Lines Matching full:elf

1 /* Get ELF program header table.
49 __elfw2(LIBELFBITS,getphdr_wrlock) (elf)
50 Elf *elf;
57 result = elf->state.ELFW(elf,LIBELFBITS).phdr;
61 if (elf->class == 0)
62 elf->class = ELFW(ELFCLASS,LIBELFBITS);
63 else if (elf->class != ELFW(ELFCLASS,LIBELFBITS))
73 ElfW2(LIBELFBITS,Ehdr) *ehdr = elf->state.ELFW(elf,LIBELFBITS).ehdr;
77 if (__elf_getphdrnum_rdlock (elf, &phnum) != 0)
89 || ehdr->e_phoff > elf->maximum_size
90 || elf->maximum_size - ehdr->e_phoff < size)
96 if (elf->map_address != NULL)
98 /* First see whether the information in the ELF header is
100 if (unlikely (ehdr->e_phoff >= elf->maximum_size)
101 || unlikely (elf->maximum_size - ehdr->e_phoff < size))
109 void *file_phdr = ((char *) elf->map_address
110 + elf->start_offset + ehdr->e_phoff);
116 elf->state.ELFW(elf,LIBELFBITS).phdr = file_phdr;
123 of entries from the ELF header. */
124 phdr = elf->state.ELFW(elf,LIBELFBITS).phdr =
126 if (elf->state.ELFW(elf,LIBELFBITS).phdr == NULL)
131 elf->state.ELFW(elf,LIBELFBITS).phdr_flags |=
168 else if (likely (elf->fildes != -1))
171 of entries from the ELF header. */
172 elf->state.ELFW(elf,LIBELFBITS).phdr =
174 if (elf->state.ELFW(elf,LIBELFBITS).phdr == NULL)
179 elf->state.ELFW(elf,LIBELFBITS).phdr_flags |= ELF_F_MALLOCED;
182 ssize_t n = pread_retry (elf->fildes,
183 elf->state.ELFW(elf,LIBELFBITS).phdr, size,
184 elf->start_offset + ehdr->e_phoff);
189 free (elf->state.ELFW(elf,LIBELFBITS).phdr);
190 elf->state.ELFW(elf,LIBELFBITS).phdr = NULL;
199 = elf->state.ELFW(elf,LIBELFBITS).phdr;
222 result = elf->state.ELFW(elf,LIBELFBITS).phdr;
230 elfw2(LIBELFBITS,getphdr) (elf)
231 Elf *elf;
235 if (elf == NULL)
238 if (unlikely (elf->kind != ELF_K_ELF))
247 result = elf->state.ELFW(elf,LIBELFBITS).phdr;
251 rwlock_wrlock (elf->lock);
252 result = __elfw2(LIBELFBITS,getphdr_wrlock) (elf);
253 rwlock_unlock (elf->lock);