PowerPC64: fix assertion in ppc_build_one_stub with -Os code
authorAlan Modra <amodra@gmail.com>
Thu, 23 Jun 2022 08:20:30 +0000 (17:50 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 23 Jun 2022 08:31:59 +0000 (18:01 +0930)
save_res stubs aren't written in ppc_build_one_stub, their offsets
(which are zero) should not be checked.

* elf64-ppc.c (ppc_build_one_stub): Don't check save_res offsets.

bfd/elf64-ppc.c

index 6af33d883b3ff75811b97055e18a1f7b5e9cf0a6..04f2c1465357feb55c134572820971d38433c0bc 100644 (file)
@@ -11735,7 +11735,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
     = ppc64_elf_section_data (stub_entry->group->stub_sec);
   ++htab->stub_id;
   if (stub_entry->id != htab->stub_id
-      || stub_entry->stub_offset < stub_entry->group->stub_sec->size)
+      || (stub_entry->type.main != ppc_stub_save_res
+         && stub_entry->stub_offset < stub_entry->group->stub_sec->size))
     {
       BFD_ASSERT (0);
       if (stub_entry->id != htab->stub_id)