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....
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.
Hi Pierre, Thanks for pointing out this omission. I have updated the documentation to include the extra item as you suggested. Cheers Nick