summaryrefslogtreecommitdiff
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
commitfd6b4287e67178a5d72359fe46c0bfefc15655cc (patch)
tree87dfccc84e14a4c28f7d2cb2ac243bb2469cd12d
parent72189cd2defd70ceb80276539e5fa294dc984851 (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.
-rw-r--r--lib/csu/crtbegin.c4
-rw-r--r--lib/csu/crtbeginS.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/csu/crtbegin.c b/lib/csu/crtbegin.c
index 95878e7db7f..325b9d9f1d3 100644
--- a/lib/csu/crtbegin.c
+++ b/lib/csu/crtbegin.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crtbegin.c,v 1.14 2010/05/01 11:32:43 kettenis Exp $ */
+/* $OpenBSD: crtbegin.c,v 1.15 2012/08/28 16:39:09 matthew Exp $ */
/* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */
/*
@@ -82,6 +82,8 @@ extern void _Jv_RegisterClasses (void *)
#if (__GNUC__ > 2)
void *__dso_handle = NULL;
__asm(".hidden __dso_handle");
+
+long __guard_local __dso_hidden __attribute__((section(".openbsd.randomdata")));
#endif
static const init_f __CTOR_LIST__[1]
diff --git a/lib/csu/crtbeginS.c b/lib/csu/crtbeginS.c
index c4572e7591d..1938f3e09c3 100644
--- a/lib/csu/crtbeginS.c
+++ b/lib/csu/crtbeginS.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crtbeginS.c,v 1.11 2010/05/01 11:32:43 kettenis Exp $ */
+/* $OpenBSD: crtbeginS.c,v 1.12 2012/08/28 16:39:09 matthew Exp $ */
/* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */
/*
@@ -70,6 +70,8 @@ extern void _Jv_RegisterClasses (void *)
void *__dso_handle = &__dso_handle;
__asm(".hidden __dso_handle");
+long __guard_local __dso_hidden __attribute__((section(".openbsd.randomdata")));
+
extern void __cxa_finalize(void *) __attribute__((weak));
#endif