Attention is currently required from: Jérémy Compostella.
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/84045?usp=email )
Change subject: [WIP]arch/x86: Make bootblock.ld LLD compatible ......................................................................
[WIP]arch/x86: Make bootblock.ld LLD compatible
Change-Id: I278c7199a25b7af77247c0e4fe52fe1c81c17a2a Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/arch/x86/bootblock.ld M src/cpu/x86/reset16.S 2 files changed, 15 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/84045/1
diff --git a/src/arch/x86/bootblock.ld b/src/arch/x86/bootblock.ld index 1f44d6a..0477a02 100644 --- a/src/arch/x86/bootblock.ld +++ b/src/arch/x86/bootblock.ld @@ -16,8 +16,7 @@ #if CONFIG(FIXED_BOOTBLOCK_SIZE) . = _ebootblock - CONFIG_C_ENV_BOOTBLOCK_SIZE; #else - . = BOOTBLOCK_TOP - PROGRAM_SZ; - /* Page tables need to be at a 4K boundary so align the bootblock downwards */ + . = 0xffffff00 - PROGRAM_SZ; . = ALIGN(4096); . -= 4096; #endif @@ -28,7 +27,7 @@
PROGRAM_SZ = SIZEOF(.text) + SIZEOF(.data) + CONFIG_X86_BOOTBLOCK_EXTRA_PROGRAM_SZ;
- . = MIN(_ECFW_PTR, MIN(_ID_SECTION, _FIT_POINTER)) - EARLYASM_SZ; + . = _ID_SECTION - EARLYASM_SZ; . = CONFIG(SIPI_VECTOR_IN_ROM) ? ALIGN(4096) : ALIGN(16); BOOTBLOCK_TOP = .; .init (.) : { @@ -50,16 +49,17 @@ }
/* Flashrom and FILO have two alternatives for the location of .id section. */ - _ID_SECTION_END = SIZEOF(.fit_pointer) && SIZEOF(.id) > 0x28 ? 0xffffff80 : _X86_RESET_VECTOR; + _ID_SECTION_END = 0xffffff80; _ID_SECTION = _ID_SECTION_END - SIZEOF(.id);
- . = _ECFW_PTR; +#if CONFIG_ECFW_PTR_SIZE + . = _CONFIG_ECFW_PTR_ADDR; .ecfw_ptr (.): { ASSERT((SIZEOF(.ecfw_ptr) == CONFIG_ECFW_PTR_SIZE), "Size of ecfw_ptr is incorrect"); KEEP(*(.ecfw_ptr)); } _ECFW_PTR = SIZEOF(.ecfw_ptr) ? CONFIG_ECFW_PTR_ADDR : _X86_RESET_VECTOR; - +#endif . = _FIT_POINTER; .fit_pointer (.): { KEEP(*(.fit_pointer)); @@ -70,14 +70,11 @@ _X86_RESET_VECTOR = .; .reset . : { *(.reset); - . = _X86_RESET_VECTOR_FILLING; - BYTE(0); } . = 0xfffffffc; .header_pointer . : { KEEP(*(.header_pointer)); } - _X86_RESET_VECTOR_FILLING = 15 - SIZEOF(.header_pointer); _ebootblock = .; }
@@ -85,8 +82,10 @@ * Tests _bogus1 and _bogus2 are here to detect case of symbol addresses truncated * to 32 bits and intermediate files reaching size of close to 4 GiB. */ + #if !CONFIG(LTO) _bogus1 = ASSERT(_bootblock & 0x80000000, "_bootblock too low, invalid ld script"); _bogus2 = ASSERT(_start16bit & 0x80000000, "_start16bit too low, invalid ld script"); _bogus3 = ASSERT(_start16bit >= 0xffff0000, "_start16bit too low. Please report."); _bogus4 = ASSERT(_ebootblock - _bootblock <= CONFIG_C_ENV_BOOTBLOCK_SIZE, "_bootblock too low, increase C_ENV_BOOTBLOCK_SIZE"); +#endif diff --git a/src/cpu/x86/reset16.S b/src/cpu/x86/reset16.S index 3858014..586d3a7 100644 --- a/src/cpu/x86/reset16.S +++ b/src/cpu/x86/reset16.S @@ -12,3 +12,10 @@ * instead of the weird 16 bit relocations that binutils does not * handle consistently between versions because they are used so rarely. */ + .byte 0xAB + .byte 0xAB + .byte 0xAB + .byte 0xAB + .byte 0xAB + .byte 0xAB + .byte 0xAB