summaryrefslogtreecommitdiffstats
path: root/sys/boot/common/load_elf_obj.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2016-03-06 15:57:43 +0000
committerdim <dim@FreeBSD.org>2016-03-06 15:57:43 +0000
commitdad90af48902731a920169292dc39a19d544fd49 (patch)
tree8785f56cda593f8f093990645de0cc7905456686 /sys/boot/common/load_elf_obj.c
parent6a7e3d9c509d7992fc2c8f519ded322715c0d0da (diff)
downloadFreeBSD-src-dad90af48902731a920169292dc39a19d544fd49.zip
FreeBSD-src-dad90af48902731a920169292dc39a19d544fd49.tar.gz
Since kernel modules can now contain sections of type SHT_AMD64_UNWIND,
the boot loader should not skip over these anymore while loading images. Otherwise the kernel can still panic when it doesn't find the .eh_frame section belonging to the .rela.eh_frame section. Unfortunately this will require installing boot loaders from sys/boot before attempting to boot with a new kernel. Reviewed by: kib MFC after: 2 weeks X-MFC-With: r296419
Diffstat (limited to 'sys/boot/common/load_elf_obj.c')
-rw-r--r--sys/boot/common/load_elf_obj.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/boot/common/load_elf_obj.c b/sys/boot/common/load_elf_obj.c
index 869f020..285a88e 100644
--- a/sys/boot/common/load_elf_obj.c
+++ b/sys/boot/common/load_elf_obj.c
@@ -221,6 +221,9 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off)
switch (shdr[i].sh_type) {
case SHT_PROGBITS:
case SHT_NOBITS:
+#if defined(__i386__) || defined(__amd64__)
+ case SHT_AMD64_UNWIND:
+#endif
lastaddr = roundup(lastaddr, shdr[i].sh_addralign);
shdr[i].sh_addr = (Elf_Addr)lastaddr;
lastaddr += shdr[i].sh_size;
OpenPOWER on IntegriCloud