From: Ard Biesheuvel Date: Fri, 18 Apr 2025 14:12:55 +0000 (+0200) Subject: vmlinux.lds: Include .data.rel[.local] into .data section X-Git-Tag: v6.16-rc1~195^2~30^2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=092071e0f63c2d2c54810a427d4d9a0df6aad52b;p=thirdparty%2Fkernel%2Flinux.git vmlinux.lds: Include .data.rel[.local] into .data section When running in -fPIC mode, the compiler may decide to emit statically initialized data objects into .data.rel or .data.rel.local if they contain absolute references to global or local objects, respectively, which require fixing up at load time. This distinction is irrelevant for the kernel, so fold .data.rel and .data.rel.local into .data. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Cc: Brian Gerst Cc: David Woodhouse Cc: Dionna Amalie Glaze Cc: H. Peter Anvin Cc: Juergen Gross Cc: Kees Cook Cc: Kevin Loughlin Cc: Len Brown Cc: Linus Torvalds Cc: Rafael J. Wysocki Cc: Tom Lendacky Link: https://lore.kernel.org/r/20250418141253.2601348-9-ardb+git@google.com --- diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 58a635a6d5bdf..66409bc3a4e0e 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -108,13 +108,13 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELLER_CLANG) #define TEXT_MAIN .text #endif #if defined(CONFIG_LD_DEAD_CODE_DATA_ELIMINATION) || defined(CONFIG_LTO_CLANG) -#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..L* .data..compoundliteral* .data.$__unnamed_* .data.$L* +#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data.rel.* .data..L* .data..compoundliteral* .data.$__unnamed_* .data.$L* #define SDATA_MAIN .sdata .sdata.[0-9a-zA-Z_]* #define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]* .rodata..L* #define BSS_MAIN .bss .bss.[0-9a-zA-Z_]* .bss..L* .bss..compoundliteral* #define SBSS_MAIN .sbss .sbss.[0-9a-zA-Z_]* #else -#define DATA_MAIN .data +#define DATA_MAIN .data .data.rel .data.rel.local #define SDATA_MAIN .sdata #define RODATA_MAIN .rodata #define BSS_MAIN .bss