summaryrefslogtreecommitdiffstats
path: root/lib/libc/i386
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-08-29 14:25:01 +0000
committerkib <kib@FreeBSD.org>2015-08-29 14:25:01 +0000
commit146b187d13b83615f02a68c038af82670588495f (patch)
treeadcae95aa50cd2cbf281d867115b7156006965ea /lib/libc/i386
parent8cde3bfeee04d11f30244c875082f0c8423cbcd8 (diff)
downloadFreeBSD-src-146b187d13b83615f02a68c038af82670588495f.zip
FreeBSD-src-146b187d13b83615f02a68c038af82670588495f.tar.gz
Switch libc from using _sig{procmask,action,suspend} symbols, which
are aliases for the syscall stubs and are plt-interposed, to the libc-private aliases of internally interposed sigprocmask() etc. Since e.g. _sigaction is not interposed by libthr, calling signal() removes thr_sighandler() from the handler slot etc. The result was breaking signal semantic and rtld locking. The added __libc_sigprocmask and other symbols are hidden, they are not exported and cannot be called through PLT. The setjmp/longjmp functions for x86 were changed to use direct calls, and since PIC_PROLOGUE only needed for functional PLT indirection on i386, it is removed as well. The PowerPC bug of calling the syscall directly in the setjmp/longjmp implementation is kept as is. Reported by: Pete French <petefrench@ingresso.co.uk> Tested by: Michiel Boland <boland37@xs4all.nl> Reviewed by: jilles (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week
Diffstat (limited to 'lib/libc/i386')
-rw-r--r--lib/libc/i386/gen/setjmp.S22
-rw-r--r--lib/libc/i386/gen/sigsetjmp.S22
2 files changed, 4 insertions, 40 deletions
diff --git a/lib/libc/i386/gen/setjmp.S b/lib/libc/i386/gen/setjmp.S
index 6e15868..eb33e10 100644
--- a/lib/libc/i386/gen/setjmp.S
+++ b/lib/libc/i386/gen/setjmp.S
@@ -50,21 +50,12 @@ __FBSDID("$FreeBSD$");
ENTRY(setjmp)
movl 4(%esp),%ecx
- PIC_PROLOGUE
-#ifdef PIC
- subl $12,%esp /* make the stack 16-byte aligned */
-#endif
leal 28(%ecx), %eax
pushl %eax /* (sigset_t*)oset */
pushl $0 /* (sigset_t*)set */
pushl $1 /* SIG_BLOCK */
- call PIC_PLT(CNAME(_sigprocmask))
-#ifdef PIC
- addl $24,%esp
-#else
+ call __libc_sigprocmask
addl $12,%esp
-#endif
- PIC_EPILOGUE
movl 4(%esp),%ecx
movl 0(%esp),%edx
movl %edx, 0(%ecx)
@@ -81,21 +72,12 @@ END(setjmp)
WEAK_REFERENCE(__longjmp, longjmp)
ENTRY(__longjmp)
movl 4(%esp),%edx
- PIC_PROLOGUE
-#ifdef PIC
- subl $12,%esp /* make the stack 16-byte aligned */
-#endif
pushl $0 /* (sigset_t*)oset */
leal 28(%edx), %eax
pushl %eax /* (sigset_t*)set */
pushl $3 /* SIG_SETMASK */
- call PIC_PLT(CNAME(_sigprocmask))
-#ifdef PIC
- addl $24,%esp
-#else
+ call __libc_sigprocmask
addl $12,%esp
-#endif
- PIC_EPILOGUE
movl 4(%esp),%edx
movl 8(%esp),%eax
movl 0(%edx),%ecx
diff --git a/lib/libc/i386/gen/sigsetjmp.S b/lib/libc/i386/gen/sigsetjmp.S
index 1c63649..7566d72 100644
--- a/lib/libc/i386/gen/sigsetjmp.S
+++ b/lib/libc/i386/gen/sigsetjmp.S
@@ -59,21 +59,12 @@ ENTRY(sigsetjmp)
movl %eax,44(%ecx)
testl %eax,%eax
jz 2f
- PIC_PROLOGUE
-#ifdef PIC
- subl $12,%esp /* make the stack 16-byte aligned */
-#endif
leal 28(%ecx), %eax
pushl %eax /* (sigset_t*)oset */
pushl $0 /* (sigset_t*)set */
pushl $1 /* SIG_BLOCK */
- call PIC_PLT(CNAME(_sigprocmask))
-#ifdef PIC
- addl $24,%esp
-#else
+ call __libc_sigprocmask
addl $12,%esp
-#endif
- PIC_EPILOGUE
movl 4(%esp),%ecx
2: movl 0(%esp),%edx
movl %edx, 0(%ecx)
@@ -92,21 +83,12 @@ ENTRY(__siglongjmp)
movl 4(%esp),%edx
cmpl $0,44(%edx)
jz 2f
- PIC_PROLOGUE
-#ifdef PIC
- subl $12,%esp /* make the stack 16-byte aligned */
-#endif
pushl $0 /* (sigset_t*)oset */
leal 28(%edx), %eax
pushl %eax /* (sigset_t*)set */
pushl $3 /* SIG_SETMASK */
- call PIC_PLT(CNAME(_sigprocmask))
-#ifdef PIC
- addl $24,%esp
-#else
+ call __libc_sigprocmask
addl $12,%esp
-#endif
- PIC_EPILOGUE
movl 4(%esp),%edx
2: movl 8(%esp),%eax
movl 0(%edx),%ecx
OpenPOWER on IntegriCloud