[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/NEWLIB PATCH 04/16] link.h: Import from musl


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Thu, 22 Aug 2019 13:10:44 +0300
  • Cc: felipe.huici@xxxxxxxxx, charalampos.mainas@xxxxxxxxx
  • Delivery-date: Thu, 22 Aug 2019 10:11:26 +0000
  • Ironport-phdr: 9a23:r/3q1RPD9kObM8XAjCMl6mtUPXoX/o7sNwtQ0KIMzox0I//5rarrMEGX3/hxlliBBdydt6sezbOK7uu6AiQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTagf79+Ngi6oArRu8UZn4dvJLs6xwfUrHdPZ+lY335jK0iJnxb76Mew/Zpj/DpVtvk86cNOUrj0crohQ7BAAzsoL2465MvwtRneVgSP/WcTUn8XkhVTHQfI6gzxU4rrvSv7sup93zSaPdHzQLspVzmu87tnRRn1gyoBKjU38nzYitZogaxbvhyvuhJxzY3Tbo6XOvpzZb/Rcc8ASGZdRMtdSzBND4WhZIUPFeoBOuNYopHjqlsJthu+GQisBOXywTFOm3/2xbA62PkmHA7a2wwgBM4OsHXSrNnvMKcSTPi1zLTTwDrfdPNawy/96JXTfRw7u/GMWqt9fMzMwkchEAPFi0+fqY3jPz6N0+QNrnOb7+55WeKrim4osB1+riKoxsc2hYnEgJ8exFPc9Shh3Yo4KsC0RFR4bNOkCpdcqT+WOolsTs4sW21kpSk3xqActZO4fCUG0ooryhDRZvCdboSF7QzvWeCMKjlinn1lYqiwhxOq/Eilze3zS9e73U5RripAjtnMrncN1wHP6sSfSvty4EOh2TGX2gDN7+FLO0E0la7BJ5E92b48jIITsVnYESPsgkX2i7eadkQi+ue29+Tqeqjqq5CBO4NuiQzzMr4iltKhDek6KAQDUXCX+eGm273i+U35Tq9KjvozkqTBrJ/aIt8bprK4Aw9TyIoj7wu/Dy+70NkDgXYHN0hJeAqaj4fyIV3OOvf4Ae+lg1uwiDdr2+zGPrr5D5XIL3jDlrbhfbFm60JF1QU8085f6IxQCrwaJPLzW1TxtMDDDhMjPA273eDnBM961oMEVmKFGrWZP7/KsV+U+uIvJPGBa5MVuDnnMfgq/frugmU8mV8FeqmpxoEbaHWiEfRnJUWWe2Hsj8wHEWgUogU+SPblh0aYXTFNena4R7g86S0jCIK6EYfDQZiggLKf0ye/H51Wfn5JBkqMEXf1doWLR/YMZTmUIsB/jjMEUaKuRJQ72R6wqQ+pg4Zge+/V/Cwfrtfv2cZ448XXlAou7npkAsLb1HuCHE9umWZdbDgtwKF56Whg0krLhaN/mOBZE5pX+utUegwhc4bBxapgDIahCUr6Yt6VRQP+EZ2dCjYrQ4dpzg==
  • Ironport-sdr: ihPDNF4hJGOX3fg3Q2vRSP3nwimsgJ/UvV1qrJ+fPxEWtiSMp9rBYEg5CRXT3nFb+THqrT1eQd 8AnWN+qFQCyQ==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

Copied as is from the official musl git mirror
git://git.musl-libc.org/musl, commit 6fcb440d.

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 musl-imported/arch/generic/bits/link.h |  1 +
 musl-imported/include/link.h           | 53 ++++++++++++++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 musl-imported/arch/generic/bits/link.h
 create mode 100644 musl-imported/include/link.h

diff --git a/musl-imported/arch/generic/bits/link.h 
b/musl-imported/arch/generic/bits/link.h
new file mode 100644
index 0000000..4a94d8f
--- /dev/null
+++ b/musl-imported/arch/generic/bits/link.h
@@ -0,0 +1 @@
+typedef uint32_t Elf_Symndx;
diff --git a/musl-imported/include/link.h b/musl-imported/include/link.h
new file mode 100644
index 0000000..8150185
--- /dev/null
+++ b/musl-imported/include/link.h
@@ -0,0 +1,53 @@
+#ifndef _LINK_H
+#define _LINK_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <elf.h>
+#define __NEED_size_t
+#define __NEED_uint32_t
+#include <bits/alltypes.h>
+
+#if UINTPTR_MAX > 0xffffffff
+#define ElfW(type) Elf64_ ## type
+#else
+#define ElfW(type) Elf32_ ## type
+#endif
+
+#include <bits/link.h>
+
+struct dl_phdr_info {
+       ElfW(Addr) dlpi_addr;
+       const char *dlpi_name;
+       const ElfW(Phdr) *dlpi_phdr;
+       ElfW(Half) dlpi_phnum;
+       unsigned long long int dlpi_adds;
+       unsigned long long int dlpi_subs;
+       size_t dlpi_tls_modid;
+       void *dlpi_tls_data;
+};
+
+struct link_map {
+       ElfW(Addr) l_addr;
+       char *l_name;
+       ElfW(Dyn) *l_ld;
+       struct link_map *l_next, *l_prev;
+};
+
+struct r_debug {
+       int r_version;
+       struct link_map *r_map;
+       ElfW(Addr) r_brk;
+       enum { RT_CONSISTENT, RT_ADD, RT_DELETE } r_state;
+       ElfW(Addr) r_ldbase;
+};
+
+int dl_iterate_phdr(int (*)(struct dl_phdr_info *, size_t, void *), void *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.