From 74dba11aaa299f71f2bf2b583d74575fec440e7b Mon Sep 17 00:00:00 2001 From: kan Date: Thu, 17 Sep 2009 13:21:53 +0000 Subject: 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. --- lib/libc/sys/stack_protector.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/libc/sys/stack_protector.c') 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