]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[build] Fix building on mildly deranged versions of binutils
authorMichael Brown <mcb30@ipxe.org>
Fri, 29 Apr 2011 00:27:36 +0000 (01:27 +0100)
committerMichael Brown <mcb30@ipxe.org>
Fri, 29 Apr 2011 00:27:36 +0000 (01:27 +0100)
commit987b825b7f046e844a332d27497b4846cb23ba43
tree8aa769f4390d5dfe4993622283b1e2e88eb38a59
parent62c963516612103c965f7b4789faf63753ca77a4
[build] Fix building on mildly deranged versions of binutils

Some versions of binutils have curious concepts of what constitutes
subtraction.  For example:

  0x00000000000000f0 _text16_late = .
  0x0000000000000898 _mtext16 = .
  0x0000000000000898 _etext16 = .
  0x0000000000000898 _text16_late_filesz = ABSOLUTE ((_mtext16 - _text16_late))
  0x00000000000007a8 _text16_late_memsz = ABSOLUTE ((_etext16 - _text16_late))

This has interesting side-effects such as producing sizes for .bss
segments that are negative, causing the majority of addressable memory
to be zeroed out.

Fix by using the form

  ABSOLUTE ( x ) - ABSOLUTE ( y )

rather than

  ABSOLUTE ( x - y )

Reported-by: H. Peter Anvin <hpa@zytor.com>
Suggested-by: H. Peter Anvin <hpa@zytor.com>
Tested-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/i386/scripts/i386.lds