summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2018-11-13 20:08:13 +0000
committerDavid Blaikie <dblaikie@gmail.com>2018-11-13 20:08:13 +0000
commit27692de9cfa6224f496b982e12ecd3fb86593cc9 (patch)
tree12088e9014d61240f1ad37a0b5e8642964722310 /clang/lib/Driver
parentbb279116f29617467a176f065c8ca4e84174e7f7 (diff)
downloadbcm5719-llvm-27692de9cfa6224f496b982e12ecd3fb86593cc9.tar.gz
bcm5719-llvm-27692de9cfa6224f496b982e12ecd3fb86593cc9.zip
DebugInfo: Add a driver flag for DWARF debug_ranges base address specifier use.
Summary: This saves a lot of relocations in optimized object files (at the cost of some cost/increase in linked executable bytes), but gold's 32 bit gdb-index support has a bug ( https://sourceware.org/bugzilla/show_bug.cgi?id=21894 ) so we can't switch to this unconditionally. (& even if it weren't for that bug, one might argue that some users would want to optimize in one direction or the other - prioritizing object size or linked executable size) Differential Revision: https://reviews.llvm.org/D54243 llvm-svn: 346789
Diffstat (limited to 'clang/lib/Driver')
-rw-r--r--clang/lib/Driver/ToolChains/Clang.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 8de20f6e2e6..0e23aae2183 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -3188,6 +3188,11 @@ static void RenderDebugOptions(const ToolChain &TC, const Driver &D,
? "-gpubnames"
: "-ggnu-pubnames");
+ if (Args.hasFlag(options::OPT_fdebug_ranges_base_address,
+ options::OPT_fno_debug_ranges_base_address, false)) {
+ CmdArgs.push_back("-fdebug-ranges-base-address");
+ }
+
// -gdwarf-aranges turns on the emission of the aranges section in the
// backend.
// Always enabled for SCE tuning.
OpenPOWER on IntegriCloud