Werner Zeh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/81678?usp=email )
Change subject: src/arch/x86/bootblock.ld: Preserve space for the .init section ......................................................................
src/arch/x86/bootblock.ld: Preserve space for the .init section
The .init section, which is placed right after the .text section in the bootblock, is currently not taken into account when the start address for the .text section is computed. Since it is quite small (just ~200-300 byte) it usually fits into the space which is created by aligning the .text section to 4k. There are cases where it does not fit into this space and therefore a section overlap between .text and .init happens at link time. This in the end leads to a build error when the bootblock is linked.
This patch considers the size of the .init section when the start address of .text is computed so that it always fits.
Change-Id: I9256fdea98ce640bc5780b23419942266562ebb8 Signed-off-by: Werner Zeh werner.zeh@siemens.com --- M src/arch/x86/bootblock.ld 1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/78/81678/1
diff --git a/src/arch/x86/bootblock.ld b/src/arch/x86/bootblock.ld index 73a3d18..6855b08 100644 --- a/src/arch/x86/bootblock.ld +++ b/src/arch/x86/bootblock.ld @@ -16,7 +16,7 @@ #if CONFIG(FIXED_BOOTBLOCK_SIZE) . = _ebootblock - CONFIG_C_ENV_BOOTBLOCK_SIZE; #else - . = BOOTBLOCK_TOP - PROGRAM_SZ; + . = BOOTBLOCK_TOP - PROGRAM_SZ - INIT_SZ; /* Page tables need to be at a 4K boundary so align the bootblock downwards */ . = ALIGN(4096); . -= 4096; @@ -37,6 +37,8 @@ *(.init.*); }
+ INIT_SZ = SIZEOF(.init); + /* * Allocation reserves extra space here. Alignment requirements * may cause the total size of a section to change when the start