xref: /freebsd/libexec/rtld-elf/rtld_paths.h (revision f940929d411102d6925e158de90d8d23b3774df6)
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  * $FreeBSD$
2733dba3bbSKonstantin Belousov  */
2833dba3bbSKonstantin Belousov 
2933dba3bbSKonstantin Belousov #ifndef _RTLD_PATHS_H
3033dba3bbSKonstantin Belousov #define _RTLD_PATHS_H
3133dba3bbSKonstantin Belousov 
3233dba3bbSKonstantin Belousov #undef _PATH_ELF_HINTS
3333dba3bbSKonstantin Belousov 
34*f940929dSJessica Clarke #ifndef _RTLD_COMPAT_LIB_SUFFIX
35*f940929dSJessica Clarke #ifdef COMPAT_libcompat
36*f940929dSJessica Clarke #define	_RTLD_COMPAT_LIB_SUFFIX	COMPAT_libcompat
37*f940929dSJessica Clarke #else
38*f940929dSJessica Clarke #define	_RTLD_COMPAT_LIB_SUFFIX	""
39*f940929dSJessica Clarke #endif
4033dba3bbSKonstantin Belousov #endif
4133dba3bbSKonstantin Belousov 
42*f940929dSJessica Clarke #ifndef _RTLD_COMPAT_ENV_SUFFIX
43*f940929dSJessica Clarke #ifdef COMPAT_LIBCOMPAT
44*f940929dSJessica Clarke #define	_RTLD_COMPAT_ENV_SUFFIX	COMPAT_LIBCOMPAT "_"
45*f940929dSJessica Clarke #else
46*f940929dSJessica Clarke #define	_RTLD_COMPAT_ENV_SUFFIX	""
47*f940929dSJessica Clarke #endif
48f3401886SKonstantin Belousov #endif
49f3401886SKonstantin Belousov 
50*f940929dSJessica Clarke #ifndef __PATH_ELF_HINTS
51*f940929dSJessica Clarke #define	__PATH_ELF_HINTS(_lc)	"/var/run/ld-elf" _lc ".so.hints"
5233dba3bbSKonstantin Belousov #endif
5333dba3bbSKonstantin Belousov 
5433dba3bbSKonstantin Belousov #ifndef _PATH_ELF_HINTS
55*f940929dSJessica Clarke #define	_PATH_ELF_HINTS		__PATH_ELF_HINTS(_RTLD_COMPAT_LIB_SUFFIX)
5633dba3bbSKonstantin Belousov #endif
5733dba3bbSKonstantin Belousov 
5833dba3bbSKonstantin Belousov #ifndef _PATH_LIBMAP_CONF
59*f940929dSJessica Clarke #define	_PATH_LIBMAP_CONF	"/etc/libmap" _RTLD_COMPAT_LIB_SUFFIX ".conf"
60*f940929dSJessica Clarke #endif
61*f940929dSJessica Clarke 
62*f940929dSJessica Clarke #ifndef __BASENAME_RTLD
63*f940929dSJessica Clarke #define	__BASENAME_RTLD(_lc)	"ld-elf" _lc ".so.1"
6433dba3bbSKonstantin Belousov #endif
6533dba3bbSKonstantin Belousov 
6633dba3bbSKonstantin Belousov #ifndef _BASENAME_RTLD
67*f940929dSJessica Clarke #define	_BASENAME_RTLD		__BASENAME_RTLD(_RTLD_COMPAT_LIB_SUFFIX)
68*f940929dSJessica Clarke #endif
69*f940929dSJessica Clarke 
70*f940929dSJessica Clarke #ifndef __PATH_RTLD
71*f940929dSJessica Clarke #define	__PATH_RTLD(_lc)	"/libexec/" __BASENAME_RTLD(_lc)
7233dba3bbSKonstantin Belousov #endif
7333dba3bbSKonstantin Belousov 
7433dba3bbSKonstantin Belousov #ifndef _PATH_RTLD
75*f940929dSJessica Clarke #define	_PATH_RTLD		__PATH_RTLD(_RTLD_COMPAT_LIB_SUFFIX)
7633dba3bbSKonstantin Belousov #endif
7733dba3bbSKonstantin Belousov 
7833dba3bbSKonstantin Belousov #ifndef STANDARD_LIBRARY_PATH
79*f940929dSJessica Clarke #define	STANDARD_LIBRARY_PATH	"/lib" _RTLD_COMPAT_LIB_SUFFIX ":/usr/lib" _RTLD_COMPAT_LIB_SUFFIX
8033dba3bbSKonstantin Belousov #endif
8133dba3bbSKonstantin Belousov 
8233dba3bbSKonstantin Belousov #ifndef LD_
83*f940929dSJessica Clarke #define	LD_			"LD_" _RTLD_COMPAT_ENV_SUFFIX
8433dba3bbSKonstantin Belousov #endif
8533dba3bbSKonstantin Belousov 
868cc44a1eSKonstantin Belousov #ifndef TOKEN_LIB
87*f940929dSJessica Clarke #define	TOKEN_LIB		"lib" _RTLD_COMPAT_LIB_SUFFIX
88*f940929dSJessica Clarke #endif
89*f940929dSJessica Clarke 
90*f940929dSJessica Clarke #ifndef _PATH_ELF32_HINTS
91*f940929dSJessica Clarke #define	_PATH_ELF32_HINTS	__PATH_ELF_HINTS("32")
92*f940929dSJessica Clarke #endif
93*f940929dSJessica Clarke 
94*f940929dSJessica Clarke #ifndef _COMPAT32_PATH_RTLD
95*f940929dSJessica Clarke #define	_COMPAT32_PATH_RTLD	__PATH_RTLD("32")
968cc44a1eSKonstantin Belousov #endif
978cc44a1eSKonstantin Belousov 
9833dba3bbSKonstantin Belousov #ifdef IN_RTLD
9933dba3bbSKonstantin Belousov extern const char *ld_elf_hints_default;
10033dba3bbSKonstantin Belousov extern const char *ld_path_libmap_conf;
10133dba3bbSKonstantin Belousov extern const char *ld_path_rtld;
10233dba3bbSKonstantin Belousov extern const char *ld_standard_library_path;
10333dba3bbSKonstantin Belousov extern const char *ld_env_prefix;
10433dba3bbSKonstantin Belousov #endif
10533dba3bbSKonstantin Belousov 
10633dba3bbSKonstantin Belousov #endif /* _RTLD_PATHS_H */
107