Certain source files will not produce a .debug_info section. This patch to
google/main adds a check for that case to output_pubnames, preventing a link
failure.

Tested:
        By rebuild and bootstrap.

ChangeLog:

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

        * gcc/dwarf2out.c (output_pubnames): Add check for info_section_emitted.

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 3788cf8..57f18ad 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -8754,7 +8754,7 @@ output_pubnames (VEC (pubname_entry, gc) * names)
   unsigned long pubnames_length = size_of_pubnames (names);
   pubname_ref pub;
 
-  if (!targetm.want_debug_pub_sections)
+  if (!targetm.want_debug_pub_sections || !info_section_emitted)
     return;
   if (names == pubname_table)
     {

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

Reply via email to