This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Dwarf reader error from ld
- To: Binutils <binutils at sourceware dot cygnus dot com>
- Subject: Dwarf reader error from ld
- From: Eric DeVolder <devolder at evsx dot com>
- Date: Wed, 12 Jan 2000 18:42:44 -0600
All,
I'm porting binutils (and tweaking gcc) to a new 64bit architecture. I'm
getting the following error message from ld during linking when it
attempts to use a module in a library archive (libgcc.a in this case):
-------------------------------------
/usr/local/comp/e3/gcc/e3-elf/bin/ld: Dwarf Error: found dwarf version
'0' in compilation unit 'ta?}H
Xs ', this reader only handles version 2
information.
/usr/local/comp/e3/gcc/e3-elf/bin/ld: Dwarf Error: found dwarf version
'0' in compilation unit 'ta?}H
Xs ', this reader only handles version 2
information.
libgcc1-test.o: In function `main_without__main':
libgcc1-test.o(.text+0xf8): undefined reference to `__divsi3'
libgcc1-test.o(.text+0x110): undefined reference to `__modsi3'
libgcc1-test.o(.text+0x128): undefined reference to `__udivsi3'
libgcc1-test.o(.text+0x140): undefined reference to `__umodsi3'
libgcc1-test.o(.text+0x1b0): undefined reference to `__divdf3'
libgcc1-test.o(.text+0x200): undefined reference to `__divsf3'
collect2: ld returned 1 exit status
make[1]: *** [libgcc1-test] Error 1
make[1]: Leaving directory `/usr/local/devolder/crossgcc/obj-e3-elf/gcc'
make: *** [all-gcc] Error 2
-------------------------------------
As far as I can tell, the source file looks okay [snippet of gcc -S
below]. Admittedly, I'm not very familiar with Dwarf2, so i an be
thrashed if this is the problem...
-------------------------------------
.file "libgcc2.c"
.version "01.01"
gcc2_compiled.:
.section .debug_abbrev
$Ldebug_abbrev0:
.section .text
$Ltext0:
.section .debug_info
$Ldebug_info0:
.section .debug_line
$Ldebug_line0:
.text
.align 3
.globl __muldi3
.type __muldi3,@function
__muldi3:
$LFB1:
$LBB2:
$LBB3:
$LBB4:
store.d r4, 8(r5)
...more deleted...
$LBE2:
$LFE1:
$Lfe1:
.size __muldi3,$Lfe1-__muldi3
.section .text
$Letext0:
.section .debug_abbrev
.byte 0x1
.byte 0x11
.byte 0x1
.byte 0x3
.byte 0x8
.byte 0x1b
.byte 0x8
.byte 0x25
.byte 0x8
.byte 0x13
.byte 0xb
.byte 0,0
.byte 0x2
.byte 0x2e
.byte 0x0
.byte 0x3f
.byte 0xc
.byte 0x3
.byte 0x8
.byte 0x3a
.byte 0xb
.byte 0x3b
.byte 0x5
.byte 0x11
.byte 0x1
.byte 0x12
.byte 0x1
.byte 0x40
.byte 0xa
.byte 0,0
.byte 0
.section .debug_info
.8byte 0x92
.2byte 0x2
.8byte $Ldebug_abbrev0
.byte 0x8
.byte 0x1
.ascii "../../gcc/gcc/libgcc2.c\0"
.ascii "/usr/local/devolder/crossgcc/obj-e3-elf/gcc\0"
.ascii "GNU C 2.95.2 19991024 (release)\0"
.byte 0x1
.byte 0x2
.byte 0x1
.ascii "__muldi3\0"
.byte 0x1
.2byte 0x125
.8byte $LFB1
.8byte $LFE1
.byte 0x1
.byte 0x55
.byte 0x0
.section .debug_pubnames
.8byte 0x2b
.2byte 0x2
.8byte $Ldebug_info0
.8byte 0x9a
.8byte 0x79
.ascii "__muldi3\0"
.8byte 0x0
.section .debug_aranges
.8byte 0x38
.2byte 0x2
.8byte $Ldebug_info0
.byte 0x8
.byte 0x0
.4byte 0x4,0,0
.8byte $Ltext0
.8byte $Letext0-$Ltext0
.8byte 0x0
.8byte 0x0
.ident "GCC: (GNU) 2.95.2 19991024 (release)"
-------------------------------------
It looks like the Dwarf info is okay. It assembles just fine [objdump
--headers below]
-------------------------------------
dallas % e3-elf-objdump --headers muldi3.o
muldi3.o: file format elf64-e3
Sections:
Idx Name Size VMA LMA File
off Algn
0 .text 000001b8 0000000000000000 0000000000000000
00000040 2**3
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 00000000 0000000000000000 0000000000000000
000001f8 2**0
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000000 0000000000000000 0000000000000000
000001f8 2**0
ALLOC
3 .note 00000014 0000000000000000 0000000000000000
000001f8 2**0
CONTENTS, READONLY
4 .debug_abbrev 00000021 0000000000000000 0000000000000000
0000020c 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_info 0000009a 0000000000000000 0000000000000000
0000022d 2**0
CONTENTS, RELOC, READONLY, DEBUGGING
6 .debug_line 00000000 0000000000000000 0000000000000000
000002c7 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_pubnames 00000033 0000000000000000 0000000000000000
000002c7 2**0
CONTENTS, RELOC, READONLY, DEBUGGING
8 .debug_aranges 00000040 0000000000000000 0000000000000000
000002fa 2**0
CONTENTS, RELOC, READONLY, DEBUGGING
9 .comment 00000026 0000000000000000 0000000000000000
0000033a 2**0
CONTENTS, READONLY
-------------------------------------
Because it is assembling ok, it appears as if binutils is correctly
handling Dwarf2 (ptr size is 8).
Yet, when ld tries to use this file which is in the libgcc.a archive, it
is unable to read it (notice the garbage string in 'compilation unit').
At this point, I can't determine if this is a binutils issue, a
gcc+dwarf2 issue, or both.
Any hints?
Thanks in advance!
Eric