]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
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 09:19:41 +0000 (18:49 +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.

(cherry picked from commit 570e911f4e533fad33ad5e4e1102929cf7e80bd7)

bfd/elf64-ppc.c

index cb12ed476d8532f15130b9e515c096dc9b458415..df503341fe9d2da9ac630302ba579587f9bb9df0 100644 (file)
@@ -11700,7 +11700,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
   if (htab == NULL)
     return false;
 
-  BFD_ASSERT (stub_entry->stub_offset >= stub_entry->group->stub_sec->size);
+  BFD_ASSERT (stub_entry->stub_offset >= stub_entry->group->stub_sec->size
+             || stub_entry->type.main == ppc_stub_save_res);
   loc = stub_entry->group->stub_sec->contents + stub_entry->stub_offset;
 
   htab->stub_count[stub_entry->type.main - 1] += 1;