mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 07:04:28 +00:00
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 <joel.peshkin@broadcom.com>
Fixes: 4e9bce1243
("Add support for stack-protector")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
This commit is contained in:
parent
654580eee1
commit
4072572b0f
2 changed files with 6 additions and 0 deletions
1
Makefile
1
Makefile
|
@ -750,6 +750,7 @@ endif
|
|||
|
||||
ifeq ($(CONFIG_STACKPROTECTOR),y)
|
||||
KBUILD_CFLAGS += $(call cc-option,-fstack-protector-strong)
|
||||
KBUILD_CFLAGS += $(call cc-option,-mstack-protector-guard=global)
|
||||
CFLAGS_EFI += $(call cc-option,-fno-stack-protector)
|
||||
else
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue