Lines Matching refs:elfhdr

244 xlatetom(Elf *elf, GElf_Ehdr *elfhdr, void *_src, void *_dst,  in xlatetom()  argument
251 src.d_version = elfhdr->e_version; in xlatetom()
254 dst.d_version = elfhdr->e_version; in xlatetom()
256 return (gelf_xlatetom(elf, &dst, &src, elfhdr->e_ident[EI_DATA]) != in xlatetom()
276 #define NEXT_NOTE(elfhdr, descsz, namesz, offset) do { \ argument
277 if (elfhdr->e_ident[EI_CLASS] == ELFCLASS32) { \
292 handle_core_note(Elf *elf, GElf_Ehdr *elfhdr, GElf_Phdr *phdr, in handle_core_note() argument
304 if (elf == NULL || elfhdr == NULL || phdr == NULL) in handle_core_note()
318 if (xlatetom(elf, elfhdr, &nhdr->n_type, &nhdr_l.n_type, in handle_core_note()
320 xlatetom(elf, elfhdr, &nhdr->n_descsz, &nhdr_l.n_descsz, in handle_core_note()
322 xlatetom(elf, elfhdr, &nhdr->n_namesz, &nhdr_l.n_namesz, in handle_core_note()
337 if (elfhdr->e_ident[EI_OSABI] == ELFOSABI_FREEBSD && in handle_core_note()
340 if (elfhdr->e_ident[EI_CLASS] == ELFCLASS32) { in handle_core_note()
360 (void)xlatetom(elf, elfhdr, &raw_size, in handle_core_note()
362 (void)xlatetom(elf, elfhdr, &pid, &pid, in handle_core_note()
469 NEXT_NOTE(elfhdr, nhdr_l.n_descsz, nhdr_l.n_namesz, offset); in handle_core_note()
480 handle_phdr(Elf *elf, GElf_Ehdr *elfhdr, GElf_Phdr *phdr, in handle_phdr() argument
487 if (elf == NULL || elfhdr == NULL || phdr == NULL) in handle_phdr()
531 handle_core(char const *name, Elf *elf, GElf_Ehdr *elfhdr) in handle_core() argument
538 if (name == NULL || elf == NULL || elfhdr == NULL) in handle_core()
540 if (elfhdr->e_shnum != 0 || elfhdr->e_type != ET_CORE) in handle_core()
549 for (i = 0; i < elfhdr->e_phnum; i++) { in handle_core()
552 handle_phdr(elf, elfhdr, &phdr, i, "note"); in handle_core()
553 handle_core_note(elf, elfhdr, &phdr, in handle_core()
584 handle_phdr(elf, elfhdr, &phdr, i, seg_name); in handle_core()
617 GElf_Ehdr elfhdr; in handle_elf() local
636 (gelf_getehdr(elf, &elfhdr) == NULL)) { in handle_elf()
644 if (elfhdr.e_shnum == 0 && elfhdr.e_type == ET_CORE) { in handle_elf()
645 exit_code = handle_core(name, elf, &elfhdr); in handle_elf()
663 sysv_calc(elf, &elfhdr, &shdr); in handle_elf()
705 sysv_calc(Elf *elf, GElf_Ehdr *elfhdr, GElf_Shdr *shdr) in sysv_calc() argument
709 section_name = elf_strptr(elf, elfhdr->e_shstrndx, in sysv_calc()