mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-09 19:00:20 +02:00
We have been relying on the `YesIKnowImNotSupposedToUseTheGlibcAllocator` fault avoidance for a long while now. The plan was to rewrite the symbol fetching in the future to avoid this since VDSO is kind of special anyway. That time is now, I have had this VDSO symbol parsing code living in a different project for a few months now and it is working great. The basic things here are that the Linux kernel provides the VDSO mapping base pointer through the auxv value `AT_SYSINFO_EHDR`. We then need a minimal ELF parser that /only/ parses the dynamic symbol header (and accompanying string header). Then it's a simple case of walking the symbol table and recording the pointers. Confirmed this fetches all the correct symbols (As I've been using it for a while already I already knew it worked.) This lets us stop allocating memory through the glibc allocator due to dlopen.