This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: PATCH: PR gas/11789: Bogus line debug info


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?

  Maciej

binutils-fsf-2.20.51-20100709-dwarf2-fix-0.patch
--- gas/testsuite/gas/elf/dwarf2-3.s	2010-07-09 03:43:48.000000000 +0100
+++ gas/testsuite/gas/elf/dwarf2-3.s	2010-07-09 03:51:20.000000000 +0100
@@ -22,68 +22,68 @@ _evoke_link_warning_foo:
 	.text
 .Letext0:
 	.section	.debug_info
-	.long	0x8a
-	.short  0x2
-	.long	.Ldebug_abbrev0
+	.4byte	0x8a
+	.2byte  0x2
+	.4byte	.Ldebug_abbrev0
 	.byte	0x4
 	.uleb128 0x1
-	.long	.Ldebug_line0
-	.long	.Letext0
-	.long	.Ltext0
-	.long	.LASF4
+	.4byte	.Ldebug_line0
+	.4byte	.Letext0
+	.4byte	.Ltext0
+	.4byte	.LASF4
 	.byte	0x1
-	.long	.LASF5
+	.4byte	.LASF5
 	.uleb128 0x2
-	.long	0x31
-	.long	0x38
+	.4byte	0x31
+	.4byte	0x38
 	.uleb128 0x3
-	.long	0x31
+	.4byte	0x31
 	.byte	0x1a
 	.byte	0x0
 	.uleb128 0x4
-	.long	.LASF0
+	.4byte	.LASF0
 	.byte	0x4
 	.byte	0x7
 	.uleb128 0x5
-	.long	0x3d
+	.4byte	0x3d
 	.uleb128 0x4
-	.long	.LASF1
+	.4byte	.LASF1
 	.byte	0x1
 	.byte	0x6
 	.uleb128 0x6
-	.long	.LASF2
+	.4byte	.LASF2
 	.byte	0x1
 	.byte	0x3
-	.long	0x55
+	.4byte	0x55
 	.byte	0x5
 	.byte	0x3
-	.long	_evoke_link_warning_foo
+	.4byte	_evoke_link_warning_foo
 	.uleb128 0x5
-	.long	0x21
+	.4byte	0x21
 	.uleb128 0x2
-	.long	0x6a
-	.long	0x6c
+	.4byte	0x6a
+	.4byte	0x6c
 	.uleb128 0x3
-	.long	0x31
+	.4byte	0x31
 	.byte	0x0
 	.byte	0x0
 	.uleb128 0x7
 	.byte	0x1
 	.uleb128 0x5
-	.long	0x71
+	.4byte	0x71
 	.uleb128 0x8
 	.byte	0x4
-	.long	0x6a
+	.4byte	0x6a
 	.uleb128 0x6
-	.long	.LASF3
+	.4byte	.LASF3
 	.byte	0x1
 	.byte	0x9
-	.long	0x88
+	.4byte	0x88
 	.byte	0x5
 	.byte	0x3
-	.long	init_array
+	.4byte	init_array
 	.uleb128 0x5
-	.long	0x5a
+	.4byte	0x5a
 	.byte	0x0
 	.section	.debug_abbrev
 	.uleb128 0x1


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