[lld] r312753 - Add -no-gdb-index which negates -gdb-index option.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 7 15:40:54 PDT 2017
Author: ruiu
Date: Thu Sep 7 15:40:54 2017
New Revision: 312753
URL: http://llvm.org/viewvc/llvm-project?rev=312753&view=rev
Log:
Add -no-gdb-index which negates -gdb-index option.
Modified:
lld/trunk/ELF/Driver.cpp
lld/trunk/ELF/Options.td
lld/trunk/test/ELF/gdb-index.s
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=312753&r1=312752&r2=312753&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Thu Sep 7 15:40:54 2017
@@ -645,7 +645,7 @@ void LinkerDriver::readConfigs(opt::Inpu
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);
Modified: lld/trunk/ELF/Options.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Options.td?rev=312753&r1=312752&r2=312753&view=diff
==============================================================================
--- lld/trunk/ELF/Options.td (original)
+++ lld/trunk/ELF/Options.td Thu Sep 7 15:40:54 2017
@@ -185,6 +185,9 @@ def no_fatal_warnings: F<"no-fatal-warni
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">;
Modified: lld/trunk/test/ELF/gdb-index.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gdb-index.s?rev=312753&r1=312752&r2=312753&view=diff
==============================================================================
--- lld/trunk/test/ELF/gdb-index.s (original)
+++ lld/trunk/test/ELF/gdb-index.s Thu Sep 7 15:40:54 2017
@@ -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- -
More information about the llvm-commits
mailing list