diff options
Diffstat (limited to 'meta-microblaze/recipes-devtools/binutils/binutils/0019-fixing-the-.bss-relocation-issue.patch')
-rw-r--r-- | meta-microblaze/recipes-devtools/binutils/binutils/0019-fixing-the-.bss-relocation-issue.patch | 117 |
1 files changed, 0 insertions, 117 deletions
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0019-fixing-the-.bss-relocation-issue.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0019-fixing-the-.bss-relocation-issue.patch deleted file mode 100644 index 69aaa651..00000000 --- a/meta-microblaze/recipes-devtools/binutils/binutils/0019-fixing-the-.bss-relocation-issue.patch +++ /dev/null | |||
@@ -1,117 +0,0 @@ | |||
1 | From 35e89c09636e2ce2f5eafcf62941d15ece79a172 Mon Sep 17 00:00:00 2001 | ||
2 | From: Nagaraju Mekala <nmekala@xilix.com> | ||
3 | Date: Wed, 24 Oct 2018 12:34:37 +0530 | ||
4 | Subject: [PATCH 19/34] fixing the .bss relocation issue | ||
5 | |||
6 | Conflicts: | ||
7 | bfd/elf64-microblaze.c | ||
8 | |||
9 | Conflicts: | ||
10 | bfd/elf64-microblaze.c | ||
11 | Upstream-Status: Pending | ||
12 | |||
13 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
14 | |||
15 | --- | ||
16 | bfd/elf64-microblaze.c | 41 +++++++++++++++++++++++++++++------------ | ||
17 | 1 file changed, 29 insertions(+), 12 deletions(-) | ||
18 | |||
19 | diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c | ||
20 | index 355e9131987..eb7f9138884 100644 | ||
21 | --- a/bfd/elf64-microblaze.c | ||
22 | +++ b/bfd/elf64-microblaze.c | ||
23 | @@ -1555,14 +1555,14 @@ microblaze_elf_relocate_section (bfd *output_bfd, | ||
24 | bfd_put_16 (input_bfd, relocation & 0xffff, | ||
25 | contents + offset + endian); | ||
26 | |||
27 | - unsigned long insn = bfd_get_32 (input_bfd, contents + offset +endian); | ||
28 | - if (insn == 0xb2000000 || insn == 0xb2ffffff) | ||
29 | - { | ||
30 | - insn &= ~0x00ffffff; | ||
31 | - insn |= (relocation >> 16) & 0xffffff; | ||
32 | - bfd_put_32 (input_bfd, insn, | ||
33 | - contents + offset + endian); | ||
34 | - } | ||
35 | + unsigned long insn = bfd_get_32 (input_bfd, contents + offset +endian); | ||
36 | + if ((insn & 0xff000000) == 0xb2000000) | ||
37 | + { | ||
38 | + insn &= ~0x00ffffff; | ||
39 | + insn |= (relocation >> 16) & 0xffffff; | ||
40 | + bfd_put_32 (input_bfd, insn, | ||
41 | + contents + offset + endian); | ||
42 | + } | ||
43 | else | ||
44 | { | ||
45 | bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff, | ||
46 | @@ -1673,7 +1673,7 @@ microblaze_elf_relocate_section (bfd *output_bfd, | ||
47 | contents + offset + endian); | ||
48 | } | ||
49 | unsigned long insn = bfd_get_32 (input_bfd, contents + offset +endian); | ||
50 | - if (insn == 0xb2000000 || insn == 0xb2ffffff) | ||
51 | + if ((insn & 0xff000000) == 0xb2000000) | ||
52 | { | ||
53 | insn &= ~0x00ffffff; | ||
54 | insn |= (relocation >> 16) & 0xffffff; | ||
55 | @@ -1791,7 +1791,7 @@ microblaze_bfd_write_imm_value_32 (bfd *abfd, bfd_byte *bfd_addr, bfd_vma val) | ||
56 | { | ||
57 | unsigned long instr = bfd_get_32 (abfd, bfd_addr); | ||
58 | |||
59 | - if (instr == 0xb2000000 || instr == 0xb2ffffff) | ||
60 | + if ((instr & 0xff000000) == 0xb2000000) | ||
61 | { | ||
62 | instr &= ~0x00ffffff; | ||
63 | instr |= (val & 0xffffff); | ||
64 | @@ -1814,7 +1814,7 @@ microblaze_bfd_write_imm_value_64 (bfd *abfd, bfd_byte *bfd_addr, bfd_vma val) | ||
65 | unsigned long instr_lo; | ||
66 | |||
67 | instr_hi = bfd_get_32 (abfd, bfd_addr); | ||
68 | - if (instr_hi == 0xb2000000 || instr_hi == 0xb2ffffff) | ||
69 | + if ((instr_hi & 0xff000000) == 0xb2000000) | ||
70 | { | ||
71 | instr_hi &= ~0x00ffffff; | ||
72 | instr_hi |= (val >> 16) & 0xffffff; | ||
73 | @@ -2294,6 +2294,8 @@ microblaze_elf_relax_section (bfd *abfd, | ||
74 | if (isym->st_shndx == shndx | ||
75 | && (ELF64_ST_TYPE (isym->st_info) == STT_SECTION)) | ||
76 | { | ||
77 | + bfd_vma immediate; | ||
78 | + | ||
79 | if (ocontents == NULL) | ||
80 | { | ||
81 | if (elf_section_data (o)->this_hdr.contents != NULL) | ||
82 | @@ -2316,8 +2318,20 @@ microblaze_elf_relax_section (bfd *abfd, | ||
83 | elf_section_data (o)->this_hdr.contents = ocontents; | ||
84 | } | ||
85 | } | ||
86 | + unsigned long instr_hi = bfd_get_32 (abfd, ocontents | ||
87 | + + irelscan->r_offset); | ||
88 | + unsigned long instr_lo = bfd_get_32 (abfd, ocontents | ||
89 | + + irelscan->r_offset | ||
90 | + + INST_WORD_SIZE); | ||
91 | + if ((instr_hi & 0xff000000) == 0xb2000000) | ||
92 | + immediate = (instr_hi & 0x00ffffff) << 24; | ||
93 | + else | ||
94 | + immediate = (instr_hi & 0x0000ffff) << 16; | ||
95 | + immediate |= (instr_lo & 0x0000ffff); | ||
96 | offset = calc_fixup (irelscan->r_addend, 0, sec); | ||
97 | + immediate -= offset; | ||
98 | irelscan->r_addend -= offset; | ||
99 | + | ||
100 | } | ||
101 | } | ||
102 | else if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_PCREL) | ||
103 | @@ -2357,7 +2371,10 @@ microblaze_elf_relax_section (bfd *abfd, | ||
104 | unsigned long instr_lo = bfd_get_32 (abfd, ocontents | ||
105 | + irelscan->r_offset | ||
106 | + INST_WORD_SIZE); | ||
107 | - immediate = (instr_hi & 0x0000ffff) << 16; | ||
108 | + if ((instr_hi & 0xff000000) == 0xb2000000) | ||
109 | + immediate = (instr_hi & 0x00ffffff) << 24; | ||
110 | + else | ||
111 | + immediate = (instr_hi & 0x0000ffff) << 16; | ||
112 | immediate |= (instr_lo & 0x0000ffff); | ||
113 | target_address = immediate; | ||
114 | offset = calc_fixup (target_address, 0, sec); | ||
115 | -- | ||
116 | 2.37.1 (Apple Git-137.1) | ||
117 | |||