diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386')
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/i686/sysdep.h | 52 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/sysdep.h | 42 |
2 files changed, 83 insertions, 11 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/i686/sysdep.h b/sysdeps/unix/sysv/linux/i386/i686/sysdep.h index 8e7e5e0420..6b54a81d32 100644 --- a/sysdeps/unix/sysv/linux/i386/i686/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/i686/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper, <drepper@cygnus.com>, 1998. @@ -32,11 +32,30 @@ /* Store (- %eax) into errno through the GOT. */ # ifdef _LIBC_REENTRANT -# define SYSCALL_ERROR_HANDLER \ -1:movl (%esp),%ebx; \ + +# ifndef HAVE_HIDDEN +# define SETUP_PIC_REG \ + call 1f; \ + .subsection 1; \ +1:movl (%esp), %ebx; \ + ret; \ + .previous +# else +# define SETUP_PIC_REG \ + .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits; \ + .globl __i686.get_pc_thunk.bx; \ + .hidden __i686.get_pc_thunk.bx; \ + .type __i686.get_pc_thunk.bx,@function; \ +__i686.get_pc_thunk.bx: \ + movl (%esp), %ebx; \ ret; \ + .previous; \ + call __i686.get_pc_thunk.bx +# endif + +# define SYSCALL_ERROR_HANDLER \ 0:pushl %ebx; \ - call 1b; \ + SETUP_PIC_REG; \ addl $_GLOBAL_OFFSET_TABLE_, %ebx; \ xorl %edx, %edx; \ subl %eax, %edx; \ @@ -52,10 +71,29 @@ /* A quick note: it is assumed that the call to `__errno_location' does not modify the stack! */ # else -# define SYSCALL_ERROR_HANDLER \ -1:movl (%esp),%ecx; \ + +# ifndef HAVE_HIDDEN +# define SETUP_PIC_REG \ + call 1f; \ + .subsection 1; \ +1:movl (%esp), %ecx; \ + ret; \ + .previous +# else +# define SETUP_PIC_REG \ + .section .gnu.linkonce.t.__i686.get_pc_thunk.cx,"ax",@progbits; \ + .globl __i686.get_pc_thunk.cx; \ + .hidden __i686.get_pc_thunk.cx; \ + .type __i686.get_pc_thunk.cx,@function; \ +__i686.get_pc_thunk.cx: \ + movl (%esp), %ecx; \ ret; \ -0:call 1b; \ + .previous; \ + call __i686.get_pc_thunk.cx +# endif + +# define SYSCALL_ERROR_HANDLER \ +0:SETUP_PIC_REG; \ addl $_GLOBAL_OFFSET_TABLE_, %ecx; \ xorl %edx, %edx; \ subl %eax, %edx; \ diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h index 2cc39d69cd..730c4dfdf9 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -76,13 +76,30 @@ #else /* Store (- %eax) into errno through the GOT. */ #ifdef _LIBC_REENTRANT -#define SYSCALL_ERROR_HANDLER \ -0:pushl %ebx; \ + +# ifndef HAVE_HIDDEN +# define SETUP_PIC_REG \ call 1f; \ .subsection 1; \ 1:movl (%esp), %ebx; \ ret; \ + .previous +# else +# define SETUP_PIC_REG \ + .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits; \ + .globl __i686.get_pc_thunk.bx; \ + .hidden __i686.get_pc_thunk.bx; \ + .type __i686.get_pc_thunk.bx,@function; \ +__i686.get_pc_thunk.bx: \ + movl (%esp), %ebx; \ + ret; \ .previous; \ + call __i686.get_pc_thunk.bx +# endif + +#define SYSCALL_ERROR_HANDLER \ +0:pushl %ebx; \ + SETUP_PIC_REG; \ addl $_GLOBAL_OFFSET_TABLE_, %ebx; \ xorl %edx, %edx; \ subl %eax, %edx; \ @@ -98,12 +115,29 @@ /* A quick note: it is assumed that the call to `__errno_location' does not modify the stack! */ #else -#define SYSCALL_ERROR_HANDLER \ -0:call 1f; \ + +# ifndef HAVE_HIDDEN +# define SETUP_PIC_REG \ + call 1f; \ .subsection 1; \ 1:movl (%esp), %ecx; \ ret; \ + .previous +# else +# define SETUP_PIC_REG \ + .section .gnu.linkonce.t.__i686.get_pc_thunk.cx,"ax",@progbits; \ + .globl __i686.get_pc_thunk.cx; \ + .hidden __i686.get_pc_thunk.cx; \ + .type __i686.get_pc_thunk.cx,@function; \ +__i686.get_pc_thunk.cx: \ + movl (%esp), %ecx; \ + ret; \ .previous; \ + call __i686.get_pc_thunk.cx +# endif + +#define SYSCALL_ERROR_HANDLER \ +0:define SETUP_PIC_REG; \ addl $_GLOBAL_OFFSET_TABLE_, %ecx; \ xorl %edx, %edx; \ subl %eax, %edx; \ |