1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-22 21:57:35 +00:00
serenity/Userland/Libraries/LibELF
Gunnar Beutner 73b9cfac1b LibELF: Support weak symbols when using BIND_NOW
When using BIND_NOW (e.g. via -Wl,-z,now) we would fail to load ELF
images while doing relocations when we encounter a weak symbol. Instead
we should just patch the PLT entry with a null pointer.

This can be reproduced with:

$ cat test.cpp
int main()
{
    std::cout << "Hello World!" << std::endl;
}
$ g++ -o test -Wl,-z,now test.cpp
$ ./test
did not find symbol while doing relocations for library test: _ITM_RU1
2021-05-31 11:49:32 +01:00
..
Arch LibELF: Implement x86_64 relocation support 2021-05-03 08:42:39 +02:00
AuxiliaryVector.h Everywhere: "file name" => "filename" 2021-04-29 22:16:18 +02:00
CMakeLists.txt LibELF+LibTest: Fix serenity_install_sources() paths 2021-03-15 09:06:10 +01:00
CoreDump.h Everywhere: Use "the SerenityOS developers." in copyright headers 2021-04-29 00:59:26 +02:00
DynamicLinker.cpp AK+Kernel+LibELF: Remove the need for IteratorDecision::Continue 2021-05-16 10:36:52 +01:00
DynamicLinker.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
DynamicLoader.cpp AK+Userland: Use akaster@serenityos.org for my copyright headers 2021-05-30 14:35:34 +01:00
DynamicLoader.h AK+Userland: Use akaster@serenityos.org for my copyright headers 2021-05-30 14:35:34 +01:00
DynamicObject.cpp LibELF: Support weak symbols when using BIND_NOW 2021-05-31 11:49:32 +01:00
DynamicObject.h AK+Userland: Use akaster@serenityos.org for my copyright headers 2021-05-30 14:35:34 +01:00
Hashes.h AK+Userland: Use akaster@serenityos.org for my copyright headers 2021-05-30 14:35:34 +01:00
Image.cpp LibELF + LibDebug: Reduce allocations during symbolification 2021-05-31 14:09:11 +04:30
Image.h LibELF + LibDebug: Reduce allocations during symbolification 2021-05-31 14:09:11 +04:30
Validation.cpp AK+Userland: Use akaster@serenityos.org for my copyright headers 2021-05-30 14:35:34 +01:00
Validation.h AK+Userland: Use akaster@serenityos.org for my copyright headers 2021-05-30 14:35:34 +01:00