[PATCH v5 4/6] scripts/sorttable: Zero out weak functions in mcount_loc table
Mark Brown
broonie at kernel.org
Mon Feb 24 12:06:28 PST 2025
On Tue, Feb 18, 2025 at 02:59:22PM -0500, Steven Rostedt wrote:
> From: Steven Rostedt <rostedt at goodmis.org>
>
> When a function is annotated as "weak" and is overridden, the code is not
> removed. If it is traced, the fentry/mcount location in the weak function
> will be referenced by the "__mcount_loc" section. This will then be added
> to the available_filter_functions list. Since only the address of the
> functions are listed, to find the name to show, a search of kallsyms is
> used.
This breaks builds with ftrace on architectures without KASLR, one
affected configuration is bcm2835_defconfig:
/home/broonie/git/bisect/kernel/trace/ftrace.c: In function 'ftrace_process_locs':
/home/broonie/git/bisect/kernel/trace/ftrace.c:7057:24: error: implicit declaration of function 'kaslr_offset' [-Werror=implicit-function-declaration]
7057 | kaslr = !mod ? kaslr_offset() : 0;
| ^~~~~~~~~~~~
since that happens to enable CONFIG_FUNCTION_TRACER but doesn't have
KASLR, we don't have stubs for KASLR on architectures that don't have
it. It also looks like from a quick glance at least RISC-V will fail to
link since it only provides kaslr_offset() with RANDOMIZE_BASE enabled.
This all feels a bit footgunish.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20250224/e0d0fe4e/attachment.sig>
More information about the linux-arm-kernel
mailing list