Lines Matching refs:tab
131 _bfd_elf_strtab_free (struct elf_strtab_hash *tab)
133 bfd_hash_table_free (&tab->table);
134 free (tab->array);
135 free (tab);
142 _bfd_elf_strtab_add (struct elf_strtab_hash *tab,
153 BFD_ASSERT (tab->sec_size == 0);
155 bfd_hash_lookup (&tab->table, str, TRUE, copy);
166 if (tab->size == tab->alloced)
169 tab->alloced *= 2;
170 tab->array = (struct elf_strtab_hash_entry **)
171 bfd_realloc_or_free (tab->array, tab->alloced * amt);
172 if (tab->array == NULL)
176 entry->u.index = tab->size++;
177 tab->array[entry->u.index] = entry;
183 _bfd_elf_strtab_addref (struct elf_strtab_hash *tab, bfd_size_type idx)
187 BFD_ASSERT (tab->sec_size == 0);
188 BFD_ASSERT (idx < tab->size);
189 ++tab->array[idx]->refcount;
193 _bfd_elf_strtab_delref (struct elf_strtab_hash *tab, bfd_size_type idx)
197 BFD_ASSERT (tab->sec_size == 0);
198 BFD_ASSERT (idx < tab->size);
199 BFD_ASSERT (tab->array[idx]->refcount > 0);
200 --tab->array[idx]->refcount;
204 _bfd_elf_strtab_refcount (struct elf_strtab_hash *tab, bfd_size_type idx)
206 return tab->array[idx]->refcount;
210 _bfd_elf_strtab_clear_all_refs (struct elf_strtab_hash *tab)
214 for (idx = 1; idx < tab->size; idx++)
215 tab->array[idx]->refcount = 0;
221 _bfd_elf_strtab_restore_size (struct elf_strtab_hash *tab, bfd_size_type idx)
223 bfd_size_type curr_size = tab->size;
225 BFD_ASSERT (tab->sec_size == 0);
227 tab->size = idx;
233 tab->array[idx]->refcount = 0;
234 tab->array[idx]->len = 0;
239 _bfd_elf_strtab_size (struct elf_strtab_hash *tab)
241 return tab->sec_size ? tab->sec_size : tab->size;
245 _bfd_elf_strtab_offset (struct elf_strtab_hash *tab, bfd_size_type idx)
251 BFD_ASSERT (idx < tab->size);
252 BFD_ASSERT (tab->sec_size);
253 entry = tab->array[idx];
256 return tab->array[idx]->u.index;
260 _bfd_elf_strtab_emit (register bfd *abfd, struct elf_strtab_hash *tab)
267 for (i = 1; i < tab->size; ++i)
272 BFD_ASSERT (tab->array[i]->refcount == 0);
273 len = tab->array[i]->len;
277 str = tab->array[i]->root.string;
284 BFD_ASSERT (off == tab->sec_size);
329 _bfd_elf_strtab_finalize (struct elf_strtab_hash *tab)
341 amt = tab->size * sizeof (struct elf_strtab_hash_entry *);
346 for (i = 1, a = array; i < tab->size; ++i)
348 e = tab->array[i];
401 for (i = 1; i < tab->size; ++i)
403 e = tab->array[i];
411 tab->sec_size = size;
414 for (i = 1; i < tab->size; ++i)
416 e = tab->array[i];