1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:24:58 +00:00

LibC+LibELF: Pass information from linker via magic lookup

This works by defining a set of weak symbols in dynamic linker whose
value would be provided by it. This has the same effect as preloading
library that magically knows right addresses of functions shared between
dynamic linker and LibC.

We were previously passing the same information by rewriting values
based on hardcoded library name, so the new approach seems a little
nicer to me.
This commit is contained in:
Dan Klishch 2024-01-20 16:20:42 -05:00 committed by Andrew Kaster
parent a17041fe7f
commit 982799f7a0
6 changed files with 59 additions and 71 deletions

View file

@ -17,8 +17,8 @@ int errno_storage;
#else
__thread int errno_storage;
#endif
char** environ;
bool __environ_is_malloced;
[[gnu::weak]] char** environ;
bool __environ_is_malloced = false;
bool __stdio_is_initialized;
void* __auxiliary_vector;