public inbox for binutils-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb/binutils-2_38-branch] PowerPC64: fix assertion in ppc_build_one_stub with -Os code
@ 2022-06-23 10:03 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-06-23 10:03 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=97dd8079feb35456d7b387a594b5e00f7654b3b8

commit 97dd8079feb35456d7b387a594b5e00f7654b3b8
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Jun 23 17:50:30 2022 +0930

    PowerPC64: fix assertion in ppc_build_one_stub with -Os code
    
    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)

Diff:
---
 bfd/elf64-ppc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index cb12ed476d8..df503341fe9 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-23 10:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23 10:03 [binutils-gdb/binutils-2_38-branch] PowerPC64: fix assertion in ppc_build_one_stub with -Os code Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).