From b2db04d0a81a9784d4a007be3bfef21aee207f8f Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Mon, 29 Oct 2018 14:34:25 +0000 Subject: Add support for Thumb-only processors. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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é Signed-off-by: Christophe Lyon --- libc/sysdeps/linux/arm/crt1.S | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libc/sysdeps') 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 */ -- cgit v1.2.3