-/* We build a hash table of all symbols defined in an archive. */
-
-/* An archive symbol may be defined by multiple archive elements.
- This linked list is used to hold the elements. */
-
-struct archive_list
-{
- struct archive_list *next;
- unsigned int indx;
-};
-
-/* An entry in an archive hash table. */
-
-struct archive_hash_entry
-{
- struct bfd_hash_entry root;
- /* Where the symbol is defined. */
- struct archive_list *defs;
-};
-
-/* An archive hash table itself. */
-
-struct archive_hash_table
-{
- struct bfd_hash_table table;
-};
-
-/* Create a new entry for an archive hash table. */
-
-static struct bfd_hash_entry *
-archive_hash_newfunc (struct bfd_hash_entry *entry,
- struct bfd_hash_table *table,
- const char *string)
-{
- struct archive_hash_entry *ret = (struct archive_hash_entry *) entry;
-
- /* Allocate the structure if it has not already been allocated by a
- subclass. */
- if (ret == NULL)
- ret = (struct archive_hash_entry *)
- bfd_hash_allocate (table, sizeof (struct archive_hash_entry));
- if (ret == NULL)
- return NULL;
-
- /* Call the allocation method of the superclass. */
- ret = ((struct archive_hash_entry *)
- bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string));
-
- if (ret)
- {
- /* Initialize the local fields. */
- ret->defs = NULL;
- }
-
- return &ret->root;
-}
-
-/* Initialize an archive hash table. */
-
-static bfd_boolean
-archive_hash_table_init
- (struct archive_hash_table *table,
- struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *,
- struct bfd_hash_table *,
- const char *),
- unsigned int entsize)
-{
- return bfd_hash_table_init (&table->table, newfunc, entsize);
-}
-
-/* Look up an entry in an archive hash table. */
-
-#define archive_hash_lookup(t, string, create, copy) \
- ((struct archive_hash_entry *) \
- bfd_hash_lookup (&(t)->table, (string), (create), (copy)))
-
-/* Allocate space in an archive hash table. */
-
-#define archive_hash_allocate(t, size) bfd_hash_allocate (&(t)->table, (size))
-
-/* Free an archive hash table. */
-
-#define archive_hash_table_free(t) bfd_hash_table_free (&(t)->table)
-