Lines Matching defs:hdr
55 Elf_Ehdr hdr;
89 Elf_Ehdr *hdr;
104 hdr = &ef.hdr;
105 bytes_read = read(ef.fd, hdr, sizeof(*hdr));
106 if (bytes_read != sizeof(*hdr)) {
112 if (!IS_ELF(*hdr)) {
116 if (hdr->e_ident[EI_CLASS] != ELF_TARG_CLASS || /* Layout ? */
117 hdr->e_ident[EI_DATA] != ELF_TARG_DATA ||
118 hdr->e_ident[EI_VERSION] != EV_CURRENT || /* Version ? */
119 hdr->e_version != EV_CURRENT ||
120 hdr->e_machine != ELF_TARG_MACH || /* Machine ? */
121 hdr->e_type != ET_REL) {
126 if (hdr->e_shnum * hdr->e_shentsize == 0 || hdr->e_shoff == 0 ||
127 hdr->e_shentsize != sizeof(Elf_Shdr)) {
141 dest = archsw.arch_loadaddr(LOAD_ELF, hdr, dest);
165 file_addmetadata(fp, MODINFOMD_ELFHDR, sizeof(*hdr), hdr);
191 Elf_Ehdr *hdr;
198 hdr = &ef->hdr;
202 shdrbytes = hdr->e_shnum * hdr->e_shentsize;
203 shdr = alloc_pread(ef->fd, (off_t)hdr->e_shoff, shdrbytes);
216 for (i = 0; i < hdr->e_shnum; i++)
218 for (i = 0; i < hdr->e_shnum; i++) {
238 for (i = 0; i < hdr->e_shnum; i++) {
258 if (symstrindex < 0 || symstrindex >= hdr->e_shnum ||
269 if (hdr->e_shstrndx == 0 || hdr->e_shstrndx >= hdr->e_shnum ||
270 shdr[hdr->e_shstrndx].sh_type != SHT_STRTAB) {
275 ef->shstrindex = hdr->e_shstrndx;
281 for (i = 0; i < hdr->e_shnum; i++) {
307 for (i = 0; i < hdr->e_shnum; i++) {
433 Elf_Ehdr *hdr;
439 hdr = &ef->hdr;
443 for (i = 0; i < hdr->e_shnum; i++) {
471 Elf_Ehdr *hdr;
479 hdr = &ef->hdr;
482 for (i = 0; i < hdr->e_shnum; i++) {
535 if (sym.st_shndx == SHN_UNDEF || sym.st_shndx >= ef->hdr.e_shnum)