summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2013-04-17 21:19:17 +0000
committermiod <miod@openbsd.org>2013-04-17 21:19:17 +0000
commit07dfdfe3c2b045cf65eabb728718bea3f81ab5df (patch)
treea449547954c622b67ce033429c249f462fa02550
parentCrank MAXPAGESIZE from 4KB to 64KB to match what SVR4/m88k and DG/UX do. (diff)
downloadwireguard-openbsd-07dfdfe3c2b045cf65eabb728718bea3f81ab5df.tar.xz
wireguard-openbsd-07dfdfe3c2b045cf65eabb728718bea3f81ab5df.zip
Define and fill machine-specific DT_88K_PLT{START,END} _DYNAMIC tags when
creating objects with a .plt (either shared libraries or dynamic binaries). These tags contain the start and end address of the plt, relative to the beginning of the object. This will (eventually) allow ld.so to find the area spanned by the plt more easily, and also matches what SVR4/m88k does.
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-m88k.c14
-rw-r--r--gnu/usr.bin/binutils/include/elf/m88k.h7
2 files changed, 20 insertions, 1 deletions
diff --git a/gnu/usr.bin/binutils/bfd/elf32-m88k.c b/gnu/usr.bin/binutils/bfd/elf32-m88k.c
index 48678637857..6723e6852a0 100644
--- a/gnu/usr.bin/binutils/bfd/elf32-m88k.c
+++ b/gnu/usr.bin/binutils/bfd/elf32-m88k.c
@@ -1260,7 +1260,9 @@ elf_m88k_size_dynamic_sections (output_bfd, info)
if (!add_dynamic_entry (DT_PLTGOT, 0)
|| !add_dynamic_entry (DT_PLTRELSZ, 0)
|| !add_dynamic_entry (DT_PLTREL, DT_RELA)
- || !add_dynamic_entry (DT_JMPREL, 0))
+ || !add_dynamic_entry (DT_JMPREL, 0)
+ || !add_dynamic_entry (DT_88K_PLTSTART, 0)
+ || !add_dynamic_entry (DT_88K_PLTEND, 0))
return FALSE;
}
@@ -2022,6 +2024,16 @@ elf_m88k_finish_dynamic_sections (output_bfd, info)
}
bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
+
+ case DT_88K_PLTSTART:
+ name = ".plt";
+ goto get_vma;
+ case DT_88K_PLTEND:
+ s = bfd_get_section_by_name (output_bfd, ".plt");
+ BFD_ASSERT (s != NULL);
+ dyn.d_un.d_ptr = s->vma + s->_raw_size;
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
}
}
diff --git a/gnu/usr.bin/binutils/include/elf/m88k.h b/gnu/usr.bin/binutils/include/elf/m88k.h
index f3afacf6838..b37f854b4f5 100644
--- a/gnu/usr.bin/binutils/include/elf/m88k.h
+++ b/gnu/usr.bin/binutils/include/elf/m88k.h
@@ -96,4 +96,11 @@ END_RELOC_NUMBERS (R_88K_UNIMPLEMENTED)
#define EF_NABI 0x80000000 /* not ABI compliant */
#define EF_M88110 0x00000004 /* used 88110-specific features */
+/* Processor specific dynamic tag values. */
+
+#define DT_88K_ADDRBASE 0x70000001
+#define DT_88K_PLTSTART 0x70000002
+#define DT_88K_PLTEND 0x70000003
+#define DT_88K_TDESC 0x70000004
+
#endif