summaryrefslogtreecommitdiff
path: root/crt/i386
diff options
context:
space:
mode:
Diffstat (limited to 'crt/i386')
-rw-r--r--crt/i386/Scrt1.s24
1 files changed, 24 insertions, 0 deletions
diff --git a/crt/i386/Scrt1.s b/crt/i386/Scrt1.s
new file mode 100644
index 00000000..b0fbe104
--- /dev/null
+++ b/crt/i386/Scrt1.s
@@ -0,0 +1,24 @@
+.weak _init
+.weak _fini
+.text
+.global _start
+_start:
+ xorl %ebp,%ebp
+ popl %ecx
+ movl %esp,%eax
+ andl $-16,%esp
+ pushl %esp
+ pushl %esp
+ pushl %edx
+ call 1f
+1: addl $_GLOBAL_OFFSET_TABLE_,(%esp)
+ pop %ebx
+ call 1f
+1: addl $[_fini-.],(%esp)
+ call 1f
+1: addl $[_init-.],(%esp)
+ pushl %eax
+ pushl %ecx
+ pushl main@GOT(%ebx)
+ call __libc_start_main@plt
+1: jmp 1b