All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Khem Raj <raj.khem@gmail.com>
Cc: kexec@lists.infradead.org
Subject: Re: [PATCH v2] Make the segment base match pinned section address
Date: Tue, 23 Sep 2025 17:50:19 +0100	[thread overview]
Message-ID: <20250923165019.GC1084957@horms.kernel.org> (raw)
In-Reply-To: <20250905032252.1216827-1-raj.khem@gmail.com>

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@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


      reply	other threads:[~2025-09-23 16:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-05  3:22 [PATCH v2] Make the segment base match pinned section address Khem Raj
2025-09-23 16:50 ` Simon Horman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250923165019.GC1084957@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=kexec@lists.infradead.org \
    --cc=raj.khem@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.