blob: fcbd662e106b1ff2103c97bbb3c97f9147932000 [file] [log] [blame]
Andrew Geissler10fa1492020-12-11 16:25:29 -06001From 4e8bd012d3025a6f6b2b2794930f1bfbad7932e8 Mon Sep 17 00:00:00 2001
Brad Bishop26bdd442019-08-16 17:08:17 -04002From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Mon, 15 Jun 2015 16:50:30 +0530
Andrew Geissler10fa1492020-12-11 16:25:29 -06004Subject: [PATCH 06/52] 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
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080011---
12 bfd/elf32-microblaze.c | 4 ++--
13 1 file changed, 2 insertions(+), 2 deletions(-)
14
15diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
Andrew Geissler10fa1492020-12-11 16:25:29 -060016index e9715eae6a..9c4f809eaa 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080017--- a/bfd/elf32-microblaze.c
18+++ b/bfd/elf32-microblaze.c
Andrew Geisslera9ff2b32020-10-16 10:11:54 -050019@@ -1447,9 +1447,9 @@ microblaze_elf_relocate_section (bfd *output_bfd,
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080020 relocation += addend;
21 relocation -= dtprel_base(info);
22 bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff,
23- contents + offset + 2);
24+ contents + offset + endian);
25 bfd_put_16 (input_bfd, relocation & 0xffff,
26- contents + offset + 2 + INST_WORD_SIZE);
27+ contents + offset + endian + INST_WORD_SIZE);
28 break;
29 case (int) R_MICROBLAZE_TEXTREL_64:
30 case (int) R_MICROBLAZE_TEXTREL_32_LO:
Andrew Geissler84ad7c52020-06-27 00:00:16 -050031--
322.17.1
33