summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/scripts
diff options
context:
space:
mode:
authorMichael Brown2012-06-10 19:25:26 +0200
committerMichael Brown2012-06-12 16:15:03 +0200
commit9e8d431a0d58caba3c5f65d4e30fd259d2f782e1 (patch)
tree357391dd1bbd9b6f0d98dd099aafec60f9bdf80e /src/arch/i386/scripts
parent[util] Rewrite catrom.pl to use Option::ROM library (diff)
downloadipxe-9e8d431a0d58caba3c5f65d4e30fd259d2f782e1.tar.gz
ipxe-9e8d431a0d58caba3c5f65d4e30fd259d2f782e1.tar.xz
ipxe-9e8d431a0d58caba3c5f65d4e30fd259d2f782e1.zip
[romprefix] Add a dummy ROM header to cover the .mrom payload
The header of a .mrom image declares its length to be only a few kilobytes; the remainder is accessed via a sideband mechanism. This makes it difficult to append an additional ROM image, such as an EFI ROM. Add a second, dummy ROM header covering the payload portion of the .mrom image, allowing consumers to locate any appended ROM images in the usual way. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/i386/scripts')
-rw-r--r--src/arch/i386/scripts/i386.lds25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/arch/i386/scripts/i386.lds b/src/arch/i386/scripts/i386.lds
index 763b80d65..fb763656c 100644
--- a/src/arch/i386/scripts/i386.lds
+++ b/src/arch/i386/scripts/i386.lds
@@ -1,4 +1,4 @@
-/* -*- sh -*- */
+/* -*- ld-script -*- */
/*
* Linker script for i386 images
@@ -122,6 +122,23 @@ SECTIONS {
_textdata_memsz = ABSOLUTE ( _etextdata ) - ABSOLUTE ( _textdata );
/*
+ * Payload prefix
+ *
+ * If present, this will be placed between .text16.early and .text16.late.
+ *
+ */
+ .pprefix 0x0 : AT ( _pprefix_lma ) {
+ _pprefix = .;
+ KEEP(*(.pprefix))
+ KEEP(*(.pprefix.*))
+ _mpprefix = .;
+ } .bss.pprefix (NOLOAD) : AT ( _end_lma ) {
+ _epprefix = .;
+ }
+ _pprefix_filesz = ABSOLUTE ( _mpprefix ) - ABSOLUTE ( _pprefix );
+ _pprefix_memsz = ABSOLUTE ( _epprefix ) - ABSOLUTE ( _pprefix );
+
+ /*
* Compressor information block
*
*/
@@ -188,7 +205,13 @@ SECTIONS {
. += _text16_early_filesz;
. = ALIGN ( _max_align );
+ . = ALIGN ( _payload_align );
+ _pprefix_lma = .;
+ . += _pprefix_filesz;
+
+ . = ALIGN ( _max_align );
_payload_lma = .;
+ _pprefix_skip = ABSOLUTE ( _payload_lma ) - ABSOLUTE ( _pprefix_lma );
_text16_late_lma = .;
. += _text16_late_filesz;