git: ee58056e1e42 - stable/15 - boot1.chrp: Specify --image-base

From: Lexi Winter <ivy_at_FreeBSD.org>
Date: Mon, 04 May 2026 00:15:57 UTC
The branch stable/15 has been updated by ivy:

URL: https://cgit.FreeBSD.org/src/commit/?id=ee58056e1e42de9230a159412827da97ae7f03bc

commit ee58056e1e42de9230a159412827da97ae7f03bc
Author:     Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2026-04-18 20:07:40 +0000
Commit:     Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2026-05-04 00:14:38 +0000

    boot1.chrp: Specify --image-base
    
    This is required for LLVM 22's ld.lld to avoid a build error:
    
    ld.lld: error: section '.text' address (0x38000) is smaller than image base (0x10000000); specify --image-base
    ld.lld: error: section '.rodata' address (0x3b308) is smaller than image base (0x10000000); specify --image-base
    ld.lld: error: section '.data' address (0x3b610) is smaller than image base (0x10000000); specify --image-base
    ld.lld: error: section '.bss' address (0x3f618) is smaller than image base (0x10000000); specify --image-base
    
    Use 0x38000 for the image base, which is the address of the lowest
    (and only) LOAD segment in the file.
    
    Sponsored by:   https://www.patreon.com/bsdivy
    Differential Revision:  https://reviews.freebsd.org/D56459
    
    (cherry picked from commit aa0bc7cca153f67f8becec8a8fb259ff5fd30fd0)
---
 stand/powerpc/boot1.chrp/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stand/powerpc/boot1.chrp/Makefile b/stand/powerpc/boot1.chrp/Makefile
index b91c0117b5a7..0b77bce2b097 100644
--- a/stand/powerpc/boot1.chrp/Makefile
+++ b/stand/powerpc/boot1.chrp/Makefile
@@ -21,7 +21,7 @@ CFLAGS+=-I${LDRSRC}
 # boot1.elf defined in the HFS template, but sometimes boot1.elf is written
 # directly to the PReP partition.
 #
-LDFLAGS=-nostdlib -static -Wl,-N -Wl,-Ttext=0x38000
+LDFLAGS=-nostdlib -static -Wl,-N -Wl,-Ttext=0x38000 -Wl,--image-base=0x38000
 
 .PATH:  ${SYSDIR}/libkern ${SRCTOP}/lib/libc/powerpc/gen ${.CURDIR}