This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [debug] dwarf2out emits unnecessary null byte in empty .debug_abbrev section
- From: Mark Wielaard <mjw at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 24 Mar 2011 16:54:18 -0400 (EDT)
- Subject: Re: [debug] dwarf2out emits unnecessary null byte in empty .debug_abbrev section
> > /* Terminate the table. */
> > - dw2_asm_output_data (1, 0, NULL);
> > + if (abbrev_die_table_in_use > 1)
> > + dw2_asm_output_data (1, 0, NULL);
>
> I'd prefer this to be handled by
>
> if (abbrev_die_table_in_use == 0)
> return;
>
> at the beginning of the function.
>
> Ok with that change.
I assume you meant the following, since abbrev_die_table_in_use is
initialized to one in dwarf2out_init (). Zero-th entry is not written
to the table (as can be seen from the diff context now).
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -11056,6 +11056,9 @@ output_abbrev_section (void)
{
unsigned long abbrev_id;
+ if (abbrev_die_table_in_use == 1)
+ return;
+
for (abbrev_id = 1; abbrev_id < abbrev_die_table_in_use; ++abbrev_id)
{
dw_die_ref abbrev = abbrev_die_table[abbrev_id];
Still OK?
Thanks,
Mark