about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/i386/sysdep.h
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-10-25 02:19:39 +0000
committerRoland McGrath <roland@gnu.org>1995-10-25 02:19:39 +0000
commit03a75825763563a80bb35d89688d8b0d451e11f2 (patch)
tree086c5a961b1cfbcd381342f66f5306fcbfd2bbe9 /sysdeps/unix/sysv/linux/i386/sysdep.h
parente97ec51d01087c2f8468a1bf83cfdb26b7040c30 (diff)
downloadglibc-03a75825763563a80bb35d89688d8b0d451e11f2.tar.gz
glibc-03a75825763563a80bb35d89688d8b0d451e11f2.tar.xz
glibc-03a75825763563a80bb35d89688d8b0d451e11f2.zip
* sysdeps/unix/sysv/linux/i386/sysdep.h (SYSCALL_ERROR_HANDLER):
	New macro.
	(PSEUDO): Use it instead of SYSCALL_PIC_SETUP and jmp syscall_error.

	* sysdeps/unix/sysv/linux/i386/sysdep.S (__syscall_error): Define
	only #ifndef PIC.

	* Makeconfig (built-program-cmd): New variable.
	* sunrpc/Makefile (rpcgen-cmd): Use $(built-program-cmd).
	* time/Makefile (zic-cmd): Likewise.

	* hurd/Makefile (user-interfaces): Add hurd/exec_startup.
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386/sysdep.h')
-rw-r--r--sysdeps/unix/sysv/linux/i386/sysdep.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
index ccb484664f..7bd910e534 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -42,16 +42,31 @@ Cambridge, MA 02139, USA.  */
 #undef	PSEUDO
 #define	PSEUDO(name, syscall_name, args)				      \
   .text;								      \
- lose: SYSCALL_PIC_SETUP						      \
-    jmp JUMPTARGET (syscall_error)					      \
-  .globl syscall_error;							      \
+  SYSCALL_ERROR_HANDLER							      \
   ENTRY (name)								      \
     movl $SYS_ify (syscall_name), %eax;					      \
     DO_CALL (args);							      \
     testl %eax, %eax;							      \
-    jl lose
+    jl syscall_error;
 
-/* We define our own ENTRY macro because the alignment should be 16 for ELF.  */
+#ifndef	PIC
+#define SYSCALL_ERROR_HANDLER	/* Nothing here; code in sysdep.S is used.  */
+#else
+/* Store (- %eax) into errno through the GOT.  */
+#define SYSCALL_ERROR_HANDLER						      \
+syscall_error:								      \
+  call 0f;								      \
+0:popl %ecx;								      \
+  negl %eax;								      \
+  addl $_GLOBAL_OFFSET_TABLE_+[.-0b], %ecx;				      \
+  movl errno@GOT(%ecx), %ecx;						      \
+  movl %eax, (%ecx);							      \
+  movl $-1, %eax;							      \
+  ret
+#endif
+
+/* We define our own ENTRY macro because the alignment should be 16 for
+   ELF.  */
 #undef ENTRY
 #define ENTRY(name)							      \
   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (name);				      \
@@ -81,7 +96,7 @@ Cambridge, MA 02139, USA.  */
    arguments 4 and 5.)
 
    The following code tries hard to be optimal.  A general assuption
-   (which is true accoriding to the data books I have) is that
+   (which is true according to the data books I have) is that
 
 	2 * xchg	is more expensive than	pushl + movl + popl