forked from Bananymous/banan-os
DynamicLoader: Don't write to pltgot if it does not exist
This makes `tcc` compile runnable executables
This commit is contained in:
parent
49133dce48
commit
3a465cb94f
|
@ -567,6 +567,9 @@ static void handle_dynamic(LoadedElf& elf)
|
|||
syscall(SYS_CLOSE, library_fd);
|
||||
}
|
||||
|
||||
if (pltgot == 0)
|
||||
return;
|
||||
|
||||
// setup required GOT entries
|
||||
reinterpret_cast<uintptr_t*>(pltgot)[0] = reinterpret_cast<uintptr_t>(elf.dynamics);
|
||||
reinterpret_cast<uintptr_t*>(pltgot)[1] = reinterpret_cast<uintptr_t>(&elf);
|
||||
|
|
Loading…
Reference in New Issue