Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/453
-gerrit
commit dcc9ad3b26c55474029db74e1f503fb6b82dedd6 Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Wed Nov 23 16:33:12 2011 +0200
Fix ldscript for bootblock .rom section
Allocation size for the section was miscalculated, so the section did not honour its upper-bound address.
Also align the section start to 4 bytes, so it starts with code instead of pad bytes.
Change-Id: Ic2a43981836a0873b50abecfcad2def7b6586a5d Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- src/arch/x86/init/ldscript_failover.lb | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/src/arch/x86/init/ldscript_failover.lb b/src/arch/x86/init/ldscript_failover.lb index 7e48dc1..83e5eb3 100644 --- a/src/arch/x86/init/ldscript_failover.lb +++ b/src/arch/x86/init/ldscript_failover.lb @@ -29,6 +29,14 @@ MEMORY { TARGET(binary) SECTIONS { + /* Align .rom to next 4 byte boundary so no pad byte appears + * between _rom and _start. + */ + .bogus ROMLOC_MIN : { + . = ALIGN(4); + ROMLOC = .; + } >rom = 0xff + /* This section might be better named .setup */ .rom ROMLOC : { _rom = .; @@ -39,7 +47,11 @@ SECTIONS _erom = .; } >rom = 0xff
- ROMLOC = 0xffffff00 - (_erom - _rom) + 1; + /* Allocation reserves extra 16 bytes here. Alignment requirements + * may cause the total size of a section to change when the start + * address gets applied. + */ + ROMLOC_MIN = 0xffffff00 - (_erom - _rom + 16);
/DISCARD/ : { *(.comment)
On Wed, 2011-11-23 at 20:02 +0100, Kyösti Mälkki wrote:
Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/453
build/bootblock.map without patch:
fffffbfb A ROMLOC fffffc02 T _rom <-- pad bytes here fffffc04 T _start <-- (not invalid, just confusing) fffffc48 T gdtptr16 ... fffffef2 t L1005 ffffff04 t L1033 <-- over upper-bound ffffff08 T _erom
build/bootblock.map with patch:
fffffbe8 A ROMLOC_MIN fffffbf0 T _rom fffffbf0 T ROMLOC fffffbf0 T _start fffffc34 T gdtptr16 ... fffffee2 t L1005 fffffef4 t L1033 fffffef8 T _erom
Am Mittwoch, den 23.11.2011, 21:09 +0200 schrieb Kyösti Mälkki:
On Wed, 2011-11-23 at 20:02 +0100, Kyösti Mälkki wrote:
Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/453
build/bootblock.map without patch:
fffffbfb A ROMLOC fffffc02 T _rom <-- pad bytes here fffffc04 T _start <-- (not invalid, just confusing) fffffc48 T gdtptr16 ... fffffef2 t L1005 ffffff04 t L1033 <-- over upper-bound ffffff08 T _erom
build/bootblock.map with patch:
fffffbe8 A ROMLOC_MIN fffffbf0 T _rom fffffbf0 T ROMLOC fffffbf0 T _start fffffc34 T gdtptr16 ... fffffee2 t L1005 fffffef4 t L1033 fffffef8 T _erom
I guess that would be useful in the commit message, would not it?
Thanks,
Paul