summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Pavlu <petr.pavlu@suse.com>2026-03-27 10:59:03 +0300
committerSami Tolvanen <samitolvanen@google.com>2026-05-26 23:45:59 +0300
commit04e17ca3f77e1722a5db068fbcd7b93c51656013 (patch)
tree28cb2659e1651b72f965cf3c835da4a285a30b29
parent9cb4d4dc82272538de1b7edb6e8cf91597ed00b0 (diff)
downloadlinux-04e17ca3f77e1722a5db068fbcd7b93c51656013.tar.xz
module, riscv: 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 riscv-specific module sections. Link: https://sourceware.org/bugzilla/show_bug.cgi?id=33958 [1] Signed-off-by: Petr Pavlu <petr.pavlu@suse.com> Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
-rw-r--r--arch/riscv/include/asm/module.lds.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/riscv/include/asm/module.lds.h b/arch/riscv/include/asm/module.lds.h
index 1075beae1ac6..9ced27c8ccb6 100644
--- a/arch/riscv/include/asm/module.lds.h
+++ b/arch/riscv/include/asm/module.lds.h
@@ -2,8 +2,8 @@
/* Copyright (C) 2017 Andes Technology Corporation */
#ifdef CONFIG_MODULE_SECTIONS
SECTIONS {
- .plt : { BYTE(0) }
- .got : { BYTE(0) }
- .got.plt : { BYTE(0) }
+ .plt 0 : { BYTE(0) }
+ .got 0 : { BYTE(0) }
+ .got.plt 0 : { BYTE(0) }
}
#endif