Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame^] | 1 | From 2ea146401a9aed9e3b6cc07e1b6c0f81e5a0527c Mon Sep 17 00:00:00 2001 |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 2 | From: Nagaraju Mekala <nmekala@xilix.com> |
| 3 | Date: Mon, 15 Jun 2015 16:50:30 +0530 |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame^] | 4 | Subject: [PATCH 07/43] Fix bug in TLSTPREL Relocation |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 5 | |
| 6 | Fixed the problem related to the fixup/relocations TLSTPREL. |
| 7 | When the fixup is applied the addend is not added at the correct offset |
| 8 | of the instruction. The offset is hard coded considering its big endian |
| 9 | and it fails for Little endian. This patch allows support for both |
| 10 | big & little-endian compilers |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 11 | --- |
| 12 | bfd/elf32-microblaze.c | 4 ++-- |
| 13 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 14 | |
| 15 | diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame^] | 16 | index 1c69c269c7..d19a6dca84 100644 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 17 | --- a/bfd/elf32-microblaze.c |
| 18 | +++ b/bfd/elf32-microblaze.c |
| 19 | @@ -1451,9 +1451,9 @@ microblaze_elf_relocate_section (bfd *output_bfd, |
| 20 | 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 Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame^] | 31 | -- |
| 32 | 2.17.1 |
| 33 | |