提交 83023d1b 编写于 作者: R Rich Felker

PIE support for i386

上级 c9dea48f
......@@ -39,7 +39,7 @@ ALL_INCLUDES = $(sort $(wildcard include/*.h include/*/*.h) $(GENH))
EMPTY_LIB_NAMES = m rt pthread crypt util xnet resolv dl
EMPTY_LIBS = $(EMPTY_LIB_NAMES:%=lib/lib%.a)
CRT_LIBS = lib/crt1.o lib/crti.o lib/crtn.o
CRT_LIBS = lib/crt1.o lib/Scrt1.o lib/crti.o lib/crtn.o
STATIC_LIBS = lib/libc.a
SHARED_LIBS = lib/libc.so
TOOL_LIBS = lib/musl-gcc.specs
......
.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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册