This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Why no error for the unresolved '-u SYMBOL' LD option ??
- From: Nick Clifton <nickc at redhat dot com>
- To: "massimiliano dot guerra at cmz dot it" <massimiliano dot guerra at cmz dot it>
- Cc: "'binutils at sources dot redhat dot com'" <binutils at sources dot redhat dot com>
- Date: Wed, 28 Jan 2004 11:13:51 +0000
- Subject: Re: Why no error for the unresolved '-u SYMBOL' LD option ??
- References: <01C3E43B.CA016BC0.massimiliano.guerra@cmz.it>
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