Skip to content

Commit f566826

Browse files
chleroympe
authored andcommitted
powerpc/32: Fix boot failure with CONFIG_STACKPROTECTOR
Commit 7c95d88 ("powerpc: Change calling convention for create_branch() et. al.") complexified the frame of function do_feature_fixups(), leading to GCC setting up a stack guard when CONFIG_STACKPROTECTOR is selected. The problem is that do_feature_fixups() is called very early while 'current' in r2 is not set up yet and the code is still not at the final address used at link time. So, like other instrumentation, stack protection needs to be deactivated for feature-fixups.c and code-patching.c Fixes: 7c95d88 ("powerpc: Change calling convention for create_branch() et. al.") Cc: [email protected] # v5.8+ Reported-by: Jonathan Neuschaefer <[email protected]> Signed-off-by: Christophe Leroy <[email protected]> Tested-by: Jonathan Neuschaefer <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/b688fe82927b330349d9e44553363fa451ea4d95.1619715114.git.christophe.leroy@csgroup.eu
1 parent b910fcb commit f566826

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/powerpc/lib/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
77

8+
CFLAGS_code-patching.o += -fno-stack-protector
9+
CFLAGS_feature-fixups.o += -fno-stack-protector
10+
811
CFLAGS_REMOVE_code-patching.o = $(CC_FLAGS_FTRACE)
912
CFLAGS_REMOVE_feature-fixups.o = $(CC_FLAGS_FTRACE)
1013

0 commit comments

Comments
 (0)