summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/arm/mmap64.S
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2005-06-10 18:25:35 +0000
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>2005-06-10 18:25:35 +0000
commit569b0e03fb08ea519434d26ee77aeb3a9cdeedf3 (patch)
treece7bae583cdc2d0d15ac3f64f5f4d8ac8c13c2d3 /libc/sysdeps/linux/arm/mmap64.S
parent79cdbec85c2c0154c8d5c6abeedee2f088300e0d (diff)
Remove TEXTREL relocations for ARM.
Hide __syscall_error from outside libc. From Peter Mazinger.
Diffstat (limited to 'libc/sysdeps/linux/arm/mmap64.S')
-rw-r--r--libc/sysdeps/linux/arm/mmap64.S35
1 files changed, 13 insertions, 22 deletions
diff --git a/libc/sysdeps/linux/arm/mmap64.S b/libc/sysdeps/linux/arm/mmap64.S
index 0da4afbb0..310a60c5f 100644
--- a/libc/sysdeps/linux/arm/mmap64.S
+++ b/libc/sysdeps/linux/arm/mmap64.S
@@ -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 @@ 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