Lines Matching refs:elf
47 __elfw2(LIBELFBITS,getphdr_wrlock) (Elf *elf)
54 result = elf->state.ELFW(elf,LIBELFBITS).phdr;
58 if (elf->class == 0)
59 elf->class = ELFW(ELFCLASS,LIBELFBITS);
60 else if (elf->class != ELFW(ELFCLASS,LIBELFBITS))
70 ElfW2(LIBELFBITS,Ehdr) *ehdr = elf->state.ELFW(elf,LIBELFBITS).ehdr;
74 if (__elf_getphdrnum_rdlock (elf, &phnum) != 0)
86 || ehdr->e_phoff > elf->maximum_size
87 || elf->maximum_size - ehdr->e_phoff < size)
93 if (elf->map_address != NULL)
97 if (unlikely (ehdr->e_phoff >= elf->maximum_size)
98 || unlikely (elf->maximum_size - ehdr->e_phoff < size))
106 void *file_phdr = ((char *) elf->map_address
107 + elf->start_offset + ehdr->e_phoff);
113 elf->state.ELFW(elf,LIBELFBITS).phdr = file_phdr;
121 phdr = elf->state.ELFW(elf,LIBELFBITS).phdr =
123 if (elf->state.ELFW(elf,LIBELFBITS).phdr == NULL)
128 elf->state.ELFW(elf,LIBELFBITS).phdr_flags |=
175 else if (likely (elf->fildes != -1))
179 elf->state.ELFW(elf,LIBELFBITS).phdr =
181 if (elf->state.ELFW(elf,LIBELFBITS).phdr == NULL)
186 elf->state.ELFW(elf,LIBELFBITS).phdr_flags |= ELF_F_MALLOCED;
189 ssize_t n = pread_retry (elf->fildes,
190 elf->state.ELFW(elf,LIBELFBITS).phdr, size,
191 elf->start_offset + ehdr->e_phoff);
196 free (elf->state.ELFW(elf,LIBELFBITS).phdr);
197 elf->state.ELFW(elf,LIBELFBITS).phdr = NULL;
206 = elf->state.ELFW(elf,LIBELFBITS).phdr;
229 result = elf->state.ELFW(elf,LIBELFBITS).phdr;
237 elfw2(LIBELFBITS,getphdr) (Elf *elf)
241 if (elf == NULL)
244 if (unlikely (elf->kind != ELF_K_ELF))
253 result = elf->state.ELFW(elf,LIBELFBITS).phdr;
257 rwlock_wrlock (elf->lock);
258 result = __elfw2(LIBELFBITS,getphdr_wrlock) (elf);
259 rwlock_unlock (elf->lock);