From 1ef849c6ec6a4e30badc844371cdf1b9eedfba57 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 13 Apr 2015 20:13:10 -0400 Subject: allow libc itself to be built with stack protector enabled this was already essentially possible as a result of the previous commits changing the dynamic linker/thread pointer bootstrap process. this commit mainly adds build system infrastructure: configure no longer attempts to disable stack protector. instead it simply determines how so the makefile can disable stack protector for a few translation units used during early startup. stack protector is also disabled for memcpy and memset since compilers (incorrectly) generate calls to them on some archs to implement struct initialization and assignment, and such calls may creep into early initialization. no explicit attempt to enable stack protector is made by configure at this time; any stack protector option supported by the compiler can be passed to configure in CFLAGS, and if the compiler uses stack protector by default, this default is respected. --- src/env/__stack_chk_fail.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/env') diff --git a/src/env/__stack_chk_fail.c b/src/env/__stack_chk_fail.c index cc55460b..1b6a9f82 100644 --- a/src/env/__stack_chk_fail.c +++ b/src/env/__stack_chk_fail.c @@ -16,3 +16,13 @@ void __stack_chk_fail(void) { a_crash(); } + +#ifdef SHARED + +__attribute__((__visibility__("hidden"))) +void __stack_chk_fail_local(void) +{ + a_crash(); +} + +#endif -- cgit v1.2.1