diff options
| author | Naveen N Rao <naveen@kernel.org> | 2024-10-30 12:38:43 +0530 |
|---|---|---|
| committer | Michael Ellerman <mpe@ellerman.id.au> | 2024-10-31 11:00:54 +1100 |
| commit | 782f46cbce5328da9380f166bd31cd17a04a7b10 (patch) | |
| tree | 0568a611d4611c8430db6ca0d4b0d00fa2214adf /arch/powerpc/Makefile.postlink | |
| parent | 9670f6d2097c4f97e15c67920dfddc664d7ee91c (diff) | |
| download | linux-782f46cbce5328da9380f166bd31cd17a04a7b10.tar.gz linux-782f46cbce5328da9380f166bd31cd17a04a7b10.tar.bz2 linux-782f46cbce5328da9380f166bd31cd17a04a7b10.zip | |
powerpc/ftrace: Add a postlink script to validate function tracer
Function tracer on powerpc can only work with vmlinux having a .text
size of up to ~64MB due to powerpc branch instruction having a limited
relative branch range of 32MB. Today, this is only detected on kernel
boot when ftrace is init'ed. Add a post-link script to check the size of
.text so that we can detect this at build time, and break the build if
necessary.
We add a dependency on !COMPILE_TEST for CONFIG_HAVE_FUNCTION_TRACER so
that allyesconfig and other test builds can continue to work without
enabling ftrace.
Signed-off-by: Naveen N Rao <naveen@kernel.org>
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://patch.msgid.link/20241030070850.1361304-11-hbathini@linux.ibm.com
Diffstat (limited to 'arch/powerpc/Makefile.postlink')
| -rw-r--r-- | arch/powerpc/Makefile.postlink | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/Makefile.postlink b/arch/powerpc/Makefile.postlink index ae5a4256b03d..bb601be36173 100644 --- a/arch/powerpc/Makefile.postlink +++ b/arch/powerpc/Makefile.postlink @@ -24,6 +24,9 @@ else $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/relocs_check.sh "$(OBJDUMP)" "$(NM)" "$@" endif +quiet_cmd_ftrace_check = CHKFTRC $@ + cmd_ftrace_check = $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/ftrace_check.sh "$(NM)" "$@" + # `@true` prevents complaint when there is nothing to be done vmlinux: FORCE @@ -34,6 +37,11 @@ endif ifdef CONFIG_RELOCATABLE $(call if_changed,relocs_check) endif +ifdef CONFIG_FUNCTION_TRACER +ifndef CONFIG_PPC64_ELF_ABI_V1 + $(call cmd,ftrace_check) +endif +endif clean: rm -f .tmp_symbols.txt |
