• Home
  • Raw
  • Download

Lines Matching refs:elf

64 elf_end (elf)  in elf_end()  argument
65 Elf *elf; in elf_end()
69 if (elf == NULL)
74 rwlock_wrlock (elf->lock);
76 if (elf->ref_count != 0 && --elf->ref_count != 0)
79 int result = elf->ref_count;
80 rwlock_unlock (elf->lock);
84 if (elf->kind == ELF_K_AR)
92 if (elf->state.ar.ar_sym != (Elf_Arsym *) -1l)
93 free (elf->state.ar.ar_sym);
94 elf->state.ar.ar_sym = NULL;
96 if (elf->state.ar.children != NULL)
101 parent = elf->parent;
109 rwlock_unlock (elf->lock);
111 rwlock_wrlock (elf->lock);
113 if (parent->state.ar.children == elf)
114 parent->state.ar.children = elf->next;
119 while (child->next != elf)
122 child->next = elf->next;
129 switch (elf->kind)
132 if (elf->state.ar.long_names != NULL)
133 free (elf->state.ar.long_names);
139 = (elf->class == ELFCLASS32
142 ? elf->state.elf32.rawchunks
143 : elf->state.elf64.rawchunks);
153 Elf_ScnList *list = (elf->class == ELFCLASS32
156 ? &elf->state.elf32.scns
157 : &elf->state.elf64.scns);
184 if (elf->map_address == NULL)
204 if (oldp != (elf->class == ELFCLASS32
207 ? &elf->state.elf32.scns
208 : &elf->state.elf64.scns))
215 if (elf->state.elf.shdr_malloced != 0)
216 free (elf->class == ELFCLASS32
219 ? (void *) elf->state.elf32.shdr
220 : (void *) elf->state.elf64.shdr);
223 if ((elf->state.elf.phdr_flags & ELF_F_MALLOCED) != 0)
224 free (elf->class == ELFCLASS32
227 ? (void *) elf->state.elf32.phdr
228 : (void *) elf->state.elf64.phdr);
235 if (elf->map_address != NULL && parent == NULL)
238 if ((elf->flags & ELF_F_MALLOCED) != 0)
239 free (elf->map_address);
240 else if ((elf->flags & ELF_F_MMAPPED) != 0)
241 munmap (elf->map_address, elf->maximum_size);
244 rwlock_fini (elf->lock);
247 free (elf);