aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-hppa.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-01-21 10:29:09 +0000
committerAlan Modra <amodra@gmail.com>2002-01-21 10:29:09 +0000
commite5094212dfec9f4caa6ec514019cdae92c163f2d (patch)
tree52fc1866d2c2cddcb2995dae1f3fbaa28cfa9c4a /bfd/elf32-hppa.c
parent61d99182f0a408360e238eff0bf2bc2dd5b0373f (diff)
downloadfsf-binutils-gdb-e5094212dfec9f4caa6ec514019cdae92c163f2d.zip
fsf-binutils-gdb-e5094212dfec9f4caa6ec514019cdae92c163f2d.tar.gz
fsf-binutils-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/elf32-hppa.c')
-rw-r--r--bfd/elf32-hppa.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 5dfd6f2..0acfb19 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
- Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001,
+ 2002 Free Software Foundation, Inc.
Original code by
Center for Software Science
@@ -335,7 +335,7 @@ static boolean elf32_hppa_gc_sweep_hook
asection *, const Elf_Internal_Rela *));
static void elf32_hppa_hide_symbol
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
+ PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean));
static boolean elf32_hppa_adjust_dynamic_symbol
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
@@ -1786,12 +1786,22 @@ elf32_hppa_gc_sweep_hook (abfd, info, sec, relocs)
plabels. */
static void
-elf32_hppa_hide_symbol (info, h)
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
+elf32_hppa_hide_symbol (info, h, force_local)
+ struct bfd_link_info *info;
struct elf_link_hash_entry *h;
+ boolean force_local;
{
- if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
- h->dynindx = -1;
+ if (force_local)
+ {
+ h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
+ if (h->dynindx != -1)
+ {
+ h->dynindx = -1;
+ _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr,
+ h->dynstr_index);
+ }
+ }
+
if (! ((struct elf32_hppa_link_hash_entry *) h)->plabel)
{
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
@@ -2206,12 +2216,7 @@ clobber_millicode_symbols (h, info)
if (h->type == STT_PARISC_MILLI
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
{
- struct elf32_hppa_link_hash_table *htab;
-
- h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
- elf32_hppa_hide_symbol (info, h);
- htab = hppa_link_hash_table (info);
- _bfd_elf_strtab_delref (htab->elf.dynstr, h->dynstr_index);
+ elf32_hppa_hide_symbol (info, h, true);
/* ?!? We only want to remove these from the dynamic symbol table.
Therefore we do not leave ELF_LINK_FORCED_LOCAL set. */