This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Can GNU ld be forced to resolve symbols during partial linking ?
- From: Lambert Duijst <l dot duijst at scantech-id dot com>
- To: binutils at sources dot redhat dot com
- Date: Mon, 9 Sep 2002 17:48:34 +0200
- Subject: Can GNU ld be forced to resolve symbols during partial linking ?
- Organization: scantech-id
- Reply-to: l dot duijst at scantech-id dot com
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