summaryrefslogtreecommitdiff
path: root/arch/i386/crt_arch.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/crt_arch.h')
-rw-r--r--arch/i386/crt_arch.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/arch/i386/crt_arch.h b/arch/i386/crt_arch.h
index ae694f99..43c8477a 100644
--- a/arch/i386/crt_arch.h
+++ b/arch/i386/crt_arch.h
@@ -1,13 +1,16 @@
-__asm__("\
-.text \n\
-.global _start \n\
-_start: \n\
- xor %ebp,%ebp \n\
- mov %esp,%eax \n\
- and $-16,%esp \n\
- push %eax \n\
- push %eax \n\
- push %eax \n\
- push %eax \n\
- call __cstart \n\
-");
+__asm__(
+".text\n"
+".weak _DYNAMIC \n"
+".hidden _DYNAMIC \n"
+".global " START "\n"
+START ":\n"
+" xor %ebp,%ebp \n"
+" mov %esp,%eax \n"
+" and $-16,%esp \n"
+" push %eax \n"
+" push %eax \n"
+" call 1f \n"
+"1: addl $_DYNAMIC-1b,(%esp) \n"
+" push %eax \n"
+" call " START "_c \n"
+);