summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2009-10-20 19:05:43 +0000
committerkan <kan@FreeBSD.org>2009-10-20 19:05:43 +0000
commitdae6c247dba58450adb88a4f80252645b1ab6d83 (patch)
tree621cdc9966fae8d0ca2c6725a55adb73dbdab0d0
parentc60a9751e06a5eafd3f7b554dd6e1000476c4dce (diff)
downloadFreeBSD-src-dae6c247dba58450adb88a4f80252645b1ab6d83.zip
FreeBSD-src-dae6c247dba58450adb88a4f80252645b1ab6d83.tar.gz
MFC Revision 197277:
Make libc.a provide __stack_chk_fail_local weak alias. This is needed to satisfy static libraries that are compiled with -fpic and linked into static binary afterwards. Several libraries in gcc are examples of such static libs. Approved by: re (kib)
-rw-r--r--lib/libc/sys/stack_protector.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc/sys/stack_protector.c b/lib/libc/sys/stack_protector.c
index 63beebc..14c20eb 100644
--- a/lib/libc/sys/stack_protector.c
+++ b/lib/libc/sys/stack_protector.c
@@ -108,4 +108,8 @@ __chk_fail(void)
__fail("buffer overflow detected; terminated");
}
+#ifdef PIC
__sym_compat(__stack_chk_fail_local, __stack_chk_fail, FBSD_1.0);
+#else
+__weak_reference(__stack_chk_fail, __stack_chk_fail_local);
+#endif
OpenPOWER on IntegriCloud