[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6ce978c1-825f-c1fd-41e3-eba2324cfd56@intel.com>
Date: Mon, 24 Jul 2023 12:30:43 +0200
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Alessandro Carminati <alessandro.carminati@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Nick Alcock <nick.alcock@...cle.com>
CC: Masahiro Yamada <masahiroy@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
"Nicolas Schier" <nicolas@...sle.eu>,
Masami Hiramatsu <mhiramat@...nel.org>,
"Daniel Bristot de Oliveira" <bristot@...nel.org>,
Viktor Malik <vmalik@...hat.com>,
Kris Van Hees <kris.van.hees@...cle.com>,
Luis Chamberlain <mcgrof@...nel.org>, <eugene.loh@...cle.com>,
Josh Poimboeuf <jpoimboe@...nel.org>,
<linux-kernel@...r.kernel.org>, <linux-kbuild@...r.kernel.org>,
<live-patching@...r.kernel.org>,
<linux-trace-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] scripts/link-vmlinux.sh: Add alias to duplicate
symbols for kallsyms
From: Alessandro Carminati <alessandro.carminati@...il.com>
Date: Fri, 21 Jul 2023 14:40:54 +0200
> Hello,
>
> I apologize for being noisy today.
>
> In an effort to be collaborative, I would like to share my thoughts on why I
> see duplicate symbols in fs/binfmt_elf.c.
[...]
> ~ $ nm -n built-in.a | grep set_brk -B100| egrep "set_brk|\.o:$"
> fs/binfmt_elf.o:
> 00000000000000d4 t set_brk
> fs/compat_binfmt_elf.o:
> 00000000000000d4 t set_brk
> ```
>
> These two symbols come from fs/binfmt_elf.o and fs/compat_binfmt_elf.o, and
> they are just two symbols that happen to share the same name, as is common
> in the kernel.
>
> at the same time, addr2line reports symbols to be generated from the same file.
>
> ```
> ~ $ llvm-addr2line-14 -fe vmlinux ffff8000082f1d2c ffff8000082f4454
> set_brk
> /home/alessandro/src/lka64/linux-6.4/fs/binfmt_elf.c:114
> set_brk
> /home/alessandro/src/lka64/linux-6.4/fs/binfmt_elf.c:114
> ~ $
> ~ $ addr2line -fe vmlinux ffff8000082f1d2c ffff8000082f4454
> set_brk
> /home/alessandro/src/lka64/linux-6.4/fs/binfmt_elf.c:114
> set_brk
> /home/alessandro/src/lka64/linux-6.4/fs/binfmt_elf.c:114
> ```
> looking at the source code:
> https://elixir.bootlin.com/linux/v6.4/source/fs/compat_binfmt_elf.c#L144
> the cause of this behavior, which is unexpected but correct.
Oh man, that's some deep investigation!
Let me go back to my old tree I was sending RFC from and check that
particular case there...
$ grep set_brk test_ksyms
ffffffff814b46c0 t fs/binfmt_elf.c:set_brk
ffffffff814b7040 t fs/compat_binfmt_elf.c:set_brk
Looks a bit better :D
>
> The rationale is that using source file + line number iproduces better kallsyms
> table, but it is still do not produce unique names.
>
> BR
> Alessandro
>> As a final note, please understand that my patch was not intended to undermine
>> anyone's work. I simply encountered a problem that I wanted to help solve.
>> Attached to this message is my code, in case anyone wants to replicate it.
>> I would appreciate being kept in the loop, as I genuinely want to assist in
>> fixing this problem.
Thanks,
Olek
Powered by blists - more mailing lists