From: Timur Tabi Date: Fri, 7 Mar 2025 17:14:17 +0000 (-0600) Subject: elf: add remaining SHF_ flag macros X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b0db1ed17645b53993bae3dd2c4be7013600084f;p=users%2Fjedix%2Flinux-maple.git elf: add remaining SHF_ flag macros Add the remaining SHF_ flags, as listed in the "Executable and Linkable Format" Wikipedia page and the System V Application Binary Interface[1]. This allows drivers to load and parse ELF images that use some of those flags. In particular, an upcoming change to the Nouveau GPU driver will use some of the flags. Link: https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.sheader.html#sh_flags [1] Signed-off-by: Timur Tabi Link: https://lore.kernel.org/r/20250307171417.267488-1-ttabi@nvidia.com Signed-off-by: Kees Cook --- diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h index 592507aa9b3a..8cf4ea9c544c 100644 --- a/include/uapi/linux/elf.h +++ b/include/uapi/linux/elf.h @@ -291,8 +291,18 @@ typedef struct elf64_phdr { #define SHF_WRITE 0x1 #define SHF_ALLOC 0x2 #define SHF_EXECINSTR 0x4 +#define SHF_MERGE 0x10 +#define SHF_STRINGS 0x20 +#define SHF_INFO_LINK 0x40 +#define SHF_LINK_ORDER 0x80 +#define SHF_OS_NONCONFORMING 0x100 +#define SHF_GROUP 0x200 +#define SHF_TLS 0x400 #define SHF_RELA_LIVEPATCH 0x00100000 #define SHF_RO_AFTER_INIT 0x00200000 +#define SHF_ORDERED 0x04000000 +#define SHF_EXCLUDE 0x08000000 +#define SHF_MASKOS 0x0ff00000 #define SHF_MASKPROC 0xf0000000 /* special section indexes */