bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ld static link problem


From: Nick Clifton
Subject: Re: ld static link problem
Date: Tue, 16 Dec 2003 16:15:56 +0000
User-agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.2 (gnu/linux)

Hi Rene,

>> Hmm - interesting.  Do you get the same error if you run this
>> command by hand ?  (Replacing "collect2" with the linker and 
>> "/var/tmp//ccq0eWgw.o" with "aa.o")

Excellent - that should make debugging this problem easier.

> This is the output

>   . = 0x4000000000001000 + SIZEOF_HEADERS;

And this line is the culprit.

One possible workaround you could try is to take the linker-script
that was output via the "ld --verbose" command, edit this line and
replace the use of SIZEOF_HEADERS with a constant (eg: 32*6) and then
use the "-Wl,-T -Wl,<filename-of-edited-script>" gcc command line
switch to force this new script to be used.

Anyway the problem appears to be this function:
bfd/elf.c:get_program_header_size() which is where the assumption is
made that there will be 5 segments in the executable that the linker
is going to create.  What needs to be done is find out what segments
are really needed for your test case and then work out whether it is
the heuristics in this function that are wrong or whether this is a
feature unique to the 64-bit HPUX target.

Unfortunately I do not have easy access to the 64-bit HPUX machine, so
I am not going to be able to debug this for you.  If you want to have
a go yourself then I would suggest adding some code into
bfd/elf.c:assign_file_positions_for_segments() where is prints out the
error message about there being not enough room.  Make it also tell
you what the 6 segments are, and then compare this with the code in
get_program_header_size() to work out the type of the extra segment.

Cheers
        Nick
        





reply via email to

[Prev in Thread] Current Thread [Next in Thread]