1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:27:35 +00:00

Loader.so+LibELF: Move most of Loader.so's logic into ELF::DynamicLinker

Loader.so now just performs the initial self relocations and static
LibC initialisation before handing over to ELF::DynamicLinker::linker_main
to handle the rest of the process.

As a trade-off, ELF::DynamicLinker needs to be explicitly excluded from
Lagom unless we really want to try writing a cross platform dynamic loader
This commit is contained in:
William Marlow 2021-01-01 23:54:43 +00:00 committed by Andreas Kling
parent 4d32121293
commit 3e815ad5b1
8 changed files with 327 additions and 220 deletions

View file

@ -276,9 +276,10 @@ public:
bool found { false };
FlatPtr value { 0 };
FlatPtr address { 0 };
unsigned bind { STB_LOCAL };
const ELF::DynamicObject* dynamic_object { nullptr }; // The object in which the symbol is defined
};
Optional<SymbolLookupResult> lookup_symbol(const char* name) const;
SymbolLookupResult lookup_symbol(const char* name) const;
// Will be called from _fixup_plt_entry, as part of the PLT trampoline
Elf32_Addr patch_plt_entry(u32 relocation_offset);