Lines Matching refs:elf

42 elf_end (Elf *elf)
46 if (elf == NULL)
51 rwlock_wrlock (elf->lock);
53 if (elf->ref_count != 0 && --elf->ref_count != 0)
56 int result = elf->ref_count;
57 rwlock_unlock (elf->lock);
61 if (elf->kind == ELF_K_AR)
69 if (elf->state.ar.ar_sym != (Elf_Arsym *) -1l)
70 free (elf->state.ar.ar_sym);
71 elf->state.ar.ar_sym = NULL;
73 if (elf->state.ar.children != NULL)
78 parent = elf->parent;
86 rwlock_unlock (elf->lock);
88 rwlock_wrlock (elf->lock);
90 if (parent->state.ar.children == elf)
91 parent->state.ar.children = elf->next;
96 while (child->next != elf)
99 child->next = elf->next;
106 switch (elf->kind)
109 if (elf->state.ar.long_names != NULL)
110 free (elf->state.ar.long_names);
116 = (elf->class == ELFCLASS32
119 ? elf->state.elf32.rawchunks
120 : elf->state.elf64.rawchunks);
130 Elf_ScnList *list = (elf->class == ELFCLASS32
133 ? &elf->state.elf32.scns
134 : &elf->state.elf64.scns);
167 if (elf->map_address == NULL
189 if (oldp != (elf->class == ELFCLASS32
192 ? &elf->state.elf32.scns
193 : &elf->state.elf64.scns))
200 if (elf->state.elf.shdr_malloced != 0)
201 free (elf->class == ELFCLASS32
204 ? (void *) elf->state.elf32.shdr
205 : (void *) elf->state.elf64.shdr);
208 if ((elf->state.elf.phdr_flags & ELF_F_MALLOCED) != 0)
209 free (elf->class == ELFCLASS32
212 ? (void *) elf->state.elf32.phdr
213 : (void *) elf->state.elf64.phdr);
220 if (elf->map_address != NULL && parent == NULL)
223 if ((elf->flags & ELF_F_MALLOCED) != 0)
224 free (elf->map_address);
225 else if ((elf->flags & ELF_F_MMAPPED) != 0)
226 munmap (elf->map_address, elf->maximum_size);
229 rwlock_unlock (elf->lock);
230 rwlock_fini (elf->lock);
233 free (elf);