[PATCH v2] Make the segment base match pinned section address

Simon Horman horms at kernel.org
Tue Sep 23 09:50:19 PDT 2025


On Thu, Sep 04, 2025 at 08:22:52PM -0700, Khem Raj wrote:
> ET_EXEC uses image base of 0x400000, but the build forces
> section VMAs like .text = 0x10000. LLD now errors when any
> section address is below the image base unless you explicitly
> set the base. (Older LLD tolerated it.)
> 
> To fix this
> 
> use a tiny linker script to keep .text at 0x10000 and avoid .note overlap
> 
> With hardcoded -Ttext,0x10000 and newer toolchains emitting
> .note.gnu.property before .text, the link can fail with an overlap.
> Provide a minimal linker script that:
>   - sets the image base to 0x10000,
>   - places .text first at exactly 0x10000,
>   - moves .note.gnu.property after .text,
>   - optionally fixes .bss at 0x12000.
> 
> Works with both ld.bfd and LLD 21+.
> 
> Fixes
> | x86_64-yoe-linux-ld.lld: error: section '.text' address (0x10000) is smaller than image base (0x400000); specify --image-base
> | x86_64-yoe-linux-ld.lld: error: section '.bss' address (0x12000) is smaller than image base (0x400000); specify --image-base
> 
> Signed-off-by: Khem Raj <raj.khem at gmail.com>
> ---
> v2: Use a tiny linker script instead of trying to use linker options like -Ttext
>     to make it portable across BFD linker and LLD

Thanks, applied.

- Make the segment base match pinned section address
  https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=efb97b509b1a



More information about the kexec mailing list