From 71664fd8d2d2550a56cc6a9c2b81797bfe90d613 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Mon, 17 Nov 2014 18:22:04 +1100 Subject: Stack checking extensions This patch adds: - Normal builds are done with -fstack-protector (we want to investigate using -fstack-protector-strong on gcc4.9 but for now we just use that - Build with STACK_CHECK=1 will use -fstack-protector-all and -pg and will check the stack in mcount Signed-off-by: Benjamin Herrenschmidt --- asm/misc.S | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'asm/misc.S') diff --git a/asm/misc.S b/asm/misc.S index ccb30d1..00c7f78 100644 --- a/asm/misc.S +++ b/asm/misc.S @@ -17,6 +17,7 @@ #include #include #include +#include .section ".text","ax" .balign 0x10 @@ -41,3 +42,11 @@ trigger_attn: isync attn blr + +#ifdef STACK_CHECK_ENABLED +.global _mcount +_mcount: + mr %r3,%r1 + mflr %r4 + b __mcount_stack_check +#endif -- cgit v1.1