[git commit] x86_64: add PLT bypass for __sigsetjmp

Mike Frysinger vapier at gentoo.org
Sat Dec 3 17:55:45 UTC 2011


commit: http://git.uclibc.org/uClibc/commit/?id=09dfeda9cf5a1bd1bd89180308ce923cc4c5f9b0
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

The current x86_64 setjmp helpers incur a reloc, so fix that up.

$ readelf -r lib/libc.so.0
...
Relocation section '.rela.plt' at offset 0xb058 contains 10 entries:
  Offset          Info           Type           Sym. Value    Sym. Name + Addend
000000236010  02a400000007 R_X86_64_JUMP_SLO 000000000000b3c4 __sigsetjmp + 0
...

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 libc/sysdeps/linux/x86_64/bsd-_setjmp.S |    4 +++-
 libc/sysdeps/linux/x86_64/bsd-setjmp.S  |    3 ++-
 libc/sysdeps/linux/x86_64/setjmp.S      |    2 ++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libc/sysdeps/linux/x86_64/bsd-_setjmp.S b/libc/sysdeps/linux/x86_64/bsd-_setjmp.S
index 81a4352..8b68ff2 100644
--- a/libc/sysdeps/linux/x86_64/bsd-_setjmp.S
+++ b/libc/sysdeps/linux/x86_64/bsd-_setjmp.S
@@ -21,9 +21,11 @@
    We cannot do it in C because it must be a tail-call, so frame-unwinding
    in setjmp doesn't clobber the state restored by longjmp.  */
 
+#include <sysdep.h>
+
 .global _setjmp
 .type   _setjmp,%function
 _setjmp:
 	xorq %rsi, %rsi
-	jmp __sigsetjmp at PLT
+	jmp HIDDEN_JUMPTARGET(__sigsetjmp)
 .size _setjmp,.-_setjmp
diff --git a/libc/sysdeps/linux/x86_64/bsd-setjmp.S b/libc/sysdeps/linux/x86_64/bsd-setjmp.S
index a906a61..889efa6 100644
--- a/libc/sysdeps/linux/x86_64/bsd-setjmp.S
+++ b/libc/sysdeps/linux/x86_64/bsd-setjmp.S
@@ -20,10 +20,11 @@
 #define _ASM
 #define _SETJMP_H
 #include <bits/setjmp.h>
+#include <sysdep.h>
 
 .global setjmp
 .type   setjmp,%function
 setjmp:
 	movq $1, %rsi
-	jmp __sigsetjmp at PLT
+	jmp HIDDEN_JUMPTARGET(__sigsetjmp)
 .size setjmp,.-setjmp
diff --git a/libc/sysdeps/linux/x86_64/setjmp.S b/libc/sysdeps/linux/x86_64/setjmp.S
index eb4b973..3a0f30b 100644
--- a/libc/sysdeps/linux/x86_64/setjmp.S
+++ b/libc/sysdeps/linux/x86_64/setjmp.S
@@ -20,6 +20,7 @@
 #define _ASM
 #define _SETJMP_H
 #include <bits/setjmp.h>
+#include <sysdep.h>
 
 .global __sigsetjmp
 .type   __sigsetjmp,%function
@@ -43,3 +44,4 @@ __sigsetjmp:
 	jmp __sigjmp_save
 #endif
 .size __sigsetjmp,.-__sigsetjmp
+libc_hidden_def(__sigsetjmp)


More information about the uClibc-cvs mailing list