summaryrefslogtreecommitdiff
path: root/bfd/elf32-sparc.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-sparc.c
parentbc93f304f60dae931ab194e929956485b5d659dc (diff)
downloadbinutils-redhat-efb10ab591f3a4fd3a5c759e4b63f138154954ec.tar.gz
Better handking for unresolved symbols
Diffstat (limited to 'bfd/elf32-sparc.c')
-rw-r--r--bfd/elf32-sparc.c40
1 files changed, 5 insertions, 35 deletions
diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c
index d8ad11d77a..50d968e673 100644
--- a/bfd/elf32-sparc.c
+++ b/bfd/elf32-sparc.c
@@ -2186,42 +2186,12 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- 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 warned ATTRIBUTE_UNUSED;
- relocation = 0;
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- if (sec->output_section == NULL)
- /* Set a flag that will be cleared later if we find a
- relocation value for this symbol. output_section
- is typically NULL for symbols satisfied by a shared
- library. */
- unresolved_reloc = TRUE;
- else
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- ;
- else if (!info->executable
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- ;
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (info->executable || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
- return FALSE;
- }
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx,
+ symtab_hdr, relocation, sec,
+ unresolved_reloc, info,
+ warned);
}
switch (r_type)