Message ID | 1477083962-9894-1-git-send-email-tuliom@linux.vnet.ibm.com |
---|---|
State | Committed |
Headers |
Received: (qmail 97443 invoked by alias); 21 Oct 2016 21:06:32 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 97376 invoked by uid 89); 21 Oct 2016 21:06:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RCVD_IN_SEMBACKSCATTER autolearn=no version=3.3.2 spammy=Hx-languages-length:948 X-HELO: mx0a-001b2d01.pphosted.com From: "Tulio Magno Quites Machado Filho" <tuliom@linux.vnet.ibm.com> To: libc-alpha@sourceware.org Subject: [PATCH] powerpc: Fix TOC stub on powerpc64 clone() Date: Fri, 21 Oct 2016 19:06:02 -0200 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16102121-0020-0000-0000-00000254BA29 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16102121-0021-0000-0000-0000305E4FFD Message-Id: <1477083962-9894-1-git-send-email-tuliom@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-21_12:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610210374 |
Commit Message
Tulio Magno Quites Machado Filho
Oct. 21, 2016, 9:06 p.m. UTC
Use a function call to _exit() so that the linker can create a TOC stub instead of just a branch. 2016-10-21 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> [BZ #20728] * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Replace a branch to _exit() by a function call. --- sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
LGTM, it follows what GCC generated for non retur functions. I am assuming you actually tested on powerpc64. On 21/10/2016 19:06, Tulio Magno Quites Machado Filho wrote: > Use a function call to _exit() so that the linker can create a TOC stub > instead of just a branch. > > 2016-10-21 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> > > [BZ #20728] > * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Replace a > branch to _exit() by a function call. > --- > sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S > index 7c59b9b..df824f5 100644 > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S > @@ -97,7 +97,7 @@ L(oldpid): > #ifdef SHARED > b JUMPTARGET(__GI__exit) > #else > - b JUMPTARGET(_exit) > + bl JUMPTARGET(_exit) > /* We won't ever get here but provide a nop so that the linker > will insert a toc adjusting stub if necessary. */ > nop >
On 10/21/2016 05:06 PM, Tulio Magno Quites Machado Filho wrote: > Use a function call to _exit() so that the linker can create a TOC stub > instead of just a branch. > > 2016-10-21 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> > > [BZ #20728] > * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Replace a > branch to _exit() by a function call. > --- > sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S > index 7c59b9b..df824f5 100644 > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S > @@ -97,7 +97,7 @@ L(oldpid): > #ifdef SHARED > b JUMPTARGET(__GI__exit) > #else > - b JUMPTARGET(_exit) > + bl JUMPTARGET(_exit) > /* We won't ever get here but provide a nop so that the linker > will insert a toc adjusting stub if necessary. */ > nop I agree with Adhemerval that this _looks_ good, but you'd have to claim it works _and_ review the final linked code generated by the static linker.
Carlos O'Donell <carlos@redhat.com> writes: > I agree with Adhemerval that this _looks_ good, but you'd have to claim > it works _and_ review the final linked code generated by the static linker. Yes, I managed to validate this on powerpc64. I'll reword my commit message to mention this and will commit it to master. Thank you Adhemerval and Carlos,
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S index 7c59b9b..df824f5 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S @@ -97,7 +97,7 @@ L(oldpid): #ifdef SHARED b JUMPTARGET(__GI__exit) #else - b JUMPTARGET(_exit) + bl JUMPTARGET(_exit) /* We won't ever get here but provide a nop so that the linker will insert a toc adjusting stub if necessary. */ nop