From 193140b0857b2b8b148647fd13a0fb75398417a5 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 4 Dec 2013 18:12:28 +0000 Subject: [PATCH] DebugInfo: Remove unused start/end labels for the debug_abbrevs section Since we always emit only one abbrevation section (shared by all the compilation units in this module) there's no need for a separate label at the start of each one (and we weren't using the CU ID anyway, so there really was only one label). Use the section label instead and drop the wholely unused debug_abbrev_end label. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196394 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 6 ------ lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 6 ++++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index a7056d6a011..be585dc03e7 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2186,9 +2186,6 @@ void DwarfDebug::emitAbbrevs(const MCSection *Section, // Start the debug abbrev section. Asm->OutStreamer.SwitchSection(Section); - MCSymbol *Begin = Asm->GetTempSymbol(Section->getLabelBeginName()); - Asm->OutStreamer.EmitLabel(Begin); - // For each abbrevation. for (unsigned i = 0, N = Abbrevs->size(); i < N; ++i) { // Get abbreviation data @@ -2203,9 +2200,6 @@ void DwarfDebug::emitAbbrevs(const MCSection *Section, // Mark end of abbreviations. Asm->EmitULEB128(0, "EOM(3)"); - - MCSymbol *End = Asm->GetTempSymbol(Section->getLabelEndName()); - Asm->OutStreamer.EmitLabel(End); } } diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index d65862040c5..d3504f8a8f6 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -1980,8 +1980,10 @@ void Unit::emitHeader(const MCSection *ASection, const MCSymbol *ASectionSym) { Asm->OutStreamer.AddComment("DWARF version number"); Asm->EmitInt16(DD->getDwarfVersion()); Asm->OutStreamer.AddComment("Offset Into Abbrev. Section"); - Asm->EmitSectionOffset(Asm->GetTempSymbol(ASection->getLabelBeginName()), - ASectionSym); + // We share one abbreviations table across all compilation units so it's + // always at the start of the section. Use a relocatable offset where needed + // to ensure linking doesn't invalidate that offset. + Asm->EmitSectionOffset(ASectionSym, ASectionSym); Asm->OutStreamer.AddComment("Address Size (in bytes)"); Asm->EmitInt8(Asm->getDataLayout().getPointerSize()); } -- 2.34.1