The enclosed patch for Google 4.7 fixes a bug where a pubtype
without a skeleton die would use an offset of zero--but a pubtype
with zero offset doubles as an end of list marker, preventing
gold from including all subsequent pubtypes in gdb index.

This patch fixes it by using an offset of the comp_unit_die instead.

This problem doesn't exist in later editions of the code because
GCC has been patched to ensure that all pubtypes will have a skeleton
die. So this is for Google 4.7 only.

OK for Google 4.7?

Sterling

2012-09-07  Sterling Augustine  <saugust...@google.com>

        * gcc/dwarf2out.c (output_pubnames): Call comp_unit_die.

Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c     (revision 191083)
+++ gcc/dwarf2out.c     (working copy)
@@ -9548,7 +9548,7 @@ output_pubnames (VEC (pubname_entry, gc) * names)
              if (type_node != NULL)
                die_offset = (type_node->skeleton_die != NULL
                              ? type_node->skeleton_die->die_offset
-                             : 0);
+                             : comp_unit_die ()->die_offset);
            }
 
           output_pubname (die_offset, pub);

--
This patch is available for review at http://codereview.appspot.com/6501109

Reply via email to