diff options
| -rw-r--r-- | lld/ELF/OutputSections.cpp | 1 | ||||
| -rw-r--r-- | lld/ELF/OutputSections.h | 1 | ||||
| -rw-r--r-- | lld/ELF/SyntheticSections.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/Writer.cpp | 1 | ||||
| -rw-r--r-- | lld/test/ELF/gdb-index-no-debug.s | 8 |
5 files changed, 9 insertions, 4 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 0e8e406b91d..c2c7f2c0320 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -32,7 +32,6 @@ using namespace lld::elf; uint8_t Out::First; PhdrEntry *Out::TlsPhdr; -OutputSection *Out::DebugInfo; OutputSection *Out::ElfHeader; OutputSection *Out::ProgramHeaders; OutputSection *Out::PreinitArray; diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h index efb6aabe974..c004c1f19bf 100644 --- a/lld/ELF/OutputSections.h +++ b/lld/ELF/OutputSections.h @@ -130,7 +130,6 @@ std::vector<InputSection *> getInputSections(OutputSection* OS); struct Out { static uint8_t First; static PhdrEntry *TlsPhdr; - static OutputSection *DebugInfo; static OutputSection *ElfHeader; static OutputSection *ProgramHeaders; static OutputSection *PreinitArray; diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 92cad5a0ce3..6bf602ce237 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -2595,7 +2595,7 @@ void GdbIndexSection::writeTo(uint8_t *Buf) { } } -bool GdbIndexSection::empty() const { return !Out::DebugInfo; } +bool GdbIndexSection::empty() const { return Chunks.empty(); } EhFrameHeader::EhFrameHeader() : SyntheticSection(SHF_ALLOC, SHT_PROGBITS, 4, ".eh_frame_hdr") {} diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 64839afa412..d76141844fe 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1533,7 +1533,6 @@ static bool computeIsPreemptible(const Symbol &B) { // Create output section objects and add them to OutputSections. template <class ELFT> void Writer<ELFT>::finalizeSections() { - Out::DebugInfo = findSection(".debug_info"); Out::PreinitArray = findSection(".preinit_array"); Out::InitArray = findSection(".init_array"); Out::FiniArray = findSection(".fini_array"); diff --git a/lld/test/ELF/gdb-index-no-debug.s b/lld/test/ELF/gdb-index-no-debug.s new file mode 100644 index 00000000000..dba5fcf2638 --- /dev/null +++ b/lld/test/ELF/gdb-index-no-debug.s @@ -0,0 +1,8 @@ +# REQUIRES: x86 +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o +# RUN: ld.lld -o %t.exe -gdb-index %t.o +# RUN: llvm-objdump --section-headers %t.exe | FileCheck %s +# CHECK-NOT: .gdb_index + +.global _start +_start: |

