[uClibc-cvs] svn commit: trunk/uClibc/libc/sysdeps/linux: arm mips powerpc
jocke at uclibc.org
jocke at uclibc.org
Fri Jun 10 18:25:36 UTC 2005
Author: jocke
Date: 2005-06-10 12:25:35 -0600 (Fri, 10 Jun 2005)
New Revision: 10503
Log:
Remove TEXTREL relocations for ARM.
Hide __syscall_error from outside libc.
>From Peter Mazinger.
Modified:
trunk/uClibc/libc/sysdeps/linux/arm/Makefile
trunk/uClibc/libc/sysdeps/linux/arm/bsd-_setjmp.S
trunk/uClibc/libc/sysdeps/linux/arm/bsd-setjmp.S
trunk/uClibc/libc/sysdeps/linux/arm/clone.S
trunk/uClibc/libc/sysdeps/linux/arm/mmap64.S
trunk/uClibc/libc/sysdeps/linux/arm/setjmp.S
trunk/uClibc/libc/sysdeps/linux/arm/vfork.S
trunk/uClibc/libc/sysdeps/linux/mips/__syscall_error.c
trunk/uClibc/libc/sysdeps/linux/powerpc/__syscall_error.c
trunk/uClibc/libc/sysdeps/linux/powerpc/__uClibc_syscall.S
trunk/uClibc/libc/sysdeps/linux/powerpc/brk.S
trunk/uClibc/libc/sysdeps/linux/powerpc/clone.S
trunk/uClibc/libc/sysdeps/linux/powerpc/syscall.S
Changeset:
Modified: trunk/uClibc/libc/sysdeps/linux/arm/Makefile
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/arm/Makefile 2005-06-10 10:31:37 UTC (rev 10502)
+++ trunk/uClibc/libc/sysdeps/linux/arm/Makefile 2005-06-10 18:25:35 UTC (rev 10503)
@@ -28,7 +28,7 @@
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)
Modified: trunk/uClibc/libc/sysdeps/linux/arm/bsd-_setjmp.S
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/arm/bsd-_setjmp.S 2005-06-10 10:31:37 UTC (rev 10502)
+++ trunk/uClibc/libc/sysdeps/linux/arm/bsd-_setjmp.S 2005-06-10 18:25:35 UTC (rev 10503)
@@ -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;
Modified: trunk/uClibc/libc/sysdeps/linux/arm/bsd-setjmp.S
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/arm/bsd-setjmp.S 2005-06-10 10:31:37 UTC (rev 10502)
+++ trunk/uClibc/libc/sysdeps/linux/arm/bsd-setjmp.S 2005-06-10 18:25:35 UTC (rev 10503)
@@ -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;
Modified: trunk/uClibc/libc/sysdeps/linux/arm/clone.S
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/arm/clone.S 2005-06-10 10:31:37 UTC (rev 10502)
+++ trunk/uClibc/libc/sysdeps/linux/arm/clone.S 2005-06-10 18:25:35 UTC (rev 10503)
@@ -20,21 +20,23 @@
/* 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 @@
@ 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 @@
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;
+ .weak clone
+ clone = __clone
-.L4: .word errno
-
-
-.globl clone;
- clone = __clone
-
+#endif
Modified: trunk/uClibc/libc/sysdeps/linux/arm/mmap64.S
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/arm/mmap64.S 2005-06-10 10:31:37 UTC (rev 10502)
+++ trunk/uClibc/libc/sysdeps/linux/arm/mmap64.S 2005-06-10 18:25:35 UTC (rev 10503)
@@ -16,20 +16,18 @@
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 @@
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)
+ b __error
-__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 mmap64,.-mmap64
- /* return -1 */
- mvn r0, $0
- mov pc, lr
-.size mmap64,.-mmap64;
-
-.L4: .word errno
-
#endif
Modified: trunk/uClibc/libc/sysdeps/linux/arm/setjmp.S
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/arm/setjmp.S 2005-06-10 10:31:37 UTC (rev 10502)
+++ trunk/uClibc/libc/sysdeps/linux/arm/setjmp.S 2005-06-10 18:25:35 UTC (rev 10503)
@@ -38,5 +38,9 @@
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;
Modified: trunk/uClibc/libc/sysdeps/linux/arm/vfork.S
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/arm/vfork.S 2005-06-10 10:31:37 UTC (rev 10502)
+++ trunk/uClibc/libc/sysdeps/linux/arm/vfork.S 2005-06-10 18:25:35 UTC (rev 10503)
@@ -20,52 +20,37 @@
* 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
+ swi __NR_vfork
+ cmn r0, #4096
+ movcc pc, lr
- /* Check if vfork even exists. */
- ldr r1, =-ENOSYS
- teq r0, r1
- bne __syscall_error
+ /* 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
+ /* Syscal worked. Return to child/parent */
+ movcc pc, lr
-__syscall_error:
+__error:
+ b __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
-
-
+ .size vfork,.-vfork
+#endif
Modified: trunk/uClibc/libc/sysdeps/linux/mips/__syscall_error.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/mips/__syscall_error.c 2005-06-10 10:31:37 UTC (rev 10502)
+++ trunk/uClibc/libc/sysdeps/linux/mips/__syscall_error.c 2005-06-10 18:25:35 UTC (rev 10503)
@@ -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;
Modified: trunk/uClibc/libc/sysdeps/linux/powerpc/__syscall_error.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/powerpc/__syscall_error.c 2005-06-10 10:31:37 UTC (rev 10502)
+++ trunk/uClibc/libc/sysdeps/linux/powerpc/__syscall_error.c 2005-06-10 18:25:35 UTC (rev 10503)
@@ -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;
Modified: trunk/uClibc/libc/sysdeps/linux/powerpc/__uClibc_syscall.S
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/powerpc/__uClibc_syscall.S 2005-06-10 10:31:37 UTC (rev 10502)
+++ trunk/uClibc/libc/sysdeps/linux/powerpc/__uClibc_syscall.S 2005-06-10 18:25:35 UTC (rev 10503)
@@ -1,14 +1,12 @@
-.section ".text"
+ .text
.align 2
-.globl __uClibc_syscall
+ .globl __uClibc_syscall
.type __uClibc_syscall, at function
__uClibc_syscall:
.Lsize:
sc
bnslr
-#ifdef __PIC__
- b __syscall_error at plt
-#else
+
b __syscall_error
-#endif
+
.size __uClibc_syscall,.Lsize-__uClibc_syscall
Modified: trunk/uClibc/libc/sysdeps/linux/powerpc/brk.S
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/powerpc/brk.S 2005-06-10 10:31:37 UTC (rev 10502)
+++ trunk/uClibc/libc/sysdeps/linux/powerpc/brk.S 2005-06-10 18:25:35 UTC (rev 10503)
@@ -24,10 +24,10 @@
#ifdef __NR_brk
.comm __curbrk,4,4
- .section ".text"
-.globl __brk;
-.type __brk, @function;
-.align 2;
+ .text
+ .globl __brk
+ .type __brk, at function
+ .align 2
__brk:
stwu r1,-16(r1)
@@ -51,13 +51,11 @@
li r3,0
blelr+
li r3,ENOMEM
-#ifdef __PIC__
- b __syscall_error at plt
-#else
+
b __syscall_error
-#endif
-.size __brk,.-__brk
-.weak brk;
-brk=__brk
+ .size __brk,.-__brk
+
+ .weak brk
+ brk=__brk
#endif
Modified: trunk/uClibc/libc/sysdeps/linux/powerpc/clone.S
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/powerpc/clone.S 2005-06-10 10:31:37 UTC (rev 10502)
+++ trunk/uClibc/libc/sysdeps/linux/powerpc/clone.S 2005-06-10 18:25:35 UTC (rev 10503)
@@ -30,11 +30,10 @@
int flags [r5], void *arg [r6]); */
#ifdef __NR_clone
-.globl __clone;
-.type __clone, @function;
-.align 2;
+ .globl __clone
+ .type __clone, at function
+ .align 2
-
__clone:
/* Check for child_stack == NULL || fn == NULL. */
cmpwi cr0,r4,0
@@ -90,21 +89,15 @@
lmw r29,16(r1)
addi r1,r1,32
bnslr+
-#ifdef __PIC__
- b __syscall_error at plt
-#else
+
b __syscall_error
-#endif
.Lbadargs:
li r3,EINVAL
-#ifdef __PIC__
- b __syscall_error at plt
-#else
+
b __syscall_error
-#endif
-.size __clone,.-__clone
-.weak clone;
-clone=__clone
+ .size __clone,.-__clone
+ .weak clone
+ clone=__clone
#endif
Modified: trunk/uClibc/libc/sysdeps/linux/powerpc/syscall.S
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/powerpc/syscall.S 2005-06-10 10:31:37 UTC (rev 10502)
+++ trunk/uClibc/libc/sysdeps/linux/powerpc/syscall.S 2005-06-10 18:25:35 UTC (rev 10503)
@@ -18,15 +18,11 @@
#include <features.h>
- .section ".text"
- .globl syscall;
- .type syscall, at function;
- .align 2;
+ .text
+ .globl syscall
+ .type syscall, at function
+ .align 2
-.globl syscall;
-.type syscall, at function;
-.align 2;
-
syscall:
mr 0,3
mr 3,4
@@ -36,10 +32,7 @@
mr 7,8
sc
bnslr;
-#ifdef __PIC__
- b __syscall_error at plt
-#else
+
b __syscall_error
-#endif
-.size syscall,.-syscall
+ .size syscall,.-syscall
More information about the uClibc-cvs
mailing list