summaryrefslogtreecommitdiff
path: root/bfd/elf32-iq2000.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-08-20 08:37:19 +0000
committerNick Clifton <nickc@redhat.com>2003-08-20 08:37:19 +0000
commitefb10ab591f3a4fd3a5c759e4b63f138154954ec (patch)
treead1ee41b1fd2f50220f00284e1b94bb50e8c48b7 /bfd/elf32-iq2000.c
parentbc93f304f60dae931ab194e929956485b5d659dc (diff)
downloadbinutils-redhat-efb10ab591f3a4fd3a5c759e4b63f138154954ec.tar.gz
Better handking for unresolved symbols
Diffstat (limited to 'bfd/elf32-iq2000.c')
-rw-r--r--bfd/elf32-iq2000.c46
1 files changed, 6 insertions, 40 deletions
diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c
index e2a3b17aee..f85ffac843 100644
--- a/bfd/elf32-iq2000.c
+++ b/bfd/elf32-iq2000.c
@@ -618,48 +618,14 @@ iq2000_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- h = sym_hashes [r_symndx];
-
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ bfd_boolean unresolved_reloc;
+ bfd_boolean warned;
+
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx,
+ symtab_hdr, relocation,
+ sec, unresolved_reloc, info, warned);
name = h->root.root.string;
-
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
-#ifdef DEBUG
- fprintf (stderr,
- "defined: sec: %s, name: %s, value: %x + %x + %x gives: %x\n",
- sec->name, name, h->root.u.def.value,
- sec->output_section->vma, sec->output_offset, relocation);
-#endif
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- {
-#ifdef DEBUG
- fprintf (stderr, "undefined: sec: %s, name: %s\n",
- sec->name, name);
-#endif
- relocation = 0;
- }
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined))))
- return FALSE;
-#ifdef DEBUG
- fprintf (stderr, "unknown: name: %s\n", name);
-#endif
- relocation = 0;
- }
}
switch (r_type)