This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
Re: symtab/2131: DW_FORM_strp pointing outside of .debug_str section
- From: drow at sources dot redhat dot com
- To: gdb-prs at sources dot redhat dot com, nobody at sources dot redhat dot com, tan at absolute-eda dot com
- Date: 24 Jun 2007 20:25:15 -0000
- Subject: Re: symtab/2131: DW_FORM_strp pointing outside of .debug_str section
- Reply-to: drow at sources dot redhat dot com, gdb-prs at sources dot redhat dot com, nobody at sources dot redhat dot com, tan at absolute-eda dot com, gdb-gnats at sources dot redhat dot com
Synopsis: DW_FORM_strp pointing outside of .debug_str section
State-Changed-From-To: open->closed
State-Changed-By: drow
State-Changed-When: Sun Jun 24 20:25:15 2007
State-Changed-Why:
The submitter sent me a testcase privately. Here's the problem:
[3775] .debug_aranges PROGBITS 00000000 e37201 00e060 00 0 0 1
[3776] .debug_str PROGBITS 00000000 e45261 038b60 00 0 0 1
[3777] .debug_ranges PROGBITS 00000000 e7ddc1 000150 00 0 0 1
[3778] .debug_str PROGBITS 00000000 e7df11 00035b 01 MS 0 0 1
There are two .debug_str sections! The last compilation unit in .debug_info references the second .debug_str section, all the others reference the first. There is nothing in the debug info to specify which section should be used.
I believe that DBX happens to pick the first section named .debug_str. We choose the second; it is the smaller one, so many offsets are invalid.
The binary is broken; this is probably caused by mixed inputs to the Sun linker, which combines sections less aggressively than GNU ld.
http://sourceware.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=2131