xref: /freebsd/libexec/rtld-elf/rtld_paths.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
133dba3bbSKonstantin Belousov /*-
233dba3bbSKonstantin Belousov  * Copyright 1996, 1997, 1998, 1999, 2000 John D. Polstra.
333dba3bbSKonstantin Belousov  * Copyright 2003 Alexander Kabaev <kan@FreeBSD.ORG>.
433dba3bbSKonstantin Belousov  * All rights reserved.
533dba3bbSKonstantin Belousov  *
633dba3bbSKonstantin Belousov  * Redistribution and use in source and binary forms, with or without
733dba3bbSKonstantin Belousov  * modification, are permitted provided that the following conditions
833dba3bbSKonstantin Belousov  * are met:
933dba3bbSKonstantin Belousov  * 1. Redistributions of source code must retain the above copyright
1033dba3bbSKonstantin Belousov  *    notice, this list of conditions and the following disclaimer.
1133dba3bbSKonstantin Belousov  * 2. Redistributions in binary form must reproduce the above copyright
1233dba3bbSKonstantin Belousov  *    notice, this list of conditions and the following disclaimer in the
1333dba3bbSKonstantin Belousov  *    documentation and/or other materials provided with the distribution.
1433dba3bbSKonstantin Belousov  *
1533dba3bbSKonstantin Belousov  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1633dba3bbSKonstantin Belousov  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1733dba3bbSKonstantin Belousov  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1833dba3bbSKonstantin Belousov  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1933dba3bbSKonstantin Belousov  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2033dba3bbSKonstantin Belousov  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2133dba3bbSKonstantin Belousov  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2233dba3bbSKonstantin Belousov  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2333dba3bbSKonstantin Belousov  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2433dba3bbSKonstantin Belousov  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2533dba3bbSKonstantin Belousov  */
2633dba3bbSKonstantin Belousov 
2733dba3bbSKonstantin Belousov #ifndef _RTLD_PATHS_H
2833dba3bbSKonstantin Belousov #define _RTLD_PATHS_H
2933dba3bbSKonstantin Belousov 
3033dba3bbSKonstantin Belousov #undef _PATH_ELF_HINTS
3133dba3bbSKonstantin Belousov 
32*f940929dSJessica Clarke #ifndef _RTLD_COMPAT_LIB_SUFFIX
33*f940929dSJessica Clarke #ifdef COMPAT_libcompat
34*f940929dSJessica Clarke #define	_RTLD_COMPAT_LIB_SUFFIX	COMPAT_libcompat
35*f940929dSJessica Clarke #else
36*f940929dSJessica Clarke #define	_RTLD_COMPAT_LIB_SUFFIX	""
37*f940929dSJessica Clarke #endif
3833dba3bbSKonstantin Belousov #endif
3933dba3bbSKonstantin Belousov 
40*f940929dSJessica Clarke #ifndef _RTLD_COMPAT_ENV_SUFFIX
41*f940929dSJessica Clarke #ifdef COMPAT_LIBCOMPAT
42*f940929dSJessica Clarke #define	_RTLD_COMPAT_ENV_SUFFIX	COMPAT_LIBCOMPAT "_"
43*f940929dSJessica Clarke #else
44*f940929dSJessica Clarke #define	_RTLD_COMPAT_ENV_SUFFIX	""
45*f940929dSJessica Clarke #endif
46f3401886SKonstantin Belousov #endif
47f3401886SKonstantin Belousov 
48*f940929dSJessica Clarke #ifndef __PATH_ELF_HINTS
49*f940929dSJessica Clarke #define	__PATH_ELF_HINTS(_lc)	"/var/run/ld-elf" _lc ".so.hints"
5033dba3bbSKonstantin Belousov #endif
5133dba3bbSKonstantin Belousov 
5233dba3bbSKonstantin Belousov #ifndef _PATH_ELF_HINTS
53*f940929dSJessica Clarke #define	_PATH_ELF_HINTS		__PATH_ELF_HINTS(_RTLD_COMPAT_LIB_SUFFIX)
5433dba3bbSKonstantin Belousov #endif
5533dba3bbSKonstantin Belousov 
5633dba3bbSKonstantin Belousov #ifndef _PATH_LIBMAP_CONF
57*f940929dSJessica Clarke #define	_PATH_LIBMAP_CONF	"/etc/libmap" _RTLD_COMPAT_LIB_SUFFIX ".conf"
58*f940929dSJessica Clarke #endif
59*f940929dSJessica Clarke 
60*f940929dSJessica Clarke #ifndef __BASENAME_RTLD
61*f940929dSJessica Clarke #define	__BASENAME_RTLD(_lc)	"ld-elf" _lc ".so.1"
6233dba3bbSKonstantin Belousov #endif
6333dba3bbSKonstantin Belousov 
6433dba3bbSKonstantin Belousov #ifndef _BASENAME_RTLD
65*f940929dSJessica Clarke #define	_BASENAME_RTLD		__BASENAME_RTLD(_RTLD_COMPAT_LIB_SUFFIX)
66*f940929dSJessica Clarke #endif
67*f940929dSJessica Clarke 
68*f940929dSJessica Clarke #ifndef __PATH_RTLD
69*f940929dSJessica Clarke #define	__PATH_RTLD(_lc)	"/libexec/" __BASENAME_RTLD(_lc)
7033dba3bbSKonstantin Belousov #endif
7133dba3bbSKonstantin Belousov 
7233dba3bbSKonstantin Belousov #ifndef _PATH_RTLD
73*f940929dSJessica Clarke #define	_PATH_RTLD		__PATH_RTLD(_RTLD_COMPAT_LIB_SUFFIX)
7433dba3bbSKonstantin Belousov #endif
7533dba3bbSKonstantin Belousov 
7633dba3bbSKonstantin Belousov #ifndef STANDARD_LIBRARY_PATH
77*f940929dSJessica Clarke #define	STANDARD_LIBRARY_PATH	"/lib" _RTLD_COMPAT_LIB_SUFFIX ":/usr/lib" _RTLD_COMPAT_LIB_SUFFIX
7833dba3bbSKonstantin Belousov #endif
7933dba3bbSKonstantin Belousov 
8033dba3bbSKonstantin Belousov #ifndef LD_
81*f940929dSJessica Clarke #define	LD_			"LD_" _RTLD_COMPAT_ENV_SUFFIX
8233dba3bbSKonstantin Belousov #endif
8333dba3bbSKonstantin Belousov 
848cc44a1eSKonstantin Belousov #ifndef TOKEN_LIB
85*f940929dSJessica Clarke #define	TOKEN_LIB		"lib" _RTLD_COMPAT_LIB_SUFFIX
86*f940929dSJessica Clarke #endif
87*f940929dSJessica Clarke 
8833dba3bbSKonstantin Belousov #ifdef IN_RTLD
8933dba3bbSKonstantin Belousov extern const char *ld_elf_hints_default;
9033dba3bbSKonstantin Belousov extern const char *ld_path_libmap_conf;
9133dba3bbSKonstantin Belousov extern const char *ld_path_rtld;
9233dba3bbSKonstantin Belousov extern const char *ld_standard_library_path;
9333dba3bbSKonstantin Belousov extern const char *ld_env_prefix;
9433dba3bbSKonstantin Belousov #endif
9533dba3bbSKonstantin Belousov 
9633dba3bbSKonstantin Belousov #endif /* _RTLD_PATHS_H */
97