summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2018-10-29 14:34:25 +0000
committerWaldemar Brodkorb <wbx@openadk.org>2018-11-01 04:43:45 +0100
commitb2db04d0a81a9784d4a007be3bfef21aee207f8f (patch)
treeff417b99d916ba18fcde41df079830d103acdc11 /libc/sysdeps/linux
parent1b41063f4019bd76a7e0f6b429fff5c5dc297fa6 (diff)
Add support for Thumb-only processors.
* ldso/ldso/arm/aeabi_read_tp.S: Add Thumb version. * ldso/ldso/arm/dl-startup.h: Do not force ARM encoding, adjust for Thumb. * ldso/ldso/arm/resolve.S: Force Thumb encoding on Thumb-only processors. * libc/sysdeps/linux/arm/crt1.S: Do not force ARM encoding, adjust for Thumb. Signed-off-by: Mickaël Guêné <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
Diffstat (limited to 'libc/sysdeps/linux')
-rw-r--r--libc/sysdeps/linux/arm/crt1.S8
1 files changed, 7 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/arm/crt1.S b/libc/sysdeps/linux/arm/crt1.S
index 5da0fe19c..a1d7f0f23 100644
--- a/libc/sysdeps/linux/arm/crt1.S
+++ b/libc/sysdeps/linux/arm/crt1.S
@@ -97,12 +97,17 @@ ARM register quick reference:
#if defined(__FDPIC__)
.text
- .arm
.globl _start
+ .type _start,%function
+ .align 2
_start:
/* Start by self relocation. */
+#if defined(__thumb2__)
+ sub r4, pc, #4
+#else
sub r4, pc, #8
+#endif
ldr r1, .L__ROFIXUP_LIST__
add r1, r1, r4
ldr r2, .L__ROFIXUP_END__
@@ -129,6 +134,7 @@ _start:
ldr r4, [r9, r4]
str r4, [sp, #0] /* sp + 0 GOT fini */
movs r4, r8 /* Test if static binary (r8 is 0 as there is no interpreter). */
+ ite ne
movne r4, r10
moveq r4, #0
str r4, [sp, #4] /* sp + 4 got rtld_fini */