Default linker library search paths

Matt Rice ratmice@gmail.com
Mon Sep 28 22:46:00 GMT 2009


On Mon, Sep 28, 2009 at 3:34 PM, Michael Morrell
<morrell@alumni.ucsd.edu> wrote:
> I'm reading this snippet from the linker's man page, describing -L:
>
>      The default set of paths searched (without being specified with -L)
>      depends on which emulation mode ld is using, and in some cases also
>      on how it was configured.
>
> I have two questions.
>
> 1) Is there a way to get this list of default paths
>
> 2) Is there any way to get it not to search those paths?
>
> I'm using a cross-linker and am worried that it will happily look for
> libraries on the host machine under /usr/lib even though they aren't the
> ones I want it to find and won't even be the correct architecture.
>
>  Michael
>

I know that you can get ld to output the default linker script when
using --verbose mode, or passing -Wl,--verbose to gcc,

you can also specify a linker script using -T or --script to use a ld
script with a modified set of SEARCH_DIR deals.



More information about the Binutils mailing list