summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2016-03-07 07:54:48 +0000
committerdim <dim@FreeBSD.org>2016-03-07 07:54:48 +0000
commit7d7aa54ad20ed3ec07ec2670ae300ccdf74123a8 (patch)
tree215087ccc92ce29a284bf593f5cb0ceb072edae5 /sys/boot
parent677f3cf709d2da38d4643c74bb1934315c32e43c (diff)
downloadFreeBSD-src-7d7aa54ad20ed3ec07ec2670ae300ccdf74123a8.zip
FreeBSD-src-7d7aa54ad20ed3ec07ec2670ae300ccdf74123a8.tar.gz
MFC r296419 (by kib):
In the link_elf_obj.c, handle sections of type SHT_AMD64_UNWIND same as SHT_PROGBITS. This is needed after the clang 3.8 import, which generates that type for .eh_frame section, which had SHT_PROGBITS type before. Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com> PR: 207729 Tested by: dim (previous version) Sponsored by: The FreeBSD Foundation MFC r296428: 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
Diffstat (limited to 'sys/boot')
-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 626f2d9..b983ecb 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