llvm-project/lld/MachO/Arch
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
..
ARM.cpp [lld-macho] Try to unbreak build 2021-05-05 15:47:14 -04:00
ARM64.cpp [lld-macho] Implement branch-range-extension thunks 2021-05-12 09:44:58 -07:00
ARM64Common.cpp [lld-macho] Support subtractor relocations that reference sections 2021-04-20 16:58:57 -04:00
ARM64Common.h [lld-macho] Don't use arrays as template parameters 2021-04-15 21:16:34 -04:00
ARM64_32.cpp [lld-macho] Support subtractor relocations that reference sections 2021-04-20 16:58:57 -04:00
X86_64.cpp [lld-macho] Support subtractor relocations that reference sections 2021-04-20 16:58:57 -04:00