summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/stack_protector_compat.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-08-24 12:58:54 +0000
committerkib <kib@FreeBSD.org>2010-08-24 12:58:54 +0000
commitccc2cef693f2f02fa55024c17c959c78003839d9 (patch)
tree93ba3d280e5bad7826eeb6ed6dc6443564e85d59 /lib/libc/sys/stack_protector_compat.c
parent78f20695ad97aec1063beb298dc82b8ffc3eeb4d (diff)
downloadFreeBSD-src-ccc2cef693f2f02fa55024c17c959c78003839d9.zip
FreeBSD-src-ccc2cef693f2f02fa55024c17c959c78003839d9.tar.gz
Move the __stack_chk_fail_local@FBSD_1.0 compat symbol definition into
the separate .o for libc_pic.a. This prevents rtld from making the symbol global. Putting the stack_protector_compat.c into the public domain acknowledged by kan. Reviewed by: kan MFC after: 2 weeks
Diffstat (limited to 'lib/libc/sys/stack_protector_compat.c')
-rw-r--r--lib/libc/sys/stack_protector_compat.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/libc/sys/stack_protector_compat.c b/lib/libc/sys/stack_protector_compat.c
new file mode 100644
index 0000000..cacb863
--- /dev/null
+++ b/lib/libc/sys/stack_protector_compat.c
@@ -0,0 +1,20 @@
+/*
+ * Written by Alexander Kabaev <kan@FreeBSD.org>
+ * The file is in public domain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+void __stack_chk_fail(void);
+
+#ifdef PIC
+void
+__stack_chk_fail_local_hidden(void)
+{
+
+ __stack_chk_fail();
+}
+
+__sym_compat(__stack_chk_fail_local, __stack_chk_fail_local_hidden, FBSD_1.0);
+#endif
OpenPOWER on IntegriCloud