summaryrefslogtreecommitdiff
path: root/bfd/coff64-rs6000.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2009-03-14 09:17:32 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2009-03-14 09:17:32 +0000
commit858ef0ce3bae131931bd6f1c24fab4acb90f89df (patch)
tree77a92d90fa2042ce333d8efb8967d6d43671c267 /bfd/coff64-rs6000.c
parent9f0eb2327b9c019347ecede4da1185ad21cca8af (diff)
downloadbinutils-gdb-858ef0ce3bae131931bd6f1c24fab4acb90f89df.tar.gz
include/coff/
* xcoff.h (XCOFF_CALLED, XCOFF_IMPORT): Update comments. (XCOFF_WAS_UNDEFINED): New flag. (xcoff_link_hash_table): Add an "rtld" field. bfd/ * coff-rs6000.c (xcoff_ppc_relocate_section): Report relocations against undefined symbols if the symbol's XCOFF_WAS_UNDEFINED flag is set. Assert that all undefined symbols are either imported or defined by a dynamic object. * coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise. * xcofflink.c (xcoff_link_add_symbols): Extend function-symbol handling to all relocations. Only set XCOFF_CALLED for function symbols. (xcoff_find_function): New function, split out from... (bfd_xcoff_export_symbol) ...here. (xcoff_set_import_path): New function, split out from... (bfd_xcoff_import_symbol): ...here. Remove assertion for old meaning of XCOFF_CALLED. (xcoff_mark_symbol): If we mark an undefined and unimported symbol, find some way of defining it. If the symbol is a function descriptor, fill in its definition automatically. If the symbol is a function, mark its descriptor and allocate room for global linkage code. Otherwise mark the symbol as implicitly imported. Move the code for creating function descriptors from... (xcoff_build_ldsyms): ...here. Use XCOFF_WAS_UNDEFINED to check for symbols that were implicitly defined. (xcoff_mark): Don't count any dynamic relocations against function symbols. (bfd_xcoff_size_dynamic_sections): Save the rtld parameter in the xcoff link info. (xcoff_link_input_bfd): Remove handling of undefined and unexported symbols. ld/ * emultempl/aix.em (gld${EMULATION_NAME}_handle_option): Make -berok and -bernotok control link_info.unresolved_syms_in_objects and link_info.unresolved_syms_in_shared_libs instead of force_make_executable. ld/testsuite/ * ld-powerpc/aix-glink-1.ex, ld-powerpc/aix-glink-1.s, ld-powerpc/aix-glink-1-32.dd, ld-powerpc/aix-glink-1-64.dd, ld-powerpc/aix-glink-1-32.d, ld-powerpc/aix-glink-1-64.d: New tests. * ld-powerpc/aix52.exp: Run them.
Diffstat (limited to 'bfd/coff64-rs6000.c')
-rw-r--r--bfd/coff64-rs6000.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c
index 71a02c237be..6be1583a4be 100644
--- a/bfd/coff64-rs6000.c
+++ b/bfd/coff64-rs6000.c
@@ -1293,6 +1293,17 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd,
}
else
{
+ if (info->unresolved_syms_in_objects != RM_IGNORE
+ && (h->flags & XCOFF_WAS_UNDEFINED) != 0)
+ {
+ if (! ((*info->callbacks->undefined_symbol)
+ (info, h->root.root.string,
+ input_bfd, input_section,
+ rel->r_vaddr - input_section->vma,
+ (info->unresolved_syms_in_objects
+ == RM_GENERATE_ERROR))))
+ return FALSE;
+ }
if (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
{
@@ -1307,17 +1318,11 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd,
val = (sec->output_section->vma
+ sec->output_offset);
}
- else if ((0 == (h->flags & (XCOFF_DEF_DYNAMIC | XCOFF_IMPORT)))
- && ! info->relocatable)
+ else
{
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma, TRUE)))
- return FALSE;
-
- /* Don't try to process the reloc. It can't help, and
- it may generate another error. */
- continue;
+ BFD_ASSERT (info->relocatable
+ || (h->flags & XCOFF_DEF_DYNAMIC) != 0
+ || (h->flags & XCOFF_IMPORT) != 0);
}
}
}