summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorderaadt <>2022-10-14 04:38:39 +0000
committerderaadt <>2022-10-14 04:38:39 +0000
commitb645f2b4bb773550337fd6ab6965c7fc96dc9c62 (patch)
tree79ce5df4e74b8ee27aa82e3449714bcea274161a
parent97dd2cd0e521799dfc6b2124c0e847fb7f404b8d (diff)
downloadopenbsd-b645f2b4bb773550337fd6ab6965c7fc96dc9c62.tar.gz
openbsd-b645f2b4bb773550337fd6ab6965c7fc96dc9c62.tar.bz2
openbsd-b645f2b4bb773550337fd6ab6965c7fc96dc9c62.zip
put the malloc_readonly struct into the "openbsd.mutable" section, so
that the kernel and ld.so will know not to mark it immutable. malloc handles the read/write transitions by itself.
-rw-r--r--src/lib/libc/stdlib/malloc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c
index b12c89aca0..a0ee04f821 100644
--- a/src/lib/libc/stdlib/malloc.c
+++ b/src/lib/libc/stdlib/malloc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: malloc.c,v 1.274 2022/06/30 17:15:48 guenther Exp $ */ 1/* $OpenBSD: malloc.c,v 1.275 2022/10/14 04:38:39 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net> 3 * Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net>
4 * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> 4 * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
@@ -228,7 +228,8 @@ struct malloc_readonly {
228static union { 228static union {
229 struct malloc_readonly mopts; 229 struct malloc_readonly mopts;
230 u_char _pad[MALLOC_PAGESIZE]; 230 u_char _pad[MALLOC_PAGESIZE];
231} malloc_readonly __attribute__((aligned(MALLOC_PAGESIZE))); 231} malloc_readonly __attribute__((aligned(MALLOC_PAGESIZE)))
232 __attribute__((section(".openbsd.mutable")));
232#define mopts malloc_readonly.mopts 233#define mopts malloc_readonly.mopts
233 234
234char *malloc_options; /* compile-time options */ 235char *malloc_options; /* compile-time options */