diff options
| -rw-r--r-- | lld/ELF/DWARF.cpp | 1 | ||||
| -rw-r--r-- | lld/ELF/DWARF.h | 5 | ||||
| -rw-r--r-- | lld/test/ELF/gdb-index-rng-lists.s | 7 |
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. |

