public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/48041] New: dwarf2out emits unnecessary null byte in empty .debug_abbrev section
@ 2011-03-09  9:55 mark at gcc dot gnu.org
  2011-03-25 10:17 ` [Bug debug/48041] " mark at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mark at gcc dot gnu.org @ 2011-03-09  9:55 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48041

           Summary: dwarf2out emits unnecessary null byte in empty
                    .debug_abbrev section
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mark@gcc.gnu.org


Detected by the elfutils dwarflint tool.

Example:
$ echo > empty.c 
$ gcc -g -c empty.c 
$ readelf -x .debug_abbrev empty.o
Hex dump of section '.debug_abbrev':
  0x00000000 00                                  .

Although harmless it might add up if a project has a lot of objects without any
real debuginfo in them. There might not actually be many such projects though.

The fix seems easy:

Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c    (revision 170813)
+++ gcc/dwarf2out.c    (working copy)
@@ -11058,7 +11058,8 @@
     }

   /* Terminate the table.  */
-  dw2_asm_output_data (1, 0, NULL);
+  if (abbrev_die_table_in_use > 1)
+    dw2_asm_output_data (1, 0, NULL);
 }

 /* Output a symbol we can use to refer to this DIE from another CU.  */

Bootstraps fine on x86_64-gnu-linux and no regressions seen with make check -k

I'll submit it to gcc-patches when the tree opens up again for stage one.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debug/48041] dwarf2out emits unnecessary null byte in empty .debug_abbrev section
  2011-03-09  9:55 [Bug debug/48041] New: dwarf2out emits unnecessary null byte in empty .debug_abbrev section mark at gcc dot gnu.org
@ 2011-03-25 10:17 ` mark at gcc dot gnu.org
  2011-03-28  9:32 ` mark at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mark at gcc dot gnu.org @ 2011-03-25 10:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48041

--- Comment #1 from Mark Wielaard <mark at gcc dot gnu.org> 2011-03-25 09:35:44 UTC ---
Author: mark
Date: Fri Mar 25 09:35:41 2011
New Revision: 171441

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171441
Log:
PR debug/48041
* dwarf2out.c (output_abbrev_section): Only write table when
abbrev_die_table_in_use > 1.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debug/48041] dwarf2out emits unnecessary null byte in empty .debug_abbrev section
  2011-03-09  9:55 [Bug debug/48041] New: dwarf2out emits unnecessary null byte in empty .debug_abbrev section mark at gcc dot gnu.org
  2011-03-25 10:17 ` [Bug debug/48041] " mark at gcc dot gnu.org
@ 2011-03-28  9:32 ` mark at gcc dot gnu.org
  2011-06-29 10:22 ` ro at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mark at gcc dot gnu.org @ 2011-03-28  9:32 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48041

Mark Wielaard <mark at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
         AssignedTo|unassigned at gcc dot       |mark at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #2 from Mark Wielaard <mark at gcc dot gnu.org> 2011-03-28 09:10:09 UTC ---
Patch committed.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debug/48041] dwarf2out emits unnecessary null byte in empty .debug_abbrev section
  2011-03-09  9:55 [Bug debug/48041] New: dwarf2out emits unnecessary null byte in empty .debug_abbrev section mark at gcc dot gnu.org
  2011-03-25 10:17 ` [Bug debug/48041] " mark at gcc dot gnu.org
  2011-03-28  9:32 ` mark at gcc dot gnu.org
@ 2011-06-29 10:22 ` ro at gcc dot gnu.org
  2012-03-22  8:47 ` rguenth at gcc dot gnu.org
  2012-03-22  9:31 ` mark at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ro at gcc dot gnu.org @ 2011-06-29 10:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48041

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
   Last reconfirmed|                            |2011.06.29 10:20:52
                 CC|                            |ro at gcc dot gnu.org
         Resolution|FIXED                       |
   Target Milestone|---                         |4.7.0
     Ever Confirmed|0                           |1

--- Comment #3 from Rainer Orth <ro at gcc dot gnu.org> 2011-06-29 10:20:52 UTC ---
Unfortunately, this caused PR debug/49364.  I think the patch should be
reverted
or the .debug_abbrev section not be emitted at all in this case.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debug/48041] dwarf2out emits unnecessary null byte in empty .debug_abbrev section
  2011-03-09  9:55 [Bug debug/48041] New: dwarf2out emits unnecessary null byte in empty .debug_abbrev section mark at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-06-29 10:22 ` ro at gcc dot gnu.org
@ 2012-03-22  8:47 ` rguenth at gcc dot gnu.org
  2012-03-22  9:31 ` mark at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-03-22  8:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48041

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.7.0                       |4.7.1

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-22 08:26:21 UTC ---
GCC 4.7.0 is being released, adjusting target milestone.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debug/48041] dwarf2out emits unnecessary null byte in empty .debug_abbrev section
  2011-03-09  9:55 [Bug debug/48041] New: dwarf2out emits unnecessary null byte in empty .debug_abbrev section mark at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-03-22  8:47 ` rguenth at gcc dot gnu.org
@ 2012-03-22  9:31 ` mark at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mark at gcc dot gnu.org @ 2012-03-22  9:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48041

Mark Wielaard <mark at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Mark Wielaard <mark at gcc dot gnu.org> 2012-03-22 09:22:50 UTC ---
The regression against the mips-sgi-irix vendor tools noted in comment #3 was
fixed in PR debug/49364 through
http://gcc.gnu.org/viewcvs?view=revision&revision=175694


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-22  9:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-09  9:55 [Bug debug/48041] New: dwarf2out emits unnecessary null byte in empty .debug_abbrev section mark at gcc dot gnu.org
2011-03-25 10:17 ` [Bug debug/48041] " mark at gcc dot gnu.org
2011-03-28  9:32 ` mark at gcc dot gnu.org
2011-06-29 10:22 ` ro at gcc dot gnu.org
2012-03-22  8:47 ` rguenth at gcc dot gnu.org
2012-03-22  9:31 ` mark at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).