Why no error for the unresolved '-u SYMBOL' LD option ??
Nick Clifton
nickc@redhat.com
Wed Jan 28 11:14:00 GMT 2004
Hi Max,
> I want to force the link (exctract) of some functions from a library
> file (archive).
>
> Then I add this library file in the objects list of the LD and also
> I add the option '-u SYMBOL' where SYMBOL is the name of one of the
> functions I want force to exctract from the previous archive. Ok all
> works good.
>
> But now If I miss to add the library file in the objects list the
> linker LD don't issue any error message. Why ?
Because all that the -u switch does is to tell the linker to include a
section if it contains the undefined symbol. If there are no sections
containing the symbol then nothing is added to the linker's output.
> How I can force an error for this type of undefined symbols ??
Put the symbols you require into an object file and include it on
the linker's command line.
Cheers
Nick
More information about the Binutils
mailing list