This is the mail archive of the binutils@sources.redhat.com 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: Problem with DWARF2 debug info for DJGPP


> > I'm getting error message about wrong DWARF2 abbrev when attemting to link 
> > program which contains reference to unresolved symbol 
> 
> If you could provide a simple testcase, I'll look into it...
> 

The message is quite easy to reproduce. This testcase will do it:

extern int foo

int main()
{
  return foo;
}

The output of 'gcc -S -gdwarf-2' is below. Does gcc 3.1 for linux produce 
similiar dwarf2 info?

gcc -S -gdwarf-2 produces:
	.file	"x.c"
	.file 1 "x.c"
	.section	.debug_abbrev,""
Ldebug_abbrev0:
	.section	.debug_info,""
Ldebug_info0:
	.section	.debug_line,""
Ldebug_line0:
	.section .text
Ltext0:
	.p2align 1
.globl _main
_main:
LFB1:
	.loc 1 4 0
	pushl	%ebp
LCFI0:
	movl	%esp, %ebp
LCFI1:
	subl	$8, %esp
LCFI2:
	andl	$-16, %esp
	movl	$0, %eax
	subl	%eax, %esp
	.loc 1 5 0
	movl	$1, %eax
	.loc 1 6 0
	leave
	ret
LFE1:
	.section	.debug_frame,""
Lframe0:
	.long	LECIE0-LSCIE0
LSCIE0:
	.long	0xffffffff
	.byte	0x1
	.ascii "\0"
	.uleb128 0x1
	.sleb128 -4
	.byte	0x8
	.byte	0xc
	.uleb128 0x5
	.uleb128 0x4
	.byte	0x88
	.uleb128 0x1
	.p2align 2
LECIE0:
LSFDE0:
	.long	LEFDE0-LASFDE0
LASFDE0:
	.long	Lframe0
	.long	LFB1
	.long	LFE1-LFB1
	.byte	0x4
	.long	LCFI0-LFB1
	.byte	0xe
	.uleb128 0x8
	.byte	0x84
	.uleb128 0x2
	.byte	0x4
	.long	LCFI1-LCFI0
	.byte	0xd
	.uleb128 0x4
	.p2align 2
LEFDE0:
	.section .text
Letext0:
	.section	.debug_info,""
	.long	0x54
	.word	0x2
	.long	Ldebug_abbrev0
	.byte	0x4
	.uleb128 0x1
	.long	Ldebug_line0
	.long	Letext0
	.long	Ltext0
	.ascii "x.c\0"
	.ascii "d:/djgpp/projects\0"
	.ascii "GNU C 3.1\0"
	.byte	0x1
	.uleb128 0x2
	.byte	0x1
	.ascii "main\0"
	.byte	0x1
	.byte	0x4
	.long	0x50
	.long	LFB1
	.long	LFE1
	.byte	0x1
	.byte	0x55
	.uleb128 0x3
	.ascii "int\0"
	.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 0x8
	.uleb128 0x1b
	.uleb128 0x8
	.uleb128 0x25
	.uleb128 0x8
	.uleb128 0x13
	.uleb128 0xb
	.byte	0x0
	.byte	0x0
	.uleb128 0x2
	.uleb128 0x2e
	.byte	0x0
	.uleb128 0x3f
	.uleb128 0xc
	.uleb128 0x3
	.uleb128 0x8
	.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,""
	.long	0x17
	.word	0x2
	.long	Ldebug_info0
	.long	0x58
	.long	0x39
	.ascii "main\0"
	.long	0x0
	.section	.debug_aranges,""
	.long	0x1c
	.word	0x2
	.long	Ldebug_info0
	.byte	0x4
	.byte	0x0
	.word	0x0
	.word	0x0
	.long	Ltext0
	.long	Letext0-Ltext0
	.long	0x0
	.long	0x0
	.ident	"GCC: (GNU) 3.1"

Mark


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