diff options
author | 2017-09-09 02:22:48 +0000 | |
---|---|---|
committer | 2017-09-09 02:22:48 +0000 | |
commit | e8145a410402bd1801e57f329b4a7616aef6cebf (patch) | |
tree | 0983b90389d7fb8b30a8eb1494ae49311e3da6ae | |
parent | Whoops, remove extra include. (diff) | |
download | wireguard-openbsd-e8145a410402bd1801e57f329b4a7616aef6cebf.tar.xz wireguard-openbsd-e8145a410402bd1801e57f329b4a7616aef6cebf.zip |
Remove superfluous mprotect()ing of the PLT that's been obsoleted by
the generic handling of RWX segments.
ok aoyama@
-rw-r--r-- | libexec/ld.so/m88k/rtld_machine.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libexec/ld.so/m88k/rtld_machine.c b/libexec/ld.so/m88k/rtld_machine.c index 586a84cff9c..acbf6d8dce0 100644 --- a/libexec/ld.so/m88k/rtld_machine.c +++ b/libexec/ld.so/m88k/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.20 2017/02/15 21:18:52 miod Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.21 2017/09/09 02:22:48 guenther Exp $ */ /* * Copyright (c) 2013 Miodrag Vallat. @@ -306,11 +306,15 @@ _dl_md_reloc_got(elf_object_t *object, int lazy) plt_end != 0) { plt_start += object->obj_base; plt_end += object->obj_base; + /* + * XXX We round to page granularity, which means + * the cacheflush trap handler will operate on + * entire pages. Maybe we should pass the true + * start+size and let the trap handler decide whether + * to do full pages or only the applicable cachelines? + */ plt_start = ELF_TRUNC(plt_start, _dl_pagesz); plt_size = ELF_ROUND(plt_end, _dl_pagesz) - plt_start; - - _dl_mprotect((void *)plt_start, plt_size, - PROT_READ | PROT_WRITE); } else plt_size = 0; @@ -344,8 +348,6 @@ _dl_md_reloc_got(elf_object_t *object, int lazy) * otherwise I$ might have stale information. */ _dl_cacheflush(plt_start, plt_size); - _dl_mprotect((void *)plt_start, plt_size, - PROT_READ | PROT_EXEC); } return (fails); |