A dwarf2 bug in gas?

H . J . Lu hjl@lucon.org
Wed May 22 08:39:00 GMT 2002


I have a simple foo.c. gas seems to generate wrong dwarf2 debug info.

# /usr/gcc-3.1/bin/gcc -g -B./   -S foo.c
# /usr/gcc-3.1/bin/gcc -g -B./   -c foo.s
# readelf -dw foo.o > /dev/null
readelf: Warning: Unable to locate entry 115 in the abbreviation table

Any ideas?


H.J.
-------------- next part --------------
int main ()
{
    return 0;
}
-------------- next part --------------
	.file	"foo.c"
	.file 1 "foo.c"
	.section	.debug_abbrev,"",@progbits
.Ldebug_abbrev0:
	.section	.debug_info,"",@progbits
.Ldebug_info0:
	.section	.debug_line,"",@progbits
.Ldebug_line0:
	.text
.Ltext0:
	.align 2
.globl main
	.type	main,@function
main:
.LFB1:
	.loc 1 2 0
	pushl	%ebp
.LCFI0:
	movl	%esp, %ebp
.LCFI1:
	subl	$8, %esp
.LCFI2:
	andl	$-16, %esp
	movl	$0, %eax
	subl	%eax, %esp
	.loc 1 3 0
	movl	$0, %eax
	.loc 1 4 0
	leave
	ret
.LFE1:
.Lfe1:
	.size	main,.Lfe1-main
	.section	.debug_frame,"",@progbits
.Lframe0:
	.long	.LECIE0-.LSCIE0
.LSCIE0:
	.long	0xffffffff
	.byte	0x1
	.string	""
	.uleb128 0x1
	.sleb128 -4
	.byte	0x8
	.byte	0xc
	.uleb128 0x4
	.uleb128 0x4
	.byte	0x88
	.uleb128 0x1
	.align 4
.LECIE0:
.LSFDE0:
	.long	.LEFDE0-.LASFDE0
.LASFDE0:
	.long	.Lframe0
	.long	.LFB1
	.long	.LFE1-.LFB1
	.byte	0x4
	.long	.LCFI0-.LFB1
	.byte	0xe
	.uleb128 0x8
	.byte	0x85
	.uleb128 0x2
	.byte	0x4
	.long	.LCFI1-.LCFI0
	.byte	0xd
	.uleb128 0x5
	.align 4
.LEFDE0:
	.text
.Letext0:
	.section	.debug_info
	.long	0x3f
	.value	0x2
	.long	.Ldebug_abbrev0
	.byte	0x4
	.uleb128 0x1
	.long	.Ldebug_line0
	.long	.Letext0
	.long	.Ltext0
	.long	.LC0
	.long	.LC1
	.long	.LC2
	.byte	0x1
	.uleb128 0x2
	.byte	0x1
	.long	.LC3
	.byte	0x1
	.byte	0x2
	.long	0x3b
	.long	.LFB1
	.long	.LFE1
	.byte	0x1
	.byte	0x55
	.uleb128 0x3
	.string	"int"
	.byte	0x4
	.byte	0x5
	.byte	0x0
	.section	.debug_abbrev
	.uleb128 0x1
	.uleb128 0x11
	.byte	0x1
	.uleb128 0x10
	.uleb128 0x6
	.uleb128 0x12
	.uleb128 0x1
	.uleb128 0x11
	.uleb128 0x1
	.uleb128 0x3
	.uleb128 0xe
	.uleb128 0x1b
	.uleb128 0xe
	.uleb128 0x25
	.uleb128 0xe
	.uleb128 0x13
	.uleb128 0xb
	.byte	0x0
	.byte	0x0
	.uleb128 0x2
	.uleb128 0x2e
	.byte	0x0
	.uleb128 0x3f
	.uleb128 0xc
	.uleb128 0x3
	.uleb128 0xe
	.uleb128 0x3a
	.uleb128 0xb
	.uleb128 0x3b
	.uleb128 0xb
	.uleb128 0x49
	.uleb128 0x13
	.uleb128 0x11
	.uleb128 0x1
	.uleb128 0x12
	.uleb128 0x1
	.uleb128 0x40
	.uleb128 0xa
	.byte	0x0
	.byte	0x0
	.uleb128 0x3
	.uleb128 0x24
	.byte	0x0
	.uleb128 0x3
	.uleb128 0x8
	.uleb128 0xb
	.uleb128 0xb
	.uleb128 0x3e
	.uleb128 0xb
	.byte	0x0
	.byte	0x0
	.byte	0x0
	.section	.debug_pubnames,"",@progbits
	.long	0x17
	.value	0x2
	.long	.Ldebug_info0
	.long	0x43
	.long	0x25
	.string	"main"
	.long	0x0
	.section	.debug_aranges,"",@progbits
	.long	0x1c
	.value	0x2
	.long	.Ldebug_info0
	.byte	0x4
	.byte	0x0
	.value	0x0
	.value	0x0
	.long	.Ltext0
	.long	.Letext0-.Ltext0
	.long	0x0
	.long	0x0
	.section	.debug_str,"MS",@progbits,1
.LC1:
	.string	"/home/hjl/bugs/gas/dwarf"
.LC2:
	.string	"GNU C 3.1"
.LC0:
	.string	"foo.c"
.LC3:
	.string	"main"
	.ident	"GCC: (GNU) 3.1"


More information about the Binutils mailing list