cannot undefine with -u option to ld
Nick Clifton
nickc@cambridge.redhat.com
Tue Sep 18 02:53:00 GMT 2001
Hi,
> It appears that when "-u" is used, ld will
> attempt to define the symbol in the usual way
> (library searches, etc), but , if it cannot, it
> fails silently. It inserts the symbol in the
> symbol table, annotates it with UND (to indicate
> that it is undefined), but then completes without
> indicating a warning or an error.
This is actually the accepted behaviour and probably should not be
changed. (There can be quite a few undefined symbol references even
in a fully resolved link).
If you need to force a symbol to be resolved, simply place it into an
object file and then include it on the link command line. eg to force
a reference to "foo":
% cat foo.c
int foo_ref asm ("foo");
% gcc -c foo.c
% gcc myprog.o foo.o
Cheers
Nick
More information about the Binutils
mailing list