diff options
author | Maciej Pijanka <maciej.pijanka@gmail.com> | 2009-11-27 14:32:17 +0000 |
---|---|---|
committer | Patrick Georgi <patrick.georgi@coresystems.de> | 2009-11-27 14:32:17 +0000 |
commit | c58290c2ff3a77ebca00d9d2edbe005d6e950e0f (patch) | |
tree | 8f5c2ad99dac4cdca57ae04e36a9bc9a9a82b27e /src | |
parent | b0f82d9cd3dffb15acf0b80a7d4756c50d6eb295 (diff) | |
download | coreboot-staging-c58290c2ff3a77ebca00d9d2edbe005d6e950e0f.zip coreboot-staging-c58290c2ff3a77ebca00d9d2edbe005d6e950e0f.tar.gz |
Let ld(1) calculate the required size for code in the bootblock
automatically.
Signed-off-by: Maciej Pijanka <maciej.pijanka@gmail.com>
Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4961 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/i386/init/ldscript_fallback_cbfs.lb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/arch/i386/init/ldscript_fallback_cbfs.lb b/src/arch/i386/init/ldscript_fallback_cbfs.lb index eb3bf3f..6dec5ed 100644 --- a/src/arch/i386/init/ldscript_fallback_cbfs.lb +++ b/src/arch/i386/init/ldscript_fallback_cbfs.lb @@ -40,8 +40,10 @@ SECTIONS _x = .; . = (_x < (CONFIG_ROMBASE - 0x10000 + CONFIG_ROM_IMAGE_SIZE)) ? (CONFIG_ROMBASE - 0x10000 + CONFIG_ROM_IMAGE_SIZE) : _x; + __my_rom_start = .; + /* This section might be better named .setup */ - .rom . : { + .rom _myrom : { _rom = .; *(.rom.text); *(.rom.data); @@ -54,6 +56,7 @@ SECTIONS } _lrom = LOADADDR(.rom); + _elrom = LOADADDR(.rom) + SIZEOF(.rom); /DISCARD/ : { @@ -62,4 +65,13 @@ SECTIONS *(.comment.*) *(.note.*) } + + __my_rom_end = .; + + __my_rom_size = (( ( __my_rom_end - __my_rom_start ) / 256) + 2 ) * 256; + /* Next line gives same output for me as above one but causes + * ld to complain about non constant offset so + __my_rom_size = (( (SIZEOF(.rom) + SIZEOF(.data) + SIZEOF(.text)) / 256 ) + 2 ) * 256; + */ + _myrom = _rom + (0x10000 - __my_rom_size); } |