summaryrefslogtreecommitdiffstats
path: root/meta-microblaze/recipes-devtools/binutils/binutils/0037-Fixing-the-imm-imml-generation-for-16-bit-argument-C.patch
blob: 5c69eed7b9667dfb50df413da082f343dfcfb1b4 (plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From 9f2319c6e32c4449604c2ec26042123a88eeb87c Mon Sep 17 00:00:00 2001
From: Mahesh Bodapati <mbodapat@xilinx.com>
Date: Mon, 24 Jan 2022 16:21:33 +0530
Subject: [PATCH 37/38] Fixing the imm/imml generation for 16 bit argument
 [CR-1115234].

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
---
 bfd/elf32-microblaze.c | 6 +++++-
 bfd/elf64-microblaze.c | 5 ++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
index e284b0e5398..8b947a6ec79 100644
--- a/bfd/elf32-microblaze.c
+++ b/bfd/elf32-microblaze.c
@@ -2016,7 +2016,11 @@ microblaze_elf_relax_section (bfd *abfd,
       else
 	symval += irel->r_addend;
 
-      if ((symval & 0xffff8000) == 0)
+      /* Check for imm command argument value to decide if
+       * we need full 32-bit value for next command */
+      if ((symval & 0xffff8000) == 0
+	  || (symval & 0xffff8000) == 0xffff8000)
+
 	{
 	  /* We can delete this instruction.  */
 	  sdata->relax[sdata->relax_count].addr = irel->r_offset;
diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
index 3b6e6aa47bd..cecfb5506f8 100644
--- a/bfd/elf64-microblaze.c
+++ b/bfd/elf64-microblaze.c
@@ -2011,7 +2011,10 @@ microblaze_elf_relax_section (bfd *abfd,
       else
 	symval += irel->r_addend;
 
-      if ((symval & 0xffff8000) == 0)
+      /* Check for imm command argument value to decide if
+       * we need full 32-bit value for next command */
+      if ((symval & 0xffff8000) == 0
+	  || (symval & 0xffff8000) == 0xffff8000)
 	{
           /* We can delete this instruction.  */
           sdata->relax[sdata->relax_count].addr = irel->r_offset;
-- 
2.25.1