Lines Matching refs:Ehdr
72 ELFW(default_ehdr,LIBELFBITS) (Elf *elf, ElfW2(LIBELFBITS,Ehdr) *ehdr,
76 if (memcmp (&ehdr->e_ident[EI_MAG0], ELFMAG, SELFMAG) != 0)
78 memcpy (&ehdr->e_ident[EI_MAG0], ELFMAG, SELFMAG);
83 update_if_changed (ehdr->e_ident[EI_CLASS], ELFW(ELFCLASS,LIBELFBITS),
87 if (unlikely (ehdr->e_ident[EI_DATA] == ELFDATANONE))
89 ehdr->e_ident[EI_DATA] =
93 else if (unlikely (ehdr->e_ident[EI_DATA] >= ELFDATANUM))
100 && ehdr->e_ident[EI_DATA] != ELFDATA2LSB)
102 && ehdr->e_ident[EI_DATA] != ELFDATA2MSB));
105 update_if_changed (ehdr->e_ident[EI_VERSION], EV_CURRENT,
108 if (unlikely (ehdr->e_version == EV_NONE)
109 || unlikely (ehdr->e_version >= EV_NUM))
117 update_if_changed (ehdr->e_shnum, 0,
121 update_if_changed (ehdr->e_shnum, shnum,
124 if (unlikely (ehdr->e_ehsize != elf_typesize (LIBELFBITS, ELF_T_EHDR, 1)))
126 ehdr->e_ehsize = elf_typesize (LIBELFBITS, ELF_T_EHDR, 1);
138 ElfW2(LIBELFBITS,Ehdr) *ehdr;
142 ehdr = __elfw2(LIBELFBITS,getehdr_wrlock) (elf);
145 if (ELFW(default_ehdr,LIBELFBITS) (elf, ehdr, shnum, change_bop) != 0)
153 && (ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN
154 || ehdr->e_type == ET_CORE))
160 if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN
161 && unlikely (ehdr->e_type != ET_CORE))
172 ehdr->e_phoff
173 + elf_typesize (LIBELFBITS, ELF_T_PHDR, ehdr->e_phnum));
177 update_if_changed (ehdr->e_phoff,
182 size += elf_typesize (LIBELFBITS, ELF_T_PHDR, ehdr->e_phnum);
234 if (ehdr->e_type != ET_REL)
244 sh_entsize = SH_ENTSIZE_HASH (ehdr);
407 (ehdr->e_shoff
420 update_if_changed (ehdr->e_shoff, (GElf_Word) size, elf->flags);
421 update_if_changed (ehdr->e_shentsize,