Creating weak symbols doesn't work correctly when building an aout libc.

Doing the "right thing" here is difficult, so create two ENTRY points for
each function (for example, __setjmp and setjmp are equivalent).  This
isn't pretty, but it works for both aout and ELF.

libc symbol naming needs an overhaul in order to properly support function
wrapping, specifically in the case of a real libpthread, and these
duplicate entry points should be fixed as part of that overhaul.

Pointed out by:	bde
This commit is contained in:
Jason Evans 1999-12-24 00:03:00 +00:00
parent a9d61af021
commit ec9d5fa5f8
4 changed files with 8 additions and 16 deletions

View File

@ -55,8 +55,7 @@
#include "SYS.h" #include "SYS.h"
ENTRY(__setjmp) ENTRY(__setjmp)
.weak setjmp; ENTRY(setjmp)
.set setjmp, __setjmp;
movl 4(%esp),%ecx movl 4(%esp),%ecx
PIC_PROLOGUE PIC_PROLOGUE
leal 28(%ecx), %eax leal 28(%ecx), %eax
@ -83,8 +82,7 @@ ENTRY(__setjmp)
ret ret
ENTRY(__longjmp) ENTRY(__longjmp)
.weak longjmp; ENTRY(longjmp)
.set longjmp, __longjmp;
movl 4(%esp),%edx movl 4(%esp),%edx
PIC_PROLOGUE PIC_PROLOGUE
pushl $0 /* (sigset_t*)oset */ pushl $0 /* (sigset_t*)oset */

View File

@ -60,8 +60,7 @@
*/ */
ENTRY(__sigsetjmp) ENTRY(__sigsetjmp)
.weak sigsetjmp; ENTRY(sigsetjmp)
.set sigsetjmp, __sigsetjmp;
movl 8(%esp),%eax movl 8(%esp),%eax
movl 4(%esp),%ecx movl 4(%esp),%ecx
movl %eax,44(%ecx) movl %eax,44(%ecx)
@ -92,8 +91,7 @@ ENTRY(__sigsetjmp)
ret ret
ENTRY(__siglongjmp) ENTRY(__siglongjmp)
.weak siglongjmp; ENTRY(siglongjmp)
.set siglongjmp, __siglongjmp;
movl 4(%esp),%edx movl 4(%esp),%edx
cmpl $0,44(%edx) cmpl $0,44(%edx)
jz 2f jz 2f

View File

@ -55,8 +55,7 @@
#include "SYS.h" #include "SYS.h"
ENTRY(__setjmp) ENTRY(__setjmp)
.weak setjmp; ENTRY(setjmp)
.set setjmp, __setjmp;
movl 4(%esp),%ecx movl 4(%esp),%ecx
PIC_PROLOGUE PIC_PROLOGUE
leal 28(%ecx), %eax leal 28(%ecx), %eax
@ -83,8 +82,7 @@ ENTRY(__setjmp)
ret ret
ENTRY(__longjmp) ENTRY(__longjmp)
.weak longjmp; ENTRY(longjmp)
.set longjmp, __longjmp;
movl 4(%esp),%edx movl 4(%esp),%edx
PIC_PROLOGUE PIC_PROLOGUE
pushl $0 /* (sigset_t*)oset */ pushl $0 /* (sigset_t*)oset */

View File

@ -60,8 +60,7 @@
*/ */
ENTRY(__sigsetjmp) ENTRY(__sigsetjmp)
.weak sigsetjmp; ENTRY(sigsetjmp)
.set sigsetjmp, __sigsetjmp;
movl 8(%esp),%eax movl 8(%esp),%eax
movl 4(%esp),%ecx movl 4(%esp),%ecx
movl %eax,44(%ecx) movl %eax,44(%ecx)
@ -92,8 +91,7 @@ ENTRY(__sigsetjmp)
ret ret
ENTRY(__siglongjmp) ENTRY(__siglongjmp)
.weak siglongjmp; ENTRY(siglongjmp)
.set siglongjmp, __siglongjmp;
movl 4(%esp),%edx movl 4(%esp),%edx
cmpl $0,44(%edx) cmpl $0,44(%edx)
jz 2f jz 2f