summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2015-04-18 22:41:46 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2015-04-22 20:00:24 +0200
commite71fc570caec4f2d4bbe729dfe9eb41bfe5a732a (patch)
tree3e9036c730288367ef489989e05b4452ca1116c8 /ldso
parent298f58e073b2782bd264edea969769b7b5e7cf41 (diff)
arm: Add BX and BXC macros
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/arm/dl-startup.h12
-rw-r--r--ldso/ldso/arm/resolve.S18
2 files changed, 8 insertions, 22 deletions
diff --git a/ldso/ldso/arm/dl-startup.h b/ldso/ldso/arm/dl-startup.h
index df2c82469..eb2a9a22a 100644
--- a/ldso/ldso/arm/dl-startup.h
+++ b/ldso/ldso/arm/dl-startup.h
@@ -47,11 +47,7 @@ __asm__(
" ldr r0, .L_FINI_PROC\n"
" ldr r0, [sl, r0]\n"
" @ jump to the user_s entry point\n"
-#if defined(__USE_BX__)
- " bx r6\n"
-#else
- " mov pc, r6\n"
-#endif
+ " " __stringify(BX(r6)) "\n"
".L_GET_GOT:\n"
" .word _GLOBAL_OFFSET_TABLE_ - .L_GOT_GOT - 4\n"
".L_SKIP_ARGS:\n"
@@ -113,11 +109,7 @@ __asm__(
" ldr r0, .L_FINI_PROC\n"
" ldr r0, [r7, r0]\n"
" @ jump to the user_s entry point\n"
-#if defined(__USE_BX__)
- " bx r6\n"
-#else
- " mov pc, r6\n"
-#endif
+ " " __stringify(BX(r6)) "\n"
"\n\n"
".L_GET_GOT:\n"
" .word _GLOBAL_OFFSET_TABLE_ - .L_GOT_GOT - 4\n"
diff --git a/ldso/ldso/arm/resolve.S b/ldso/ldso/arm/resolve.S
index c1caf9a14..7e0058e0d 100644
--- a/ldso/ldso/arm/resolve.S
+++ b/ldso/ldso/arm/resolve.S
@@ -90,12 +90,10 @@
* dl-startup.c).
*/
-#include <sys/syscall.h>
+#include <features.h>
#include <bits/arm_asm.h>
#include <bits/arm_bx.h>
-#include <features.h>
-
#define sl r10
#define fp r11
#define ip r12
@@ -114,8 +112,8 @@ _dl_linux_resolve:
@ function must branch to the real function, and that expects
@ r0-r3 and lr to be as they were before the whole PLT stuff -
@ ip can be trashed.
- @ This routine is called after pushing lr, so we must push an odd
- @ number of words to keep the stack correctly aligned.
+ @ This routine is called after pushing lr, so we must push an odd
+ @ number of words to keep the stack correctly aligned.
stmdb sp!, {r0, r1, r2, r3, r4}
ldr r0, [lr, #-4] @ r0 : = [lr-4] (GOT_TABLE[1])
@@ -124,16 +122,12 @@ _dl_linux_resolve:
@ ~x = -x-1, therefore ~(r1>>2) = (-((lr-ip)>>2)-1)
@ = - ((lr-ip)/4) - 1 = (ip - lr - 4)/4, as required
- bl _dl_linux_resolver
+ bl _dl_linux_resolver
- mov ip, r0
+ mov ip, r0
ldmia sp!, {r0, r1, r2, r3, r4, lr}
-#if defined(__USE_BX__)
- bx ip
-#else
- mov pc,ip
-#endif
+ BX(ip)
#else
@ In the thumb case _dl_linux_resolver is thumb. If a bl is used
@ from arm code the linker will insert a stub call which, with