Problem
When the kernel is relinked, it fails with this error:
ld locore.o 34: can't allocate section .bss into owner KV_loads
ld fatal: Error(s). No output written to unix
ERROR: Can not link-edit unix Cause
The kernel has exceeded its maximum size, 8MB. This is usually caused by:
1. Increasing a kernel tunable to a very large value.
2. Adding a device driver that uses very large internal data structures.
Solution
In the case of "1. Increasing a kernel tunable to a very large value", check:
/etc/conf/cf.d/stuneto determine if any of the recommended maximums have been exceeded as defined in:
/etc/conf/cf.d/mtuneFor any that seem too large, try reducing them by running the configure(ADM) utility.
In the case of "2. Adding a device driver that uses very large internal data structures", determine the sizes of the various device drivers on your system using the following procedure: Note: This will require the SCO Development System to be installed, which you may wish to consider removing from the kernel.
1. Cut the following shell script from this script and put it
into a file, for example, /tmp/sizeof. Make sure that the
file is executable by running:# chmod 755 /tmp/sizeof-----8<-----cut here---8<------cut here---8<-------cut here-------8<-------
#!/bin/sh
#
# usage: sizeof <file> <file> ...
#global_bss()
{
/usr/ccs/bin/coff/nm -p $1 | grep " [cC] " | awk -F\| '
BEGIN {
total=0;
}
{
total += $1
}
END {
printf "%d\n", total
}
'
}bsize()
{
file=$1
tag=$2
set -- `size $file`
global=`global_bss $file`
total=`expr $global + $7`
global=`expr $global + $5`
echo "$tag: $1(text) + $3(data) + $global(bss) = $total"
}bss_archive()
{
archive=$1
base=`basename $1 .a`
opwd=`pwd`
full="$opwd/$1"
dir=/tmp/${base}$$
[ -d $dir ] || mkdir $dir
cd $dir
idar x $full
for x in *
do
bsize $x "$archive[$x]"
done
cd $opwd
rm -rf $dir
}if [ $# -eq 0 ]
then
echo "$0: usage: $0 <file> <file> ..."
exit 1
fifor x in "$@" do if [ -f $x ] then case $x in
*.o) bsize $x $x
;;
*.a) bss_archive $x
;;
esac
else
echo "$0: $x not found"
fi
done
exit 0
-----8<-----cut here---8<------cut here---8<-------cut here-------8<-------2. Log in as the root user and:
# cd /etc/conf/cf.d
# ./link_unix -pThe kernel relink will still fail but this will leave behind all the space.o files which were generated when the kernel was linked.
3. Then:# cd /etc/conf/pack.dAnd run the above shell script with the space.o files as parameters.
For example, if the script is saved in /tmp/sizeof:
# /tmp/sizeof */space.oLook for unusually large totals, for example:
spam/space.o: 0(text) + 32(data) + 8000480(bss) = 8000512This shows that the "spam" driver's space.o file allocates nearly 8MB of space.
If investigating the space.o files does not reveal anything, you can try the Driver.o files:
# /tmp/sizeof */Driver.oAlthough the above is not a real example, note that drivers can be easily excluded from kernel relinks by editing:
/etc/conf/sdevice.d/<driver name>and changing any "Y" in the file to an "N".
NOTE: Editing a driver's sdevice file may cause subsequent
kernel relink errors.Where possible you should use the mkdev(ADM) scripts to remove SCO supplied device drivers, or refer to the documentation supplied with your 3rd party device driver to determine the recommended driver removal procedure.
See also
configure(ADM); link_unix(ADM); mtune(F); stune(F); mkdev(ADM);
size(ADM); nm(ADM)