Skip to content
Snippets Groups Projects
Commit a1274cc9 authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Hans de Goede
Browse files

ARM: Page align secure section only when it is executed in situ


Targets that define CONFIG_ARMV7_SECURE_BASE will copy the secure section
to another address before execution.

Since the secure section in the u-boot image is only storage, there's
no reason to page align it and increase the binary image size.

Page align the secure section only when CONFIG_ARMV7_SECURE_BASE is not
defined. And instead of just aligning the __secure_start symbol, align
the whole .__secure_start section. This also makes the section empty,
so we need to add KEEP() to the input entry to prevent the section from
being garbage collected.

Also use ld constant "COMMONPAGESIZE" instead of hardcoded page size.

Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 1e77ce0e
No related branches found
No related tags found
No related merge requests found
...@@ -48,16 +48,20 @@ SECTIONS ...@@ -48,16 +48,20 @@ SECTIONS
#ifdef CONFIG_ARMV7_NONSEC #ifdef CONFIG_ARMV7_NONSEC
/* Align the secure section only if we're going to use it in situ */
.__secure_start :
#ifndef CONFIG_ARMV7_SECURE_BASE
ALIGN(CONSTANT(COMMONPAGESIZE))
#endif
{
KEEP(*(.__secure_start))
}
#ifndef CONFIG_ARMV7_SECURE_BASE #ifndef CONFIG_ARMV7_SECURE_BASE
#define CONFIG_ARMV7_SECURE_BASE #define CONFIG_ARMV7_SECURE_BASE
#define __ARMV7_PSCI_STACK_IN_RAM #define __ARMV7_PSCI_STACK_IN_RAM
#endif #endif
.__secure_start : {
. = ALIGN(0x1000);
*(.__secure_start)
}
.secure_text CONFIG_ARMV7_SECURE_BASE : .secure_text CONFIG_ARMV7_SECURE_BASE :
AT(ADDR(.__secure_start) + SIZEOF(.__secure_start)) AT(ADDR(.__secure_start) + SIZEOF(.__secure_start))
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment