mirror of
https://github.com/RGBCube/serenity
synced 2025-10-27 02:32:33 +00:00
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
|
||
|---|---|---|
| .. | ||
| Arch | ||
| AuxiliaryVector.h | ||
| CMakeLists.txt | ||
| CoreDump.h | ||
| DynamicLinker.cpp | ||
| DynamicLinker.h | ||
| DynamicLoader.cpp | ||
| DynamicLoader.h | ||
| DynamicObject.cpp | ||
| DynamicObject.h | ||
| Hashes.h | ||
| Image.cpp | ||
| Image.h | ||
| Validation.cpp | ||
| Validation.h | ||