2003-04-07 16:21:26 +00:00
|
|
|
.\" Copyright (c) 2003 Matthew N. Dodd <winter@jurai.net>
|
2013-09-21 21:03:52 +00:00
|
|
|
.\" Copyright (c) 2013 Dag-Erling Smørgrav
|
2003-04-07 16:21:26 +00:00
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2013-09-21 21:03:52 +00:00
|
|
|
.Dd September 16, 2013
|
2003-04-07 16:21:26 +00:00
|
|
|
.Dt LIBMAP.CONF 5
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm libmap.conf
|
|
|
|
.Nd "configuration file for dynamic object dependency mapping"
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
2003-05-29 21:41:11 +00:00
|
|
|
.Nm libmap
|
2003-04-07 16:21:26 +00:00
|
|
|
functionality of
|
2003-05-29 21:41:11 +00:00
|
|
|
.Xr ld-elf.so.1 1
|
2013-09-21 21:03:52 +00:00
|
|
|
allows dynamic object dependencies to be mapped to arbitrary names.
|
2003-04-07 16:21:26 +00:00
|
|
|
.Pp
|
2013-09-21 21:03:52 +00:00
|
|
|
Each line in
|
|
|
|
.Pa /etc/libmap.conf
|
|
|
|
can have one of five forms:
|
2012-04-30 21:26:35 +00:00
|
|
|
.Bl -tag -width indent
|
2013-09-21 21:03:52 +00:00
|
|
|
.It Ar origin Ar target
|
|
|
|
Whenever a dependency on
|
|
|
|
.Ar origin
|
|
|
|
is encountered while loading a dynamic object, use
|
|
|
|
.Ar target
|
|
|
|
instead of searching for
|
|
|
|
.Ar origin
|
|
|
|
in the normal library search paths.
|
|
|
|
.It Ar path1 Ar path2
|
|
|
|
When iterating through a library search path, replace any element that
|
|
|
|
matches
|
|
|
|
.Ar path1
|
|
|
|
exactly with
|
|
|
|
.Ar path2 .
|
|
|
|
.It Bq Ar constraint
|
|
|
|
Apply
|
|
|
|
.Ar constraint
|
|
|
|
to all subsequent mappings until the next constraint line or the end
|
|
|
|
of the file.
|
|
|
|
See the
|
|
|
|
.Sx Constraints
|
|
|
|
section for details.
|
2012-04-30 21:26:35 +00:00
|
|
|
.It Cm include Ar file
|
|
|
|
Parse the contents of
|
|
|
|
.Ar file
|
|
|
|
before continuing with the current file.
|
2013-09-21 21:03:52 +00:00
|
|
|
Nesting depth is limited only by available memory, but each file
|
|
|
|
encountered is processed only once, and loops are silently ignored.
|
2012-04-30 21:26:35 +00:00
|
|
|
.It Cm includedir Ar dir
|
2013-09-21 21:03:52 +00:00
|
|
|
Recurse through
|
2012-04-30 21:26:35 +00:00
|
|
|
.Ar dir
|
2013-09-21 21:03:52 +00:00
|
|
|
and parse the contents of any file that ends in
|
2012-04-30 21:26:35 +00:00
|
|
|
.Pa .conf
|
|
|
|
before continuing with the current file.
|
2013-09-21 21:03:52 +00:00
|
|
|
Nesting depth is limited only by available memory, but each directory
|
|
|
|
or file encountered is processed only once, and loops are silently
|
|
|
|
ignored.
|
2012-04-30 21:26:35 +00:00
|
|
|
.El
|
2013-09-21 21:03:52 +00:00
|
|
|
.Ss Constraints
|
|
|
|
Constrained mappings only apply when processing binaries or libraries
|
|
|
|
that satisfy the constraint.
|
|
|
|
There are three types of constraints:
|
2004-05-24 01:24:13 +00:00
|
|
|
.Bl -tag -width indent
|
2004-06-16 08:33:57 +00:00
|
|
|
.It Exact
|
2004-05-24 01:24:13 +00:00
|
|
|
The constraint is matched literally so that only an executable with an
|
2013-09-21 21:03:52 +00:00
|
|
|
identical fully qualified pathname will satisfy the constraint.
|
2004-05-24 01:24:13 +00:00
|
|
|
This means that the executable
|
2003-05-29 21:41:11 +00:00
|
|
|
.Pa /usr/bin/foo
|
2013-09-21 21:03:52 +00:00
|
|
|
will not satisfy the constraint
|
|
|
|
.Bq Pa /usr/bin/./foo ,
|
2004-06-05 02:47:08 +00:00
|
|
|
and vice-versa.
|
2004-05-24 01:24:13 +00:00
|
|
|
This is the default constraint type.
|
|
|
|
.It Basename
|
|
|
|
A constraint with no path is matched against the basename of the
|
|
|
|
executable.
|
2013-09-21 21:03:52 +00:00
|
|
|
For instance, the constraint
|
|
|
|
.Bq Pa foo
|
2004-06-16 08:33:57 +00:00
|
|
|
will match
|
2004-05-24 01:24:13 +00:00
|
|
|
.Pa /bin/foo ,
|
|
|
|
.Pa /usr/local/sbin/foo ,
|
2004-06-16 08:33:57 +00:00
|
|
|
or any other executable named
|
2004-05-24 01:24:13 +00:00
|
|
|
.Pa foo ,
|
2013-09-21 21:03:52 +00:00
|
|
|
no matter what directory it is in.
|
2004-05-24 01:24:13 +00:00
|
|
|
.It Directory
|
2013-09-21 21:03:52 +00:00
|
|
|
A constraint with a trailing slash is satisfied if the full pathname
|
|
|
|
begins with the constraint string.
|
|
|
|
For instance, the constraint
|
|
|
|
.Bq Pa /usr/bin/
|
|
|
|
will match any executable with a path starting with
|
|
|
|
.Pa /usr/bin/ .
|
2004-05-24 01:24:13 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
2013-09-21 21:03:52 +00:00
|
|
|
Note that the constraints are matched against the path that was passed
|
|
|
|
as the first argument to whichever
|
|
|
|
.Xr exec 3
|
|
|
|
function was used to execute the binary in question.
|
2004-05-24 01:24:13 +00:00
|
|
|
Most programs executed from a shell are run without a full path, via
|
2013-09-21 21:03:52 +00:00
|
|
|
.Xr execvp 3
|
|
|
|
or similar, so the basename constraint type is the most useful.
|
2003-04-07 16:21:26 +00:00
|
|
|
.Pp
|
2013-09-21 21:03:52 +00:00
|
|
|
.Bf -symbolic
|
2003-05-29 21:41:11 +00:00
|
|
|
WARNING!
|
2013-09-21 21:03:52 +00:00
|
|
|
Constraints apply to all mappings until the next constraint or the end
|
|
|
|
of the file.
|
|
|
|
Hence, unconstrained mappings must be placed at the top of the file.
|
|
|
|
.Ef
|
|
|
|
.Ss ABI compatibility
|
|
|
|
On 64-bit architectures that provide 32-bit binary compatibility, the
|
|
|
|
mappings in
|
|
|
|
.Pa /etc/libmap.conf
|
|
|
|
apply only to 64-bit binaries.
|
|
|
|
Mappings for 32-bit binaries must be placed in
|
2006-03-27 00:53:11 +00:00
|
|
|
.Pa /etc/libmap32.conf .
|
2005-01-21 08:36:40 +00:00
|
|
|
.Sh FILES
|
2006-03-27 00:53:11 +00:00
|
|
|
.Bl -tag -width ".Pa /etc/libmap32.conf" -compact
|
2005-01-21 08:36:40 +00:00
|
|
|
.It Pa /etc/libmap.conf
|
|
|
|
The libmap configuration file.
|
2006-03-27 00:53:11 +00:00
|
|
|
.It Pa /etc/libmap32.conf
|
|
|
|
The libmap configuration file for 32-bit binaries on 64-bit system.
|
2005-01-21 08:36:40 +00:00
|
|
|
.El
|
2004-06-16 08:33:57 +00:00
|
|
|
.Sh EXAMPLES
|
2003-04-07 16:21:26 +00:00
|
|
|
.Bd -literal
|
|
|
|
#
|
2013-09-21 21:03:52 +00:00
|
|
|
# origin target
|
2003-04-07 16:21:26 +00:00
|
|
|
#
|
2005-10-27 16:59:02 +00:00
|
|
|
libc_r.so.6 libpthread.so.2 # Everything that uses 'libc_r'
|
2004-01-31 22:02:03 +00:00
|
|
|
libc_r.so libpthread.so # now uses 'libpthread'
|
|
|
|
|
2004-05-24 01:24:13 +00:00
|
|
|
[/tmp/mplayer] # Test version of mplayer uses libc_r
|
2005-10-27 16:59:02 +00:00
|
|
|
libpthread.so.2 libc_r.so.6
|
2004-01-31 17:56:45 +00:00
|
|
|
libpthread.so libc_r.so
|
2003-04-07 16:21:26 +00:00
|
|
|
|
2004-05-24 01:24:13 +00:00
|
|
|
[/usr/local/jdk1.4.1/] # All Java 1.4.1 programs use libthr
|
|
|
|
# This works because "javavms" executes
|
|
|
|
# programs with the full pathname
|
2005-10-27 16:59:02 +00:00
|
|
|
libpthread.so.2 libthr.so.2
|
2004-01-31 17:56:45 +00:00
|
|
|
libpthread.so libthr.so
|
2005-08-10 21:44:26 +00:00
|
|
|
|
|
|
|
# Glue for Linux-only EPSON printer .so to be loaded into cups, etc.
|
|
|
|
[/usr/local/lib/pips/libsc80c.so]
|
|
|
|
libc.so.6 pluginwrapper/pips.so
|
|
|
|
libdl.so.2 pluginwrapper/pips.so
|
2003-04-07 16:21:26 +00:00
|
|
|
.Ed
|
|
|
|
.Sh SEE ALSO
|
2003-05-29 21:41:11 +00:00
|
|
|
.Xr ldd 1 ,
|
2003-04-07 16:21:26 +00:00
|
|
|
.Xr rtld 1
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
2003-05-29 21:41:11 +00:00
|
|
|
.Nm libmap
|
2013-09-21 21:03:52 +00:00
|
|
|
mechanism first appeared in
|
2003-04-07 16:21:26 +00:00
|
|
|
.Fx 5.1 .
|
|
|
|
.Sh AUTHORS
|
2014-06-23 08:27:27 +00:00
|
|
|
.An -nosplit
|
2003-05-29 21:41:11 +00:00
|
|
|
This manual page was written by
|
2014-06-23 08:27:27 +00:00
|
|
|
.An Matthew N. Dodd Aq Mt winter@jurai.net
|
2013-09-21 21:03:52 +00:00
|
|
|
and extensively rewritten by
|
2014-06-23 08:27:27 +00:00
|
|
|
.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .
|