kernel: Handle zero-length ELF sections better
authorJohn Marino <draco@marino.st>
Mon, 21 Sep 2015 15:48:53 +0000 (17:48 +0200)
committerJohn Marino <draco@marino.st>
Tue, 22 Sep 2015 11:22:50 +0000 (13:22 +0200)
commit96e935d23e2fe088e6edbff415efb2c365940b55
tree6a0d149449923d309698b1984d1df99eb33564d6
parenteab4ae1efcc5f9ff70a6d318ded636e64893ac70
kernel: Handle zero-length ELF sections better

FreeBSD simply skips all zero-length ELF sections when scanning an
REL type file.  The first time we tried it, DF panicked with a lost
bigs message.  It turns out this was because the skip should have been
applied in 3 places and we missed the first one.

The same approach is needed by the boot loader as well.
sys/boot/common/load_elf_obj.c
sys/kern/link_elf_obj.c