[Google,4.7,Pubnames] Use comp_unit_die offset when no skeleton die exists. (issue6501109)

Submitted by Sterling Augustine on Sept. 7, 2012, 10:27 p.m.

Details

Message ID 20120907222723.0AD89160F48@sterling.mtv.corp.google.com
State New
Headers show

Commit Message

Sterling Augustine Sept. 7, 2012, 10:27 p.m.
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  <saugustine@google.com>

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


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

Comments

Cary Coutant Sept. 7, 2012, 10:44 p.m.
> 2012-09-07  Sterling Augustine  <saugustine@google.com>
>
>         * gcc/dwarf2out.c (output_pubnames): Call comp_unit_die.

OK for google/gcc-4_7.

-cary
Sterling Augustine Sept. 7, 2012, 10:57 p.m.
On Fri, Sep 7, 2012 at 3:44 PM, Cary Coutant <ccoutant@google.com> wrote:
>> 2012-09-07  Sterling Augustine  <saugustine@google.com>
>>
>>         * gcc/dwarf2out.c (output_pubnames): Call comp_unit_die.
>
> OK for google/gcc-4_7.
>
> -cary

Committed as r191084.

Patch hide | download patch | download mbox

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);