OSDN Git Service

Remove TEXTREL relocations for ARM.
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>
Fri, 10 Jun 2005 18:25:35 +0000 (18:25 -0000)
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>
Fri, 10 Jun 2005 18:25:35 +0000 (18:25 -0000)
Hide __syscall_error from outside libc.
From Peter Mazinger.

13 files changed:
libc/sysdeps/linux/arm/Makefile
libc/sysdeps/linux/arm/bsd-_setjmp.S
libc/sysdeps/linux/arm/bsd-setjmp.S
libc/sysdeps/linux/arm/clone.S
libc/sysdeps/linux/arm/mmap64.S
libc/sysdeps/linux/arm/setjmp.S
libc/sysdeps/linux/arm/vfork.S
libc/sysdeps/linux/mips/__syscall_error.c
libc/sysdeps/linux/powerpc/__syscall_error.c
libc/sysdeps/linux/powerpc/__uClibc_syscall.S
libc/sysdeps/linux/powerpc/brk.S
libc/sysdeps/linux/powerpc/clone.S
libc/sysdeps/linux/powerpc/syscall.S

index f25d0b5..7724530 100644 (file)
@@ -28,7 +28,7 @@ SSRC=__longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \
        bsd-_setjmp.S sigrestorer.S mmap64.S
 SOBJS=$(patsubst %.S,%.o, $(SSRC))
 
-CSRC=brk.c syscall.c ioperm.c sigaction.c
+CSRC=brk.c syscall.c ioperm.c sigaction.c __syscall_error.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(SOBJS) $(COBJS)
index 7f092c1..83cbd6e 100644 (file)
@@ -30,5 +30,9 @@
 .align 4;
 _setjmp:
        mov     r1, #0
-       b       __sigsetjmp (PLT)
+#ifdef __PIC__
+       b       __sigsetjmp(PLT)
+#else
+       b       __sigsetjmp
+#endif
 .size _setjmp,.-_setjmp;
index 16f077a..1bbddc5 100644 (file)
@@ -30,5 +30,9 @@
 .align 4;
 setjmp:
        mov     r1, #1
-       b       __sigsetjmp (PLT)
+#ifdef __PIC__
+       b       __sigsetjmp(PLT)
+#else
+       b       __sigsetjmp
+#endif
 .size setjmp,.-setjmp;
index f417be0..7b5bf2e 100644 (file)
 /* clone() is even more special than fork() as it mucks with stacks
    and invokes a function in the right context after its all over.  */
 
-#include <asm/errno.h>
+#define _ERRNO_H
+#include <bits/errno.h>
 #include <sys/syscall.h>
 
+#ifdef __NR_clone
 /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
 
-.text
-.globl __clone;
-.type __clone,%function
-.align 4;
+       .text
+       .globl __clone
+       .type __clone,%function
+       .align 4
 __clone:
        @ sanity check args
        cmp     r0, #0
        cmpne   r1, #0
        moveq   r0, #-EINVAL
-       beq     __syscall_error (PLT)
+       beq     __error
 
        @ insert the args onto the new stack
        sub     r1, r1, #8
@@ -48,7 +50,7 @@ __clone:
        @ new sp is already in r1
        swi     __NR_clone
        movs    a1, a1
-       blt     __syscall_error  (PLT)
+       blt     __error
        movne    pc, lr
 
        @ pick the function arg and call address off the stack and execute
@@ -57,25 +59,18 @@ __clone:
        ldr     pc, [sp]
 
        @ and we are done, passing the return value through r0
-       b       _exit   (PLT)
+#ifdef __PIC__
+       b       _exit(PLT)
+#else
+       b       _exit
+#endif
 
-__syscall_error:
-       /* Looks like the syscall choked -- set errno */
-       ldr  r3, .L4
-       /* Calculate the - of the syscall result, in case we need it */
-       rsb  r2, r0, $0
+__error:
+       b       __syscall_error
 
-       /* errno = -result */
-       str  r2, [r9,r3]
+       .size __clone,.-__clone
 
