From 1601a3c52c101215c97d419404e60e0fac7cd469 Mon Sep 17 00:00:00 2001 From: Jerome Forissier Date: Fri, 12 Apr 2019 15:38:15 +0200 Subject: 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 Acked-by: Jens Wiklander --- core/arch/arm/kernel/kern.ld.S | 4 ++-- 1 file 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); -- cgit v1.2.3