rust/pvimg/boot: Hard code location and size of the stage3a BSS section

Hardcode the location and size of the BSS section of stage3a to 0xc000
and 0x1000. This change is made in preparation for storing the Secure
Execution image metadata at the address of the BSS section of stage3a.
The idea behind this is that since there is no ELF loader involved, the
stage3a loader will memset it's BSS section and therefore the Secure
Execution image metadata to 0. This way, it's avoided having any
leftover metadata after running the stage3a loader.

In addition, add .bss.* as input sections for the .bss section.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2024-11-21 18:26:50 +00:00
committed by Jan Höppner
parent 7d81c1bbd4
commit f99719a695
2 changed files with 12 additions and 6 deletions
+2
View File
@@ -13,6 +13,8 @@
#include "lib/zt_common.h"
#include "boot/loaders_layout.h"
#define STAGE3A_BSS_ADDRESS _AC(0xc000, UL)
#define STAGE3A_BSS_SIZE _AC(0x1000, UL)
#define STAGE3A_INIT_ENTRY IMAGE_ENTRY
#define STAGE3A_ENTRY (STAGE3A_INIT_ENTRY + _AC(0x1000, UL))
#define STAGE3A_LOAD_ADDRESS IMAGE_LOAD_ADDRESS
+10 -6
View File
@@ -32,6 +32,16 @@ SECTIONS
}
__heap_stop = .;
. = STAGE3A_BSS_ADDRESS;
__bss_start = .;
.bss : {
*(.bss .bss.*)
. = ALIGN(4096);
ASSERT(__bss_stop - __bss_start == STAGE3A_BSS_SIZE,
"Stack section doesn't conform to the described memory layout");
}
__bss_stop = .;
. = STACK_ADDRESS;
__stack_start = .;
.stack : {
@@ -64,12 +74,6 @@ SECTIONS
__ex_table_stop = .;
}
.bss ALIGN(16) : {
__bss_start = .;
*(.bss)
__bss_stop = .;
}
.rodata ALIGN(16) : {
*(.rodata)
*(.rodata*)