[elf] Work around entry point bug in NetBSD kernels
authorMichael Brown <mcb30@etherboot.org>
Fri, 24 Apr 2009 02:42:34 +0000 (03:42 +0100)
committerMichael Brown <mcb30@etherboot.org>
Fri, 24 Apr 2009 02:42:34 +0000 (03:42 +0100)
commit4b8e021161bbe43f81bb664cceb95d1758a51936
treeea2abcb0096ed0f4f8c1f67be99fab67f0e01b3c
parente960fac8d037601ac6f7f7b8de80566d33ac6712
[elf] Work around entry point bug in NetBSD kernels

NetBSD kernels are multiboot ELF kernels with an entry point
incorrectly specified as a virtual address rather than a physical
address.

Work around this by looking for the segment that could plausibly
contain the entry point address (interpreted as either a physical or
virtual address), and using that to determine the eventual physical
entry point.

In the event of any ambiguity, precedence is given to interpretation
of the entry point as a physical address.
src/image/elf.c