aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rwxr-xr-xarch/powerpc/boot/wrapper20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index eb78e437ec1b..3790dcd13640 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -260,6 +260,8 @@ vmz="$tmpdir/`basename \"$kernel\"`.$ext"
260if [ -z "$cacheit" -o ! -f "$vmz$gzip" -o "$vmz$gzip" -ot "$kernel" ]; then 260if [ -z "$cacheit" -o ! -f "$vmz$gzip" -o "$vmz$gzip" -ot "$kernel" ]; then
261 ${CROSS}objcopy $objflags "$kernel" "$vmz.$$" 261 ${CROSS}objcopy $objflags "$kernel" "$vmz.$$"
262 262
263 strip_size=$(stat -c %s $vmz.$$)
264
263 if [ -n "$gzip" ]; then 265 if [ -n "$gzip" ]; then
264 gzip -n -f -9 "$vmz.$$" 266 gzip -n -f -9 "$vmz.$$"
265 fi 267 fi
@@ -269,6 +271,24 @@ if [ -z "$cacheit" -o ! -f "$vmz$gzip" -o "$vmz$gzip" -ot "$kernel" ]; then
269 else 271 else
270 vmz="$vmz.$$" 272 vmz="$vmz.$$"
271 fi 273 fi
274else
275 # Calculate the vmlinux.strip size
276 ${CROSS}objcopy $objflags "$kernel" "$vmz.$$"
277 strip_size=$(stat -c %s $vmz.$$)
278 rm -f $vmz.$$
279fi
280
281# Round the size to next higher MB limit
282round_size=$(((strip_size + 0xfffff) & 0xfff00000))
283
284round_size=0x$(printf "%x" $round_size)
285link_addr=$(printf "%d" $link_address)
286
287if [ $link_addr -lt $strip_size ]; then
288 echo "WARN: Uncompressed kernel (size 0x$(printf "%x\n" $strip_size))" \
289 "overlaps the address of the wrapper($link_address)"
290 echo "WARN: Fixing the link_address of wrapper to ($round_size)"
291 link_address=$round_size
272fi 292fi
273 293
274vmz="$vmz$gzip" 294vmz="$vmz$gzip"