summaryrefslogtreecommitdiffstats
path: root/libgloss/arm/crt0.S
diff options
context:
space:
mode:
Diffstat (limited to 'libgloss/arm/crt0.S')
-rw-r--r--libgloss/arm/crt0.S38
1 files changed, 11 insertions, 27 deletions
diff --git a/libgloss/arm/crt0.S b/libgloss/arm/crt0.S
index 823f409a4..bea289277 100644
--- a/libgloss/arm/crt0.S
+++ b/libgloss/arm/crt0.S
@@ -18,26 +18,15 @@
/* .text is used instead of .section .text so it works with arm-aout too. */
.text
-#if defined(__thumb2__)
- .syntax unified
- .thumb
-.macro FUNC_START name
- .global \name
- .thumb_func
-\name:
-.endm
-#else
.code 32
-.macro FUNC_START name
- .global \name
-\name:
-.endm
-#endif
.align 0
- FUNC_START _mainCRTStartup
- FUNC_START _start
- FUNC_START start
+ .global _mainCRTStartup
+ .global _start
+ .global start
+start:
+_start:
+_mainCRTStartup:
#if defined(__ELF__) && !defined(__USING_SJLJ_EXCEPTIONS__)
/* Annotation for EABI unwinding tables. */
.fnstart
@@ -56,12 +45,7 @@
/* Issue Angel SWI to read stack info */
mov r0, #AngelSWI_Reason_HeapInfo
adr r1, .LC0 /* point at ptr to 4 words to receive data */
-#if defined(__thumb2__)
- bkpt AngelSWI
-#else
- /* We are always in ARM mode for startup */
- AngelSWIAsm AngelSWI_ARM
-#endif
+ swi AngelSWI_ARM /* We are always in ARM mode for startup */
ldr r0, .LC0 /* point at values read */
ldr sp, [r0, #8]
ldr sl, [r0, #12]
@@ -140,8 +124,8 @@
sub a3, a3, a1 /* Third arg: length of block */
-#if defined(__thumb__) && !defined(__thumb2__)
- /* Enter Thumb mode.... */
+#ifdef __thumb__ /* Enter Thumb mode.... */
+
add a4, pc, #1 /* Get the address of the Thumb block */
bx a4 /* Go there and start Thumb decoding */
@@ -181,7 +165,7 @@ __change_mode:
#else
mov r0, #AngelSWI_Reason_GetCmdLine
adr r1, .LC30 /* Space for command line */
- AngelSWIAsm AngelSWI
+ swi AngelSWI
ldr r1, .LC30
#endif
/* Parse string at r1 */
@@ -303,7 +287,7 @@ __change_mode:
bl FUNCTION (exit) /* Should not return. */
-#if defined(__thumb__) && !defined(__thumb2__)
+#ifdef __thumb__
/* Come out of Thumb mode. This code should be redundant. */
mov a4, pc