This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ld: EXTERN/--unresolved & unresolved Symbols
- From: trashmailer <my dot 1337 dot trash dot mail at googlemail dot com>
- To: binutils at sourceware dot org
- Date: Sat, 31 Jul 2010 16:25:09 +0200
- Subject: ld: EXTERN/--unresolved & unresolved Symbols
Hello,
I have got some problems with ld. But first, I do _not_ want to use
shared libraries, they are simply no option for me and what I want to
do, so please, no recommendations on using those.
1) the man pages state that I can use --unresolved=Foo to force symbol
Foo to be unresolved in the output file. Whenever I do that it just does
nothing as far as I can tell (as does EXTERN in a linker script). I
still get an error saying that Foo is unresolved. Is there an example on
how to use it? I have found _nothing_ about it. Can it only be used in
special modes (e.g. only with -Bdynamic or whatever)? What is this
option for anyway, if this does not work?
2) I can use --unresolved-symbols=ignore-all to simply ignore unresolved
symbols. But is there _some_ way to resolve them later by linking a
second time? Basically I link an executable 'foo' that has an unresolved
symbol 'sym'. Now I want to link a second time and use something like
--defsym=sym=0x200 to define 'sym'. When looking at the resulting
executable with nm, 'sym' is shown there to be defined correctly as
0x200, however when executing 'foo' 'sym' is simply 0 (-> undefined).
I know there is an option (-r) for creating relocatable executables
which directly allows for partial linking and would let me do that,
however there are some drawbacks I cannot live with (I do not want to
explain them here; just take it as given :).
Thank you for your help!
trashmailer