From owner-svn-src-all@FreeBSD.ORG Sun May 27 16:27:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D543106566B; Sun, 27 May 2012 16:27:05 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F7628FC08; Sun, 27 May 2012 16:27:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4RGR5V4059970; Sun, 27 May 2012 16:27:05 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4RGR5Ya059967; Sun, 27 May 2012 16:27:05 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201205271627.q4RGR5Ya059967@svn.freebsd.org> From: Tim Kientzle Date: Sun, 27 May 2012 16:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236159 - head/sys/boot/arm/uboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 May 2012 16:27:05 -0000 Author: kientzle Date: Sun May 27 16:27:04 2012 New Revision: 236159 URL: http://svn.freebsd.org/changeset/base/236159 Log: Allow the load address used by ARM ubldr to be set via Make argument. In particular, this simplifies scripts that build system images. Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/arm/uboot/ldscript.arm Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Sun May 27 16:24:00 2012 (r236158) +++ head/sys/boot/arm/uboot/Makefile Sun May 27 16:27:04 2012 (r236159) @@ -7,6 +7,9 @@ NEWVERSWHAT= "U-Boot loader" ${MACHINE_A 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 Modified: head/sys/boot/arm/uboot/ldscript.arm ============================================================================== --- head/sys/boot/arm/uboot/ldscript.arm Sun May 27 16:24:00 2012 (r236158) +++ head/sys/boot/arm/uboot/ldscript.arm Sun May 27 16:27:04 2012 (r236159) @@ -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) }