浏览代码

make startup code PIE-compatible

Rich Felker 14 年之前
父节点
当前提交
e2ee1bdd8d
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      crt/i386/crt1.s

+ 4 - 2
crt/i386/crt1.s

@@ -12,6 +12,8 @@ _start:
 	pushl %ebp
 	pushl %ebp
 	pushl %eax
 	pushl %eax
 	pushl %ecx
 	pushl %ecx
-	pushl $main
+	call 1f
+1:	addl $[main-.],(%esp)
+	//pushl $main
 	call __libc_start_main
 	call __libc_start_main
-.L0:	jmp .L0
+1:	jmp 1b