From e2abcdca396661cbe0ae2ddb13d5c2b85682c13a Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Fri, 16 Oct 2020 17:41:25 +0300 Subject: initial commit --- include/link_elf.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 include/link_elf.h (limited to 'include/link_elf.h') diff --git a/include/link_elf.h b/include/link_elf.h new file mode 100644 index 0000000..45fc1b9 --- /dev/null +++ b/include/link_elf.h @@ -0,0 +1,42 @@ +/* $OpenBSD: link_elf.h,v 1.7 2016/09/20 18:24:55 kettenis Exp $ */ + +/* + * Public domain. + */ + +#ifndef _LINK_ELF_H +#define _LINK_ELF_H + +#include + +#ifndef DT_PROCNUM +#define DT_PROCNUM 0 +#endif + +/* + * struct link_map is a part of the protocol between the debugger and + * ld.so. ld.so may have additional fields in it's version of this + * structure but those are ld.so private fields. + */ +struct link_map { + caddr_t l_addr; /* Base address of library */ + const char *l_name; /* Absolute path to library */ + void *l_ld; /* pointer to _DYNAMIC */ + struct link_map *l_next; + struct link_map *l_prev; +}; + +struct dl_phdr_info { + Elf_Addr dlpi_addr; + const char *dlpi_name; + const Elf_Phdr *dlpi_phdr; + Elf_Half dlpi_phnum; +}; + +__BEGIN_DECLS +int dl_iterate_phdr (int (*)(struct dl_phdr_info *, size_t, void *), + void *); +void *dl_unwind_find_exidx(const void *, int *); +__END_DECLS + +#endif /* !_LINK_ELF_H */ -- cgit v1.2.3