[RFA] Perform relocations in dwarf2.c
Michal Ludvig
mludvig@suse.cz
Fri Oct 25 03:24:00 GMT 2002
Daniel Berlin wrote:
>> You shouldn't be casually deleting
>> code like this if you don't even know what platforms it is for.
>>
>> The list archives would be glad to tell you.
>
> He's also removing the checks for what the standard specifically says is
> the right thing.
>
> If it doesn't work as is, something else is broken, as the code is correct.
It was related to these lines:
bfd/dwarf2.c (_bfd_dwarf2_find_nearest_line()):
1924 if (addr_size == 0)
1925 addr_size = 4;
1926 BFD_ASSERT (addr_size == 4 || addr_size == 8);
From bfd/elf.c (ie. on all platforms except arm, alpha and mips) this
function is called with addr_size==0, it's then reinitialised to 4 -
even on 64b systems. It's a little confusing to have addr_size==4 on
x86-64, so I've "fixed" itby initialising to
get_elf_backend_data(abfd)->s->arch_size/8 instead of 4 in case it was 0
before.
Then the rest ceased to work for me, because offset_size was initialized
to addr_size, ie. 8 on 64b archs, but should have been 4 to let the
.debug_info parser work.
Now I've reverted this change and will follow the rule: "don't fix it
unless it's broken" :-))
Michal Ludvig
--
* SuSE CR, s.r.o * mludvig@suse.cz
* (+420) 296.545.373 * http://www.suse.cz
More information about the Binutils
mailing list