-       /* return -1 */
-       mvn  r0, $0
-       mov  pc, lr
-.size __clone,.-__clone;
-
-.L4:  .word errno
-
-
-.globl clone;
-    clone = __clone
+       .weak clone
+       clone = __clone
 
+#endif
index 0da4afb..310a60c 100644 (file)
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#define _ERRNO_H       1
 #include <features.h>
+#define _ERRNO_H
 #include <bits/errno.h>
 #include <sys/syscall.h>
 
 #if defined __UCLIBC_HAS_LFS__ && defined __NR_mmap2
 
-
        /* The mmap2 system call takes six arguments, all in registers.  */
        .text
-       .global mmap64;
+       .global mmap64
        .type mmap64,%function
-       .align 4;
-
+       .align 4
 mmap64:
        stmfd   sp!, {r4, r5, lr}
        ldr     r5, [sp, $16]
@@ -47,33 +45,26 @@ mmap64:
        ldmccfd sp!, {r4, r5, pc}
        cmn     r0, $ENOSYS
        ldmnefd sp!, {r4, r5, lr}
-       bne     __syscall_error (PLT)
+       bne     __error
        /* The current kernel does not support mmap2.  Fall back to plain
           mmap if the offset is small enough.  */
        ldr     r5, [sp, $20]
        mov     r0, ip                  @ first arg was clobbered
        teq     r5, $0
        ldmeqfd sp!, {r4, r5, lr}
-       beq     mmap (PLT)
+#ifdef __PIC__
+       beq     mmap(PLT)
+#else
+       beq     mmap
+#endif
 .Linval:
        mov     r0, $-EINVAL
        ldmfd   sp!, {r4, r5, lr}
-       b       __syscall_error (PLT)
-
-__syscall_error:
-       /* Looks like the syscall choked -- set errno */
-       ldr  r3, .L4
-       /* Calculate the - of the syscall result, in case we need it */
-       rsb  r2, r0, $0
-
-       /* errno = -result */
-       str  r2, [r9,r3]
+       b       __error
 
-       /* return -1 */
-       mvn  r0, $0
-       mov  pc, lr
-.size mmap64,.-mmap64;
+__error:
+       b       __syscall_error
 
-.L4:  .word errno
+       .size mmap64,.-mmap64
 
 #endif
index 402a664..47ddf4a 100644 (file)
@@ -38,5 +38,9 @@ __sigsetjmp:
        sub     r0, r0, #48
 
        /* Make a tail call to __sigjmp_save; it takes the same args.  */
-       B       __sigjmp_save   (PLT)
+#ifdef __PIC__
+       B       __sigjmp_save(PLT)
+#else
+       B       __sigjmp_save
+#endif
 .size __sigsetjmp,.-__sigsetjmp;
index 9d18945..eecf56b 100644 (file)
  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#include <asm/errno.h>
+#define _ERRNO_H
+#include <bits/errno.h>
 #include <sys/syscall.h>
 
-
-
-               .text
-               .global vfork;
-               .type vfork,%function
-               .align 4;                                                               \
-
-
-
+#ifdef __NR_fork
+       .text
+       .global vfork
+       .type vfork,%function
+       .align 4
 vfork:
 
 #ifdef __NR_vfork
-               swi             __NR_vfork
-               cmn             r0, #4096
-               movcc   pc, lr
-
-               /* Check if vfork even exists.  */
-               ldr     r1, =-ENOSYS
-               teq     r0, r1
-               bne     __syscall_error
+       swi     __NR_vfork
+       cmn     r0, #4096
+       movcc   pc, lr
+
+       /* Check if vfork even exists.  */
+       ldr     r1, =-ENOSYS
+       teq     r0, r1
+       bne     __error
 #endif
 
-               /* If we don't have vfork, use fork.  */
-               swi     __NR_fork
-               cmn     r0, #4096
+       /* If we don't have vfork, use fork.  */
+       swi     __NR_fork
+       cmn     r0, #4096
 
