diff mbox

[5/6,BZ,#18822] Call __setcontext with HIDDEN_JUMPTARGET

Message ID 20150814121835.GE28610@gmail.com
State New
Headers show

Commit Message

H.J. Lu Aug. 14, 2015, 12:18 p.m. UTC
i386 __makecontext should call __setcontext with HIDDEN_JUMPTARGET.

OK for master?

	[BZ #18822]
	* sysdeps/unix/sysv/linux/i386/makecontext.S (__makecontext):
	Don't load %ebx when calling __setcontext.  Call __setcontext
	with HIDDEN_JUMPTARGET.
	* sysdeps/unix/sysv/linux/i386/setcontext.S (__setcontext): Add
	libc_hidden_def.
---
 sysdeps/unix/sysv/linux/i386/makecontext.S | 7 +------
 sysdeps/unix/sysv/linux/i386/setcontext.S  | 1 +
 2 files changed, 2 insertions(+), 6 deletions(-)

Comments

Ondřej Bílka Aug. 19, 2015, 6:02 a.m. UTC | #1
On Fri, Aug 14, 2015 at 05:18:35AM -0700, H.J. Lu wrote:
> i386 __makecontext should call __setcontext with HIDDEN_JUMPTARGET.
> 
also ok.
diff mbox

Patch

diff --git a/sysdeps/unix/sysv/linux/i386/makecontext.S b/sysdeps/unix/sysv/linux/i386/makecontext.S
index bcf8de6..fd1abf8 100644
--- a/sysdeps/unix/sysv/linux/i386/makecontext.S
+++ b/sysdeps/unix/sysv/linux/i386/makecontext.S
@@ -102,15 +102,10 @@  L(exitcode):
 	   parameters (see above).  */
 	leal	(%esp,%ebx,4), %esp
 
-#ifdef	PIC
-	call	1f
-1:	popl	%ebx
-	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
-#endif
 	cmpl	$0, (%esp)		/* Check the next context.  */
 	je	2f			/* If it is zero exit.  */
 
-	call	JUMPTARGET(__setcontext)
+	call	HIDDEN_JUMPTARGET(__setcontext)
 	/* If this returns (which can happen if the syscall fails) we'll
 	   exit the program with the return error value (-1).  */
 
diff --git a/sysdeps/unix/sysv/linux/i386/setcontext.S b/sysdeps/unix/sysv/linux/i386/setcontext.S
index 13609b0..75b4447 100644
--- a/sysdeps/unix/sysv/linux/i386/setcontext.S
+++ b/sysdeps/unix/sysv/linux/i386/setcontext.S
@@ -91,5 +91,6 @@  ENTRY(__setcontext)
 
 	ret
 PSEUDO_END(__setcontext)
+libc_hidden_def (__setcontext)
 
 weak_alias (__setcontext, setcontext)