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]));
246 #define NEXT_NOTE(elfhdr, descsz, namesz, offset) do { \
247 if (elfhdr->e_ident[EI_CLASS] == ELFCLASS32) { \
262 handle_core_note(Elf *elf, GElf_Ehdr *elfhdr, GElf_Phdr *phdr,
274 if (elf == NULL || elfhdr == NULL || phdr == NULL)
288 if (!xlatetom(elf, elfhdr, &nhdr->n_type, &nhdr_l.n_type,
290 !xlatetom(elf, elfhdr, &nhdr->n_descsz, &nhdr_l.n_descsz,
292 !xlatetom(elf, elfhdr, &nhdr->n_namesz, &nhdr_l.n_namesz,
307 if (elfhdr->e_ident[EI_OSABI] == ELFOSABI_FREEBSD &&
310 if (elfhdr->e_ident[EI_CLASS] == ELFCLASS32) {
330 xlatetom(elf, elfhdr, &raw_size, &raw_size,
332 xlatetom(elf, elfhdr, &pid, &pid, ELF_T_WORD,
439 NEXT_NOTE(elfhdr, nhdr_l.n_descsz, nhdr_l.n_namesz, offset);
450 handle_phdr(Elf *elf, GElf_Ehdr *elfhdr, GElf_Phdr *phdr,
457 if (elf == NULL || elfhdr == NULL || phdr == NULL)
501 handle_core(char const *name, Elf *elf, GElf_Ehdr *elfhdr)
508 if (name == NULL || elf == NULL || elfhdr == NULL)
510 if (elfhdr->e_shnum != 0 || elfhdr->e_type != ET_CORE)
519 for (i = 0; i < elfhdr->e_phnum; i++) {
522 handle_phdr(elf, elfhdr, &phdr, i, "note");
523 handle_core_note(elf, elfhdr, &phdr,
554 handle_phdr(elf, elfhdr, &phdr, i, seg_name);
587 GElf_Ehdr elfhdr;
612 (gelf_getehdr(elf, &elfhdr) == NULL)) {
620 if (elfhdr.e_shnum == 0 && elfhdr.e_type == ET_CORE) {
621 exit_code = handle_core(name, elf, &elfhdr);
639 sysv_calc(elf, &elfhdr, &shdr);
681 sysv_calc(Elf *elf, GElf_Ehdr *elfhdr, GElf_Shdr *shdr)
685 section_name = elf_strptr(elf, elfhdr->e_shstrndx,