-               /* Syscal worked.  Return to child/parent */
-               movcc   pc, lr
-
-__syscall_error:
-
-               /* Looks like the syscall choked -- set errno */
-               ldr  r3, .L4
-               /* Calculate the - of the syscall result, in case we need it */
-               rsb  r2, r0, $0
-
-               /* errno = -result */
-               str  r2, [r9,r3]
-
-               /* return -1 */
-               mvn  r0, $0
-               mov  pc, lr
-
-.L4:  .word errno
+       /* Syscal worked.  Return to child/parent */
+       movcc   pc, lr
 
+__error:
+       b       __syscall_error
 
+       .size vfork,.-vfork
+#endif
index 9ab65ed..bb998b1 100644 (file)
@@ -21,7 +21,7 @@
 
 /* This routine is jumped to by all the syscall handlers, to stash
  * an error number into errno.  */
-int __syscall_error (int err_no)
+int attribute_hidden __syscall_error (int err_no)
 {
        __set_errno (err_no);
        return -1;
index 9ab65ed..bb998b1 100644 (file)
@@ -21,7 +21,7 @@
 
 /* This routine is jumped to by all the syscall handlers, to stash
  * an error number into errno.  */
-int __syscall_error (int err_no)
+int attribute_hidden __syscall_error (int err_no)
 {
        __set_errno (err_no);
        return -1;
index 09bfb89..5a14c94 100644 (file)
@@ -1,14 +1,12 @@
-.section ".text"
+       .text
        .align 2
-.globl __uClibc_syscall
+       .globl __uClibc_syscall
        .type   __uClibc_syscall,@function
 __uClibc_syscall:
 .Lsize:
        sc
        bnslr
-#ifdef __PIC__
-       b       __syscall_error@plt
-#else
+
        b       __syscall_error
-#endif
+
        .size   __uClibc_syscall,.Lsize-__uClibc_syscall
index b914ce8..c0b436d 100644 (file)
 
 #ifdef __NR_brk
        .comm   __curbrk,4,4
-       .section ".text"
-.globl      __brk;
-.type      __brk, @function;
-.align  2;
+       .text
+       .globl  __brk
+       .type   __brk,@function
+       .align  2
 
 __brk:
        stwu    r1,-16(r1)
@@ -51,13 +51,11 @@ __brk:
        li      r3,0
        blelr+
        li      r3,ENOMEM
-#ifdef __PIC__
-       b       __syscall_error@plt
-#else
+
        b       __syscall_error
-#endif
-.size __brk,.-__brk
 
-.weak brk;
-brk=__brk        
+       .size __brk,.-__brk
+
+       .weak brk
+       brk=__brk        
 #endif 
index edce8d5..f7c6bd1 100644 (file)
                  int flags [r5], void *arg [r6]); */
 
 #ifdef __NR_clone
-.globl      __clone;
-.type      __clone, @function;
-.align  2;
-
+       .globl __clone
+       .type __clone,@function
+       .align 2
 
 __clone:
        /* Check for child_stack == NULL || fn == NULL.  */
@@ -90,21 +89,15 @@ __clone:
        lmw     r29,16(r1)
        addi    r1,r1,32
        bnslr+
-#ifdef __PIC__
-       b       __syscall_error@plt
-#else
+
        b       __syscall_error
-#endif
 
 .Lbadargs:
        li      r3,EINVAL
-#ifdef __PIC__
-       b       __syscall_error@plt
-#else
+
        b       __syscall_error
-#endif
 
-.size __clone,.-__clone
-.weak clone;
-clone=__clone
+       .size __clone,.-__clone
+       .weak clone
+       clone=__clone
 #endif
index 71f7119..b853984 100644 (file)
 
 #include <features.h>
 
-       .section ".text"
-       .globl  syscall;
-       .type   syscall,@function;
-       .align  2;
-
-.globl syscall;
-.type syscall,@function;
-.align 2;
+       .text
+       .globl  syscall
+       .type   syscall,@function
+       .align  2
 
 syscall:
        mr 0,3
@@ -36,10 +32,7 @@ syscall:
        mr 7,8
        sc
        bnslr;
-#ifdef __PIC__
-       b __syscall_error@plt
-#else
+
        b __syscall_error
-#endif
 
-.size syscall,.-syscall
+       .size syscall,.-syscall