From: Alan Modra Date: Mon, 13 Jun 2011 00:59:15 +0000 (+0000) Subject: * linker.c (bfd_link_hash_traverse): Follow warning symbol link. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7686d77de353217f4a1d50e07ccb5aecd2579e67;p=binutils-gdb.git * linker.c (bfd_link_hash_traverse): Follow warning symbol link. (_bfd_generic_link_write_global_symbol, fix_syms): Don't handle warning symbols here. * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise. * elf32-arm.c (allocate_dynrelocs_for_symbol, elf32_arm_readonly_dynrelocs): Likewise. * elf32-bfin.c (bfin_discard_copies): Likewise. * elf32-cris.c (elf_cris_adjust_gotplt_to_got, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): Likewise. * elf32-hppa.c (allocate_plt_static, allocate_dynrelocs, clobber_millicode_symbols, readonly_dynrelocs): Likewise. * elf32-i370.c (i370_elf_adjust_dynindx): Likewise. * elf32-i386.c (elf_i386_allocate_dynrelocs, elf_i386_readonly_dynrelocs): Likewise. * elf32-lm32.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-m32c.c (m32c_relax_plt_check, m32c_relax_plt_realloc): Likewise. * elf32-m32r.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-m68k.c (elf_m68k_discard_copies): Likewise. * elf32-microblaze.c (allocate_dynrelocs): Likewise. * elf32-ppc.c (allocate_dynrelocs, maybe_set_textrel): Likewise. * elf32-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-score.c (score_elf_sort_hash_table_f): Likewise. * elf32-score7.c (score_elf_sort_hash_table_f): Likewise. * elf32-sh.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-tic6x.c (elf32_tic6x_allocate_dynrelocs, elf32_tic6x_readonly_dynrelocs): Likewise. * elf32-vax.c (elf_vax_discard_copies): Likewise. * elf32-xstormy16.c (xstormy16_relax_plt_check, xstormy16_relax_plt_realloc): Likewise. * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Likewise. * elf64-alpha.c (elf64_alpha_output_extsym, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_1): Likewise. * elf64-hppa.c (elf64_hppa_mark_exported_functions, allocate_global_data_opd, elf64_hppa_mark_milli_and_exported_functions, elf_hppa_unmark_useless_dynamic_symbols, elf_hppa_remark_useless_dynamic_symbols): Likewise. * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref, func_desc_adjust, adjust_opd_syms, adjust_toc_syms, allocate_dynrelocs, readonly_dynrelocs, merge_global_got, reallocate_got, undo_symbol_twiddle): Likewise. * elf64-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf64-sh64.c (sh64_elf64_discard_copies): Likewise. * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs, elf_x86_64_readonly_dynrelocs): Likewise. * elflink.c (elf_link_renumber_hash_table_dynsyms, elf_link_renumber_local_hash_table_dynsyms, _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies, _bfd_elf_link_assign_sym_version, _bfd_elf_adjust_dynamic_symbol, _bfd_elf_link_sec_merge_syms, elf_adjust_dynstr_offsets, elf_collect_hash_codes, elf_collect_gnu_hash_codes, elf_renumber_gnu_hash_syms, elf_gc_sweep_symbol, elf_gc_propagate_vtable_entries_used, elf_gc_smash_unused_vtentry_relocs, bfd_elf_gc_mark_dynamic_ref_symbol, elf_gc_allocate_got_offsets): Likewise. * elfnn-ia64.c (elfNN_ia64_global_dyn_info_free, elfNN_ia64_global_dyn_sym_thunk): Likewise. * elfxx-mips.c (mips_elf_check_symbols, mips_elf_output_extsym, mips_elf_sort_hash_table_f, allocate_dynrelocs): Likewise. * elfxx-sparc.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * i386linux.c (linux_tally_symbols): Likewise. * m68klinux.c (linux_tally_symbols): Likewise. * sparclinux.c (linux_tally_symbols): Likewise. * sunos.c (sunos_scan_dynamic_symbol): Likewise. * xcofflink.c (xcoff_post_gc_symbol): Likewise. * elflink.c (elf_link_output_extsym): Make it a bfd_hash_traverse function. Update all callers. * aoutx.h (aout_link_write_other_symbol): Likewise. * pdp11.c (aout_link_write_other_symbol): Likewise. * cofflink.c (_bfd_coff_write_global_sym): Likewise. * ecoff.c (ecoff_link_write_external): Likewise. * xcofflink.c (xcoff_write_global_symbol): Likewise. * vms-alpha.c (alpha_vms_link_output_symbol): Likewise. Handle warning symbols. * ecoff.c (ecoff_link_hash_traverse): Delete. * coff-ppc.c (ppc_bfd_coff_final_link): Use bfd_hash_traverse for _bfd_coff_write_global_sym. * libcoff-in.h (_bfd_coff_write_global_sym): Update prototype. * libcoff.h: Regenerate. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1e72bf2d86d..95d7ab2b7d7 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,87 @@ +2011-06-13 Alan Modra + + * linker.c (bfd_link_hash_traverse): Follow warning symbol link. + (_bfd_generic_link_write_global_symbol, fix_syms): Don't handle + warning symbols here. + * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise. + * elf32-arm.c (allocate_dynrelocs_for_symbol, + elf32_arm_readonly_dynrelocs): Likewise. + * elf32-bfin.c (bfin_discard_copies): Likewise. + * elf32-cris.c (elf_cris_adjust_gotplt_to_got, + elf_cris_discard_excess_dso_dynamics, + elf_cris_discard_excess_program_dynamics): Likewise. + * elf32-hppa.c (allocate_plt_static, allocate_dynrelocs, + clobber_millicode_symbols, readonly_dynrelocs): Likewise. + * elf32-i370.c (i370_elf_adjust_dynindx): Likewise. + * elf32-i386.c (elf_i386_allocate_dynrelocs, + elf_i386_readonly_dynrelocs): Likewise. + * elf32-lm32.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. + * elf32-m32c.c (m32c_relax_plt_check, m32c_relax_plt_realloc): Likewise. + * elf32-m32r.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. + * elf32-m68k.c (elf_m68k_discard_copies): Likewise. + * elf32-microblaze.c (allocate_dynrelocs): Likewise. + * elf32-ppc.c (allocate_dynrelocs, maybe_set_textrel): Likewise. + * elf32-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. + * elf32-score.c (score_elf_sort_hash_table_f): Likewise. + * elf32-score7.c (score_elf_sort_hash_table_f): Likewise. + * elf32-sh.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. + * elf32-tic6x.c (elf32_tic6x_allocate_dynrelocs, + elf32_tic6x_readonly_dynrelocs): Likewise. + * elf32-vax.c (elf_vax_discard_copies): Likewise. + * elf32-xstormy16.c (xstormy16_relax_plt_check, + xstormy16_relax_plt_realloc): Likewise. + * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Likewise. + * elf64-alpha.c (elf64_alpha_output_extsym, + elf64_alpha_calc_got_offsets_for_symbol, + elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_1): Likewise. + * elf64-hppa.c (elf64_hppa_mark_exported_functions, + allocate_global_data_opd, elf64_hppa_mark_milli_and_exported_functions, + elf_hppa_unmark_useless_dynamic_symbols, + elf_hppa_remark_useless_dynamic_symbols): Likewise. + * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref, func_desc_adjust, + adjust_opd_syms, adjust_toc_syms, allocate_dynrelocs, + readonly_dynrelocs, merge_global_got, reallocate_got, + undo_symbol_twiddle): Likewise. + * elf64-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. + * elf64-sh64.c (sh64_elf64_discard_copies): Likewise. + * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs, + elf_x86_64_readonly_dynrelocs): Likewise. + * elflink.c (elf_link_renumber_hash_table_dynsyms, + elf_link_renumber_local_hash_table_dynsyms, _bfd_elf_export_symbol, + _bfd_elf_link_find_version_dependencies, + _bfd_elf_link_assign_sym_version, _bfd_elf_adjust_dynamic_symbol, + _bfd_elf_link_sec_merge_syms, elf_adjust_dynstr_offsets, + elf_collect_hash_codes, elf_collect_gnu_hash_codes, + elf_renumber_gnu_hash_syms, elf_gc_sweep_symbol, + elf_gc_propagate_vtable_entries_used, + elf_gc_smash_unused_vtentry_relocs, bfd_elf_gc_mark_dynamic_ref_symbol, + elf_gc_allocate_got_offsets): Likewise. + * elfnn-ia64.c (elfNN_ia64_global_dyn_info_free, + elfNN_ia64_global_dyn_sym_thunk): Likewise. + * elfxx-mips.c (mips_elf_check_symbols, mips_elf_output_extsym, + mips_elf_sort_hash_table_f, allocate_dynrelocs): Likewise. + * elfxx-sparc.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. + * i386linux.c (linux_tally_symbols): Likewise. + * m68klinux.c (linux_tally_symbols): Likewise. + * sparclinux.c (linux_tally_symbols): Likewise. + * sunos.c (sunos_scan_dynamic_symbol): Likewise. + * xcofflink.c (xcoff_post_gc_symbol): Likewise. + + * elflink.c (elf_link_output_extsym): Make it a bfd_hash_traverse + function. Update all callers. + * aoutx.h (aout_link_write_other_symbol): Likewise. + * pdp11.c (aout_link_write_other_symbol): Likewise. + * cofflink.c (_bfd_coff_write_global_sym): Likewise. + * ecoff.c (ecoff_link_write_external): Likewise. + * xcofflink.c (xcoff_write_global_symbol): Likewise. + * vms-alpha.c (alpha_vms_link_output_symbol): Likewise. Handle + warning symbols. + * ecoff.c (ecoff_link_hash_traverse): Delete. + * coff-ppc.c (ppc_bfd_coff_final_link): Use bfd_hash_traverse for + _bfd_coff_write_global_sym. + * libcoff-in.h (_bfd_coff_write_global_sym): Update prototype. + * libcoff.h: Regenerate. + 2011-06-10 Nick Clifton * elflink.c (_bfd_elf_link_create_dynamic_sections): If the diff --git a/bfd/aoutx.h b/bfd/aoutx.h index ec0bdf0326a..1efb7151205 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -1,6 +1,6 @@ /* BFD semi-generic back-end for a.out binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Written by Cygnus Support. @@ -3551,8 +3551,9 @@ aout_link_includes_newfunc (struct bfd_hash_entry *entry, object. */ static bfd_boolean -aout_link_write_other_symbol (struct aout_link_hash_entry *h, void * data) +aout_link_write_other_symbol (struct bfd_hash_entry *bh, void *data) { + struct aout_link_hash_entry *h = (struct aout_link_hash_entry *) bh; struct aout_final_link_info *finfo = (struct aout_final_link_info *) data; bfd *output_bfd; int type; @@ -3719,7 +3720,7 @@ aout_link_reloc_link_order (struct aout_final_link_info *finfo, symbol. */ h->indx = -2; h->written = FALSE; - if (! aout_link_write_other_symbol (h, (void *) finfo)) + if (!aout_link_write_other_symbol (&h->root.root, finfo)) return FALSE; r_index = h->indx; } @@ -4077,8 +4078,8 @@ aout_link_input_section_std (struct aout_final_link_info *finfo, { h->indx = -2; h->written = FALSE; - if (! aout_link_write_other_symbol (h, - (void *) finfo)) + if (!aout_link_write_other_symbol (&h->root.root, + finfo)) return FALSE; } r_index = h->indx; @@ -4419,8 +4420,8 @@ aout_link_input_section_ext (struct aout_final_link_info *finfo, { h->indx = -2; h->written = FALSE; - if (! aout_link_write_other_symbol (h, - (void *) finfo)) + if (!aout_link_write_other_symbol (&h->root.root, + finfo)) return FALSE; } r_index = h->indx; @@ -5468,7 +5469,7 @@ NAME (aout, final_link) (bfd *abfd, h = aout_link_hash_lookup (aout_hash_table (info), "__DYNAMIC", FALSE, FALSE, FALSE); if (h != NULL) - aout_link_write_other_symbol (h, &aout_info); + aout_link_write_other_symbol (&h->root.root, &aout_info); } /* The most time efficient way to do the link would be to read all @@ -5542,9 +5543,9 @@ NAME (aout, final_link) (bfd *abfd, } /* Write out any symbols that we have not already written out. */ - aout_link_hash_traverse (aout_hash_table (info), - aout_link_write_other_symbol, - (void *) &aout_info); + bfd_hash_traverse (&info->hash->table, + aout_link_write_other_symbol, + &aout_info); /* Now handle any relocs we were asked to create by the linker. These did not come from any input file. We must do these after diff --git a/bfd/coff-ppc.c b/bfd/coff-ppc.c index b866d482f7b..b37a2247bc8 100644 --- a/bfd/coff-ppc.c +++ b/bfd/coff-ppc.c @@ -2401,8 +2401,7 @@ ppc_bfd_coff_final_link (abfd, info) /* Write out the global symbols. */ finfo.failed = FALSE; - coff_link_hash_traverse (coff_hash_table (info), _bfd_coff_write_global_sym, - (PTR) &finfo); + bfd_hash_traverse (&info->hash->table, _bfd_coff_write_global_sym, &finfo); if (finfo.failed) goto error_return; diff --git a/bfd/cofflink.c b/bfd/cofflink.c index fdfab1de48f..bca136445de 100644 --- a/bfd/cofflink.c +++ b/bfd/cofflink.c @@ -1,6 +1,6 @@ /* COFF specific linker code. Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007, 2008, 2009, 2011 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -1019,8 +1019,7 @@ _bfd_coff_final_link (bfd *abfd, /* Write out the global symbols. */ finfo.failed = FALSE; - coff_link_hash_traverse (coff_hash_table (info), - _bfd_coff_write_global_sym, &finfo); + bfd_hash_traverse (&info->hash->table, _bfd_coff_write_global_sym, &finfo); if (finfo.failed) goto error_return; @@ -2516,11 +2515,12 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *finfo, bfd *input_bfd) return TRUE; } -/* Write out a global symbol. Called via coff_link_hash_traverse. */ +/* Write out a global symbol. Called via bfd_hash_traverse. */ bfd_boolean -_bfd_coff_write_global_sym (struct coff_link_hash_entry *h, void *data) +_bfd_coff_write_global_sym (struct bfd_hash_entry *bh, void *data) { + struct coff_link_hash_entry *h = (struct coff_link_hash_entry *) bh; struct coff_final_link_info *finfo = (struct coff_final_link_info *) data; bfd *output_bfd; struct internal_syment isym; @@ -2745,7 +2745,7 @@ _bfd_coff_write_task_globals (struct coff_link_hash_entry *h, void *data) case bfd_link_hash_defweak: save_global_to_static = finfo->global_to_static; finfo->global_to_static = TRUE; - rtnval = _bfd_coff_write_global_sym (h, data); + rtnval = _bfd_coff_write_global_sym (&h->root.root, data); finfo->global_to_static = save_global_to_static; break; default: diff --git a/bfd/ecoff.c b/bfd/ecoff.c index f85627d2f52..efcb9bf75cd 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -1,6 +1,6 @@ /* Generic ECOFF (Extended-COFF) routines. Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -3231,14 +3231,6 @@ _bfd_ecoff_bfd_link_hash_table_create (bfd *abfd) ((struct ecoff_link_hash_entry *) \ bfd_link_hash_lookup (&(table)->root, (string), (create), (copy), (follow))) -/* Traverse an ECOFF link hash table. */ - -#define ecoff_link_hash_traverse(table, func, info) \ - (bfd_link_hash_traverse \ - (&(table)->root, \ - (bfd_boolean (*) (struct bfd_link_hash_entry *, void *)) (func), \ - (info))) - /* Get the ECOFF link hash table from the info structure. This is just a cast. */ @@ -4259,8 +4251,9 @@ ecoff_reloc_link_order (bfd *output_bfd, the hash table. */ static bfd_boolean -ecoff_link_write_external (struct ecoff_link_hash_entry *h, void * data) +ecoff_link_write_external (struct bfd_hash_entry *bh, void * data) { + struct ecoff_link_hash_entry *h = (struct ecoff_link_hash_entry *) bh; struct extsym_info *einfo = (struct extsym_info *) data; bfd *output_bfd = einfo->abfd; bfd_boolean strip; @@ -4491,9 +4484,7 @@ _bfd_ecoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info) /* Write out the external symbols. */ einfo.abfd = abfd; einfo.info = info; - ecoff_link_hash_traverse (ecoff_hash_table (info), - ecoff_link_write_external, - (void *) &einfo); + bfd_hash_traverse (&info->hash->table, ecoff_link_write_external, &einfo); if (info->relocatable) { diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index 30b5e02282e..8276a2fb0bf 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -1,6 +1,6 @@ /* Matsushita 10300 specific support for 32-bit ELF Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -1602,9 +1602,6 @@ elf32_mn10300_finish_hash_table_entry (struct bfd_hash_entry *gen_entry, 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) diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 8ace48a801b..f5b31c6cc69 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -12787,12 +12787,6 @@ allocate_dynrelocs_for_symbol (struct elf_link_hash_entry *h, void * inf) 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; - eh = (struct elf32_arm_link_hash_entry *) h; info = (struct bfd_link_info *) inf; @@ -13156,9 +13150,6 @@ elf32_arm_readonly_dynrelocs (struct elf_link_hash_entry * h, void * inf) struct elf32_arm_link_hash_entry * eh; struct elf_dyn_relocs * p; - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - eh = (struct elf32_arm_link_hash_entry *) h; for (p = eh->dyn_relocs; p != NULL; p = p->next) { diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c index 40c2c0446b0..b112dfc267f 100644 --- a/bfd/elf32-bfin.c +++ b/bfd/elf32-bfin.c @@ -5451,9 +5451,6 @@ bfin_discard_copies (struct elf_link_hash_entry *h, PTR inf) struct bfd_link_info *info = (struct bfd_link_info *) inf; struct bfin_pcrel_relocs_copied *s; - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - if (!h->def_regular || (!info->symbolic && !h->forced_local)) { if ((info->flags & DF_TEXTREL) == 0) diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index 9644e9b902d..ea5043ac0f6 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -1,6 +1,6 @@ /* CRIS-specific support for 32-bit ELF. Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, - 2010 Free Software Foundation, Inc. + 2010, 2011 Free Software Foundation, Inc. Contributed by Axis Communications AB. Written by Hans-Peter Nilsson, based on elf32-fr30.c PIC and shlib bits based primarily on elf32-m68k.c and elf32-i386.c. @@ -2733,9 +2733,6 @@ elf_cris_adjust_gotplt_to_got (h, p) { struct bfd_link_info *info = (struct bfd_link_info *) p; - 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; @@ -3956,9 +3953,6 @@ elf_cris_discard_excess_dso_dynamics (h, inf) 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. */ @@ -4014,9 +4008,6 @@ elf_cris_discard_excess_program_dynamics (h, inf) { 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 defined by a DSO) then lose the reloc for the .got diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index e70d7e52f34..0e33f47a6a4 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -1,6 +1,6 @@ /* BFD back-end for HP PA-RISC ELF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Original code by @@ -1938,9 +1938,6 @@ allocate_plt_static (struct elf_link_hash_entry *eh, void *inf) if (eh->root.type == bfd_link_hash_indirect) return TRUE; - if (eh->root.type == bfd_link_hash_warning) - eh = (struct elf_link_hash_entry *) eh->root.u.i.link; - info = (struct bfd_link_info *) inf; hh = hppa_elf_hash_entry (eh); htab = hppa_link_hash_table (info); @@ -2008,9 +2005,6 @@ allocate_dynrelocs (struct elf_link_hash_entry *eh, void *inf) if (eh->root.type == bfd_link_hash_indirect) return TRUE; - if (eh->root.type == bfd_link_hash_warning) - eh = (struct elf_link_hash_entry *) eh->root.u.i.link; - info = inf; htab = hppa_link_hash_table (info); if (htab == NULL) @@ -2170,9 +2164,6 @@ static bfd_boolean clobber_millicode_symbols (struct elf_link_hash_entry *eh, struct bfd_link_info *info) { - if (eh->root.type == bfd_link_hash_warning) - eh = (struct elf_link_hash_entry *) eh->root.u.i.link; - if (eh->type == STT_PARISC_MILLI && !eh->forced_local) { @@ -2189,9 +2180,6 @@ readonly_dynrelocs (struct elf_link_hash_entry *eh, void *inf) struct elf32_hppa_link_hash_entry *hh; struct elf32_hppa_dyn_reloc_entry *hdh_p; - if (eh->root.type == bfd_link_hash_warning) - eh = (struct elf_link_hash_entry *) eh->root.u.i.link; - hh = hppa_elf_hash_entry (eh); for (hdh_p = hh->dyn_relocs; hdh_p != NULL; hdh_p = hdh_p->hdh_next) { diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index a6174c2ea20..c9f4333bba4 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -1,6 +1,6 @@ /* i370-specific support for 32-bit ELF Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc. + 2005, 2006, 2007, 2008, 2010, 2011 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. Hacked by Linas Vepstas for i370 linas@linas.org @@ -562,9 +562,6 @@ i370_elf_adjust_dynindx (struct elf_link_hash_entry *h, void * cparg) 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; diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index eea22633a5e..05962a07f7f 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -2083,11 +2083,6 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) 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; eh = (struct elf_i386_link_hash_entry *) h; info = (struct bfd_link_info *) inf; @@ -2383,9 +2378,6 @@ elf_i386_readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) struct elf_i386_link_hash_entry *eh; struct elf_dyn_relocs *p; - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - /* Skip local IFUNC symbols. */ if (h->forced_local && h->type == STT_GNU_IFUNC) return TRUE; diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c index b6e8ba0f399..07add20c478 100644 --- a/bfd/elf32-lm32.c +++ b/bfd/elf32-lm32.c @@ -1,5 +1,5 @@ /* Lattice Mico32-specific support for 32-bit ELF - Copyright 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by Jon Beniston This file is part of BFD, the Binary File Descriptor library. @@ -1918,12 +1918,6 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) 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 = lm32_elf_hash_table (info); if (htab == NULL) @@ -2110,9 +2104,6 @@ readonly_dynrelocs (struct elf_link_hash_entry *h, void * inf) struct elf_lm32_link_hash_entry *eh; struct elf_lm32_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_lm32_link_hash_entry *) h; for (p = eh->dyn_relocs; p != NULL; p = p->next) { diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c index e9cabaa963a..cf7ad99ccff 100644 --- a/bfd/elf32-m32c.c +++ b/bfd/elf32-m32c.c @@ -1,5 +1,5 @@ /* M16C/M32C specific support for 32-bit ELF. - Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 + Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -989,9 +989,6 @@ m32c_relax_plt_check (struct elf_link_hash_entry *h, { 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; @@ -1024,9 +1021,6 @@ m32c_relax_plt_realloc (struct elf_link_hash_entry *h, { 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; diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index 0b114bd9968..51ef61e6b49 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -1,6 +1,6 @@ /* M32R-specific support for 32-bit ELF. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -1977,12 +1977,6 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) 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 = m32r_elf_hash_table (info); if (htab == NULL) @@ -2169,9 +2163,6 @@ readonly_dynrelocs (struct elf_link_hash_entry *h, void * inf) struct elf_m32r_link_hash_entry *eh; struct elf_m32r_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_m32r_link_hash_entry *) h; for (p = eh->dyn_relocs; p != NULL; p = p->next) { diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index b4f7bc2c94c..612525c2ad6 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -1,6 +1,7 @@ /* Motorola 68k series support for 32-bit ELF Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -3466,9 +3467,6 @@ elf_m68k_discard_copies (h, inf) struct bfd_link_info *info = (struct bfd_link_info *) inf; struct elf_m68k_pcrel_relocs_copied *s; - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - if (!SYMBOL_CALLS_LOCAL (info, h)) { if ((info->flags & DF_TEXTREL) == 0) diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c index 2d460ab9a7a..b180dc4308c 100644 --- a/bfd/elf32-microblaze.c +++ b/bfd/elf32-microblaze.c @@ -2382,12 +2382,6 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat) 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 *) dat; htab = elf32_mb_hash_table (info); if (htab == NULL) diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index d8be8c65260..f05ddb26674 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -5149,12 +5149,6 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) 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; - htab = ppc_elf_hash_table (info); if (htab->elf.dynamic_sections_created || h->type == STT_GNU_IFUNC) @@ -5504,9 +5498,6 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info) 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 (readonly_dynrelocs (h)) { ((struct bfd_link_info *) info)->flags |= DF_TEXTREL; diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index 46e9541f07f..98437d0df90 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -1,6 +1,6 @@ /* IBM S/390-specific support for 32-bit ELF - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 - Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + 2011 Free Software Foundation, Inc. Contributed by Carl B. Pedersen and Martin Schwidefsky. This file is part of BFD, the Binary File Descriptor library. @@ -1696,12 +1696,6 @@ allocate_dynrelocs (h, inf) 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_s390_hash_table (info); @@ -1922,9 +1916,6 @@ readonly_dynrelocs (h, inf) 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) { diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c index 1c08c8ac32b..b4376242c94 100644 --- a/bfd/elf32-score.c +++ b/bfd/elf32-score.c @@ -1,5 +1,6 @@ /* 32-bit ELF support for S+core. - Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright 2006, 2007, 2008, 2009, 2010, 2011 + Free Software Foundation, Inc. Contributed by Brain.lin (brain.lin@sunplusct.com) Mei Ligang (ligang@sunnorth.com.cn) @@ -1037,9 +1038,6 @@ score_elf_sort_hash_table_f (struct score_elf_link_hash_entry *h, void *data) { struct score_elf_hash_sort_data *hsd = data; - if (h->root.root.type == bfd_link_hash_warning) - h = (struct score_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) return TRUE; diff --git a/bfd/elf32-score7.c b/bfd/elf32-score7.c index 9ce3bf1dea0..3e98bfc45ac 100644 --- a/bfd/elf32-score7.c +++ b/bfd/elf32-score7.c @@ -1,5 +1,5 @@ /* 32-bit ELF support for S+core. - Copyright 2009, 2010 Free Software Foundation, Inc. + Copyright 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by Brain.lin (brain.lin@sunplusct.com) Mei Ligang (ligang@sunnorth.com.cn) @@ -920,9 +920,6 @@ score_elf_sort_hash_table_f (struct score_elf_link_hash_entry *h, void *data) { struct score_elf_hash_sort_data *hsd = data; - if (h->root.root.type == bfd_link_hash_warning) - h = (struct score_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) return TRUE; diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index e15f51c20f4..b85b7c2111b 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -1,6 +1,6 @@ /* Renesas / SuperH SH specific support for 32-bit ELF Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -2977,12 +2977,6 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) 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 = sh_elf_hash_table (info); if (htab == NULL) @@ -3321,9 +3315,6 @@ readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) struct elf_sh_link_hash_entry *eh; struct elf_sh_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_sh_link_hash_entry *) h; for (p = eh->dyn_relocs; p != NULL; p = p->next) { diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c index 9b2b0f03c9b..b31e6409394 100644 --- a/bfd/elf32-tic6x.c +++ b/bfd/elf32-tic6x.c @@ -3127,13 +3127,7 @@ elf32_tic6x_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) 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; eh = (struct elf32_tic6x_link_hash_entry *) h; - info = (struct bfd_link_info *) inf; htab = elf32_tic6x_hash_table (info); @@ -3277,9 +3271,6 @@ elf32_tic6x_readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) struct elf32_tic6x_link_hash_entry *eh; struct elf_dyn_relocs *p; - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - eh = (struct elf32_tic6x_link_hash_entry *) h; for (p = eh->dyn_relocs; p != NULL; p = p->next) { diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c index 78f14ecead2..643381c5c43 100644 --- a/bfd/elf32-vax.c +++ b/bfd/elf32-vax.c @@ -1,6 +1,7 @@ /* VAX series support for 32-bit ELF Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + Free Software Foundation, Inc. Contributed by Matt Thomas . This file is part of BFD, the Binary File Descriptor library. @@ -1272,9 +1273,6 @@ elf_vax_discard_copies (struct elf_vax_link_hash_entry *h, { struct elf_vax_pcrel_relocs_copied *s; - if (h->root.root.type == bfd_link_hash_warning) - h = (struct elf_vax_link_hash_entry *) h->root.root.u.i.link; - /* We only discard relocs for symbols defined in a regular object. */ if (!h->root.def_regular) return TRUE; diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c index 09c894e95b1..614178337e9 100644 --- a/bfd/elf32-xstormy16.c +++ b/bfd/elf32-xstormy16.c @@ -1,5 +1,5 @@ /* Xstormy16-specific support for 32-bit ELF. - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2011 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -537,9 +537,6 @@ xstormy16_relax_plt_check (struct elf_link_hash_entry *h, void * xdata) { 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; @@ -571,9 +568,6 @@ xstormy16_relax_plt_realloc (struct elf_link_hash_entry *h, void * xdata) { 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; diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index 3be01613180..c6e4fb43a01 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -1531,9 +1531,6 @@ elf_xtensa_allocate_dynrelocs (struct elf_link_hash_entry *h, void *arg) 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 *) arg; htab = elf_xtensa_hash_table (info); if (htab == NULL) diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 33b27ac6d3c..4efe02a6ec4 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -1553,9 +1553,6 @@ elf64_alpha_output_extsym (struct alpha_elf_link_hash_entry *h, PTR data) bfd_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.def_dynamic @@ -2390,9 +2387,6 @@ elf64_alpha_calc_got_offsets_for_symbol (struct alpha_elf_link_hash_entry *h, { 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) { @@ -2695,9 +2689,6 @@ elf64_alpha_calc_dynrel_sizes (struct alpha_elf_link_hash_entry *h, struct alpha_elf_reloc_entry *relent; unsigned long entries; - 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 @@ -2751,9 +2742,6 @@ elf64_alpha_size_rela_got_1 (struct alpha_elf_link_hash_entry *h, struct alpha_elf_got_entry *gotent; unsigned long entries; - if (h->root.root.type == bfd_link_hash_warning) - h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link; - /* If we're using a plt for this symbol, then all of its relocations for its got entries go into .rela.plt. */ if (h->root.needs_plt) diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index d8213a01a8a..d78225b567d 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -1,6 +1,6 @@ /* Support for HPPA 64-bit ELF 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, - 2010 Free Software Foundation, Inc. + 2010, 2011 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -937,9 +937,6 @@ elf64_hppa_mark_exported_functions (struct elf_link_hash_entry *eh, void *data) if (hppa_info == NULL) return FALSE; - if (eh->root.type == bfd_link_hash_warning) - eh = (struct elf_link_hash_entry *) eh->root.u.i.link; - if (eh && (eh->root.type == bfd_link_hash_defined || eh->root.type == bfd_link_hash_defweak) @@ -1056,10 +1053,6 @@ allocate_global_data_opd (struct elf_link_hash_entry *eh, void *data) if (hh && hh->want_opd) { - while (hh->eh.root.type == bfd_link_hash_indirect - || hh->eh.root.type == bfd_link_hash_warning) - hh = hppa_elf_hash_entry (hh->eh.root.u.i.link); - /* We never need an opd entry for a symbol which is not defined by this output file. */ if (hh && (hh->eh.root.type == bfd_link_hash_undefined @@ -1512,19 +1505,15 @@ static bfd_boolean elf64_hppa_mark_milli_and_exported_functions (struct elf_link_hash_entry *eh, void *data) { - struct elf_link_hash_entry *elf = eh; - struct bfd_link_info *info = (struct bfd_link_info *)data; - - if (elf->root.type == bfd_link_hash_warning) - elf = (struct elf_link_hash_entry *) elf->root.u.i.link; + struct bfd_link_info *info = (struct bfd_link_info *) data; - if (elf->type == STT_PARISC_MILLI) + if (eh->type == STT_PARISC_MILLI) { - if (elf->dynindx != -1) + if (eh->dynindx != -1) { - elf->dynindx = -1; + eh->dynindx = -1; _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr, - elf->dynstr_index); + eh->dynstr_index); } return TRUE; } @@ -2839,9 +2828,6 @@ elf_hppa_unmark_useless_dynamic_symbols (struct elf_link_hash_entry *h, { struct bfd_link_info *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. @@ -2873,9 +2859,6 @@ elf_hppa_remark_useless_dynamic_symbols (struct elf_link_hash_entry *h, { struct bfd_link_info *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. diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 70e2a8a5dce..14fa20b2ac5 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -5669,9 +5669,6 @@ ppc64_elf_gc_mark_dynamic_ref (struct elf_link_hash_entry *h, void *inf) struct ppc_link_hash_entry *eh = (struct ppc_link_hash_entry *) h; struct ppc_link_hash_entry *fdh; - if (eh->elf.root.type == bfd_link_hash_warning) - eh = (struct ppc_link_hash_entry *) eh->elf.root.u.i.link; - /* Dynamic linking info is on the func descriptor sym. */ fdh = defined_func_desc (eh); if (fdh != NULL) @@ -6214,9 +6211,6 @@ func_desc_adjust (struct elf_link_hash_entry *h, void *inf) if (fh->elf.root.type == bfd_link_hash_indirect) return TRUE; - if (fh->elf.root.type == bfd_link_hash_warning) - fh = (struct ppc_link_hash_entry *) fh->elf.root.u.i.link; - info = inf; htab = ppc_hash_table (info); if (htab == NULL) @@ -6742,9 +6736,6 @@ adjust_opd_syms (struct elf_link_hash_entry *h, void *inf ATTRIBUTE_UNUSED) 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->root.type != bfd_link_hash_defined && h->root.type != bfd_link_hash_defweak) return TRUE; @@ -7905,9 +7896,6 @@ adjust_toc_syms (struct elf_link_hash_entry *h, void *inf) 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->root.type != bfd_link_hash_defined && h->root.type != bfd_link_hash_defweak) return TRUE; @@ -8603,9 +8591,6 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) 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); if (htab == NULL) @@ -8846,9 +8831,6 @@ readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) struct ppc_link_hash_entry *eh; struct elf_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) { @@ -10217,9 +10199,6 @@ merge_global_got (struct elf_link_hash_entry *h, void *inf ATTRIBUTE_UNUSED) 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; - merge_got_entries (&h->got.glist); return TRUE; @@ -10236,9 +10215,6 @@ reallocate_got (struct elf_link_hash_entry *h, void *inf) 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; - for (gent = h->got.glist; gent != NULL; gent = gent->next) if (!gent->is_indirect) allocate_got (h, (struct bfd_link_info *) inf, gent); @@ -11493,9 +11469,6 @@ undo_symbol_twiddle (struct elf_link_hash_entry *h, void *inf ATTRIBUTE_UNUSED) 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; - eh = (struct ppc_link_hash_entry *) h; if (eh->elf.root.type != bfd_link_hash_undefweak || !eh->was_undefined) return TRUE; diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index 671cb93a4a5..9884da03b61 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -1,6 +1,6 @@ /* IBM S/390-specific support for 64-bit ELF Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, - 2010 Free Software Foundation, Inc. + 2010, 2011 Free Software Foundation, Inc. Contributed Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of BFD, the Binary File Descriptor library. @@ -1680,12 +1680,6 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, 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_s390_hash_table (info); if (htab == NULL) @@ -1907,9 +1901,6 @@ readonly_dynrelocs (h, inf) 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) { diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index 96923046412..bbef2a216cf 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -1,6 +1,6 @@ /* SuperH SH64-specific support for 64-bit ELF Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, - 2010 Free Software Foundation, Inc. + 2010, 2011 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -3422,9 +3422,6 @@ sh64_elf64_discard_copies (struct elf_sh64_link_hash_entry *h, { 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.def_regular) return TRUE; diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 72a7cc1dc08..8ebd56ed685 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -2039,8 +2039,6 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) 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; eh = (struct elf_x86_64_link_hash_entry *) h; info = (struct bfd_link_info *) inf; @@ -2305,9 +2303,6 @@ elf_x86_64_readonly_dynrelocs (struct elf_link_hash_entry *h, struct elf_x86_64_link_hash_entry *eh; struct elf_dyn_relocs *p; - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - /* Skip local IFUNC symbols. */ if (h->forced_local && h->type == STT_GNU_IFUNC) return TRUE; diff --git a/bfd/elflink.c b/bfd/elflink.c index ef7a524809e..9d2d68a3397 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -722,9 +722,6 @@ elf_link_renumber_hash_table_dynsyms (struct elf_link_hash_entry *h, { 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->forced_local) return TRUE; @@ -744,9 +741,6 @@ elf_link_renumber_local_hash_table_dynsyms (struct elf_link_hash_entry *h, { 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->forced_local) return TRUE; @@ -1812,16 +1806,13 @@ _bfd_elf_export_symbol (struct elf_link_hash_entry *h, void *data) { struct elf_info_failed *eif = (struct elf_info_failed *) data; - /* Ignore this if we won't export it. */ - if (!eif->info->export_dynamic && !h->dynamic) - return TRUE; - /* 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_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; + /* Ignore this if we won't export it. */ + if (!eif->info->export_dynamic && !h->dynamic) + return TRUE; if (h->dynindx == -1 && (h->def_regular @@ -1858,9 +1849,6 @@ _bfd_elf_link_find_version_dependencies (struct elf_link_hash_entry *h, 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->def_dynamic @@ -1946,9 +1934,6 @@ _bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *h, void *data) sinfo = (struct elf_info_failed *) 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; @@ -2564,17 +2549,6 @@ _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data) if (! is_elf_hash_table (eif->info->hash)) return FALSE; - if (h->root.type == bfd_link_hash_warning) - { - h->got = elf_hash_table (eif->info)->init_got_offset; - h->plt = elf_hash_table (eif->info)->init_plt_offset; - - /* 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; @@ -2730,9 +2704,6 @@ _bfd_elf_link_sec_merge_syms (struct elf_link_hash_entry *h, void *data) { 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) @@ -3180,9 +3151,6 @@ elf_adjust_dynstr_offsets (struct elf_link_hash_entry *h, void *data) { 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; @@ -5175,9 +5143,6 @@ elf_collect_hash_codes (struct elf_link_hash_entry *h, void *data) 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; @@ -5246,9 +5211,6 @@ elf_collect_gnu_hash_codes (struct elf_link_hash_entry *h, void *data) 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; @@ -5299,9 +5261,6 @@ elf_renumber_gnu_hash_syms (struct elf_link_hash_entry *h, void *data) unsigned long int bucket; unsigned long int val; - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - /* Ignore indirect symbols. */ if (h->dynindx == -1) return TRUE; @@ -8605,8 +8564,9 @@ elf_link_check_versioned_symbol (struct bfd_link_info *info, global symbols. */ static bfd_boolean -elf_link_output_extsym (struct elf_link_hash_entry *h, void *data) +elf_link_output_extsym (struct bfd_hash_entry *bh, void *data) { + struct elf_link_hash_entry *h = (struct elf_link_hash_entry *) bh; struct elf_outext_info *eoinfo = (struct elf_outext_info *) data; struct elf_final_link_info *finfo = eoinfo->finfo; bfd_boolean strip; @@ -10822,8 +10782,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) eoinfo.failed = FALSE; eoinfo.finfo = &finfo; eoinfo.localsyms = TRUE; - elf_link_hash_traverse (elf_hash_table (info), elf_link_output_extsym, - &eoinfo); + bfd_hash_traverse (&info->hash->table, elf_link_output_extsym, &eoinfo); if (eoinfo.failed) return FALSE; @@ -10932,8 +10891,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) eoinfo.failed = FALSE; eoinfo.localsyms = FALSE; eoinfo.finfo = &finfo; - elf_link_hash_traverse (elf_hash_table (info), elf_link_output_extsym, - &eoinfo); + bfd_hash_traverse (&info->hash->table, elf_link_output_extsym, &eoinfo); if (eoinfo.failed) return FALSE; @@ -11687,9 +11645,6 @@ struct elf_gc_sweep_symbol_info static bfd_boolean elf_gc_sweep_symbol (struct elf_link_hash_entry *h, void *data) { - 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) && !h->root.u.def.section->gc_mark @@ -11801,9 +11756,6 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info) static bfd_boolean elf_gc_propagate_vtable_entries_used (struct elf_link_hash_entry *h, void *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 == NULL || h->vtable->parent == NULL) return TRUE; @@ -11865,9 +11817,6 @@ elf_gc_smash_unused_vtentry_relocs (struct elf_link_hash_entry *h, void *okp) const struct elf_backend_data *bed; unsigned int log_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 == NULL || h->vtable->parent == NULL) @@ -11915,9 +11864,6 @@ bfd_elf_gc_mark_dynamic_ref_symbol (struct elf_link_hash_entry *h, void *inf) { struct bfd_link_info *info = (struct bfd_link_info *) inf; - 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) && (h->ref_dynamic @@ -12190,9 +12136,6 @@ elf_gc_allocate_got_offsets (struct elf_link_hash_entry *h, void *arg) bfd *obfd = gofarg->info->output_bfd; const struct elf_backend_data *bed = get_elf_backend_data (obfd); - 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 = gofarg->gotoff; diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c index 9f846809b0e..bc31fca7903 100644 --- a/bfd/elfnn-ia64.c +++ b/bfd/elfnn-ia64.c @@ -1421,9 +1421,6 @@ elfNN_ia64_global_dyn_info_free (void **xentry, struct elfNN_ia64_link_hash_entry *entry = (struct elfNN_ia64_link_hash_entry *) xentry; - if (entry->root.root.type == bfd_link_hash_warning) - entry = (struct elfNN_ia64_link_hash_entry *) entry->root.root.u.i.link; - if (entry->info) { free (entry->info); @@ -1496,9 +1493,6 @@ elfNN_ia64_global_dyn_sym_thunk (struct bfd_hash_entry *xentry, struct elfNN_ia64_dyn_sym_info *dyn_i; unsigned int count; - if (entry->root.root.type == bfd_link_hash_warning) - entry = (struct elfNN_ia64_link_hash_entry *) entry->root.root.u.i.link; - for (count = entry->count, dyn_i = entry->info; count != 0; count--, dyn_i++) diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index d5f677fad5f..2ce56789c0b 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -1719,9 +1719,6 @@ mips_elf_check_symbols (struct mips_elf_link_hash_entry *h, void *data) struct mips_htab_traverse_info *hti; hti = (struct mips_htab_traverse_info *) data; - if (h->root.root.type == bfd_link_hash_warning) - h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link; - if (!hti->info->relocatable) mips_elf_check_mips16_stubs (hti->info, h); @@ -2409,9 +2406,6 @@ mips_elf_output_extsym (struct mips_elf_link_hash_entry *h, void *data) bfd_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.def_dynamic @@ -3437,9 +3431,6 @@ mips_elf_sort_hash_table_f (struct mips_elf_link_hash_entry *h, void *data) { struct mips_elf_hash_sort_data *hsd = 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) @@ -8147,10 +8138,9 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) if (htab->is_vxworks && !info->shared) return TRUE; - /* Ignore indirect and warning symbols. All relocations against - such symbols will be redirected to the target symbol. */ - if (h->root.type == bfd_link_hash_indirect - || h->root.type == bfd_link_hash_warning) + /* Ignore indirect symbols. All relocations against such symbols + will be redirected to the target symbol. */ + if (h->root.type == bfd_link_hash_indirect) return TRUE; /* If this symbol is defined in a dynamic object, or we are creating diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c index f0f79070a36..d72dcba0a3e 100644 --- a/bfd/elfxx-sparc.c +++ b/bfd/elfxx-sparc.c @@ -1,5 +1,6 @@ /* SPARC-specific support for ELF - Copyright 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -2145,12 +2146,6 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, PTR inf) 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 = _bfd_sparc_elf_hash_table (info); BFD_ASSERT (htab != NULL); @@ -2426,9 +2421,6 @@ readonly_dynrelocs (struct elf_link_hash_entry *h, PTR inf) struct _bfd_sparc_elf_link_hash_entry *eh; struct _bfd_sparc_elf_dyn_relocs *p; - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - eh = (struct _bfd_sparc_elf_link_hash_entry *) h; for (p = eh->dyn_relocs; p != NULL; p = p->next) { diff --git a/bfd/i386linux.c b/bfd/i386linux.c index a5bb77db12d..03a2dbe71b4 100644 --- a/bfd/i386linux.c +++ b/bfd/i386linux.c @@ -1,6 +1,6 @@ /* BFD back-end for linux flavored i386 a.out binaries. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007, 2008, 2009, 2011 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -435,9 +435,6 @@ linux_tally_symbols (h, data) struct linux_link_hash_entry *h1, *h2; bfd_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 && CONST_STRNEQ (h->root.root.root.string, NEEDS_SHRLIB)) { diff --git a/bfd/libcoff-in.h b/bfd/libcoff-in.h index 9d24748b898..1b651514760 100644 --- a/bfd/libcoff-in.h +++ b/bfd/libcoff-in.h @@ -1,6 +1,6 @@ /* BFD COFF object file private structure. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Written by Cygnus Support. @@ -559,7 +559,7 @@ extern bfd_boolean _bfd_coff_generic_relocate_section extern struct bfd_hash_entry *_bfd_coff_debug_merge_hash_newfunc (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); extern bfd_boolean _bfd_coff_write_global_sym - (struct coff_link_hash_entry *, void *); + (struct bfd_hash_entry *, void *); extern bfd_boolean _bfd_coff_write_task_globals (struct coff_link_hash_entry *, void *); extern bfd_boolean _bfd_coff_link_input_bfd diff --git a/bfd/libcoff.h b/bfd/libcoff.h index 4f73f109de8..37b05d19701 100644 --- a/bfd/libcoff.h +++ b/bfd/libcoff.h @@ -4,7 +4,7 @@ /* BFD COFF object file private structure. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Written by Cygnus Support. @@ -563,7 +563,7 @@ extern bfd_boolean _bfd_coff_generic_relocate_section extern struct bfd_hash_entry *_bfd_coff_debug_merge_hash_newfunc (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); extern bfd_boolean _bfd_coff_write_global_sym - (struct coff_link_hash_entry *, void *); + (struct bfd_hash_entry *, void *); extern bfd_boolean _bfd_coff_write_task_globals (struct coff_link_hash_entry *, void *); extern bfd_boolean _bfd_coff_link_input_bfd diff --git a/bfd/linker.c b/bfd/linker.c index bac541799ff..e472317b791 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -604,21 +604,32 @@ bfd_wrapped_link_hash_lookup (bfd *abfd, return bfd_link_hash_lookup (info->hash, string, create, copy, follow); } -/* Traverse a generic link hash table. The only reason this is not a - macro is to do better type checking. This code presumes that an - argument passed as a struct bfd_hash_entry * may be caught as a - struct bfd_link_hash_entry * with no explicit cast required on the - call. */ +/* Traverse a generic link hash table. Differs from bfd_hash_traverse + in the treatment of warning symbols. When warning symbols are + created they replace the real symbol, so you don't get to see the + real symbol in a bfd_hash_travere. This traversal calls func with + the real symbol. */ void bfd_link_hash_traverse - (struct bfd_link_hash_table *table, + (struct bfd_link_hash_table *htab, bfd_boolean (*func) (struct bfd_link_hash_entry *, void *), void *info) { - bfd_hash_traverse (&table->table, - (bfd_boolean (*) (struct bfd_hash_entry *, void *)) func, - info); + unsigned int i; + + htab->table.frozen = 1; + for (i = 0; i < htab->table.size; i++) + { + struct bfd_link_hash_entry *p; + + p = (struct bfd_link_hash_entry *) htab->table.table[i]; + for (; p != NULL; p = (struct bfd_link_hash_entry *) p->root.next) + if (!(*func) (p->type == bfd_link_hash_warning ? p->u.i.link : p, info)) + goto out; + } + out: + htab->table.frozen = 0; } /* Add a symbol to the linker hash table undefs list. */ @@ -2442,9 +2453,6 @@ _bfd_generic_link_write_global_symbol (struct generic_link_hash_entry *h, (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; @@ -3095,9 +3103,6 @@ fix_syms (struct bfd_link_hash_entry *h, void *data) { bfd *obfd = (bfd *) data; - if (h->type == bfd_link_hash_warning) - h = h->u.i.link; - if (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak) { diff --git a/bfd/m68klinux.c b/bfd/m68klinux.c index 08b0010627c..ab5a4563ab0 100644 --- a/bfd/m68klinux.c +++ b/bfd/m68klinux.c @@ -1,6 +1,7 @@ /* BFD back-end for linux flavored m68k a.out binaries. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -439,9 +440,6 @@ linux_tally_symbols (h, data) struct linux_link_hash_entry *h1, *h2; bfd_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 && CONST_STRNEQ (h->root.root.root.string, NEEDS_SHRLIB)) { diff --git a/bfd/pdp11.c b/bfd/pdp11.c index 8cb87e4a72e..e815a4304f2 100644 --- a/bfd/pdp11.c +++ b/bfd/pdp11.c @@ -2892,8 +2892,9 @@ aout_link_includes_newfunc (struct bfd_hash_entry *entry, } static bfd_boolean -aout_link_write_other_symbol (struct aout_link_hash_entry *h, void * data) +aout_link_write_other_symbol (struct bfd_hash_entry *bh, void *data) { + struct aout_link_hash_entry *h = (struct aout_link_hash_entry *) bh; struct aout_final_link_info *finfo = (struct aout_final_link_info *) data; bfd *output_bfd; int type; @@ -3056,7 +3057,7 @@ aout_link_reloc_link_order (struct aout_final_link_info *finfo, symbol. */ h->indx = -2; h->written = FALSE; - if (! aout_link_write_other_symbol (h, (void *) finfo)) + if (!aout_link_write_other_symbol (&h->root.root, finfo)) return FALSE; r_index = h->indx; } @@ -3335,8 +3336,8 @@ pdp11_aout_link_input_section (struct aout_final_link_info *finfo, { h->indx = -2; h->written = FALSE; - if (! aout_link_write_other_symbol (h, - (void *) finfo)) + if (!aout_link_write_other_symbol (&h->root.root, + finfo)) return FALSE; } r_index = h->indx; @@ -3799,7 +3800,7 @@ NAME (aout, final_link) (bfd *abfd, h = aout_link_hash_lookup (aout_hash_table (info), "__DYNAMIC", FALSE, FALSE, FALSE); if (h != NULL) - aout_link_write_other_symbol (h, &aout_info); + aout_link_write_other_symbol (&h->root.root, &aout_info); } /* The most time efficient way to do the link would be to read all @@ -3871,9 +3872,9 @@ NAME (aout, final_link) (bfd *abfd, } /* Write out any symbols that we have not already written out. */ - aout_link_hash_traverse (aout_hash_table (info), - aout_link_write_other_symbol, - (void *) &aout_info); + bfd_hash_traverse (&info->hash->table, + aout_link_write_other_symbol, + &aout_info); /* Now handle any relocs we were asked to create by the linker. These did not come from any input file. We must do these after diff --git a/bfd/sparclinux.c b/bfd/sparclinux.c index 7bb10d8e03b..b7fef220643 100644 --- a/bfd/sparclinux.c +++ b/bfd/sparclinux.c @@ -1,6 +1,7 @@ /* BFD back-end for linux flavored sparc a.out binaries. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -433,9 +434,6 @@ linux_tally_symbols (struct linux_link_hash_entry *h, void * data) struct linux_link_hash_entry *h1, *h2; bfd_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 && CONST_STRNEQ (h->root.root.root.string, NEEDS_SHRLIB)) { diff --git a/bfd/sunos.c b/bfd/sunos.c index 67880b2ce62..8ef25edbb1c 100644 --- a/bfd/sunos.c +++ b/bfd/sunos.c @@ -1,6 +1,6 @@ /* BFD backend for SunOS binaries. Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011 Free Software Foundation, Inc. Written by Cygnus Support. @@ -1749,9 +1749,6 @@ sunos_scan_dynamic_symbol (struct sunos_link_hash_entry *h, void * data) { 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 diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c index 45828c75294..92bf444f231 100644 --- a/bfd/vms-alpha.c +++ b/bfd/vms-alpha.c @@ -8600,21 +8600,31 @@ alpha_vms_build_fixups (struct bfd_link_info *info) return TRUE; } -/* Called by bfd_link_hash_traverse to fill the symbol table. +/* Called by bfd_hash_traverse to fill the symbol table. Return FALSE in case of failure. */ static bfd_boolean -alpha_vms_link_output_symbol (struct bfd_link_hash_entry *hc, void *infov) +alpha_vms_link_output_symbol (struct bfd_hash_entry *bh, void *infov) { + struct bfd_link_hash_entry *hc = (struct bfd_link_hash_entry *) bh; struct bfd_link_info *info = (struct bfd_link_info *)infov; - struct alpha_vms_link_hash_entry *h = (struct alpha_vms_link_hash_entry *)hc; + struct alpha_vms_link_hash_entry *h; struct vms_symbol_entry *sym; + if (hc->type == bfd_link_hash_warning) + { + hc = hc->u.i.link; + if (hc->type == bfd_link_hash_new) + return TRUE; + } + h = (struct alpha_vms_link_hash_entry *) hc; + switch (h->root.type) { case bfd_link_hash_undefined: return TRUE; case bfd_link_hash_new: + case bfd_link_hash_warning: abort (); case bfd_link_hash_undefweak: return TRUE; @@ -8634,7 +8644,6 @@ alpha_vms_link_output_symbol (struct bfd_link_hash_entry *hc, void *infov) case bfd_link_hash_common: break; case bfd_link_hash_indirect: - case bfd_link_hash_warning: return TRUE; } @@ -8740,7 +8749,7 @@ alpha_vms_bfd_final_link (bfd *abfd, struct bfd_link_info *info) /* Generate the symbol table. */ BFD_ASSERT (PRIV (syms) == NULL); if (info->strip != strip_all) - bfd_link_hash_traverse (info->hash, alpha_vms_link_output_symbol, info); + bfd_hash_traverse (&info->hash->table, alpha_vms_link_output_symbol, info); /* Find the entry point. */ if (bfd_get_start_address (abfd) == 0) diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index 4308b186988..4adfb174669 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -3354,9 +3354,6 @@ xcoff_post_gc_symbol (struct xcoff_link_hash_entry *h, void * p) { struct xcoff_loader_info *ldinfo = (struct xcoff_loader_info *) p; - 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; @@ -5152,8 +5149,9 @@ xcoff_find_tc0 (bfd *output_bfd, struct xcoff_final_link_info *flinfo) /* Write out a non-XCOFF global symbol. */ static bfd_boolean -xcoff_write_global_symbol (struct xcoff_link_hash_entry *h, void * inf) +xcoff_write_global_symbol (struct bfd_hash_entry *bh, void * inf) { + struct xcoff_link_hash_entry *h = (struct xcoff_link_hash_entry *) bh; struct xcoff_final_link_info *flinfo = (struct xcoff_final_link_info *) inf; bfd *output_bfd; bfd_byte *outsym; @@ -6237,9 +6235,7 @@ _bfd_xcoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info) /* Write out all the global symbols which do not come from XCOFF input files. */ - xcoff_link_hash_traverse (xcoff_hash_table (info), - xcoff_write_global_symbol, - (void *) &flinfo); + bfd_hash_traverse (&info->hash->table, xcoff_write_global_symbol, &flinfo); if (flinfo.outsyms != NULL) {