Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From ca0336a49c33ccb78962530f2affff8982027e8e Mon Sep 17 00:00:00 2001 |
| 2 | From: Nagaraju Mekala <nagaraju.mekala@xilinx.com> |
| 3 | Date: Mon, 28 Aug 2017 19:53:58 -0700 |
| 4 | Subject: [PATCH] Fix bug in MicroBlaze TLSTPREL Relocation |
| 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 |
| 11 | |
| 12 | Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com> |
| 13 | Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> |
| 14 | Upstream-Status: Pending |
| 15 | |
| 16 | --- |
| 17 | bfd/elf32-microblaze.c | 4 ++-- |
| 18 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 19 | |
| 20 | diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c |
| 21 | index 1dc56f7..d4e53de 100644 |
| 22 | --- a/bfd/elf32-microblaze.c |
| 23 | +++ b/bfd/elf32-microblaze.c |
| 24 | @@ -1451,9 +1451,9 @@ microblaze_elf_relocate_section (bfd *output_bfd, |
| 25 | relocation += addend; |
| 26 | relocation -= dtprel_base(info); |
| 27 | bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff, |
| 28 | - contents + offset + 2); |
| 29 | + contents + offset + endian); |
| 30 | bfd_put_16 (input_bfd, relocation & 0xffff, |
| 31 | - contents + offset + 2 + INST_WORD_SIZE); |
| 32 | + contents + offset + endian + INST_WORD_SIZE); |
| 33 | break; |
| 34 | case (int) R_MICROBLAZE_TEXTREL_64: |
| 35 | case (int) R_MICROBLAZE_TEXTREL_32_LO: |