diff options
author | Alan Modra <amodra@gmail.com> | 2017-10-28 14:10:55 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2017-10-28 22:11:40 +1030 |
commit | c0e331c794d6bd75d9be9bea6145513074c33f39 (patch) | |
tree | 6f6ad19925ad01938e4429d3fbdd9c3328909b3f /bfd/elf32-ppc.c | |
parent | bac608e7e11fa83a648c0980883f810ebd1874b1 (diff) | |
download | fsf-binutils-gdb-c0e331c794d6bd75d9be9bea6145513074c33f39.zip fsf-binutils-gdb-c0e331c794d6bd75d9be9bea6145513074c33f39.tar.gz fsf-binutils-gdb-c0e331c794d6bd75d9be9bea6145513074c33f39.tar.bz2 |
PR22300, Abort in elf32_hppa_relocate_section building polyml
polyml produces object files with the wrong OS/ABI for hppa-linux.
This, along with the fact that elf32-hppa.c is using the strictest
backend relocs_compatible, results in wrong merging of ELF symbols.
So, remove the relocs_compatible check in _bfd_elf_merge_symbol.
_bfd_elf_merge_symbol is only called nowadays from within blocks
protected by is_elf_hash_table, so "we are doing an ELF link" as the
removed comment says, is true.
Also relax relocs_compatible for hppa and powerpc. relocs_compatible
is used for more than just merging symbols, as the name suggests.
This allows objects that are in fact reasonably compatible to be
linked.
PR 22300
* elflink.c (_bfd_elf_merge_symbol): Remove relocs_compatible check.
* elf32-hppa.c (elf_backend_relocs_compatible): Define.
* elf32-ppc.c (elf_backend_relocs_compatible): Define.
* elf64-ppc.c (elf_backend_relocs_compatible): Define.
Diffstat (limited to 'bfd/elf32-ppc.c')
-rw-r--r-- | bfd/elf32-ppc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index bd29377..afd233f 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -10778,6 +10778,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, #define elf_backend_relocate_section ppc_elf_relocate_section #define elf_backend_create_dynamic_sections ppc_elf_create_dynamic_sections #define elf_backend_check_relocs ppc_elf_check_relocs +#define elf_backend_relocs_compatible _bfd_elf_relocs_compatible #define elf_backend_copy_indirect_symbol ppc_elf_copy_indirect_symbol #define elf_backend_adjust_dynamic_symbol ppc_elf_adjust_dynamic_symbol #define elf_backend_add_symbol_hook ppc_elf_add_symbol_hook |