(_bfd_generic_link_write_global_symbol): Follow warning symbol link.
* elflink.h (elf_adjust_dynstr_offsets): Likewise.
(elf_adjust_dynamic_symbol): Likewise.
(elf_export_symbol): Likewise.
(elf_link_find_version_dependencies): Likewise.
(elf_link_assign_sym_version): Likewise.
(elf_link_sec_merge_syms): Likewise.
(elf_link_output_extsym): Likewise.
(elf_gc_sweep_symbol): Likewise.
(elf_gc_propagate_vtable_entries_used): Likewise.
(elf_gc_smash_unused_vtentry_relocs): Likewise.
(elf_gc_allocate_got_offsets): Likewise.
(elf_collect_hash_codes): Likewise.
* elflink.c (elf_link_renumber_hash_table_dynsyms): Likewise.
* elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): Likewise.
(elf_hppa_remark_useless_dynamic_symbols): Likewise.
* elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise.
* elf32-arm.h (elf32_arm_discard_copies): Likewise.
* elf32-cris.c (elf_cris_adjust_gotplt_to_got): Likewise.
(elf_cris_discard_excess_dso_dynamics): Likewise.
* elf32-hppa.c (clobber_millicode_symbols): Likewise.
(mark_PIC_calls): Likewise.
(allocate_plt_static): Likewise.
(allocate_dynrelocs): Likewise.
(readonly_dynrelocs): Likewise.
* elf32-i386.c (allocate_dynrelocs): Likewise.
(readonly_dynrelocs): Likewise.
* elf32-i370.c (i370_elf_adjust_dynindx): Likewise.
* elf32-m68k.c (elf_m68k_discard_copies): Likewise.
* elf32-mips.c (mips_elf_output_extsym): Likewise.
(mips_elf_sort_hash_table_f): Likewise.
(mips_elf_check_mips16_stubs): Likewise.
* elf32-s390.c (allocate_dynrelocs): Likewise.
(readonly_dynrelocs): Likewise.
* elf32-sh.c (sh_elf_discard_copies): Likewise.
* elf32-xstormy16.c (xstormy16_relax_plt_check): Likewise.
(xstormy16_relax_plt_realloc): Likewise.
* elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Likewise.
(elf64_alpha_output_extsym): Likewise.
* elf64-hppa.c (elf64_hppa_mark_exported_functions): Likewise.
* elf64-mips.c (mips_elf64_sort_hash_table_f): Likewise.
(mips_elf64_check_mips16_stubs): Likewise.
(mips_elf64_output_extsym): Likewise.
* elf64-ppc.c (func_desc_adjust): Likewise.
(allocate_dynrelocs): Likewise.
(readonly_dynrelocs): Likewise.
* elf64-s390.c (allocate_dynrelocs): Likewise.
(readonly_dynrelocs): Likewise.
* elf64-sh64.c (sh64_elf64_discard_copies): Likewise.
* elf64-x86-64.c (allocate_dynrelocs): Likewise.
(readonly_dynrelocs): Likewise.
* elfxx-ia64.c (elfNN_ia64_global_dyn_sym_thunk): Likewise.
* aoutx.h (aout_link_write_other_symbol): Likewise.
* cofflink.c (_bfd_coff_write_task_globals): Likewise.
(_bfd_coff_write_global_sym): Likewise.
* i386linux.c (linux_tally_symbols): Likewise.
* m68klinux.c (linux_tally_symbols): Likewise.
* sparclinux.c (linux_tally_symbols): Likewise.
* pdp11.c (aout_link_write_other_symbol): Likewise.
* sunos.c (sunos_scan_dynamic_symbol): Likewise.
* xcofflink.c (xcoff_build_ldsyms): Likewise.
(xcoff_write_global_symbol): Likewise.
* cofflink.c (_bfd_coff_final_link): Formatting.
* cpu-mips.c (mips_compatible): Make static, prototype.
* elf32-i386.c (elf_i386_check_relocs): Formatting.
* elf32-sh.c (sh_elf_size_dynamic_sections): Likewise.
* elf64-alpha.c (elf64_alpha_output_extsym): Likewise.
* elf64-mips.c (mips_elf64_sort_hash_table): Likewise.
(mips_elf64_final_link): Likewise.
* elflink.h (elf_link_find_version_dependencies): Remove duplicate
prototype.
+2002-03-28 Alan Modra <amodra@bigpond.net.au>
+
+ * linker.c (link_action): Ignore duplicate warning syms.
+ (_bfd_generic_link_write_global_symbol): Follow warning symbol link.
+ * elflink.h (elf_adjust_dynstr_offsets): Likewise.
+ (elf_adjust_dynamic_symbol): Likewise.
+ (elf_export_symbol): Likewise.
+ (elf_link_find_version_dependencies): Likewise.
+ (elf_link_assign_sym_version): Likewise.
+ (elf_link_sec_merge_syms): Likewise.
+ (elf_link_output_extsym): Likewise.
+ (elf_gc_sweep_symbol): Likewise.
+ (elf_gc_propagate_vtable_entries_used): Likewise.
+ (elf_gc_smash_unused_vtentry_relocs): Likewise.
+ (elf_gc_allocate_got_offsets): Likewise.
+ (elf_collect_hash_codes): Likewise.
+ * elflink.c (elf_link_renumber_hash_table_dynsyms): Likewise.
+ * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): Likewise.
+ (elf_hppa_remark_useless_dynamic_symbols): Likewise.
+ * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise.
+ * elf32-arm.h (elf32_arm_discard_copies): Likewise.
+ * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Likewise.
+ (elf_cris_discard_excess_dso_dynamics): Likewise.
+ * elf32-hppa.c (clobber_millicode_symbols): Likewise.
+ (mark_PIC_calls): Likewise.
+ (allocate_plt_static): Likewise.
+ (allocate_dynrelocs): Likewise.
+ (readonly_dynrelocs): Likewise.
+ * elf32-i386.c (allocate_dynrelocs): Likewise.
+ (readonly_dynrelocs): Likewise.
+ * elf32-i370.c (i370_elf_adjust_dynindx): Likewise.
+ * elf32-m68k.c (elf_m68k_discard_copies): Likewise.
+ * elf32-mips.c (mips_elf_output_extsym): Likewise.
+ (mips_elf_sort_hash_table_f): Likewise.
+ (mips_elf_check_mips16_stubs): Likewise.
+ * elf32-s390.c (allocate_dynrelocs): Likewise.
+ (readonly_dynrelocs): Likewise.
+ * elf32-sh.c (sh_elf_discard_copies): Likewise.
+ * elf32-xstormy16.c (xstormy16_relax_plt_check): Likewise.
+ (xstormy16_relax_plt_realloc): Likewise.
+ * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Likewise.
+ (elf64_alpha_output_extsym): Likewise.
+ * elf64-hppa.c (elf64_hppa_mark_exported_functions): Likewise.
+ * elf64-mips.c (mips_elf64_sort_hash_table_f): Likewise.
+ (mips_elf64_check_mips16_stubs): Likewise.
+ (mips_elf64_output_extsym): Likewise.
+ * elf64-ppc.c (func_desc_adjust): Likewise.
+ (allocate_dynrelocs): Likewise.
+ (readonly_dynrelocs): Likewise.
+ * elf64-s390.c (allocate_dynrelocs): Likewise.
+ (readonly_dynrelocs): Likewise.
+ * elf64-sh64.c (sh64_elf64_discard_copies): Likewise.
+ * elf64-x86-64.c (allocate_dynrelocs): Likewise.
+ (readonly_dynrelocs): Likewise.
+ * elfxx-ia64.c (elfNN_ia64_global_dyn_sym_thunk): Likewise.
+ * aoutx.h (aout_link_write_other_symbol): Likewise.
+ * cofflink.c (_bfd_coff_write_task_globals): Likewise.
+ (_bfd_coff_write_global_sym): Likewise.
+ * i386linux.c (linux_tally_symbols): Likewise.
+ * m68klinux.c (linux_tally_symbols): Likewise.
+ * sparclinux.c (linux_tally_symbols): Likewise.
+ * pdp11.c (aout_link_write_other_symbol): Likewise.
+ * sunos.c (sunos_scan_dynamic_symbol): Likewise.
+ * xcofflink.c (xcoff_build_ldsyms): Likewise.
+ (xcoff_write_global_symbol): Likewise.
+
+ * cofflink.c (_bfd_coff_final_link): Formatting.
+ * cpu-mips.c (mips_compatible): Make static, prototype.
+ * elf32-i386.c (elf_i386_check_relocs): Formatting.
+ * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise.
+ * elf64-alpha.c (elf64_alpha_output_extsym): Likewise.
+ * elf64-mips.c (mips_elf64_sort_hash_table): Likewise.
+ (mips_elf64_final_link): Likewise.
+ * elflink.h (elf_link_find_version_dependencies): Remove duplicate
+ prototype.
+
2002-03-27 Nick Clifton <nickc@cambridge.redhat.com>
* coff-arm.c (SWAP_IN_RELOC_OFFSET): Define.
/* BFD semi-generic back-end for a.out binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
- 2001
+ 2001, 2002
Free Software Foundation, Inc.
Written by Cygnus Support.
bfd_size_type indx;
bfd_size_type amt;
+ if (h->root.type == bfd_link_hash_warning)
+ {
+ h = (struct aout_link_hash_entry *) h->root.u.i.link;
+ if (h->root.type == bfd_link_hash_new)
+ return true;
+ }
+
output_bfd = finfo->output_bfd;
if (aout_backend_info (output_bfd)->write_dynamic_symbol != NULL)
switch (h->root.type)
{
default:
+ case bfd_link_hash_warning:
abort ();
/* Avoid variable not initialized warnings. */
return true;
type = N_WEAKU;
val = 0;
case bfd_link_hash_indirect:
- case bfd_link_hash_warning:
- /* FIXME: Ignore these for now. The circumstances under which
- they should be written out are not clear to me. */
+ /* We ignore these symbols, since the indirected symbol is
+ already in the hash table. */
return true;
}
/* COFF specific linker code.
- Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
if (info->task_link)
{
finfo.failed = false;
- coff_link_hash_traverse (coff_hash_table (info), _bfd_coff_write_task_globals,
+ coff_link_hash_traverse (coff_hash_table (info),
+ _bfd_coff_write_task_globals,
(PTR) &finfo);
if (finfo.failed)
goto error_return;
/* Write out the global symbols. */
finfo.failed = false;
- coff_link_hash_traverse (coff_hash_table (info), _bfd_coff_write_global_sym,
+ coff_link_hash_traverse (coff_hash_table (info),
+ _bfd_coff_write_global_sym,
(PTR) &finfo);
if (finfo.failed)
goto error_return;
output_bfd = finfo->output_bfd;
+ if (h->root.type == bfd_link_hash_warning)
+ {
+ h = (struct coff_link_hash_entry *) h->root.u.i.link;
+ if (h->root.type == bfd_link_hash_new)
+ return true;
+ }
+
if (h->indx >= 0)
return true;
{
default:
case bfd_link_hash_new:
+ case bfd_link_hash_warning:
abort ();
return false;
break;
case bfd_link_hash_indirect:
- case bfd_link_hash_warning:
/* Just ignore these. They can't be handled anyhow. */
return true;
}
boolean rtnval = true;
boolean save_global_to_static;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct coff_link_hash_entry *) h->root.u.i.link;
+
if (h->indx < 0)
{
switch (h->root.type)
#include "sysdep.h"
#include "libbfd.h"
+static const bfd_arch_info_type *mips_compatible
+ PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
+
/* The default routine tests bits_per_word, which is wrong on mips as
mips word size doesn't correlate with reloc size. */
-const bfd_arch_info_type *
+static const bfd_arch_info_type *
mips_compatible (a, b)
const bfd_arch_info_type *a;
const bfd_arch_info_type *b;
/* Generic ECOFF (Extended-COFF) routines.
- Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+ Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
Original version by Per Bothner.
Full support added by Ian Lance Taylor, ian@cygnus.com.
bfd *output_bfd = einfo->abfd;
boolean strip;
+ if (h->root.type == bfd_link_hash_warning)
+ {
+ h = (struct ecoff_link_hash_entry *) h->root.u.i.link;
+ if (h->root.type == bfd_link_hash_new)
+ return true;
+ }
+
/* We need to check if this symbol is being stripped. */
if (h->root.type == bfd_link_hash_undefined
|| h->root.type == bfd_link_hash_undefweak)
switch (h->root.type)
{
default:
+ case bfd_link_hash_warning:
case bfd_link_hash_new:
abort ();
case bfd_link_hash_undefined:
h->esym.asym.value = h->root.u.c.size;
break;
case bfd_link_hash_indirect:
- case bfd_link_hash_warning:
- /* FIXME: Ignore these for now. The circumstances under which
- they should be written out are not clear to me. */
+ /* We ignore these symbols, since the indirected symbol is
+ already in the hash table. */
return true;
}
{
struct bfd_link_info *info = (struct bfd_link_info *)data;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
/* If we are not creating a shared library, and this symbol is
referenced by a shared library but is not defined anywhere, then
the generic code will warn that it is undefined.
{
struct bfd_link_info *info = (struct bfd_link_info *)data;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
/* If we are not creating a shared library, and this symbol is
referenced by a shared library but is not defined anywhere, then
the generic code will warn that it is undefined.
entry = (struct elf32_mn10300_link_hash_entry *) gen_entry;
+ if (entry->root.root.type == bfd_link_hash_warning)
+ entry = (struct elf32_mn10300_link_hash_entry *) entry->root.root.u.i.link;
+
/* If we already know we want to convert "call" to "calls" for calls
to this symbol, then return now. */
if (entry->flags == MN10300_CONVERT_CALL_TO_CALLS)
{
struct elf32_arm_pcrel_relocs_copied * s;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct elf32_arm_link_hash_entry *) h->root.root.u.i.link;
+
/* We only discard relocs for symbols defined in a regular object. */
if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
return true;
BFD_ASSERT (dynobj != NULL);
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct elf_cris_link_hash_entry *) h->root.root.u.i.link;
+
/* If nobody wanted a GOTPLT with this symbol, we're done. */
if (h->gotplt_refcount <= 0)
return true;
struct elf_cris_pcrel_relocs_copied *s;
struct bfd_link_info *info = (struct bfd_link_info *) inf;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct elf_cris_link_hash_entry *) h->root.root.u.i.link;
+
/* If a symbol has been forced local or we have found a regular
definition for the symbolic link case, then we won't be needing
any relocs. */
{
struct bfd_link_info *info = (struct bfd_link_info *) inf;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct elf_cris_link_hash_entry *) h->root.root.u.i.link;
+
/* If we're not creating a shared library and have a symbol which is
referred to by .got references, but the symbol is defined locally,
(or rather, not referred to by a DSO and not defined by a DSO) then
struct elf_link_hash_entry *h;
PTR inf ATTRIBUTE_UNUSED;
{
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
if (! (h->plt.refcount > 0
&& (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
struct elf32_hppa_link_hash_table *htab;
asection *s;
- if (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
+ if (h->root.type == bfd_link_hash_indirect)
return true;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
info = (struct bfd_link_info *) inf;
htab = hppa_link_hash_table (info);
if (((struct elf32_hppa_link_hash_entry *) h)->pic_call)
struct elf32_hppa_link_hash_entry *eh;
struct elf32_hppa_dyn_reloc_entry *p;
- if (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
+ if (h->root.type == bfd_link_hash_indirect)
return true;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
info = (struct bfd_link_info *) inf;
htab = hppa_link_hash_table (info);
if (htab->elf.dynamic_sections_created
struct elf_link_hash_entry *h;
struct bfd_link_info *info;
{
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
if (h->type == STT_PARISC_MILLI
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
{
struct elf32_hppa_link_hash_entry *eh;
struct elf32_hppa_dyn_reloc_entry *p;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
eh = (struct elf32_hppa_link_hash_entry *) h;
for (p = eh->dyn_relocs; p != NULL; p = p->next)
{
/* i370-specific support for 32-bit ELF
- Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001
+ Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
Hacked by Linas Vepstas for i370 linas@linas.org
h->dynindx, *cp);
#endif
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
if (h->dynindx != -1)
h->dynindx += *cp;
/* Intel 80386/80486-specific support for 32-bit ELF
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
{
const char *name;
bfd *dynobj;
+ unsigned int strndx = elf_elfheader (abfd)->e_shstrndx;
+ unsigned int shnam = elf_section_data (sec)->rel_hdr.sh_name;
- name = (bfd_elf_string_from_elf_section
- (abfd,
- elf_elfheader (abfd)->e_shstrndx,
- elf_section_data (sec)->rel_hdr.sh_name));
+ name = bfd_elf_string_from_elf_section (abfd, strndx, shnam);
if (name == NULL)
return false;
struct elf_i386_link_hash_entry *eh;
struct elf_i386_dyn_relocs *p;
- if (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
+ if (h->root.type == bfd_link_hash_indirect)
return true;
+ if (h->root.type == bfd_link_hash_warning)
+ /* When warning symbols are created, they **replace** the "real"
+ entry in the hash table, thus we never get to see the real
+ symbol in a hash traversal. So look at it now. */
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
info = (struct bfd_link_info *) inf;
htab = elf_i386_hash_table (info);
struct elf_i386_link_hash_entry *eh;
struct elf_i386_dyn_relocs *p;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
eh = (struct elf_i386_link_hash_entry *) h;
for (p = eh->dyn_relocs; p != NULL; p = p->next)
{
/* Motorola 68k series support for 32-bit ELF
- Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
{
struct elf_m68k_pcrel_relocs_copied *s;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct elf_m68k_link_hash_entry *) h->root.root.u.i.link;
+
/* We only discard relocs for symbols defined in a regular object. */
if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
return true;
boolean strip;
asection *sec, *output_section;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link;
+
if (h->root.indx == -2)
strip = false;
else if (((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
struct mips_elf_hash_sort_data *hsd
= (struct mips_elf_hash_sort_data *) data;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link;
+
/* Symbols without dynamic symbol table entries aren't interesting
at all. */
if (h->root.dynindx == -1)
struct mips_elf_link_hash_entry *h;
PTR data ATTRIBUTE_UNUSED;
{
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link;
+
if (h->fn_stub != NULL
&& ! h->need_fn_stub)
{
/* IBM S/390-specific support for 32-bit ELF
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Carl B. Pedersen and Martin Schwidefsky.
This file is part of BFD, the Binary File Descriptor library.
struct elf_s390_link_hash_entry *eh;
struct elf_s390_dyn_relocs *p;
- if (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
+ if (h->root.type == bfd_link_hash_indirect)
return true;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
info = (struct bfd_link_info *) inf;
htab = elf_s390_hash_table (info);
struct elf_s390_link_hash_entry *eh;
struct elf_s390_dyn_relocs *p;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
eh = (struct elf_s390_link_hash_entry *) h;
for (p = eh->dyn_relocs; p != NULL; p = p->next)
{
will not fill them in in the relocate_section routine. */
if (info->shared && info->symbolic)
sh_elf_link_hash_traverse (sh_elf_hash_table (info),
- sh_elf_discard_copies,
- (PTR) NULL);
+ sh_elf_discard_copies,
+ (PTR) NULL);
/* The check_relocs and adjust_dynamic_symbol entry points have
determined the sizes of the various dynamic sections. Allocate
{
struct elf_sh_pcrel_relocs_copied *s;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct elf_sh_link_hash_entry *) h->root.root.u.i.link;
+
/* We only discard relocs for symbols defined in a regular object. */
if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
return true;
{
struct relax_plt_data *data = (struct relax_plt_data *) xdata;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
if (h->plt.offset != (bfd_vma) -1)
{
bfd_vma address;
{
bfd_vma *entry = (bfd_vma *) xdata;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
if (h->plt.offset != (bfd_vma) -1)
{
h->plt.offset = *entry;
boolean strip;
asection *sec, *output_section;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link;
+
if (h->root.indx == -2)
strip = false;
else if (((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- || (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)
- && (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
- && (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
+ || (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)
+ && (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+ && (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
strip = true;
else if (einfo->info->strip == strip_all
- || (einfo->info->strip == strip_some
- && bfd_hash_lookup (einfo->info->keep_hash,
- h->root.root.root.string,
- false, false) == NULL))
+ || (einfo->info->strip == strip_some
+ && bfd_hash_lookup (einfo->info->keep_hash,
+ h->root.root.root.string,
+ false, false) == NULL))
strip = true;
else
strip = false;
h->esym.asym.st = stGlobal;
if (h->root.root.type != bfd_link_hash_defined
- && h->root.root.type != bfd_link_hash_defweak)
- h->esym.asym.sc = scAbs;
+ && h->root.root.type != bfd_link_hash_defweak)
+ h->esym.asym.sc = scAbs;
else
- {
- const char *name;
-
- sec = h->root.root.u.def.section;
- output_section = sec->output_section;
-
- /* When making a shared library and symbol h is the one from
- the another shared library, OUTPUT_SECTION may be null. */
- if (output_section == NULL)
- h->esym.asym.sc = scUndefined;
- else
- {
- name = bfd_section_name (output_section->owner, output_section);
-
- if (strcmp (name, ".text") == 0)
- h->esym.asym.sc = scText;
- else if (strcmp (name, ".data") == 0)
- h->esym.asym.sc = scData;
- else if (strcmp (name, ".sdata") == 0)
- h->esym.asym.sc = scSData;
- else if (strcmp (name, ".rodata") == 0
- || strcmp (name, ".rdata") == 0)
- h->esym.asym.sc = scRData;
- else if (strcmp (name, ".bss") == 0)
- h->esym.asym.sc = scBss;
- else if (strcmp (name, ".sbss") == 0)
- h->esym.asym.sc = scSBss;
- else if (strcmp (name, ".init") == 0)
- h->esym.asym.sc = scInit;
- else if (strcmp (name, ".fini") == 0)
- h->esym.asym.sc = scFini;
- else
- h->esym.asym.sc = scAbs;
- }
- }
+ {
+ const char *name;
+
+ sec = h->root.root.u.def.section;
+ output_section = sec->output_section;
+
+ /* When making a shared library and symbol h is the one from
+ the another shared library, OUTPUT_SECTION may be null. */
+ if (output_section == NULL)
+ h->esym.asym.sc = scUndefined;
+ else
+ {
+ name = bfd_section_name (output_section->owner, output_section);
+
+ if (strcmp (name, ".text") == 0)
+ h->esym.asym.sc = scText;
+ else if (strcmp (name, ".data") == 0)
+ h->esym.asym.sc = scData;
+ else if (strcmp (name, ".sdata") == 0)
+ h->esym.asym.sc = scSData;
+ else if (strcmp (name, ".rodata") == 0
+ || strcmp (name, ".rdata") == 0)
+ h->esym.asym.sc = scRData;
+ else if (strcmp (name, ".bss") == 0)
+ h->esym.asym.sc = scBss;
+ else if (strcmp (name, ".sbss") == 0)
+ h->esym.asym.sc = scSBss;
+ else if (strcmp (name, ".init") == 0)
+ h->esym.asym.sc = scInit;
+ else if (strcmp (name, ".fini") == 0)
+ h->esym.asym.sc = scFini;
+ else
+ h->esym.asym.sc = scAbs;
+ }
+ }
h->esym.asym.reserved = 0;
h->esym.asym.index = indexNil;
|| h->root.root.type == bfd_link_hash_defweak)
{
if (h->esym.asym.sc == scCommon)
- h->esym.asym.sc = scBss;
+ h->esym.asym.sc = scBss;
else if (h->esym.asym.sc == scSCommon)
- h->esym.asym.sc = scSBss;
+ h->esym.asym.sc = scSBss;
sec = h->root.root.u.def.section;
output_section = sec->output_section;
if (output_section != NULL)
- h->esym.asym.value = (h->root.root.u.def.value
- + sec->output_offset
- + output_section->vma);
+ h->esym.asym.value = (h->root.root.u.def.value
+ + sec->output_offset
+ + output_section->vma);
else
- h->esym.asym.value = 0;
+ h->esym.asym.value = 0;
}
else if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
{
}
if (! bfd_ecoff_debug_one_external (einfo->abfd, einfo->debug, einfo->swap,
- h->root.root.root.string,
- &h->esym))
+ h->root.root.root.string,
+ &h->esym))
{
einfo->failed = true;
return false;
{
struct alpha_elf_got_entry *gotent;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link;
+
for (gotent = h->got_entries; gotent; gotent = gotent->next)
if (gotent->use_count > 0)
{
struct alpha_elf_link_hash_entry *h;
struct bfd_link_info *info;
{
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link;
+
/* If the symbol was defined as a common symbol in a regular object
file, and there was no definition in any dynamic object, then the
linker will have allocated space for the symbol in a common
/* Support for HPPA 64-bit ELF
- Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
hppa_info = elf64_hppa_hash_table (info);
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
if (h
&& (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
struct mips_elf64_hash_sort_data *hsd
= (struct mips_elf64_hash_sort_data *) data;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct mips_elf64_link_hash_entry *) h->root.root.u.i.link;
+
/* Symbols without dynamic symbol table entries aren't interesting
at all. */
if (h->root.dynindx == -1)
hsd.min_got_dynindx = elf_hash_table (info)->dynsymcount;
hsd.max_non_got_dynindx = max_local;
mips_elf64_link_hash_traverse (((struct mips_elf64_link_hash_table *)
- elf_hash_table (info)),
- mips_elf64_sort_hash_table_f,
- &hsd);
+ elf_hash_table (info)),
+ mips_elf64_sort_hash_table_f,
+ &hsd);
/* There shoud have been enough room in the symbol table to
accomodate both the GOT and non-GOT symbols. */
struct mips_elf64_link_hash_entry *h;
PTR data ATTRIBUTE_UNUSED;
{
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct mips_elf64_link_hash_entry *) h->root.root.u.i.link;
+
if (h->fn_stub != NULL
&& ! h->need_fn_stub)
{
boolean strip;
asection *sec, *output_section;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct mips_elf64_link_hash_entry *) h->root.root.u.i.link;
+
if (h->root.indx == -2)
strip = false;
else if (((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
einfo.swap = swap;
einfo.failed = false;
mips_elf64_link_hash_traverse (mips_elf64_hash_table (info),
- mips_elf64_output_extsym,
- (PTR) &einfo);
+ mips_elf64_output_extsym,
+ (PTR) &einfo);
if (einfo.failed)
return false;
struct bfd_link_info *info;
struct ppc_link_hash_table *htab;
- if (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
+ if (h->root.type == bfd_link_hash_indirect)
return true;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
info = (struct bfd_link_info *) inf;
htab = ppc_hash_table (info);
struct ppc_link_hash_entry *eh;
struct ppc_dyn_relocs *p;
- if (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
+ if (h->root.type == bfd_link_hash_indirect)
return true;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
info = (struct bfd_link_info *) inf;
htab = ppc_hash_table (info);
struct ppc_link_hash_entry *eh;
struct ppc_dyn_relocs *p;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
eh = (struct ppc_link_hash_entry *) h;
for (p = eh->dyn_relocs; p != NULL; p = p->next)
{
/* IBM S/390-specific support for 64-bit ELF
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of BFD, the Binary File Descriptor library.
struct elf_s390_link_hash_entry *eh;
struct elf_s390_dyn_relocs *p;
- if (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
+ if (h->root.type == bfd_link_hash_indirect)
return true;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
info = (struct bfd_link_info *) inf;
htab = elf_s390_hash_table (info);
struct elf_s390_link_hash_entry *eh;
struct elf_s390_dyn_relocs *p;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
eh = (struct elf_s390_link_hash_entry *) h;
for (p = eh->dyn_relocs; p != NULL; p = p->next)
{
{
struct elf_sh64_pcrel_relocs_copied *s;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct elf_sh64_link_hash_entry *) h->root.root.u.i.link;
+
/* We only discard relocs for symbols defined in a regular object. */
if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
return true;
struct elf64_x86_64_link_hash_entry *eh;
struct elf64_x86_64_dyn_relocs *p;
- if (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
+ if (h->root.type == bfd_link_hash_indirect)
return true;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
info = (struct bfd_link_info *) inf;
htab = elf64_x86_64_hash_table (info);
struct elf64_x86_64_link_hash_entry *eh;
struct elf64_x86_64_dyn_relocs *p;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
eh = (struct elf64_x86_64_link_hash_entry *) h;
for (p = eh->dyn_relocs; p != NULL; p = p->next)
{
/* ELF linking support for BFD.
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
{
size_t *count = (size_t *) data;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
if (h->dynindx != -1)
h->dynindx = ++(*count);
PARAMS ((struct elf_link_hash_entry *, PTR));
static boolean elf_link_find_version_dependencies
PARAMS ((struct elf_link_hash_entry *, PTR));
-static boolean elf_link_find_version_dependencies
- PARAMS ((struct elf_link_hash_entry *, PTR));
static boolean elf_link_assign_sym_version
PARAMS ((struct elf_link_hash_entry *, PTR));
static boolean elf_collect_hash_codes
{
struct elf_strtab_hash *dynstr = (struct elf_strtab_hash *) data;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
if (h->dynindx != -1)
h->dynstr_index = _bfd_elf_strtab_offset (dynstr, h->dynstr_index);
return true;
bfd *dynobj;
struct elf_backend_data *bed;
+ if (h->root.type == bfd_link_hash_warning)
+ {
+ h->plt.offset = (bfd_vma) -1;
+ h->got.offset = (bfd_vma) -1;
+
+ /* When warning symbols are created, they **replace** the "real"
+ entry in the hash table, thus we never get to see the real
+ symbol in a hash traversal. So look at it now. */
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ }
+
/* Ignore indirect symbols. These are added by the versioning code. */
if (h->root.type == bfd_link_hash_indirect)
return true;
if (h->root.type == bfd_link_hash_indirect)
return true;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
if (h->dynindx == -1
&& (h->elf_link_hash_flags
& (ELF_LINK_HASH_DEF_REGULAR | ELF_LINK_HASH_REF_REGULAR)) != 0)
Elf_Internal_Vernaux *a;
bfd_size_type amt;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
/* We only care about symbols defined in shared objects with version
information. */
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
sinfo = (struct elf_assign_sym_version_info *) data;
info = sinfo->info;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
/* Fix the symbol flags. */
eif.failed = false;
eif.info = info;
{
asection *sec;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
&& ((sec = h->root.u.def.section)->flags & SEC_MERGE)
Elf_Internal_Sym sym;
asection *input_sec;
+ if (h->root.type == bfd_link_hash_warning)
+ {
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ if (h->root.type == bfd_link_hash_new)
+ return true;
+ }
+
/* Decide whether to output this symbol in this pass. */
if (eoinfo->localsyms)
{
{
default:
case bfd_link_hash_new:
+ case bfd_link_hash_warning:
abort ();
return false;
foo which points to foo@@GNU_1.2. We ignore these symbols,
since the indirected symbol is already in the hash table. */
return true;
-
- case bfd_link_hash_warning:
- /* We can't represent these symbols in ELF, although a warning
- symbol may have come from a .gnu.warning.SYMBOL section. We
- just put the target symbol in the hash table. If the target
- symbol does not really exist, don't do anything. */
- if (h->root.u.i.link->type == bfd_link_hash_new)
- return true;
- return (elf_link_output_extsym
- ((struct elf_link_hash_entry *) h->root.u.i.link, data));
}
/* Give the processor backend a chance to tweak the symbol value,
{
int *idx = (int *) idxptr;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
if (h->dynindx != -1
&& ((h->root.type != bfd_link_hash_defined
&& h->root.type != bfd_link_hash_defweak)
struct elf_link_hash_entry *h;
PTR okp;
{
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
/* Those that are not vtables. */
if (h->vtable_parent == NULL)
return true;
struct elf_backend_data *bed;
int file_align;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
/* Take care of both those symbols that do not describe vtables as
well as those that are not loaded. */
if (h->vtable_parent == NULL)
{
bfd_vma *off = (bfd_vma *) offarg;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
if (h->got.refcount > 0)
{
h->got.offset = off[0];
unsigned long ha;
char *alc = NULL;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
/* Ignore indirect symbols. These are added by the versioning code. */
if (h->dynindx == -1)
return true;
= (struct elfNN_ia64_dyn_sym_traverse_data *) xdata;
struct elfNN_ia64_dyn_sym_info *dyn_i;
+ if (entry->root.root.type == bfd_link_hash_warning)
+ entry = (struct elfNN_ia64_link_hash_entry *) entry->root.root.u.i.link;
+
for (dyn_i = entry->info; dyn_i; dyn_i = dyn_i->next)
if (! (*data->func) (dyn_i, data->data))
return false;
/* BFD back-end for linux flavored i386 a.out binaries.
- Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2001
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
struct linux_link_hash_entry *h1, *h2;
boolean exists;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct linux_link_hash_entry *) h->root.root.u.i.link;
+
if (h->root.root.type == bfd_link_hash_undefined
&& strncmp (h->root.root.root.string, NEEDS_SHRLIB,
sizeof NEEDS_SHRLIB - 1) == 0)
/* DEFW_ROW */ {DEFW, DEFW, DEFW, NOACT, NOACT, NOACT, NOACT, CYCLE },
/* COMMON_ROW */ {COM, COM, COM, CREF, COM, BIG, REFC, WARNC },
/* INDR_ROW */ {IND, IND, IND, MDEF, IND, CIND, MIND, CYCLE },
- /* WARN_ROW */ {MWARN, WARN, WARN, CWARN, CWARN, WARN, CWARN, MWARN },
+ /* WARN_ROW */ {MWARN, WARN, WARN, CWARN, CWARN, WARN, CWARN, NOACT },
/* SET_ROW */ {SET, SET, SET, SET, SET, SET, CYCLE, CYCLE }
};
(struct generic_write_global_symbol_info *) data;
asymbol *sym;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct generic_link_hash_entry *) h->root.u.i.link;
+
if (h->written)
return true;
/* BFD back-end for linux flavored m68k a.out binaries.
- Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
struct linux_link_hash_entry *h1, *h2;
boolean exists;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct linux_link_hash_entry *) h->root.root.u.i.link;
+
if (h->root.root.type == bfd_link_hash_undefined
&& strncmp (h->root.root.root.string, NEEDS_SHRLIB,
sizeof NEEDS_SHRLIB - 1) == 0)
/* BFD back-end for PDP-11 a.out binaries.
- Copyright 2001 Free Software Foundation, Inc.
+ Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
bfd_size_type indx;
bfd_size_type amt;
+ if (h->root.type == bfd_link_hash_warning)
+ {
+ h = (struct aout_link_hash_entry *) h->root.u.i.link;
+ if (h->root.type == bfd_link_hash_new)
+ return true;
+ }
+
output_bfd = finfo->output_bfd;
if (aout_backend_info (output_bfd)->write_dynamic_symbol != NULL)
/* BFD back-end for linux flavored sparc a.out binaries.
- Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
struct linux_link_hash_entry *h1, *h2;
boolean exists;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct linux_link_hash_entry *) h->root.root.u.i.link;
+
if (h->root.root.type == bfd_link_hash_undefined
&& strncmp (h->root.root.root.string, NEEDS_SHRLIB,
sizeof NEEDS_SHRLIB - 1) == 0)
{
struct bfd_link_info *info = (struct bfd_link_info *) data;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct sunos_link_hash_entry *) h->root.root.u.i.link;
+
/* Set the written flag for symbols we do not want to write out as
part of the regular symbol table. This is all symbols which are
not defined in a regular object file. For some reason symbols
struct xcoff_loader_info *ldinfo = (struct xcoff_loader_info *) p;
bfd_size_type amt;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct xcoff_link_hash_entry *) h->root.u.i.link;
+
/* __rtinit, this symbol has special handling. */
if (h->flags & XCOFF_RTINIT)
return true;
output_bfd = finfo->output_bfd;
outsym = finfo->outsyms;
+ if (h->root.type == bfd_link_hash_warning)
+ {
+ h = (struct xcoff_link_hash_entry *) h->root.u.i.link;
+ if (h->root.type == bfd_link_hash_new)
+ return true;
+ }
+
/* If this symbol was garbage collected, just skip it. */
if (xcoff_hash_table (finfo->info)->gc
&& (h->flags & XCOFF_MARK) == 0)