aboutsummaryrefslogtreecommitdiffstats
path: root/main/binutils/binutils-ppc64le-assertion.patch
blob: cd6113e6f8b20f70b649f7e880125e345c8a6957 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 97dd8079feb35456d7b387a594b5e00f7654b3b8 Mon Sep 17 00:00:00 2001
From: Alan Modra <amodra@gmail.com>
Date: Thu, 23 Jun 2022 17:50:30 +0930
Subject: [PATCH] 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)
---
 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;
-- 
2.31.1