summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2012-08-28 16:39:10 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2012-08-28 16:39:10 +0000
commitb585b1065b8f081279c5a2fb013a8a3aa6666899 (patch)
tree8441694c613f2959e722cca0b197e9474d20abb0 /sys/kern
parentc3e7080efa7b1e6cfbafdb87860837b17e9218d9 (diff)
Add __guard_local as a hidden symbol to ld.so, kernel, and every
executable and DSO (via crtbegin.c/crtbeginS.c). Not used yet, but needed before GCC can start emitting -fstack-protector code that uses them instead of __guard.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/init_main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 9672d3e80ed..eb36c4c46ed 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_main.c,v 1.183 2012/06/13 22:47:39 ariane Exp $ */
+/* $OpenBSD: init_main.c,v 1.184 2012/08/28 16:39:09 matthew Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
@@ -132,6 +132,9 @@ int ncpusfound = 1; /* number of cpus we find */
__volatile int start_init_exec; /* semaphore for start_init() */
#if !defined(NO_PROPOLICE)
+#ifdef __ELF__
+long __guard_local __dso_hidden;
+#endif
long __guard[8];
#endif
@@ -408,6 +411,9 @@ main(void *framep)
arc4random_buf((long *)newguard, sizeof(newguard));
+#ifdef __ELF__
+ __guard_local = newguard[0];
+#endif
for (i = nitems(__guard) - 1; i; i--)
__guard[i] = newguard[i];
}