public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] LD/doc: Clarify `-rpath' option's semantics WRT link-time dependencies
@ 2019-06-05 21:15 Maciej Rozycki
  2019-06-07 16:03 ` Nick Clifton
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej Rozycki @ 2019-06-05 21:15 UTC (permalink / raw)
  To: binutils

From: Maciej W. Rozycki <macro@wdc.com>

Mention in the description of the `-rpath' LD option the restrictions 
the option has with respect to searching link-time dependencies of 
shared objects referred in the link.  Previously these restrictions were 
only documented along with the `-rpath-link' option, which may not be 
the place one would consider when looking for the semantics of `-rpath'.

Copy the relevant part of the `-rpath-link' option description then, 
splitting the now overlong paragraph into three, for legibility.

	ld/
	* ld.texi (Options): Also document `-rpath' option restrictions 
	in the description of the option itself.
---
Hi,

 It took me a better part of the day to figure out what was going on with 
`-rpath' being ignored for the purpose of searching link-time dependencies 
with a cross-linker that was configured with no sysroot defined.  As it 
eventually turned out from code inspection it is a feature I have never 
come across before, however documented with the `-rpath-link' option only, 
which is not necessarily the place one would look at for the semantics of 
`-rpath'.

 NB my WDC copyright assignment paperwork for FSF is still in progress, 
however I have not contributed to binutils on behalf of WDC yet and I 
believe the change is small enough to be acceptable right away.

 Verified with `make info pdf' and then visually.  OK to apply then?

  Maciej
---
 ld/ld.texi |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

binutils-ld-doc-rpath-cross.diff
Index: binutils-gdb/ld/ld.texi
===================================================================
--- binutils-gdb.orig/ld/ld.texi
+++ binutils-gdb/ld/ld.texi
@@ -1958,12 +1958,17 @@ line.  It overrides @samp{-s} and @samp{
 Add a directory to the runtime library search path.  This is used when
 linking an ELF executable with shared objects.  All @option{-rpath}
 arguments are concatenated and passed to the runtime linker, which uses
-them to locate shared objects at runtime.  The @option{-rpath} option is
-also used when locating shared objects which are needed by shared
-objects explicitly included in the link; see the description of the
-@option{-rpath-link} option.  If @option{-rpath} is not used when linking an
-ELF executable, the contents of the environment variable
-@code{LD_RUN_PATH} will be used if it is defined.
+them to locate shared objects at runtime.
+
+The @option{-rpath} option is also used when locating shared objects which
+are needed by shared objects explicitly included in the link; see the
+description of the @option{-rpath-link} option.  Searching @option{-rpath}
+in this way is only supported by native linkers and cross linkers which
+have been configured with the @option{--with-sysroot} option.
+
+If @option{-rpath} is not used when linking an ELF executable, the
+contents of the environment variable @code{LD_RUN_PATH} will be used if it
+is defined.
 
 The @option{-rpath} option may also be used on SunOS.  By default, on
 SunOS, the linker will form a runtime search path out of all the

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

* Re: [PATCH] LD/doc: Clarify `-rpath' option's semantics WRT link-time dependencies
  2019-06-05 21:15 [PATCH] LD/doc: Clarify `-rpath' option's semantics WRT link-time dependencies Maciej Rozycki
@ 2019-06-07 16:03 ` Nick Clifton
  2019-06-07 18:28   ` Maciej Rozycki
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Clifton @ 2019-06-07 16:03 UTC (permalink / raw)
  To: Maciej Rozycki, binutils

Hi Maciej,

> 	ld/
> 	* ld.texi (Options): Also document `-rpath' option restrictions 
> 	in the description of the option itself.

Approved - please apply - and welcome back! :-)

Cheers
  Nick


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

* Re: [PATCH] LD/doc: Clarify `-rpath' option's semantics WRT link-time dependencies
  2019-06-07 16:03 ` Nick Clifton
@ 2019-06-07 18:28   ` Maciej Rozycki
  0 siblings, 0 replies; 3+ messages in thread
From: Maciej Rozycki @ 2019-06-07 18:28 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils

Hi Nick,

> > 	ld/
> > 	* ld.texi (Options): Also document `-rpath' option restrictions 
> > 	in the description of the option itself.
> 
> Approved - please apply - and welcome back! :-)

 I'm glad to be onboard.  Applied now, thank you for your review.

  Maciej

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

end of thread, other threads:[~2019-06-07 18:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-05 21:15 [PATCH] LD/doc: Clarify `-rpath' option's semantics WRT link-time dependencies Maciej Rozycki
2019-06-07 16:03 ` Nick Clifton
2019-06-07 18:28   ` Maciej Rozycki

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).