aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Forissier <jerome.forissier@linaro.org>2019-04-12 15:38:15 +0200
committerJérôme Forissier <jerome.forissier@linaro.org>2019-04-15 11:57:20 +0200
commit1601a3c52c101215c97d419404e60e0fac7cd469 (patch)
tree85a80a8ad841a7c8a1e424d3d7669fdf22304c05
parent5981d0341c0e7118fe3f2fbd205acf7d275588e5 (diff)
core: arm: kern.ld.S: use ABSOLUTE() in some assertions
Symbols defined inside output sections are relative to the section start. Therefore, when we want to check the actual address, we need to apply the ABSOLUTE() builtin function to the symbol. Note that symbols defined outside output sections are absolute by default, and therefore need not be treated the same. kern.ld.S has two incorrect assertions which can never fail, because the value that is checked is in fact 0 (since we are at the beginning of a section in both cases). Fix the code by adding the missing ABSOLUTE(). Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
-rw-r--r--core/arch/arm/kernel/kern.ld.S4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/arch/arm/kernel/kern.ld.S b/core/arch/arm/kernel/kern.ld.S
index 793a2772..cdb3f5b6 100644
--- a/core/arch/arm/kernel/kern.ld.S
+++ b/core/arch/arm/kernel/kern.ld.S
@@ -214,7 +214,7 @@ SECTIONS
__nex_heap_end = .;
}
.nex_nozi (NOLOAD) : {
- ASSERT(!( . & (16 * 1024 - 1)), "align nozi to 16kB");
+ ASSERT(!(ABSOLUTE(.) & (16 * 1024 - 1)), "align nozi to 16kB");
KEEP(*(.nozi.mmu.l1 .nozi.mmu.l2))
}
@@ -281,7 +281,7 @@ SECTIONS
*/
.nozi (NOLOAD) : {
__nozi_start = .;
- ASSERT(!(__nozi_start & (16 * 1024 - 1)), "align nozi to 16kB");
+ ASSERT(!(ABSOLUTE(.) & (16 * 1024 - 1)), "align nozi to 16kB");
KEEP(*(.nozi .nozi.*))
. = ALIGN(16);