summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/sysdeps/linux/arm/crt1.S2
-rw-r--r--libc/sysdeps/linux/m68k/crt1.S10
2 files changed, 8 insertions, 4 deletions
diff --git a/libc/sysdeps/linux/arm/crt1.S b/libc/sysdeps/linux/arm/crt1.S
index fade1d25c..799f11080 100644
--- a/libc/sysdeps/linux/arm/crt1.S
+++ b/libc/sysdeps/linux/arm/crt1.S
@@ -245,7 +245,7 @@ _start:
mov fp, #0
mov lr, #0
-#ifdef __ARCH_USE_MMU__
+#if defined(__ARCH_USE_MMU__) || defined(__UCLIBC_FORMAT_ELF__)
#ifdef L_rcrt1
/* We don't need to save a1 since no dynamic linker should have run */
ldr a1, .L_GOT /* Get value at .L_GOT + 0 (offset to GOT)*/
diff --git a/libc/sysdeps/linux/m68k/crt1.S b/libc/sysdeps/linux/m68k/crt1.S
index 815a6076f..e7292682b 100644
--- a/libc/sysdeps/linux/m68k/crt1.S
+++ b/libc/sysdeps/linux/m68k/crt1.S
@@ -78,9 +78,13 @@ _start:
sub.l %fp, %fp
#if !defined __ARCH_USE_MMU__ && defined __PIC__
+#ifdef UCLIBC_FORMAT_ELF
+ move.l #_GLOBAL_OFFSET_TABLE_, %a5
+#else
/* Set up the global pointer. The GOT is at the beginning of the
data segment, whose address is in %d5. */
move.l %d5,%a5
+#endif
.equ have_current_got, 1
#endif
@@ -92,11 +96,11 @@ _start:
arguments for `main': argc, argv. envp will be determined
later in __libc_start_main. */
move.l (%sp)+, %d0 /* Pop the argument count. */
-#ifndef __ARCH_USE_MMU__
- move.l (%sp)+, %a0
-#else
+#if defined(__ARCH_USE_MMU__) || defined(__UCLIBC_FORMAT_ELF__)
move.l %sp, %a0 /* The argument vector starts just at the
current stack top. */
+#else
+ move.l (%sp)+, %a0
#endif
/* Provide the highest stack address to the user code (for stacks