Rewrite PSEUDO etc to make syscall_error label in case of PIC
authordrepper <drepper>
Sun, 7 Jun 1998 14:04:12 +0000 (14:04 +0000)
committerdrepper <drepper>
Sun, 7 Jun 1998 14:04:12 +0000 (14:04 +0000)
anonymous.

sysdeps/unix/sysv/linux/i386/i686/sysdep.h
sysdeps/unix/sysv/linux/i386/sysdep.h

index 001f3fc..3f1391f 100644 (file)
 /* Store (- %eax) into errno through the GOT.  */
 # ifdef _LIBC_REENTRANT
 #  define SYSCALL_ERROR_HANDLER                                                      \
-  .type syscall_error,@function;                                             \
-0:movl (%esp),%ebx;                                                          \
+1:movl (%esp),%ebx;                                                          \
   ret;                                                                       \
-syscall_error:                                                               \
-  pushl %ebx;                                                                \
-  call 0b;                                                                   \
+0:pushl %ebx;                                                                \
+  call 1b;                                                                   \
   addl $_GLOBAL_OFFSET_TABLE_, %ebx;                                         \
   xorl %edx, %edx;                                                           \
   subl %eax, %edx;                                                           \
@@ -46,25 +44,22 @@ syscall_error:                                                                    \
   popl %ebx;                                                                 \
   movl %ecx, (%eax);                                                         \
   movl $-1, %eax;                                                            \
-  jmp L(pseudo_end);                                                         \
-  .size syscall_error,.-syscall_error;
+  jmp L(pseudo_end);
 /* A quick note: it is assumed that the call to `__errno_location' does
    not modify the stack!  */
 # else
 #  define SYSCALL_ERROR_HANDLER                                                      \
   .type syscall_error,@function;                                             \
-0:movl (%esp),%ecx;                                                          \
+1:movl (%esp),%ecx;                                                          \
   ret;                                                                       \
-syscall_error:                                                               \
-  call 0b;                                                                   \
+0:call 1b;                                                                   \
   addl $_GLOBAL_OFFSET_TABLE_, %ecx;                                         \
   xorl %edx, %edx;                                                           \
   subl %eax, %edx;                                                           \
   movl errno@GOT(%ecx), %ecx;                                                \
   movl %edx, (%ecx);                                                         \
   movl $-1, %eax;                                                            \
-  jmp L(pseudo_end);                                                         \
-  .size syscall_error,.-syscall_error;
+  jmp L(pseudo_end);
 # endif        /* _LIBC_REENTRANT */
 #endif /* PIC */
 
index 5231d3e..8c046ef 100644 (file)
    is a real error number.  Linus said he will make sure the no syscall
    returns a value in -1 .. -4095 as a valid result so we can savely
    test with -4095.  */
+
+/* We don't want the label for the error handle to be global when we define
+   it here.  */
+#ifdef PIC
+# define SYSCALL_ERROR_LABEL 0f
+#else
+# define SYSCALL_ERROR_LABEL syscall_error
+#endif
+
 #undef PSEUDO
 #define        PSEUDO(name, syscall_name, args)                                      \
   .text;                                                                     \
   ENTRY (name)                                                               \
     DO_CALL (args, syscall_name);                                            \
     cmpl $-4095, %eax;                                                       \
-    jae syscall_error;                                                       \
+    jae SYSCALL_ERROR_LABEL;                                                 \
   L(pseudo_end):
 
 #undef PSEUDO_END
 /* Store (- %eax) into errno through the GOT.  */
 #ifdef _LIBC_REENTRANT
 #define SYSCALL_ERROR_HANDLER                                                \
-  .type syscall_error,@function;                                             \
-syscall_error:                                                               \
-  pushl %ebx;                                                                \
-  call 0f;                                                                   \
-0:popl %ebx;                                                                 \
+0:pushl %ebx;                                                                \
+  call 1f;                                                                   \
+1:popl %ebx;                                                                 \
   xorl %edx, %edx;                                                           \
-  addl $_GLOBAL_OFFSET_TABLE_+[.-0b], %ebx;                                  \
+  addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx;                                  \
   subl %eax, %edx;                                                           \
   pushl %edx;                                                                \
   call __errno_location@PLT;                                                 \
@@ -80,24 +87,20 @@ syscall_error:                                                                    \
   popl %ebx;                                                                 \
   movl %ecx, (%eax);                                                         \
   movl $-1, %eax;                                                            \
-  jmp L(pseudo_end);                                                         \
-  .size syscall_error,.-syscall_error;
+  jmp L(pseudo_end);
 /* A quick note: it is assumed that the call to `__errno_location' does
    not modify the stack!  */
 #else
 #define SYSCALL_ERROR_HANDLER                                                \
-  .type syscall_error,@function;                                             \
-syscall_error:                                                               \
-  call 0f;                                                                   \
-0:popl %ecx;                                                                 \
+0:call 1f;                                                                   \
+1:popl %ecx;                                                                 \
   xorl %edx, %edx;                                                           \
-  addl $_GLOBAL_OFFSET_TABLE_+[.-0b], %ecx;                                  \
+  addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx;                                  \
   subl %eax, %edx;                                                           \
   movl errno@GOT(%ecx), %ecx;                                                \
   movl %edx, (%ecx);                                                         \
   movl $-1, %eax;                                                            \
-  jmp L(pseudo_end);                                                         \
-  .size syscall_error,.-syscall_error;
+  jmp L(pseudo_end);
 #endif /* _LIBC_REENTRANT */
 #endif /* PIC */