Lines Matching refs:elf
267 has_freebsd_abi_tag(const char *fname, Elf *elf, GElf_Ehdr *ehdr, off_t offset, in has_freebsd_abi_tag() argument
278 buf = elf_rawfile(elf, NULL); in has_freebsd_abi_tag()
296 if (gelf_xlatetom(elf, &dst, &src, ehdr->e_ident[EI_DATA]) == NULL) { in has_freebsd_abi_tag()
335 is_pie(const char *fname, Elf *elf, GElf_Ehdr *ehdr, off_t offset, size_t len) in is_pie() argument
345 buf = elf_rawfile(elf, NULL); in is_pie()
351 dynsize = gelf_fsize(elf, ELF_T_DYN, 1, EV_CURRENT); in is_pie()
370 if (gelf_xlatetom(elf, &dst, &src, ehdr->e_ident[EI_DATA]) == NULL) { in is_pie()
393 Elf *elf; in is_executable() local
409 elf = elf_begin(fd, ELF_C_READ, NULL); in is_executable()
410 if (elf == NULL) { in is_executable()
414 if (elf_kind(elf) != ELF_K_ELF) { in is_executable()
415 elf_end(elf); in is_executable()
419 if (gelf_getehdr(elf, &ehdr) == NULL) { in is_executable()
421 elf_end(elf); in is_executable()
427 if (gelf_getclass(elf) == ELFCLASS32) { in is_executable()
434 if (gelf_getphdr(elf, i, &phdr) == NULL) { in is_executable()
436 elf_end(elf); in is_executable()
442 freebsd = has_freebsd_abi_tag(fname, elf, &ehdr, in is_executable()
448 pie = is_pie(fname, elf, &ehdr, phdr.p_offset, in is_executable()
455 elf_end(elf); in is_executable()
464 elf_end(elf); in is_executable()
470 elf_end(elf); in is_executable()