Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] module: force sh_addr=0 for arch-specific sections
@ 2026-03-27  7:58 Petr Pavlu
  2026-03-27  7:59 ` [PATCH 1/4] module, arm: " Petr Pavlu
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Petr Pavlu @ 2026-03-27  7:58 UTC (permalink / raw)
  To: Russell King, Catalin Marinas, Will Deacon, Geert Uytterhoeven,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Sami Tolvanen
  Cc: Alexandre Ghiti, Luis Chamberlain, Petr Pavlu, Daniel Gomez,
	Aaron Tomlin, Joe Lawrence, linux-arm-kernel, linux-m68k,
	linux-riscv, linux-modules, linux-kernel

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].

Joe Lawrence previously addressed the same issue in the main
scripts/module.lds.S file [2] and we discussed that the same fix should be
also applied to architecture-specific module sections. This series
implements these changes.

The series can later be merged through the modules tree, or individual
patches can be applied through the architecture-specific trees.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=33958
[2] https://lore.kernel.org/linux-modules/20260305015237.299727-1-joe.lawrence@redhat.com/

Petr Pavlu (4):
  module, arm: force sh_addr=0 for arch-specific sections
  module, arm64: force sh_addr=0 for arch-specific sections
  module, m68k: force sh_addr=0 for arch-specific sections
  module, riscv: force sh_addr=0 for arch-specific sections

 arch/arm/include/asm/module.lds.h   | 4 ++--
 arch/arm64/include/asm/module.lds.h | 4 ++--
 arch/m68k/include/asm/module.lds.h  | 2 +-
 arch/riscv/include/asm/module.lds.h | 6 +++---
 4 files changed, 8 insertions(+), 8 deletions(-)


base-commit: c369299895a591d96745d6492d4888259b004a9e
-- 
2.53.0



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-06-26  8:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-27  7:58 [PATCH 0/4] module: force sh_addr=0 for arch-specific sections Petr Pavlu
2026-03-27  7:59 ` [PATCH 1/4] module, arm: " Petr Pavlu
2026-03-27  7:59 ` [PATCH 2/4] module, arm64: " Petr Pavlu
2026-03-27  7:59 ` [PATCH 3/4] module, m68k: " Petr Pavlu
2026-03-27  7:59 ` [PATCH 4/4] module, riscv: " Petr Pavlu
2026-05-26 23:40 ` [PATCH 0/4] module: " Sami Tolvanen
2026-06-26  8:21 ` patchwork-bot+linux-riscv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox