and hide_symbol members.
(elf_link_hash_copy_indirect): Remove.
(elf_link_hash_hide_symbol): Remove.
(struct elf_backend_data): Add elf_backend_copy_indirect_symbol
and elf_backend_hide_symbol.
(_bfd_elf_link_hash_copy_indirect): Declare.
(_bfd_elf_link_hash_hide_symbol): Declare.
* elf.c (_bfd_elf_link_hash_copy_indirect): Remove table argument.
(_bfd_elf_link_hash_hide_symbol): Likewise.
(_bfd_elf_link_hash_table_init): Don't init killed members.
* elflink.h (elf_link_add_object_symbols): Use the bed function
pointers not elf_link_hash_{copy_indirect,hide_symbol}.
(elf_link_assign_sym_version): Likewise.
* elfxx-target.h (elf_backend_copy_indirect_symbol): Default.
(elf_backend_hide_symbol): Likewise.
(elfNN_bed): Update for new members.
+2000-02-18 Richard Henderson <rth@cygnus.com>
+
+ * elf-bfd.h (struct elf_link_hash_table): Remove copy_indirect
+ and hide_symbol members.
+ (elf_link_hash_copy_indirect): Remove.
+ (elf_link_hash_hide_symbol): Remove.
+ (struct elf_backend_data): Add elf_backend_copy_indirect_symbol
+ and elf_backend_hide_symbol.
+ (_bfd_elf_link_hash_copy_indirect): Declare.
+ (_bfd_elf_link_hash_hide_symbol): Declare.
+ * elf.c (_bfd_elf_link_hash_copy_indirect): Remove table argument.
+ (_bfd_elf_link_hash_hide_symbol): Likewise.
+ (_bfd_elf_link_hash_table_init): Don't init killed members.
+ * elflink.h (elf_link_add_object_symbols): Use the bed function
+ pointers not elf_link_hash_{copy_indirect,hide_symbol}.
+ (elf_link_assign_sym_version): Likewise.
+ * elfxx-target.h (elf_backend_copy_indirect_symbol): Default.
+ (elf_backend_hide_symbol): Likewise.
+ (elfNN_bed): Update for new members.
+
2000-02-17 Kevin Buettner <kevinb@redhat.com>
* rs6000-core.c (CORE_DATA_SIZE_FIELD, CORE_COMM_FIELD, SAVE_FIELD,
PTR stab_info;
/* A linked list of local symbols to be added to .dynsym. */
struct elf_link_local_dynamic_entry *dynlocal;
-
- void (*copy_indirect) PARAMS ((struct elf_link_hash_table *,
- struct elf_link_hash_entry *,
- struct elf_link_hash_entry *));
- void (*hide_symbol) PARAMS ((struct elf_link_hash_table *,
- struct elf_link_hash_entry *));
};
/* Look up an entry in an ELF linker hash table. */
/* Get the ELF linker hash table from a link_info structure. */
#define elf_hash_table(p) ((struct elf_link_hash_table *) ((p)->hash))
-
-/* Call the copy_indirect method. */
-
-#define elf_link_hash_copy_indirect(TABLE,DIR,IND) \
- ((*(TABLE)->copy_indirect) ((TABLE), (DIR), (IND)))
-
-/* Call the hide_symbol method. */
-
-#define elf_link_hash_hide_symbol(TABLE,SYM) \
- ((*(TABLE)->hide_symbol) ((TABLE), (SYM)))
\f
/* Constant information held for an ELF backend. */
boolean (*) PARAMS ((PTR, const char *,
Elf_Internal_Sym *, asection *))));
+ /* Copy any information related to dynamic linking from a pre-existing
+ symbol IND to a newly created symbol DIR. */
+ void (*elf_backend_copy_indirect_symbol)
+ PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *));
+
+ /* Modify any information related to dynamic linking such that the
+ symbol is not exported. */
+ void (*elf_backend_hide_symbol)
+ PARAMS ((struct elf_link_hash_entry *));
+
/* The swapping table to use when dealing with ECOFF information.
Used for the MIPS ELF .mdebug section. */
const struct ecoff_debug_swap *elf_backend_ecoff_debug_swap;
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create
PARAMS ((bfd *));
+extern void _bfd_elf_link_hash_copy_indirect
+ PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *));
+extern void _bfd_elf_link_hash_hide_symbol
+ PARAMS ((struct elf_link_hash_entry *));
extern boolean _bfd_elf_link_hash_table_init
PARAMS ((struct elf_link_hash_table *, bfd *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
/* Copy data from an indirect symbol to its direct symbol, hiding the
old indirect symbol. */
-static void
-_bfd_elf_link_hash_copy_indirect (table, dir, ind)
- struct elf_link_hash_table *table;
+void
+_bfd_elf_link_hash_copy_indirect (dir, ind)
struct elf_link_hash_entry *dir, *ind;
{
/* Copy down any references that we may have already seen to the
BFD_ASSERT (ind->dynindx == -1);
}
-static void
-_bfd_elf_link_hash_hide_symbol(table, h)
- struct elf_link_hash_table *table;
+void
+_bfd_elf_link_hash_hide_symbol(h)
struct elf_link_hash_entry *h;
{
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
table->needed = NULL;
table->hgot = NULL;
table->stab_info = NULL;
- table->copy_indirect = _bfd_elf_link_hash_copy_indirect;
- table->hide_symbol = _bfd_elf_link_hash_hide_symbol;
return _bfd_link_hash_table_init (&table->root, abfd, newfunc);
}
struct elf_link_hash_entry *weaks;
Elf_External_Sym *esym;
Elf_External_Sym *esymend;
+ struct elf_backend_data *bed;
- add_symbol_hook = get_elf_backend_data (abfd)->elf_add_symbol_hook;
- collect = get_elf_backend_data (abfd)->collect;
+ bed = get_elf_backend_data (abfd);
+ add_symbol_hook = bed->elf_add_symbol_hook;
+ collect = bed->collect;
if ((abfd->flags & DYNAMIC) == 0)
dynamic = false;
== 0);
ht = (struct elf_link_hash_entry *) hi->root.u.i.link;
- elf_link_hash_copy_indirect (elf_hash_table (info),
- ht, hi);
+ (*bed->elf_backend_copy_indirect_symbol) (ht, hi);
/* See if the new flags lead us to realize that
the symbol must be dynamic. */
| ELF_LINK_HASH_DEF_REGULAR))
== 0);
- elf_link_hash_copy_indirect (elf_hash_table (info),
- h, hi);
+ (*bed->elf_backend_copy_indirect_symbol) (h, hi);
/* See if the new flags lead us to realize
that the symbol must be dynamic. */
struct elf_assign_sym_version_info *sinfo =
(struct elf_assign_sym_version_info *) data;
struct bfd_link_info *info = sinfo->info;
+ struct elf_backend_data *bed;
struct elf_info_failed eif;
char *p;
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
return true;
+ bed = get_elf_backend_data (sinfo->output_bfd);
p = strchr (h->root.root.string, ELF_VER_CHR);
if (p != NULL && h->verinfo.vertree == NULL)
{
&& ! sinfo->export_dynamic)
{
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
- elf_link_hash_hide_symbol (elf_hash_table (info),
- h);
+ (*bed->elf_backend_hide_symbol) (h);
/* FIXME: The name of the symbol has
already been recorded in the dynamic
string table section. */
&& ! sinfo->export_dynamic)
{
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
- elf_link_hash_hide_symbol (elf_hash_table (info), h);
+ (*bed->elf_backend_hide_symbol) (h);
/* FIXME: The name of the symbol has already
been recorded in the dynamic string table
section. */
&& ! sinfo->export_dynamic)
{
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
- elf_link_hash_hide_symbol (elf_hash_table (info), h);
+ (*bed->elf_backend_hide_symbol) (h);
/* FIXME: The name of the symbol has already been
recorded in the dynamic string table section. */
}
#ifndef elf_backend_output_arch_syms
#define elf_backend_output_arch_syms NULL
#endif
+#ifndef elf_backend_copy_indirect_symbol
+#define elf_backend_copy_indirect_symbol _bfd_elf_link_hash_copy_indirect
+#endif
+#ifndef elf_backend_hide_symbol
+#define elf_backend_hide_symbol _bfd_elf_link_hash_hide_symbol
+#endif
+
/* Previously, backends could only use SHT_REL or SHT_RELA relocation
sections, but not both. They defined USE_REL to indicate SHT_REL
elf_backend_post_process_headers,
elf_backend_print_symbol_all,
elf_backend_output_arch_syms,
+ elf_backend_copy_indirect_symbol,
+ elf_backend_hide_symbol,
elf_backend_ecoff_debug_swap,
ELF_MACHINE_ALT1,
ELF_MACHINE_ALT2,