From 577e4aa1ec5462ead3af4ba2236881ed4672f01e Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 4 Dec 2004 21:20:42 +0000 Subject: * sysdeps/arm/sysdep.h: Define __USE_BX__ if bx is available. Use it instead of __THUMB_INTERWORK__. Make RETINSTR take only a condition and a register. * sysdeps/arm/dl-machine.h: Use __USE_BX__ instead of __THUMB_INTERWORK__. (_dl_start_user): Use BX. * sysdeps/arm/strlen.S: Use DO_RET. * sysdeps/unix/arm/brk.S, sysdeps/unix/arm/fork.S, sysdeps/unix/arm/sysdep.S, sysdeps/unix/arm/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/arm/clone.S, sysdeps/unix/sysv/linux/arm/mmap.S, sysdeps/unix/sysv/linux/arm/mmap64.S, sysdeps/unix/sysv/linux/arm/socket.S, sysdeps/unix/sysv/linux/arm/sysdep.h, sysdeps/unix/sysv/linux/arm/vfork.S: Update uses of RETINSTR. --- sysdeps/arm/dl-machine.h | 4 ++-- sysdeps/arm/strlen.S | 2 +- sysdeps/arm/sysdep.h | 17 ++++++++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) (limited to 'sysdeps/arm') diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h index 5dfe3346f5..761f8daeaa 100644 --- a/sysdeps/arm/dl-machine.h +++ b/sysdeps/arm/dl-machine.h @@ -123,7 +123,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) return lazy; } -#if defined(__THUMB_INTERWORK__) +#if defined(__USE_BX__) #define BX(x) "bx\t" #x #else #define BX(x) "mov\tpc, " #x @@ -293,7 +293,7 @@ _dl_start_user:\n\ ldr r0, .L_FINI_PROC\n\ add r0, sl, r0\n\ @ jump to the user_s entry point\n\ - mov pc, r6\n\ + " BX(r6) "\n\ .L_GET_GOT:\n\ .word _GLOBAL_OFFSET_TABLE_ - .L_GOT_GOT - 4\n\ .L_SKIP_ARGS:\n\ diff --git a/sysdeps/arm/strlen.S b/sysdeps/arm/strlen.S index a83c41d26a..86e16652e4 100644 --- a/sysdeps/arm/strlen.S +++ b/sysdeps/arm/strlen.S @@ -68,6 +68,6 @@ Llastword: @ drop through to here once we find a tstne r2, $0x00ff0000 @ (if first three all non-zero, 4th addne r0, r0, $1 @ must be zero) #endif - RETINSTR(mov,pc,lr) + DO_RET(lr) END(strlen) libc_hidden_builtin_def (strlen) diff --git a/sysdeps/arm/sysdep.h b/sysdeps/arm/sysdep.h index cb3f105afe..8ca77a60cb 100644 --- a/sysdeps/arm/sysdep.h +++ b/sysdeps/arm/sysdep.h @@ -19,6 +19,11 @@ #include +#if (!defined (__ARM_ARCH_2__) && !defined (__ARM_ARCH_3__) \ + && !defined (__ARM_ARCH_3M__) && !defined (__ARM_ARCH_4__)) +# define __USE_BX__ +#endif + #ifdef __ASSEMBLER__ /* Syntactic details of assembler. */ @@ -50,20 +55,22 @@ #ifdef __APCS_32__ #define LOADREGS(cond, base, reglist...)\ ldm##cond base,reglist -#define RETINSTR(instr, regs...)\ - instr regs -#ifdef __THUMB_INTERWORK__ +#ifdef __USE_BX__ +#define RETINSTR(cond, reg) \ + bx##cond reg #define DO_RET(_reg) \ bx _reg #else +#define RETINSTR(cond, reg) \ + mov##cond pc, reg #define DO_RET(_reg) \ mov pc, _reg #endif #else /* APCS-26 */ #define LOADREGS(cond, base, reglist...)\ ldm##cond base,reglist^ -#define RETINSTR(instr, regs...)\ - instr##s regs +#define RETINSTR(cond, reg) \ + mov##cond##s pc, reg #define DO_RET(_reg) \ movs pc, _reg #endif -- cgit v1.2.3