From 1d234146c04ec6a6bad50e6d1bf74cf6ff189e7a Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 19 Oct 1995 02:20:22 +0000 Subject: * sysdeps/unix/sysv/linux/i386/sysdep.h (PSEUDO): Use SYSCALL_PIC_SETUP before jumping to syscall_error. * sysdeps/unix/i386/sysdep.h (SYSCALL_PIC_SETUP): New macro. (PSEUDO): Use it before jumping to syscall_error. * sysdeps/unix/i386/sysdep.S [! PIC]: Don't find GOT address; expect it in %ebx on entry. Pop old %ebx value off stack after using it. --- sysdeps/unix/i386/sysdep.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'sysdeps/unix/i386/sysdep.h') diff --git a/sysdeps/unix/i386/sysdep.h b/sysdeps/unix/i386/sysdep.h index 7fd77dd936..fb1781b156 100644 --- a/sysdeps/unix/i386/sysdep.h +++ b/sysdeps/unix/i386/sysdep.h @@ -42,15 +42,23 @@ Cambridge, MA 02139, USA. */ #endif #define PSEUDO(name, syscall_name, args) \ +lose: SYSCALL_PIC_SETUP \ + jmp JUMPTARGET(syscall_error) \ .globl syscall_error; \ ENTRY (name) \ DO_CALL (syscall_name, args); \ - jb JUMPTARGET(syscall_error) + jb lose #ifdef PIC -#define JUMPTARGET(name) name##@PLT +#define JUMPTARGET(name) name##@PLT +#define SYSCALL_PIC_SETUP \ + pushl %ebx; \ + call 0f; \ +0: popl %ebx; \ + addl $_GLOBAL_OFFSET_TABLE+[.-0b], %ebx; #else -#define JUMPTARGET(name) name +#define JUMPTARGET(name) name +#define SYSCALL_PIC_SETUP /* Nothing. */ #endif /* This is defined as a separate macro so that other sysdep.h files -- cgit 1.4.1