Re: [PATCH v2 3/3] tracing/kprobes: Use APIs that matches symbols without .XXX suffix

From: Song Liu
Date: Wed Aug 07 2024 - 15:46:44 EST




> On Aug 7, 2024, at 7:58 AM, zhang warden <zhangwarden@xxxxxxxxx> wrote:
>
>
>> In my GCC built, we have suffixes like ".constprop.0", ".part.0", ".isra.0",
>> and ".isra.0.cold".
>
> A fresher's eye, I met sometime when try to build a livepatch module and found some mistake caused by ".constprop.0" ".part.0" which is generated by GCC.
>
> These section with such suffixes is special and sometime the symbol st_value is quite different. What is these kind of section (or symbol) use for?


IIUC, constprop means const propagation. For example, function
"foo(int a, int b)" that is called as "foo(a, 10)" will be come
"foo(int a)" with a hard-coded b = 10 inside.

.part.0 is part of the function, as the other part is inlined in
the caller.

With binary-diff based toolchain (kpatch-build), I think these will be
handled automatically. However, if we write the livepatch manually, we
need to understand these behavior with .constprop and .part.

Thanks,
Song