Lines Matching refs:elf
266 has_freebsd_abi_tag(const char *fname, Elf *elf, GElf_Ehdr *ehdr, off_t offset, in has_freebsd_abi_tag() argument
277 buf = elf_rawfile(elf, NULL); in has_freebsd_abi_tag()
295 if (gelf_xlatetom(elf, &dst, &src, ehdr->e_ident[EI_DATA]) == NULL) { in has_freebsd_abi_tag()
334 is_pie(const char *fname, Elf *elf, GElf_Ehdr *ehdr, off_t offset, size_t len) in is_pie() argument
344 buf = elf_rawfile(elf, NULL); in is_pie()
350 dynsize = gelf_fsize(elf, ELF_T_DYN, 1, EV_CURRENT); in is_pie()
369 if (gelf_xlatetom(elf, &dst, &src, ehdr->e_ident[EI_DATA]) == NULL) { in is_pie()
392 Elf *elf; in is_executable() local
408 elf = elf_begin(fd, ELF_C_READ, NULL); in is_executable()
409 if (elf == NULL) { in is_executable()
413 if (elf_kind(elf) != ELF_K_ELF) { in is_executable()
414 elf_end(elf); in is_executable()
418 if (gelf_getehdr(elf, &ehdr) == NULL) { in is_executable()
420 elf_end(elf); in is_executable()
426 if (gelf_getclass(elf) == ELFCLASS32) { in is_executable()
433 if (gelf_getphdr(elf, i, &phdr) == NULL) { in is_executable()
435 elf_end(elf); in is_executable()
441 freebsd = has_freebsd_abi_tag(fname, elf, &ehdr, in is_executable()
447 pie = is_pie(fname, elf, &ehdr, phdr.p_offset, in is_executable()
454 elf_end(elf); in is_executable()
463 elf_end(elf); in is_executable()
469 elf_end(elf); in is_executable()