You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Copy file name to clipboardExpand all lines: tests/rustdoc-ui/z-help.stdout
+1-3
Original file line number
Diff line number
Diff line change
@@ -107,9 +107,7 @@
107
107
-Z parse-only=val -- parse only; do not compile, assemble, or link (default: no)
108
108
-Z perf-stats=val -- print some performance-related statistics (default: no)
109
109
-Z pick-stable-methods-before-any-unstable=val -- try to pick stable methods first before picking any unstable methods (default: yes)
110
-
-Z plt=val -- whether to use the PLT when calling into shared libraries;
111
-
only has effect for PIC code on systems with ELF binaries
112
-
(default: PLT is disabled if full relro is enabled)
110
+
-Z plt=val -- if false, use GOT-generating code sequences for external function calls. This results in longer code sequences, but may avoid a PLT if the function is not bound locally. Only has effect on ELF systems (default: yes)
0 commit comments