From 8b7b35eb01cd4ad471075536f38788752fd533dc Mon Sep 17 00:00:00 2001 From: kn Date: Tue, 14 Jun 2022 09:56:07 +0000 Subject: [PATCH] Document search order Explain when and how LD_LIBRARY_PATH, DT_RUNPATH and DT_RPATH are used. Input OK guenther --- libexec/ld.so/ld.so.1 | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/libexec/ld.so/ld.so.1 b/libexec/ld.so/ld.so.1 index 6a1a8c3071c..9a1bbc1330e 100644 --- a/libexec/ld.so/ld.so.1 +++ b/libexec/ld.so/ld.so.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ld.so.1,v 1.24 2020/05/08 10:57:50 jca Exp $ +.\" $OpenBSD: ld.so.1,v 1.25 2022/06/14 09:56:07 kn Exp $ .\" $NetBSD: rtld.1,v 1.2 1995/10/08 23:43:28 pk Exp $ .\" .\" Copyright (c) 1995 Paul Kranenburg @@ -29,7 +29,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: May 8 2020 $ +.Dd $Mdocdate: June 14 2022 $ .Dt LD.SO 1 .Os .Sh NAME @@ -79,6 +79,34 @@ looked up by hashing on the 3-tuple .Aq library-name , major-version-number , minor-version-number . .Pp .Nm +searches for shared objects in the following lists of paths: +.Pp +.Bl -enum -offset ident -compact +.It +.Ev LD_LIBRARY_PATH +environment variable if set +.It +.Dv DT_RUNPATH +of the calling object if set, otherwise: +.Bl -enum -compact +.It +.Dv DT_RPATH +of the calling object if set +.It +.Dv DT_RPATH +of the program if set +.El +(The use of +.Dv DT_RPATH +is deprecated as its behaviour varies across operating systems.) +.It +default search path set by +.Xr ldconfig 8 +.It +.Pa /usr/lib +.El +.Pp +.Nm recognises a number of environment variables that can be used to modify its behaviour as follows: .Pp -- 2.20.1