-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
6009da0 defaulted to `-Z plt=no` (like `clang -fno-plt`) which a not a useful default[1]. On x86-64, if the target symbol is preemptible, there is an `R_X86_64_GLOB_DAT` relocation, and the (very minor) optimization works as intended. However, if the target is non-preemptible, i.e. the target is resolved to the same component, this is actually a pessimization due to the longer instruction. On RISC architectures, there is typically no single instruction which can load a GOT entry and perform an indirect call. `-fno-plt` has a longer code quence. For example, AArch64 needs 3 instructions: adrp x0, _GLOBAL_OFFSET_TABLE_ ldr x0, [x0, #:gotpage_lo15:bar] br x0 This does not end up with a serious code size issue, because LLVM "RtLibUseGOT" is not implemented for non-x86 targets. On x86-32, very new lld[2] (2022-12-31) is needed to support general-dynamic/local-dynamic TLS models. `-Z plt=no` is not an appropriate default, so just default to true for all targets. [1] https://maskray.me/blog/2021-09-19-all-about-procedure-linkage-table#fno-plt [2] llvm/llvm-project@8dc7366
- Loading branch information
Showing
8 changed files
with
11 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters