This is the mail archive of the
mailing list for the binutils project.
Re: What is the meaning/purpose of the â=â that sometimes appears in the SEARCH_DIR command in binutils' ldscripts?
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: Cary Coutant <ccoutant at gmail dot com>
- Cc: Kevin Mertes <kmmertes at gmail dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Wed, 8 Jul 2015 19:57:59 -0400 (EDT)
- Subject: Re: What is the meaning/purpose of the â=â that sometimes appears in the SEARCH_DIR command in binutils' ldscripts?
- Authentication-results: sourceware.org; auth=none
- References: <5B3029C5-9EE4-45D6-8096-5F0E2FA36DBD at gmail dot com> <CAJimCsFY9n37c9+shm9RM1YVaXVe6qB6Foy9pa9EbAEi-gpqMw at mail dot gmail dot com> <20150707154834 dot GK17734 at vapier> <CAJimCsFAG7+FoYkKn0f=maRMOX0b86YAtneds6sX_8Jb+FQW+A at mail dot gmail dot com>
On Tue, 7 Jul 2015, Cary Coutant wrote:
> >> The '=' causes ld to add the sysroot to the path. I suspect this is
> >> undocumented because it's an internal implementation detail intended
> >> only for the linker-provided script templates.
> > the latest manual does document it. the one referenced is from binutils-2.12
> > which long predates this functionality.
> > -L searchdir
> > --library-path=searchdir
> > ...
> > If searchdir begins with =, then the = will be replaced by the sysroot prefix,
> > controlled by the `--sysroot' option, or specified when the linker is
> > configured.
> > ...
> > The paths can also be specified in a link script with the SEARCH_DIR command.
> > Directories specified this way are searched at the point in which the linker
> > script appears in the command line.
> > https://sourceware.org/binutils/docs/ld/Options.html
> Oops, sorry, I didn't even think to look at the version number of the
> link provided.
> If it can be found outside the built-in script templates, I guess I
> should implement this feature in gold.
That'd be great. Note that the "="-means-sysroot feature is
also present for other input file paths in linker scripts, since
last October, both for "-quoted and unquoted file paths.
Sorry for not looking into adding this to gold at the time.