From: pavenis AT lanet DOT lv To: binutils AT sources DOT redhat DOT com Date: Fri, 09 Aug 2002 12:57:06 +0300 MIME-Version: 1.0 Subject: Problem with DWARF2 debug info for DJGPP Cc: djgpp-workers AT delorie DOT com Message-ID: <3D53BC22.16268.856EFE@localhost> X-mailer: Pegasus Mail for Windows (v4.02) Content-type: text/plain; charset=ISO-8859-1 Content-description: Mail message body Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from Quoted-printable to 8bit by delorie.com id g799v9b14592 Reply-To: djgpp-workers AT delorie DOT com I'm getting error message about wrong DWARF2 abbrev when attemting to link program which contains reference to unresolved symbol (targets i[3456]86-pc-msdosdjgpp, binutils version 2.13). See backtrace from GDB below for details. Often I'm also getting a message that abbrev is out of range. This always happens when there is an unresolved reference, so we already have another problem. One of the possible workarounds here could be removing call to _bfd_dwarf2_find_nearest_line() in coff_find_nearest_line() (file coffgen.c), but perhaps it would be best to fix it without removing call. Andris GNU gdb 5.2.1 Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-pc-msdosdjgpp". (gdb) b fprintf Breakpoint 1 at 0x60eb5 (gdb) r Starting program: d:/Devel/binutils/gnu/binutl-2.13/build.djg/ld/ld-new.exe -o f oo.exe c:/djgpp/lib/crt0.o -Lc:/djgpp/lib/gcc-lib/djgpp/3.2 -Lc:/djgpp/bin - Lc:/ djgpp/lib -Lc:/djgpp/lib/gcc-lib/djgpp/3.2/../../.. foo.o -lgcc -lc -lgcc - Tdjgp p-x.djl Breakpoint 1, 0x00060eb5 in fprintf () #0 0x00060eb5 in fprintf () #1 0x00022abf in _bfd_default_error_handler ( s=0x4efe0 "Dwarf Error: Could not find abbrev number %u.") at ../../bfd/bfd.c:419 #2 0x0004f46b in parse_comp_unit (abfd=0xffedff78, stash=0xffeeaac4, unit_length=355, offset_size=4) at ../../bfd/dwarf2.c:1527 #3 0x0004f92f in _bfd_dwarf2_find_nearest_line (abfd=0xffedff78, section=0xfe368, symbols=0x5a6588, offset=38, filename_ptr=0xfd454, functionname_ptr=0xfd458, linenumber_ptr=0xfd45c, addr_size=4, pinfo=0x4) at ../../bfd/dwarf2.c:1912 #4 0x0004168d in coff_find_nearest_line (abfd=0xffedff78, section=0xffee1024, symbols=0x5a6588, offset=38, filename_ptr=0xfd454, functionname_ptr=0xfd458, line_ptr=0xfd45c) at ../../bfd/coffgen.c:2233 #5 0x0001f40a in vfinfo (fp=0x75c00, fmt=0x1bcf2 ": undefined reference to `%T'\n", arg=0xfd590 "˳ò \177 ") at ../../ld/ldmisc.c:284 #6 0x0001fb18 in einfo (fmt=0x1bcf0 "%C: undefined reference to `%T'\n") at ../../ld/ldmisc.c:454 #7 0x0001bf04 in undefined_symbol (info=0x7b758, name=0xffecfcb8 "_foo", abfd=0xffedff78, section=0xffee1024, address=38, fatal=true) at ../../ld/ldmain.c:1260 #8 0x0004627d in _bfd_coff_generic_relocate_section (output_bfd=0xffec96c0, info=0x7b758, input_bfd=0xffedff78, input_section=0xffee1024, contents=0x5aebd0 "Hello", relocs=0x5b0898, syms=0x5a5aa8, sections=0x5a6248) at ../../bfd/cofflink.c:2985 #9 0x00044246 in _bfd_coff_link_input_bfd (finfo=0xfd8b0, input_bfd=0xffedff78) at ../../bfd/cofflink.c:2362 #10 0x0004338e in _bfd_coff_final_link (abfd=0xffec96c0, info=0x7b758) at ../../bfd/cofflink.c:923 #11 0x0001cb90 in ldwrite () at ../../ld/ldwrite.c:540 #12 0x0001a43d in main (argc=0, argv=0x0) at ../../ld/ldmain.c:415 #13 0x000607e7 in __crt1_startup ()