DebugInfo: Don't emit relocations to abbreviations in debug_info.dwo
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 24 Mar 2014 20:53:02 +0000 (20:53 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 24 Mar 2014 20:53:02 +0000 (20:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204667 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.cpp
test/DebugInfo/X86/fission-cu.ll

index e396ff9a7f4e356904faf468fee001547172f03f..eb769fe7ae34952850043eeeef1934210f5a4f09 100644 (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
index 4a2b62421dd60bdec41d06f55925cd40c703a810..86005cd3d809b419bacec885ca392c55acd3c230 100644 (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());
 }
index 1591deee5ee18ac43d0f0cd1094ad4c6d55381dd..f1b2acf10b9b88194d6115eb63d6e3804572a0de 100644 (file)
 ; OBJ-NEXT: }
 
 ; HDR-NOT: .debug_aranges
+; HDR-NOT: .rela.{{.*}}.dwo
 
 !9 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}