diff options
author | Jerome Forissier <jerome.forissier@linaro.org> | 2019-04-15 10:51:53 +0200 |
---|---|---|
committer | Jérôme Forissier <jerome.forissier@linaro.org> | 2019-04-15 11:57:20 +0200 |
commit | bccaa847d21b19d38988d2ab85b77ac5109608f0 (patch) | |
tree | 7521de907e6afb076a8956d4b347fd074c7faef2 | |
parent | 1601a3c52c101215c97d419404e60e0fac7cd469 (diff) |
core: arm: kern.ld.S: minimize padding between .heap1 and .nozi
When OP-TEE is build with CFG_WITH_LPAE=y, the things stored in the
.nozi section do not need to be aligned on more than 4 KiB. Only the
non-LPAE case requires 16 KiB alignment for the L1 page table.
Use an #ifdef to minimize the extra space between .heap1 and .nozi,
thus making the heap size closer to what is requested by
CFG_CORE_HEAP_SIZE. This can be useful when trying to minimize the
size of the TEE core binary, which could otherwise be bigger than
necessary by as much as 12 KiB.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
-rw-r--r-- | core/arch/arm/kernel/kern.ld.S | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/arch/arm/kernel/kern.ld.S b/core/arch/arm/kernel/kern.ld.S index cdb3f5b6..e2e85d3e 100644 --- a/core/arch/arm/kernel/kern.ld.S +++ b/core/arch/arm/kernel/kern.ld.S @@ -270,7 +270,11 @@ SECTIONS #ifndef CFG_WITH_PAGER . += CFG_CORE_HEAP_SIZE; #endif +#ifdef CFG_WITH_LPAE + . = ALIGN(4 * 1024); +#else . = ALIGN(16 * 1024); +#endif __heap1_end = .; } /* @@ -281,8 +285,6 @@ SECTIONS */ .nozi (NOLOAD) : { __nozi_start = .; - ASSERT(!(ABSOLUTE(.) & (16 * 1024 - 1)), "align nozi to 16kB"); - KEEP(*(.nozi .nozi.*)) . = ALIGN(16); __nozi_end = .; |