summaryrefslogtreecommitdiffstats
path: root/meta-microblaze/recipes-devtools/binutils/binutils/0031-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-microblaze/recipes-devtools/binutils/binutils/0031-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch')
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0031-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch146
1 files changed, 0 insertions, 146 deletions
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0031-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0031-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch
deleted file mode 100644
index 2a16e274..00000000
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0031-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch
+++ /dev/null
@@ -1,146 +0,0 @@
1From 7bddfaf3ad574aa738ab903f63a345ebde134f9e Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Mon, 24 Jan 2022 16:04:07 +0530
4Subject: [PATCH 31/34] [Patch,MicroBlaze] : Invalid data offsets (pointer)
5 after relaxation. Proposed patch from community member (dednev@rambler.ru)
6 against 2021.1 [CR-1115232]
7
8Upstream-Status: Pending
9
10Signed-off-by: Mark Hatle <mark.hatle@amd.com>
11
12---
13 bfd/elf32-microblaze.c | 18 ++++++++++++++++++
14 bfd/elf64-microblaze.c | 17 +++++++++++++++++
15 2 files changed, 35 insertions(+)
16
17diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
18index 88ac730582b..588367ebcbb 100644
19--- a/bfd/elf32-microblaze.c
20+++ b/bfd/elf32-microblaze.c
21@@ -2095,6 +2095,9 @@ microblaze_elf_relax_section (bfd *abfd,
22 {
23 unsigned int val;
24
25+ if (ELF32_R_SYM (irelscan->r_info) >= symtab_hdr->sh_info)
26+ continue;
27+
28 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
29
30 /* hax: We only do the following fixup for debug location lists. */
31@@ -2136,6 +2139,9 @@ microblaze_elf_relax_section (bfd *abfd,
32 }
33 if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32)
34 {
35+ if (ELF32_R_SYM (irelscan->r_info) >= symtab_hdr->sh_info)
36+ continue;
37+
38 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
39
40 /* Look at the reloc only if the value has been resolved. */
41@@ -2168,6 +2174,9 @@ microblaze_elf_relax_section (bfd *abfd,
42 }
43 else if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_SYM_OP_SYM)
44 {
45+ if (ELF32_R_SYM (irelscan->r_info) >= symtab_hdr->sh_info)
46+ continue;
47+
48 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
49
50 /* Look at the reloc only if the value has been resolved. */
51@@ -2205,6 +2214,9 @@ microblaze_elf_relax_section (bfd *abfd,
52 || (ELF32_R_TYPE (irelscan->r_info)
53 == (int) R_MICROBLAZE_TEXTREL_32_LO))
54 {
55+ if (ELF32_R_SYM (irelscan->r_info) >= symtab_hdr->sh_info)
56+ continue;
57+
58 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
59
60 /* Look at the reloc only if the value has been resolved. */
61@@ -2251,6 +2263,9 @@ microblaze_elf_relax_section (bfd *abfd,
62 || (ELF32_R_TYPE (irelscan->r_info)
63 == (int) R_MICROBLAZE_TEXTREL_64))
64 {
65+ if (ELF32_R_SYM (irelscan->r_info) >= symtab_hdr->sh_info)
66+ continue;
67+
68 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
69
70 /* Look at the reloc only if the value has been resolved. */
71@@ -2285,6 +2300,9 @@ microblaze_elf_relax_section (bfd *abfd,
72 }
73 else if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_PCREL)
74 {
75+ if (ELF32_R_SYM (irelscan->r_info) >= symtab_hdr->sh_info)
76+ continue;
77+
78 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
79
80 /* Look at the reloc only if the value has been resolved. */
81diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
82index 03fe9eba53a..76aec43ec7a 100644
83--- a/bfd/elf64-microblaze.c
84+++ b/bfd/elf64-microblaze.c
85@@ -2132,6 +2132,8 @@ microblaze_elf_relax_section (bfd *abfd,
86 if (1 && ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_NONE)
87 {
88 unsigned int val;
89+ if (ELF64_R_SYM (irelscan->r_info) >= symtab_hdr->sh_info)
90+ continue;
91
92 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
93
94@@ -2174,6 +2176,9 @@ microblaze_elf_relax_section (bfd *abfd,
95 if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32
96 || ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_IMML_64)
97 {
98+ if (ELF64_R_SYM (irelscan->r_info) >= symtab_hdr->sh_info)
99+ continue;
100+
101 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
102
103 /* Look at the reloc only if the value has been resolved. */
104@@ -2206,6 +2211,9 @@ microblaze_elf_relax_section (bfd *abfd,
105 }
106 else if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_SYM_OP_SYM)
107 {
108+ if (ELF64_R_SYM (irelscan->r_info) >= symtab_hdr->sh_info)
109+ continue;
110+
111 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
112
113 /* Look at the reloc only if the value has been resolved. */
114@@ -2243,6 +2251,9 @@ microblaze_elf_relax_section (bfd *abfd,
115 || (ELF32_R_TYPE (irelscan->r_info)
116 == (int) R_MICROBLAZE_TEXTREL_32_LO))
117 {
118+ if (ELF64_R_SYM (irelscan->r_info) >= symtab_hdr->sh_info)
119+ continue;
120+
121 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
122
123 /* Look at the reloc only if the value has been resolved. */
124@@ -2288,6 +2299,9 @@ microblaze_elf_relax_section (bfd *abfd,
125 if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64
126 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_TEXTREL_64))
127 {
128+ if (ELF64_R_SYM (irelscan->r_info) >= symtab_hdr->sh_info)
129+ continue;
130+
131 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
132
133 /* Look at the reloc only if the value has been resolved. */
134@@ -2336,6 +2350,9 @@ microblaze_elf_relax_section (bfd *abfd,
135 }
136 else if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_PCREL)
137 {
138+ if (ELF64_R_SYM (irelscan->r_info) >= symtab_hdr->sh_info)
139+ continue;
140+
141 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
142
143 /* Look at the reloc only if the value has been resolved. */
144--
1452.37.1 (Apple Git-137.1)
146