blob: a4f8257d2a856e16cf3ad7200c37fc5fcb60d54b [file] [log] [blame]
Brad Bishop26bdd442019-08-16 17:08:17 -04001From ed3e6fad3e2a626fc987e9c7477f51d03d2b4512 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Wed, 28 Nov 2018 14:00:29 +0530
4Subject: [PATCH] Fixed the bug in the R_MICROBLAZE_64_NONE relocation. It was
5 adjusting only lower 16bits.
6
7Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
8Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
9
10---
11 bfd/elf32-microblaze.c | 4 ++--
12 bfd/elf64-microblaze.c | 4 ++--
13 2 files changed, 4 insertions(+), 4 deletions(-)
14
15diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
16index 035e71f..2d8c062 100644
17--- a/bfd/elf32-microblaze.c
18+++ b/bfd/elf32-microblaze.c
19@@ -2022,8 +2022,8 @@ microblaze_elf_relax_section (bfd *abfd,
20 sfix = calc_fixup (irel->r_offset + INST_WORD_SIZE, 0, sec);
21 efix = calc_fixup (target_address, 0, sec);
22 irel->r_addend -= (efix - sfix);
23- microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset
24- + INST_WORD_SIZE, irel->r_addend);
25+ microblaze_bfd_write_imm_value_64 (abfd, contents + irel->r_offset,
26+ irel->r_addend);
27 }
28 break;
29 }
30diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
31index 184b7d5..ef6a870 100644
32--- a/bfd/elf64-microblaze.c
33+++ b/bfd/elf64-microblaze.c
34@@ -2017,8 +2017,8 @@ microblaze_elf_relax_section (bfd *abfd,
35 sfix = calc_fixup (irel->r_offset + INST_WORD_SIZE, 0, sec);
36 efix = calc_fixup (target_address, 0, sec);
37 irel->r_addend -= (efix - sfix);
38- microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset
39- + INST_WORD_SIZE, irel->r_addend);
40+ microblaze_bfd_write_imm_value_64 (abfd, contents + irel->r_offset,
41+ irel->r_addend);
42 }
43 break;
44 }