public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Fix TOC stub on powerpc64 clone()
@ 2016-10-21 21:06 Tulio Magno Quites Machado Filho
  2016-10-21 21:49 ` Adhemerval Zanella
  2016-10-28 11:58 ` Carlos O'Donell
  0 siblings, 2 replies; 4+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2016-10-21 21:06 UTC (permalink / raw)
  To: libc-alpha

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
-- 
2.1.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: Fix TOC stub on powerpc64 clone()
  2016-10-21 21:06 [PATCH] powerpc: Fix TOC stub on powerpc64 clone() Tulio Magno Quites Machado Filho
@ 2016-10-21 21:49 ` Adhemerval Zanella
  2016-10-28 11:58 ` Carlos O'Donell
  1 sibling, 0 replies; 4+ messages in thread
From: Adhemerval Zanella @ 2016-10-21 21:49 UTC (permalink / raw)
  To: libc-alpha

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
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: Fix TOC stub on powerpc64 clone()
  2016-10-21 21:06 [PATCH] powerpc: Fix TOC stub on powerpc64 clone() Tulio Magno Quites Machado Filho
  2016-10-21 21:49 ` Adhemerval Zanella
@ 2016-10-28 11:58 ` Carlos O'Donell
  2016-10-28 20:17   ` Tulio Magno Quites Machado Filho
  1 sibling, 1 reply; 4+ messages in thread
From: Carlos O'Donell @ 2016-10-28 11:58 UTC (permalink / raw)
  To: Tulio Magno Quites Machado Filho, libc-alpha

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.

-- 
Cheers,
Carlos.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: Fix TOC stub on powerpc64 clone()
  2016-10-28 11:58 ` Carlos O'Donell
@ 2016-10-28 20:17   ` Tulio Magno Quites Machado Filho
  0 siblings, 0 replies; 4+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2016-10-28 20:17 UTC (permalink / raw)
  To: Adhemerval Zanella, Carlos O'Donell, libc-alpha

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,

-- 
Tulio Magno

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-28 20:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-21 21:06 [PATCH] powerpc: Fix TOC stub on powerpc64 clone() Tulio Magno Quites Machado Filho
2016-10-21 21:49 ` Adhemerval Zanella
2016-10-28 11:58 ` Carlos O'Donell
2016-10-28 20:17   ` Tulio Magno Quites Machado Filho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).