diff options
author | Fangrui Song <i@maskray.me> | 2023-01-05 13:28:48 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2023-01-05 13:28:48 -0800 |
commit | 2aedfdd9b82e6c72a28576d0e8ea854f1300ff4e (patch) | |
tree | b1e64ec2d6a5a3dff075bab5db5ed119d9abd02c /llvm/lib/CodeGen/CommandFlags.cpp | |
parent | 5751c439be7d00427991e8503e618d0c27a56f89 (diff) | |
download | llvm-2aedfdd9b82e6c72a28576d0e8ea854f1300ff4e.zip llvm-2aedfdd9b82e6c72a28576d0e8ea854f1300ff4e.tar.gz llvm-2aedfdd9b82e6c72a28576d0e8ea854f1300ff4e.tar.bz2 |
[CodeGen] Default TargetOptions::RelaxELFRelocations to true
MC and lld/ELF defaults were flipped in 2016. For Clang: CMake
ENABLE_X86_RELAX_RELOCATIONS defaults to on in 2020. It makes sense for
the TargetOptions default to be true now.
R_X86_64_GOTPCRELX/R_X86_64_REX_GOTPCRELX require GNU ld newer than 2015-10
(subsumed by the current requirement of -fbinutils-version=).
This should fix `rustc -Z plt=no` PIC relocatable files with GNU ld.
(See https://github.com/rust-lang/rust/pull/106380)
Diffstat (limited to 'llvm/lib/CodeGen/CommandFlags.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CommandFlags.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/CommandFlags.cpp b/llvm/lib/CodeGen/CommandFlags.cpp index 9ad7c35..48cd8e9 100644 --- a/llvm/lib/CodeGen/CommandFlags.cpp +++ b/llvm/lib/CodeGen/CommandFlags.cpp @@ -359,7 +359,7 @@ codegen::RegisterCodeGenFlags::RegisterCodeGenFlags() { "relax-elf-relocations", cl::desc( "Emit GOTPCRELX/REX_GOTPCRELX instead of GOTPCREL on x86-64 ELF"), - cl::init(false)); + cl::init(true)); CGBINDOPT(RelaxELFRelocations); static cl::opt<bool> DataSections( |