Lines Matching refs:hdr
62 Elf_Ehdr *hdr = NULL;
123 hdr = malloc(sizeof(*hdr), M_LINKER, M_WAITOK);
126 if ((error = vn_rdwr(UIO_READ, nd.ni_vp, hdr, sizeof(*hdr),
132 if (!IS_ELF(*hdr)) {
137 nbytes = hdr->e_shnum * hdr->e_shentsize;
138 if (nbytes == 0 || hdr->e_shoff == 0 ||
139 hdr->e_shentsize != sizeof(Elf_Shdr)) {
149 hdr->e_shoff, UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED,
158 if (hdr->e_shstrndx == 0 || shdr[hdr->e_shstrndx].sh_type != SHT_STRTAB) {
160 __func__, __LINE__, lf->pathname, hdr->e_shstrndx,
161 shdr[hdr->e_shstrndx].sh_type);
167 shstrtab = malloc(shdr[hdr->e_shstrndx].sh_size, M_LINKER, M_WAITOK);
171 shdr[hdr->e_shstrndx].sh_size, shdr[hdr->e_shstrndx].sh_offset,
176 for (i = 0; i < hdr->e_shnum; i++)
181 if (i >= hdr->e_shnum) {
309 if (hdr != NULL)
310 free(hdr, M_LINKER);