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 movq %rdx, %rdi # environ
pushq $__fini_array_end leaq __fini_array_end(%rip), %rax; pushq %rax
pushq $__fini_array_start leaq __fini_array_start(%rip), %rax; pushq %rax
pushq $_fini leaq _fini(%rip), %rax; pushq %rax
pushq $__init_array_end leaq __init_array_end(%rip), %rax; pushq %rax
pushq $__init_array_start leaq __init_array_start(%rip), %rax; pushq %rax
pushq $_init leaq _init(%rip), %rax; pushq %rax
call _init_libc call _init_libc