summaryrefslogtreecommitdiffstats
path: root/lib/libc/i386/sys/ptrace.S
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-05-05 07:56:21 +0000
committerpeter <peter@FreeBSD.org>1996-05-05 07:56:21 +0000
commit4b7195c99191637bf59fd4ad626297296bf3610f (patch)
treebea8a07c70223c0e39939063c6dbbdf8eb9d0f17 /lib/libc/i386/sys/ptrace.S
parent93f1aa601a7bda9bd9b83bf5098c3f05f6edd744 (diff)
downloadFreeBSD-src-4b7195c99191637bf59fd4ad626297296bf3610f.zip
FreeBSD-src-4b7195c99191637bf59fd4ad626297296bf3610f.tar.gz
Add support to enable libc to be compiled in ELF format. (#ifdef __ELF__)
In a nutshell, this macroizes the local/global symbol scoping rules that are different in a.out and ELF. It also makes the i386 assembler stubs conform to i386 PIC calling conventions - the a.out ld.so didn't object, but the ELF one needs it as it implements PIC jumps via PLT's as well as calls. The a.out rtld only worked because it was accidently snooping the grandparent calling function's return address off the stack.. This also affects the libc_r code a little, because of cpp macro nesting.
Diffstat (limited to 'lib/libc/i386/sys/ptrace.S')
-rw-r--r--lib/libc/i386/sys/ptrace.S13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/libc/i386/sys/ptrace.S b/lib/libc/i386/sys/ptrace.S
index e3ac3a5..993c9be 100644
--- a/lib/libc/i386/sys/ptrace.S
+++ b/lib/libc/i386/sys/ptrace.S
@@ -33,12 +33,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ptrace.S,v 1.1 1994/08/05 01:18:47 wollman Exp $
+ * $Id: ptrace.S,v 1.2 1995/01/23 01:29:59 davidg Exp $
*/
#if defined(SYSLIBC_RCS) && !defined(lint)
.text
- .asciz "$Id$"
+ .asciz "$Id: ptrace.S,v 1.2 1995/01/23 01:29:59 davidg Exp $"
#endif /* SYSLIBC_RCS and not lint */
#include "SYS.h"
@@ -47,15 +47,16 @@ ENTRY(ptrace)
xorl %eax,%eax
#ifdef PIC
PIC_PROLOGUE
- movl PIC_GOT(_errno),%edx
+ movl PIC_GOT(CNAME(errno)),%edx
movl %eax,(%edx)
PIC_EPILOGUE
#else
- movl %eax,_errno
+ movl %eax,CNAME(errno)
#endif
lea SYS_ptrace,%eax
- LCALL(7,0)
+ KERNCALL
jb err
ret
err:
- jmp cerror
+ PIC_PROLOGUE
+ jmp PIC_PLT(HIDENAME(cerror))
OpenPOWER on IntegriCloud