Re: [PATCH v5 02/24] x86/elf, um/x86/elf: Move relocation constants to UAPI
From: Thomas Weißschuh
Date: Wed Sep 09 2026 - 02:01:14 EST
On Tue, Sep 08, 2026 at 08:12:38AM -0700, Borislav Petkov wrote:
> On Tue, Sep 08, 2026 at 04:26:00PM +0200, Thomas Weißschuh wrote:
> > The existing, generic ELF definitions are there.
> > The ELF stuff in include/linux/ is highly specific to Linux.
>
> And putting them in UAPI casts them in stone. I wouldn't want to maintain them
> forever if not necessary.
These names and numbers are defined by the architectures' ELF specifications.
They are already cast in stone. For example see Table 4.9 of [0].
Changing them would break compilers, linkers, loaders and more or less every
existing ELF binary.
> > Also later in the patchset I want to expose the definitions to the
> > tools/ build. Exposing generic UAPI definitions to tools/ is a much
> > easier sell than include/linux/.
>
> tools/ *copies* kernel headers on a "they're needed" basis. No need to put
> anything in UAPI for that.
>
> It's even written down: tools/include/uapi/README
That is the documentation for the tools UAPI headers.
Also we already have other, closely related, ELF constants in the UAPI,
see {,tools/}include/uapi/linux/elf{,-em}.h.
[0] https://gitlab.com/x86-psABIs/x86-64-ABI/-/jobs/artifacts/master/raw/x86-64-ABI/abi.pdf?job=build
Thomas