From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 14:38:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DDB8106564A; Wed, 1 Apr 2009 14:38:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 112D78FC08; Wed, 1 Apr 2009 14:38:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31EcKVW034594; Wed, 1 Apr 2009 14:38:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31EcKIg034592; Wed, 1 Apr 2009 14:38:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904011438.n31EcKIg034592@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Apr 2009 14:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190624 - in head: lib/libc/gen libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 14:38:21 -0000 Author: kib Date: Wed Apr 1 14:38:20 2009 New Revision: 190624 URL: http://svn.freebsd.org/changeset/base/190624 Log: Document RTLD_NODELETE, -z nodelete and -z origin support. Modified: head/lib/libc/gen/dlopen.3 head/libexec/rtld-elf/rtld.1 Modified: head/lib/libc/gen/dlopen.3 ============================================================================== --- head/lib/libc/gen/dlopen.3 Wed Apr 1 13:44:28 2009 (r190623) +++ head/lib/libc/gen/dlopen.3 Wed Apr 1 14:38:20 2009 (r190624) @@ -32,7 +32,7 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd September 10, 2002 +.Dd April 1, 2009 .Os .Dt DLOPEN 3 .Sh NAME @@ -123,7 +123,7 @@ call to One of the following flags may be ORed into the .Fa mode argument: -.Bl -tag -width RTLD_GLOBALX +.Bl -tag -width RTLD_NODELETE .It Dv RTLD_GLOBAL Symbols from this shared object and its directed acyclic graph (DAG) of needed objects will be available for resolving undefined references @@ -141,6 +141,13 @@ the absolute pathnames of all objects, t With this flag .Fn dlopen will return to the caller only in the case of error. +.It Dv RTLD_NODELETE +Prevents unload of the loaded object on +.Fn dlclose . +The same behaviour may be requested by +.Fl "z nodelete" +option of the static linker +.Xr ld 1 . .El .Pp If Modified: head/libexec/rtld-elf/rtld.1 ============================================================================== --- head/libexec/rtld-elf/rtld.1 Wed Apr 1 13:44:28 2009 (r190623) +++ head/libexec/rtld-elf/rtld.1 Wed Apr 1 14:38:20 2009 (r190624) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 23, 2009 +.Dd April 1, 2009 .Dt RTLD 1 .Os .Sh NAME @@ -58,6 +58,25 @@ to be called on a per-object basis, givi to perform any extra set-up before execution of the program proper begins. This is useful for C++ libraries that contain static constructors. .Pp +When resolving dependencies for the loaded objects, +.Nm +may be allowed to translate dynamic token strings in rpath and soname +by setting +.Fl "z origin" +option of the static linker +.Xr ld 1 . +The following strings are recognized now: +.Bl -tag -width ".Pa $PLATFORM" +.It Pa $ORIGIN +Translated to the full path of the loaded object. +.It Pa $OSNAME +Translated to the name of the operating system implementation. +.It Pa $OSREL +Translated to the release level of the operating system. +.It Pa $PLATFORM +Translated to the machine hardware platform. +.El +.Pp The .Nm utility itself is loaded by the kernel together with any dynamically-linked