Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2011-12-14 02:45:12 +0400
committerJeff Johnston <jjohnstn@redhat.com>2011-12-14 02:45:12 +0400
commit50e970d1b16e3eb67a091de05661892f9c1ae77e (patch)
tree70fdde3f18c1cadcca9bab2f4a92595f4556219f /libgloss
parente480bc80c30631ee5634b4b3aed63660109091e0 (diff)
2011-12-13 Richard Earnshaw <rearnsha@arm.com>
Thomas Klein <th.r.klein@web.de> * arm/crt0.S: Manually set the target architecture when compiling for Thumb1 on EABI targets. Avoid v6-only Thumb-1 MOV instruction.
Diffstat (limited to 'libgloss')
-rw-r--r--libgloss/ChangeLog7
-rw-r--r--libgloss/arm/crt0.S38
2 files changed, 38 insertions, 7 deletions
diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog
index b0048e4fe..ada15f0de 100644
--- a/libgloss/ChangeLog
+++ b/libgloss/ChangeLog
@@ -1,3 +1,10 @@
+2011-12-13 Richard Earnshaw <rearnsha@arm.com>
+ Thomas Klein <th.r.klein@web.de>
+
+ * arm/crt0.S: Manually set the target architecture
+ when compiling for Thumb1 on EABI targets.
+ Avoid v6-only Thumb-1 MOV instruction.
+
2011-11-28 DJ Delorie <dj@redhat.com>
* configure.in: Add rl78.
diff --git a/libgloss/arm/crt0.S b/libgloss/arm/crt0.S
index 101041e04..92e76480c 100644
--- a/libgloss/arm/crt0.S
+++ b/libgloss/arm/crt0.S
@@ -17,6 +17,30 @@
#define _fini __libc_fini_array
#endif
+#if defined(__ARM_EABI__) && defined(__thumb__) && !defined(__thumb2__)
+/* For Thumb1 we need to force the architecture to be sure that we get the
+ correct attributes on the object file; otherwise the assembler will get
+ confused and mark the object as being v6T2. */
+#if defined(__ARM_ARCH_4T__)
+ .arch armv4t
+#elif defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5TE__)
+ /* Nothing in this object requires higher than v5. */
+ .arch armv5t
+#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
+ || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \
+ || defined(__ARM_ARCH_6ZK__)
+ /* Nothing in this object requires higher than v6. */
+ .arch armv6
+#elif defined(__ARM_ARCH_6M__)
+#ifdef ARM_RDP_MONITOR
+ /* Object file uses SVC, so mark as v6s-m. */
+ .arch armv6s-m
+#else
+ .arch armv6-m
+#endif
+#endif
+#endif
+
/* .text is used instead of .section .text so it works with arm-aout too. */
.text
.syntax unified
@@ -250,7 +274,7 @@ __change_mode:
#ifdef ARM_RDP_MONITOR
swi SWI_GetEnv /* sets r0 to point to the command line */
- mov r1, r0
+ movs r1, r0
#else
movs r0, #AngelSWI_Reason_GetCmdLine
adr r1, .LC30 /* Space for command line */
@@ -285,7 +309,7 @@ __change_mode:
cmp r3, #'\''
bne .LC21
.LC20:
- mov r2, r3
+ movs r2, r3
b .LC22
.LC21:
@@ -326,7 +350,7 @@ __change_mode:
mov r1, sp /* point at stacked arg pointers */
/* We've now got the stacked args in order reverse the */
#ifdef __thumb__
- mov r2, r0
+ movs r2, r0
lsls r2, #2
add r2, sp
mov r3, sp
@@ -364,13 +388,13 @@ __change_mode:
to create constructors and destructors, and for these
targets we need to call the _init function and arrange
for _fini to be called at program exit. */
- mov r4, r0
- mov r5, r1
+ movs r4, r0
+ movs r5, r1
ldr r0, .Lfini
bl FUNCTION (atexit)
bl FUNCTION (_init)
- mov r0, r4
- mov r1, r5
+ movs r0, r4
+ movs r1, r5
#endif
bl FUNCTION (main)