Brendan Coles
8ad74684ea
LibELF: DynamicObject: Add rpath and runpath helpers
2021-03-22 17:46:05 +01:00
Brendan Coles
f8c603fe7e
LibELF: DynamicObject: set for_each_symbol/for_each_dynamic_entry public
2021-03-21 09:40:30 +01:00
Brian Gianforcaro
141e6724d1
LibELF: Use StringView literal syntax to build section names.
2021-02-24 14:38:31 +01:00
Andreas Kling
b33a6a443e
LibELF: Inline DynamicObject::hash_section()
...
This was high up in profiles and gets almost entirely optimized out
when inlined, so let's do that.
2021-02-23 20:33:32 +01:00
Andreas Kling
22b8110554
LibELF: Avoid doing strlen() on everything while iterating GNU hash
...
It's a lot faster to iterate the GNU hash tables if we don't have to
compute the length of every symbol name before rejecting it anyway while
comparing the first character. :^)
2021-02-23 19:43:44 +01:00
Andreas Kling
46a94a9a9e
LibELF: Rename lookup_elf_symbol() => lookup_sysv_symbol()
...
We have two kinds of lookup, SYSV and GNU hash. Both are ELF lookups.
2021-02-23 19:43:44 +01:00
Andreas Kling
d6af3302e8
LibELF: Don't recompute the same ELF hashes over and over
...
When performing a global symbol lookup, we were recomputing the symbol
hashes once for every dynamic object searched. The hash function was
at the very top of a profile (15%) of program startup.
With this change, the hash function is no longer visible among the top
stacks in the profile. :^)
2021-02-23 19:43:44 +01:00
Andreas Kling
37420f1baf
LibELF: Move ELF hash functions to their own file (and make constexpr)
2021-02-23 19:43:44 +01:00
Andreas Kling
f23b29f605
LibELF: Move DynamicObject::lookup_symbol() to DynamicLoader
...
Also simplify it by removing an unreachable code path.
2021-02-21 00:29:52 +01:00
Andreas Kling
a43910acc3
LibELF: Make SymbolLookupResult::address a VirtualAddress
...
Let's use a stronger type than void* for this since we're talking
specifically about a virtual address and not necessarily a pointer
to something actually in memory (yet).
2021-02-21 00:02:21 +01:00
Andreas Kling
c5d93e55d0
LibELF: Simplify DynamicObject::Symbol class a bit
...
We no longer need the create_undefined() helper function.
Also we don't need a member field for is_undefined().
2021-02-21 00:02:21 +01:00
Andreas Kling
1997d5de1a
LibELF: Make symbol lookup functions return Optional<Symbol>
...
It was very confusing how these functions used the "undefined" state
of Symbol to signal lookup failure. Let's use Optional<T> to make things
a bit more understandable.
2021-02-21 00:02:21 +01:00
Andreas Kling
ba1eea9898
LibELF+DynamicLoader: Rename DynamicObject::construct() => create()
2021-02-21 00:02:21 +01:00
Andreas Kling
01f1e480e5
LibELF: Fix various clang-tidy warnings
...
Remove a bunch of unused code, unnecessary const, and make some
non-object-specific member functions static.
2021-02-21 00:02:21 +01:00
Andreas Kling
0c0127dc3f
LibELF: Use StringView instead of "const char*" in dynamic linker code
...
There's no reason to use C strings more than absolutely necessary.
2021-02-20 22:29:12 +01:00
Andreas Kling
4df3a34bc2
LibELF: Only set up PLT trampoline for objects with a PLT
2021-02-05 12:10:45 +01:00
Andreas Kling
41d8734288
LibELF: Use Optional<SymbolLookupResult> as a return type
...
Instead of storing a "found" state inside the result object.
2021-01-25 18:57:06 +01:00
Linus Groh
6715ca3e16
LibELF: Remove unused m_global_symbol_lookup_func from DynamicObject
...
This was refactored in 3e815ad
, leaving this unused member behind.
2021-01-18 19:17:52 +01:00
Andreas Kling
13d7c09125
Libraries: Move to Userland/Libraries/
2021-01-12 12:17:46 +01:00