Lines Matching defs:elfhdr

215 xlatetom(Elf *elf, GElf_Ehdr *elfhdr, void *_src, void *_dst,
222 src.d_version = elfhdr->e_version;
225 dst.d_version = elfhdr->e_version;
227 return (gelf_xlatetom(elf, &dst, &src, elfhdr->e_ident[EI_DATA]) !=
247 #define NEXT_NOTE(elfhdr, descsz, namesz, offset) do { \
248 if (elfhdr->e_ident[EI_CLASS] == ELFCLASS32) { \
263 handle_core_note(Elf *elf, GElf_Ehdr *elfhdr, GElf_Phdr *phdr,
275 if (elf == NULL || elfhdr == NULL || phdr == NULL)
289 if (xlatetom(elf, elfhdr, &nhdr->n_type, &nhdr_l.n_type,
291 xlatetom(elf, elfhdr, &nhdr->n_descsz, &nhdr_l.n_descsz,
293 xlatetom(elf, elfhdr, &nhdr->n_namesz, &nhdr_l.n_namesz,
308 if (elfhdr->e_ident[EI_OSABI] == ELFOSABI_FREEBSD &&
311 if (elfhdr->e_ident[EI_CLASS] == ELFCLASS32) {
331 (void)xlatetom(elf, elfhdr, &raw_size,
333 (void)xlatetom(elf, elfhdr, &pid, &pid,
440 NEXT_NOTE(elfhdr, nhdr_l.n_descsz, nhdr_l.n_namesz, offset);
451 handle_phdr(Elf *elf, GElf_Ehdr *elfhdr, GElf_Phdr *phdr,
458 if (elf == NULL || elfhdr == NULL || phdr == NULL)
502 handle_core(char const *name, Elf *elf, GElf_Ehdr *elfhdr)
509 if (name == NULL || elf == NULL || elfhdr == NULL)
511 if (elfhdr->e_shnum != 0 || elfhdr->e_type != ET_CORE)
520 for (i = 0; i < elfhdr->e_phnum; i++) {
523 handle_phdr(elf, elfhdr, &phdr, i, "note");
524 handle_core_note(elf, elfhdr, &phdr,
555 handle_phdr(elf, elfhdr, &phdr, i, seg_name);
588 GElf_Ehdr elfhdr;
613 (gelf_getehdr(elf, &elfhdr) == NULL)) {
621 if (elfhdr.e_shnum == 0 && elfhdr.e_type == ET_CORE) {
622 exit_code = handle_core(name, elf, &elfhdr);
640 sysv_calc(elf, &elfhdr, &shdr);
682 sysv_calc(Elf *elf, GElf_Ehdr *elfhdr, GElf_Shdr *shdr)
686 section_name = elf_strptr(elf, elfhdr->e_shstrndx,