diff options
author | Suzuki K Poulose <suzuki.poulose@arm.com> | 2018-04-25 14:06:04 +0100 |
---|---|---|
committer | Mark Rutland <mark.rutland@arm.com> | 2018-04-26 13:52:58 +0100 |
commit | 7c2bc5495e556c9039f0d3e79d8d5af4ad35baf4 (patch) | |
tree | b3efb21916ff7ced1a7e1ed823c8f5a315177354 | |
parent | 5e1261e08abfb8add6491b90a42076e864589ced (diff) | |
download | boot-wrapper-aarch64-7c2bc5495e556c9039f0d3e79d8d5af4ad35baf4.tar.gz |
boot-wrapper-aarch64: Do not hardcode TEXT_LIMIT
We hard code TEXT_LIMIT to check for image overflow, assuming the memory
is always at 0x80000000, which may not always be true. Instead use the
offset from the PHYS_OFFSET, which is actually dependent on the DT.
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | model.lds.S | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am index 49cfa84..6940a99 100644 --- a/Makefile.am +++ b/Makefile.am @@ -75,11 +75,11 @@ endif if KERNEL_32 MBOX_OFFSET := 0x7ff8 KERNEL_OFFSET := 0x8000 -TEXT_LIMIT := 0x80003000 +TEXT_LIMIT := 0x3000 else MBOX_OFFSET := 0xfff8 KERNEL_OFFSET := 0x80000 -TEXT_LIMIT := 0x80080000 +TEXT_LIMIT := 0x80000 endif LD_SCRIPT := model.lds.S diff --git a/model.lds.S b/model.lds.S index 511f552..370ff56 100644 --- a/model.lds.S +++ b/model.lds.S @@ -76,5 +76,5 @@ SECTIONS QUAD(0x0) } - ASSERT(etext <= TEXT_LIMIT, ".text overflow!") + ASSERT(etext <= (PHYS_OFFSET + TEXT_LIMIT), ".text overflow!") } |