summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2013-01-14 05:24:07 +0000
committermiod <miod@openbsd.org>2013-01-14 05:24:07 +0000
commitc65a622392a3bce73d32101943c668946e99fc48 (patch)
tree681b1fc6c9438fe1e3c6570f46c24dae8c416ab6
parentsm_usmerr should be initialized with OIDVAL, not MIB; ok reyk@ (diff)
downloadwireguard-openbsd-c65a622392a3bce73d32101943c668946e99fc48.tar.xz
wireguard-openbsd-c65a622392a3bce73d32101943c668946e99fc48.zip
Do not bogusly attempt to mprotect ld.so's .rodata area RW at bootstrap
time: the logic is wrong, and there are no relocations to apply to .rodata anyway. ok jsing@ kettenis@
-rw-r--r--libexec/ld.so/mips64/ldasm.S22
1 files changed, 1 insertions, 21 deletions
diff --git a/libexec/ld.so/mips64/ldasm.S b/libexec/ld.so/mips64/ldasm.S
index 4eff70f157f..2d7c19c28f5 100644
--- a/libexec/ld.so/mips64/ldasm.S
+++ b/libexec/ld.so/mips64/ldasm.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldasm.S,v 1.7 2012/11/01 19:37:50 kettenis Exp $ */
+/* $OpenBSD: ldasm.S,v 1.8 2013/01/14 05:24:07 miod Exp $ */
/*
* Copyright (c) 1998-2002 Opsycon AB, Sweden.
@@ -50,26 +50,6 @@ LEAF(_dl_start, FRAMESZ) /* Not really LEAF, but we simplify */
bgezal zero, 1f
1:
PTR_SUBU s0, ra, s1 # This is the load offset
- LA t0, _fdata
- PTR_SRL t0, 20 # check if distance is > 2**16.
- beqz t0, 2f
- li t0, 0x10000
-
- li t0, 0x100000
-2:
-
- # This is a hack to change protection of .rodata so it
- # can be relocated. A better way to find the location
- # of .rodata should probably be used.
- # We know that .rodata is aligned on 0x100000 or 0x10000
- # and is at most 64 k in size.
- li v0, SYS_mprotect
- or a0, ra, 0xfff
- xor a0, 0xfff
- PTR_ADDU a0, t0
- li a1, 0x10000
- li a2, 7 /* (PROT_READ|PROT_WRITE|PROT_EXEC) */
- syscall
PTR_ADDU a0, sp, FRAMESZ # Where stack info is.
PTR_ADDU a1, sp, 0 # Where fast AUX info will be.