This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] ldfile.c: Fix the search path ordering for a linker script.
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Kazu Hirata <kazu at codesourcery dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 2 Apr 2009 15:19:27 +1030
- Subject: Re: [patch] ldfile.c: Fix the search path ordering for a linker script.
- References: <20090402025040.9486F6F62056@daisy.codesourcery.com>
On Wed, Apr 01, 2009 at 07:50:40PM -0700, Kazu Hirata wrote:
> http://sourceware.org/ml/binutils-cvs/2008-08/msg00062.html
>
> seems to have changed the search path ordering for a linker script in
> a way that contradicts what the ld documentation says.
There was a reason why I chose that particular search order. Consider
the most common case, where someone invokes ld without giving a -T
or -dT option. If your copy of ld supports built-in scripts then for
the default target you'll always use one of the built-in scripts. If
ld doesn't support built-in scripts, then ld reads the script from
ldscripts/, which is usually installed in $prefix/lib/. Your change
could make ld choose some ldscripts/ other than the one installed
along with the ld binary. For instance, if I build and install a new
version of ld using a prefix of /usr/local, then I always want to use
scripts in /usr/local/lib/ldscripts/. I wouldn't want to pick up the
old system scripts in /usr/lib/ldscripts/ if -L /usr/lib happened to
be passed to ld!
--
Alan Modra
Australia Development Lab, IBM