summaryrefslogtreecommitdiffstats
path: root/sys/kern/stack_protector.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2008-06-26 07:52:45 +0000
committerru <ru@FreeBSD.org>2008-06-26 07:52:45 +0000
commitc878414354902f7800675ee0bf31d10892400a81 (patch)
treebe33cabf41774f2cce52ff453a59c8e7ea375148 /sys/kern/stack_protector.c
parent2b91fddddae74c8aeb407e90be1ac4d4cb7cde8d (diff)
downloadFreeBSD-src-c878414354902f7800675ee0bf31d10892400a81.zip
FreeBSD-src-c878414354902f7800675ee0bf31d10892400a81.tar.gz
Fix a chicken-and-egg problem: this files implements SSP support,
so we cannot compile it with -fstack-protector[-all] flags (or it will self-recurse); this is ensured in sys/conf/files. This OTOH means that checking for defines __SSP__ and __SSP_ALL__ to determine if we should be compiling the support is impossible (which it was trying, resulting in an empty object file). Fix this by always compiling the symbols in this files. It's good because it allows us to always have SSP support, and then compile with SSP selectively. Repoted by: tinderbox
Diffstat (limited to 'sys/kern/stack_protector.c')
-rw-r--r--sys/kern/stack_protector.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/sys/kern/stack_protector.c b/sys/kern/stack_protector.c
index 9135c29..554d47d 100644
--- a/sys/kern/stack_protector.c
+++ b/sys/kern/stack_protector.c
@@ -7,7 +7,6 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/libkern.h>
-#if defined(__SSP__) || defined(__SSP_ALL__)
long __stack_chk_guard[8] = {};
void __stack_chk_fail(void);
@@ -31,5 +30,3 @@ __stack_chk_init(void *dummy __unused)
}
/* SI_SUB_EVENTHANDLER is right after SI_SUB_LOCK used by arc4rand() init. */
SYSINIT(stack_chk, SI_SUB_EVENTHANDLER, SI_ORDER_ANY, __stack_chk_init, NULL);
-
-#endif
OpenPOWER on IntegriCloud