From 365261c37ff9156372a32f4ab3f07dcfbd72217e Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 13 Feb 2013 20:32:14 -0800 Subject: [PATCH] arm: Mark assembly files that will not use thumb mode Some routines are written with complex LDM/STM insns that cannot be used in thumb mode, or are highly conditional requiring excessive IT insns. When a future patch goes in to enable thumb2 by default, this marker will be used to override that default. --- ports/ChangeLog.arm | 11 +++++++++++ ports/sysdeps/arm/__longjmp.S | 2 ++ ports/sysdeps/arm/crti.S | 2 ++ ports/sysdeps/arm/crtn.S | 2 ++ ports/sysdeps/arm/dl-trampoline.S | 2 ++ ports/sysdeps/arm/memcpy.S | 2 ++ ports/sysdeps/arm/memmove.S | 2 ++ ports/sysdeps/arm/memset.S | 2 ++ ports/sysdeps/arm/setjmp.S | 2 ++ ports/sysdeps/arm/strlen.S | 2 ++ ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S | 2 ++ ports/sysdeps/unix/sysv/linux/arm/setcontext.S | 2 ++ 12 files changed, 33 insertions(+) diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm index 33a1f57f71..28ec8f96a1 100644 --- a/ports/ChangeLog.arm +++ b/ports/ChangeLog.arm @@ -37,6 +37,17 @@ * sysdeps/unix/sysv/linux/arm/sysdep.h (PSEUDO_RET): Likewise. * sysdeps/unix/sysv/linux/arm/vfork.S (__vfork): Likewise. + * ports/sysdeps/arm/__longjmp.S: Define NO_THUMB before + * sysdeps/arm/crti.S, sysdeps/arm/crtn.S: Likewise. + * sysdeps/arm/dl-trampoline.S: Likewise. + * sysdeps/arm/memcpy.S: Likewise. + * sysdeps/arm/memmove.S: Likewise. + * sysdeps/arm/memset.S: Likewise. + * sysdeps/arm/setjmp.S: Likewise. + * sysdeps/arm/strlen.S: Likewise. + * sysdeps/unix/sysv/linux/arm/____longjmp_chk.S: Likewise. + * sysdeps/unix/sysv/linux/arm/setcontext.S: Likewise. + 2013-02-27 Roland McGrath * sysdeps/arm/sysdep.h (CFI_SECTIONS): New macro. diff --git a/ports/sysdeps/arm/__longjmp.S b/ports/sysdeps/arm/__longjmp.S index 3d6e114c88..a3a2a8aecb 100644 --- a/ports/sysdeps/arm/__longjmp.S +++ b/ports/sysdeps/arm/__longjmp.S @@ -16,6 +16,8 @@ License along with the GNU C Library. If not, see . */ +/* ??? Needs more rearrangement for the LDM to handle thumb mode. */ +#define NO_THUMB #include #define _SETJMP_H #define _ASM diff --git a/ports/sysdeps/arm/crti.S b/ports/sysdeps/arm/crti.S index 44e20f0c11..1d55ae27ad 100644 --- a/ports/sysdeps/arm/crti.S +++ b/ports/sysdeps/arm/crti.S @@ -38,6 +38,8 @@ they can be called as functions. The symbols _init and _fini are magic and cause the linker to emit DT_INIT and DT_FINI. */ +/* Always build .init and .fini sections in ARM mode. */ +#define NO_THUMB #include #include diff --git a/ports/sysdeps/arm/crtn.S b/ports/sysdeps/arm/crtn.S index 5ff3661f18..a01eb01397 100644 --- a/ports/sysdeps/arm/crtn.S +++ b/ports/sysdeps/arm/crtn.S @@ -33,6 +33,8 @@ License along with the GNU C Library. If not, see . */ +/* Always build .init and .fini sections in ARM mode. */ +#define NO_THUMB #include /* crtn.S puts function epilogues in the .init and .fini sections diff --git a/ports/sysdeps/arm/dl-trampoline.S b/ports/sysdeps/arm/dl-trampoline.S index 6d41ebd88f..561d8ae6fd 100644 --- a/ports/sysdeps/arm/dl-trampoline.S +++ b/ports/sysdeps/arm/dl-trampoline.S @@ -16,6 +16,8 @@ License along with the GNU C Library. If not, see . */ +/* ??? Needs more rearrangement for the LDM to handle thumb mode. */ +#define NO_THUMB #include #include diff --git a/ports/sysdeps/arm/memcpy.S b/ports/sysdeps/arm/memcpy.S index d8164b4d70..98b9b47e39 100644 --- a/ports/sysdeps/arm/memcpy.S +++ b/ports/sysdeps/arm/memcpy.S @@ -17,6 +17,8 @@ License along with the GNU C Library. If not, see . */ +/* Thumb requires excessive IT insns here. */ +#define NO_THUMB #include /* diff --git a/ports/sysdeps/arm/memmove.S b/ports/sysdeps/arm/memmove.S index d33c1cef84..059ca7ac31 100644 --- a/ports/sysdeps/arm/memmove.S +++ b/ports/sysdeps/arm/memmove.S @@ -17,6 +17,8 @@ License along with the GNU C Library. If not, see . */ +/* Thumb requires excessive IT insns here. */ +#define NO_THUMB #include /* diff --git a/ports/sysdeps/arm/memset.S b/ports/sysdeps/arm/memset.S index 3152a84e80..9924cb9115 100644 --- a/ports/sysdeps/arm/memset.S +++ b/ports/sysdeps/arm/memset.S @@ -16,6 +16,8 @@ License along with the GNU C Library. If not, see . */ +/* Thumb requires excessive IT insns here. */ +#define NO_THUMB #include /* void *memset (dstpp, c, len) */ diff --git a/ports/sysdeps/arm/setjmp.S b/ports/sysdeps/arm/setjmp.S index baa02be39d..6776cab384 100644 --- a/ports/sysdeps/arm/setjmp.S +++ b/ports/sysdeps/arm/setjmp.S @@ -16,6 +16,8 @@ License along with the GNU C Library. If not, see . */ +/* ??? Needs more rearrangement for the STM to handle thumb mode. */ +#define NO_THUMB #include #define _SETJMP_H #define _ASM diff --git a/ports/sysdeps/arm/strlen.S b/ports/sysdeps/arm/strlen.S index 15e922118a..2b947e240e 100644 --- a/ports/sysdeps/arm/strlen.S +++ b/ports/sysdeps/arm/strlen.S @@ -16,6 +16,8 @@ License along with the GNU C Library. If not, see . */ +/* Thumb requires excessive IT insns here. */ +#define NO_THUMB #include /* size_t strlen(const char *S) diff --git a/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S b/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S index bdcfa206ec..29edec69d2 100644 --- a/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S +++ b/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S @@ -15,6 +15,8 @@ License along with the GNU C Library. If not, see . */ +/* ??? Needs more rearrangement for the LDM to handle thumb mode. */ +#define NO_THUMB #include .section .rodata.str1.1,"aMS",%progbits,1 diff --git a/ports/sysdeps/unix/sysv/linux/arm/setcontext.S b/ports/sysdeps/unix/sysv/linux/arm/setcontext.S index edd17bcd40..b3148c8943 100644 --- a/ports/sysdeps/unix/sysv/linux/arm/setcontext.S +++ b/ports/sysdeps/unix/sysv/linux/arm/setcontext.S @@ -15,6 +15,8 @@ License along with the GNU C Library; if not, see . */ +/* ??? Needs more rearrangement for the LDM to handle thumb mode. */ +#define NO_THUMB #include #include