xref: /dflybsd-src/share/man/man5/libmap.conf.5 (revision 70839a950bcee0684fe8435afcece612e92a5382)
1fcf53d9bSJohn Marino.\" Copyright (c) 2003 Matthew N. Dodd <winter@jurai.net>
24e9c0f50SJohn Marino.\" Copyright (c) 2013 Dag-Erling Smørgrav
3fcf53d9bSJohn Marino.\" All rights reserved.
4fcf53d9bSJohn Marino.\"
5fcf53d9bSJohn Marino.\" Redistribution and use in source and binary forms, with or without
6fcf53d9bSJohn Marino.\" modification, are permitted provided that the following conditions
7fcf53d9bSJohn Marino.\" are met:
8fcf53d9bSJohn Marino.\" 1. Redistributions of source code must retain the above copyright
9fcf53d9bSJohn Marino.\"    notice, this list of conditions and the following disclaimer.
10fcf53d9bSJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright
11fcf53d9bSJohn Marino.\"    notice, this list of conditions and the following disclaimer in the
12fcf53d9bSJohn Marino.\"    documentation and/or other materials provided with the distribution.
13fcf53d9bSJohn Marino.\"
14fcf53d9bSJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15fcf53d9bSJohn Marino.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16fcf53d9bSJohn Marino.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17fcf53d9bSJohn Marino.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18fcf53d9bSJohn Marino.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19fcf53d9bSJohn Marino.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20fcf53d9bSJohn Marino.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21fcf53d9bSJohn Marino.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22fcf53d9bSJohn Marino.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23fcf53d9bSJohn Marino.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24fcf53d9bSJohn Marino.\" SUCH DAMAGE.
25fcf53d9bSJohn Marino.\"
264e9c0f50SJohn Marino.\" $FreeBSD: head/share/man/man5/libmap.conf.5 255765 2013-09-21 21:03:52Z des $
27fcf53d9bSJohn Marino.\"
284e9c0f50SJohn Marino.Dd September 16, 2013
29fcf53d9bSJohn Marino.Dt LIBMAP.CONF 5
30fcf53d9bSJohn Marino.Os
31fcf53d9bSJohn Marino.Sh NAME
32fcf53d9bSJohn Marino.Nm libmap.conf
33fcf53d9bSJohn Marino.Nd "configuration file for dynamic object dependency mapping"
34fcf53d9bSJohn Marino.Sh DESCRIPTION
35fcf53d9bSJohn MarinoThe
36fcf53d9bSJohn Marino.Nm libmap
37fcf53d9bSJohn Marinofunctionality of
38*70839a95SSascha Wildner.Xr ld-elf.so.2 1
394e9c0f50SJohn Marinoallows dynamic object dependencies to be mapped to arbitrary names.
40fcf53d9bSJohn Marino.Pp
414e9c0f50SJohn MarinoEach line in
424e9c0f50SJohn Marino.Pa /etc/libmap.conf
434e9c0f50SJohn Marinocan have one of five forms:
4451b1ba8eSJohn Marino.Bl -tag -width indent
454e9c0f50SJohn Marino.It Ar origin Ar target
464e9c0f50SJohn MarinoWhenever a dependency on
474e9c0f50SJohn Marino.Ar origin
484e9c0f50SJohn Marinois encountered while loading a dynamic object, use
494e9c0f50SJohn Marino.Ar target
504e9c0f50SJohn Marinoinstead of searching for
514e9c0f50SJohn Marino.Ar origin
524e9c0f50SJohn Marinoin the normal library search paths.
534e9c0f50SJohn Marino.It Ar path1 Ar path2
544e9c0f50SJohn MarinoWhen iterating through a library search path, replace any element that
554e9c0f50SJohn Marinomatches
564e9c0f50SJohn Marino.Ar path1
574e9c0f50SJohn Marinoexactly with
584e9c0f50SJohn Marino.Ar path2 .
594e9c0f50SJohn Marino.It Bq Ar constraint
604e9c0f50SJohn MarinoApply
614e9c0f50SJohn Marino.Ar constraint
624e9c0f50SJohn Marinoto all subsequent mappings until the next constraint line or the end
634e9c0f50SJohn Marinoof the file.
644e9c0f50SJohn MarinoSee the
654e9c0f50SJohn Marino.Sx Constraints
664e9c0f50SJohn Marinosection for details.
6751b1ba8eSJohn Marino.It Cm include Ar file
6851b1ba8eSJohn MarinoParse the contents of
6951b1ba8eSJohn Marino.Ar file
7051b1ba8eSJohn Marinobefore continuing with the current file.
714e9c0f50SJohn MarinoNesting depth is limited only by available memory, but each file
724e9c0f50SJohn Marinoencountered is processed only once, and loops are silently ignored.
7351b1ba8eSJohn Marino.It Cm includedir Ar dir
744e9c0f50SJohn MarinoRecurse through
7551b1ba8eSJohn Marino.Ar dir
764e9c0f50SJohn Marinoand parse the contents of any file that ends in
7751b1ba8eSJohn Marino.Pa .conf
7851b1ba8eSJohn Marinobefore continuing with the current file.
794e9c0f50SJohn MarinoNesting depth is limited only by available memory, but each directory
804e9c0f50SJohn Marinoor file encountered is processed only once, and loops are silently
814e9c0f50SJohn Marinoignored.
8251b1ba8eSJohn Marino.El
834e9c0f50SJohn Marino.Ss Constraints
844e9c0f50SJohn MarinoConstrained mappings only apply when processing binaries or libraries
854e9c0f50SJohn Marinothat satisfy the constraint.
864e9c0f50SJohn MarinoThere are three types of constraints:
87fcf53d9bSJohn Marino.Bl -tag -width indent
88fcf53d9bSJohn Marino.It Exact
89fcf53d9bSJohn MarinoThe constraint is matched literally so that only an executable with an
904e9c0f50SJohn Marinoidentical fully qualified pathname will satisfy the constraint.
91fcf53d9bSJohn MarinoThis means that the executable
92fcf53d9bSJohn Marino.Pa /usr/bin/foo
934e9c0f50SJohn Marinowill not satisfy the constraint
944e9c0f50SJohn Marino.Bq Pa /usr/bin/./foo ,
95fcf53d9bSJohn Marinoand vice-versa.
96fcf53d9bSJohn MarinoThis is the default constraint type.
97fcf53d9bSJohn Marino.It Basename
98fcf53d9bSJohn MarinoA constraint with no path is matched against the basename of the
99fcf53d9bSJohn Marinoexecutable.
1004e9c0f50SJohn MarinoFor instance, the constraint
1014e9c0f50SJohn Marino.Bq Pa foo
102fcf53d9bSJohn Marinowill match
103fcf53d9bSJohn Marino.Pa /bin/foo ,
104fcf53d9bSJohn Marino.Pa /usr/local/sbin/foo ,
105fcf53d9bSJohn Marinoor any other executable named
106fcf53d9bSJohn Marino.Pa foo ,
1074e9c0f50SJohn Marinono matter what directory it is in.
108fcf53d9bSJohn Marino.It Directory
1094e9c0f50SJohn MarinoA constraint with a trailing slash is satisfied if the full pathname
1104e9c0f50SJohn Marinobegins with the constraint string.
1114e9c0f50SJohn MarinoFor instance, the constraint
1124e9c0f50SJohn Marino.Bq Pa /usr/bin/
1134e9c0f50SJohn Marinowill match any executable with a path starting with
1144e9c0f50SJohn Marino.Pa /usr/bin/ .
115fcf53d9bSJohn Marino.El
116fcf53d9bSJohn Marino.Pp
1174e9c0f50SJohn MarinoNote that the constraints are matched against the path that was passed
1184e9c0f50SJohn Marinoas the first argument to whichever
1194e9c0f50SJohn Marino.Xr exec 3
1204e9c0f50SJohn Marinofunction was used to execute the binary in question.
121fcf53d9bSJohn MarinoMost programs executed from a shell are run without a full path, via
1224e9c0f50SJohn Marino.Xr execvp 3
1234e9c0f50SJohn Marinoor similar, so the basename constraint type is the most useful.
124fcf53d9bSJohn Marino.Pp
1254e9c0f50SJohn Marino.Bf -symbolic
126fcf53d9bSJohn MarinoWARNING!
1274e9c0f50SJohn MarinoConstraints apply to all mappings until the next constraint or the end
1284e9c0f50SJohn Marinoof the file.
1294e9c0f50SJohn MarinoHence, unconstrained mappings must be placed at the top of the file.
1304e9c0f50SJohn Marino.Ef
131fcf53d9bSJohn Marino.Sh FILES
132fcf53d9bSJohn Marino.Bl -tag -width ".Pa /etc/libmap.conf" -compact
133fcf53d9bSJohn Marino.It Pa /etc/libmap.conf
134fcf53d9bSJohn MarinoThe libmap configuration file.
135fcf53d9bSJohn Marino.El
136fcf53d9bSJohn Marino.Sh EXAMPLES
137fcf53d9bSJohn Marino.Bd -literal
138fcf53d9bSJohn Marino#
1394e9c0f50SJohn Marino# candidate		target
140fcf53d9bSJohn Marino#
141fcf53d9bSJohn Marinolibc_r.so.6		libpthread.so.2	# Everything that uses 'libc_r'
142fcf53d9bSJohn Marinolibc_r.so		libpthread.so	# now uses 'libpthread'
143fcf53d9bSJohn Marino
144fcf53d9bSJohn Marino[/tmp/mplayer]		# Test version of mplayer uses libc_r
145fcf53d9bSJohn Marinolibpthread.so.2		libc_r.so.6
146fcf53d9bSJohn Marinolibpthread.so		libc_r.so
147fcf53d9bSJohn Marino
148fcf53d9bSJohn Marino[/usr/local/jdk1.4.1/]	# All Java 1.4.1 programs use libthr
149fcf53d9bSJohn Marino			# This works because "javavms" executes
150fcf53d9bSJohn Marino			# programs with the full pathname
151fcf53d9bSJohn Marinolibpthread.so.2		libthr.so.2
152fcf53d9bSJohn Marinolibpthread.so		libthr.so
153fcf53d9bSJohn Marino
154fcf53d9bSJohn Marino# Glue for Linux-only EPSON printer .so to be loaded into cups, etc.
155fcf53d9bSJohn Marino[/usr/local/lib/pips/libsc80c.so]
156fcf53d9bSJohn Marinolibc.so.6		pluginwrapper/pips.so
157fcf53d9bSJohn Marinolibdl.so.2		pluginwrapper/pips.so
158fcf53d9bSJohn Marino.Ed
159fcf53d9bSJohn Marino.Sh SEE ALSO
160fcf53d9bSJohn Marino.Xr ldd 1 ,
161fcf53d9bSJohn Marino.Xr rtld 1
162fcf53d9bSJohn Marino.Sh HISTORY
163fcf53d9bSJohn MarinoThe
164fcf53d9bSJohn Marino.Nm libmap
1654e9c0f50SJohn Marinomechanism first appeared in
166fcf53d9bSJohn Marino.Fx 5.1 .
167fcf53d9bSJohn Marino.Sh AUTHORS
168fcf53d9bSJohn MarinoThis manual page was written by
1694e9c0f50SJohn Marino.An Matthew N. Dodd Aq Mt winter@jurai.net
1704e9c0f50SJohn Marinoand extensively rewritten by
1714e9c0f50SJohn Marino.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .
172