Skip to content

Overhaul the linker

The linker has gained support for aarch64/macho, and aarch64/elf, as well as improved arm/elf code, this code introduces separate mapping of sections into different pages, to allow for W^X protection. This is essentially a requirement on iOS, and I believe a sane default to have. To this extend the symbol extras logic needed to be split up into GOT and PLTs, where the PLTs are allocated alongside the sections, as the architecture may not allow arbitrary jumps (arm/aarch64). The introduction aarch64/elf has also been done through a pseudo interface so that the actual relocation logic can be contained within it's own files.

Ideally we'd improve the linker by migrating the existing (heavily #ifdef'd) to the new separate section mapping (W^X) and pseudo interface approach. The separate section mapping logic has an inherent memory inefficiency (which might be improved a bit by aggregating similar sections into the same page), and might also cause a performance penalty due to separate mapping instead of a single file mmap.

Trac metadata
Trac field Value
Version 8.3
Type Bug
TypeOfFailure OtherFailure
Priority lowest
Resolution Unresolved
Component Compiler (Linking)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information