This is the mail archive of the binutils@sources.redhat.com 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]

Re: binutils (cvs) target=m68k-linux giving bad value in ld (-shared)


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.



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