summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-07-14 00:04:54 +0000
committerMike Frysinger <vapier@gentoo.org>2005-07-14 00:04:54 +0000
commit802c7d3ac886b8df885bc74417795663de0b6032 (patch)
treeb6f4f19848103a1e2b466b7d2a87ca7dda193f33 /libc
parentf50c17eb71a926ce9606313485c72041cc9e4d4b (diff)
import the rest of the glibc start.S so PIE works
Diffstat (limited to 'libc')
-rw-r--r--libc/sysdeps/linux/x86_64/crt1.S24
1 files changed, 12 insertions, 12 deletions
diff --git a/libc/sysdeps/linux/x86_64/crt1.S b/libc/sysdeps/linux/x86_64/crt1.S
index f6e76cd02..f6c1eb1e7 100644
--- a/libc/sysdeps/linux/x86_64/crt1.S
+++ b/libc/sysdeps/linux/x86_64/crt1.S
@@ -106,6 +106,17 @@ _start:
which grow downwards). */
pushq %rsp
+#if defined(L_Scrt1)
+ /* Give address for main() */
+ movq main@GOTPCREL(%rip), %rdi
+
+ /* setup init/fini address */
+ movq _init@GOTPCREL(%rip), %rcx
+ movq _fini@GOTPCREL(%rip), %r8
+
+ /* start the fun */
+ call __uClibc_main@PLT
+#else
/* Give address for main() */
movq $main, %rdi
@@ -113,20 +124,9 @@ _start:
movq $_init, %rcx
movq $_fini, %r8
-/**************
- * START TODO */
-#if defined(L_Scrt1)
- call .L0
-.L0:
- popq %rbx
- addq $_GLOBAL_OFFSET_TABLE_+[.-.L0],%rbx
-
- call *__uClibc_main@GOT(%rip)
-#else
+ /* start the fun */
call __uClibc_main
#endif
-/* END TODO *
- ************/
hlt /* Crash if somehow `exit' does return. */
.size _start,.-_start