2012-11-01 01:27:48 +00:00
|
|
|
#ifndef _LINK_H
|
|
|
|
#define _LINK_H
|
|
|
|
|
2013-08-02 20:52:17 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-11-01 01:27:48 +00:00
|
|
|
#include <elf.h>
|
|
|
|
#define __NEED_size_t
|
2012-12-19 04:08:07 +00:00
|
|
|
#define __NEED_uint32_t
|
2012-11-01 01:27:48 +00:00
|
|
|
#include <bits/alltypes.h>
|
|
|
|
|
|
|
|
#if UINTPTR_MAX > 0xffffffff
|
|
|
|
#define ElfW(type) Elf64_ ## type
|
|
|
|
#else
|
|
|
|
#define ElfW(type) Elf32_ ## type
|
|
|
|
#endif
|
|
|
|
|
2016-11-11 17:30:24 +00:00
|
|
|
#include <bits/link.h>
|
2012-12-19 04:08:07 +00:00
|
|
|
|
2012-11-01 01:27:48 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2012-12-19 04:08:07 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2012-11-01 01:27:48 +00:00
|
|
|
int dl_iterate_phdr(int (*)(struct dl_phdr_info *, size_t, void *), void *);
|
|
|
|
|
2013-08-02 20:52:17 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-11-01 01:27:48 +00:00
|
|
|
#endif
|