From 7418443d1246959a5d89dad67d56b749a6708c6a Mon Sep 17 00:00:00 2001 From: "Ithamar R. Adema" Date: Tue, 17 Sep 2013 02:42:58 +0200 Subject: [PATCH] loader/u-boot: fix alignment of uimage components. The "blobs" in a U-Boot uimage are aligned at 4 bytes, which we did not take into account. Found this when adding a 3rd blob containing the Flattened Device Tree for ARM. --- src/system/boot/platform/u-boot/uimage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/boot/platform/u-boot/uimage.cpp b/src/system/boot/platform/u-boot/uimage.cpp index dfe85a4242..0e2edd5c0e 100644 --- a/src/system/boot/platform/u-boot/uimage.cpp +++ b/src/system/boot/platform/u-boot/uimage.cpp @@ -55,7 +55,7 @@ image_multi_getimg(struct image_header *image, uint32 idx, uint32 *data, uint32 *size = ntohl(sizes[i]); return true; } - base += ntohl(sizes[i]); + base += (ntohl(sizes[i]) + 3) & ~3; } return false; }