Home | History | Annotate | Download | only in libelf

Lines Matching refs:Ehdr

51 ELFW(default_ehdr,LIBELFBITS) (Elf *elf, ElfW2(LIBELFBITS,Ehdr) *ehdr,
55 if (memcmp (&ehdr->e_ident[EI_MAG0], ELFMAG, SELFMAG) != 0)
57 memcpy (&ehdr->e_ident[EI_MAG0], ELFMAG, SELFMAG);
62 update_if_changed (ehdr->e_ident[EI_CLASS], ELFW(ELFCLASS,LIBELFBITS),
66 if (unlikely (ehdr->e_ident[EI_DATA] == ELFDATANONE))
68 ehdr->e_ident[EI_DATA] =
72 else if (unlikely (ehdr->e_ident[EI_DATA] >= ELFDATANUM))
79 && ehdr->e_ident[EI_DATA] != ELFDATA2LSB)
81 && ehdr->e_ident[EI_DATA] != ELFDATA2MSB));
84 update_if_changed (ehdr->e_ident[EI_VERSION], EV_CURRENT,
87 if (unlikely (ehdr->e_version == EV_NONE))
89 ehdr->e_version = EV_CURRENT;
92 else if (unlikely (ehdr->e_version >= EV_NUM))
100 update_if_changed (ehdr->e_shnum, 0,
104 update_if_changed (ehdr->e_shnum, shnum,
107 if (unlikely (ehdr->e_ehsize != elf_typesize (LIBELFBITS, ELF_T_EHDR, 1)))
109 ehdr->e_ehsize = elf_typesize (LIBELFBITS, ELF_T_EHDR, 1);
115 if (ehdr->e_phnum == 0 && ehdr->e_phoff != 0)
117 ehdr->e_phoff = 0;
129 ElfW2(LIBELFBITS,Ehdr) *ehdr;
133 ehdr = __elfw2(LIBELFBITS,getehdr_wrlock) (elf);
136 if (ELFW(default_ehdr,LIBELFBITS) (elf, ehdr, shnum, change_bop) != 0)
144 && (ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN
145 || ehdr->e_type == ET_CORE))
151 if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN
152 && unlikely (ehdr->e_type != ET_CORE))
167 ehdr->e_phoff
172 update_if_changed (ehdr->e_phoff,
234 if (ehdr->e_type != ET_REL)
244 sh_entsize = SH_ENTSIZE_HASH (ehdr);
416 update_if_changed (ehdr->e_shentsize,
424 (ehdr->e_shoff
437 update_if_changed (ehdr->e_shoff, (GElf_Word) size, elf->flags);