aboutsummaryrefslogtreecommitdiffstats
path: root/src/arch/i386/prefix/nbiprefix.S
diff options
context:
space:
mode:
authorJoshua Oreman <oremanj@rwcr.net>2009-08-09 22:12:21 -0700
committerMichael Brown <mcb30@etherboot.org>2009-08-11 12:59:26 +0100
commitd5d68b2e310b8bf0caa6b8529f1ce7adbb92e771 (patch)
tree520a11c84f5542fbc26fb8ad0b0464432f951305 /src/arch/i386/prefix/nbiprefix.S
parent487347a0cdf10a4fabe295abb6d68487083d1aba (diff)
downloadipxe-d5d68b2e310b8bf0caa6b8529f1ce7adbb92e771.tar.gz
[zbin] Change fixup semantics to support ROMs over 128k uncompressed
The option ROM header contains a one-byte field indicating the number of 512-byte sectors in the ROM image. Currently it is linked to contain the number of uncompressed sectors, with an instruction to the compressor to correct it. This causes link failure when the uncompressed size of the ROM image is over 128k. Fix by replacing the SUBx compressor fixup with an ADDx fixup that adds the total compressed output length, scaled as requested, to an addend stored in the field where the final length value will be placed. This is similar to the behavior of ELF relocations, and ensures that an overflow error will not be generated unless the compressed size is still too large for the field. This also allows us to do away with the _filesz_pgh and _filesz_sect calculations exported by the linker script. Output tested bitwise identical to the old SUBx mechanism on hd, dsk, lkrn, and rom prefixes, on both 32-bit and 64-bit processors. Modified-by: Michael Brown <mcb30@etherboot.org> Signed-off-by: Michael Brown <mcb30@etherboot.org>
Diffstat (limited to 'src/arch/i386/prefix/nbiprefix.S')
-rw-r--r--src/arch/i386/prefix/nbiprefix.S8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/arch/i386/prefix/nbiprefix.S b/src/arch/i386/prefix/nbiprefix.S
index 4fb4acb1..607d80fb 100644
--- a/src/arch/i386/prefix/nbiprefix.S
+++ b/src/arch/i386/prefix/nbiprefix.S
@@ -30,16 +30,16 @@ segment_header:
.byte 0
.byte 0x04 /* Last segment */
.long 0x00007e00
-imglen: .long _filesz - 512
-memlen: .long _filesz - 512
+imglen: .long -512
+memlen: .long -512
.size segment_header, . - segment_header
.section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
- .ascii "SUBL"
+ .ascii "ADDL"
.long imglen
.long 1
.long 0
- .ascii "SUBL"
+ .ascii "ADDL"
.long memlen
.long 1
.long 0