[coreboot] [commit] r4961 - trunk/src/arch/i386/init

svn at coreboot.org svn at coreboot.org
Fri Nov 27 15:32:17 CET 2009


Author: oxygene
Date: 2009-11-27 15:32:17 +0100 (Fri, 27 Nov 2009)
New Revision: 4961

Modified:
   trunk/src/arch/i386/init/ldscript_fallback_cbfs.lb
Log:
Let ld(1) calculate the required size for code in the bootblock
automatically.

Signed-off-by: Maciej Pijanka <maciej.pijanka at gmail.com>
Acked-by: Patrick Georgi <patrick.georgi at coresystems.de>


Modified: trunk/src/arch/i386/init/ldscript_fallback_cbfs.lb
===================================================================
--- trunk/src/arch/i386/init/ldscript_fallback_cbfs.lb	2009-11-27 11:04:08 UTC (rev 4960)
+++ trunk/src/arch/i386/init/ldscript_fallback_cbfs.lb	2009-11-27 14:32:17 UTC (rev 4961)
@@ -40,8 +40,10 @@
 	_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 @@
 	}
 
 	_lrom = LOADADDR(.rom);
+
 	_elrom = LOADADDR(.rom) + SIZEOF(.rom);
 
 	/DISCARD/ : {
@@ -62,4 +65,13 @@
 		*(.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);
 }





More information about the coreboot mailing list