Arthur Heymans has uploaded this change for review.

View Change

arch/x86/bootblock.ld: Align the base of bootblock downwards

Instead of using some aritmetics that sometimes works, use the largest
alignment necessary (page tables) and align downwards in the linker
script.

This fixes linking failing when linking in page tables inside the
bootblock.

Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: I78c6ba6e250ded3f04b12cd0c20b18cb653a1506
---
M src/arch/x86/bootblock.ld
1 file changed, 4 insertions(+), 7 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/80346/1
diff --git a/src/arch/x86/bootblock.ld b/src/arch/x86/bootblock.ld
index d59eb27..6547985 100644
--- a/src/arch/x86/bootblock.ld
+++ b/src/arch/x86/bootblock.ld
@@ -17,19 +17,16 @@
. = _ebootblock - CONFIG_C_ENV_BOOTBLOCK_SIZE;
#else
. = BOOTBLOCK_TOP - PROGRAM_SZ;
- . = ALIGN(64);
+ /* Page tables need to be at a 4K boundary so align the bootblock downwards */
+ . = ALIGN(4096);
+ . -= 4096;
#endif

_bootblock = .;

INCLUDE "bootblock/lib/program.ld"

- /*
- * Allocation reserves extra space here. Alignment requirements
- * may cause the total size of a section to change when the start
- * address gets applied.
- */
- PROGRAM_SZ = SIZEOF(.text) + 512;
+ PROGRAM_SZ = SIZEOF(.text);

. = MIN(_ECFW_PTR, MIN(_ID_SECTION, _FIT_POINTER)) - EARLYASM_SZ;
. = CONFIG(SIPI_VECTOR_IN_ROM) ? ALIGN(4096) : ALIGN(16);

To view, visit change 80346. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I78c6ba6e250ded3f04b12cd0c20b18cb653a1506
Gerrit-Change-Number: 80346
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-MessageType: newchange