minor compatibility fixes in utmp.h and fixing mismatch with paths.h
[musl] / include / link.h
1 #ifndef _LINK_H
2 #define _LINK_H
3
4 #include <elf.h>
5 #define __NEED_size_t
6 #define __NEED_uint32_t
7 #include <bits/alltypes.h>
8
9 #if UINTPTR_MAX > 0xffffffff
10 #define ElfW(type) Elf64_ ## type
11 #else
12 #define ElfW(type) Elf32_ ## type
13 #endif
14
15 /* this is the same everywhere except alpha and s390 */
16 typedef uint32_t Elf_Symndx;
17
18 struct dl_phdr_info {
19         ElfW(Addr) dlpi_addr;
20         const char *dlpi_name;
21         const ElfW(Phdr) *dlpi_phdr;
22         ElfW(Half) dlpi_phnum;
23         unsigned long long int dlpi_adds;
24         unsigned long long int dlpi_subs;
25         size_t dlpi_tls_modid;
26         void *dlpi_tls_data;
27 };
28
29 struct link_map {
30         ElfW(Addr) l_addr;
31         char *l_name;
32         ElfW(Dyn) *l_ld;
33         struct link_map *l_next, *l_prev;
34 };
35
36 struct r_debug {
37         int r_version;
38         struct link_map *r_map;
39         ElfW(Addr) r_brk;
40         enum { RT_CONSISTENT, RT_ADD, RT_DELETE } r_state;
41         ElfW(Addr) r_ldbase;
42 };
43
44 int dl_iterate_phdr(int (*)(struct dl_phdr_info *, size_t, void *), void *);
45
46 #endif