Allow the load address used by ARM ubldr to be set via Make argument.
In particular, this simplifies scripts that build system images.
This commit is contained in:
parent
8b0f4e0a0d
commit
81174e7872
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=236159
@ -7,6 +7,9 @@ NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH}
|
||||
BINDIR?= /boot
|
||||
INSTALLFLAGS= -b
|
||||
WARNS?= 1
|
||||
# Address at which ubldr will be loaded.
|
||||
# This varies for different boards and SOCs.
|
||||
UBLDR_LOADADDR?= 0x1000000
|
||||
|
||||
# Architecture-specific loader code
|
||||
SRCS= start.S conf.c vers.c
|
||||
@ -85,7 +88,9 @@ CLEANFILES+= vers.c loader.help
|
||||
|
||||
CFLAGS+= -ffreestanding
|
||||
|
||||
LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
|
||||
LDFLAGS= -nostdlib -static
|
||||
LDFLAGS+= -T ldscript.generated
|
||||
LDFLAGS+= -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
|
||||
|
||||
# Pull in common loader code
|
||||
.PATH: ${.CURDIR}/../../uboot/common
|
||||
@ -110,6 +115,18 @@ loader.help: help.common help.uboot
|
||||
cat ${.ALLSRC} | \
|
||||
awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
|
||||
|
||||
${PROG}: ldscript.generated ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
|
||||
|
||||
ldscript.generated::
|
||||
rm -f ldscript.generated.tmp
|
||||
echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >ldscript.generated.tmp
|
||||
if diff ldscript.generated ldscript.generated.tmp > /dev/null; then \
|
||||
true; \
|
||||
else \
|
||||
rm -f ldscript.generated; \
|
||||
mv ldscript.generated.tmp ldscript.generated; \
|
||||
fi
|
||||
|
||||
.PATH: ${.CURDIR}/../../forth
|
||||
FILES= loader.help
|
||||
|
||||
|
@ -5,7 +5,7 @@ ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = 0x1000000 + SIZEOF_HEADERS;
|
||||
. = UBLDR_LOADADDR + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
|
Loading…
Reference in New Issue
Block a user