/* A function to return the linker hash table entry of a symbol that
might be satisfied by an archive symbol. */
- struct elf_link_hash_entry * (*elf_backend_archive_symbol_lookup)
+ struct bfd_link_hash_entry * (*elf_backend_archive_symbol_lookup)
(bfd *, struct bfd_link_info *, const char *);
/* Return true if local section symbols should have a non-null st_name.
extern bool _bfd_elf_notice_as_needed
(bfd *, struct bfd_link_info *, enum notice_asneeded_action);
-extern struct elf_link_hash_entry *_bfd_elf_archive_symbol_lookup
+extern struct bfd_link_hash_entry *_bfd_elf_archive_symbol_lookup
(bfd *, struct bfd_link_info *, const char *);
extern bool bfd_elf_link_add_symbols
(bfd *, struct bfd_link_info *);
NAME is a symbol defined in an archive. Return a symbol in the hash
table that might be satisfied by the archive symbols. */
-static struct elf_link_hash_entry *
+static struct bfd_link_hash_entry *
ppc64_elf_archive_symbol_lookup (bfd *abfd,
struct bfd_link_info *info,
const char *name)
{
- struct elf_link_hash_entry *h;
+ struct bfd_link_hash_entry *h;
char *dot_name;
size_t len;
h = _bfd_elf_archive_symbol_lookup (abfd, info, name);
if (h != NULL
+ && ppc_hash_table (info) != NULL
/* Don't return this sym if it is a fake function descriptor
created by add_symbol_adjust. */
- && !ppc_elf_hash_entry (h)->fake)
+ && !((struct ppc_link_hash_entry *) h)->fake)
return h;
if (name[0] == '.')
len = strlen (name);
dot_name = bfd_alloc (abfd, len + 2);
if (dot_name == NULL)
- return (struct elf_link_hash_entry *) -1;
+ return (struct bfd_link_hash_entry *) -1;
dot_name[0] = '.';
memcpy (dot_name + 1, name, len + 1);
h = _bfd_elf_archive_symbol_lookup (abfd, info, dot_name);
/* Return the linker hash table entry of a symbol that might be
satisfied by an archive symbol. Return -1 on error. */
-struct elf_link_hash_entry *
+struct bfd_link_hash_entry *
_bfd_elf_archive_symbol_lookup (bfd *abfd,
struct bfd_link_info *info,
const char *name)
{
- struct elf_link_hash_entry *h;
+ struct bfd_link_hash_entry *h;
char *p, *copy;
size_t len, first;
- h = elf_link_hash_lookup (elf_hash_table (info), name, false, false, true);
+ h = bfd_link_hash_lookup (info->hash, name, false, false, true);
if (h != NULL)
return h;
len = strlen (name);
copy = (char *) bfd_alloc (abfd, len);
if (copy == NULL)
- return (struct elf_link_hash_entry *) -1;
+ return (struct bfd_link_hash_entry *) -1;
first = p - name + 1;
memcpy (copy, name, first);
memcpy (copy + first, name + first + 1, len - first);
- h = elf_link_hash_lookup (elf_hash_table (info), copy, false, false, true);
+ h = bfd_link_hash_lookup (info->hash, copy, false, false, true);
if (h == NULL)
{
/* We also need to check references to the symbol without the
version. */
copy[first - 1] = '\0';
- h = elf_link_hash_lookup (elf_hash_table (info), copy,
- false, false, true);
+ h = bfd_link_hash_lookup (info->hash, copy, false, false, true);
}
bfd_release (abfd, copy);
bool loop;
size_t amt;
const struct elf_backend_data *bed;
- struct elf_link_hash_entry * (*archive_symbol_lookup)
+ struct bfd_link_hash_entry * (*archive_symbol_lookup)
(bfd *, struct bfd_link_info *, const char *);
if (! bfd_has_map (abfd))
symdefend = symdef + c;
for (i = 0; symdef < symdefend; symdef++, i++)
{
- struct elf_link_hash_entry *h;
+ struct bfd_link_hash_entry *h;
bfd *element;
struct bfd_link_hash_entry *undefs_tail;
symindex mark;
}
h = archive_symbol_lookup (abfd, info, symdef->name);
- if (h == (struct elf_link_hash_entry *) -1)
+ if (h == (struct bfd_link_hash_entry *) -1)
goto error_return;
if (h == NULL)
continue;
- if (h->root.type == bfd_link_hash_undefined)
+ if (h->type == bfd_link_hash_undefined)
{
/* If the archive element has already been loaded then one
of the symbols defined by that element might have been
made undefined due to being in a discarded section. */
- if (h->indx == -3)
+ if (is_elf_hash_table (info->hash)
+ && ((struct elf_link_hash_entry *) h)->indx == -3)
continue;
}
- else if (h->root.type == bfd_link_hash_common)
+ else if (h->type == bfd_link_hash_common)
{
/* We currently have a common symbol. The archive map contains
a reference to this symbol, so we may want to include it. We
}
else
{
- if (h->root.type != bfd_link_hash_undefweak)
+ if (h->type != bfd_link_hash_undefweak)
/* Symbol must be defined. Don't check it again. */
included[i] = true;
continue;