This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Default linker library search paths
- From: Matt Rice <ratmice at gmail dot com>
- To: morrell at alumni dot ucsd dot edu
- Cc: binutils at sourceware dot org
- Date: Mon, 28 Sep 2009 15:46:39 -0700
- Subject: Re: Default linker library search paths
- References: <208696.14343.qm@web112615.mail.gq1.yahoo.com>
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.