Changeset View
Changeset View
Standalone View
Standalone View
libexec/rtld-elf/rtld.c
Show First 20 Lines • Show All 259 Lines • ▼ Show 20 Lines | |||||
size_t tls_last_offset; /* Static TLS offset of last module */ | size_t tls_last_offset; /* Static TLS offset of last module */ | ||||
size_t tls_last_size; /* Static TLS size of last module */ | size_t tls_last_size; /* Static TLS size of last module */ | ||||
size_t tls_static_space; /* Static TLS space allocated */ | size_t tls_static_space; /* Static TLS space allocated */ | ||||
size_t tls_static_max_align; | size_t tls_static_max_align; | ||||
int tls_dtv_generation = 1; /* Used to detect when dtv size changes */ | int tls_dtv_generation = 1; /* Used to detect when dtv size changes */ | ||||
int tls_max_index = 1; /* Largest module index allocated */ | int tls_max_index = 1; /* Largest module index allocated */ | ||||
bool ld_library_path_rpath = false; | bool ld_library_path_rpath = false; | ||||
bool ld_fast_sigblock = false; | |||||
/* | /* | ||||
* Globals for path names, and such | * Globals for path names, and such | ||||
*/ | */ | ||||
char *ld_elf_hints_default = _PATH_ELF_HINTS; | char *ld_elf_hints_default = _PATH_ELF_HINTS; | ||||
char *ld_path_libmap_conf = _PATH_LIBMAP_CONF; | char *ld_path_libmap_conf = _PATH_LIBMAP_CONF; | ||||
char *ld_path_rtld = _PATH_RTLD; | char *ld_path_rtld = _PATH_RTLD; | ||||
char *ld_standard_library_path = STANDARD_LIBRARY_PATH; | char *ld_standard_library_path = STANDARD_LIBRARY_PATH; | ||||
▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) | ||||
if (sysctl(mib, 2, __stack_chk_guard, &len, NULL, 0) == -1 || | if (sysctl(mib, 2, __stack_chk_guard, &len, NULL, 0) == -1 || | ||||
len != sizeof(__stack_chk_guard)) { | len != sizeof(__stack_chk_guard)) { | ||||
/* If sysctl was unsuccessful, use the "terminator canary". */ | /* If sysctl was unsuccessful, use the "terminator canary". */ | ||||
((unsigned char *)(void *)__stack_chk_guard)[0] = 0; | ((unsigned char *)(void *)__stack_chk_guard)[0] = 0; | ||||
((unsigned char *)(void *)__stack_chk_guard)[1] = 0; | ((unsigned char *)(void *)__stack_chk_guard)[1] = 0; | ||||
((unsigned char *)(void *)__stack_chk_guard)[2] = '\n'; | ((unsigned char *)(void *)__stack_chk_guard)[2] = '\n'; | ||||
((unsigned char *)(void *)__stack_chk_guard)[3] = 255; | ((unsigned char *)(void *)__stack_chk_guard)[3] = 255; | ||||
} | } | ||||
} | |||||
if (aux_info[AT_BSDFLAGS] != NULL) { | |||||
if ((aux_info[AT_BSDFLAGS]->a_un.a_val & ELF_BSDF_FASTSIGBLK) != 0) | |||||
ld_fast_sigblock = true; | |||||
} | } | ||||
trust = !issetugid(); | trust = !issetugid(); | ||||
md_abi_variant_hook(aux_info); | md_abi_variant_hook(aux_info); | ||||
fd = -1; | fd = -1; | ||||
if (aux_info[AT_EXECFD] != NULL) { | if (aux_info[AT_EXECFD] != NULL) { | ||||
▲ Show 20 Lines • Show All 5,120 Lines • Show Last 20 Lines |