blob: 472aa0cf8011928ea2a58a4027ddfdc37a28461d [file] [log] [blame]
Brad Bishop26bdd442019-08-16 17:08:17 -04001From 1367d2933de24720fa24032947f784b72b54e974 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Mon, 15 Jun 2015 16:50:30 +0530
4Subject: [PATCH] Fix bug in TLSTPREL Relocation
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08005
6Fixed the problem related to the fixup/relocations TLSTPREL.
7When the fixup is applied the addend is not added at the correct offset
8of the instruction. The offset is hard coded considering its big endian
9and it fails for Little endian. This patch allows support for both
10big & little-endian compilers
11
12Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080013
14---
15 bfd/elf32-microblaze.c | 4 ++--
16 1 file changed, 2 insertions(+), 2 deletions(-)
17
18diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
Brad Bishop26bdd442019-08-16 17:08:17 -040019index 1c69c26..d19a6dc 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080020--- a/bfd/elf32-microblaze.c
21+++ b/bfd/elf32-microblaze.c
22@@ -1451,9 +1451,9 @@ microblaze_elf_relocate_section (bfd *output_bfd,
23 relocation += addend;
24 relocation -= dtprel_base(info);
25 bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff,
26- contents + offset + 2);
27+ contents + offset + endian);
28 bfd_put_16 (input_bfd, relocation & 0xffff,
29- contents + offset + 2 + INST_WORD_SIZE);
30+ contents + offset + endian + INST_WORD_SIZE);
31 break;
32 case (int) R_MICROBLAZE_TEXTREL_64:
33 case (int) R_MICROBLAZE_TEXTREL_32_LO: