diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-05-29 02:01:14 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-05-29 02:01:14 +0000 |
commit | f8f01c3d59b76c343813429b2b6f0506bbfb34de (patch) | |
tree | e90e3035784c9c89ce68d11085b279d4a95d2db7 /clang/lib/Driver/Tools.cpp | |
parent | fd82f0501fe1b3e0d6f4ba09c0e3169e01e88d7a (diff) | |
download | llvm-f8f01c3d59b76c343813429b2b6f0506bbfb34de.zip llvm-f8f01c3d59b76c343813429b2b6f0506bbfb34de.tar.gz llvm-f8f01c3d59b76c343813429b2b6f0506bbfb34de.tar.bz2 |
Handle -Wa,--mrelax-relocations=[no|yes].
llvm-svn: 271162
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 1c6082e..c6edc2a 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -2797,6 +2797,8 @@ static void CollectArgsForIntegratedAssembler(Compilation &C, // When using an integrated assembler, translate -Wa, and -Xassembler // options. bool CompressDebugSections = false; + + bool UseRelaxRelocations = false; const char *MipsTargetFeature = nullptr; for (const Arg *A : Args.filtered(options::OPT_Wa_COMMA, options::OPT_Xassembler)) { @@ -2872,6 +2874,12 @@ static void CollectArgsForIntegratedAssembler(Compilation &C, } else if (Value == "-nocompress-debug-sections" || Value == "--nocompress-debug-sections") { CompressDebugSections = false; + } else if (Value == "-mrelax-relocations=yes" || + Value == "--mrelax-relocations=yes") { + UseRelaxRelocations = true; + } else if (Value == "-mrelax-relocations=no" || + Value == "--mrelax-relocations=no") { + UseRelaxRelocations = false; } else if (Value.startswith("-I")) { CmdArgs.push_back(Value.data()); // We need to consume the next argument if the current arg is a plain @@ -2903,6 +2911,8 @@ static void CollectArgsForIntegratedAssembler(Compilation &C, else D.Diag(diag::warn_debug_compression_unavailable); } + if (UseRelaxRelocations) + CmdArgs.push_back("--mrelax-relocations"); if (MipsTargetFeature != nullptr) { CmdArgs.push_back("-target-feature"); CmdArgs.push_back(MipsTargetFeature); |