mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:27:34 +00:00
LibELF: Cache consecutive lookups for the same symbol
This reduces the startup time of LibWeb by 10%, and eliminates 156'000 of the total 481'000 global symbol lookups during a self-test run.
This commit is contained in:
parent
9a07ac0b6a
commit
1adf06c9f0
3 changed files with 31 additions and 6 deletions
|
@ -143,7 +143,11 @@ private:
|
|||
ResolveLater = 2,
|
||||
CallIfuncResolver = 3,
|
||||
};
|
||||
RelocationResult do_direct_relocation(DynamicObject::Relocation const&, ShouldInitializeWeak, ShouldCallIfuncResolver);
|
||||
struct CachedLookupResult {
|
||||
DynamicObject::Symbol symbol;
|
||||
Optional<DynamicObject::SymbolLookupResult> result;
|
||||
};
|
||||
RelocationResult do_direct_relocation(DynamicObject::Relocation const&, Optional<CachedLookupResult>&, ShouldInitializeWeak, ShouldCallIfuncResolver);
|
||||
// Will be called from _fixup_plt_entry, as part of the PLT trampoline
|
||||
static RelocationResult do_plt_relocation(DynamicObject::Relocation const&, ShouldCallIfuncResolver);
|
||||
void do_relr_relocations();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue