Lines Matching refs:tab
127 _bfd_elf_strtab_free (struct elf_strtab_hash *tab) in _bfd_elf_strtab_free() argument
129 bfd_hash_table_free (&tab->table); in _bfd_elf_strtab_free()
130 free (tab->array); in _bfd_elf_strtab_free()
131 free (tab); in _bfd_elf_strtab_free()
138 _bfd_elf_strtab_add (struct elf_strtab_hash *tab, in _bfd_elf_strtab_add() argument
149 BFD_ASSERT (tab->sec_size == 0); in _bfd_elf_strtab_add()
151 bfd_hash_lookup (&tab->table, str, TRUE, copy); in _bfd_elf_strtab_add()
162 if (tab->size == tab->alloced) in _bfd_elf_strtab_add()
165 tab->alloced *= 2; in _bfd_elf_strtab_add()
166 tab->array = bfd_realloc (tab->array, tab->alloced * amt); in _bfd_elf_strtab_add()
167 if (tab->array == NULL) in _bfd_elf_strtab_add()
171 entry->u.index = tab->size++; in _bfd_elf_strtab_add()
172 tab->array[entry->u.index] = entry; in _bfd_elf_strtab_add()
178 _bfd_elf_strtab_addref (struct elf_strtab_hash *tab, bfd_size_type idx) in _bfd_elf_strtab_addref() argument
182 BFD_ASSERT (tab->sec_size == 0); in _bfd_elf_strtab_addref()
183 BFD_ASSERT (idx < tab->size); in _bfd_elf_strtab_addref()
184 ++tab->array[idx]->refcount; in _bfd_elf_strtab_addref()
188 _bfd_elf_strtab_delref (struct elf_strtab_hash *tab, bfd_size_type idx) in _bfd_elf_strtab_delref() argument
192 BFD_ASSERT (tab->sec_size == 0); in _bfd_elf_strtab_delref()
193 BFD_ASSERT (idx < tab->size); in _bfd_elf_strtab_delref()
194 BFD_ASSERT (tab->array[idx]->refcount > 0); in _bfd_elf_strtab_delref()
195 --tab->array[idx]->refcount; in _bfd_elf_strtab_delref()
199 _bfd_elf_strtab_clear_all_refs (struct elf_strtab_hash *tab) in _bfd_elf_strtab_clear_all_refs() argument
203 for (idx = 1; idx < tab->size; ++idx) in _bfd_elf_strtab_clear_all_refs()
204 tab->array[idx]->refcount = 0; in _bfd_elf_strtab_clear_all_refs()
208 _bfd_elf_strtab_size (struct elf_strtab_hash *tab) in _bfd_elf_strtab_size() argument
210 return tab->sec_size ? tab->sec_size : tab->size; in _bfd_elf_strtab_size()
214 _bfd_elf_strtab_offset (struct elf_strtab_hash *tab, bfd_size_type idx) in _bfd_elf_strtab_offset() argument
220 BFD_ASSERT (idx < tab->size); in _bfd_elf_strtab_offset()
221 BFD_ASSERT (tab->sec_size); in _bfd_elf_strtab_offset()
222 entry = tab->array[idx]; in _bfd_elf_strtab_offset()
225 return tab->array[idx]->u.index; in _bfd_elf_strtab_offset()
229 _bfd_elf_strtab_emit (register bfd *abfd, struct elf_strtab_hash *tab) in _bfd_elf_strtab_emit() argument
236 for (i = 1; i < tab->size; ++i) in _bfd_elf_strtab_emit()
241 BFD_ASSERT (tab->array[i]->refcount == 0); in _bfd_elf_strtab_emit()
242 len = tab->array[i]->len; in _bfd_elf_strtab_emit()
246 str = tab->array[i]->root.string; in _bfd_elf_strtab_emit()
253 BFD_ASSERT (off == tab->sec_size); in _bfd_elf_strtab_emit()
298 _bfd_elf_strtab_finalize (struct elf_strtab_hash *tab) in _bfd_elf_strtab_finalize() argument
310 amt = tab->size * sizeof (struct elf_strtab_hash_entry *); in _bfd_elf_strtab_finalize()
315 for (i = 1, a = array; i < tab->size; ++i) in _bfd_elf_strtab_finalize()
317 e = tab->array[i]; in _bfd_elf_strtab_finalize()
370 for (i = 1; i < tab->size; ++i) in _bfd_elf_strtab_finalize()
372 e = tab->array[i]; in _bfd_elf_strtab_finalize()
380 tab->sec_size = size; in _bfd_elf_strtab_finalize()
383 for (i = 1; i < tab->size; ++i) in _bfd_elf_strtab_finalize()
385 e = tab->array[i]; in _bfd_elf_strtab_finalize()