Skip to content

Linker: Use m32 allocator for symbol extras in PEi386 linker

Ben Gamari requested to merge wip/win32-m32 into master

Previously the PEi386 linker had its own ad-hoc treatment of symbol extras which made no particular attempt to ensure that extras remained in the bottom 32-bits of address space. Here we throw out this mechanism and instead teach the existing m32 allocator to work on Windows. Not only does this improve code sharing but it also gives us a far more robust mechanism for ensuring that mappings end up in low memory.

Note that there is somewhat of a trade-off here. The previous scheme ensured that each symbol would have precisely one associated jump island. While in principle this sounds like a good thing, in practice this reserved vast amounts of low memory (since there are many, many symbols) where only very few were ultimately needed. Here we rather allocate a new jump island for each relocation. We could in principle create a hash table to avoid this duplication but it hardly seems the effort given how small these are and how few duplicates there appear to be.

Depends upon !4497 (closed)

Edited by Ben Gamari

Merge request reports