summaryrefslogtreecommitdiffstats
path: root/meta-microblaze/recipes-devtools
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@kernel.crashing.org>2022-07-25 21:50:15 -0500
committerMark Hatle <mark.hatle@kernel.crashing.org>2022-08-31 19:54:10 -0500
commit99db60eba08220956b1541cfb3e3201fd691c87a (patch)
tree225ad4dd99cc0f560248ed98144c8724de3af289 /meta-microblaze/recipes-devtools
parent020b40194f61b75c312386adff86170b45c4c033 (diff)
downloadmeta-xilinx-99db60eba08220956b1541cfb3e3201fd691c87a.tar.gz
binutils: Update patches for Langdale binutils
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Diffstat (limited to 'meta-microblaze/recipes-devtools')
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils-microblaze.inc3
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0009-Add-new-bit-field-instructions.patch47
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0014-Patch-MicroBlaze-initial-support-for-MicroBlaze-64-b.patch355
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0017-Fixed-MB-x-relocation-issues.patch43
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0025-Added-support-to-new-arithmetic-single-register-inst.patch45
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0030-Patch-microblaze-Changing-the-long-to-long-long-as-i.patch17
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0033-Add-initial-port-of-linux-gdbserver.patch93
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0034-Initial-port-of-core-reading-support.patch79
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0035-Fix-debug-message-when-register-is-unavailable.patch41
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0036-microblaze-Add-build_gdbserver-yes-to-top-level-conf.patch32
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0037-Fixing-the-issues-related-to-GDB-7.12.patch220
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0039-Patch-MicroBlaze-Double-free-with-ld-no-keep-memory.patch36
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0040-Patch-MicroBlaze-Fixing-the-imm-imml-generation-for-.patch23
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0041-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch43
14 files changed, 372 insertions, 705 deletions
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils-microblaze.inc b/meta-microblaze/recipes-devtools/binutils/binutils-microblaze.inc
index 4a84be9e..d8d0f268 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils-microblaze.inc
+++ b/meta-microblaze/recipes-devtools/binutils/binutils-microblaze.inc
@@ -35,9 +35,6 @@ SRC_URI:append = " \
35 file://0032-ld-emulparams-elf64microblaze-Fix-emulation-generati.patch \ 35 file://0032-ld-emulparams-elf64microblaze-Fix-emulation-generati.patch \
36 file://0033-Add-initial-port-of-linux-gdbserver.patch \ 36 file://0033-Add-initial-port-of-linux-gdbserver.patch \
37 file://0034-Initial-port-of-core-reading-support.patch \ 37 file://0034-Initial-port-of-core-reading-support.patch \
38 file://0035-Fix-debug-message-when-register-is-unavailable.patch \
39 file://0036-microblaze-Add-build_gdbserver-yes-to-top-level-conf.patch \
40 file://0037-Fixing-the-issues-related-to-GDB-7.12.patch \
41 file://0038-Patch-MB-MB-binutils-Upstream-port-issues.patch \ 38 file://0038-Patch-MB-MB-binutils-Upstream-port-issues.patch \
42 file://0039-Patch-MicroBlaze-Double-free-with-ld-no-keep-memory.patch \ 39 file://0039-Patch-MicroBlaze-Double-free-with-ld-no-keep-memory.patch \
43 file://0040-Patch-MicroBlaze-Fixing-the-imm-imml-generation-for-.patch \ 40 file://0040-Patch-MicroBlaze-Fixing-the-imm-imml-generation-for-.patch \
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0009-Add-new-bit-field-instructions.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0009-Add-new-bit-field-instructions.patch
index 16e086fb..5cd7d9c8 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0009-Add-new-bit-field-instructions.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0009-Add-new-bit-field-instructions.patch
@@ -22,16 +22,16 @@ Conflicts:
22 opcodes/microblaze-opcm.h | 6 +++- 22 opcodes/microblaze-opcm.h | 6 +++-
23 4 files changed, 104 insertions(+), 5 deletions(-) 23 4 files changed, 104 insertions(+), 5 deletions(-)
24 24
25diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 25Index: git/gas/config/tc-microblaze.c
26index 87efc2b7a46..aa58a18f05c 100644 26===================================================================
27--- a/gas/config/tc-microblaze.c 27--- git.orig/gas/config/tc-microblaze.c
28+++ b/gas/config/tc-microblaze.c 28+++ git/gas/config/tc-microblaze.c
29@@ -917,7 +917,7 @@ md_assemble (char * str) 29@@ -917,7 +917,7 @@ md_assemble (char * str)
30 unsigned reg2; 30 unsigned reg2;
31 unsigned reg3; 31 unsigned reg3;
32 unsigned isize; 32 unsigned isize;
33- unsigned int immed, temp; 33- unsigned int immed = 0, temp;
34+ unsigned int immed, immed2, temp; 34+ unsigned int immed = 0, immed2 = 0, temp;
35 expressionS exp; 35 expressionS exp;
36 char name[20]; 36 char name[20];
37 37
@@ -60,7 +60,7 @@ index 87efc2b7a46..aa58a18f05c 100644
60+ as_fatal (_("Cannot use special register with this instruction")); 60+ as_fatal (_("Cannot use special register with this instruction"));
61+ if (check_spl_reg (&reg2)) 61+ if (check_spl_reg (&reg2))
62+ as_fatal (_("Cannot use special register with this instruction")); 62+ as_fatal (_("Cannot use special register with this instruction"));
63 63+
64+ /* Width immediate value. */ 64+ /* Width immediate value. */
65+ if (strcmp (op_end, "")) 65+ if (strcmp (op_end, ""))
66+ op_end = parse_imm (op_end + 1, &exp, MIN_IMM_WIDTH, MAX_IMM_WIDTH); 66+ op_end = parse_imm (op_end + 1, &exp, MIN_IMM_WIDTH, MAX_IMM_WIDTH);
@@ -75,7 +75,7 @@ index 87efc2b7a46..aa58a18f05c 100644
75+ immed = exp.X_add_number; 75+ immed = exp.X_add_number;
76+ if (opcode->instr == bsefi && immed > 31) 76+ if (opcode->instr == bsefi && immed > 31)
77+ as_fatal (_("Width value must be less than 32")); 77+ as_fatal (_("Width value must be less than 32"));
78+ 78
79+ /* Shift immediate value. */ 79+ /* Shift immediate value. */
80+ if (strcmp (op_end, "")) 80+ if (strcmp (op_end, ""))
81+ op_end = parse_imm (op_end + 1, &exp, MIN_IMM, MAX_IMM); 81+ op_end = parse_imm (op_end + 1, &exp, MIN_IMM, MAX_IMM);
@@ -112,11 +112,11 @@ index 87efc2b7a46..aa58a18f05c 100644
112 case INST_TYPE_R1_R2: 112 case INST_TYPE_R1_R2:
113 if (strcmp (op_end, "")) 113 if (strcmp (op_end, ""))
114 op_end = parse_reg (op_end + 1, &reg1); /* Get r1. */ 114 op_end = parse_reg (op_end + 1, &reg1); /* Get r1. */
115diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c 115Index: git/opcodes/microblaze-dis.c
116index 1696f559a0b..1fe8da2e51b 100644 116===================================================================
117--- a/opcodes/microblaze-dis.c 117--- git.orig/opcodes/microblaze-dis.c
118+++ b/opcodes/microblaze-dis.c 118+++ git/opcodes/microblaze-dis.c
119@@ -91,7 +91,19 @@ get_field_imm5_mbar (struct string_buf *buf, long instr) 119@@ -91,7 +91,19 @@ get_field_imm5_mbar (struct string_buf *
120 } 120 }
121 121
122 static char * 122 static char *
@@ -137,7 +137,7 @@ index 1696f559a0b..1fe8da2e51b 100644
137 { 137 {
138 char *p = strbuf (buf); 138 char *p = strbuf (buf);
139 139
140@@ -427,7 +439,11 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info) 140@@ -427,7 +439,11 @@ print_insn_microblaze (bfd_vma memaddr,
141 /* For mbar 16 or sleep insn. */ 141 /* For mbar 16 or sleep insn. */
142 case INST_TYPE_NONE: 142 case INST_TYPE_NONE:
143 break; 143 break;
@@ -150,10 +150,10 @@ index 1696f559a0b..1fe8da2e51b 100644
150 case INST_TYPE_RD: 150 case INST_TYPE_RD:
151 print_func (stream, "\t%s", get_field_rd (&buf, inst)); 151 print_func (stream, "\t%s", get_field_rd (&buf, inst));
152 break; 152 break;
153diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h 153Index: git/opcodes/microblaze-opc.h
154index bf53e492b9a..6fcded04b49 100644 154===================================================================
155--- a/opcodes/microblaze-opc.h 155--- git.orig/opcodes/microblaze-opc.h
156+++ b/opcodes/microblaze-opc.h 156+++ git/opcodes/microblaze-opc.h
157@@ -59,6 +59,9 @@ 157@@ -59,6 +59,9 @@
158 /* For mbar. */ 158 /* For mbar. */
159 #define INST_TYPE_IMM5 20 159 #define INST_TYPE_IMM5 20
@@ -201,10 +201,10 @@ index bf53e492b9a..6fcded04b49 100644
201+ 201+
202 #endif /* MICROBLAZE_OPC */ 202 #endif /* MICROBLAZE_OPC */
203 203
204diff --git a/opcodes/microblaze-opcm.h b/opcodes/microblaze-opcm.h 204Index: git/opcodes/microblaze-opcm.h
205index 250fd6a250a..78a2ac44960 100644 205===================================================================
206--- a/opcodes/microblaze-opcm.h 206--- git.orig/opcodes/microblaze-opcm.h
207+++ b/opcodes/microblaze-opcm.h 207+++ git/opcodes/microblaze-opcm.h
208@@ -29,7 +29,7 @@ enum microblaze_instr 208@@ -29,7 +29,7 @@ enum microblaze_instr
209 addi, rsubi, addic, rsubic, addik, rsubik, addikc, rsubikc, mul, 209 addi, rsubi, addic, rsubic, addik, rsubik, addikc, rsubikc, mul,
210 mulh, mulhu, mulhsu,swapb,swaph, 210 mulh, mulhu, mulhsu,swapb,swaph,
@@ -232,6 +232,3 @@ index 250fd6a250a..78a2ac44960 100644
232 /* FSL imm mask for get, put instructions. */ 232 /* FSL imm mask for get, put instructions. */
233 #define RFSL_MASK 0x000000F 233 #define RFSL_MASK 0x000000F
234 234
235--
2362.17.1
237
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0014-Patch-MicroBlaze-initial-support-for-MicroBlaze-64-b.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0014-Patch-MicroBlaze-initial-support-for-MicroBlaze-64-b.patch
index 0ba67003..0d70bf25 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0014-Patch-MicroBlaze-initial-support-for-MicroBlaze-64-b.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0014-Patch-MicroBlaze-initial-support-for-MicroBlaze-64-b.patch
@@ -34,11 +34,11 @@ Subject: [PATCH 14/38] [Patch,MicroBlaze] : initial support for MicroBlaze 64
34 create mode 100644 ld/emulparams/elf64microblaze.sh 34 create mode 100644 ld/emulparams/elf64microblaze.sh
35 create mode 100644 ld/emulparams/elf64microblazeel.sh 35 create mode 100644 ld/emulparams/elf64microblazeel.sh
36 36
37diff --git a/bfd/Makefile.am b/bfd/Makefile.am 37Index: git/bfd/Makefile.am
38index ed2f701805d..0dc77afa8ad 100644 38===================================================================
39--- a/bfd/Makefile.am 39--- git.orig/bfd/Makefile.am
40+++ b/bfd/Makefile.am 40+++ git/bfd/Makefile.am
41@@ -558,6 +558,7 @@ BFD64_BACKENDS = \ 41@@ -563,6 +563,7 @@ BFD64_BACKENDS = \
42 elf64-riscv.lo \ 42 elf64-riscv.lo \
43 elfxx-riscv.lo \ 43 elfxx-riscv.lo \
44 elf64-s390.lo \ 44 elf64-s390.lo \
@@ -46,7 +46,7 @@ index ed2f701805d..0dc77afa8ad 100644
46 elf64-sparc.lo \ 46 elf64-sparc.lo \
47 elf64-tilegx.lo \ 47 elf64-tilegx.lo \
48 elf64-x86-64.lo \ 48 elf64-x86-64.lo \
49@@ -592,6 +593,7 @@ BFD64_BACKENDS_CFILES = \ 49@@ -599,6 +600,7 @@ BFD64_BACKENDS_CFILES = \
50 elf64-nfp.c \ 50 elf64-nfp.c \
51 elf64-ppc.c \ 51 elf64-ppc.c \
52 elf64-s390.c \ 52 elf64-s390.c \
@@ -54,11 +54,11 @@ index ed2f701805d..0dc77afa8ad 100644
54 elf64-sparc.c \ 54 elf64-sparc.c \
55 elf64-tilegx.c \ 55 elf64-tilegx.c \
56 elf64-x86-64.c \ 56 elf64-x86-64.c \
57diff --git a/bfd/Makefile.in b/bfd/Makefile.in 57Index: git/bfd/Makefile.in
58index 12807d99760..01ac4805eb8 100644 58===================================================================
59--- a/bfd/Makefile.in 59--- git.orig/bfd/Makefile.in
60+++ b/bfd/Makefile.in 60+++ git/bfd/Makefile.in
61@@ -985,6 +985,7 @@ BFD64_BACKENDS = \ 61@@ -991,6 +991,7 @@ BFD64_BACKENDS = \
62 elf64-riscv.lo \ 62 elf64-riscv.lo \
63 elfxx-riscv.lo \ 63 elfxx-riscv.lo \
64 elf64-s390.lo \ 64 elf64-s390.lo \
@@ -66,7 +66,7 @@ index 12807d99760..01ac4805eb8 100644
66 elf64-sparc.lo \ 66 elf64-sparc.lo \
67 elf64-tilegx.lo \ 67 elf64-tilegx.lo \
68 elf64-x86-64.lo \ 68 elf64-x86-64.lo \
69@@ -1019,6 +1020,7 @@ BFD64_BACKENDS_CFILES = \ 69@@ -1027,6 +1028,7 @@ BFD64_BACKENDS_CFILES = \
70 elf64-nfp.c \ 70 elf64-nfp.c \
71 elf64-ppc.c \ 71 elf64-ppc.c \
72 elf64-s390.c \ 72 elf64-s390.c \
@@ -74,7 +74,7 @@ index 12807d99760..01ac4805eb8 100644
74 elf64-sparc.c \ 74 elf64-sparc.c \
75 elf64-tilegx.c \ 75 elf64-tilegx.c \
76 elf64-x86-64.c \ 76 elf64-x86-64.c \
77@@ -1498,6 +1500,7 @@ distclean-compile: 77@@ -1535,6 +1537,7 @@ distclean-compile:
78 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-ppc.Plo@am__quote@ 78 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-ppc.Plo@am__quote@
79 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-riscv.Plo@am__quote@ 79 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-riscv.Plo@am__quote@
80 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-s390.Plo@am__quote@ 80 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-s390.Plo@am__quote@
@@ -82,37 +82,37 @@ index 12807d99760..01ac4805eb8 100644
82 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-sparc.Plo@am__quote@ 82 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-sparc.Plo@am__quote@
83 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-tilegx.Plo@am__quote@ 83 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-tilegx.Plo@am__quote@
84 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-x86-64.Plo@am__quote@ 84 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-x86-64.Plo@am__quote@
85diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h 85Index: git/bfd/bfd-in2.h
86index 943bc2e914c..2a1d7563643 100644 86===================================================================
87--- a/bfd/bfd-in2.h 87--- git.orig/bfd/bfd-in2.h
88+++ b/bfd/bfd-in2.h 88+++ git/bfd/bfd-in2.h
89@@ -5433,11 +5433,21 @@ value in two words (with an imm instruction). No relocation is 89@@ -5436,11 +5436,21 @@ done here - only used for relaxing */
90 done here - only used for relaxing */
91 BFD_RELOC_MICROBLAZE_64_NONE, 90 BFD_RELOC_MICROBLAZE_64_NONE,
92 91
93+/* This is a 64 bit reloc that stores the 32 bit pc relative 92 /* This is a 64 bit reloc that stores the 32 bit pc relative
94+ * +value in two words (with an imml instruction). No relocation is 93+ * +value in two words (with an imml instruction). No relocation is
95+ * +done here - only used for relaxing */ 94+ * +done here - only used for relaxing */
96+ BFD_RELOC_MICROBLAZE_64, 95+ BFD_RELOC_MICROBLAZE_64,
97+ 96+
98 /* This is a 64 bit reloc that stores the 32 bit pc relative 97+/* This is a 64 bit reloc that stores the 32 bit pc relative
99 value in two words (with an imm instruction). The relocation is 98 value in two words (with an imm instruction). The relocation is
100 PC-relative GOT offset */ 99 PC-relative GOT offset */
101 BFD_RELOC_MICROBLAZE_64_GOTPC, 100 BFD_RELOC_MICROBLAZE_64_GOTPC,
102 101
103+/* This is a 64 bit reloc that stores the 32 bit pc relative 102 /* This is a 64 bit reloc that stores the 32 bit pc relative
104+value in two words (with an imml instruction). The relocation is 103+value in two words (with an imml instruction). The relocation is
105+PC-relative GOT offset */ 104+PC-relative GOT offset */
106+ BFD_RELOC_MICROBLAZE_64_GPC, 105+ BFD_RELOC_MICROBLAZE_64_GPC,
107+ 106+
108 /* This is a 64 bit reloc that stores the 32 bit pc relative 107+/* This is a 64 bit reloc that stores the 32 bit pc relative
109 value in two words (with an imm instruction). The relocation is 108 value in two words (with an imm instruction). The relocation is
110 GOT offset */ 109 GOT offset */
111diff --git a/bfd/config.bfd b/bfd/config.bfd 110 BFD_RELOC_MICROBLAZE_64_GOT,
112index 30087e3b8f8..108b77ac9c1 100644 111Index: git/bfd/config.bfd
113--- a/bfd/config.bfd 112===================================================================
114+++ b/bfd/config.bfd 113--- git.orig/bfd/config.bfd
115@@ -822,11 +822,15 @@ case "${targ}" in 114+++ git/bfd/config.bfd
115@@ -855,11 +855,15 @@ case "${targ}" in
116 microblazeel*-*) 116 microblazeel*-*)
117 targ_defvec=microblaze_elf32_le_vec 117 targ_defvec=microblaze_elf32_le_vec
118 targ_selvecs=microblaze_elf32_vec 118 targ_selvecs=microblaze_elf32_vec
@@ -128,11 +128,11 @@ index 30087e3b8f8..108b77ac9c1 100644
128 ;; 128 ;;
129 129
130 #ifdef BFD64 130 #ifdef BFD64
131diff --git a/bfd/configure b/bfd/configure 131Index: git/bfd/configure
132index 41586f00f93..ffcd8ad4be0 100755 132===================================================================
133--- a/bfd/configure 133--- git.orig/bfd/configure
134+++ b/bfd/configure 134+++ git/bfd/configure
135@@ -13445,6 +13445,8 @@ do 135@@ -14198,6 +14198,8 @@ do
136 s390_elf64_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; 136 s390_elf64_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
137 score_elf32_be_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo elf64.lo $elf"; want64=true; target_size=64 ;; 137 score_elf32_be_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo elf64.lo $elf"; want64=true; target_size=64 ;;
138 score_elf32_le_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo elf64.lo $elf"; want64=true; target_size=64 ;; 138 score_elf32_le_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo elf64.lo $elf"; want64=true; target_size=64 ;;
@@ -141,11 +141,11 @@ index 41586f00f93..ffcd8ad4be0 100755
141 sh_coff_vec) tb="$tb coff-sh.lo $coff" ;; 141 sh_coff_vec) tb="$tb coff-sh.lo $coff" ;;
142 sh_coff_le_vec) tb="$tb coff-sh.lo $coff" ;; 142 sh_coff_le_vec) tb="$tb coff-sh.lo $coff" ;;
143 sh_coff_small_vec) tb="$tb coff-sh.lo $coff" ;; 143 sh_coff_small_vec) tb="$tb coff-sh.lo $coff" ;;
144diff --git a/bfd/configure.ac b/bfd/configure.ac 144Index: git/bfd/configure.ac
145index fec067b2135..9a7df353285 100644 145===================================================================
146--- a/bfd/configure.ac 146--- git.orig/bfd/configure.ac
147+++ b/bfd/configure.ac 147+++ git/bfd/configure.ac
148@@ -625,6 +625,8 @@ do 148@@ -627,6 +627,8 @@ do
149 s390_elf64_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; 149 s390_elf64_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
150 score_elf32_be_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo elf64.lo $elf"; want64=true; target_size=64 ;; 150 score_elf32_be_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo elf64.lo $elf"; want64=true; target_size=64 ;;
151 score_elf32_le_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo elf64.lo $elf"; want64=true; target_size=64 ;; 151 score_elf32_le_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo elf64.lo $elf"; want64=true; target_size=64 ;;
@@ -154,10 +154,10 @@ index fec067b2135..9a7df353285 100644
154 sh_coff_vec) tb="$tb coff-sh.lo $coff" ;; 154 sh_coff_vec) tb="$tb coff-sh.lo $coff" ;;
155 sh_coff_le_vec) tb="$tb coff-sh.lo $coff" ;; 155 sh_coff_le_vec) tb="$tb coff-sh.lo $coff" ;;
156 sh_coff_small_vec) tb="$tb coff-sh.lo $coff" ;; 156 sh_coff_small_vec) tb="$tb coff-sh.lo $coff" ;;
157diff --git a/bfd/cpu-microblaze.c b/bfd/cpu-microblaze.c 157Index: git/bfd/cpu-microblaze.c
158index d461d01e08f..ec94cc13595 100644 158===================================================================
159--- a/bfd/cpu-microblaze.c 159--- git.orig/bfd/cpu-microblaze.c
160+++ b/bfd/cpu-microblaze.c 160+++ git/bfd/cpu-microblaze.c
161@@ -23,7 +23,24 @@ 161@@ -23,7 +23,24 @@
162 #include "bfd.h" 162 #include "bfd.h"
163 #include "libbfd.h" 163 #include "libbfd.h"
@@ -184,7 +184,7 @@ index d461d01e08f..ec94cc13595 100644
184 { 184 {
185 32, /* Bits in a word. */ 185 32, /* Bits in a word. */
186 32, /* Bits in an address. */ 186 32, /* Bits in an address. */
187@@ -39,4 +56,38 @@ const bfd_arch_info_type bfd_microblaze_arch = 187@@ -39,4 +56,38 @@ const bfd_arch_info_type bfd_microblaze_
188 bfd_arch_default_fill, /* Default fill. */ 188 bfd_arch_default_fill, /* Default fill. */
189 NULL, /* Next in list. */ 189 NULL, /* Next in list. */
190 0 /* Maximum offset of a reloc from the start of an insn. */ 190 0 /* Maximum offset of a reloc from the start of an insn. */
@@ -223,11 +223,11 @@ index d461d01e08f..ec94cc13595 100644
223+} 223+}
224+#endif 224+#endif
225 }; 225 };
226diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 226Index: git/bfd/elf32-microblaze.c
227index e378542b902..2f2e1ef7f41 100644 227===================================================================
228--- a/bfd/elf32-microblaze.c 228--- git.orig/bfd/elf32-microblaze.c
229+++ b/bfd/elf32-microblaze.c 229+++ git/bfd/elf32-microblaze.c
230@@ -114,6 +114,20 @@ static reloc_howto_type microblaze_elf_howto_raw[] = 230@@ -114,6 +114,20 @@ static reloc_howto_type microblaze_elf_h
231 0x0000ffff, /* Dest Mask. */ 231 0x0000ffff, /* Dest Mask. */
232 true), /* PC relative offset? */ 232 true), /* PC relative offset? */
233 233
@@ -248,7 +248,7 @@ index e378542b902..2f2e1ef7f41 100644
248 /* A 64 bit relocation. Table entry not really used. */ 248 /* A 64 bit relocation. Table entry not really used. */
249 HOWTO (R_MICROBLAZE_64, /* Type. */ 249 HOWTO (R_MICROBLAZE_64, /* Type. */
250 0, /* Rightshift. */ 250 0, /* Rightshift. */
251@@ -179,15 +193,15 @@ static reloc_howto_type microblaze_elf_howto_raw[] = 251@@ -179,15 +193,15 @@ static reloc_howto_type microblaze_elf_h
252 0, /* Rightshift. */ 252 0, /* Rightshift. */
253 2, /* Size (0 = byte, 1 = short, 2 = long). */ 253 2, /* Size (0 = byte, 1 = short, 2 = long). */
254 32, /* Bitsize. */ 254 32, /* Bitsize. */
@@ -267,7 +267,7 @@ index e378542b902..2f2e1ef7f41 100644
267 267
268 HOWTO (R_MICROBLAZE_64_NONE, /* Type. */ 268 HOWTO (R_MICROBLAZE_64_NONE, /* Type. */
269 0, /* Rightshift. */ 269 0, /* Rightshift. */
270@@ -278,6 +292,21 @@ static reloc_howto_type microblaze_elf_howto_raw[] = 270@@ -278,6 +292,21 @@ static reloc_howto_type microblaze_elf_h
271 0x0000ffff, /* Dest Mask. */ 271 0x0000ffff, /* Dest Mask. */
272 true), /* PC relative offset? */ 272 true), /* PC relative offset? */
273 273
@@ -289,7 +289,7 @@ index e378542b902..2f2e1ef7f41 100644
289 /* A 64 bit GOT relocation. Table-entry not really used. */ 289 /* A 64 bit GOT relocation. Table-entry not really used. */
290 HOWTO (R_MICROBLAZE_GOT_64, /* Type. */ 290 HOWTO (R_MICROBLAZE_GOT_64, /* Type. */
291 0, /* Rightshift. */ 291 0, /* Rightshift. */
292@@ -617,9 +646,15 @@ microblaze_elf_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, 292@@ -617,9 +646,15 @@ microblaze_elf_reloc_type_lookup (bfd *
293 case BFD_RELOC_VTABLE_ENTRY: 293 case BFD_RELOC_VTABLE_ENTRY:
294 microblaze_reloc = R_MICROBLAZE_GNU_VTENTRY; 294 microblaze_reloc = R_MICROBLAZE_GNU_VTENTRY;
295 break; 295 break;
@@ -305,7 +305,7 @@ index e378542b902..2f2e1ef7f41 100644
305 case BFD_RELOC_MICROBLAZE_64_GOT: 305 case BFD_RELOC_MICROBLAZE_64_GOT:
306 microblaze_reloc = R_MICROBLAZE_GOT_64; 306 microblaze_reloc = R_MICROBLAZE_GOT_64;
307 break; 307 break;
308@@ -1459,7 +1494,7 @@ microblaze_elf_relocate_section (bfd *output_bfd, 308@@ -1459,7 +1494,7 @@ microblaze_elf_relocate_section (bfd *ou
309 if (r_symndx == STN_UNDEF || (input_section->flags & SEC_ALLOC) == 0) 309 if (r_symndx == STN_UNDEF || (input_section->flags & SEC_ALLOC) == 0)
310 { 310 {
311 relocation += addend; 311 relocation += addend;
@@ -343,11 +343,10 @@ index e378542b902..2f2e1ef7f41 100644
343 case R_MICROBLAZE_NONE: 343 case R_MICROBLAZE_NONE:
344 case R_MICROBLAZE_32_NONE: 344 case R_MICROBLAZE_32_NONE:
345 { 345 {
346diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 346Index: git/bfd/elf64-microblaze.c
347new file mode 100644 347===================================================================
348index 00000000000..46c4aba46f1
349--- /dev/null 348--- /dev/null
350+++ b/bfd/elf64-microblaze.c 349+++ git/bfd/elf64-microblaze.c
351@@ -0,0 +1,3577 @@ 350@@ -0,0 +1,3577 @@
352+/* Xilinx MicroBlaze-specific support for 32-bit ELF 351+/* Xilinx MicroBlaze-specific support for 32-bit ELF
353+ 352+
@@ -3926,11 +3925,11 @@ index 00000000000..46c4aba46f1
3926+#define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook 3925+#define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook
3927+ 3926+
3928+#include "elf64-target.h" 3927+#include "elf64-target.h"
3929diff --git a/bfd/libbfd.h b/bfd/libbfd.h 3928Index: git/bfd/libbfd.h
3930index 4153b94564d..2caaf27bcd7 100644 3929===================================================================
3931--- a/bfd/libbfd.h 3930--- git.orig/bfd/libbfd.h
3932+++ b/bfd/libbfd.h 3931+++ git/bfd/libbfd.h
3933@@ -2990,7 +2990,9 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", 3932@@ -2994,7 +2994,9 @@ static const char *const bfd_reloc_code_
3934 "BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM", 3933 "BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM",
3935 "BFD_RELOC_MICROBLAZE_32_NONE", 3934 "BFD_RELOC_MICROBLAZE_32_NONE",
3936 "BFD_RELOC_MICROBLAZE_64_NONE", 3935 "BFD_RELOC_MICROBLAZE_64_NONE",
@@ -3940,40 +3939,41 @@ index 4153b94564d..2caaf27bcd7 100644
3940 "BFD_RELOC_MICROBLAZE_64_GOT", 3939 "BFD_RELOC_MICROBLAZE_64_GOT",
3941 "BFD_RELOC_MICROBLAZE_64_PLT", 3940 "BFD_RELOC_MICROBLAZE_64_PLT",
3942 "BFD_RELOC_MICROBLAZE_64_GOTOFF", 3941 "BFD_RELOC_MICROBLAZE_64_GOTOFF",
3943diff --git a/bfd/reloc.c b/bfd/reloc.c 3942Index: git/bfd/reloc.c
3944index 3a08f7a8a42..288a5026d27 100644 3943===================================================================
3945--- a/bfd/reloc.c 3944--- git.orig/bfd/reloc.c
3946+++ b/bfd/reloc.c 3945+++ git/bfd/reloc.c
3947@@ -6904,12 +6904,24 @@ ENUMDOC 3946@@ -6907,6 +6907,12 @@ ENUMDOC
3948 done here - only used for relaxing
3949 ENUM 3947 ENUM
3950 BFD_RELOC_MICROBLAZE_64_NONE 3948 BFD_RELOC_MICROBLAZE_64_NONE
3951+ENUMDOC 3949 ENUMDOC
3952+ This is a 32 bit reloc that stores the 32 bit pc relative 3950+ This is a 32 bit reloc that stores the 32 bit pc relative
3953+ value in two words (with an imml instruction). No relocation is 3951+ value in two words (with an imml instruction). No relocation is
3954+ done here - only used for relaxing 3952+ done here - only used for relaxing
3955+ENUM 3953+ENUM
3956+ BFD_RELOC_MICROBLAZE_64 3954+ BFD_RELOC_MICROBLAZE_64
3957 ENUMDOC 3955+ENUMDOC
3958 This is a 64 bit reloc that stores the 32 bit pc relative 3956 This is a 64 bit reloc that stores the 32 bit pc relative
3959 value in two words (with an imm instruction). No relocation is 3957 value in two words (with an imm instruction). No relocation is
3960 done here - only used for relaxing 3958 done here - only used for relaxing
3961 ENUM 3959@@ -6914,6 +6920,12 @@ ENUM
3962 BFD_RELOC_MICROBLAZE_64_GOTPC 3960 BFD_RELOC_MICROBLAZE_64_GOTPC
3963+ENUMDOC 3961 ENUMDOC
3964+ This is a 64 bit reloc that stores the 32 bit pc relative 3962 This is a 64 bit reloc that stores the 32 bit pc relative
3965+ value in two words (with an imml instruction). No relocation is 3963+ value in two words (with an imml instruction). No relocation is
3966+ done here - only used for relaxing 3964+ done here - only used for relaxing
3967+ENUM 3965+ENUM
3968+ BFD_RELOC_MICROBLAZE_64_GPC 3966+ BFD_RELOC_MICROBLAZE_64_GPC
3969 ENUMDOC 3967+ENUMDOC
3970 This is a 64 bit reloc that stores the 32 bit pc relative 3968+ This is a 64 bit reloc that stores the 32 bit pc relative
3971 value in two words (with an imm instruction). The relocation is 3969 value in two words (with an imm instruction). The relocation is
3972diff --git a/bfd/targets.c b/bfd/targets.c 3970 PC-relative GOT offset
3973index 89b49e721b4..22543016ffb 100644 3971 ENUM
3974--- a/bfd/targets.c 3972Index: git/bfd/targets.c
3975+++ b/bfd/targets.c 3973===================================================================
3976@@ -791,6 +791,8 @@ extern const bfd_target mep_elf32_le_vec; 3974--- git.orig/bfd/targets.c
3975+++ git/bfd/targets.c
3976@@ -794,6 +794,8 @@ extern const bfd_target mep_elf32_le_vec
3977 extern const bfd_target metag_elf32_vec; 3977 extern const bfd_target metag_elf32_vec;
3978 extern const bfd_target microblaze_elf32_vec; 3978 extern const bfd_target microblaze_elf32_vec;
3979 extern const bfd_target microblaze_elf32_le_vec; 3979 extern const bfd_target microblaze_elf32_le_vec;
@@ -3982,7 +3982,7 @@ index 89b49e721b4..22543016ffb 100644
3982 extern const bfd_target mips_ecoff_be_vec; 3982 extern const bfd_target mips_ecoff_be_vec;
3983 extern const bfd_target mips_ecoff_le_vec; 3983 extern const bfd_target mips_ecoff_le_vec;
3984 extern const bfd_target mips_ecoff_bele_vec; 3984 extern const bfd_target mips_ecoff_bele_vec;
3985@@ -1156,6 +1158,10 @@ static const bfd_target * const _bfd_target_vector[] = 3985@@ -1160,6 +1162,10 @@ static const bfd_target * const _bfd_tar
3986 3986
3987 &metag_elf32_vec, 3987 &metag_elf32_vec,
3988 3988
@@ -3993,10 +3993,10 @@ index 89b49e721b4..22543016ffb 100644
3993 &microblaze_elf32_vec, 3993 &microblaze_elf32_vec,
3994 3994
3995 &mips_ecoff_be_vec, 3995 &mips_ecoff_be_vec,
3996diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 3996Index: git/gas/config/tc-microblaze.c
3997index 98d0c259246..378fb882f13 100644 3997===================================================================
3998--- a/gas/config/tc-microblaze.c 3998--- git.orig/gas/config/tc-microblaze.c
3999+++ b/gas/config/tc-microblaze.c 3999+++ git/gas/config/tc-microblaze.c
4000@@ -35,10 +35,13 @@ 4000@@ -35,10 +35,13 @@
4001 #define streq(a,b) (strcmp (a, b) == 0) 4001 #define streq(a,b) (strcmp (a, b) == 0)
4002 #endif 4002 #endif
@@ -4048,7 +4048,7 @@ index 98d0c259246..378fb882f13 100644
4048 {"frame", s_ignore, 0}, 4048 {"frame", s_ignore, 0},
4049 {"mask", s_ignore, 0}, /* Emitted by gcc. */ 4049 {"mask", s_ignore, 0}, /* Emitted by gcc. */
4050 {NULL, NULL, 0} 4050 {NULL, NULL, 0}
4051@@ -773,6 +781,74 @@ parse_imm (char * s, expressionS * e, offsetT min, offsetT max) 4051@@ -773,6 +781,74 @@ parse_imm (char * s, expressionS * e, of
4052 return new_pointer; 4052 return new_pointer;
4053 } 4053 }
4054 4054
@@ -4123,7 +4123,7 @@ index 98d0c259246..378fb882f13 100644
4123 static char * 4123 static char *
4124 check_got (int * got_type, int * got_len) 4124 check_got (int * got_type, int * got_len)
4125 { 4125 {
4126@@ -827,7 +903,7 @@ check_got (int * got_type, int * got_len) 4126@@ -827,7 +903,7 @@ check_got (int * got_type, int * got_len
4127 extern bfd_reloc_code_real_type 4127 extern bfd_reloc_code_real_type
4128 parse_cons_expression_microblaze (expressionS *exp, int size) 4128 parse_cons_expression_microblaze (expressionS *exp, int size)
4129 { 4129 {
@@ -4132,7 +4132,7 @@ index 98d0c259246..378fb882f13 100644
4132 { 4132 {
4133 /* Handle @GOTOFF et.al. */ 4133 /* Handle @GOTOFF et.al. */
4134 char *save, *gotfree_copy; 4134 char *save, *gotfree_copy;
4135@@ -859,6 +935,7 @@ parse_cons_expression_microblaze (expressionS *exp, int size) 4135@@ -859,6 +935,7 @@ parse_cons_expression_microblaze (expres
4136 4136
4137 static const char * str_microblaze_ro_anchor = "RO"; 4137 static const char * str_microblaze_ro_anchor = "RO";
4138 static const char * str_microblaze_rw_anchor = "RW"; 4138 static const char * str_microblaze_rw_anchor = "RW";
@@ -4141,7 +4141,7 @@ index 98d0c259246..378fb882f13 100644
4141 static bool 4141 static bool
4142 check_spl_reg (unsigned * reg) 4142 check_spl_reg (unsigned * reg)
4143@@ -920,6 +997,7 @@ md_assemble (char * str) 4143@@ -920,6 +997,7 @@ md_assemble (char * str)
4144 unsigned int immed, immed2, temp; 4144 unsigned int immed = 0, immed2 = 0, temp;
4145 expressionS exp; 4145 expressionS exp;
4146 char name[20]; 4146 char name[20];
4147+ long immedl; 4147+ long immedl;
@@ -4439,7 +4439,7 @@ index 98d0c259246..378fb882f13 100644
4439 { NULL, no_argument, NULL, 0} 4439 { NULL, no_argument, NULL, 0}
4440 }; 4440 };
4441 4441
4442@@ -1971,13 +2230,23 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, 4442@@ -1971,13 +2230,23 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UN
4443 fragP->fr_fix += INST_WORD_SIZE * 2; 4443 fragP->fr_fix += INST_WORD_SIZE * 2;
4444 fragP->fr_var = 0; 4444 fragP->fr_var = 0;
4445 break; 4445 break;
@@ -4555,7 +4555,7 @@ index 98d0c259246..378fb882f13 100644
4555 else if (fixP->fx_r_type == BFD_RELOC_32) 4555 else if (fixP->fx_r_type == BFD_RELOC_32)
4556 fixP->fx_r_type = BFD_RELOC_MICROBLAZE_32_NONE; 4556 fixP->fx_r_type = BFD_RELOC_MICROBLAZE_32_NONE;
4557 else 4557 else
4558@@ -2323,6 +2614,32 @@ md_estimate_size_before_relax (fragS * fragP, 4558@@ -2323,6 +2614,32 @@ md_estimate_size_before_relax (fragS * f
4559 as_bad (_("Absolute PC-relative value in relaxation code. Assembler error.....")); 4559 as_bad (_("Absolute PC-relative value in relaxation code. Assembler error....."));
4560 abort (); 4560 abort ();
4561 } 4561 }
@@ -4588,7 +4588,7 @@ index 98d0c259246..378fb882f13 100644
4588 else if (S_GET_SEGMENT (fragP->fr_symbol) == segment_type && 4588 else if (S_GET_SEGMENT (fragP->fr_symbol) == segment_type &&
4589 !S_IS_WEAK (fragP->fr_symbol)) 4589 !S_IS_WEAK (fragP->fr_symbol))
4590 { 4590 {
4591@@ -2330,6 +2647,7 @@ md_estimate_size_before_relax (fragS * fragP, 4591@@ -2330,6 +2647,7 @@ md_estimate_size_before_relax (fragS * f
4592 /* Don't know now whether we need an imm instruction. */ 4592 /* Don't know now whether we need an imm instruction. */
4593 fragP->fr_var = INST_WORD_SIZE; 4593 fragP->fr_var = INST_WORD_SIZE;
4594 } 4594 }
@@ -4596,7 +4596,7 @@ index 98d0c259246..378fb882f13 100644
4596 else if (S_IS_DEFINED (fragP->fr_symbol) 4596 else if (S_IS_DEFINED (fragP->fr_symbol)
4597 && (((S_GET_SEGMENT (fragP->fr_symbol))->flags & SEC_CODE) == 0)) 4597 && (((S_GET_SEGMENT (fragP->fr_symbol))->flags & SEC_CODE) == 0))
4598 { 4598 {
4599@@ -2432,6 +2750,7 @@ md_estimate_size_before_relax (fragS * fragP, 4599@@ -2432,6 +2750,7 @@ md_estimate_size_before_relax (fragS * f
4600 case TLSLD_OFFSET: 4600 case TLSLD_OFFSET:
4601 case TLSTPREL_OFFSET: 4601 case TLSTPREL_OFFSET:
4602 case TLSDTPREL_OFFSET: 4602 case TLSDTPREL_OFFSET:
@@ -4604,7 +4604,7 @@ index 98d0c259246..378fb882f13 100644
4604 fragP->fr_var = INST_WORD_SIZE*2; 4604 fragP->fr_var = INST_WORD_SIZE*2;
4605 break; 4605 break;
4606 case DEFINED_RO_SEGMENT: 4606 case DEFINED_RO_SEGMENT:
4607@@ -2485,7 +2804,7 @@ md_pcrel_from_section (fixS * fixp, segT sec ATTRIBUTE_UNUSED) 4607@@ -2485,7 +2804,7 @@ md_pcrel_from_section (fixS * fixp, segT
4608 else 4608 else
4609 { 4609 {
4610 /* The case where we are going to resolve things... */ 4610 /* The case where we are going to resolve things... */
@@ -4613,7 +4613,7 @@ index 98d0c259246..378fb882f13 100644
4613 return fixp->fx_where + fixp->fx_frag->fr_address + INST_WORD_SIZE; 4613 return fixp->fx_where + fixp->fx_frag->fr_address + INST_WORD_SIZE;
4614 else 4614 else
4615 return fixp->fx_where + fixp->fx_frag->fr_address; 4615 return fixp->fx_where + fixp->fx_frag->fr_address;
4616@@ -2518,6 +2837,8 @@ tc_gen_reloc (asection * section ATTRIBUTE_UNUSED, fixS * fixp) 4616@@ -2518,6 +2837,8 @@ tc_gen_reloc (asection * section ATTRIBU
4617 case BFD_RELOC_MICROBLAZE_32_RWSDA: 4617 case BFD_RELOC_MICROBLAZE_32_RWSDA:
4618 case BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM: 4618 case BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM:
4619 case BFD_RELOC_MICROBLAZE_64_GOTPC: 4619 case BFD_RELOC_MICROBLAZE_64_GOTPC:
@@ -4622,7 +4622,7 @@ index 98d0c259246..378fb882f13 100644
4622 case BFD_RELOC_MICROBLAZE_64_GOT: 4622 case BFD_RELOC_MICROBLAZE_64_GOT:
4623 case BFD_RELOC_MICROBLAZE_64_PLT: 4623 case BFD_RELOC_MICROBLAZE_64_PLT:
4624 case BFD_RELOC_MICROBLAZE_64_GOTOFF: 4624 case BFD_RELOC_MICROBLAZE_64_GOTOFF:
4625@@ -2578,6 +2899,18 @@ tc_gen_reloc (asection * section ATTRIBUTE_UNUSED, fixS * fixp) 4625@@ -2578,6 +2899,18 @@ tc_gen_reloc (asection * section ATTRIBU
4626 return rel; 4626 return rel;
4627 } 4627 }
4628 4628
@@ -4641,7 +4641,7 @@ index 98d0c259246..378fb882f13 100644
4641 int 4641 int
4642 md_parse_option (int c, const char * arg ATTRIBUTE_UNUSED) 4642 md_parse_option (int c, const char * arg ATTRIBUTE_UNUSED)
4643 { 4643 {
4644@@ -2591,6 +2924,10 @@ md_parse_option (int c, const char * arg ATTRIBUTE_UNUSED) 4644@@ -2591,6 +2924,10 @@ md_parse_option (int c, const char * arg
4645 case OPTION_LITTLE: 4645 case OPTION_LITTLE:
4646 target_big_endian = 0; 4646 target_big_endian = 0;
4647 break; 4647 break;
@@ -4652,7 +4652,7 @@ index 98d0c259246..378fb882f13 100644
4652 default: 4652 default:
4653 return 0; 4653 return 0;
4654 } 4654 }
4655@@ -2606,6 +2943,7 @@ md_show_usage (FILE * stream ATTRIBUTE_UNUSED) 4655@@ -2606,6 +2943,7 @@ md_show_usage (FILE * stream ATTRIBUTE_U
4656 fprintf (stream, _(" MicroBlaze specific assembler options:\n")); 4656 fprintf (stream, _(" MicroBlaze specific assembler options:\n"));
4657 fprintf (stream, " -%-23s%s\n", "mbig-endian", N_("assemble for a big endian cpu")); 4657 fprintf (stream, " -%-23s%s\n", "mbig-endian", N_("assemble for a big endian cpu"));
4658 fprintf (stream, " -%-23s%s\n", "mlittle-endian", N_("assemble for a little endian cpu")); 4658 fprintf (stream, " -%-23s%s\n", "mlittle-endian", N_("assemble for a little endian cpu"));
@@ -4672,11 +4672,11 @@ index 98d0c259246..378fb882f13 100644
4672 break; 4672 break;
4673 default: 4673 default:
4674 as_bad (_("unsupported BFD relocation size %u"), size); 4674 as_bad (_("unsupported BFD relocation size %u"), size);
4675diff --git a/gas/config/tc-microblaze.h b/gas/config/tc-microblaze.h 4675Index: git/gas/config/tc-microblaze.h
4676index c6d33f873c4..34aa1174ed2 100644 4676===================================================================
4677--- a/gas/config/tc-microblaze.h 4677--- git.orig/gas/config/tc-microblaze.h
4678+++ b/gas/config/tc-microblaze.h 4678+++ git/gas/config/tc-microblaze.h
4679@@ -78,7 +78,9 @@ extern const struct relax_type md_relax_table[]; 4679@@ -81,7 +81,9 @@ extern const struct relax_type md_relax_
4680 4680
4681 #ifdef OBJ_ELF 4681 #ifdef OBJ_ELF
4682 4682
@@ -4687,10 +4687,10 @@ index c6d33f873c4..34aa1174ed2 100644
4687 4687
4688 #define ELF_TC_SPECIAL_SECTIONS \ 4688 #define ELF_TC_SPECIAL_SECTIONS \
4689 { ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, \ 4689 { ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, \
4690diff --git a/include/elf/common.h b/include/elf/common.h 4690Index: git/include/elf/common.h
4691index 0cca28673dd..a650d624e3c 100644 4691===================================================================
4692--- a/include/elf/common.h 4692--- git.orig/include/elf/common.h
4693+++ b/include/elf/common.h 4693+++ git/include/elf/common.h
4694@@ -354,6 +354,7 @@ 4694@@ -354,6 +354,7 @@
4695 #define EM_65816 257 /* WDC 65816/65C816 */ 4695 #define EM_65816 257 /* WDC 65816/65C816 */
4696 #define EM_LOONGARCH 258 /* LoongArch */ 4696 #define EM_LOONGARCH 258 /* LoongArch */
@@ -4699,11 +4699,11 @@ index 0cca28673dd..a650d624e3c 100644
4699 4699
4700 /* If it is necessary to assign new unofficial EM_* values, please pick large 4700 /* If it is necessary to assign new unofficial EM_* values, please pick large
4701 random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision 4701 random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision
4702diff --git a/include/elf/microblaze.h b/include/elf/microblaze.h 4702Index: git/include/elf/microblaze.h
4703index 936ef484289..1f958724e5f 100644 4703===================================================================
4704--- a/include/elf/microblaze.h 4704--- git.orig/include/elf/microblaze.h
4705+++ b/include/elf/microblaze.h 4705+++ git/include/elf/microblaze.h
4706@@ -62,6 +62,8 @@ START_RELOC_NUMBERS (elf_microblaze_reloc_type) 4706@@ -62,6 +62,8 @@ START_RELOC_NUMBERS (elf_microblaze_relo
4707 RELOC_NUMBER (R_MICROBLAZE_TEXTREL_64, 31) /* TEXT Entry offset 64-bit. */ 4707 RELOC_NUMBER (R_MICROBLAZE_TEXTREL_64, 31) /* TEXT Entry offset 64-bit. */
4708 RELOC_NUMBER (R_MICROBLAZE_TEXTREL_32_LO, 32) /* TEXT Entry offset 32-bit. */ 4708 RELOC_NUMBER (R_MICROBLAZE_TEXTREL_32_LO, 32) /* TEXT Entry offset 32-bit. */
4709 RELOC_NUMBER (R_MICROBLAZE_32_NONE, 33) 4709 RELOC_NUMBER (R_MICROBLAZE_32_NONE, 33)
@@ -4712,42 +4712,42 @@ index 936ef484289..1f958724e5f 100644
4712 4712
4713 END_RELOC_NUMBERS (R_MICROBLAZE_max) 4713 END_RELOC_NUMBERS (R_MICROBLAZE_max)
4714 4714
4715diff --git a/ld/Makefile.am b/ld/Makefile.am 4715Index: git/ld/Makefile.am
4716index f8e99325361..8d263078750 100644 4716===================================================================
4717--- a/ld/Makefile.am 4717--- git.orig/ld/Makefile.am
4718+++ b/ld/Makefile.am 4718+++ git/ld/Makefile.am
4719@@ -410,6 +410,8 @@ ALL_64_EMULATION_SOURCES = \ 4719@@ -448,6 +448,8 @@ ALL_64_EMULATION_SOURCES = \
4720 eelf32ltsmipn32.c \ 4720 eelf64lriscv_lp64f.c \
4721 eelf32ltsmipn32_fbsd.c \ 4721 eelf64ltsmip.c \
4722 eelf32mipswindiss.c \ 4722 eelf64ltsmip_fbsd.c \
4723+ eelf64microblazeel.c \ 4723+ eelf64microblazeel.c \
4724+ eelf64microblaze.c \ 4724+ eelf64microblaze.c \
4725 eelf32lriscv.c \ 4725 eelf64mmix.c \
4726 eelf32lriscv_ilp32f.c \ 4726 eelf64ppc.c \
4727 eelf32lriscv_ilp32.c \ 4727 eelf64ppc_fbsd.c \
4728@@ -902,6 +904,8 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS) 4728@@ -916,6 +918,8 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULAT
4729 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32.Pc@am__quote@ 4729 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32.Pc@am__quote@
4730 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32_fbsd.Pc@am__quote@ 4730 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32_fbsd.Pc@am__quote@
4731 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32mipswindiss.Pc@am__quote@ 4731 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32mipswindiss.Pc@am__quote@
4732+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64microblazeel.Pc@am__quote@ 4732+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64microblazeel.Pc@am__quote@
4733+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64microblaze.Pc@am__quote@ 4733+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64microblaze.Pc@am__quote@
4734 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_aix.Pc@am__quote@ 4734 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_aix.Pc@am__quote@
4735 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64bpf.Pc@am__quote@
4736 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64.Pc@am__quote@ 4735 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64.Pc@am__quote@
4737diff --git a/ld/Makefile.in b/ld/Makefile.in 4736 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_fbsd.Pc@am__quote@
4738index ef2e99e08da..f7e845b9274 100644 4737Index: git/ld/Makefile.in
4739--- a/ld/Makefile.in 4738===================================================================
4740+++ b/ld/Makefile.in 4739--- git.orig/ld/Makefile.in
4741@@ -899,6 +899,8 @@ ALL_64_EMULATION_SOURCES = \ 4740+++ git/ld/Makefile.in
4742 eelf32ltsmipn32.c \ 4741@@ -938,6 +938,8 @@ ALL_64_EMULATION_SOURCES = \
4743 eelf32ltsmipn32_fbsd.c \ 4742 eelf64lriscv_lp64f.c \
4744 eelf32mipswindiss.c \ 4743 eelf64ltsmip.c \
4744 eelf64ltsmip_fbsd.c \
4745+ eelf64microblazeel.c \ 4745+ eelf64microblazeel.c \
4746+ eelf64microblaze.c \ 4746+ eelf64microblaze.c \
4747 eelf32lriscv.c \ 4747 eelf64mmix.c \
4748 eelf32lriscv_ilp32f.c \ 4748 eelf64ppc.c \
4749 eelf32lriscv_ilp32.c \ 4749 eelf64ppc_fbsd.c \
4750@@ -1398,6 +1400,8 @@ distclean-compile: 4750@@ -1411,6 +1413,8 @@ distclean-compile:
4751 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xstormy16.Po@am__quote@ 4751 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xstormy16.Po@am__quote@
4752 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xtensa.Po@am__quote@ 4752 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xtensa.Po@am__quote@
4753 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32z80.Po@am__quote@ 4753 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32z80.Po@am__quote@
@@ -4756,20 +4756,20 @@ index ef2e99e08da..f7e845b9274 100644
4756 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_aix.Po@am__quote@ 4756 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_aix.Po@am__quote@
4757 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64.Po@am__quote@ 4757 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64.Po@am__quote@
4758 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_fbsd.Po@am__quote@ 4758 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_fbsd.Po@am__quote@
4759@@ -2560,6 +2564,8 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS) 4759@@ -2583,6 +2587,8 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULAT
4760 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32.Pc@am__quote@ 4760 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32.Pc@am__quote@
4761 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32_fbsd.Pc@am__quote@ 4761 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32_fbsd.Pc@am__quote@
4762 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32mipswindiss.Pc@am__quote@ 4762 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32mipswindiss.Pc@am__quote@
4763+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64microblazeel.Pc@am__quote@ 4763+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64microblazeel.Pc@am__quote@
4764+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64microblaze.Pc@am__quote@ 4764+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64microblaze.Pc@am__quote@
4765 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_aix.Pc@am__quote@ 4765 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_aix.Pc@am__quote@
4766 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64bpf.Pc@am__quote@
4767 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64.Pc@am__quote@ 4766 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64.Pc@am__quote@
4768diff --git a/ld/configure.tgt b/ld/configure.tgt 4767 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_fbsd.Pc@am__quote@
4769index 6205d7c9872..3e97dbb311c 100644 4768Index: git/ld/configure.tgt
4770--- a/ld/configure.tgt 4769===================================================================
4771+++ b/ld/configure.tgt 4770--- git.orig/ld/configure.tgt
4772@@ -468,6 +468,9 @@ microblaze*-linux*) targ_emul="elf32mb_linux" 4771+++ git/ld/configure.tgt
4772@@ -478,6 +478,9 @@ microblaze*-linux*) targ_emul="elf32mb_l
4773 microblazeel*) targ_emul=elf32microblazeel 4773 microblazeel*) targ_emul=elf32microblazeel
4774 targ_extra_emuls=elf32microblaze 4774 targ_extra_emuls=elf32microblaze
4775 ;; 4775 ;;
@@ -4779,11 +4779,10 @@ index 6205d7c9872..3e97dbb311c 100644
4779 microblaze*) targ_emul=elf32microblaze 4779 microblaze*) targ_emul=elf32microblaze
4780 targ_extra_emuls=elf32microblazeel 4780 targ_extra_emuls=elf32microblazeel
4781 ;; 4781 ;;
4782diff --git a/ld/emulparams/elf64microblaze.sh b/ld/emulparams/elf64microblaze.sh 4782Index: git/ld/emulparams/elf64microblaze.sh
4783new file mode 100644 4783===================================================================
4784index 00000000000..9c7b0eb7080
4785--- /dev/null 4784--- /dev/null
4786+++ b/ld/emulparams/elf64microblaze.sh 4785+++ git/ld/emulparams/elf64microblaze.sh
4787@@ -0,0 +1,23 @@ 4786@@ -0,0 +1,23 @@
4788+SCRIPT_NAME=elfmicroblaze 4787+SCRIPT_NAME=elfmicroblaze
4789+OUTPUT_FORMAT="elf64-microblazeel" 4788+OUTPUT_FORMAT="elf64-microblazeel"
@@ -4808,11 +4807,10 @@ index 00000000000..9c7b0eb7080
4808+ 4807+
4809+TEMPLATE_NAME=elf32 4808+TEMPLATE_NAME=elf32
4810+#GENERATE_SHLIB_SCRIPT=yes 4809+#GENERATE_SHLIB_SCRIPT=yes
4811diff --git a/ld/emulparams/elf64microblazeel.sh b/ld/emulparams/elf64microblazeel.sh 4810Index: git/ld/emulparams/elf64microblazeel.sh
4812new file mode 100644 4811===================================================================
4813index 00000000000..9c7b0eb7080
4814--- /dev/null 4812--- /dev/null
4815+++ b/ld/emulparams/elf64microblazeel.sh 4813+++ git/ld/emulparams/elf64microblazeel.sh
4816@@ -0,0 +1,23 @@ 4814@@ -0,0 +1,23 @@
4817+SCRIPT_NAME=elfmicroblaze 4815+SCRIPT_NAME=elfmicroblaze
4818+OUTPUT_FORMAT="elf64-microblazeel" 4816+OUTPUT_FORMAT="elf64-microblazeel"
@@ -4837,10 +4835,10 @@ index 00000000000..9c7b0eb7080
4837+ 4835+
4838+TEMPLATE_NAME=elf32 4836+TEMPLATE_NAME=elf32
4839+#GENERATE_SHLIB_SCRIPT=yes 4837+#GENERATE_SHLIB_SCRIPT=yes
4840diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c 4838Index: git/opcodes/microblaze-dis.c
4841index 1fe8da2e51b..fc15d210fe0 100644 4839===================================================================
4842--- a/opcodes/microblaze-dis.c 4840--- git.orig/opcodes/microblaze-dis.c
4843+++ b/opcodes/microblaze-dis.c 4841+++ git/opcodes/microblaze-dis.c
4844@@ -33,6 +33,7 @@ 4842@@ -33,6 +33,7 @@
4845 #define get_field_r1(buf, instr) get_field (buf, instr, RA_MASK, RA_LOW) 4843 #define get_field_r1(buf, instr) get_field (buf, instr, RA_MASK, RA_LOW)
4846 #define get_field_r2(buf, instr) get_field (buf, instr, RB_MASK, RB_LOW) 4844 #define get_field_r2(buf, instr) get_field (buf, instr, RB_MASK, RB_LOW)
@@ -4849,29 +4847,29 @@ index 1fe8da2e51b..fc15d210fe0 100644
4849 #define get_int_field_r1(instr) ((instr & RA_MASK) >> RA_LOW) 4847 #define get_int_field_r1(instr) ((instr & RA_MASK) >> RA_LOW)
4850 4848
4851 #define NUM_STRBUFS 3 4849 #define NUM_STRBUFS 3
4852@@ -73,11 +74,19 @@ get_field_imm (struct string_buf *buf, long instr) 4850@@ -73,11 +74,19 @@ get_field_imm (struct string_buf *buf, l
4853 } 4851 }
4854 4852
4855 static char * 4853 static char *
4856-get_field_imm5 (struct string_buf *buf, long instr) 4854-get_field_imm5 (struct string_buf *buf, long instr)
4857+get_field_imml (struct string_buf *buf, long instr) 4855+get_field_imml (struct string_buf *buf, long instr)
4858 { 4856+{
4859 char *p = strbuf (buf); 4857+ char *p = strbuf (buf);
4860+ sprintf (p, "%d", (short)((instr & IMML_MASK) >> IMM_LOW)); 4858+ sprintf (p, "%d", (short)((instr & IMML_MASK) >> IMM_LOW));
4861+ return p; 4859+ return p;
4862+} 4860+}
4863 4861+
4864- sprintf (p, "%d", (short)((instr & IMM5_MASK) >> IMM_LOW));
4865+static char * 4862+static char *
4866+get_field_imms (struct string_buf *buf, long instr) 4863+get_field_imms (struct string_buf *buf, long instr)
4867+{ 4864 {
4868+ char *p = strbuf (buf); 4865 char *p = strbuf (buf);
4869+ 4866
4867- sprintf (p, "%d", (short)((instr & IMM5_MASK) >> IMM_LOW));
4870+ sprintf (p, "%d", (short)((instr & IMM6_MASK) >> IMM_LOW)); 4868+ sprintf (p, "%d", (short)((instr & IMM6_MASK) >> IMM_LOW));
4871 return p; 4869 return p;
4872 } 4870 }
4873 4871
4874@@ -91,14 +100,14 @@ get_field_imm5_mbar (struct string_buf *buf, long instr) 4872@@ -91,14 +100,14 @@ get_field_imm5_mbar (struct string_buf *
4875 } 4873 }
4876 4874
4877 static char * 4875 static char *
@@ -4889,7 +4887,7 @@ index 1fe8da2e51b..fc15d210fe0 100644
4889 return p; 4887 return p;
4890 } 4888 }
4891 4889
4892@@ -308,9 +317,13 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info) 4890@@ -308,9 +317,13 @@ print_insn_microblaze (bfd_vma memaddr,
4893 } 4891 }
4894 } 4892 }
4895 break; 4893 break;
@@ -4905,7 +4903,7 @@ index 1fe8da2e51b..fc15d210fe0 100644
4905 break; 4903 break;
4906 case INST_TYPE_RD_RFSL: 4904 case INST_TYPE_RD_RFSL:
4907 print_func (stream, "\t%s, %s", get_field_rd (&buf, inst), 4905 print_func (stream, "\t%s, %s", get_field_rd (&buf, inst),
4908@@ -417,6 +430,10 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info) 4906@@ -417,6 +430,10 @@ print_insn_microblaze (bfd_vma memaddr,
4909 case INST_TYPE_RD_R2: 4907 case INST_TYPE_RD_R2:
4910 print_func (stream, "\t%s, %s", get_field_rd (&buf, inst), 4908 print_func (stream, "\t%s, %s", get_field_rd (&buf, inst),
4911 get_field_r2 (&buf, inst)); 4909 get_field_r2 (&buf, inst));
@@ -4916,7 +4914,7 @@ index 1fe8da2e51b..fc15d210fe0 100644
4916 break; 4914 break;
4917 case INST_TYPE_R2: 4915 case INST_TYPE_R2:
4918 print_func (stream, "\t%s", get_field_r2 (&buf, inst)); 4916 print_func (stream, "\t%s", get_field_r2 (&buf, inst));
4919@@ -440,8 +457,8 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info) 4917@@ -440,8 +457,8 @@ print_insn_microblaze (bfd_vma memaddr,
4920 case INST_TYPE_NONE: 4918 case INST_TYPE_NONE:
4921 break; 4919 break;
4922 /* For bit field insns. */ 4920 /* For bit field insns. */
@@ -4927,10 +4925,10 @@ index 1fe8da2e51b..fc15d210fe0 100644
4927 break; 4925 break;
4928 /* For tuqula instruction */ 4926 /* For tuqula instruction */
4929 case INST_TYPE_RD: 4927 case INST_TYPE_RD:
4930diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h 4928Index: git/opcodes/microblaze-opc.h
4931index 6fcded04b49..4a1545d8920 100644 4929===================================================================
4932--- a/opcodes/microblaze-opc.h 4930--- git.orig/opcodes/microblaze-opc.h
4933+++ b/opcodes/microblaze-opc.h 4931+++ git/opcodes/microblaze-opc.h
4934@@ -40,7 +40,7 @@ 4932@@ -40,7 +40,7 @@
4935 #define INST_TYPE_RD_SPECIAL 11 4933 #define INST_TYPE_RD_SPECIAL 11
4936 #define INST_TYPE_R1 12 4934 #define INST_TYPE_R1 12
@@ -5155,10 +5153,10 @@ index 6fcded04b49..4a1545d8920 100644
5155+ 5153+
5156 #endif /* MICROBLAZE_OPC */ 5154 #endif /* MICROBLAZE_OPC */
5157 5155
5158diff --git a/opcodes/microblaze-opcm.h b/opcodes/microblaze-opcm.h 5156Index: git/opcodes/microblaze-opcm.h
5159index 78a2ac44960..70e351f6f4e 100644 5157===================================================================
5160--- a/opcodes/microblaze-opcm.h 5158--- git.orig/opcodes/microblaze-opcm.h
5161+++ b/opcodes/microblaze-opcm.h 5159+++ git/opcodes/microblaze-opcm.h
5162@@ -25,6 +25,7 @@ 5160@@ -25,6 +25,7 @@
5163 5161
5164 enum microblaze_instr 5162 enum microblaze_instr
@@ -5218,6 +5216,3 @@ index 78a2ac44960..70e351f6f4e 100644
5218 5216
5219 /* FSL imm mask for get, put instructions. */ 5217 /* FSL imm mask for get, put instructions. */
5220 #define RFSL_MASK 0x000000F 5218 #define RFSL_MASK 0x000000F
5221--
52222.17.1
5223
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0017-Fixed-MB-x-relocation-issues.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0017-Fixed-MB-x-relocation-issues.patch
index a14b7159..7b05d13c 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0017-Fixed-MB-x-relocation-issues.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0017-Fixed-MB-x-relocation-issues.patch
@@ -13,11 +13,11 @@ Conflicts:
13 gas/tc.h | 2 +- 13 gas/tc.h | 2 +-
14 3 files changed, 152 insertions(+), 53 deletions(-) 14 3 files changed, 152 insertions(+), 53 deletions(-)
15 15
16diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 16Index: git/bfd/elf64-microblaze.c
17index 46c4aba46f1..010ee1d15b4 100644 17===================================================================
18--- a/bfd/elf64-microblaze.c 18--- git.orig/bfd/elf64-microblaze.c
19+++ b/bfd/elf64-microblaze.c 19+++ git/bfd/elf64-microblaze.c
20@@ -1511,6 +1511,14 @@ microblaze_elf_relocate_section (bfd *output_bfd, 20@@ -1511,6 +1511,14 @@ microblaze_elf_relocate_section (bfd *ou
21 bfd_put_16 (input_bfd, relocation & 0xffff, 21 bfd_put_16 (input_bfd, relocation & 0xffff,
22 contents + offset + endian); 22 contents + offset + endian);
23 23
@@ -32,7 +32,7 @@ index 46c4aba46f1..010ee1d15b4 100644
32 else 32 else
33 { 33 {
34 bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff, 34 bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff,
35@@ -1618,6 +1626,14 @@ microblaze_elf_relocate_section (bfd *output_bfd, 35@@ -1618,6 +1626,14 @@ microblaze_elf_relocate_section (bfd *ou
36 bfd_put_16 (input_bfd, relocation & 0xffff, 36 bfd_put_16 (input_bfd, relocation & 0xffff,
37 contents + offset + endian); 37 contents + offset + endian);
38 } 38 }
@@ -70,7 +70,7 @@ index 46c4aba46f1..010ee1d15b4 100644
70 } 70 }
71 71
72 /* Read-modify-write into the bfd, an immediate value into appropriate fields of 72 /* Read-modify-write into the bfd, an immediate value into appropriate fields of
73@@ -1741,10 +1767,18 @@ microblaze_bfd_write_imm_value_64 (bfd *abfd, bfd_byte *bfd_addr, bfd_vma val) 73@@ -1741,10 +1767,18 @@ microblaze_bfd_write_imm_value_64 (bfd *
74 unsigned long instr_lo; 74 unsigned long instr_lo;
75 75
76 instr_hi = bfd_get_32 (abfd, bfd_addr); 76 instr_hi = bfd_get_32 (abfd, bfd_addr);
@@ -93,11 +93,11 @@ index 46c4aba46f1..010ee1d15b4 100644
93 instr_lo = bfd_get_32 (abfd, bfd_addr + INST_WORD_SIZE); 93 instr_lo = bfd_get_32 (abfd, bfd_addr + INST_WORD_SIZE);
94 instr_lo &= ~0x0000ffff; 94 instr_lo &= ~0x0000ffff;
95 instr_lo |= (val & 0x0000ffff); 95 instr_lo |= (val & 0x0000ffff);
96diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 96Index: git/gas/config/tc-microblaze.c
97index 685a6e93f2b..9b311ed1450 100644 97===================================================================
98--- a/gas/config/tc-microblaze.c 98--- git.orig/gas/config/tc-microblaze.c
99+++ b/gas/config/tc-microblaze.c 99+++ git/gas/config/tc-microblaze.c
100@@ -392,7 +392,7 @@ microblaze_s_weakext (int ignore ATTRIBUTE_UNUSED) 100@@ -392,7 +392,7 @@ microblaze_s_weakext (int ignore ATTRIBU
101 Integer arg to pass to the function. */ 101 Integer arg to pass to the function. */
102 /* If the pseudo-op is not found in this table, it searches in the obj-elf.c, 102 /* If the pseudo-op is not found in this table, it searches in the obj-elf.c,
103 and then in the read.c table. */ 103 and then in the read.c table. */
@@ -119,8 +119,8 @@ index 685a6e93f2b..9b311ed1450 100644
119 unsigned reg2; 119 unsigned reg2;
120 unsigned reg3; 120 unsigned reg3;
121 unsigned isize; 121 unsigned isize;
122- unsigned int immed, immed2, temp; 122- unsigned int immed = 0, immed2 = 0, temp;
123+ unsigned long immed, immed2, temp; 123+ unsigned long immed = 0, immed2 = 0, temp;
124 expressionS exp; 124 expressionS exp;
125 char name[20]; 125 char name[20];
126 long immedl; 126 long immedl;
@@ -316,7 +316,7 @@ index 685a6e93f2b..9b311ed1450 100644
316 if (fixP->fx_r_type == BFD_RELOC_MICROBLAZE_64) 316 if (fixP->fx_r_type == BFD_RELOC_MICROBLAZE_64)
317 fixP->fx_r_type = BFD_RELOC_64; 317 fixP->fx_r_type = BFD_RELOC_64;
318 if (fixP->fx_r_type == BFD_RELOC_MICROBLAZE_64_PCREL) 318 if (fixP->fx_r_type == BFD_RELOC_MICROBLAZE_64_PCREL)
319@@ -2636,7 +2693,14 @@ md_estimate_size_before_relax (fragS * fragP, 319@@ -2636,7 +2693,14 @@ md_estimate_size_before_relax (fragS * f
320 } 320 }
321 else 321 else
322 { 322 {
@@ -332,7 +332,7 @@ index 685a6e93f2b..9b311ed1450 100644
332 fragP->fr_var = INST_WORD_SIZE*2; 332 fragP->fr_var = INST_WORD_SIZE*2;
333 } 333 }
334 break; 334 break;
335@@ -2913,6 +2977,7 @@ md_parse_option (int c, const char * arg ATTRIBUTE_UNUSED) 335@@ -2913,6 +2977,7 @@ md_parse_option (int c, const char * arg
336 case OPTION_M64: 336 case OPTION_M64:
337 //if (arg != NULL && strcmp (arg, "64") == 0) 337 //if (arg != NULL && strcmp (arg, "64") == 0)
338 microblaze_arch_size = 64; 338 microblaze_arch_size = 64;
@@ -340,10 +340,10 @@ index 685a6e93f2b..9b311ed1450 100644
340 break; 340 break;
341 default: 341 default:
342 return 0; 342 return 0;
343diff --git a/gas/tc.h b/gas/tc.h 343Index: git/gas/tc.h
344index c9722307dea..f1fa7495e29 100644 344===================================================================
345--- a/gas/tc.h 345--- git.orig/gas/tc.h
346+++ b/gas/tc.h 346+++ git/gas/tc.h
347@@ -22,7 +22,7 @@ 347@@ -22,7 +22,7 @@
348 /* In theory (mine, at least!) the machine dependent part of the assembler 348 /* In theory (mine, at least!) the machine dependent part of the assembler
349 should only have to include one file. This one. -- JF */ 349 should only have to include one file. This one. -- JF */
@@ -353,6 +353,3 @@ index c9722307dea..f1fa7495e29 100644
353 353
354 const char * md_atof (int, char *, int *); 354 const char * md_atof (int, char *, int *);
355 int md_parse_option (int, const char *); 355 int md_parse_option (int, const char *);
356--
3572.17.1
358
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0025-Added-support-to-new-arithmetic-single-register-inst.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0025-Added-support-to-new-arithmetic-single-register-inst.patch
index d0c23c91..f614a245 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0025-Added-support-to-new-arithmetic-single-register-inst.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0025-Added-support-to-new-arithmetic-single-register-inst.patch
@@ -17,10 +17,10 @@ Conflicts:
17 opcodes/microblaze-opcm.h | 5 +- 17 opcodes/microblaze-opcm.h | 5 +-
18 4 files changed, 200 insertions(+), 6 deletions(-) 18 4 files changed, 200 insertions(+), 6 deletions(-)
19 19
20diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 20Index: git/gas/config/tc-microblaze.c
21index 52058d94f98..1a543c328f2 100644 21===================================================================
22--- a/gas/config/tc-microblaze.c 22--- git.orig/gas/config/tc-microblaze.c
23+++ b/gas/config/tc-microblaze.c 23+++ git/gas/config/tc-microblaze.c
24@@ -423,12 +423,33 @@ void 24@@ -423,12 +423,33 @@ void
25 md_begin (void) 25 md_begin (void)
26 { 26 {
@@ -68,12 +68,12 @@ index 52058d94f98..1a543c328f2 100644
68@@ -996,9 +1018,10 @@ md_assemble (char * str) 68@@ -996,9 +1018,10 @@ md_assemble (char * str)
69 unsigned reg3; 69 unsigned reg3;
70 unsigned isize; 70 unsigned isize;
71 unsigned long immed, immed2, temp; 71 unsigned long immed = 0, immed2 = 0, temp;
72- expressionS exp; 72- expressionS exp;
73+ expressionS exp,exp1; 73+ expressionS exp, exp1;
74 char name[20]; 74 char name[20];
75 long immedl; 75 long immedl;
76+ int reg=0; 76+ int reg = 0;
77 77
78 /* Drop leading whitespace. */ 78 /* Drop leading whitespace. */
79 while (ISSPACE (* str)) 79 while (ISSPACE (* str))
@@ -209,11 +209,11 @@ index 52058d94f98..1a543c328f2 100644
209 case INST_TYPE_R1_RFSL: 209 case INST_TYPE_R1_RFSL:
210 if (strcmp (op_end, "")) 210 if (strcmp (op_end, ""))
211 op_end = parse_reg (op_end + 1, &reg1); /* Get r1. */ 211 op_end = parse_reg (op_end + 1, &reg1); /* Get r1. */
212diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c 212Index: git/opcodes/microblaze-dis.c
213index 143a0a9d59e..d945d144c44 100644 213===================================================================
214--- a/opcodes/microblaze-dis.c 214--- git.orig/opcodes/microblaze-dis.c
215+++ b/opcodes/microblaze-dis.c 215+++ git/opcodes/microblaze-dis.c
216@@ -130,6 +130,14 @@ get_field_imm15 (struct string_buf *buf, long instr) 216@@ -130,6 +130,14 @@ get_field_imm15 (struct string_buf *buf,
217 return p; 217 return p;
218 } 218 }
219 219
@@ -228,7 +228,7 @@ index 143a0a9d59e..d945d144c44 100644
228 static char * 228 static char *
229 get_field_special (struct string_buf *buf, long instr, 229 get_field_special (struct string_buf *buf, long instr,
230 const struct op_code_struct *op) 230 const struct op_code_struct *op)
231@@ -456,6 +464,9 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info) 231@@ -456,6 +464,9 @@ print_insn_microblaze (bfd_vma memaddr,
232 /* For mbar 16 or sleep insn. */ 232 /* For mbar 16 or sleep insn. */
233 case INST_TYPE_NONE: 233 case INST_TYPE_NONE:
234 break; 234 break;
@@ -238,10 +238,10 @@ index 143a0a9d59e..d945d144c44 100644
238 /* For bit field insns. */ 238 /* For bit field insns. */
239 case INST_TYPE_RD_R1_IMMW_IMMS: 239 case INST_TYPE_RD_R1_IMMW_IMMS:
240 print_func (stream, "\t%s, %s, %s, %s", get_field_rd (&buf, inst),get_field_r1(&buf, inst),get_field_immw (&buf, inst), get_field_imms (&buf, inst)); 240 print_func (stream, "\t%s, %s, %s, %s", get_field_rd (&buf, inst),get_field_r1(&buf, inst),get_field_immw (&buf, inst), get_field_imms (&buf, inst));
241diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h 241Index: git/opcodes/microblaze-opc.h
242index fff7520ae81..c25383f2de9 100644 242===================================================================
243--- a/opcodes/microblaze-opc.h 243--- git.orig/opcodes/microblaze-opc.h
244+++ b/opcodes/microblaze-opc.h 244+++ git/opcodes/microblaze-opc.h
245@@ -69,6 +69,7 @@ 245@@ -69,6 +69,7 @@
246 #define INST_TYPE_RD_R1_IMMW_IMMS 21 246 #define INST_TYPE_RD_R1_IMMW_IMMS 21
247 247
@@ -337,10 +337,10 @@ index fff7520ae81..c25383f2de9 100644
337 {"imml", INST_TYPE_IMML, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0xB2000000, OPCODE_MASK_H8, imml, immediate_inst }, 337 {"imml", INST_TYPE_IMML, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0xB2000000, OPCODE_MASK_H8, imml, immediate_inst },
338 {"breai", INST_TYPE_IMM, INST_PC_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0xB8010000, OPCODE_MASK_H12, breai, branch_inst }, 338 {"breai", INST_TYPE_IMM, INST_PC_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0xB8010000, OPCODE_MASK_H12, breai, branch_inst },
339 {"breaid", INST_TYPE_IMM, INST_PC_OFFSET, DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0xB8110000, OPCODE_MASK_H12, breaid, branch_inst }, 339 {"breaid", INST_TYPE_IMM, INST_PC_OFFSET, DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0xB8110000, OPCODE_MASK_H12, breaid, branch_inst },
340diff --git a/opcodes/microblaze-opcm.h b/opcodes/microblaze-opcm.h 340Index: git/opcodes/microblaze-opcm.h
341index 70e351f6f4e..cf7512d6a87 100644 341===================================================================
342--- a/opcodes/microblaze-opcm.h 342--- git.orig/opcodes/microblaze-opcm.h
343+++ b/opcodes/microblaze-opcm.h 343+++ git/opcodes/microblaze-opcm.h
344@@ -61,7 +61,9 @@ enum microblaze_instr 344@@ -61,7 +61,9 @@ enum microblaze_instr
345 eaputd, teaputd, ecaputd, tecaputd, neaputd, tneaputd, necaputd, tnecaputd, 345 eaputd, teaputd, ecaputd, tecaputd, neaputd, tneaputd, necaputd, tnecaputd,
346 346
@@ -359,6 +359,3 @@ index 70e351f6f4e..cf7512d6a87 100644
359+#define IMM16_MASK 0x0000FFFF 359+#define IMM16_MASK 0x0000FFFF
360 360
361 #endif /* MICROBLAZE-OPCM */ 361 #endif /* MICROBLAZE-OPCM */
362--
3632.17.1
364
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0030-Patch-microblaze-Changing-the-long-to-long-long-as-i.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0030-Patch-microblaze-Changing-the-long-to-long-long-as-i.patch
index 85f63b41..d1997929 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0030-Patch-microblaze-Changing-the-long-to-long-long-as-i.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0030-Patch-microblaze-Changing-the-long-to-long-long-as-i.patch
@@ -9,19 +9,16 @@ Signed-off-by :Nagaraju Mekala <nmekala@xilix.com>
9 gas/config/tc-microblaze.c | 2 +- 9 gas/config/tc-microblaze.c | 2 +-
10 1 file changed, 1 insertion(+), 1 deletion(-) 10 1 file changed, 1 insertion(+), 1 deletion(-)
11 11
12diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 12Index: git/gas/config/tc-microblaze.c
13index 805d250b6ac..84f60c029c1 100644 13===================================================================
14--- a/gas/config/tc-microblaze.c 14--- git.orig/gas/config/tc-microblaze.c
15+++ b/gas/config/tc-microblaze.c 15+++ git/gas/config/tc-microblaze.c
16@@ -1017,7 +1017,7 @@ md_assemble (char * str) 16@@ -1017,7 +1017,7 @@ md_assemble (char * str)
17 unsigned reg2; 17 unsigned reg2;
18 unsigned reg3; 18 unsigned reg3;
19 unsigned isize; 19 unsigned isize;
20- unsigned long immed, immed2, temp; 20- unsigned long immed = 0, immed2 = 0, temp;
21+ unsigned long long immed, immed2, temp; 21+ unsigned long long immed = 0, immed2 = 0, temp;
22 expressionS exp,exp1; 22 expressionS exp, exp1;
23 char name[20]; 23 char name[20];
24 long immedl; 24 long immedl;
25--
262.17.1
27
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0033-Add-initial-port-of-linux-gdbserver.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0033-Add-initial-port-of-linux-gdbserver.patch
index 402566be..c08a06e1 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0033-Add-initial-port-of-linux-gdbserver.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0033-Add-initial-port-of-linux-gdbserver.patch
@@ -40,11 +40,11 @@ Conflicts:
40 create mode 100644 gdb/gdbserver/linux-microblaze-low.c 40 create mode 100644 gdb/gdbserver/linux-microblaze-low.c
41 create mode 100644 gdb/regformats/reg-microblaze.dat 41 create mode 100644 gdb/regformats/reg-microblaze.dat
42 42
43diff --git a/gdb/configure.host b/gdb/configure.host 43Index: git/gdb/configure.host
44index e94a19b0332..4d73af78bc3 100644 44===================================================================
45--- a/gdb/configure.host 45--- git.orig/gdb/configure.host
46+++ b/gdb/configure.host 46+++ git/gdb/configure.host
47@@ -66,6 +66,7 @@ hppa*) gdb_host_cpu=pa ;; 47@@ -60,6 +60,7 @@ hppa*) gdb_host_cpu=pa ;;
48 i[34567]86*) gdb_host_cpu=i386 ;; 48 i[34567]86*) gdb_host_cpu=i386 ;;
49 m68*) gdb_host_cpu=m68k ;; 49 m68*) gdb_host_cpu=m68k ;;
50 mips*) gdb_host_cpu=mips ;; 50 mips*) gdb_host_cpu=mips ;;
@@ -52,20 +52,19 @@ index e94a19b0332..4d73af78bc3 100644
52 powerpc* | rs6000) gdb_host_cpu=powerpc ;; 52 powerpc* | rs6000) gdb_host_cpu=powerpc ;;
53 sparcv9 | sparc64) gdb_host_cpu=sparc ;; 53 sparcv9 | sparc64) gdb_host_cpu=sparc ;;
54 s390*) gdb_host_cpu=s390 ;; 54 s390*) gdb_host_cpu=s390 ;;
55@@ -136,6 +137,8 @@ mips*-*-netbsd* | mips*-*-knetbsd*-gnu) 55@@ -132,6 +133,8 @@ mips64*-*-openbsd*) gdb_host=obsd64 ;;
56 mips*-*-freebsd*) gdb_host=fbsd ;; 56
57 mips64*-*-openbsd*) gdb_host=obsd64 ;; 57 or1k-*-linux*) gdb_host=linux ;;
58 58
59+microblaze*-*linux*) gdb_host=linux ;; 59+microblaze*-*linux*) gdb_host=linux ;;
60+ 60+
61 powerpc-*-aix* | rs6000-*-* | powerpc64-*-aix*) 61 powerpc-*-aix* | rs6000-*-* | powerpc64-*-aix*)
62 gdb_host=aix ;; 62 gdb_host=aix ;;
63 powerpc*-*-freebsd*) gdb_host=fbsd ;; 63 powerpc*-*-freebsd*) gdb_host=fbsd ;;
64diff --git a/gdb/features/microblaze-linux.xml b/gdb/features/microblaze-linux.xml 64Index: git/gdb/features/microblaze-linux.xml
65new file mode 100644 65===================================================================
66index 00000000000..8983e66eb3d
67--- /dev/null 66--- /dev/null
68+++ b/gdb/features/microblaze-linux.xml 67+++ git/gdb/features/microblaze-linux.xml
69@@ -0,0 +1,12 @@ 68@@ -0,0 +1,12 @@
70+<?xml version="1.0"?> 69+<?xml version="1.0"?>
71+<!-- Copyright (C) 2014-2018 Free Software Foundation, Inc. 70+<!-- Copyright (C) 2014-2018 Free Software Foundation, Inc.
@@ -79,11 +78,10 @@ index 00000000000..8983e66eb3d
79+ <osabi>GNU/Linux</osabi> 78+ <osabi>GNU/Linux</osabi>
80+ <xi:include href="microblaze-core.xml"/> 79+ <xi:include href="microblaze-core.xml"/>
81+</target> 80+</target>
82diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in 81Index: git/gdb/gdbserver/Makefile.in
83new file mode 100644 82===================================================================
84index 00000000000..fb4762a22d5
85--- /dev/null 83--- /dev/null
86+++ b/gdb/gdbserver/Makefile.in 84+++ git/gdb/gdbserver/Makefile.in
87@@ -0,0 +1,712 @@ 85@@ -0,0 +1,712 @@
88+# Copyright (C) 1989-2020 Free Software Foundation, Inc. 86+# Copyright (C) 1989-2020 Free Software Foundation, Inc.
89+ 87+
@@ -797,11 +795,10 @@ index 00000000000..fb4762a22d5
797+.SECONDARY: 795+.SECONDARY:
798+ 796+
799+# This is the end of "Makefile.in". 797+# This is the end of "Makefile.in".
800diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv 798Index: git/gdb/gdbserver/configure.srv
801new file mode 100644 799===================================================================
802index 00000000000..e0d2b2fe04a
803--- /dev/null 800--- /dev/null
804+++ b/gdb/gdbserver/configure.srv 801+++ git/gdb/gdbserver/configure.srv
805@@ -0,0 +1,398 @@ 802@@ -0,0 +1,398 @@
806+# Mappings from configuration triplets to gdbserver build options. 803+# Mappings from configuration triplets to gdbserver build options.
807+# This is invoked from the autoconf-generated configure script, to 804+# This is invoked from the autoconf-generated configure script, to
@@ -1201,11 +1198,10 @@ index 00000000000..e0d2b2fe04a
1201+ exit 1 1198+ exit 1
1202+ ;; 1199+ ;;
1203+esac 1200+esac
1204diff --git a/gdb/gdbserver/linux-microblaze-low.c b/gdb/gdbserver/linux-microblaze-low.c 1201Index: git/gdb/gdbserver/linux-microblaze-low.c
1205new file mode 100644 1202===================================================================
1206index 00000000000..cba5d6fc585
1207--- /dev/null 1203--- /dev/null
1208+++ b/gdb/gdbserver/linux-microblaze-low.c 1204+++ git/gdb/gdbserver/linux-microblaze-low.c
1209@@ -0,0 +1,189 @@ 1205@@ -0,0 +1,189 @@
1210+/* GNU/Linux/Microblaze specific low level interface, for the remote server for 1206+/* GNU/Linux/Microblaze specific low level interface, for the remote server for
1211+ GDB. 1207+ GDB.
@@ -1396,10 +1392,10 @@ index 00000000000..cba5d6fc585
1396+ microblaze_collect_ptrace_register, 1392+ microblaze_collect_ptrace_register,
1397+ microblaze_supply_ptrace_register, 1393+ microblaze_supply_ptrace_register,
1398+}; 1394+};
1399diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c 1395Index: git/gdb/microblaze-linux-tdep.c
1400index 17cdc2516d4..7d488d12b52 100644 1396===================================================================
1401--- a/gdb/microblaze-linux-tdep.c 1397--- git.orig/gdb/microblaze-linux-tdep.c
1402+++ b/gdb/microblaze-linux-tdep.c 1398+++ git/gdb/microblaze-linux-tdep.c
1403@@ -37,6 +37,22 @@ 1399@@ -37,6 +37,22 @@
1404 #include "tramp-frame.h" 1400 #include "tramp-frame.h"
1405 #include "linux-tdep.h" 1401 #include "linux-tdep.h"
@@ -1423,7 +1419,7 @@ index 17cdc2516d4..7d488d12b52 100644
1423 static int 1419 static int
1424 microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, 1420 microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
1425 struct bp_target_info *bp_tgt) 1421 struct bp_target_info *bp_tgt)
1426@@ -50,13 +66,20 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, 1422@@ -50,13 +66,20 @@ microblaze_linux_memory_remove_breakpoin
1427 /* Determine appropriate breakpoint contents and size for this address. */ 1423 /* Determine appropriate breakpoint contents and size for this address. */
1428 bp = gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen); 1424 bp = gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen);
1429 1425
@@ -1445,7 +1441,7 @@ index 17cdc2516d4..7d488d12b52 100644
1445 1441
1446 return val; 1442 return val;
1447 } 1443 }
1448@@ -129,6 +152,10 @@ microblaze_linux_init_abi (struct gdbarch_info info, 1444@@ -129,6 +152,10 @@ microblaze_linux_init_abi (struct gdbarc
1449 /* Trampolines. */ 1445 /* Trampolines. */
1450 tramp_frame_prepend_unwinder (gdbarch, 1446 tramp_frame_prepend_unwinder (gdbarch,
1451 &microblaze_linux_sighandler_tramp_frame); 1447 &microblaze_linux_sighandler_tramp_frame);
@@ -1456,15 +1452,14 @@ index 17cdc2516d4..7d488d12b52 100644
1456 } 1452 }
1457 1453
1458 void _initialize_microblaze_linux_tdep (); 1454 void _initialize_microblaze_linux_tdep ();
1459diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c 1455Index: git/gdb/microblaze-tdep.c
1460index 0c3316dece1..2d6eb8ce94e 100644 1456===================================================================
1461--- a/gdb/microblaze-tdep.c 1457--- git.orig/gdb/microblaze-tdep.c
1462+++ b/gdb/microblaze-tdep.c 1458+++ git/gdb/microblaze-tdep.c
1463@@ -137,7 +137,38 @@ microblaze_fetch_instruction (CORE_ADDR pc) 1459@@ -128,7 +128,38 @@ microblaze_fetch_instruction (CORE_ADDR
1464 constexpr gdb_byte microblaze_break_insn[] = MICROBLAZE_BREAKPOINT; 1460 constexpr gdb_byte microblaze_break_insn[] = MICROBLAZE_BREAKPOINT;
1465 1461
1466 typedef BP_MANIPULATION (microblaze_break_insn) microblaze_breakpoint; 1462 typedef BP_MANIPULATION (microblaze_break_insn) microblaze_breakpoint;
1467-
1468+static int 1463+static int
1469+microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, 1464+microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
1470+ struct bp_target_info *bp_tgt) 1465+ struct bp_target_info *bp_tgt)
@@ -1494,13 +1489,13 @@ index 0c3316dece1..2d6eb8ce94e 100644
1494+ val = target_write_raw_memory (addr, bp_tgt->shadow_contents, bplen); 1489+ val = target_write_raw_memory (addr, bp_tgt->shadow_contents, bplen);
1495+ microblaze_debug ("microblaze_linux_memory_remove_breakpoint writing back to memory at addr 0x%lx\n", addr); 1490+ microblaze_debug ("microblaze_linux_memory_remove_breakpoint writing back to memory at addr 0x%lx\n", addr);
1496+ } 1491+ }
1497+ 1492
1498+ return val; 1493+ return val;
1499+} 1494+}
1500 1495
1501 /* Allocate and initialize a frame cache. */ 1496 /* Allocate and initialize a frame cache. */
1502 1497
1503@@ -729,6 +760,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 1498@@ -716,6 +747,7 @@ microblaze_gdbarch_init (struct gdbarch_
1504 microblaze_breakpoint::kind_from_pc); 1499 microblaze_breakpoint::kind_from_pc);
1505 set_gdbarch_sw_breakpoint_from_kind (gdbarch, 1500 set_gdbarch_sw_breakpoint_from_kind (gdbarch,
1506 microblaze_breakpoint::bp_from_kind); 1501 microblaze_breakpoint::bp_from_kind);
@@ -1508,17 +1503,17 @@ index 0c3316dece1..2d6eb8ce94e 100644
1508 1503
1509 set_gdbarch_frame_args_skip (gdbarch, 8); 1504 set_gdbarch_frame_args_skip (gdbarch, 8);
1510 1505
1511@@ -769,4 +801,5 @@ When non-zero, microblaze specific debugging is enabled."), 1506@@ -756,4 +788,5 @@ When non-zero, microblaze specific debug
1512 NULL, 1507 NULL,
1513 &setdebuglist, &showdebuglist); 1508 &setdebuglist, &showdebuglist);
1514 1509
1515+ 1510+
1516 } 1511 }
1517diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h 1512Index: git/gdb/microblaze-tdep.h
1518index 08af0d191c5..8a429cbf001 100644 1513===================================================================
1519--- a/gdb/microblaze-tdep.h 1514--- git.orig/gdb/microblaze-tdep.h
1520+++ b/gdb/microblaze-tdep.h 1515+++ git/gdb/microblaze-tdep.h
1521@@ -117,6 +117,8 @@ struct microblaze_frame_cache 1516@@ -118,6 +118,8 @@ struct microblaze_frame_cache
1522 1517
1523 /* MICROBLAZE_BREAKPOINT defines the breakpoint that should be used. 1518 /* MICROBLAZE_BREAKPOINT defines the breakpoint that should be used.
1524 Only used for native debugging. */ 1519 Only used for native debugging. */
@@ -1528,11 +1523,10 @@ index 08af0d191c5..8a429cbf001 100644
1528+ 1523+
1529 1524
1530 #endif /* microblaze-tdep.h */ 1525 #endif /* microblaze-tdep.h */
1531diff --git a/gdb/regformats/reg-microblaze.dat b/gdb/regformats/reg-microblaze.dat 1526Index: git/gdb/regformats/reg-microblaze.dat
1532new file mode 100644 1527===================================================================
1533index 00000000000..bd8a4384424
1534--- /dev/null 1528--- /dev/null
1535+++ b/gdb/regformats/reg-microblaze.dat 1529+++ git/gdb/regformats/reg-microblaze.dat
1536@@ -0,0 +1,41 @@ 1530@@ -0,0 +1,41 @@
1537+name:microblaze 1531+name:microblaze
1538+expedite:r1,pc 1532+expedite:r1,pc
@@ -1575,6 +1569,3 @@ index 00000000000..bd8a4384424
1575+32:fsr 1569+32:fsr
1576+32:slr 1570+32:slr
1577+32:shr 1571+32:shr
1578--
15792.17.1
1580
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0034-Initial-port-of-core-reading-support.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0034-Initial-port-of-core-reading-support.patch
index 876fc5c8..a9e9c001 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0034-Initial-port-of-core-reading-support.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0034-Initial-port-of-core-reading-support.patch
@@ -19,11 +19,11 @@ Conflicts:
19 gdb/microblaze-tdep.h | 27 ++++++++++++ 19 gdb/microblaze-tdep.h | 27 ++++++++++++
20 5 files changed, 176 insertions(+), 2 deletions(-) 20 5 files changed, 176 insertions(+), 2 deletions(-)
21 21
22diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 22Index: git/bfd/elf32-microblaze.c
23index 2a976ecbe1d..713f5e8e506 100644 23===================================================================
24--- a/bfd/elf32-microblaze.c 24--- git.orig/bfd/elf32-microblaze.c
25+++ b/bfd/elf32-microblaze.c 25+++ git/bfd/elf32-microblaze.c
26@@ -765,6 +765,87 @@ microblaze_elf_is_local_label_name (bfd *abfd, const char *name) 26@@ -765,6 +765,87 @@ microblaze_elf_is_local_label_name (bfd
27 return _bfd_elf_is_local_label_name (abfd, name); 27 return _bfd_elf_is_local_label_name (abfd, name);
28 } 28 }
29 29
@@ -111,7 +111,7 @@ index 2a976ecbe1d..713f5e8e506 100644
111 /* ELF linker hash entry. */ 111 /* ELF linker hash entry. */
112 112
113 struct elf32_mb_link_hash_entry 113 struct elf32_mb_link_hash_entry
114@@ -3572,4 +3653,7 @@ microblaze_elf_add_symbol_hook (bfd *abfd, 114@@ -3558,4 +3639,7 @@ microblaze_elf_add_symbol_hook (bfd *abf
115 #define elf_backend_size_dynamic_sections microblaze_elf_size_dynamic_sections 115 #define elf_backend_size_dynamic_sections microblaze_elf_size_dynamic_sections
116 #define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook 116 #define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook
117 117
@@ -119,23 +119,23 @@ index 2a976ecbe1d..713f5e8e506 100644
119+#define elf_backend_grok_psinfo microblaze_elf_grok_psinfo 119+#define elf_backend_grok_psinfo microblaze_elf_grok_psinfo
120+ 120+
121 #include "elf32-target.h" 121 #include "elf32-target.h"
122diff --git a/gdb/configure.tgt b/gdb/configure.tgt 122Index: git/gdb/configure.tgt
123index a928c0227a0..95095e98706 100644 123===================================================================
124--- a/gdb/configure.tgt 124--- git.orig/gdb/configure.tgt
125+++ b/gdb/configure.tgt 125+++ git/gdb/configure.tgt
126@@ -399,7 +399,7 @@ mep-*-*) 126@@ -389,7 +389,7 @@ mep-*-*)
127 127
128 microblaze*-linux-*|microblaze*-*-linux*) 128 microblaze*-linux-*|microblaze*-*-linux*)
129 # Target: Xilinx MicroBlaze running Linux 129 # Target: Xilinx MicroBlaze running Linux
130- gdb_target_obs="microblaze-tdep.o microblaze-linux-tdep.o solib-svr4.o \ 130- gdb_target_obs="microblaze-tdep.o microblaze-linux-tdep.o solib-svr4.o \
131+ gdb_target_obs="microblaze-tdep.o microblaze-linux-tdep.o solib-svr4.o glibc-tdep.o \ 131+ gdb_target_obs="microblaze-tdep.o microblaze-linux-tdep.o solib-svr4.o glibc-tdep.o \
132 symfile-mem.o linux-tdep.o" 132 symfile-mem.o linux-tdep.o"
133 gdb_sim=../sim/microblaze/libsim.a
134 ;; 133 ;;
135diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c 134 microblaze*-*-*)
136index 7d488d12b52..6ea43dd0d3c 100644 135Index: git/gdb/microblaze-linux-tdep.c
137--- a/gdb/microblaze-linux-tdep.c 136===================================================================
138+++ b/gdb/microblaze-linux-tdep.c 137--- git.orig/gdb/microblaze-linux-tdep.c
138+++ git/gdb/microblaze-linux-tdep.c
139@@ -36,6 +36,7 @@ 139@@ -36,6 +36,7 @@
140 #include "frame-unwind.h" 140 #include "frame-unwind.h"
141 #include "tramp-frame.h" 141 #include "tramp-frame.h"
@@ -144,7 +144,7 @@ index 7d488d12b52..6ea43dd0d3c 100644
144 144
145 static int microblaze_debug_flag = 0; 145 static int microblaze_debug_flag = 0;
146 146
147@@ -135,13 +136,16 @@ static struct tramp_frame microblaze_linux_sighandler_tramp_frame = 147@@ -135,13 +136,16 @@ static struct tramp_frame microblaze_lin
148 microblaze_linux_sighandler_cache_init 148 microblaze_linux_sighandler_cache_init
149 }; 149 };
150 150
@@ -162,7 +162,7 @@ index 7d488d12b52..6ea43dd0d3c 100644
162 set_gdbarch_memory_remove_breakpoint (gdbarch, 162 set_gdbarch_memory_remove_breakpoint (gdbarch,
163 microblaze_linux_memory_remove_breakpoint); 163 microblaze_linux_memory_remove_breakpoint);
164 164
165@@ -153,6 +157,17 @@ microblaze_linux_init_abi (struct gdbarch_info info, 165@@ -153,6 +157,17 @@ microblaze_linux_init_abi (struct gdbarc
166 tramp_frame_prepend_unwinder (gdbarch, 166 tramp_frame_prepend_unwinder (gdbarch,
167 &microblaze_linux_sighandler_tramp_frame); 167 &microblaze_linux_sighandler_tramp_frame);
168 168
@@ -180,11 +180,11 @@ index 7d488d12b52..6ea43dd0d3c 100644
180 /* Enable TLS support. */ 180 /* Enable TLS support. */
181 set_gdbarch_fetch_tls_load_module_address (gdbarch, 181 set_gdbarch_fetch_tls_load_module_address (gdbarch,
182 svr4_fetch_objfile_link_map); 182 svr4_fetch_objfile_link_map);
183diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c 183Index: git/gdb/microblaze-tdep.c
184index 2d6eb8ce94e..ceeee26007f 100644 184===================================================================
185--- a/gdb/microblaze-tdep.c 185--- git.orig/gdb/microblaze-tdep.c
186+++ b/gdb/microblaze-tdep.c 186+++ git/gdb/microblaze-tdep.c
187@@ -678,6 +678,43 @@ microblaze_register_g_packet_guesses (struct gdbarch *gdbarch) 187@@ -666,6 +666,43 @@ microblaze_register_g_packet_guesses (st
188 tdesc_microblaze_with_stack_protect); 188 tdesc_microblaze_with_stack_protect);
189 } 189 }
190 190
@@ -228,8 +228,8 @@ index 2d6eb8ce94e..ceeee26007f 100644
228 static struct gdbarch * 228 static struct gdbarch *
229 microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 229 microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
230 { 230 {
231@@ -731,6 +768,10 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 231@@ -718,6 +755,10 @@ microblaze_gdbarch_init (struct gdbarch_
232 tdep = XCNEW (struct gdbarch_tdep); 232 microblaze_gdbarch_tdep *tdep = new microblaze_gdbarch_tdep;
233 gdbarch = gdbarch_alloc (&info, tdep); 233 gdbarch = gdbarch_alloc (&info, tdep);
234 234
235+ tdep->gregset = NULL; 235+ tdep->gregset = NULL;
@@ -239,7 +239,7 @@ index 2d6eb8ce94e..ceeee26007f 100644
239 set_gdbarch_long_double_bit (gdbarch, 128); 239 set_gdbarch_long_double_bit (gdbarch, 128);
240 240
241 set_gdbarch_num_regs (gdbarch, MICROBLAZE_NUM_REGS); 241 set_gdbarch_num_regs (gdbarch, MICROBLAZE_NUM_REGS);
242@@ -779,6 +820,13 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 242@@ -766,6 +807,13 @@ microblaze_gdbarch_init (struct gdbarch_
243 frame_base_append_sniffer (gdbarch, dwarf2_frame_base_sniffer); 243 frame_base_append_sniffer (gdbarch, dwarf2_frame_base_sniffer);
244 if (tdesc_data != NULL) 244 if (tdesc_data != NULL)
245 tdesc_use_registers (gdbarch, tdesc, std::move (tdesc_data)); 245 tdesc_use_registers (gdbarch, tdesc, std::move (tdesc_data));
@@ -253,24 +253,24 @@ index 2d6eb8ce94e..ceeee26007f 100644
253 253
254 return gdbarch; 254 return gdbarch;
255 } 255 }
256diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h 256Index: git/gdb/microblaze-tdep.h
257index 8a429cbf001..e91991b8dba 100644 257===================================================================
258--- a/gdb/microblaze-tdep.h 258--- git.orig/gdb/microblaze-tdep.h
259+++ b/gdb/microblaze-tdep.h 259+++ git/gdb/microblaze-tdep.h
260@@ -22,8 +22,22 @@ 260@@ -23,8 +23,22 @@
261 261 #include "gdbarch.h"
262 262
263 /* Microblaze architecture-specific information. */ 263 /* Microblaze architecture-specific information. */
264+struct microblaze_gregset 264+struct microblaze_gregset
265+{ 265+{
266+ unsigned int gregs[32]; 266+ unsigned int gregs[32];
267+ unsigned int fpregs[32]; 267+ unsigned int fpregs[32];
268+ unsigned int pregs[16]; 268+ unsigned int pregs[16];
269+}; 269+};
270+ 270+
271 struct gdbarch_tdep 271 struct microblaze_gdbarch_tdep : gdbarch_tdep
272 { 272 {
273+ int dummy; // declare something. 273+ int dummy; // declare something.
274+ 274+
275+ /* Register sets. */ 275+ /* Register sets. */
276+ struct regset *gregset; 276+ struct regset *gregset;
@@ -280,7 +280,7 @@ index 8a429cbf001..e91991b8dba 100644
280 }; 280 };
281 281
282 /* Register numbers. */ 282 /* Register numbers. */
283@@ -120,5 +134,18 @@ struct microblaze_frame_cache 283@@ -121,5 +135,18 @@ struct microblaze_frame_cache
284 #define MICROBLAZE_BREAKPOINT {0xba, 0x0c, 0x00, 0x18} 284 #define MICROBLAZE_BREAKPOINT {0xba, 0x0c, 0x00, 0x18}
285 #define MICROBLAZE_BREAKPOINT_LE {0x18, 0x00, 0x0c, 0xba} 285 #define MICROBLAZE_BREAKPOINT_LE {0x18, 0x00, 0x0c, 0xba}
286 286
@@ -299,6 +299,3 @@ index 8a429cbf001..e91991b8dba 100644
299+ const char *sect_name, size_t sect_size); 299+ const char *sect_name, size_t sect_size);
300 300
301 #endif /* microblaze-tdep.h */ 301 #endif /* microblaze-tdep.h */
302--
3032.17.1
304
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0035-Fix-debug-message-when-register-is-unavailable.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0035-Fix-debug-message-when-register-is-unavailable.patch
deleted file mode 100644
index 9326e2c0..00000000
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0035-Fix-debug-message-when-register-is-unavailable.patch
+++ /dev/null
@@ -1,41 +0,0 @@
1From 59fd18d5155ffe8924ed24283def8ef434067909 Mon Sep 17 00:00:00 2001
2From: Nathan Rossi <nathan.rossi@petalogix.com>
3Date: Tue, 8 May 2012 18:11:17 +1000
4Subject: [PATCH 35/38] Fix debug message when register is unavailable
5
6Signed-off-by: Nathan Rossi <nathan.rossi@petalogix.com>
7
8Conflicts:
9 gdb/frame.c
10---
11 gdb/frame.c | 9 ++++++++-
12 1 file changed, 8 insertions(+), 1 deletion(-)
13
14diff --git a/gdb/frame.c b/gdb/frame.c
15index 3f2d2700541..d557a093f63 100644
16--- a/gdb/frame.c
17+++ b/gdb/frame.c
18@@ -1261,12 +1261,19 @@ frame_unwind_register_value (frame_info *next_frame, int regnum)
19 else
20 {
21 int i;
22- const gdb_byte *buf = value_contents (value);
23+ const gdb_byte *buf = NULL;
24+ if (value_entirely_available(value)) {
25+ buf = value_contents (value);
26+ }
27
28 fprintf_unfiltered (&debug_file, " bytes=");
29 fprintf_unfiltered (&debug_file, "[");
30+ if (buf != NULL) {
31 for (i = 0; i < register_size (gdbarch, regnum); i++)
32 fprintf_unfiltered (&debug_file, "%02x", buf[i]);
33+ } else {
34+ fprintf_unfiltered (&debug_file, "unavailable");
35+ }
36 fprintf_unfiltered (&debug_file, "]");
37 }
38 }
39--
402.17.1
41
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0036-microblaze-Add-build_gdbserver-yes-to-top-level-conf.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0036-microblaze-Add-build_gdbserver-yes-to-top-level-conf.patch
deleted file mode 100644
index 350dd8c0..00000000
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0036-microblaze-Add-build_gdbserver-yes-to-top-level-conf.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1From 112d69b1bcebf14e37049a9795ce7128e98c1a23 Mon Sep 17 00:00:00 2001
2From: David Holsgrove <david.holsgrove@xilinx.com>
3Date: Mon, 16 Dec 2013 16:37:32 +1000
4Subject: [PATCH 36/38] microblaze: Add build_gdbserver=yes to top level
5 configure.tgt
6
7For Microblaze linux toolchains, set the build_gdbserver=yes
8to allow driving gdbserver configuration from the upper level
9
10This patch has been absorbed into the original patch to add
11linux gdbserver support for Microblaze.
12
13Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
14---
15 gdb/configure.tgt | 1 +
16 1 file changed, 1 insertion(+)
17
18diff --git a/gdb/configure.tgt b/gdb/configure.tgt
19index 95095e98706..47497ac3d39 100644
20--- a/gdb/configure.tgt
21+++ b/gdb/configure.tgt
22@@ -407,6 +407,7 @@ microblaze*-*-*)
23 # Target: Xilinx MicroBlaze running standalone
24 gdb_target_obs="microblaze-tdep.o"
25 gdb_sim=../sim/microblaze/libsim.a
26+ build_gdbserver=yes
27 ;;
28
29 mips*-*-linux*)
30--
312.17.1
32
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0037-Fixing-the-issues-related-to-GDB-7.12.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0037-Fixing-the-issues-related-to-GDB-7.12.patch
deleted file mode 100644
index 14ebbb63..00000000
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0037-Fixing-the-issues-related-to-GDB-7.12.patch
+++ /dev/null
@@ -1,220 +0,0 @@
1From 3d14409964a92753c3176b6af84ba4c80011237f Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Fri, 17 Feb 2017 14:09:40 +0530
4Subject: [PATCH 37/38] Fixing the issues related to GDB-7.12
5
6added all the required function which are new in 7.12 and removed
7few deprecated functions from 7.6
8
9Conflicts:
10 gdb/config/microblaze/linux.mh
11---
12 gdb/config/microblaze/linux.mh | 11 ++++
13 gdb/gdbserver/configure.srv | 3 +-
14 gdb/gdbserver/linux-microblaze-low.c | 97 ++++++++++++++++++++++++----
15 gdb/microblaze-tdep.h | 1 +
16 4 files changed, 97 insertions(+), 15 deletions(-)
17 create mode 100644 gdb/config/microblaze/linux.mh
18
19diff --git a/gdb/config/microblaze/linux.mh b/gdb/config/microblaze/linux.mh
20new file mode 100644
21index 00000000000..74a53b854a4
22--- /dev/null
23+++ b/gdb/config/microblaze/linux.mh
24@@ -0,0 +1,11 @@
25+# Host: Microblaze, running Linux
26+
27+#linux-nat.o linux-waitpid.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o
28+NAT_FILE= config/nm-linux.h
29+NATDEPFILES= inf-ptrace.o fork-child.o \
30+ microblaze-linux-nat.o proc-service.o linux-thread-db.o \
31+ linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
32+ linux-waitpid.o linux-personality.o linux-namespaces.o
33+NAT_CDEPS = $(srcdir)/proc-service.list
34+
35+LOADLIBES = -ldl $(RDYNAMIC)
36diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
37index e0d2b2fe04a..26db2dd2461 100644
38--- a/gdb/gdbserver/configure.srv
39+++ b/gdb/gdbserver/configure.srv
40@@ -185,8 +185,7 @@ case "${target}" in
41 srv_linux_thread_db=yes
42 ;;
43 microblaze*-*-linux*) srv_regobj="microblaze-linux.o"
44- srv_tgtobj="linux-low.o linux-osdata.o linux-microblaze-low.o "
45- srv_tgtobj="${srv_tgtobj} linux-procfs.o linux-ptrace.o"
46+ srv_tgtobj="$srv_linux_obj linux-microblaze-low.o "
47 srv_xmlfiles="microblaze-linux.xml"
48 srv_linux_regsets=yes
49 srv_linux_usrregs=yes
50diff --git a/gdb/gdbserver/linux-microblaze-low.c b/gdb/gdbserver/linux-microblaze-low.c
51index cba5d6fc585..a2733f3c21c 100644
52--- a/gdb/gdbserver/linux-microblaze-low.c
53+++ b/gdb/gdbserver/linux-microblaze-low.c
54@@ -39,10 +39,11 @@ static int microblaze_regmap[] =
55 PT_FSR
56 };
57
58-#define microblaze_num_regs (sizeof microblaze_regmap / sizeof microblaze_regmap[0])
59+#define microblaze_num_regs (sizeof (microblaze_regmap) / sizeof (microblaze_regmap[0]))
60
61 /* Defined in auto-generated file microblaze-linux.c. */
62 void init_registers_microblaze (void);
63+extern const struct target_desc *tdesc_microblaze;
64
65 static int
66 microblaze_cannot_store_register (int regno)
67@@ -81,6 +82,15 @@ microblaze_set_pc (struct regcache *regcache, CORE_ADDR pc)
68 static const unsigned long microblaze_breakpoint = 0xba0c0018;
69 #define microblaze_breakpoint_len 4
70
71+/* Implementation of linux_target_ops method "sw_breakpoint_from_kind". */
72+
73+static const gdb_byte *
74+microblaze_sw_breakpoint_from_kind (int kind, int *size)
75+{
76+ *size = microblaze_breakpoint_len;
77+ return (const gdb_byte *) &microblaze_breakpoint;
78+}
79+
80 static int
81 microblaze_breakpoint_at (CORE_ADDR where)
82 {
83@@ -107,7 +117,7 @@ microblaze_reinsert_addr (struct regcache *regcache)
84 static void
85 microblaze_collect_ptrace_register (struct regcache *regcache, int regno, char *buf)
86 {
87- int size = register_size (regno);
88+ int size = register_size (regcache->tdesc, regno);
89
90 memset (buf, 0, sizeof (long));
91
92@@ -121,7 +131,7 @@ static void
93 microblaze_supply_ptrace_register (struct regcache *regcache,
94 int regno, const char *buf)
95 {
96- int size = register_size (regno);
97+ int size = register_size (regcache->tdesc, regno);
98
99 if (regno == 0) {
100 unsigned long regbuf_0 = 0;
101@@ -157,33 +167,94 @@ microblaze_store_gregset (struct regcache *regcache, const void *buf)
102
103 #endif /* HAVE_PTRACE_GETREGS */
104
105-struct regset_info target_regsets[] = {
106+static struct regset_info microblaze_regsets[] = {
107 #ifdef HAVE_PTRACE_GETREGS
108 { PTRACE_GETREGS, PTRACE_SETREGS, 0, sizeof (elf_gregset_t), GENERAL_REGS, microblaze_fill_gregset, microblaze_store_gregset },
109- { 0, 0, 0, -1, -1, NULL, NULL },
110+ { 0, 0, 0, -1, GENERAL_REGS, NULL, NULL },
111 #endif /* HAVE_PTRACE_GETREGS */
112- { 0, 0, 0, -1, -1, NULL, NULL }
113+ { 0, 0, 0, -1, GENERAL_REGS, NULL, NULL },
114+ NULL_REGSET
115 };
116
117+static struct usrregs_info microblaze_usrregs_info =
118+ {
119+ microblaze_num_regs,
120+ microblaze_regmap,
121+ };
122+
123+static struct regsets_info microblaze_regsets_info =
124+ {
125+ microblaze_regsets, /* regsets */
126+ 0, /* num_regsets */
127+ NULL, /* disabled_regsets */
128+ };
129+
130+static struct regs_info regs_info =
131+ {
132+ NULL, /* regset_bitmap */
133+ &microblaze_usrregs_info,
134+ &microblaze_regsets_info
135+ };
136+
137+static const struct regs_info *
138+microblaze_regs_info (void)
139+{
140+ return &regs_info;
141+}
142+
143+/* Support for hardware single step. */
144+
145+static int
146+microblaze_supports_hardware_single_step (void)
147+{
148+ return 1;
149+}
150+
151+
152+static void
153+microblaze_arch_setup (void)
154+{
155+ current_process ()->tdesc = tdesc_microblaze;
156+}
157+
158 struct linux_target_ops the_low_target = {
159- init_registers_microblaze,
160- microblaze_num_regs,
161- microblaze_regmap,
162- NULL,
163+ microblaze_arch_setup,
164+ microblaze_regs_info,
165 microblaze_cannot_fetch_register,
166 microblaze_cannot_store_register,
167 NULL, /* fetch_register */
168 microblaze_get_pc,
169 microblaze_set_pc,
170- (const unsigned char *) &microblaze_breakpoint,
171- microblaze_breakpoint_len,
172- microblaze_reinsert_addr,
173+ NULL,
174+ microblaze_sw_breakpoint_from_kind,
175+ NULL,
176 0,
177 microblaze_breakpoint_at,
178 NULL,
179 NULL,
180 NULL,
181 NULL,
182+ NULL,
183 microblaze_collect_ptrace_register,
184 microblaze_supply_ptrace_register,
185+ NULL, /* siginfo_fixup */
186+ NULL, /* new_process */
187+ NULL, /* new_thread */
188+ NULL, /* new_fork */
189+ NULL, /* prepare_to_resume */
190+ NULL, /* process_qsupported */
191+ NULL, /* supports_tracepoints */
192+ NULL, /* get_thread_area */
193+ NULL, /* install_fast_tracepoint_jump_pad */
194+ NULL, /* emit_ops */
195+ NULL, /* get_min_fast_tracepoint_insn_len */
196+ NULL, /* supports_range_stepping */
197+ NULL, /* breakpoint_kind_from_current_state */
198+ microblaze_supports_hardware_single_step,
199 };
200+
201+void
202+initialize_low_arch (void)
203+{
204+ init_registers_microblaze ();
205+}
206diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h
207index e91991b8dba..872a3931f20 100644
208--- a/gdb/microblaze-tdep.h
209+++ b/gdb/microblaze-tdep.h
210@@ -24,6 +24,7 @@
211 /* Microblaze architecture-specific information. */
212 struct microblaze_gregset
213 {
214+ microblaze_gregset() {}
215 unsigned int gregs[32];
216 unsigned int fpregs[32];
217 unsigned int pregs[16];
218--
2192.17.1
220
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0039-Patch-MicroBlaze-Double-free-with-ld-no-keep-memory.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0039-Patch-MicroBlaze-Double-free-with-ld-no-keep-memory.patch
index b79640b0..89257eb4 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0039-Patch-MicroBlaze-Double-free-with-ld-no-keep-memory.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0039-Patch-MicroBlaze-Double-free-with-ld-no-keep-memory.patch
@@ -10,10 +10,10 @@ Subject: [PATCH] [Patch,MicroBlaze] : Double free with ld --no-keep-memory.
10 bfd/elf64-microblaze.c | 43 ++++++++++++++++++++---------------------- 10 bfd/elf64-microblaze.c | 43 ++++++++++++++++++++----------------------
11 2 files changed, 41 insertions(+), 41 deletions(-) 11 2 files changed, 41 insertions(+), 41 deletions(-)
12 12
13diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 13Index: git/bfd/elf32-microblaze.c
14index 290e70e0f4..cbbedddd1a 100644 14===================================================================
15--- a/bfd/elf32-microblaze.c 15--- git.orig/bfd/elf32-microblaze.c
16+++ b/bfd/elf32-microblaze.c 16+++ git/bfd/elf32-microblaze.c
17@@ -1839,10 +1839,8 @@ microblaze_elf_relax_section (bfd *abfd, 17@@ -1839,10 +1839,8 @@ microblaze_elf_relax_section (bfd *abfd,
18 { 18 {
19 Elf_Internal_Shdr *symtab_hdr; 19 Elf_Internal_Shdr *symtab_hdr;
@@ -42,7 +42,7 @@ index 290e70e0f4..cbbedddd1a 100644
42 42
43 if (!bfd_get_section_contents (abfd, sec, contents, 43 if (!bfd_get_section_contents (abfd, sec, contents,
44 (file_ptr) 0, sec->size)) 44 (file_ptr) 0, sec->size))
45@@ -2445,25 +2440,26 @@ microblaze_elf_relax_section (bfd *abfd, 45@@ -2413,25 +2408,26 @@ microblaze_elf_relax_section (bfd *abfd,
46 } 46 }
47 47
48 elf_section_data (sec)->relocs = internal_relocs; 48 elf_section_data (sec)->relocs = internal_relocs;
@@ -56,14 +56,15 @@ index 290e70e0f4..cbbedddd1a 100644
56 56
57- free (free_relocs); 57- free (free_relocs);
58- free_relocs = NULL; 58- free_relocs = NULL;
59+ if (internal_relocs != NULL 59-
60+ && elf_section_data (sec)->relocs != internal_relocs)
61+ free (internal_relocs);
62
63- if (free_contents != NULL) 60- if (free_contents != NULL)
64- { 61- {
65- if (!link_info->keep_memory) 62- if (!link_info->keep_memory)
66- free (free_contents); 63- free (free_contents);
64+ if (internal_relocs != NULL
65+ && elf_section_data (sec)->relocs != internal_relocs)
66+ free (internal_relocs);
67+
67+ if (contents != NULL 68+ if (contents != NULL
68+ && elf_section_data (sec)->this_hdr.contents != contents) 69+ && elf_section_data (sec)->this_hdr.contents != contents)
69+ { 70+ {
@@ -80,7 +81,7 @@ index 290e70e0f4..cbbedddd1a 100644
80 } 81 }
81 82
82 if (sec->relax_count == 0) 83 if (sec->relax_count == 0)
83@@ -2477,8 +2473,15 @@ microblaze_elf_relax_section (bfd *abfd, 84@@ -2445,8 +2441,15 @@ microblaze_elf_relax_section (bfd *abfd,
84 return true; 85 return true;
85 86
86 error_return: 87 error_return:
@@ -98,10 +99,10 @@ index 290e70e0f4..cbbedddd1a 100644
98 free (sec->relax); 99 free (sec->relax);
99 sec->relax = NULL; 100 sec->relax = NULL;
100 sec->relax_count = 0; 101 sec->relax_count = 0;
101diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 102Index: git/bfd/elf64-microblaze.c
102index 7bad93e706..677499e672 100644 103===================================================================
103--- a/bfd/elf64-microblaze.c 104--- git.orig/bfd/elf64-microblaze.c
104+++ b/bfd/elf64-microblaze.c 105+++ git/bfd/elf64-microblaze.c
105@@ -1849,10 +1849,8 @@ microblaze_elf_relax_section (bfd *abfd, 106@@ -1849,10 +1849,8 @@ microblaze_elf_relax_section (bfd *abfd,
106 { 107 {
107 Elf_Internal_Shdr *symtab_hdr; 108 Elf_Internal_Shdr *symtab_hdr;
@@ -131,7 +132,7 @@ index 7bad93e706..677499e672 100644
131 if (!bfd_get_section_contents (abfd, sec, contents, 132 if (!bfd_get_section_contents (abfd, sec, contents,
132 (file_ptr) 0, sec->size)) 133 (file_ptr) 0, sec->size))
133 goto error_return; 134 goto error_return;
134@@ -2454,28 +2448,26 @@ microblaze_elf_relax_section (bfd *abfd, 135@@ -2434,28 +2428,26 @@ microblaze_elf_relax_section (bfd *abfd,
135 } 136 }
136 137
137 elf_section_data (sec)->relocs = internal_relocs; 138 elf_section_data (sec)->relocs = internal_relocs;
@@ -171,7 +172,7 @@ index 7bad93e706..677499e672 100644
171 } 172 }
172 173
173 if (sec->relax_count == 0) 174 if (sec->relax_count == 0)
174@@ -2489,10 +2481,15 @@ microblaze_elf_relax_section (bfd *abfd, 175@@ -2469,10 +2461,15 @@ microblaze_elf_relax_section (bfd *abfd,
175 return true; 176 return true;
176 177
177 error_return: 178 error_return:
@@ -191,6 +192,3 @@ index 7bad93e706..677499e672 100644
191 if (sec->relax != NULL) 192 if (sec->relax != NULL)
192 { 193 {
193 free (sec->relax); 194 free (sec->relax);
194--
1952.17.1
196
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0040-Patch-MicroBlaze-Fixing-the-imm-imml-generation-for-.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0040-Patch-MicroBlaze-Fixing-the-imm-imml-generation-for-.patch
index f93b87ee..30ba75ba 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0040-Patch-MicroBlaze-Fixing-the-imm-imml-generation-for-.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0040-Patch-MicroBlaze-Fixing-the-imm-imml-generation-for-.patch
@@ -9,11 +9,11 @@ Subject: [PATCH] [Patch,MicroBlaze] : Fixing the imm/imml generation for 16
9 bfd/elf64-microblaze.c | 5 ++++- 9 bfd/elf64-microblaze.c | 5 ++++-
10 2 files changed, 9 insertions(+), 2 deletions(-) 10 2 files changed, 9 insertions(+), 2 deletions(-)
11 11
12diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 12Index: git/bfd/elf32-microblaze.c
13index 37a1873570..290e70e0f4 100644 13===================================================================
14--- a/bfd/elf32-microblaze.c 14--- git.orig/bfd/elf32-microblaze.c
15+++ b/bfd/elf32-microblaze.c 15+++ git/bfd/elf32-microblaze.c
16@@ -1977,7 +1977,11 @@ microblaze_elf_relax_section (bfd *abfd, 16@@ -1972,7 +1972,11 @@ microblaze_elf_relax_section (bfd *abfd,
17 else 17 else
18 symval += irel->r_addend; 18 symval += irel->r_addend;
19 19
@@ -26,11 +26,11 @@ index 37a1873570..290e70e0f4 100644
26 { 26 {
27 /* We can delete this instruction. */ 27 /* We can delete this instruction. */
28 sec->relax[sec->relax_count].addr = irel->r_offset; 28 sec->relax[sec->relax_count].addr = irel->r_offset;
29diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 29Index: git/bfd/elf64-microblaze.c
30index bd1c7d3b1f..7bad93e706 100644 30===================================================================
31--- a/bfd/elf64-microblaze.c 31--- git.orig/bfd/elf64-microblaze.c
32+++ b/bfd/elf64-microblaze.c 32+++ git/bfd/elf64-microblaze.c
33@@ -1987,7 +1987,10 @@ microblaze_elf_relax_section (bfd *abfd, 33@@ -1981,7 +1981,10 @@ microblaze_elf_relax_section (bfd *abfd,
34 else 34 else
35 symval += irel->r_addend; 35 symval += irel->r_addend;
36 36
@@ -42,6 +42,3 @@ index bd1c7d3b1f..7bad93e706 100644
42 { 42 {
43 /* We can delete this instruction. */ 43 /* We can delete this instruction. */
44 sec->relax[sec->relax_count].addr = irel->r_offset; 44 sec->relax[sec->relax_count].addr = irel->r_offset;
45--
462.17.1
47
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0041-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0041-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch
index f98f6e99..ed32dedc 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0041-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0041-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch
@@ -10,11 +10,11 @@ Subject: [PATCH] [Patch,MicroBlaze] : Invalid data offsets (pointer) after
10 bfd/elf64-microblaze.c | 17 +++++++++++++++++ 10 bfd/elf64-microblaze.c | 17 +++++++++++++++++
11 2 files changed, 35 insertions(+) 11 2 files changed, 35 insertions(+)
12 12
13diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 13Index: git/bfd/elf32-microblaze.c
14index 713f5e8e50..37a1873570 100644 14===================================================================
15--- a/bfd/elf32-microblaze.c 15--- git.orig/bfd/elf32-microblaze.c
16+++ b/bfd/elf32-microblaze.c 16+++ git/bfd/elf32-microblaze.c
17@@ -2131,6 +2131,9 @@ microblaze_elf_relax_section (bfd *abfd, 17@@ -2130,6 +2130,9 @@ microblaze_elf_relax_section (bfd *abfd,
18 { 18 {
19 unsigned int val; 19 unsigned int val;
20 20
@@ -24,7 +24,7 @@ index 713f5e8e50..37a1873570 100644
24 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 24 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
25 25
26 /* hax: We only do the following fixup for debug location lists. */ 26 /* hax: We only do the following fixup for debug location lists. */
27@@ -2172,6 +2175,9 @@ microblaze_elf_relax_section (bfd *abfd, 27@@ -2171,6 +2174,9 @@ microblaze_elf_relax_section (bfd *abfd,
28 } 28 }
29 if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32) 29 if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32)
30 { 30 {
@@ -34,7 +34,7 @@ index 713f5e8e50..37a1873570 100644
34 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 34 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
35 35
36 /* Look at the reloc only if the value has been resolved. */ 36 /* Look at the reloc only if the value has been resolved. */
37@@ -2204,6 +2210,9 @@ microblaze_elf_relax_section (bfd *abfd, 37@@ -2203,6 +2209,9 @@ microblaze_elf_relax_section (bfd *abfd,
38 } 38 }
39 else if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_SYM_OP_SYM) 39 else if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_SYM_OP_SYM)
40 { 40 {
@@ -44,7 +44,7 @@ index 713f5e8e50..37a1873570 100644
44 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 44 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
45 45
46 /* Look at the reloc only if the value has been resolved. */ 46 /* Look at the reloc only if the value has been resolved. */
47@@ -2241,6 +2250,9 @@ microblaze_elf_relax_section (bfd *abfd, 47@@ -2240,6 +2249,9 @@ microblaze_elf_relax_section (bfd *abfd,
48 || (ELF32_R_TYPE (irelscan->r_info) 48 || (ELF32_R_TYPE (irelscan->r_info)
49 == (int) R_MICROBLAZE_TEXTREL_32_LO)) 49 == (int) R_MICROBLAZE_TEXTREL_32_LO))
50 { 50 {
@@ -54,7 +54,7 @@ index 713f5e8e50..37a1873570 100644
54 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 54 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
55 55
56 /* Look at the reloc only if the value has been resolved. */ 56 /* Look at the reloc only if the value has been resolved. */
57@@ -2287,6 +2299,9 @@ microblaze_elf_relax_section (bfd *abfd, 57@@ -2286,6 +2298,9 @@ microblaze_elf_relax_section (bfd *abfd,
58 || (ELF32_R_TYPE (irelscan->r_info) 58 || (ELF32_R_TYPE (irelscan->r_info)
59 == (int) R_MICROBLAZE_TEXTREL_64)) 59 == (int) R_MICROBLAZE_TEXTREL_64))
60 { 60 {
@@ -64,7 +64,7 @@ index 713f5e8e50..37a1873570 100644
64 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 64 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
65 65
66 /* Look at the reloc only if the value has been resolved. */ 66 /* Look at the reloc only if the value has been resolved. */
67@@ -2331,6 +2346,9 @@ microblaze_elf_relax_section (bfd *abfd, 67@@ -2320,6 +2335,9 @@ microblaze_elf_relax_section (bfd *abfd,
68 } 68 }
69 else if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_PCREL) 69 else if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_PCREL)
70 { 70 {
@@ -74,11 +74,11 @@ index 713f5e8e50..37a1873570 100644
74 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 74 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
75 75
76 /* Look at the reloc only if the value has been resolved. */ 76 /* Look at the reloc only if the value has been resolved. */
77diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 77Index: git/bfd/elf64-microblaze.c
78index 210b84b2a5..bd1c7d3b1f 100644 78===================================================================
79--- a/bfd/elf64-microblaze.c 79--- git.orig/bfd/elf64-microblaze.c
80+++ b/bfd/elf64-microblaze.c 80+++ git/bfd/elf64-microblaze.c
81@@ -2138,6 +2138,8 @@ microblaze_elf_relax_section (bfd *abfd, 81@@ -2135,6 +2135,8 @@ microblaze_elf_relax_section (bfd *abfd,
82 if (1 && ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_NONE) 82 if (1 && ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_NONE)
83 { 83 {
84 unsigned int val; 84 unsigned int val;
@@ -87,7 +87,7 @@ index 210b84b2a5..bd1c7d3b1f 100644
87 87
88 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 88 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
89 89
90@@ -2180,6 +2182,9 @@ microblaze_elf_relax_section (bfd *abfd, 90@@ -2177,6 +2179,9 @@ microblaze_elf_relax_section (bfd *abfd,
91 if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32 91 if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32
92 || ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_IMML_64) 92 || ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_IMML_64)
93 { 93 {
@@ -97,7 +97,7 @@ index 210b84b2a5..bd1c7d3b1f 100644
97 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 97 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
98 98
99 /* Look at the reloc only if the value has been resolved. */ 99 /* Look at the reloc only if the value has been resolved. */
100@@ -2212,6 +2217,9 @@ microblaze_elf_relax_section (bfd *abfd, 100@@ -2209,6 +2214,9 @@ microblaze_elf_relax_section (bfd *abfd,
101 } 101 }
102 else if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_SYM_OP_SYM) 102 else if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_SYM_OP_SYM)
103 { 103 {
@@ -107,7 +107,7 @@ index 210b84b2a5..bd1c7d3b1f 100644
107 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 107 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
108 108
109 /* Look at the reloc only if the value has been resolved. */ 109 /* Look at the reloc only if the value has been resolved. */
110@@ -2247,6 +2255,9 @@ microblaze_elf_relax_section (bfd *abfd, 110@@ -2244,6 +2252,9 @@ microblaze_elf_relax_section (bfd *abfd,
111 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_LO) 111 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_LO)
112 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_TEXTREL_32_LO)) 112 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_TEXTREL_32_LO))
113 { 113 {
@@ -117,7 +117,7 @@ index 210b84b2a5..bd1c7d3b1f 100644
117 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 117 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
118 118
119 /* Look at the reloc only if the value has been resolved. */ 119 /* Look at the reloc only if the value has been resolved. */
120@@ -2292,6 +2303,9 @@ microblaze_elf_relax_section (bfd *abfd, 120@@ -2289,6 +2300,9 @@ microblaze_elf_relax_section (bfd *abfd,
121 if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64 121 if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64
122 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_TEXTREL_64)) 122 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_TEXTREL_64))
123 { 123 {
@@ -127,7 +127,7 @@ index 210b84b2a5..bd1c7d3b1f 100644
127 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 127 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
128 128
129 /* Look at the reloc only if the value has been resolved. */ 129 /* Look at the reloc only if the value has been resolved. */
130@@ -2339,6 +2353,9 @@ microblaze_elf_relax_section (bfd *abfd, 130@@ -2336,6 +2350,9 @@ microblaze_elf_relax_section (bfd *abfd,
131 } 131 }
132 else if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_PCREL) 132 else if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_PCREL)
133 { 133 {
@@ -137,6 +137,3 @@ index 210b84b2a5..bd1c7d3b1f 100644
137 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 137 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
138 138
139 /* Look at the reloc only if the value has been resolved. */ 139 /* Look at the reloc only if the value has been resolved. */
140--
1412.17.1
142