]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
PR22300, Abort in elf32_hppa_relocate_section building polyml
authorAlan Modra <amodra@gmail.com>
Sat, 28 Oct 2017 03:40:55 +0000 (14:10 +1030)
committerAlan Modra <amodra@gmail.com>
Sat, 28 Oct 2017 11:41:40 +0000 (22:11 +1030)
commitc0e331c794d6bd75d9be9bea6145513074c33f39
tree6f6ad19925ad01938e4429d3fbdd9c3328909b3f
parentbac608e7e11fa83a648c0980883f810ebd1874b1
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.
bfd/ChangeLog
bfd/elf32-hppa.c
bfd/elf32-ppc.c
bfd/elf64-ppc.c
bfd/elflink.c