From: Ian Lance Taylor Date: Tue, 10 Oct 1995 05:05:18 +0000 (+0000) Subject: * ld.h (args_type): Add rpath_link field. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5caef232bd39883502df77a39c1c6d1114620f56;p=binutils-gdb.git * ld.h (args_type): Add rpath_link field. * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Search for required dependencies in rpath_link path. Only search LD_LIBRARY_PATH when configured native. * lexsup.c (parse_args): Recognize -rpath-link. * ld.1, ld.texinfo: Document -rpath-link. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index d6a0de6c839..2f13b325863 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,12 @@ +Tue Oct 10 01:01:51 1995 Ian Lance Taylor + + * ld.h (args_type): Add rpath_link field. + * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Search for + required dependencies in rpath_link path. Only search + LD_LIBRARY_PATH when configured native. + * lexsup.c (parse_args): Recognize -rpath-link. + * ld.1, ld.texinfo: Document -rpath-link. + Sat Oct 7 17:07:17 1995 Ian Lance Taylor * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Don't diff --git a/ld/ld.1 b/ld/ld.1 index 082bafa981d..d2ace47cdc6 100644 --- a/ld/ld.1 +++ b/ld/ld.1 @@ -82,6 +82,12 @@ ld \- the GNU linker \&\|] .RB "[\|" \-relax "\|]" .RB "[\|" \-r | \-Ur "\|]" +.RB "[\|" "\-rpath\ "\c +.I directory\c +\&\|] +.RB "[\|" "\-rpath\-link\ "\c +.I directory\c +\&\|] .RB "[\|" \-S "\|]" .RB "[\|" \-s "\|]" .RB "[\|" \-shared "\|]" @@ -691,6 +697,56 @@ This option does the same as \c .B \-i\c \&. +.TP +.B \-rpath\ \fIdirectory +Add a directory to the runtime library search path. This is used when +linking an ELF executable with shared objects. All +.B \-rpath +arguments are concatenated and passed to the runtime linker, which uses +them to locate shared objects at runtime. The +.B \-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 +.B \-rpath\-link +option. + +The +.B \-rpath +option may also be used on SunOS. By default, on SunOS, the linker +will form a runtime search patch out of all the +.B \-L +options it is given. If a +.B \-rpath option is used, the runtime search path +will be formed exclusively using the +.B \-rpath +options, ignoring +the +.B \-L +options. This can be useful when using gcc, which adds many +.B \-L +options which may be on NFS mounted filesystems. + +.TP +.B \-rpath\-link\ \fIdirectory +When using ELF, one shared library may require another. This happens +when an +.B ld\ \-shared +link includes a shared library as one of the input files. + +When the linker encounters such a dependency when doing a non-shared, +non-relocateable link, it will automatically try to locate the required +shared library and include it in the link, if it is not included +explicitly. In such a case, the +.B \-rpath\-link +option specifies the first set of directories to search. The +.B \-rpath\-link +option may specify a sequence of directory names either by specifying +a list of names separated by colons, or by appearing multiple times. + +If the required shared library is not found, the linker will issue a +warning and continue with the link. + .TP .B \-S Omits debugger symbol information (but not all symbols) from the output file.