Changeset View
Standalone View
libexec/rtld-elf/paths.h
Show All 25 Lines | |||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef PATHS_H | #ifndef PATHS_H | ||||
#define PATHS_H | #define PATHS_H | ||||
#undef _PATH_ELF_HINTS | #undef _PATH_ELF_HINTS | ||||
#if defined(__ILP32__) | |||||
kib: We use __ILP32__/__LP64__ for these checks. | |||||
Done Inline ActionsThe reason that I did it this way is that the use of LP64 causes issues for CHERI (we use 64-bit virtual addresses and integer registers, so generally do want the LP64 branch, but pointers are 128-bits so LP64 is not defined). Since your suggestion also works for all currently supported architectures, and I can make the change if you prefer. arichardson: The reason that I did it this way is that the use of __LP64__ causes issues for CHERI (we use… | |||||
Done Inline ActionsYes I prefer standard ABI designators. We have around 450 checks with them, not counting contrib. kib: Yes I prefer standard ABI designators. We have around 450 checks with them, not counting… | |||||
Done Inline ActionsWell, a lot of those are wrong for CHERI and should become more precise in what their requirements are; most of the time it's really __SIZEOF_LONG__ (or, even more precisely, "how big is my virtual address space", but the two are equivalent if you don't care about Window's awful LLP64). However, __ILP32__ and __LP64__ are fine to be checking here, as pure-capability CHERI C is a different ABI with a different environment variable prefix. jrtc27: Well, a lot of those are wrong for CHERI and should become more precise in what their… | |||||
#define LD_ "LD_32_" | |||||
#elif defined(__LP64__) | |||||
#define LD_ "LD_64_" | |||||
#else | |||||
#error "Unsupported pointer size" | |||||
#endif | |||||
#define LD_FALLBACK_ "LD_" | |||||
#ifdef COMPAT_32BIT | #ifdef COMPAT_32BIT | ||||
#define _PATH_ELF_HINTS "/var/run/ld-elf32.so.hints" | #define _PATH_ELF_HINTS "/var/run/ld-elf32.so.hints" | ||||
#define _PATH_LIBMAP_CONF "/etc/libmap32.conf" | #define _PATH_LIBMAP_CONF "/etc/libmap32.conf" | ||||
#define _BASENAME_RTLD "ld-elf32.so.1" | #define _BASENAME_RTLD "ld-elf32.so.1" | ||||
#define STANDARD_LIBRARY_PATH "/lib32:/usr/lib32" | #define STANDARD_LIBRARY_PATH "/lib32:/usr/lib32" | ||||
#define LD_ "LD_32_" | |||||
#endif | #endif | ||||
#ifndef _PATH_ELF_HINTS | #ifndef _PATH_ELF_HINTS | ||||
#define _PATH_ELF_HINTS "/var/run/ld-elf.so.hints" | #define _PATH_ELF_HINTS "/var/run/ld-elf.so.hints" | ||||
#endif | #endif | ||||
#ifndef _PATH_LIBMAP_CONF | #ifndef _PATH_LIBMAP_CONF | ||||
#define _PATH_LIBMAP_CONF "/etc/libmap.conf" | #define _PATH_LIBMAP_CONF "/etc/libmap.conf" | ||||
#endif | #endif | ||||
#ifndef _BASENAME_RTLD | #ifndef _BASENAME_RTLD | ||||
#define _BASENAME_RTLD "ld-elf.so.1" | #define _BASENAME_RTLD "ld-elf.so.1" | ||||
#endif | #endif | ||||
#ifndef _PATH_RTLD | #ifndef _PATH_RTLD | ||||
#define _PATH_RTLD "/libexec/" _BASENAME_RTLD | #define _PATH_RTLD "/libexec/" _BASENAME_RTLD | ||||
#endif | #endif | ||||
#ifndef STANDARD_LIBRARY_PATH | #ifndef STANDARD_LIBRARY_PATH | ||||
#define STANDARD_LIBRARY_PATH "/lib/casper:/lib:/usr/lib" | #define STANDARD_LIBRARY_PATH "/lib/casper:/lib:/usr/lib" | ||||
#endif | |||||
#ifndef LD_ | |||||
#define LD_ "LD_" | |||||
#endif | #endif | ||||
#define _PATH_SOFT_ELF_HINTS "/var/run/ld-elf-soft.so.hints" | #define _PATH_SOFT_ELF_HINTS "/var/run/ld-elf-soft.so.hints" | ||||
Done Inline ActionsThis should be LD_FALLBACK_ with no argument to match the others. jrtc27: This should be LD_FALLBACK_ with no argument to match the others. | |||||
Done Inline Actionsgood catch, it was required in the initial version for CheriBSD, but is no longer needed. arichardson: good catch, it was required in the initial version for CheriBSD, but is no longer needed. | |||||
Done Inline ActionsThis was only here because of COMPAT_32BIT. jrtc27: This was only here because of COMPAT_32BIT. | |||||
#define _PATH_SOFT_LIBMAP_CONF "/etc/libmap-soft.conf" | #define _PATH_SOFT_LIBMAP_CONF "/etc/libmap-soft.conf" | ||||
#define _PATH_SOFT_RTLD "/libexec/ld-elf.so.1" | #define _PATH_SOFT_RTLD "/libexec/ld-elf.so.1" | ||||
#define SOFT_STANDARD_LIBRARY_PATH "/usr/libsoft" | #define SOFT_STANDARD_LIBRARY_PATH "/usr/libsoft" | ||||
#define LD_SOFT_ "LD_SOFT_" | #define LD_SOFT_ "LD_SOFT_" | ||||
extern const char *ld_elf_hints_default; | extern const char *ld_elf_hints_default; | ||||
extern const char *ld_path_libmap_conf; | extern const char *ld_path_libmap_conf; | ||||
extern const char *ld_path_rtld; | extern const char *ld_path_rtld; | ||||
extern const char *ld_standard_library_path; | extern const char *ld_standard_library_path; | ||||
extern const char *ld_env_prefix; | extern const char *ld_env_prefix; | ||||
#endif /* PATHS_H */ | #endif /* PATHS_H */ |
We use ILP32__/LP64__ for these checks.