]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
relocs_compatible test for gc-sections
authorAlan Modra <amodra@gmail.com>
Sun, 29 Oct 2017 23:50:29 +0000 (10:20 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 1 Nov 2017 00:56:05 +0000 (11:26 +1030)
commit5e769a82c35d580ed81a52e6fbd072841530d3f6
treee8c8898af3a372c038c69c316206561bf64cd379
parent1dac3b4518f811cc124df2040db3c5a0e9049bb3
relocs_compatible test for gc-sections

I noticed when looking at pr22300 that before calling check_relocs we
have an elf_object_id test (added for pr11933) as well as the
relocs_compatible test.  I believe backend gc_mark_hook and
gc_sweep_hook ought to be protected similarly from being confused by
unexpected relocations (for example, both elf64-ppc.c and elf32-ppc.c
use _bfd_elf_relocs_compatible, so I think it would be possible for
the ppc64 gc_mark_hook to be presented with a ppc32 relocatable
object).

* elflink.c (elf_gc_sweep): Test elf_object_id in addition to
relocs_compatible.
(bfd_elf_gc_sections): Likewise.
bfd/ChangeLog
bfd/elflink.c