diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-12-21 10:17:56 +0200 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2021-01-28 08:54:21 +0000 |
commit | 2289a70b6f5fa14f3e008bc6041d8a8bd4ef956b (patch) | |
tree | 6ad1858a4f11d0a05a3afb71c33c8a4396648ff9 /src/soc/amd | |
parent | 6c7441f5e6e667b6602aa12832a52894cf06dd89 (diff) | |
download | coreboot-2289a70b6f5fa14f3e008bc6041d8a8bd4ef956b.tar.xz |
arch/x86: Top-align .init in bootblock
Link .init section near the end of bootblock program.
It contains _start16bit, gdtptr and gdt that must be
addressable from realmode, thus within top 64 KiB.
Change-Id: If7b9737650362ac7cd82685cfdfaf18bd2429238
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47970
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/soc/amd')
-rw-r--r-- | src/soc/amd/common/block/cpu/noncar/memlayout_x86.ld | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/cpu/noncar/memlayout_x86.ld b/src/soc/amd/common/block/cpu/noncar/memlayout_x86.ld index 352472e18b..e1f2765ebb 100644 --- a/src/soc/amd/common/block/cpu/noncar/memlayout_x86.ld +++ b/src/soc/amd/common/block/cpu/noncar/memlayout_x86.ld @@ -110,6 +110,22 @@ SECTIONS { _TOO_LOW = _X86_RESET_VECTOR - 0xfff0; _bogus = ASSERT(_start16bit >= _TOO_LOW, "_start16bit too low. Please report."); + . = _X86_RESET_VECTOR - EARLYASM_SZ; + . = ALIGN(16); + BOOTBLOCK_TOP = .; + .init (.) : { + *(.init._start); + *(.init); + *(.init.*); + } + + /* + * Allocation reserves extra space here. Alignment requirements + * may cause the total size of a section to change when the start + * address gets applied. + */ + EARLYASM_SZ = SIZEOF(.init) + 16; + . = BOOTBLOCK_END - 0x10; _X86_RESET_VECTOR = .; .reset . : { |