summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2017-09-07 22:40:54 +0000
committerRui Ueyama <ruiu@google.com>2017-09-07 22:40:54 +0000
commite2f52eb22fdff21122388c420766daebf5852b9a (patch)
treea8bcdb64daf436903be77fa927b9b49c0af615b9
parent84ef7b42586c31f1932d7e6327e36d03e70f3025 (diff)
downloadbcm5719-llvm-e2f52eb22fdff21122388c420766daebf5852b9a.tar.gz
bcm5719-llvm-e2f52eb22fdff21122388c420766daebf5852b9a.zip
Add -no-gdb-index which negates -gdb-index option.
llvm-svn: 312753
-rw-r--r--lld/ELF/Driver.cpp2
-rw-r--r--lld/ELF/Options.td3
-rw-r--r--lld/test/ELF/gdb-index.s4
3 files changed, 8 insertions, 1 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 8ae7ee92eb5..177d33d8f8c 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -645,7 +645,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) {
Config->FilterList = getArgs(Args, OPT_filter);
Config->Fini = Args.getLastArgValue(OPT_fini, "_fini");
Config->GcSections = getArg(Args, OPT_gc_sections, OPT_no_gc_sections, false);
- Config->GdbIndex = Args.hasArg(OPT_gdb_index);
+ Config->GdbIndex = getArg(Args, OPT_gdb_index, OPT_no_gdb_index, false);
Config->ICF = getArg(Args, OPT_icf_all, OPT_icf_none, false);
Config->Init = Args.getLastArgValue(OPT_init, "_init");
Config->LTOAAPipeline = Args.getLastArgValue(OPT_lto_aa_pipeline);
diff --git a/lld/ELF/Options.td b/lld/ELF/Options.td
index f89ca7007fa..ff02dcba0f5 100644
--- a/lld/ELF/Options.td
+++ b/lld/ELF/Options.td
@@ -185,6 +185,9 @@ def no_fatal_warnings: F<"no-fatal-warnings">;
def no_gc_sections: F<"no-gc-sections">,
HelpText<"Disable garbage collection of unused sections">;
+def no_gdb_index: F<"no-gdb-index">,
+ HelpText<"Do not generate .gdb_index section">;
+
def no_gnu_unique: F<"no-gnu-unique">,
HelpText<"Disable STB_GNU_UNIQUE symbol binding">;
diff --git a/lld/test/ELF/gdb-index.s b/lld/test/ELF/gdb-index.s
index e04845e022c..780dc4d27c6 100644
--- a/lld/test/ELF/gdb-index.s
+++ b/lld/test/ELF/gdb-index.s
@@ -35,6 +35,10 @@
# CHECK-NEXT: 1(0x8): 0x90000000 0x90000001
# CHECK-NEXT: 2(0x14): 0x30000001
+# RUN: ld.lld --gdb-index --no-gdb-index -e main %t1.o %t2.o -o %t2
+# RUN: llvm-readobj -sections %t2 | FileCheck -check-prefix=NOGDB %s
+# NOGDB-NOT: Name: .gdb_index
+
## The following section contents are created by this using gcc 7.1.0:
## echo 'int main() { return 0; }' | gcc -gsplit-dwarf -xc++ -S -o- -
OpenPOWER on IntegriCloud