* [PATCH] kallsyms: ignore ARMv4 thunks along with others
@ 2024-02-14 18:19 Arnd Bergmann
2024-02-14 20:34 ` Masahiro Yamada
0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2024-02-14 18:19 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Arnd Bergmann, Nathan Chancellor, Nicolas Schier,
Pierre-Clément Tosi, Ard Biesheuvel, linux-kbuild,
linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
lld is now able to build ARMv4 and ARMv4T kernels, which means it can generate
thunks for those that can interfere with kallsyms table generation since
they do not get ignore like the corresponding ARMv5+ ones are:
Inconsistent kallsyms data
Try "make KALLSYMS_EXTRA_PASS=1" as a workaround
Add the missing symbols to the list of ignored symbol prefixes.
Fixes: 5eb6e280432d ("ARM: 9289/1: Allow pre-ARMv5 builds with ld.lld 16.0.0 and newer")
Fixes: efe6e3068067 ("kallsyms: fix nonconverging kallsyms table with lld")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
scripts/mksysmap | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/mksysmap b/scripts/mksysmap
index 9ba1c9da0a40..c809bf592790 100755
--- a/scripts/mksysmap
+++ b/scripts/mksysmap
@@ -52,6 +52,8 @@ ${NM} -n ${1} | sed >${2} -e "
/ __AArch64ADRPThunk_/d
# arm lld
+/ __ARMv4PILongThunk_/d
+/ __ARMv4PILongBXThunk_/d
/ __ARMV5PILongThunk_/d
/ __ARMV7PILongThunk_/d
/ __ThumbV7PILongThunk_/d
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] kallsyms: ignore ARMv4 thunks along with others
2024-02-14 18:19 [PATCH] kallsyms: ignore ARMv4 thunks along with others Arnd Bergmann
@ 2024-02-14 20:34 ` Masahiro Yamada
2024-02-14 20:45 ` Arnd Bergmann
0 siblings, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2024-02-14 20:34 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Arnd Bergmann, Nathan Chancellor, Nicolas Schier,
Pierre-Clément Tosi, Ard Biesheuvel, linux-kbuild,
linux-kernel
On Thu, Feb 15, 2024 at 3:19 AM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> lld is now able to build ARMv4 and ARMv4T kernels, which means it can generate
> thunks for those that can interfere with kallsyms table generation since
> they do not get ignore like the corresponding ARMv5+ ones are:
>
> Inconsistent kallsyms data
> Try "make KALLSYMS_EXTRA_PASS=1" as a workaround
>
> Add the missing symbols to the list of ignored symbol prefixes.
>
> Fixes: 5eb6e280432d ("ARM: 9289/1: Allow pre-ARMv5 builds with ld.lld 16.0.0 and newer")
> Fixes: efe6e3068067 ("kallsyms: fix nonconverging kallsyms table with lld")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> scripts/mksysmap | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/scripts/mksysmap b/scripts/mksysmap
> index 9ba1c9da0a40..c809bf592790 100755
> --- a/scripts/mksysmap
> +++ b/scripts/mksysmap
> @@ -52,6 +52,8 @@ ${NM} -n ${1} | sed >${2} -e "
> / __AArch64ADRPThunk_/d
>
> # arm lld
> +/ __ARMv4PILongThunk_/d
> +/ __ARMv4PILongBXThunk_/d
> / __ARMV5PILongThunk_/d
> / __ARMV7PILongThunk_/d
> / __ThumbV7PILongThunk_/d
> --
> 2.39.2
>
If this is a recurring problem,
maybe is it better to use a regular expression?
Remove these lines:
# arm64 lld
/ __AArch64ADRPThunk_/d
# arm lld
/ __ARMV5PILongThunk_/d
/ __ARMV7PILongThunk_/d
/ __ThumbV7PILongThunk_/d
# mips lld
/ __LA25Thunk_/d
/ __microLA25Thunk_/d
Add this:
# lld
/ __[^[:space:]]*Thunk_/d
This pattern is only used in tooling,
but never in the kernel space.
$ git grep '__[^[:space:]]*Thunk_'
scripts/mksysmap:/ __AArch64ADRPThunk_/d
scripts/mksysmap:/ __ARMV5PILongThunk_/d
scripts/mksysmap:/ __ARMV7PILongThunk_/d
scripts/mksysmap:/ __ThumbV7PILongThunk_/d
scripts/mksysmap:/ __LA25Thunk_/d
scripts/mksysmap:/ __microLA25Thunk_/d
tools/perf/tests/vmlinux-kallsyms.c: "__AArch64ADRPThunk_",
/* arm64 lld */
tools/perf/tests/vmlinux-kallsyms.c: "__ARMV5PILongThunk_",
/* arm lld */
tools/perf/tests/vmlinux-kallsyms.c: "__ARMV7PILongThunk_",
tools/perf/tests/vmlinux-kallsyms.c: "__ThumbV7PILongThunk_",
tools/perf/tests/vmlinux-kallsyms.c: "__LA25Thunk_",
/* mips lld */
tools/perf/tests/vmlinux-kallsyms.c: "__microLA25Thunk_",
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] kallsyms: ignore ARMv4 thunks along with others
2024-02-14 20:34 ` Masahiro Yamada
@ 2024-02-14 20:45 ` Arnd Bergmann
2024-02-14 20:56 ` Masahiro Yamada
0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2024-02-14 20:45 UTC (permalink / raw)
To: Masahiro Yamada, Arnd Bergmann
Cc: Nathan Chancellor, Nicolas Schier, Pierre-Clément Tosi,
Ard Biesheuvel, linux-kbuild, linux-kernel
On Wed, Feb 14, 2024, at 21:34, Masahiro Yamada wrote:
> On Thu, Feb 15, 2024 at 3:19 AM Arnd Bergmann <arnd@kernel.org> wrote:
> If this is a recurring problem,
> maybe is it better to use a regular expression?
>
>
> Remove these lines:
>
> # arm64 lld
> / __AArch64ADRPThunk_/d
>
> # arm lld
> / __ARMV5PILongThunk_/d
> / __ARMV7PILongThunk_/d
> / __ThumbV7PILongThunk_/d
>
> # mips lld
> / __LA25Thunk_/d
> / __microLA25Thunk_/d
>
>
>
>
>
> Add this:
>
> # lld
> / __[^[:space:]]*Thunk_/d
>
> This pattern is only used in tooling,
> but never in the kernel space.
Right, makes sense. There is always a risk of removing
intential kernel symbols and this is slightly higher
with the regex but still not that bad.
I'll give this a spin and send a v2 tomorrow then.
Arnd
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] kallsyms: ignore ARMv4 thunks along with others
2024-02-14 20:45 ` Arnd Bergmann
@ 2024-02-14 20:56 ` Masahiro Yamada
0 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2024-02-14 20:56 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Arnd Bergmann, Nathan Chancellor, Nicolas Schier,
Pierre-Clément Tosi, Ard Biesheuvel, linux-kbuild,
linux-kernel
On Thu, Feb 15, 2024 at 5:47 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Wed, Feb 14, 2024, at 21:34, Masahiro Yamada wrote:
> > On Thu, Feb 15, 2024 at 3:19 AM Arnd Bergmann <arnd@kernel.org> wrote:
> > If this is a recurring problem,
> > maybe is it better to use a regular expression?
> >
> >
> > Remove these lines:
> >
> > # arm64 lld
> > / __AArch64ADRPThunk_/d
> >
> > # arm lld
> > / __ARMV5PILongThunk_/d
> > / __ARMV7PILongThunk_/d
> > / __ThumbV7PILongThunk_/d
> >
> > # mips lld
> > / __LA25Thunk_/d
> > / __microLA25Thunk_/d
> >
> >
> >
> >
> >
> > Add this:
> >
> > # lld
> > / __[^[:space:]]*Thunk_/d
> >
> > This pattern is only used in tooling,
> > but never in the kernel space.
>
> Right, makes sense. There is always a risk of removing
> intential kernel symbols and this is slightly higher
> with the regex but still not that bad.
>
> I'll give this a spin and send a v2 tomorrow then.
>
> Arnd
Maybe this is a little more simpler:
/ __[[:alnum:]]*Thunk_/d
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-02-14 20:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-14 18:19 [PATCH] kallsyms: ignore ARMv4 thunks along with others Arnd Bergmann
2024-02-14 20:34 ` Masahiro Yamada
2024-02-14 20:45 ` Arnd Bergmann
2024-02-14 20:56 ` Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox