summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-03-09 08:41:15 -0300
committerRenato Botelho <renato@netgate.com>2016-03-09 08:41:15 -0300
commit22a5a00c6b7b2d9cc56c40859d6fb4fc5a50df4f (patch)
tree94a7306181396550b163b02e952c6e6a3e007391
parent2cb9037172ce155f30b73a0605c0a9f0ec20ad24 (diff)
parent9f6c0beb36d11aa18540a6697d10617db187affc (diff)
downloadFreeBSD-src-22a5a00c6b7b2d9cc56c40859d6fb4fc5a50df4f.zip
FreeBSD-src-22a5a00c6b7b2d9cc56c40859d6fb4fc5a50df4f.tar.gz
Merge remote-tracking branch 'origin/releng/10.3' into RELENG_2_3
-rw-r--r--sys/boot/common/load_elf_obj.c3
-rw-r--r--sys/kern/link_elf_obj.c29
2 files changed, 31 insertions, 1 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;
diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c
index 453d8ce..dc13283 100644
--- a/sys/kern/link_elf_obj.c
+++ b/sys/kern/link_elf_obj.c
@@ -257,6 +257,9 @@ link_elf_link_preload(linker_class_t cls, const char *filename,
switch (shdr[i].sh_type) {
case SHT_PROGBITS:
case SHT_NOBITS:
+#ifdef __amd64__
+ case SHT_AMD64_UNWIND:
+#endif
ef->nprogtab++;
break;
case SHT_SYMTAB:
@@ -327,9 +330,16 @@ link_elf_link_preload(linker_class_t cls, const char *filename,
switch (shdr[i].sh_type) {
case SHT_PROGBITS:
case SHT_NOBITS:
+#ifdef __amd64__
+ case SHT_AMD64_UNWIND:
+#endif
ef->progtab[pb].addr = (void *)shdr[i].sh_addr;
if (shdr[i].sh_type == SHT_PROGBITS)
ef->progtab[pb].name = "<<PROGBITS>>";
+#ifdef __amd64__
+ else if (shdr[i].sh_type == SHT_AMD64_UNWIND)
+ ef->progtab[pb].name = "<<UNWIND>>";
+#endif
else
ef->progtab[pb].name = "<<NOBITS>>";
ef->progtab[pb].size = shdr[i].sh_size;
@@ -553,6 +563,9 @@ link_elf_load_file(linker_class_t cls, const char *filename,
switch (shdr[i].sh_type) {
case SHT_PROGBITS:
case SHT_NOBITS:
+#ifdef __amd64__
+ case SHT_AMD64_UNWIND:
+#endif
ef->nprogtab++;
break;
case SHT_SYMTAB:
@@ -659,6 +672,9 @@ link_elf_load_file(linker_class_t cls, const char *filename,
switch (shdr[i].sh_type) {
case SHT_PROGBITS:
case SHT_NOBITS:
+#ifdef __amd64__
+ case SHT_AMD64_UNWIND:
+#endif
alignmask = shdr[i].sh_addralign - 1;
mapsize += alignmask;
mapsize &= ~alignmask;
@@ -726,6 +742,9 @@ link_elf_load_file(linker_class_t cls, const char *filename,
switch (shdr[i].sh_type) {
case SHT_PROGBITS:
case SHT_NOBITS:
+#ifdef __amd64__
+ case SHT_AMD64_UNWIND:
+#endif
alignmask = shdr[i].sh_addralign - 1;
mapbase += alignmask;
mapbase &= ~alignmask;
@@ -734,6 +753,10 @@ link_elf_load_file(linker_class_t cls, const char *filename,
ef->shstrtab + shdr[i].sh_name;
else if (shdr[i].sh_type == SHT_PROGBITS)
ef->progtab[pb].name = "<<PROGBITS>>";
+#ifdef __amd64__
+ else if (shdr[i].sh_type == SHT_AMD64_UNWIND)
+ ef->progtab[pb].name = "<<UNWIND>>";
+#endif
else
ef->progtab[pb].name = "<<NOBITS>>";
if (ef->progtab[pb].name != NULL &&
@@ -755,7 +778,11 @@ link_elf_load_file(linker_class_t cls, const char *filename,
}
ef->progtab[pb].size = shdr[i].sh_size;
ef->progtab[pb].sec = i;
- if (shdr[i].sh_type == SHT_PROGBITS) {
+ if (shdr[i].sh_type == SHT_PROGBITS
+#ifdef __amd64__
+ || shdr[i].sh_type == SHT_AMD64_UNWIND
+#endif
+ ) {
error = vn_rdwr(UIO_READ, nd.ni_vp,
ef->progtab[pb].addr,
shdr[i].sh_size, shdr[i].sh_offset,
OpenPOWER on IntegriCloud