public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* ambiguity of ld manual regarding to -L option!!
@ 2010-11-20 10:56 ali hagigat
  2010-11-22 17:35 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: ali hagigat @ 2010-11-20 10:56 UTC (permalink / raw)
  To: binutils

-L searchdir
--library-path=searchdir
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.
-----------------------------------------------------------------------------------------------
I have copied part of ld manual...
Can anyone give an example of how to specify a path for -L by a link script?
When we use -L , we add some paths for search of ld command to find
libraries and link scripts. But what does 'search at the point' mean?
When 'searchdir' is specified by a link script, those paths should be
considered for the whole session of ld, so why the position of link
script is important? and if it is important how those paths are
considered?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ambiguity of ld manual regarding to -L option!!
  2010-11-20 10:56 ambiguity of ld manual regarding to -L option!! ali hagigat
@ 2010-11-22 17:35 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2010-11-22 17:35 UTC (permalink / raw)
  To: ali hagigat; +Cc: binutils

ali hagigat <hagigatali@gmail.com> writes:

> -L searchdir
> --library-path=searchdir
> 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.
> -----------------------------------------------------------------------------------------------
> I have copied part of ld manual...
> Can anyone give an example of how to specify a path for -L by a link script?

SEARCH_DIR(my/dir/ectory)

> When we use -L , we add some paths for search of ld command to find
> libraries and link scripts. But what does 'search at the point' mean?
> When 'searchdir' is specified by a link script, those paths should be
> considered for the whole session of ld, so why the position of link
> script is important? and if it is important how those paths are
> considered?

The position of the linker script is relevant because the order in which
the linker searches -L options is relevant.  If a file exists in more
than one directory mentioned in a -L option, the order of the -L options
determines which file is used.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-22 17:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-20 10:56 ambiguity of ld manual regarding to -L option!! ali hagigat
2010-11-22 17:35 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).