From 84be4d471910e06c81745a7ad062c419769bb23b Mon Sep 17 00:00:00 2001 From: thorpej Date: Tue, 5 Mar 2002 21:26:11 +0000 Subject: [PATCH] Fix size/padding of .data. From Nick. --- sys/arch/arm/conf/elf2aout.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/arch/arm/conf/elf2aout.sh b/sys/arch/arm/conf/elf2aout.sh index f72216744803..efb6c3a884c7 100644 --- a/sys/arch/arm/conf/elf2aout.sh +++ b/sys/arch/arm/conf/elf2aout.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: elf2aout.sh,v 1.3 2002/02/20 21:54:08 skrll Exp $ +# $NetBSD: elf2aout.sh,v 1.4 2002/03/05 21:26:11 thorpej Exp $ # # Shell script to convert an ARM ELF kernel into a bootable a.out kernel by # changing the header block on the kernel, and shuffling bits around in the @@ -44,9 +44,10 @@ DPAD=$(( $DALIGN - $DATA )) BPAD=$(( $BALIGN - $BSS )) DTMP=$(( $DATA + 32768 - $TPAD )) +DTALIGN=$(( (($DTMP + 4095) /4096) * 4096 )) TDPAD=32768 -DBPAD=$(( ((($DTMP + 4095) / 4096) * 4096) - $DTMP )) +DBPAD=$(( $DTALIGN - $DTMP )) echo TEXT = $TEXT echo TPAD = $TPAD @@ -57,7 +58,7 @@ echo DPAD = $DPAD echo DBPAD = $DBPAD ( - echo $TALIGN $DTMP $BSS | awk "${AWKPROG}"; \ + echo $TALIGN $DTALIGN $BSS | awk "${AWKPROG}"; \ cat ${infile}.text; \ dd if=/dev/zero bs=$TDPAD count=1; \ cat ${infile}.data; \