aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-07-03 13:45:48 -0700
committerGitHub <noreply@github.com>2024-07-03 13:45:48 -0700
commit04a1a3482ce3ee00b5bbec1ce852e58410e4b6ad (patch)
tree343a0400ddfa195a4c301821e0d8f3c8f19ca66d /clang/lib/CodeGen/BackendUtil.cpp
parentb5864988b3230324f5426036f45aab43d20a5b94 (diff)
downloadllvm-04a1a3482ce3ee00b5bbec1ce852e58410e4b6ad.zip
llvm-04a1a3482ce3ee00b5bbec1ce852e58410e4b6ad.tar.gz
llvm-04a1a3482ce3ee00b5bbec1ce852e58410e4b6ad.tar.bz2
[Driver] Add -Wa, options --crel and --allow-experimental-crel
The two options are discussed in a few comments around https://github.com/llvm/llvm-project/pull/91280#issuecomment-2099344079 * -Wa,--crel: error "-Wa,--allow-experimental-crel must be specified to use -Wa,--crel..." * -Wa,--allow-experimental-crel: no-op * -Wa,--crel,--allow-experimental-crel: enable CREL in the integrated assembler (#91280) MIPS's little-endian n64 ABI messed up the `r_info` field in relocations. While this could be fixed with CREL, my intention is to avoid complication in assembler/linker. The implementation simply doesn't allow CREL for MIPS. Link: https://discourse.llvm.org/t/rfc-crel-a-compact-relocation-format-for-elf/77600 Pull Request: https://github.com/llvm/llvm-project/pull/97378
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 4195bb8..e765bbf 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -470,6 +470,7 @@ static bool initTargetOptions(DiagnosticsEngine &Diags,
Options.MCOptions.AsmVerbose = CodeGenOpts.AsmVerbose;
Options.MCOptions.Dwarf64 = CodeGenOpts.Dwarf64;
Options.MCOptions.PreserveAsmComments = CodeGenOpts.PreserveAsmComments;
+ Options.MCOptions.Crel = CodeGenOpts.Crel;
Options.MCOptions.X86RelaxRelocations = CodeGenOpts.RelaxELFRelocations;
Options.MCOptions.CompressDebugSections =
CodeGenOpts.getCompressDebugSections();