Can GNU ld be forced to resolve symbols during partial linking ?
Lambert Duijst
l.duijst@scantech-id.com
Mon Sep 9 08:48:00 GMT 2002
Hi all,
I am using GNU ld from binutils 2.13 , it is configured for the h8300-hms
processor (hitachi), but I think the problem I have is a general one.
I want to link two object files together that are both dependant on the same
library. I want to link that certain library statically to both object files,
so they don't contain any more unresolved symbols to functions in the
library. In the final linking step I want to link both object files together,
resolving symbols that are only known in that stage (concerning positions and
sizes of code). I need to have the library available in flash memory and in
ram memory, so I need to link it twice.
I tried partially linking with the -r option and -l options to tell the
linker what library it needs to link. But if I look to such a partially
linked object file with objdump I see that calls to library functions are not
yet resolved , I hoped I would see absolute adresses to funcions in the
assembler code but I don't see them. Apparently ld does not resolve any
symbol in this stage, it does this in the stage where an absolute executable
is linked together, giving me only 2 options. Put the library in memory only
once (which is not what I want) or have the linker compain about double
defined symbols (what it does when I link the library to both object files).
My question is , can ld be forced to resolve all resolvable symbols during a
partial link (with -r) and leaving all other symbols unresolved, to be
resolved in a second linking stage ??
I hope you can help me,
Thanks
Lambert Duijst
More information about the Binutils
mailing list