[lld-macho] Support EH frames under arm64
For arm64, llvm-mc emits relocations for the target function address like so: ltmp: <CIE start> ... <CIE end> ... multiple FDEs ... <FDE start> <target function address - (ltmp + pcrel offset)> ... If any of the FDEs in `multiple FDEs` get dead-stripped, then `FDE start` will move to an earlier address, and `ltmp + pcrel offset` will no longer reflect an accurate pcrel value. To avoid this problem, we "canonicalize" our relocation by adding an `EH_Frame` symbol at `FDE start`, and updating the reloc to be `target function address - (EH_Frame + new pcrel offset)`. Reviewed By: #lld-macho, Roger Differential Revision: https://reviews.llvm.org/D124561
Loading
Please sign in to comment