diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2016-08-14 04:30:40 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2016-08-14 04:30:40 +0000 |
commit | eae29bb85c98bb033606911b73e7c06f14a55385 (patch) | |
tree | da9b83a97a0559da1ba6115f6508fd300b7ee599 /libexec/ld.so | |
parent | 1c0455ddae953b821a9358112b4948e0d63e252a (diff) |
Mark the relro/got section as read-only before setting up the environment
to minimize the amount of code run without it RO.
Diffstat (limited to 'libexec/ld.so')
-rw-r--r-- | libexec/ld.so/loader.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libexec/ld.so/loader.c b/libexec/ld.so/loader.c index 06dc2cbab91..6fcff3d62ac 100644 --- a/libexec/ld.so/loader.c +++ b/libexec/ld.so/loader.c @@ -1,4 +1,4 @@ -/* $OpenBSD: loader.c,v 1.164 2016/08/12 20:39:01 deraadt Exp $ */ +/* $OpenBSD: loader.c,v 1.165 2016/08/14 04:30:39 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -389,8 +389,6 @@ _dl_boot(const char **argv, char **envp, const long dyn_loff, long *dl_data) Elf_Phdr *ptls = NULL; int align; - _dl_setup_env(argv[0], envp); - if (dl_data[AUX_pagesz] != 0) _dl_pagesz = dl_data[AUX_pagesz]; else @@ -420,6 +418,8 @@ _dl_boot(const char **argv, char **envp, const long dyn_loff, long *dl_data) } #endif + _dl_setup_env(argv[0], envp); + DL_DEB(("rtld loading: '%s'\n", __progname)); /* init this in runtime, not statically */ |