PATCH: PR gas/11789: Bogus line debug info

H.J. Lu hjl.tools@gmail.com
Wed Jul 14 14:23:00 GMT 2010


On Thu, Jul 8, 2010 at 8:09 PM, Maciej W. Rozycki
<macro@codesourcery.com> wrote:
> H.J.,
>
> On Mon, 5 Jul 2010, Alan Modra wrote:
>
>> On Sun, Jul 04, 2010 at 11:26:01AM -0700, H.J. Lu wrote:
>> > binutils/testsuite/
>> >
>> > 2009-10-27  H.J. Lu  <hongjiu.lu@intel.com>
>> >
>> >     PR gas/10531
>> >     * binutils-all/objdump.W: Remove bogus line debug info.
>> >
>> > gas/
>> >
>> > 2009-10-27  Jim Wilson  <wilson@codesourcery.com>
>> >
>> >     PR gas/10531
>> >     * dwarf2dbg.c (dwarf2_finish): Don't generate .debug_line section
>> >     if it isn't empty.
>> >
>> > gas/testsuite/
>> >
>> > 2010-07-04  H.J. Lu  <hongjiu.lu@intel.com>
>> >
>> >     * gas/i386/dw2-compress-1.d: Remove bogus line debug info.
>> >
>> > 2009-10-27  H.J. Lu  <hongjiu.lu@intel.com>
>> >
>> >     PR gas/10531
>> >     * gas/elf/dwarf2-1.d: New.
>> >     * gas/elf/dwarf2-1.s: Likewise.
>> >     * gas/elf/dwarf2-2.d: Likewise.
>> >     * gas/elf/dwarf2-2.s: Likewise.
>> >     * gas/elf/dwarf2-3.d: Likewise.
>> >     * gas/elf/dwarf2-3.s: Likewise.
>> >     * gas/i386/debug1.d: Likewise.
>> >     * gas/i386/debug1.s: Likewise.
>> >
>> >     * gas/elf/elf.exp: Run dwarf2-1, dwarf2-2 and dwarf2-3.
>> >
>> >     * gas/i386/i386.exp: Run debug1 for both 32bit and 64bit.
>>
>> OK.
>
>  This caused a regression on MIPS targets:
>
> mips-sde-elf-as   -o dump.o [...]/gas/testsuite/gas/elf/dwarf2-3.s
> Executing on host: sh -c {mips-sde-elf-as   -o dump.o [...]/gas/testsuite/gas/elf/dwarf2-3.s 2>&1}  /dev/null gas.out (timeout = 300)
> mips-sde-elf-readelf  -wl dump.o
> Executing on host: sh -c {mips-sde-elf-readelf  -wl dump.o >dump.out 2>gas.stderr}  /dev/null  (timeout = 300)
> readelf: Warning: Corrupt unit length (0) found in section .debug_info
> readelf: Warning: Unable to load/parse the .debug_info section, so cannot interpret the .debug_line section.
> FAIL: DWARF2 3
>
> mips-gnu-linux is likewise affected.
>
>  A brief look at the contents of your .debug_info section reveals
> non-standard usage of platform-specific GAS directives to emit DWARF-2
> records.  You should be using .2byte, .4byte, etc., that have been
> invented specifically for DWARF records, rather than .short, .long, etc.,
> whose behaviour (size, alignment) is target-dependent.
>
>  The fix below removes the regression, but please be more careful in the
> future.  Thanks.
>
> 2010-07-09  Maciej W. Rozycki  <macro@codesourcery.com>
>
>        gas/testsuite/
>        * gas/elf/dwarf2-3.s: Replace .short and .long directives in
>        .debug_info section with .2byte and .4byte respectively.
>
>  OK to apply?
>

I checked this in as an obvious fix.

Thanks.


-- 
H.J.



More information about the Binutils mailing list