diff mbox

[google/main] Fix erroneous output of pubnames when no .debug_section is emitted. (issue5528054)

Message ID 20120109221849.8A179160CF0@sterling.mtv.corp.google.com
State New
Headers show

Commit Message

Sterling Augustine Jan. 9, 2012, 10:18 p.m. UTC
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  <saugustine@google.com>

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


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

Comments

Cary Coutant Jan. 9, 2012, 11:09 p.m. UTC | #1
> 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  <saugustine@google.com>
>
>        * gcc/dwarf2out.c (output_pubnames): Add check for info_section_emitted.

LGTM.

-cary
diff mbox

Patch

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