diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2016-05-21 21:58:53 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2016-05-21 21:58:53 +0000 |
commit | 0a8d30ee217e321d090b2f46b66efbfd0ab0545d (patch) | |
tree | 6a51a6f7598b7698e859b792fcd39014cd719598 /libexec/ld.so | |
parent | c8b0546b9b863611efc2edf69614529dc83d0f9b (diff) |
Temporarily make the PLT writable when we're initializing the magic slots
or doing non-lazy relocation processing.
ok guenther@
Diffstat (limited to 'libexec/ld.so')
-rw-r--r-- | libexec/ld.so/sparc64/rtld_machine.c | 6 |
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 { |