aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-08-22 01:27:20 +0000
committerAlan Modra <amodra@gmail.com>2002-08-22 01:27:20 +0000
commitb48fa14c8688f60dffc6f64c253aaf1b73e3e04a (patch)
treecf9bfd13e19ddbcdd015d62ca2b3de8929fb061f /bfd/elf.c
parentf43d77f5e130299c2142238bbda23d626be0ad93 (diff)
downloadgdb-b48fa14c8688f60dffc6f64c253aaf1b73e3e04a.zip
gdb-b48fa14c8688f60dffc6f64c253aaf1b73e3e04a.tar.gz
gdb-b48fa14c8688f60dffc6f64c253aaf1b73e3e04a.tar.bz2
* elf-bfd.h (struct elf_backend_data): Add struct elf_backend_data
param to elf_backend_copy_indirect_symbol. (_bfd_elf_link_hash_copy_indirect): Likewise. * elflink.h (elf_add_default_symbol, elf_fix_symbol_flags): Adjust calls to copy_indirect_symbol. * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise. * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise. * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise. * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise. * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise. * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise. * elfxx-mips.h (_bfd_mips_elf_copy_indirect_symbol): Likewise. * elf.c (_bfd_elf_link_hash_copy_indirect): Likewise. Properly test refcounts for "used" values.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index a9db43b..71763d4 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1418,10 +1418,12 @@ _bfd_elf_link_hash_newfunc (entry, table, string)
old indirect symbol. Also used for copying flags to a weakdef. */
void
-_bfd_elf_link_hash_copy_indirect (dir, ind)
+_bfd_elf_link_hash_copy_indirect (bed, dir, ind)
+ struct elf_backend_data *bed;
struct elf_link_hash_entry *dir, *ind;
{
bfd_signed_vma tmp;
+ bfd_signed_vma lowest_valid = bed->can_refcount;
/* Copy down any references that we may have already seen to the
symbol which just became indirect. */
@@ -1439,22 +1441,22 @@ _bfd_elf_link_hash_copy_indirect (dir, ind)
/* Copy over the global and procedure linkage table refcount entries.
These may have been already set up by a check_relocs routine. */
tmp = dir->got.refcount;
- if (tmp <= 0)
+ if (tmp < lowest_valid)
{
dir->got.refcount = ind->got.refcount;
ind->got.refcount = tmp;
}
else
- BFD_ASSERT (ind->got.refcount <= 0);
+ BFD_ASSERT (ind->got.refcount < lowest_valid);
tmp = dir->plt.refcount;
- if (tmp <= 0)
+ if (tmp < lowest_valid)
{
dir->plt.refcount = ind->plt.refcount;
ind->plt.refcount = tmp;
}
else
- BFD_ASSERT (ind->plt.refcount <= 0);
+ BFD_ASSERT (ind->plt.refcount < lowest_valid);
if (dir->dynindx == -1)
{