Make rtld use libc_nossp_pic.a. Remove SSP shims.
Submitted by: Luis Pires Reviewed by: brooks Differential revision: https://reviews.freebsd.org/D15341
This commit is contained in:
parent
db08bfce2f
commit
0725fca53d
@ -51,7 +51,7 @@ CFLAGS+= -fvisibility=hidden
|
||||
CFLAGS.reloc.c+=-fno-jump-tables
|
||||
.endif
|
||||
LDFLAGS+= -shared -Wl,-Bsymbolic -Wl,-z,defs
|
||||
LIBADD= c_pic
|
||||
LIBADD= c_nossp_pic
|
||||
.if ${MK_TOOLCHAIN} == "no"
|
||||
LDFLAGS+= -L${LIBCDIR}
|
||||
.endif
|
||||
|
@ -238,8 +238,6 @@ void _rtld_error(const char *, ...) __exported;
|
||||
int npagesizes, osreldate;
|
||||
size_t *pagesizes;
|
||||
|
||||
long __stack_chk_guard[8] = {0, 0, 0, 0, 0, 0, 0, 0};
|
||||
|
||||
static int stack_prot = PROT_READ | PROT_WRITE | RTLD_DEFAULT_STACK_EXEC;
|
||||
static int max_stack_flags;
|
||||
|
||||
@ -360,8 +358,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
|
||||
char **argv, *argv0, **env, **envp, *kexecpath, *library_path_rpath;
|
||||
caddr_t imgentry;
|
||||
char buf[MAXPATHLEN];
|
||||
int argc, fd, i, mib[2], phnum, rtld_argc;
|
||||
size_t len;
|
||||
int argc, fd, i, phnum, rtld_argc;
|
||||
bool dir_enable, explicit_fd, search_in_path;
|
||||
|
||||
/*
|
||||
@ -399,27 +396,6 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
|
||||
main_argc = argc;
|
||||
main_argv = argv;
|
||||
|
||||
if (aux_info[AT_CANARY] != NULL &&
|
||||
aux_info[AT_CANARY]->a_un.a_ptr != NULL) {
|
||||
i = aux_info[AT_CANARYLEN]->a_un.a_val;
|
||||
if (i > sizeof(__stack_chk_guard))
|
||||
i = sizeof(__stack_chk_guard);
|
||||
memcpy(__stack_chk_guard, aux_info[AT_CANARY]->a_un.a_ptr, i);
|
||||
} else {
|
||||
mib[0] = CTL_KERN;
|
||||
mib[1] = KERN_ARND;
|
||||
|
||||
len = sizeof(__stack_chk_guard);
|
||||
if (sysctl(mib, 2, __stack_chk_guard, &len, NULL, 0) == -1 ||
|
||||
len != sizeof(__stack_chk_guard)) {
|
||||
/* If sysctl was unsuccessful, use the "terminator canary". */
|
||||
((unsigned char *)(void *)__stack_chk_guard)[0] = 0;
|
||||
((unsigned char *)(void *)__stack_chk_guard)[1] = 0;
|
||||
((unsigned char *)(void *)__stack_chk_guard)[2] = '\n';
|
||||
((unsigned char *)(void *)__stack_chk_guard)[3] = 255;
|
||||
}
|
||||
}
|
||||
|
||||
trust = !issetugid();
|
||||
|
||||
md_abi_variant_hook(aux_info);
|
||||
@ -5537,23 +5513,6 @@ __pthread_cxa_finalize(struct dl_phdr_info *a)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
__stack_chk_fail(void)
|
||||
{
|
||||
|
||||
_rtld_error("stack overflow detected; terminated");
|
||||
rtld_die();
|
||||
}
|
||||
__weak_reference(__stack_chk_fail, __stack_chk_fail_local);
|
||||
|
||||
void
|
||||
__chk_fail(void)
|
||||
{
|
||||
|
||||
_rtld_error("buffer overflow detected; terminated");
|
||||
rtld_die();
|
||||
}
|
||||
|
||||
const char *
|
||||
rtld_strerror(int errnum)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user