diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c56e1cf66b3..7cf5b3270c0 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2017-10-30 Alan Modra + + * elflink.c (elf_gc_sweep): Test elf_object_id in addition to + relocs_compatible. + (bfd_elf_gc_sections): Likewise. + 2017-10-30 Alan Modra PR 22269 diff --git a/bfd/elflink.c b/bfd/elflink.c index 9f2d63b2805..122549c594b 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -13034,6 +13034,7 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info) asection *o; if (bfd_get_flavour (sub) != bfd_target_elf_flavour + || elf_object_id (sub) != elf_hash_table_id (elf_hash_table (info)) || !(*bed->relocs_compatible) (sub->xvec, abfd->xvec)) continue; o = sub->sections; @@ -13335,6 +13336,7 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info) asection *o; if (bfd_get_flavour (sub) != bfd_target_elf_flavour + || elf_object_id (sub) != elf_hash_table_id (htab) || !(*bed->relocs_compatible) (sub->xvec, abfd->xvec)) continue;