diff options
author | Nick Clifton <nickc@redhat.com> | 2003-08-20 08:37:19 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2003-08-20 08:37:19 +0000 |
commit | efb10ab591f3a4fd3a5c759e4b63f138154954ec (patch) | |
tree | ad1ee41b1fd2f50220f00284e1b94bb50e8c48b7 /bfd/elf32-sh.c | |
parent | bc93f304f60dae931ab194e929956485b5d659dc (diff) | |
download | binutils-redhat-efb10ab591f3a4fd3a5c759e4b63f138154954ec.tar.gz |
Better handking for unresolved symbols
Diffstat (limited to 'bfd/elf32-sh.c')
-rw-r--r-- | bfd/elf32-sh.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index b509536e47..368bbca37a 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -4663,6 +4663,8 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, } else { + /* FIXME: Ought to make use of the RELOC_FOR_GLOBAL_SYMBOL macro. */ + /* Section symbol are never (?) placed in the hash table, so we can just ignore hash relocations when creating a relocatable object file. */ @@ -4765,16 +4767,17 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; else if (! info->executable - && ! info->no_undefined + && info->unresolved_syms_in_objects == RM_IGNORE && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; 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))))) + if (! info->callbacks->undefined_symbol + (info, h->root.root.string, input_bfd, + input_section, rel->r_offset, + ((info->shared && info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR) + || (!info->shared && info->unresolved_syms_in_objects == RM_GENERATE_ERROR) + || ELF_ST_VISIBILITY (h->other)))) return FALSE; relocation = 0; } |