summaryrefslogtreecommitdiff
path: root/devel/linuxthreads
diff options
context:
space:
mode:
authorTor Egge <tegge@FreeBSD.org>2001-02-26 14:15:28 +0000
committerTor Egge <tegge@FreeBSD.org>2001-02-26 14:15:28 +0000
commit5f887dac56d5f351b43215f090e8158de2716e2b (patch)
treeb9ea7e5bd3246ea4910c193fe8199e8077c493d0 /devel/linuxthreads
parentUse __error() from liblthread instead of the libc version. (diff)
Calling the libc .cerror from outside libc doesn't work when libc
is a shared library. Use a copy of .cerror to avoid this problem. PR: 24845
Diffstat (limited to 'devel/linuxthreads')
-rw-r--r--devel/linuxthreads/files/clone.S17
1 files changed, 15 insertions, 2 deletions
diff --git a/devel/linuxthreads/files/clone.S b/devel/linuxthreads/files/clone.S
index 7a868b2becc5..50ded5356a1e 100644
--- a/devel/linuxthreads/files/clone.S
+++ b/devel/linuxthreads/files/clone.S
@@ -32,6 +32,7 @@ ENTRY(_clone)
pushl %ebp
movl %esp, %ebp
pushl %esi
+ PIC_PROLOGUE
/*
* Push thread info onto the new thread's stack
@@ -51,7 +52,7 @@ ENTRY(_clone)
* Prepare and execute rfork
*/
pushl 16(%ebp)
- pushl %esi
+ pushl $0 /* fake return address */
leal SYS_rfork, %eax
KERNCALL
@@ -64,6 +65,7 @@ ENTRY(_clone)
cmpl $0, %edx
jnz 1f
addl $8, %esp
+ PIC_EPILOGUE
popl %esi
movl %ebp, %esp
popl %ebp
@@ -101,10 +103,21 @@ ENTRY(_clone)
.stabd 68,0,5
2: addl $8, %esp
+ PIC_EPILOGUE
popl %esi
movl %ebp, %esp
popl %ebp
- jmp PIC_PLT(HIDENAME(cerror))
+ PIC_PROLOGUE
+ /* Copy of libc .cerror since libc .cerror must be called from libc */
+ pushl %eax
+ /* The caller must execute the PIC prologue before jumping to cerror. */
+ call PIC_PLT(CNAME(__error))
+ popl %ecx
+ PIC_EPILOGUE
+ movl %ecx,(%eax)
+ movl $-1,%eax
+ movl $-1,%edx
+ ret
.stabs "_clone:f67",36,0,6,CNAME(_clone)
Lfe1: