From 4072572b0f8aeffedcd908dc45b7e046ee0554b0 Mon Sep 17 00:00:00 2001 From: Christophe Leroy Date: Wed, 15 Nov 2023 19:36:36 +0100 Subject: Fix stack-protector for powerpc On powerpc, stack protector expects a function called __stack_chk_fail_local() instead of __stack_chk_fail() And some versions of GCC for powerpc default to TLS canary instead of global canary, so always force GCC to use global canary with -mstack-protector-guard=global Cc: Joel Peshkin Fixes: 4e9bce12432 ("Add support for stack-protector") Signed-off-by: Christophe Leroy --- common/stackprot.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'common/stackprot.c') diff --git a/common/stackprot.c b/common/stackprot.c index d5b70616655..6495951a773 100644 --- a/common/stackprot.c +++ b/common/stackprot.c @@ -18,3 +18,8 @@ void __stack_chk_fail(void) panic("Stack smashing detected in function:\n%p relocated from %p", ra, ra - gd->reloc_off); } + +void __stack_chk_fail_local(void) +{ + __stack_chk_fail(); +} -- cgit v1.2.3