From dae6c247dba58450adb88a4f80252645b1ab6d83 Mon Sep 17 00:00:00 2001 From: kan Date: Tue, 20 Oct 2009 19:05:43 +0000 Subject: 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) --- lib/libc/sys/stack_protector.c | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.1