: /bin/sh
#
#	Old boot-loaders wanted all data initialized to zero and no BSS.
#	New boot-loaders want all BSS and no initialized data.
#	This utility check that all data is in one place (BSS or data).
#
#ident	"@(#)mb1:uts/i386/boot/mb1/checkbss	1.1"
SIZE=${SIZE:-"size"}
FILE=$1
set `$SIZE $FILE | sed "s/: */:/"`
DATA=$3
BSS=$5
MIN=`echo $DATA $BSS | awk '{ if ($1 < $2) print $1; else print $2; }'`
case $MIN in
	0)	exit 0 ;;
	*)	echo "error: $DATA bytes of data and $BSS bytes of BSS in $FILE" >&2
		exit 1
esac
