Skip to content

Commit 9b44580

Browse files
rnavgregkh
authored andcommitted
powerpc/ftrace: Fix dropping weak symbols with older toolchains
commit f6834c8 upstream. The minimum level of gcc supported for building the kernel is v5.1. v5.x releases of gcc emitted a three instruction sequence for -mprofile-kernel: mflr r0 std r0, 16(r1) bl _mcount It is only with the v6.x releases that gcc started emitting the two instruction sequence for -mprofile-kernel, omitting the second store instruction. With the older three instruction sequence, the actual ftrace location can be the 5th instruction into a function. Update the allowed offset for ftrace location from 12 to 16 to accommodate the same. Cc: [email protected] Fixes: 7af82ff ("powerpc/ftrace: Ignore weak functions") Signed-off-by: Naveen N Rao <[email protected]> Reviewed-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/7b265908a9461e38fc756ef9b569703860a80621.1687166935.git.naveen@kernel.org Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 593ad63 commit 9b44580

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/include/asm/ftrace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
/* Ignore unused weak functions which will have larger offsets */
1414
#ifdef CONFIG_MPROFILE_KERNEL
15-
#define FTRACE_MCOUNT_MAX_OFFSET 12
15+
#define FTRACE_MCOUNT_MAX_OFFSET 16
1616
#elif defined(CONFIG_PPC32)
1717
#define FTRACE_MCOUNT_MAX_OFFSET 8
1818
#endif

0 commit comments

Comments
 (0)