This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Work around binutils/15021
- From: Cary Coutant <ccoutant at google dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: Doug Evans <dje at google dot com>, gdb-patches <gdb-patches at sourceware dot org>, Tom Tromey <tromey at redhat dot com>, Sterling Augustine <saugustine at google dot com>, Jakub Jelinek <jakub at redhat dot com>
- Date: Wed, 12 Jun 2013 11:29:30 -0700
- Subject: Re: [RFA] Work around binutils/15021
- References: <yjt24nigsohy dot fsf at ruffy2 dot mtv dot corp dot google dot com> <20130608160421 dot GA10141 at host2 dot jankratochvil dot net> <CADPb22QnTxx6Szx6-sp+buS5sKnaGka_GkZJF0JuEpB_uztQCQ at mail dot gmail dot com> <20130612181619 dot GA13006 at host2 dot jankratochvil dot net>
>> 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