91 #define SEG_START_ADDR(info, seg) \ 92 ((char *) (info)->dlpi_addr + (info)->dlpi_phdr[seg].p_vaddr) 94 #define SEG_SIZE(info, seg) ((info)->dlpi_phdr[seg].p_memsz) 96 #define SEG_IS_EXECUTABLE_CODE(info, seg) \ 97 (((info) != NULL) && \ 98 ((info)->dlpi_phdr != NULL) && \ 99 ((info)->dlpi_phdr[seg].p_type == PT_LOAD) && \ 100 ((info)->dlpi_phdr[seg].p_flags & PF_X)) 109 size_t size,
void *);
113 size_t size,
void *fargs_v);
185 int ret = dladdr(pc, &dli);
188 *proc_beg = dli.dli_saddr;
189 *mod_beg = dli.dli_fbase;
200 #if defined(__ia64__) && defined(__linux__) 204 extern int __libc_start_main(
void);
205 extern int __clone2(
int (*fn)(
void *),
void *child_stack_base,
206 size_t stack_size,
int flags,
void *arg, ...
208 void* proc_beg =
NULL, *mod_beg =
NULL;
211 return (proc_beg == __libc_start_main ||
212 proc_beg == __clone2);
218 extern int __libc_start_main(
void);
219 extern int __clone(
void);
220 extern int clone(
void);
222 void* proc_beg =
NULL, *mod_beg =
NULL;
224 return (proc_beg == __libc_start_main ||
225 proc_beg == clone || proc_beg == __clone);
227 #endif // __ia64__ && __linux__ 233 int ret = dladdr(pc, &dli);
235 return (dli.dli_sname) ? dli.dli_sname : dli.dli_fname;
253 char *
start = (
char *) -1;
259 for (j = 0; j < info->dlpi_phnum; j++) {
265 char *eaddr = saddr + size;
266 if (saddr < start) start = saddr;
267 if (eaddr >= end) end = eaddr;
281 if (strcmp(info->dlpi_name,
"") != 0) {
293 size_t size,
void* fargs_v)
#define SEG_START_ADDR(info, seg)
void dylib_map_executable()
static int dylib_find_module_containing_addr_callback(struct dl_phdr_info *info, size_t size, void *fargs_v)
#define SEG_IS_EXECUTABLE_CODE(info, seg)
int dylib_addr_is_mapped(void *addr)
const char * dylib_find_proc_name(const void *pc)
int dylib_find_proc(void *pc, void **proc_beg, void **mod_beg)
bool fnbounds_ensure_mapped_dso(const char *module_name, void *start, void *end)
void dylib_get_segment_bounds(struct dl_phdr_info *info, struct dylib_seg_bounds_s *bounds)
void dylib_map_open_dsos()
bool dylib_isin_start_func(void *pc)
struct dylib_seg_bounds_s bounds
static int dylib_map_open_dsos_callback(struct dl_phdr_info *info, size_t size, void *)
int dylib_find_module_containing_addr(void *addr, char *module_name, void **start, void **end)
#define SEG_SIZE(info, seg)