[PATCH v5 01/24] elf, uapi: Add a header for relocation constants

Christophe Leroy (CS GROUP) chleroy at kernel.org
Tue Sep 8 02:00:55 PDT 2026



Le 08/09/2026 à 08:33, Thomas Weißschuh a écrit :
> While the numeric constants for relocations are architecture specific,
> it is still useful to get access to them from other architectures.
> Also the definitions are useful for userspace in general.
> For example tools processing elf files during a kernel cross-compilation
> can make use of them.
> 
> Introduce a dedicated header for them, similar to the elf-em.h header.
> For now the header is empty but it will be filled step by step in
> upcomming commits.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>

Reviewed-by: Christophe Leroy (CS GROUP) <chleroy at kernel.org>

> ---
>   include/uapi/linux/elf-r.h | 5 +++++
>   include/uapi/linux/elf.h   | 1 +
>   2 files changed, 6 insertions(+)
> 
> diff --git a/include/uapi/linux/elf-r.h b/include/uapi/linux/elf-r.h
> new file mode 100644
> index 000000000000..2c382c8a4807
> --- /dev/null
> +++ b/include/uapi/linux/elf-r.h
> @@ -0,0 +1,5 @@
> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
> +#ifndef _UAPI_LINUX_ELF_R_H
> +#define _UAPI_LINUX_ELF_R_H
> +
> +#endif /* _UAPI_LINUX_ELF_R_H */
> diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h
> index ee30dcd80901..b3e312255552 100644
> --- a/include/uapi/linux/elf.h
> +++ b/include/uapi/linux/elf.h
> @@ -4,6 +4,7 @@
>   
>   #include <linux/types.h>
>   #include <linux/elf-em.h>
> +#include <linux/elf-r.h>
>   
>   /* 32-bit ELF base types. */
>   typedef __u32	Elf32_Addr;
> 




More information about the linux-riscv mailing list