Refine image size calculation.
The image size is the expanded space taken in memory rather than just
the binary size. This is the value that should be used in the image
header when conforming the the Linux header for aarch64.
Change-Id: Icbba83b466ea311a72862104878b1a4b50ec38ce
diff --git a/src/layout.c b/src/layout.c
index e53361b..5414fe4 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -121,11 +121,11 @@
/**
* Get the address the loaded image ends at.
*/
-paddr_t layout_bin_end(void)
+paddr_t layout_image_end(void)
{
- extern uint8_t bin_end[];
+ extern uint8_t image_end[];
- return pa_init((uintpaddr_t)bin_end);
+ return pa_init((uintpaddr_t)image_end);
}
/**
@@ -136,7 +136,7 @@
paddr_t layout_primary_begin(void)
{
/* TODO: This is a hack. We must read the alignment from the binary. */
- paddr_t bin_end = layout_bin_end();
+ paddr_t image_end = layout_image_end();
- return pa_init(align_up(pa_addr(bin_end), 0x80000));
+ return pa_init(align_up(pa_addr(image_end), 0x80000));
}