This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Default linker library search paths
- From: Michael Morrell <morrell at alumni dot ucsd dot edu>
- To: Matt Rice <ratmice at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 28 Sep 2009 16:00:15 -0700 (PDT)
- Subject: Re: Default linker library search paths
- Reply-to: morrell at alumni dot ucsd dot edu
Matt,
> 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.
Thanks.
When I run "ld --verbose" with this linker, and grep for SEARCH_DIR, I
get:
SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
So, it looks like it will search the host in places that make sense for
a native linker, but not a cross linker. Do you know if it checks the
architecture at all?
Do you then recommend I take the output from "verbose", delete the SEARCH_DIR line, and pass this in using -T and the only thing I will have
done is limit where -l looks for libraries (I only want it to search
directories explicitly specified using -L).
Michael