From fe5d1a98c7699392366e32c3d238c5b14c6bf8d6 Mon Sep 17 00:00:00 2001 From: Marco Oliverio Date: Thu, 8 Feb 2024 16:05:16 +0100 Subject: [PATCH] x86_fsp: linker: add KEEP to sections that may be removed by gc --- hal/x86_fsp_qemu_stage1.ld.in | 10 +++++----- hal/x86_fsp_tgl_stage1.ld.in | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/hal/x86_fsp_qemu_stage1.ld.in b/hal/x86_fsp_qemu_stage1.ld.in index 566b6fd5..362691ee 100644 --- a/hal/x86_fsp_qemu_stage1.ld.in +++ b/hal/x86_fsp_qemu_stage1.ld.in @@ -24,7 +24,7 @@ SECTIONS { _wolfboot_flash_start = .; KEEP(*(.sig_wolfboot_raw*)) - *(.wolfboot) + KEEP(*(.wolfboot)) _wolfboot_flash_end = .; } > FLASH @@ -41,7 +41,7 @@ SECTIONS .keystore KEYSTORE_START : { _start_keystore = .; - *(.keystore*) + KEEP(*(.keystore*)) } > FLASH .jmpto32 BOOTLOADER_JUMP32_START : @@ -90,7 +90,7 @@ SECTIONS AT(FSP_T_ORIGIN) { _start_fsp_t = .; - *(.fsp_t) + KEEP(*(.fsp_t)) } .fsp_s FSP_S_ORIGIN : @@ -98,14 +98,14 @@ SECTIONS _fsp_s_hdr = .; KEEP(*(.sig_fsp_s*)) _start_fsp_s = .; - *(.fsp_s) + KEEP(*(.fsp_s)) _end_fsp_s = .; } .fsp_m FSP_M_ORIGIN : { _start_fsp_m = .; - *(.fsp_m) + KEEP(*(.fsp_m)) _end_fsp_m = .; } } diff --git a/hal/x86_fsp_tgl_stage1.ld.in b/hal/x86_fsp_tgl_stage1.ld.in index 668f33d0..c4b4684c 100644 --- a/hal/x86_fsp_tgl_stage1.ld.in +++ b/hal/x86_fsp_tgl_stage1.ld.in @@ -27,7 +27,7 @@ SECTIONS { _wolfboot_flash_start = .; KEEP(*(.sig_wolfboot_raw*)) - *(.wolfboot) + KEEP(*(.wolfboot)) _wolfboot_flash_end = .; } > FLASH @@ -37,13 +37,13 @@ SECTIONS _policy_size_u32 = .; . += 4; _start_policy = .; - . += MAX_POLICY_SIZE; + . += MAX_POLICY_SIZE; _end_policy = .; } > FLASH .ucode_update0 UCODE0_BASE : { - *(.ucode0) + KEEP(*(.ucode0)) } > FLASH .fit_table FIT_TABLE : @@ -57,16 +57,16 @@ SECTIONS _fsp_s_hdr = .; KEEP(*(.sig_fsp_s*)) _start_fsp_s = .; - *(.fsp_s) + KEEP(*(.fsp_s)) _end_fsp_s = .; } > FLASH .bootloader WOLFBOOT_ORIGIN : { KEEP(./tgl_fsp.o(.boot)) - *(.boot*) + KEEP(*(.boot*)) KEYSTORE_START = .; - *(.keystore*) + KEEP(*(.keystore*)) *(.text*) *(.rodata*) *(.eh_frame*) @@ -100,13 +100,13 @@ SECTIONS AT(FSP_T_ORIGIN) { _start_fsp_t = .; - *(.fsp_t) + KEEP(*(.fsp_t)) } > FLASH .fsp_m FSP_M_ORIGIN : { _start_fsp_m = .; - *(.fsp_m) + KEEP(*(.fsp_m)) _end_fsp_m = .; } > FLASH