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

Eric Christopher echristo at gmail.com
Thu Apr 3 04:19:49 PDT 2014


On Tue, Apr 1, 2014 at 7:12 PM, David Blaikie <dblaikie at gmail.com> wrote:
> On Fri, Mar 28, 2014 at 4:37 PM, Eric Christopher <echristo at gmail.com> wrote:
>>>    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,
>
> Fair point
>
>> with a separate one of
>> "assume a 0 offset if we haven't had a symbol passed in" here.
>
> Not sure how much value that comment adds - it sort of just seems to
> describe what the code does (which, in 3 lines or so seems fairly
> clear), not why we'd want to do that. Not sure if there's a better
> comment to add there...
>
> in any case, added/modified both these comments in r205386.

Cool, thanks.

-eric



More information about the llvm-commits mailing list