LibC: Make x86_64 crt0 PIE compatible

Instead of pushing addresses of functions directly, use rip relative
addressing
This commit is contained in:
Bananymous 2025-11-09 16:31:59 +02:00
parent 72982e3c2b
commit 362501a097
1 changed files with 6 additions and 6 deletions

View File

@ -19,13 +19,13 @@ _start:
movq %rdx, %rdi # environ
pushq $__fini_array_end
pushq $__fini_array_start
pushq $_fini
leaq __fini_array_end(%rip), %rax; pushq %rax
leaq __fini_array_start(%rip), %rax; pushq %rax
leaq _fini(%rip), %rax; pushq %rax
pushq $__init_array_end
pushq $__init_array_start
pushq $_init
leaq __init_array_end(%rip), %rax; pushq %rax
leaq __init_array_start(%rip), %rax; pushq %rax
leaq _init(%rip), %rax; pushq %rax
call _init_libc