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] fix DWARF for ia64


Nick Clifton wrote:
Your first patch and this follow on one both look OK, apart from the last part of this second patch:

loc.flags |= DWARF2_FLAG_BASIC_BLOCK;

  -  current.flags &= ~(DWARF2_FLAG_BASIC_BLOCK
  -             | DWARF2_FLAG_PROLOGUE_END
  -             | DWARF2_FLAG_EPILOGUE_BEGIN);
  -
  +  dwarf2_consume_line_info ();
     dwarf2_gen_line_info_1 (label, &loc);

Why are you deleting the update of current.flags ?

It isn't deleted, just moved into the dwarf2_consume_line_info function.



Everything passed as expected with one exception: the ld-ia64/line.exp test fails but I see the same failure without any of my changes.

Hmm, I do not see that failure. In fact I get (trimmed slightly for email):


Running .../ld-ia64/line.exp ...
.../gas/as-new -o tmpdir/undefined.o -x .../ld-ia64/undefined.s
./ld-new -e start -o tmpdir/undefined tmpdir/undefined.o
ld-new: warning: cannot find entry symbol start; defaulting to 40000000000000b0
tmpdir/undefined.o: In function `function':
undefined.c:9: undefined reference to `this_function_is_not_defined'
ld-new: warning: cannot find entry symbol start; defaulting to 40000000000000b0
tmpdir/undefined.o: In function `function':
undefined.c:9: undefined reference to `this_function_is_not_defined'
ld-new: warning: cannot find entry symbol start; defaulting to 40000000000000b0
tmpdir/undefined.o: In function `function':
undefined.c:9: undefined reference to `this_function_is_not_defined'
PASS: undefined line
testcase .../ld-ia64/line.exp completed in 0 seconds


ld fails to show the source line number in an error message. That does seem suspicious. Is this a known problem?

Suspicious yes. Known problem no. The above test was run for an ia64-unknown-linux-gnu toolchain, and I would hope that you would see the same results. Can you investigate a little more please ?

It definitely not related to my change. I have again verified that it happens without any of my changes. I suspect you're using a 64-bit host, since the problem appears to be related to 32-bit hosts.


Here is what I get:

% ia64-unknown-linux-gnu-ld -e start -o undefined undefined.o
ia64-unknown-linux-gnu-ld: warning: cannot find entry symbol start; defaulting to 40000000000000b0
ia64-unknown-linux-gnu-ld: BFD (GNU Binutils) 2.18.50.20071116 assertion fail ../../src/bfd/arange-set.c:667
undefined.o: In function `function':
undefined.c:(.text+0x12): undefined reference to `this_function_is_not_defined'


Notice the assertion failure. The following stack trace shows the problem:

#0  splay_tree_insert (sp=0x81814e0, key=176, value=239)
    at ../../src/libiberty/splay-tree.c:299
#1  0x08093118 in arange_set_splay_tree_insert (set=0x81814ac,
    low=4611686018427388080, high=4611686018427388143, value=0)
    at ../../src/bfd/arange-set.c:455
#2  0x08093aff in arange_set_insert (set=0x81814ac, low=4611686018427388080,
    high=4611686018427388143, value=0) at ../../src/bfd/arange-set.c:660
#3  0x0808db4d in dwarf2_comp_unit_arange_add (unit=0x8181458,
    low=4611686018427388080, high=4611686018427388144)
    at ../../src/bfd/dwarf2.c:1014
#4  0x080908e5 in parse_comp_unit (stash=0x8167cc8, unit_length=76,
    info_ptr_unit=0x8181104 "L", offset_size=4) at ../../src/bfd/dwarf2.c:2353
#5  0x080920bb in find_line (abfd=0x815fb80, section=0x8161e34, offset=18,
    symbol=0x0, symbols=0x8161738, filename_ptr=0xbfc6e314,
    functionname_ptr=0xbfc6e310, linenumber_ptr=0xbfc6e30c, addr_size=4,
    pinfo=0x815ff9c) at ../../src/bfd/dwarf2.c:3303
#6  0x0809237d in _bfd_dwarf2_find_nearest_line (abfd=0x815fb80,
    section=0x8161e34, symbols=0x8161738, offset=18, filename_ptr=0xbfc6e314,
    functionname_ptr=0xbfc6e310, linenumber_ptr=0xbfc6e30c, addr_size=0,
    pinfo=0x815ff9c) at ../../src/bfd/dwarf2.c:3372
#7  0x080b5280 in _bfd_elf_find_nearest_line (abfd=0x815fb80,
    section=0x8161e34, symbols=0x8161738, offset=18, filename_ptr=0xbfc6e314,
    functionname_ptr=0xbfc6e310, line_ptr=0xbfc6e30c)
    at ../../src/bfd/elf.c:7033
#8  0x08065b48 in vfinfo (fp=0x40168560,
    fmt=0x810f30c ": undefined reference to `%T'\n",
    arg=0xbfc6e424 "?\026\b", is_warning=1) at ../../src/ld/ldmisc.c:323
#9  0x08066031 in einfo (fmt=0x810f308 "%X%C: undefined reference to `%T'\n")
    at ../../src/ld/ldmisc.c:465
#10 0x08060b3e in undefined_symbol (info=0x8147940,
    name=0x81676f2 "this_function_is_not_defined", abfd=0x815fb80,
    section=0x8161e34, address=18, error=1) at ../../src/ld/ldmain.c:1362

When arange_set_splay_tree_insert calls splay_tree_insert, the 64-bit "low" and "high" values are truncated to 32-bit "key" and "value".

--Bob


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