This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: binutils (cvs) target=m68k-linux giving bad value in ld (-shared)
- To: "Dr. David Gilbert" <gilbertd at treblig dot org>
- Subject: Re: binutils (cvs) target=m68k-linux giving bad value in ld (-shared)
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Tue, 6 Mar 2001 09:54:17 +1100 (EST)
- cc: binutils at sourceware dot cygnus dot com
On Mon, 5 Mar 2001, Dr. David Gilbert wrote:
> Thanks for the fix - I'll try it in a few days. I'd appreciate an
> explanation of the change.
.._before_allocation was simply the wrong routine to call. The
.._before_allocation function gets called earlier in the link and amongst
other things, sets the size of dynamic sections. Calling it again results
in the size of .dynamic being doubled, but other parts of various data
structures have been set using the original correct size. Later, a sanity
check found a mismatch and caused ld to bomb.
> (I'd chased down into elflink.h and found the
> set_content stuff but didn't really appreciate where that was being called
> from.
Yeah, I did the same thing, found the mismatch between .dynamic _raw_size
and _cooked_size, and put a breakpoint on the backend ..size_dynamic_section
routine to see what was going on. When the breakpoint triggered twice, it
was enough of a clue that something was badly wrong. `bt' under gdb quickly
showed the culprit.
> Is there a 'guided tour round the innards of binutils' anywhere?
Unfortunately, no. You can glean some information from the bfd info doc,
but it's not very detailed.
Alan Modra
--
Linuxcare. Support for the Revolution.