Re: [PATCH v2] module.lds,codetag: force 0 sh_addr for sections

Josh Poimboeuf
2026-03-17T22:56:00Z

On Mon, Mar 16, 2026 at 03:23:20PM +0100, Petr Pavlu wrote:
> > Do we also need similar changes in any of the architecture-specific module
> > linker scripts (arch/*/include/asm/module.lds.h)?
>
> I overlooked these architecture-specific files. I believe we should do
> the same for them. For instance, riscv explicitly defines the .plt, .got
> and .got.plt sections, and they have misleading addresses:
>
> $ readelf -t fs/xfs/xfs.ko
> [...]
> Section Headers:
> [Nr] Name
> Type Address Offset Link
> Size EntSize Info Align
> Flags
> [...]
> [48] __versions
> PROGBITS 0000000000000000 0000000000194e90 0
> 0000000000007900 0000000000000000 0 8
> [0000000000000002]: ALLOC
> [49] .plt
> PROGBITS 0000000000007900 000000000019c790 0
> 0000000000000001 0000000000000000 0 1
> [0000000000000006]: ALLOC, EXEC
> [50] .got
> PROGBITS 0000000000007901 000000000019c791 0
> 0000000000000001 0000000000000000 0 1
> [0000000000000003]: WRITE, ALLOC
> [51] .got.plt
> PROGBITS 0000000000007902 000000000019c792 0
> 0000000000000001 0000000000000000 0 1
> [0000000000000002]: ALLOC
> [...]
>
> Nonetheless, this can be done separately. I think fixes for these files
> should better go through architecture-specific trees anyway.
>
> I can check the individual architectures and prepare the necessary
> patches, unless someone else is already looking into this or wants to
> take a look.

I agree those can be done separately. In the meantime do you plan to
take this patch in the module tree?

--
Josh