DebugInfo: Don't emit relocations to abbreviations in debug_info.dwo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204667 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2014-03-24 20:53:02 +00:00
parent f2c696ac66
commit 05e62b507a
3 changed files with 7 additions and 2 deletions

View File

@ -2690,7 +2690,7 @@ DwarfTypeUnit *DwarfDebug::constructSkeletonTU(DwarfTypeUnit *TU) {
// compile units that would normally be in debug_info.
void DwarfDebug::emitDebugInfoDWO() {
assert(useSplitDwarf() && "No split dwarf debug info?");
InfoHolder.emitUnits(this, DwarfAbbrevDWOSectionSym);
InfoHolder.emitUnits(this, nullptr);
}
// Emit the .debug_abbrev.dwo section for separated dwarf. This contains the

View File

@ -2037,7 +2037,11 @@ void DwarfUnit::emitHeader(const MCSymbol *ASectionSym) const {
// We share one abbreviations table across all 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);
if (ASectionSym)
Asm->EmitSectionOffset(ASectionSym, ASectionSym);
else
// Use a constant value in the dwo file, to avoid relocations
Asm->EmitInt32(0);
Asm->OutStreamer.AddComment("Address Size (in bytes)");
Asm->EmitInt8(Asm->getDataLayout().getPointerSize());
}

View File

@ -110,5 +110,6 @@
; OBJ-NEXT: }
; HDR-NOT: .debug_aranges
; HDR-NOT: .rela.{{.*}}.dwo
!9 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}