Bug 25588 - Documentation inaccurate for directories searched when a shared library is requiring another
Summary: Documentation inaccurate for directories searched when a shared library is re...
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.34
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-23 08:34 UTC by Pierre Labastie
Modified: 2020-03-03 12:56 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Labastie 2020-02-23 08:34:20 UTC
The documentation (both in man and info form) under -rpath-link=DIR states:
           The linker uses the following search paths to locate required
           shared libraries:

           1.  Any directories specified by -rpath-link options.
[...]
           8.  For a native linker on an ELF system, if the file
               /etc/ld.so.conf exists, the list of directories found in that
               file.

Actually, studying the code of ldelf.c, I understand that it is <sysroot>/<prefix>/etc/ld.so.conf or <sysroot>/etc/ld.so.conf which is used. Furthermore, if all that fails, it falls back to using the search path of the ld script (or another search path, I am not sure: it uses the "search_head" variable, which may be modified by using a pointer to it, so not easy to follow statically). So I think the doco should have a point:
          9.  On an elf system, falls back to use the search path of....
Comment 1 Sourceware Commits 2020-03-03 12:54:35 UTC
The master branch has been updated by Nick Clifton <nickc@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d8e4137b5efc2dd5e99c45534cdccbdfcc814f1a

commit d8e4137b5efc2dd5e99c45534cdccbdfcc814f1a
Author: Nick Clifton <nickc@redhat.com>
Date:   Tue Mar 3 12:53:00 2020 +0000

    Note that the --rpath-link command line option will search the contents of the SEARCH_DIR linker script directive, if one is provided.
    
    	PR 25588
    	* ld.texi (Options): Update the description of the --rpath-link
    	option.
Comment 2 Nick Clifton 2020-03-03 12:56:11 UTC
Hi Pierre,

  Thanks for pointing out this omission.  I have updated the documentation
  to include the extra item as you suggested.

Cheers
  Nick