summaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2001-10-15 07:28:45 +0000
committerAlan Modra <amodra@bigpond.net.au>2001-10-15 07:28:45 +0000
commit75e86fd846e2f471bd72ffe1ea168f4c195a2e39 (patch)
treee2797c4025e82b209ac1c37df0bdedcbbe1645f8 /bfd/elf32-i386.c
parent2a39a8e269fee82cce00097b6a67982a996877eb (diff)
downloadgdb-75e86fd846e2f471bd72ffe1ea168f4c195a2e39.tar.gz
* elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Merge dyn_reloc
counts for aliases instead of aborting. * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set plt.offset to -1 for non-function symbols. * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise. * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise. * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. * elf64-x86-64.c (elf64_x86_64_adjust_dynamic_symbol): Likewise. * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Refer to plt.offset instead of plt.refcount when setting to -1.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index e2493044767..f5e64555b10 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -637,13 +637,39 @@ elf_i386_copy_indirect_symbol (dir, ind)
edir = (struct elf_i386_link_hash_entry *) dir;
eind = (struct elf_i386_link_hash_entry *) ind;
- if (edir->dyn_relocs == NULL)
+ if (eind->dyn_relocs != NULL)
{
+ if (edir->dyn_relocs != NULL)
+ {
+ struct elf_i386_dyn_relocs **pp;
+ struct elf_i386_dyn_relocs *p;
+
+ if (dir != ind->weakdef)
+ abort ();
+
+ /* Add reloc counts against the weak sym to the strong sym
+ list. Merge any entries against the same section. */
+ for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+ {
+ struct elf_i386_dyn_relocs *q;
+
+ for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ if (q->sec == p->sec)
+ {
+ q->pc_count += p->pc_count;
+ q->count += p->count;
+ *pp = p->next;
+ break;
+ }
+ if (q == NULL)
+ pp = &p->next;
+ }
+ *pp = edir->dyn_relocs;
+ }
+
edir->dyn_relocs = eind->dyn_relocs;
eind->dyn_relocs = NULL;
}
- else if (eind->dyn_relocs != NULL)
- abort ();
_bfd_elf_link_hash_copy_indirect (dir, ind);
}
@@ -1086,7 +1112,7 @@ elf_i386_adjust_dynamic_symbol (info, h)
object, or if all references were garbage collected. In
such a case, we don't actually need to build a procedure
linkage table, and we can just do a PC32 reloc instead. */
- h->plt.refcount = -1;
+ h->plt.offset = (bfd_vma) -1;
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
}
@@ -1098,7 +1124,7 @@ elf_i386_adjust_dynamic_symbol (info, h)
check_relocs. We can't decide accurately between function and
non-function syms in check-relocs; Objects loaded later in
the link may change h->type. So fix it now. */
- h->plt.refcount = -1;
+ h->plt.offset = (bfd_vma) -1;
/* If this is a weak symbol, and there is a real definition, the
processor independent code will have arranged for us to see the