Re: [RFA] Work around binutils/15021

Cary Coutant
2013-06-12T18:29:32Z

>> The gold "bug" is that, when using pubnames(/pubtypes) to generate the
>> index, gold doesn't have sufficient info to generate as "accurate" a
>> .gdb_index ("accurate" as in: the CU will have a DW_AT_GNU_pubtypes
>> attribute when it would be better if the TU had that attribute).
>> If those sections are missing then gold falls back to reading all the
>> debug info and using that to generate the index, and when it does that
>> it can generate a better index, and I'm guessing that's what you're
>> seeing.
>
> I get the same .gdb_index content from gold even when I use -gpubnames.

Gold ignores the pubnames sections unless there's a DW_AT_GNU_pubtypes
attribute with a reference class form. If it's just a flag (as trunk
GCC generates), that's not sufficient. (I intend to fix gold to work
with this, but haven't done it yet.) On top of that, GCC doesn't put
that attribute in the TUs at all, so gold will always parse the debug
info in each TU. I think GCC needs to be fixed to emit that attribute
in each TU.

-cary