Lines Matching refs:elf
43 elf_end (Elf *elf) in elf_end() argument
47 if (elf == NULL) in elf_end()
52 rwlock_wrlock (elf->lock); in elf_end()
54 if (elf->ref_count != 0 && --elf->ref_count != 0) in elf_end()
57 int result = elf->ref_count; in elf_end()
58 rwlock_unlock (elf->lock); in elf_end()
62 if (elf->kind == ELF_K_AR) in elf_end()
70 if (elf->state.ar.ar_sym != (Elf_Arsym *) -1l) in elf_end()
71 free (elf->state.ar.ar_sym); in elf_end()
72 elf->state.ar.ar_sym = NULL; in elf_end()
74 if (elf->state.ar.children != NULL) in elf_end()
79 parent = elf->parent; in elf_end()
87 rwlock_unlock (elf->lock); in elf_end()
89 rwlock_wrlock (elf->lock); in elf_end()
91 if (parent->state.ar.children == elf) in elf_end()
92 parent->state.ar.children = elf->next; in elf_end()
97 while (child->next != elf) in elf_end()
100 child->next = elf->next; in elf_end()
107 switch (elf->kind) in elf_end()
110 if (elf->state.ar.long_names != NULL) in elf_end()
111 free (elf->state.ar.long_names); in elf_end()
117 = (elf->class == ELFCLASS32 in elf_end()
120 ? elf->state.elf32.rawchunks in elf_end()
121 : elf->state.elf64.rawchunks); in elf_end()
131 Elf_ScnList *list = (elf->class == ELFCLASS32 in elf_end()
134 ? &elf->state.elf32.scns in elf_end()
135 : &elf->state.elf64.scns); in elf_end()
168 if (elf->map_address == NULL in elf_end()
190 if (oldp != (elf->class == ELFCLASS32 in elf_end()
193 ? &elf->state.elf32.scns in elf_end()
194 : &elf->state.elf64.scns)) in elf_end()
201 if (elf->state.elf.shdr_malloced != 0) in elf_end()
202 free (elf->class == ELFCLASS32 in elf_end()
205 ? (void *) elf->state.elf32.shdr in elf_end()
206 : (void *) elf->state.elf64.shdr); in elf_end()
209 if ((elf->state.elf.phdr_flags & ELF_F_MALLOCED) != 0) in elf_end()
210 free (elf->class == ELFCLASS32 in elf_end()
213 ? (void *) elf->state.elf32.phdr in elf_end()
214 : (void *) elf->state.elf64.phdr); in elf_end()
221 if (elf->map_address != NULL && parent == NULL) in elf_end()
224 if ((elf->flags & ELF_F_MALLOCED) != 0) in elf_end()
225 free (elf->map_address); in elf_end()
226 else if ((elf->flags & ELF_F_MMAPPED) != 0) in elf_end()
227 munmap (elf->map_address, elf->maximum_size); in elf_end()
230 rwlock_unlock (elf->lock); in elf_end()
231 rwlock_fini (elf->lock); in elf_end()
234 free (elf); in elf_end()