From 458dc17aa5485e90ede863a753c0bef2edb5dba7 Mon Sep 17 00:00:00 2001 From: Antonio Nino Diaz Date: Wed, 28 Feb 2018 16:37:22 +0000 Subject: Replace magic numbers in linkerscripts by PAGE_SIZE This way it is easier to understand the code and it is still valid even if the page size changes. Change-Id: I731ad0aa99a012eae4990ea95f507661a35ab818 Signed-off-by: Antonio Nino Diaz --- fwu/ns_bl1u/ns_bl1u.ld.S | 7 ++++--- fwu/ns_bl2u/ns_bl2u.ld.S | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'fwu') diff --git a/fwu/ns_bl1u/ns_bl1u.ld.S b/fwu/ns_bl1u/ns_bl1u.ld.S index 4f53eb4..b464fe9 100644 --- a/fwu/ns_bl1u/ns_bl1u.ld.S +++ b/fwu/ns_bl1u/ns_bl1u.ld.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,6 +29,7 @@ */ #include +#include OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT) OUTPUT_ARCH(PLATFORM_LINKER_ARCH) @@ -42,7 +43,7 @@ MEMORY { SECTIONS { . = NS_BL1U_RO_BASE; - ASSERT(. == ALIGN(4096), + ASSERT(. == ALIGN(PAGE_SIZE), "NS_BL1U_RO_BASE address is not aligned on a page boundary.") ro . : { @@ -59,7 +60,7 @@ SECTIONS * Its VMA must be page-aligned as it marks the first read/write page. */ . = NS_BL1U_RW_BASE; - ASSERT(. == ALIGN(4096), + ASSERT(. == ALIGN(PAGE_SIZE), "NS_BL1U_RW_BASE address is not aligned on a page boundary.") .data . : ALIGN(16) { __DATA_RAM_START__ = .; diff --git a/fwu/ns_bl2u/ns_bl2u.ld.S b/fwu/ns_bl2u/ns_bl2u.ld.S index a45c418..cd6d0cb 100644 --- a/fwu/ns_bl2u/ns_bl2u.ld.S +++ b/fwu/ns_bl2u/ns_bl2u.ld.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,6 +29,7 @@ */ #include +#include OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT) OUTPUT_ARCH(PLATFORM_LINKER_ARCH) @@ -41,7 +42,7 @@ MEMORY { SECTIONS { . = NS_BL2U_BASE; - ASSERT(. == ALIGN(4096), + ASSERT(. == ALIGN(PAGE_SIZE), "NS_BL2U_BASE address is not aligned on a page boundary.") ro . : { @@ -56,7 +57,7 @@ SECTIONS * read-only, executable. No RW data from the next section must * creep in. Ensure the rest of the current memory page is unused. */ - . = NEXT(4096); /* Aligned to the size of a 4KB */ + . = NEXT(PAGE_SIZE); /* Aligned to the size of a page */ __RO_END__ = .; } >RAM __RO_SIZE__ = __RO_END__ - __RO_START__; -- cgit v1.2.3