summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2016-05-21 21:58:52 +0000
committerkettenis <kettenis@openbsd.org>2016-05-21 21:58:52 +0000
commit83c41c9705f353872fb3c1a33182503df389a36f (patch)
tree4cd1ff1cda41f6e423087a26e39721a57dc3879a
parentsync (diff)
downloadwireguard-openbsd-83c41c9705f353872fb3c1a33182503df389a36f.tar.xz
wireguard-openbsd-83c41c9705f353872fb3c1a33182503df389a36f.zip
Temporarily make the PLT writable when we're initializing the magic slots
or doing non-lazy relocation processing. ok guenther@
-rw-r--r--libexec/ld.so/sparc64/rtld_machine.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libexec/ld.so/sparc64/rtld_machine.c b/libexec/ld.so/sparc64/rtld_machine.c
index 5b91c432162..915737b599b 100644
--- a/libexec/ld.so/sparc64/rtld_machine.c
+++ b/libexec/ld.so/sparc64/rtld_machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtld_machine.c,v 1.56 2015/11/02 07:02:53 guenther Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.57 2016/05/21 21:58:52 kettenis Exp $ */
/*
* Copyright (c) 1999 Dale Rahn
@@ -847,6 +847,10 @@ _dl_md_reloc_got(elf_object_t *object, int lazy)
if (object->traced)
lazy = 1;
+ /* temporarily make the PLT writable */
+ _dl_protect_segment(object, 0, "__plt_start", "__plt_end",
+ PROT_READ|PROT_WRITE);
+
if (!lazy) {
fails = _dl_md_reloc_all_plt(object);
} else {