From 55d061f031085f24d138664c897791aebe9a2fab Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 20 Jun 2015 03:01:07 +0000 Subject: provide __stack_chk_fail_local in libc.a this symbol is needed only on archs where the PLT call ABI is klunky, and only for position-independent code compiled with stack protector. thus references usually only appear in shared libraries or PIE executables, but they can also appear when linking statically if some of the object files being linked were built as PIC/PIE. normally libssp_nonshared.a from the compiler toolchain should provide __stack_chk_fail_local, but reportedly it appears prior to -lc in the link order, thus failing to satisfy references from libc itself (which arise only if libc.a was built as PIC/PIE with stack protector enabled). --- src/env/__stack_chk_fail.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/env/__stack_chk_fail.c') diff --git a/src/env/__stack_chk_fail.c b/src/env/__stack_chk_fail.c index 47784c62..be0c184a 100644 --- a/src/env/__stack_chk_fail.c +++ b/src/env/__stack_chk_fail.c @@ -25,4 +25,8 @@ void __stack_chk_fail_local(void) a_crash(); } +#else + +weak_alias(__stack_chk_fail, __stack_chk_fail_local); + #endif -- cgit v1.2.1