if [ $compression = ".none" ]; then
compression=
uboot_comp=none
fi
if [ $uboot_comp = "gz" ]; then
uboot_comp=gzip
fi
;;
--no-gzip)
# a "feature" of the wrapper script is that it can be used outside
# the kernel tree. So keeping this around for backwards compatibility.
compression=
uboot_comp=none
;;
-?)
usage
;;
*)
[ -z "$kernel" ] || usage
kernel="$1"
;;
esac
shift
done
if [ -n "$dts" ]; then
if [ ! -r "$dts" -a -r "$object/dts/$dts" ]; then
dts="$object/dts/$dts"
fi
if [ -z "$dtb" ]; then
dtb="$platform.dtb"
fi
$dtc -O dtb -o "$dtb" -b 0 "$dts"
fi
ld_version()
{
# Poached from scripts/ld-version.sh, but we don't want to call that because
# this script (wrapper) is distributed separately from the kernel source.
# Extract linker version number from stdin and turn into single number.
awk '{
gsub(".*\\)", "");
gsub(".*version ", "");
gsub("-.*", "");
split($1,a, ".");
if( length(a[3]) == "8" )
# a[3] is probably a date of format yyyymmdd used for release snapshots. We
# can assume it to be zero as it does not signify a new version as such.
a[3] = 0;
print a[1]*100000000 + a[2]*1000000 + a[3]*10000;
exit
}'
}
ld_is_lld()
{
${CROSS}ld -V 2>&1 | grep -q LLD
}
# Do not include PT_INTERP segment when linking pie. Non-pie linking
# just ignores this option.
LD_VERSION=$(${CROSS}ld --version | ld_version)
LD_NO_DL_MIN_VERSION=$(echo 2.26 | ld_version)
if [ "$LD_VERSION" -ge "$LD_NO_DL_MIN_VERSION" ] ; then
nodl="--no-dynamic-linker"
fi
# suppress some warnings in recent ld versions
nowarn="-z noexecstack"
if "${CROSS}ld" -v --no-warn-rwx-segments >/dev/null 2>&1; then
nowarn="$nowarn --no-warn-rwx-segments"
fi
# Calculate the vmlinux.strip size
${CROSS}objcopy $objflags "$kernel""$vmz.$$"
strip_size=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh""$vmz.$$")
if [ -z "$cacheit" -o ! -f "$vmz$compression" -o "$vmz$compression" -ot "$kernel" ]; then
# recompress the image if we need to
case $compression in
.xz)
xz --check=crc32 -f -6 "$vmz.$$"
;;
.gz)
gzip -n -f -9 "$vmz.$$"
;;
.lzma)
xz --format=lzma -f -6 "$vmz.$$"
;;
.lzo)
lzop -f -9 "$vmz.$$"
;;
*)
# drop the compression suffix so the stripped vmlinux is used
compression=
uboot_comp=none
;;
esac
if [ -n "$cacheit" ]; then
mv -f "$vmz.$$$compression""$vmz$compression"
else
vmz="$vmz.$$"
fi
else
rm -f $vmz.$$
fi
vmz="$vmz$compression"
if [ "$make_space" = "y" ]; then
# Round the size to next higher MB limit
round_size=$(((strip_size + 0xfffff) & 0xfff00000))
if [ $link_addr -lt $strip_size ]; then
echo "INFO: Uncompressed kernel (size 0x$(printf "%x\n" $strip_size))" \ "overlaps the address of the wrapper($link_address)"
echo "INFO: Fixing the link_address of wrapper to ($round_size)"
link_address=$round_size
fi
fi
# Extract kernel version information, some platforms want to include
# it in the image header
version=`${CROSS}strings "$kernel" | grep '^Linux version [-0-9.]' | \ head -n1 | cut -d' ' -f3`
if [ -n "$version" ]; then
uboot_version="-n Linux-$version"
fi
case "$platform" in
uboot)
rm -f "$ofile"
${MKIMAGE} -A ppc -O linux -T kernel -C $uboot_comp -a $membase -e $membase \
$uboot_version -d "$vmz""$ofile"
if [ -z "$cacheit" ]; then
rm -f "$vmz"
fi
exit 0
;;
esac
addsec $tmp "$vmz" $ksection $object/empty.o
if [ -z "$cacheit" ]; then
rm -f "$vmz"
fi
if [ -n "$initrd" ]; then
addsec $tmp "$initrd" $isection
fi
if [ -n "$dtb" ]; then
addsec $tmp "$dtb" .kernel:dtb
if [ -n "$dts" ]; then
rm $dtb
fi
fi
if [ -n "$esm_blob" ]; then
addsec $tmp "$esm_blob" $esection
fi
if [ "$platform" != "miboot" ]; then
if [ -n "$link_address" ] ; then
text_start="-Ttext $link_address"
fi
#link everything
${CROSS}ld -m $format -T $lds $text_start $pie $nodl $nowarn $rodynamic $notext -o "$ofile" $map \
$platformo $tmp $object/wrapper.a
rm $tmp
fi
# Some platforms need the zImage's entry point and base address base=0x`${CROSS}nm "$ofile" | grep ' _start$' | cut -d' ' -f1`
entry=`${CROSS}objdump -f "$ofile" | grep '^start address ' | cut -d' ' -f3`
if [ -n "$binary" ]; then
mv "$ofile""$ofile".elf
${CROSS}objcopy -O binary "$ofile".elf "$ofile"
fi
# post-processing needed for some platforms
case "$platform" in
pseries|chrp)
$objbin/addnote "$ofile"
;;
coff)
${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry""$ofile"
$objbin/hack-coff "$ofile"
;;
cuboot*)
gzip -n -f -9 "$ofile"
${MKIMAGE} -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \
$uboot_version -d "$ofile".gz "$ofile"
;;
treeboot*)
mv "$ofile""$ofile.elf"
$objbin/mktree "$ofile.elf""$ofile""$base""$entry"
if [ -z "$cacheit" ]; then
rm -f "$ofile.elf"
fi
exit 0
;;
ps3)
# The ps3's loader supports loading a gzipped binary image from flash
# rom to ram addr zero. The loader then enters the system reset
# vector at addr 0x100. A bootwrapper overlay is used to arrange for
# a binary image of the kernel to be at addr zero, and yet have a
# suitable bootwrapper entry at 0x100. To construct the final rom
# image 512 bytes from offset 0x100 is copied to the bootwrapper
# place holder at symbol __system_reset_kernel. The 512 bytes of the
# bootwrapper entry code at symbol __system_reset_overlay is then
# copied to offset 0x100. At runtime the bootwrapper program copies
# the data at __system_reset_kernel back to addr 0x100.
# The ps3's flash loader has a size limit of 16 MiB for the uncompressed
# image. If a compressed image that exceeded this limit is written to
# flash the loader will decompress that image until the 16 MiB limit is
# reached, then enter the system reset vector of the partially decompressed
# image. No warning is issued.
rm -f "$odir"/{otheros,otheros-too-big}.bld
size=$(${CROSS}nm --no-sort --radix=d "$ofile" | grep -E ' _end$' | cut -d' ' -f1)
bld="otheros.bld"
if [ $size -gt $((0x1000000)) ]; then
bld="otheros-too-big.bld"
fi
gzip -n --force -9 --stdout "$ofile.bin" > "$odir/$bld"
;;
esac
Messung V0.5
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.