summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2019-08-07 22:49:14 +0000
committerDavid Blaikie <dblaikie@gmail.com>2019-08-07 22:49:14 +0000
commit8a480d2cbf8b779ce8bdac27ea1c84cbe7dda04e (patch)
tree8fed41828b0d8b1a8e1b3367c3cbbcb6ae1e9317
parentac136fc51f8f320628d550ed534aa9d30df760df (diff)
downloadbcm5719-llvm-8a480d2cbf8b779ce8bdac27ea1c84cbe7dda04e.tar.gz
bcm5719-llvm-8a480d2cbf8b779ce8bdac27ea1c84cbe7dda04e.zip
gdb-index: Wire up str_offsets section to avoid incorrect error message about offsets_base
There's still a need for a deeper fix to the way libDebugInfoDWARF error messages are propagated up to lld - if lld had exited non-zero on this error message we would've found the issue sooner. llvm-svn: 368229
-rw-r--r--lld/ELF/DWARF.cpp1
-rw-r--r--lld/ELF/DWARF.h5
-rw-r--r--lld/test/ELF/gdb-index-rng-lists.s7
3 files changed, 12 insertions, 1 deletions
diff --git a/lld/ELF/DWARF.cpp b/lld/ELF/DWARF.cpp
index 21c33df3fe4..9ef83caf4f7 100644
--- a/lld/ELF/DWARF.cpp
+++ b/lld/ELF/DWARF.cpp
@@ -38,6 +38,7 @@ template <class ELFT> LLDDwarfObj<ELFT>::LLDDwarfObj(ObjFile<ELFT> *obj) {
.Case(".debug_info", &infoSection)
.Case(".debug_ranges", &rangesSection)
.Case(".debug_rnglists", &rnglistsSection)
+ .Case(".debug_str_offsets", &strOffsetsSection)
.Case(".debug_line", &lineSection)
.Default(nullptr)) {
m->Data = toStringRef(sec->data());
diff --git a/lld/ELF/DWARF.h b/lld/ELF/DWARF.h
index 9f5e477201b..51ec9092f17 100644
--- a/lld/ELF/DWARF.h
+++ b/lld/ELF/DWARF.h
@@ -40,6 +40,10 @@ public:
return rnglistsSection;
}
+ const llvm::DWARFSection &getStrOffsetsSection() const override {
+ return strOffsetsSection;
+ }
+
const llvm::DWARFSection &getLineSection() const override {
return lineSection;
}
@@ -79,6 +83,7 @@ private:
LLDDWARFSection infoSection;
LLDDWARFSection rangesSection;
LLDDWARFSection rnglistsSection;
+ LLDDWARFSection strOffsetsSection;
LLDDWARFSection lineSection;
LLDDWARFSection addrSection;
StringRef abbrevSection;
diff --git a/lld/test/ELF/gdb-index-rng-lists.s b/lld/test/ELF/gdb-index-rng-lists.s
index d853d3bb605..e2a63d77fc2 100644
--- a/lld/test/ELF/gdb-index-rng-lists.s
+++ b/lld/test/ELF/gdb-index-rng-lists.s
@@ -1,8 +1,13 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t1.o
-# RUN: ld.lld --gdb-index %t1.o -o %t
+# RUN: ld.lld --gdb-index %t1.o -o %t 2>&1 | FileCheck --check-prefix=LLD %s
# RUN: llvm-dwarfdump -gdb-index %t | FileCheck %s
+# FIXME: Remove this once lld correctly returns non-zero on errors like this
+# There's no other behavior to test hidden behind this error - lld only parses
+# the CU for the address ranges, it doesn't need to decode any strings.
+# LLD-NOT: error:
+
## The code contains DWARF v5 sections .debug_rnglists and .debug_addr.
## Check we are able to build the correct address
## area using address range lists.
OpenPOWER on IntegriCloud