Re: [PATCH v2] x86/lib: Do not use local symbols with SYM_CODE_START_LOCAL()

From: Borislav Petkov
Date: Fri May 26 2023 - 16:46:14 EST


On Fri, May 26, 2023 at 10:29:29AM -0700, Nadav Amit wrote:
> Can you give me some examples for code whose address cannot be mapped
> back to a symbol?

No, this is not what I'm talking about.

I'm talking about all the local labels the compiler uses. For example:

$ make kernel/sched/core.s
$ grep -E "^\.L" kernel/sched/core.s | wc -l
2799

All those local labels are not in the symbol table (get discarded) and
the addresses they represent are shown as belonging to the containing
function.

> I did not ask to make them global. Just to keep them as local after
> linkage in the executable, like all other functions in the kernel.

Ok, not global. But local and present in the symbol table:

105185: ffffffff81b89330 17 NOTYPE LOCAL DEFAULT 1 bad_get_user_clac

And again, this helps how exactly?

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette