llvm-project/lld/test/MachO/tools
Greg McGary 93c8559baf [lld-macho] Implement branch-range-extension thunks
Extend the range of calls beyond an architecture's limited branch range by first calling a thunk, which loads the far address into a scratch register (x16 on ARM64) and branches through it.

Other ports (COFF, ELF) use multiple passes with successively-refined guesses regarding the expansion of text-space imposed by thunk-space overhead. This MachO algorithm places thunks during MergedOutputSection::finalize() in a single pass using exact thunk-space overheads. Thunks are kept in a separate vector to avoid the overhead of inserting into the `inputs` vector of `MergedOutputSection`.

FIXME:
* arm64-stubs.s test is broken
* add thunk tests
* Handle thunks to DylibSymbol in MergedOutputSection::finalize()

Differential Revision: https://reviews.llvm.org/D100818
2021-05-12 09:44:58 -07:00
..
generate-cfi-funcs.py Handle overflow beyond the 127 common encodings limit 2020-12-19 14:54:37 -08:00
generate-thunkable-program.py [lld-macho] Implement branch-range-extension thunks 2021-05-12 09:44:58 -07:00
validate-unwind-info.py [lld-macho] Emit personalities in compact unwind 2021-02-08 13:47:59 -05:00