diff options
author | Alan Modra <amodra@gmail.com> | 2002-01-21 10:29:09 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-01-21 10:29:09 +0000 |
commit | e5094212dfec9f4caa6ec514019cdae92c163f2d (patch) | |
tree | 52fc1866d2c2cddcb2995dae1f3fbaa28cfa9c4a /bfd/elflink.h | |
parent | 61d99182f0a408360e238eff0bf2bc2dd5b0373f (diff) | |
download | gdb-e5094212dfec9f4caa6ec514019cdae92c163f2d.zip gdb-e5094212dfec9f4caa6ec514019cdae92c163f2d.tar.gz gdb-e5094212dfec9f4caa6ec514019cdae92c163f2d.tar.bz2 |
* elf-bfd.h (elf_backend_data <elf_backend_hide_symbol>): Add
boolean param.
(_bfd_elf_link_hash_hide_symbol): Likewise.
* elflink.h (elf_link_add_object_symbols): Adjust call to
elf_backend_hide_symbol.
(elf_fix_symbol_flags): Likewise.
(elf_link_assign_sym_version): Likewise. Use bfd_malloc rather
than bfd_alloc.
* elf.c (_bfd_elf_link_hash_hide_symbol): Add "force_local" param.
Set ELF_LINK_FORCED_LOCAL and call _bfd_elf_strtab_delref.
* elf32-hppa.c (elf32_hppa_hide_symbol): Likewise.
(clobber_millicode_symbols): Adjust to suit new hide_symbol.
* elf32-cris.c (elf_cris_hide_symbol): Add "force_local" param
and adjust to suit.
* elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise, and call
_bfd_elf_link_hash_hide_symbol rather than duplicating code.
* elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r-- | bfd/elflink.h | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h index bf63192..47927d3 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -2056,10 +2056,7 @@ elf_link_add_object_symbols (abfd, info) { case STV_INTERNAL: case STV_HIDDEN: - h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - (*bed->elf_backend_hide_symbol) (info, h); - _bfd_elf_strtab_delref (hash_table->dynstr, - h->dynstr_index); + (*bed->elf_backend_hide_symbol) (info, h, true); break; } @@ -3873,16 +3870,13 @@ elf_fix_symbol_flags (h, eif) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) { struct elf_backend_data *bed; + boolean force_local; bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj); - if (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL - || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN) - { - h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - _bfd_elf_strtab_delref (elf_hash_table (eif->info)->dynstr, - h->dynstr_index); - } - (*bed->elf_backend_hide_symbol) (eif->info, h); + + force_local = (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL + || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN); + (*bed->elf_backend_hide_symbol) (eif->info, h, force_local); } /* If this is a weak defined symbol in a dynamic object, and we know @@ -4233,7 +4227,7 @@ elf_link_assign_sym_version (h, data) struct bfd_elf_version_expr *d; len = p - h->root.root.string; - alc = bfd_alloc (sinfo->output_bfd, (bfd_size_type) len); + alc = bfd_malloc ((bfd_size_type) len); if (alc == NULL) return false; strncpy (alc, h->root.root.string, len - 1); @@ -4264,10 +4258,7 @@ elf_link_assign_sym_version (h, data) && info->shared && ! info->export_dynamic) { - h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - (*bed->elf_backend_hide_symbol) (info, h); - _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr, - h->dynstr_index); + (*bed->elf_backend_hide_symbol) (info, h, true); } break; @@ -4275,7 +4266,7 @@ elf_link_assign_sym_version (h, data) } } - bfd_release (sinfo->output_bfd, alc); + free (alc); break; } } @@ -4379,10 +4370,7 @@ elf_link_assign_sym_version (h, data) && info->shared && ! info->export_dynamic) { - h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - (*bed->elf_backend_hide_symbol) (info, h); - _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr, - h->dynstr_index); + (*bed->elf_backend_hide_symbol) (info, h, true); } break; } @@ -4400,10 +4388,7 @@ elf_link_assign_sym_version (h, data) && info->shared && ! info->export_dynamic) { - h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - (*bed->elf_backend_hide_symbol) (info, h); - _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr, - h->dynstr_index); + (*bed->elf_backend_hide_symbol) (info, h, true); } } } |