Re: [PATCH v6 06/15] x86/module: Deal with GOT based stack cookie load on Clang < 17

From: H. Peter Anvin
Date: Tue Feb 18 2025 - 16:53:51 EST


On February 18, 2025 6:05:37 AM PST, Brian Gerst <brgerst@xxxxxxxxx> wrote:
>On Tue, Feb 18, 2025 at 4:07 AM Ingo Molnar <mingo@xxxxxxxxxx> wrote:
>>
>>
>> * Brian Gerst <brgerst@xxxxxxxxx> wrote:
>>
>> > #define R_X86_64_GOTPCREL 9 /* 32 bit signed pc relative
>> > - offset to GOT */
>> > +#define R_X86_64_GOTPCRELX 41 offset to GOT */
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> > +#define R_X86_64_REX_GOTPCRELX 42
>>
>> Uhm, I'm pretty sure this won't even build, should any code use
>> R_X86_64_GOTPCRELX - which it doesn't currently...
>>
>> Also, each entry here has a comment explaining it - except these two
>> new GOTPCREL variants.
>
>Should we remove the non-REX version that isn't used by the kernel?
>This header is not exported to userspace.
>
>
>Brian Gerst
>

I would personally like to see them in there for the sake of documentation at least. If something runs into this in the future then at least it will be a little quicker to debug. This is an ABI constant, after all.