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

             Bug #: 50497
           Summary: gcc 4.6.x '-g' option no longer emits the
                    .debug_pubnames section
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: debug
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: g...@cray.com


Our performance tool collection relies on the DWARF .debug_pubnames
section to quickly find global symbols. As of GCC 4.6.0 this section is no
longer emitted when -g is specified, imposing an unnecessary hardship upon the
performance tools. Signification problems it causes includes:

1. preventing users of the tool to instrument entry points in user-defined
source code (although -finstrument-functions can circumvent this it requires a
re-compilation of source not previously required)

2. imposing a severe processing overhead penalty if using other means to gather
subprogram details for all globally defined entry points

This bug requests that the .debug_pubnames section again be emitted when -g is
specified. Otherwise, an option should be provided that will allow this as I am
sure other tools have experienced this imposition of a seemingly short-sided
decision (and least I can not find any logical reason why this section was
removed)


Test case:

$ cat abc.c

void a () { }
void b () { }
void c () { }

$

 ** Here is GCC 4.5.3 working: **

$ gcc --version
gcc (GCC) 4.5.3 20110428 (Cray Inc.)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ dwarfdump abc.o           

 <snip>

.debug_pubnames
global a               die-in-sect 45, cu-in-sect 11, die-in-cu 45,
cu-header-in
-sect 0
global b               die-in-sect 71, cu-in-sect 11, die-in-cu 71,
cu-header-in
-sect 0
global c               die-in-sect 97, cu-in-sect 11, die-in-cu 97,
cu-header-in
-sect 0

.debug_macinfo

  <snip>



 ** Here is GCC 4.6.1 not working: **


$ gcc --version
gcc (GCC) 4.6.1 20110627 (Cray Inc.)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ gcc -c -g abc.c
$ dwarfdump abc.o            

 <snip>

.debug_pubnames

.debug_macinfo

 <snip>

Reply via email to