diff options
author | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2014-05-22 15:28:26 +0100 |
---|---|---|
committer | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2014-05-23 11:05:44 +0100 |
commit | a37255a205fa004bfc075aca81cef45b99dc30cb (patch) | |
tree | b7ff04d96b7d675c22e95a1ce4734b00128292cd /bl1/bl1.ld.S | |
parent | 4f59d8359f97e031c212032afeb57124ac4fcd94 (diff) |
Make the memory layout more flexible
Currently the platform code gets to define the base address of each
boot loader image. However, the linker scripts couteract this
flexibility by enforcing a fixed overall layout of the different
images. For example, they require that the BL3-1 image sits below
the BL2 image. Choosing BL3-1 and BL2 base addresses in such a way
that it violates this constraint makes the build fail at link-time.
This patch requires the platform code to now define a limit address
for each image. The linker scripts check that the image fits within
these bounds so they don't rely anymore on the position of a given
image in regard to the others.
Fixes ARM-software/tf-issues#163
Change-Id: I8c108646825da19a6a8dfb091b613e1dd4ae133c
Diffstat (limited to 'bl1/bl1.ld.S')
-rw-r--r-- | bl1/bl1.ld.S | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bl1/bl1.ld.S b/bl1/bl1.ld.S index 11b9a8f0..1af2a32d 100644 --- a/bl1/bl1.ld.S +++ b/bl1/bl1.ld.S @@ -118,11 +118,17 @@ SECTIONS __DATA_ROM_START__ = LOADADDR(.data); __DATA_SIZE__ = SIZEOF(.data); + /* + * The .data section is the last PROGBITS section so its end marks the end + * of the read-only part of BL1's binary. + */ + ASSERT(__DATA_ROM_START__ + __DATA_SIZE__ <= BL1_RO_LIMIT, + "BL1's RO section has exceeded its limit.") __BSS_SIZE__ = SIZEOF(.bss); __COHERENT_RAM_UNALIGNED_SIZE__ = __COHERENT_RAM_END_UNALIGNED__ - __COHERENT_RAM_START__; - ASSERT(. <= BL31_BASE, "BL1 image overlaps BL31 image.") + ASSERT(. <= BL1_RW_LIMIT, "BL1's RW section has exceeded its limit.") } |