Index: libexec/rtld-elf/mips/reloc.c =================================================================== --- libexec/rtld-elf/mips/reloc.c +++ libexec/rtld-elf/mips/reloc.c @@ -245,7 +245,7 @@ def = find_symdef(reloff, obj, &defobj, SYMLOOK_IN_PLT, NULL, NULL); if (def == NULL) - _rtld_error("bind failed no symbol"); + _rtld_die(); target = (Elf_Addr)(defobj->relocbase + def->st_value); dbg("bind now/fixup at %s sym # %jd in %s --> was=%p new=%p", Index: libexec/rtld-elf/rtld.h =================================================================== --- libexec/rtld-elf/rtld.h +++ libexec/rtld-elf/rtld.h @@ -350,6 +350,7 @@ } SymLook; void _rtld_error(const char *, ...) __printflike(1, 2); +void _rtld_die(void) __dead2; const char *rtld_strerror(int); Obj_Entry *map_object(int, const char *, const struct stat *); void *xcalloc(size_t, size_t); Index: libexec/rtld-elf/rtld.c =================================================================== --- libexec/rtld-elf/rtld.c +++ libexec/rtld-elf/rtld.c @@ -78,7 +78,6 @@ * Function declarations. */ static const char *basename(const char *); -static void die(void) __dead2; static void digest_dynamic1(Obj_Entry *, int, const Elf_Dyn **, const Elf_Dyn **, const Elf_Dyn **); static void digest_dynamic2(Obj_Entry *, const Elf_Dyn *, const Elf_Dyn *, @@ -409,7 +408,7 @@ unsetenv(LD_ "DEBUG") || unsetenv(LD_ "ELF_HINTS_PATH") || unsetenv(LD_ "LOADFLTR") || unsetenv(LD_ "LIBRARY_PATH_RPATH")) { _rtld_error("environment corrupt; aborting"); - die(); + _rtld_die(); } } ld_debug = getenv(LD_ "DEBUG"); @@ -458,7 +457,7 @@ obj_main = map_object(fd, argv0, NULL); close(fd); if (obj_main == NULL) - die(); + _rtld_die(); max_stack_flags = obj->stack_flags; } else { /* Main program already loaded. */ const Elf_Phdr *phdr; @@ -475,7 +474,7 @@ assert(aux_info[AT_ENTRY] != NULL); entry = (caddr_t) aux_info[AT_ENTRY]->a_un.a_ptr; if ((obj_main = digest_phdr(phdr, phnum, entry, argv0)) == NULL) - die(); + _rtld_die(); } if (aux_info[AT_EXECPATH] != 0) { @@ -540,12 +539,12 @@ dbg("loading LD_PRELOAD libraries"); if (load_preload_objects() == -1) - die(); + _rtld_die(); preload_tail = obj_tail; dbg("loading needed objects"); if (load_needed_objects(obj_main, 0) == -1) - die(); + _rtld_die(); /* Make a list of all objects loaded at startup. */ last_interposer = obj_main; @@ -561,7 +560,7 @@ dbg("checking for required versions"); if (rtld_verify_versions(&list_main) == -1 && !ld_tracing) - die(); + _rtld_die(); if (ld_tracing) { /* We're done */ trace_loaded_objects(obj_main); @@ -590,11 +589,11 @@ if (relocate_objects(obj_main, ld_bind_now != NULL && *ld_bind_now != '\0', &obj_rtld, SYMLOOK_EARLY, NULL) == -1) - die(); + _rtld_die(); dbg("doing copy relocations"); if (do_copy_relocations(obj_main) == -1) - die(); + _rtld_die(); if (getenv(LD_ "DUMP_REL_POST") != NULL) { dump_relocations(obj_main); @@ -626,7 +625,7 @@ if (resolve_objects_ifunc(obj_main, ld_bind_now != NULL && *ld_bind_now != '\0', SYMLOOK_EARLY, NULL) == -1) - die(); + _rtld_die(); if (!obj_main->crt_no_init) { /* @@ -693,7 +692,7 @@ def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, true, NULL, &lockstate); if (def == NULL) - die(); + _rtld_die(); if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) target = (Elf_Addr)rtld_resolve_ifunc(defobj, def); else @@ -842,8 +841,8 @@ return (res4); } -static void -die(void) +void +_rtld_die(void) { const char *msg = dlerror(); @@ -1195,7 +1194,7 @@ if (obj->z_origin && obj->origin_path == NULL) { obj->origin_path = xmalloc(PATH_MAX); if (rtld_dirname_abs(obj->path, obj->origin_path) == -1) - die(); + _rtld_die(); } if (dyn_runpath != NULL) { @@ -1893,7 +1892,7 @@ } if (sysctl(mib, len, psa, &size, NULL, 0) == -1) { _rtld_error("sysctl for hw.pagesize(s) failed"); - die(); + _rtld_die(); } psa_filled: pagesizes = psa; @@ -2820,7 +2819,7 @@ if (rtld_snprintf(found, len, "#%d/%s", dirfd, name) < 0) { _rtld_error("error generating '%d/%s'", dirfd, name); - die(); + _rtld_die(); } dbg("open('%s') => %d", found, fd); break; @@ -4534,7 +4533,7 @@ } if (!obj) { _rtld_error("Can't find module with TLS index %d", index); - die(); + _rtld_die(); } p = malloc_aligned(obj->tlssize, obj->tlsalign); @@ -4675,7 +4674,7 @@ } _rtld_error("%s: Unexpected inconsistency: dependency %s not found", obj->path, name); - die(); + _rtld_die(); } static int @@ -4991,7 +4990,7 @@ { _rtld_error("stack overflow detected; terminated"); - die(); + _rtld_die(); } __weak_reference(__stack_chk_fail, __stack_chk_fail_local); @@ -5000,7 +4999,7 @@ { _rtld_error("buffer overflow detected; terminated"); - die(); + _rtld_die(); } const char *