summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibELF/DynamicObject.h
AgeCommit message (Collapse)Author
2021-07-22LibELF+Utilities: Avoid truncating 64-bit valuesGunnar Beutner
This fixes displaying 64-bit addresses in readelf and also fixes showing backtraces from core dumps on x86_64.
2021-07-04LibELF: Save the negative TLS offset in m_tls_offsetGunnar Beutner
This makes it unnecessary to track the symbol size which just isn't available for unexported symbols (e.g. for 'static __thread').
2021-07-01LibELF: Implement support for RELA relocationsGunnar Beutner
2021-06-29LibELF: Use correct accessor macros on x86_64 for some ELF fieldsGunnar Beutner
2021-05-30AK+Userland: Use akaster@serenityos.org for my copyright headersAndrew Kaster
2021-05-16AK+Kernel+LibELF: Remove the need for `IteratorDecision::Continue`Nicholas Baron
By constraining two implementations, the compiler will select the best fitting one. All this will require is duplicating the implementation and simplifying for the `void` case. This constraining also informs both the caller and compiler by passing the callback parameter types as part of the constraint (e.g.: `IterationFunction<int>`). Some `for_each` functions in LibELF only take functions which return `void`. This is a minimal correctness check, as it removes one way for a function to incompletely do something. There seems to be a possible idiom where inside a lambda, a `return;` is the same as `continue;` in a for-loop.
2021-05-03LibELF+LibC: Support building LibELF for 64-bit targetsGunnar Beutner
2021-04-30LibELF: Change TLS offset calculationItamar
This changes the TLS offset calculation logic to be based on the symbol's size instead of the total size of the TLS. Because of this change, we no longer need to pipe "m_tls_size" to so many functions. Also, After this patch, the TLS data of the main program exists at the "end" of the TLS block (Highest addresses). This fixes a part of #6609.
2021-04-25LibC+LibELF: Implement more fully-features dlfcn functionalityGunnar Beutner
This implements more of the dlfcn functionality. Most notably: * It's now possible to dlopen() libraries which were already loaded at program startup time. This does not cause those libraries to be loaded twice. * Errors are reported via dlerror() rather than by crashing the program. * Calls to the dl*() functions are thread-safe.
2021-04-23LibELF: Avoid calculating symbol hashes when we don't need themGunnar Beutner
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-18LibC+LibELF: Implement support for the dl_iterate_phdr helperGunnar Beutner
This helper is used by libgcc_s to figure out where the .eh_frame sections are located for all loaded shared objects.
2021-03-22LibELF: DynamicObject: Add rpath and runpath helpersBrendan Coles
2021-03-21LibELF: DynamicObject: set for_each_symbol/for_each_dynamic_entry publicBrendan Coles
2021-02-24LibELF: Use StringView literal syntax to build section names.Brian Gianforcaro
2021-02-23LibELF: Inline DynamicObject::hash_section()Andreas Kling
This was high up in profiles and gets almost entirely optimized out when inlined, so let's do that.
2021-02-23LibELF: Avoid doing strlen() on everything while iterating GNU hashAndreas Kling
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-23LibELF: Rename lookup_elf_symbol() => lookup_sysv_symbol()Andreas Kling
We have two kinds of lookup, SYSV and GNU hash. Both are ELF lookups.
2021-02-23LibELF: Don't recompute the same ELF hashes over and overAndreas Kling
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-23LibELF: Move ELF hash functions to their own file (and make constexpr)Andreas Kling
2021-02-21LibELF: Move DynamicObject::lookup_symbol() to DynamicLoaderAndreas Kling
Also simplify it by removing an unreachable code path.
2021-02-21LibELF: Make SymbolLookupResult::address a VirtualAddressAndreas Kling
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-21LibELF: Simplify DynamicObject::Symbol class a bitAndreas Kling
We no longer need the create_undefined() helper function. Also we don't need a member field for is_undefined().
2021-02-21LibELF: Make symbol lookup functions return Optional<Symbol>Andreas Kling
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-21LibELF+DynamicLoader: Rename DynamicObject::construct() => create()Andreas Kling
2021-02-21LibELF: Fix various clang-tidy warningsAndreas Kling
Remove a bunch of unused code, unnecessary const, and make some non-object-specific member functions static.
2021-02-20LibELF: Use StringView instead of "const char*" in dynamic linker codeAndreas Kling
There's no reason to use C strings more than absolutely necessary.
2021-02-05LibELF: Only set up PLT trampoline for objects with a PLTAndreas Kling
2021-01-25LibELF: Use Optional<SymbolLookupResult> as a return typeAndreas Kling
Instead of storing a "found" state inside the result object.
2021-01-18LibELF: Remove unused m_global_symbol_lookup_func from DynamicObjectLinus Groh
This was refactored in 3e815ad, leaving this unused member behind.
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling