|
@@ -260,6 +260,8 @@ vmz="$tmpdir/`basename \"$kernel\"`.$ext"
|
|
|
if [ -z "$cacheit" -o ! -f "$vmz$gzip" -o "$vmz$gzip" -ot "$kernel" ]; then
|
|
|
${CROSS}objcopy $objflags "$kernel" "$vmz.$$"
|
|
|
|
|
|
+ strip_size=$(stat -c %s $vmz.$$)
|
|
|
+
|
|
|
if [ -n "$gzip" ]; then
|
|
|
gzip -n -f -9 "$vmz.$$"
|
|
|
fi
|
|
@@ -269,6 +271,24 @@ if [ -z "$cacheit" -o ! -f "$vmz$gzip" -o "$vmz$gzip" -ot "$kernel" ]; then
|
|
|
else
|
|
|
vmz="$vmz.$$"
|
|
|
fi
|
|
|
+else
|
|
|
+ # Calculate the vmlinux.strip size
|
|
|
+ ${CROSS}objcopy $objflags "$kernel" "$vmz.$$"
|
|
|
+ strip_size=$(stat -c %s $vmz.$$)
|
|
|
+ rm -f $vmz.$$
|
|
|
+fi
|
|
|
+
|
|
|
+# Round the size to next higher MB limit
|
|
|
+round_size=$(((strip_size + 0xfffff) & 0xfff00000))
|
|
|
+
|
|
|
+round_size=0x$(printf "%x" $round_size)
|
|
|
+link_addr=$(printf "%d" $link_address)
|
|
|
+
|
|
|
+if [ $link_addr -lt $strip_size ]; then
|
|
|
+ echo "WARN: Uncompressed kernel (size 0x$(printf "%x\n" $strip_size))" \
|
|
|
+ "overlaps the address of the wrapper($link_address)"
|
|
|
+ echo "WARN: Fixing the link_address of wrapper to ($round_size)"
|
|
|
+ link_address=$round_size
|
|
|
fi
|
|
|
|
|
|
vmz="$vmz$gzip"
|