From: Petr Pavlu Date: Fri, 27 Mar 2026 07:59:01 +0000 (+0100) Subject: module, arm64: force sh_addr=0 for arch-specific sections X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c5553deb577fe433f770e270fd9582b8325f12d9;p=thirdparty%2Fkernel%2Flinux.git module, arm64: force sh_addr=0 for arch-specific sections When linking modules with 'ld.bfd -r', sections defined without an address inherit the location counter, resulting in non-zero sh_addr values in the resulting .ko files. Relocatable objects are expected to have sh_addr=0 for all sections. Non-zero addresses are confusing in this context, typically worse compressible, and may cause tools to misbehave [1]. Force sh_addr=0 for all arm64-specific module sections. Link: https://sourceware.org/bugzilla/show_bug.cgi?id=33958 [1] Signed-off-by: Petr Pavlu Signed-off-by: Sami Tolvanen --- diff --git a/arch/arm64/include/asm/module.lds.h b/arch/arm64/include/asm/module.lds.h index fb944b46846da..0b3aacd22c590 100644 --- a/arch/arm64/include/asm/module.lds.h +++ b/arch/arm64/include/asm/module.lds.h @@ -14,7 +14,7 @@ SECTIONS { * directive to force them into a single section and silence the * warning. */ - .text.hot : { *(.text.hot) } + .text.hot 0 : { *(.text.hot) } #endif #ifdef CONFIG_UNWIND_TABLES @@ -22,6 +22,6 @@ SECTIONS { * Currently, we only use unwind info at module load time, so we can * put it into the .init allocation. */ - .init.eh_frame : { *(.eh_frame) } + .init.eh_frame 0 : { *(.eh_frame) } #endif }