From 83023d1b50297cd2aa0fe4cbd2a0539462bb7c48 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 2 May 2012 21:01:55 -0400 Subject: PIE support for i386 --- crt/Scrt1.c | 0 crt/i386/Scrt1.s | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 crt/Scrt1.c create mode 100644 crt/i386/Scrt1.s (limited to 'crt') diff --git a/crt/Scrt1.c b/crt/Scrt1.c new file mode 100644 index 00000000..e69de29b 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 -- cgit v1.2.1