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 --- ldso/ldso/arm/dl-startup.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'ldso/ldso/arm/dl-startup.h') diff --git a/ldso/ldso/arm/dl-startup.h b/ldso/ldso/arm/dl-startup.h index 06c95cb44..cacd461e1 100644 --- a/ldso/ldso/arm/dl-startup.h +++ b/ldso/ldso/arm/dl-startup.h @@ -11,10 +11,13 @@ #if defined(__FDPIC__) #if !defined(__thumb__) || defined(__thumb2__) __asm__( - " .arm\n" " .text\n" " .globl _start\n" " .type _start,%function\n" +#if defined(__thumb2__) + " .thumb_func\n" +#endif + " .align 2\n" "_start:\n" /* We compute the parameters for __self_reloc: - r0 is a pointer to the loadmap (either from r8 or r7 if rtld is @@ -25,12 +28,17 @@ __asm__( __self_reloc will fix indirect addresses in .rofixup section and will return the relocated GOT value. */ +#if defined(__thumb2__) + " sub r4, pc, #4\n" +#else " sub r4, pc, #8\n" +#endif " ldr r1, .L__ROFIXUP_LIST__\n" " add r1, r1, r4\n" " ldr r2, .L__ROFIXUP_END__\n" " add r2, r2, r4\n" " movs r0, r8\n" + " it eq\n" " moveq r0, r7\n" " push {r7, r8, r9, r10}\n" " bl __self_reloc;\n" -- cgit v1.2.3