[llvm] r204667 - DebugInfo: Don't emit relocations to abbreviations in debug_info.dwo

Eric Christopher echristo at gmail.com
Fri Mar 28 16:37:23 PDT 2014


>    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
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=204667&r1=204666&r2=204667&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Mon Mar 24 15:53:02 2014
> @@ -2037,7 +2037,11 @@ void DwarfUnit::emitHeader(const MCSymbo
>    // 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);
>

This comment is probably better up above, with a separate one of
"assume a 0 offset if we haven't had a symbol passed in" here.

-eric



More information about the llvm-commits mailing list