This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [debug] PR42288 emit empty .debug_aranges section


Hi Rainer,

On Tue, 2011-04-26 at 11:22 +0200, Rainer Orth wrote:
> Mark Wielaard <mjw@redhat.com> writes:
> 
> > This PR was put on hold for a while since gdb didn't immediately need
> > it. But the consensus seemed that it was a good idea to always output
> > the address ranges (.debug_arange section) information if a CU
> > (.debug_info section) was emitted. Because the consumer has no way to
> > tell the difference between an empty table that we omitted and failure
> > to generate a table that would have contained data. We recently
> > discussed this again (see PR), and it still seems like a good thing. So
> > here it a patch to just do that:
> 
> I doubt this is a good idea in general: I've seen the following failure
> in the libgo testsuite on IRIX 6.5:
> 
> _gotest_.o ERROR:  dwarf_elf_init:  DW_DLE_DEBUG_ABBREV_NULL 34 .debug_abbrev section present but elf_getdata() failed or section is zero-length
> gotest: warning: no tests matching Test([^a-z].*)? in _gotest_.o _xtest_.o
> 
> elfdump reveals:
> 
> [13]   SHT_MIPS_DWARF        0          0x410      0           .debug_abbrev
>        0          0          0x1        0          0x00000000 
> 
> So at least some linkers and tools get confused by such emtpy sections.

Thanks for testing the patch. Although I am slightly confused how it
ended up producing a .debug_abbrev section that is actually empty. Are
you sure this isn't an existing issue?

The only thing the patch should do (and seems to do on my GNU/Linux
setup) is to explicitly output a .debug_aranges section that is of the
minimum size (so not actually empty, just indicating no ranges are
covered by outputting just the table terminator).

If you could provide me with some more information (I have neither an
IRIX 6.5, nor a libgo setup here) about the created files before/after
the patch that would be appreciated. I might have missed some other
interaction between the debug section output.

Thanks,

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]