Re: [PATCH] seq_buf: avoid clang section mismatch from seq_buf_terminate optimization

From: Arnd Bergmann

Date: Tue Dec 01 2026 - 16:54:08 EST


On Tue, Dec 1, 2026, at 16:13, Steven Rostedt wrote:
> On Tue, 1 Dec 2026 10:06:16 +0100 Arnd Bergmann <arnd@xxxxxxxxxx> wrote:
>>
>> I'm unsure whether this should be considered a bug in clang or the
>> kernel, or what the best workaround is. The two options I considered
>> are:
>
> It's definitely a bug in clang. If it created a specialized version of a
> function and that version is now causing section mismatches, that's a bug
> in the compiler. The kernel did nothing wrong.

Not sure I understand, do you mean clang should skip the FunctionSpecialization
in interprocedural constant propagation altogether when building the kernel,
or do you think we should teach clang about the kernel's concept of what
functions are allowed to reference .initdata?

Is the clang behavior fundamentally different from gcc here? It seems to
me that gcc just didn't hit this issue because unlike clang it does
inline across sections.

Arnd