summaryrefslogtreecommitdiffstats
path: root/meta-microblaze
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@kernel.crashing.org>2022-09-01 12:36:20 -0500
committerMark Hatle <mark.hatle@kernel.crashing.org>2022-09-01 18:10:26 -0500
commit940e4d944196a2637eee3f7143cfe4573f92f7d7 (patch)
tree624814a18ddb0c9a46d850543b7b097fa7526503 /meta-microblaze
parentdafa66a5674c2d9f71a9ea01b7a566d8451a9163 (diff)
downloadmeta-xilinx-940e4d944196a2637eee3f7143cfe4573f92f7d7.tar.gz
binutils: update to current oe-core 2.39 version
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Diffstat (limited to 'meta-microblaze')
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils-microblaze.inc40
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0001-Add-wdc.ext.clear-and-wdc.ext.flush-insns.patch9
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0002-Add-mlittle-endian-and-mbig-endian-flags.patch7
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0003-Disable-the-warning-message-for-eh_frame_hdr.patch7
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0004-Fix-relaxation-of-assembler-resolved-references-Fixu.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0004-LOCAL-Fix-relaxation-of-assembler-resolved-reference.patch)76
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0005-upstream-change-to-garbage-collection-sweep-causes-m.patch9
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0006-Fix-bug-in-TLSTPREL-Relocation.patch10
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0007-Added-Address-extension-instructions.patch12
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0008-fixing-the-MAX_OPCODES-to-correct-value.patch7
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0009-Add-new-bit-field-instructions.patch50
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0010-fixing-the-imm-bug.-with-relax-option-imm-1-is-also-.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0010-fixing-the-imm-bug.patch)11
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0011-fixed-bug-in-GCC-so-that-It-will-support-.long-0U-an.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0011-Patch-Microblaze-fixed-bug-in-GCC-so-that-It-will-su.patch)11
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0012-fixing-the-constant-range-check-issue-sample-error-n.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0012-fixing-the-constant-range-check-issue.patch)7
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0013-Compiler-will-give-error-messages-in-more-detail-for.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0013-Patch-Microblaze-Compiler-will-give-error-messages-i.patch)13
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0014-initial-support-for-MicroBlaze-64-bit-m64.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0014-Patch-MicroBlaze-initial-support-for-MicroBlaze-64-b.patch)482
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0015-negl-instruction-is-overriding-rsubl-fixed-it-by-cha.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0015-Patch-Microblaze-negl-instruction-is-overriding-rsub.patch)11
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0016-Added-relocations-for-MB-X.patch22
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0017-Fixed-MB-x-relocation-issues-Added-imml-for-required.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0017-Fixed-MB-x-relocation-issues.patch)45
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0018-Fixing-the-branch-related-issues.patch10
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0019-Fixed-address-computation-issues-with-64bit-address-.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0019-Fixed-address-computation-issues-with-64bit-address.patch)18
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0020-Patch-MicroBlaze-Adding-new-relocation-to-support-64.patch21
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0021-fixing-the-.bss-relocation-issue.patch20
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0022-Fixed-the-bug-in-the-R_MICROBLAZE_64_NONE-relocation.patch13
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0023-Revert-ld-Remove-unused-expression-state-defsym-symb.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0023-Revert-ld-Remove-unused-expression-state.patch)20
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0024-fixing-the-long-long-long-mingw-toolchain-issue.patch9
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0025-Added-support-to-new-arithmetic-single-register-inst.patch47
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0026-double-imml-generation-for-64-bit-values.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0026-Patch-MicroBlaze-double-imml-generation-for-64-bit-v.patch)13
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0027-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch8
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0028-This-patch-will-remove-imml-0-and-imml-1-instruction.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0028-Patch-MicroBlaze-m64-This-patch-will-remove-imml-0-a.patch)12
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0029-improper-address-mapping-of-PROVIDE-directive-symbol.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0029-Patch-MicroBlaze-improper-address-mapping-of-PROVIDE.patch)17
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0030-Changing-the-long-to-long-long-as-in-Windows-long-is.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0030-Patch-microblaze-Changing-the-long-to-long-long-as-i.patch)18
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0031-gas-revert-moving-of-md_pseudo_table-from-const.patch8
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0032-ld-emulparams-elf64microblaze-Fix-emulation-generati.patch5
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0033-Add-initial-port-of-linux-gdbserver-add-gdb_proc_ser.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0033-Add-initial-port-of-linux-gdbserver.patch)92
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0034-Initial-port-of-core-reading-support-Added-support-f.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0034-Initial-port-of-core-reading-support.patch)62
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0035-MB-binutils-Upstream-port-issues.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0038-Patch-MB-MB-binutils-Upstream-port-issues.patch)100
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0036-Double-free-with-ld-no-keep-memory.-Proposed-patches.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0039-Patch-MicroBlaze-Double-free-with-ld-no-keep-memory.patch)80
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0037-Fixing-the-imm-imml-generation-for-16-bit-argument-C.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0040-Patch-MicroBlaze-Fixing-the-imm-imml-generation-for-.patch)34
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0038-Invalid-data-offsets-pointer-after-relaxation.-Propo.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0041-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch)52
39 files changed, 794 insertions, 694 deletions
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils-microblaze.inc b/meta-microblaze/recipes-devtools/binutils/binutils-microblaze.inc
index d8d0f268..24702838 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils-microblaze.inc
+++ b/meta-microblaze/recipes-devtools/binutils/binutils-microblaze.inc
@@ -4,39 +4,39 @@ SRC_URI:append = " \
4 file://0001-Add-wdc.ext.clear-and-wdc.ext.flush-insns.patch \ 4 file://0001-Add-wdc.ext.clear-and-wdc.ext.flush-insns.patch \
5 file://0002-Add-mlittle-endian-and-mbig-endian-flags.patch \ 5 file://0002-Add-mlittle-endian-and-mbig-endian-flags.patch \
6 file://0003-Disable-the-warning-message-for-eh_frame_hdr.patch \ 6 file://0003-Disable-the-warning-message-for-eh_frame_hdr.patch \
7 file://0004-LOCAL-Fix-relaxation-of-assembler-resolved-reference.patch \ 7 file://0004-Fix-relaxation-of-assembler-resolved-references-Fixu.patch \
8 file://0005-upstream-change-to-garbage-collection-sweep-causes-m.patch \ 8 file://0005-upstream-change-to-garbage-collection-sweep-causes-m.patch \
9 file://0006-Fix-bug-in-TLSTPREL-Relocation.patch \ 9 file://0006-Fix-bug-in-TLSTPREL-Relocation.patch \
10 file://0007-Added-Address-extension-instructions.patch \ 10 file://0007-Added-Address-extension-instructions.patch \
11 file://0008-fixing-the-MAX_OPCODES-to-correct-value.patch \ 11 file://0008-fixing-the-MAX_OPCODES-to-correct-value.patch \
12 file://0009-Add-new-bit-field-instructions.patch \ 12 file://0009-Add-new-bit-field-instructions.patch \
13 file://0010-fixing-the-imm-bug.patch \ 13 file://0010-fixing-the-imm-bug.-with-relax-option-imm-1-is-also-.patch \
14 file://0011-Patch-Microblaze-fixed-bug-in-GCC-so-that-It-will-su.patch \ 14 file://0011-fixed-bug-in-GCC-so-that-It-will-support-.long-0U-an.patch \
15 file://0012-fixing-the-constant-range-check-issue.patch \ 15 file://0012-fixing-the-constant-range-check-issue-sample-error-n.patch \
16 file://0013-Patch-Microblaze-Compiler-will-give-error-messages-i.patch \ 16 file://0013-Compiler-will-give-error-messages-in-more-detail-for.patch \
17 file://0014-Patch-MicroBlaze-initial-support-for-MicroBlaze-64-b.patch \ 17 file://0014-initial-support-for-MicroBlaze-64-bit-m64.patch \
18 file://0015-Patch-Microblaze-negl-instruction-is-overriding-rsub.patch \ 18 file://0015-negl-instruction-is-overriding-rsubl-fixed-it-by-cha.patch \
19 file://0016-Added-relocations-for-MB-X.patch \ 19 file://0016-Added-relocations-for-MB-X.patch \
20 file://0017-Fixed-MB-x-relocation-issues.patch \ 20 file://0017-Fixed-MB-x-relocation-issues-Added-imml-for-required.patch \
21 file://0018-Fixing-the-branch-related-issues.patch \ 21 file://0018-Fixing-the-branch-related-issues.patch \
22 file://0019-Fixed-address-computation-issues-with-64bit-address.patch \ 22 file://0019-Fixed-address-computation-issues-with-64bit-address-.patch \
23 file://0020-Patch-MicroBlaze-Adding-new-relocation-to-support-64.patch \ 23 file://0020-Patch-MicroBlaze-Adding-new-relocation-to-support-64.patch \
24 file://0021-fixing-the-.bss-relocation-issue.patch \ 24 file://0021-fixing-the-.bss-relocation-issue.patch \
25 file://0022-Fixed-the-bug-in-the-R_MICROBLAZE_64_NONE-relocation.patch \ 25 file://0022-Fixed-the-bug-in-the-R_MICROBLAZE_64_NONE-relocation.patch \
26 file://0023-Revert-ld-Remove-unused-expression-state.patch \ 26 file://0023-Revert-ld-Remove-unused-expression-state-defsym-symb.patch \
27 file://0024-fixing-the-long-long-long-mingw-toolchain-issue.patch \ 27 file://0024-fixing-the-long-long-long-mingw-toolchain-issue.patch \
28 file://0025-Added-support-to-new-arithmetic-single-register-inst.patch \ 28 file://0025-Added-support-to-new-arithmetic-single-register-inst.patch \
29 file://0026-Patch-MicroBlaze-double-imml-generation-for-64-bit-v.patch \ 29 file://0026-double-imml-generation-for-64-bit-values.patch \
30 file://0027-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch \ 30 file://0027-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch \
31 file://0028-Patch-MicroBlaze-m64-This-patch-will-remove-imml-0-a.patch \ 31 file://0028-This-patch-will-remove-imml-0-and-imml-1-instruction.patch \
32 file://0029-Patch-MicroBlaze-improper-address-mapping-of-PROVIDE.patch \ 32 file://0029-improper-address-mapping-of-PROVIDE-directive-symbol.patch \
33 file://0030-Patch-microblaze-Changing-the-long-to-long-long-as-i.patch \ 33 file://0030-Changing-the-long-to-long-long-as-in-Windows-long-is.patch \
34 file://0031-gas-revert-moving-of-md_pseudo_table-from-const.patch \ 34 file://0031-gas-revert-moving-of-md_pseudo_table-from-const.patch \
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-add-gdb_proc_ser.patch \
37 file://0034-Initial-port-of-core-reading-support.patch \ 37 file://0034-Initial-port-of-core-reading-support-Added-support-f.patch \
38 file://0038-Patch-MB-MB-binutils-Upstream-port-issues.patch \ 38 file://0035-MB-binutils-Upstream-port-issues.patch \
39 file://0039-Patch-MicroBlaze-Double-free-with-ld-no-keep-memory.patch \ 39 file://0036-Double-free-with-ld-no-keep-memory.-Proposed-patches.patch \
40 file://0040-Patch-MicroBlaze-Fixing-the-imm-imml-generation-for-.patch \ 40 file://0037-Fixing-the-imm-imml-generation-for-16-bit-argument-C.patch \
41 file://0041-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch \ 41 file://0038-Invalid-data-offsets-pointer-after-relaxation.-Propo.patch \
42 " 42 "
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0001-Add-wdc.ext.clear-and-wdc.ext.flush-insns.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0001-Add-wdc.ext.clear-and-wdc.ext.flush-insns.patch
index c34600e5..53416280 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0001-Add-wdc.ext.clear-and-wdc.ext.flush-insns.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0001-Add-wdc.ext.clear-and-wdc.ext.flush-insns.patch
@@ -1,4 +1,4 @@
1From baa73267935dc5854f4e07c809a46e42aa8cca4b Mon Sep 17 00:00:00 2001 1From fd654b0c7b88cd55fa659e0acea91296c7ed8e80 Mon Sep 17 00:00:00 2001
2From: David Holsgrove <david.holsgrove@xilinx.com> 2From: David Holsgrove <david.holsgrove@xilinx.com>
3Date: Wed, 8 May 2013 11:03:36 +1000 3Date: Wed, 8 May 2013 11:03:36 +1000
4Subject: [PATCH 01/38] Add wdc.ext.clear and wdc.ext.flush insns 4Subject: [PATCH 01/38] Add wdc.ext.clear and wdc.ext.flush insns
@@ -9,13 +9,14 @@ used with the new coherency support for multiprocessing.
9 9
10Signed-off-by:nagaraju <nmekala@xilix.com> 10Signed-off-by:nagaraju <nmekala@xilix.com>
11Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> 11Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
12Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
12--- 13---
13 opcodes/microblaze-opc.h | 5 ++++- 14 opcodes/microblaze-opc.h | 5 ++++-
14 opcodes/microblaze-opcm.h | 4 ++-- 15 opcodes/microblaze-opcm.h | 4 ++--
15 2 files changed, 6 insertions(+), 3 deletions(-) 16 2 files changed, 6 insertions(+), 3 deletions(-)
16 17
17diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h 18diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
18index 080d238bd2b..746566fdb87 100644 19index ffb0f08c692..b8a0cf82516 100644
19--- a/opcodes/microblaze-opc.h 20--- a/opcodes/microblaze-opc.h
20+++ b/opcodes/microblaze-opc.h 21+++ b/opcodes/microblaze-opc.h
21@@ -91,6 +91,7 @@ 22@@ -91,6 +91,7 @@
@@ -46,7 +47,7 @@ index 080d238bd2b..746566fdb87 100644
46 {"mfs", INST_TYPE_RD_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_MFS, 0x94008000, OPCODE_MASK_H23S, mfs, special_inst }, 47 {"mfs", INST_TYPE_RD_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_MFS, 0x94008000, OPCODE_MASK_H23S, mfs, special_inst },
47 {"br", INST_TYPE_R2, INST_PC_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x98000000, OPCODE_MASK_H124, br, branch_inst }, 48 {"br", INST_TYPE_R2, INST_PC_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x98000000, OPCODE_MASK_H124, br, branch_inst },
48diff --git a/opcodes/microblaze-opcm.h b/opcodes/microblaze-opcm.h 49diff --git a/opcodes/microblaze-opcm.h b/opcodes/microblaze-opcm.h
49index 6dd3694f4be..10d7e883366 100644 50index 8e293465fec..e56c1d2d47c 100644
50--- a/opcodes/microblaze-opcm.h 51--- a/opcodes/microblaze-opcm.h
51+++ b/opcodes/microblaze-opcm.h 52+++ b/opcodes/microblaze-opcm.h
52@@ -33,8 +33,8 @@ enum microblaze_instr 53@@ -33,8 +33,8 @@ enum microblaze_instr
@@ -61,5 +62,5 @@ index 6dd3694f4be..10d7e883366 100644
61 imm, rtsd, rtid, rtbd, rted, bri, brid, brlid, brai, braid, bralid, 62 imm, rtsd, rtid, rtbd, rted, bri, brid, brlid, brai, braid, bralid,
62 brki, beqi, beqid, bnei, bneid, blti, bltid, blei, bleid, bgti, 63 brki, beqi, beqid, bnei, bneid, blti, bltid, blei, bleid, bgti,
63-- 64--
642.17.1 652.25.1
65 66
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0002-Add-mlittle-endian-and-mbig-endian-flags.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0002-Add-mlittle-endian-and-mbig-endian-flags.patch
index 03fcf2f0..ace172b6 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0002-Add-mlittle-endian-and-mbig-endian-flags.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0002-Add-mlittle-endian-and-mbig-endian-flags.patch
@@ -1,4 +1,4 @@
1From 2c240d885b5871571d93af64baf2e67f077f735c Mon Sep 17 00:00:00 2001 1From 2daa3e3863ee052020ad07ac59c49b7f82f7a9d1 Mon Sep 17 00:00:00 2001
2From: nagaraju <nmekala@xilix.com> 2From: nagaraju <nmekala@xilix.com>
3Date: Tue, 19 Mar 2013 17:18:23 +0530 3Date: Tue, 19 Mar 2013 17:18:23 +0530
4Subject: [PATCH 02/38] Add mlittle-endian and mbig-endian flags 4Subject: [PATCH 02/38] Add mlittle-endian and mbig-endian flags
@@ -11,12 +11,13 @@ to include new entries.
11 11
12Signed-off-by:nagaraju <nmekala@xilix.com> 12Signed-off-by:nagaraju <nmekala@xilix.com>
13Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> 13Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
14Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
14--- 15---
15 gas/config/tc-microblaze.c | 9 +++++++++ 16 gas/config/tc-microblaze.c | 9 +++++++++
16 1 file changed, 9 insertions(+) 17 1 file changed, 9 insertions(+)
17 18
18diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 19diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
19index 881172d5274..d6fc400cef9 100644 20index 3db17a76ee7..c927331ea0a 100644
20--- a/gas/config/tc-microblaze.c 21--- a/gas/config/tc-microblaze.c
21+++ b/gas/config/tc-microblaze.c 22+++ b/gas/config/tc-microblaze.c
22@@ -37,6 +37,8 @@ 23@@ -37,6 +37,8 @@
@@ -60,5 +61,5 @@ index 881172d5274..d6fc400cef9 100644
60 61
61 62
62-- 63--
632.17.1 642.25.1
64 65
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0003-Disable-the-warning-message-for-eh_frame_hdr.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0003-Disable-the-warning-message-for-eh_frame_hdr.patch
index b76020f5..09af3e82 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0003-Disable-the-warning-message-for-eh_frame_hdr.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0003-Disable-the-warning-message-for-eh_frame_hdr.patch
@@ -1,4 +1,4 @@
1From fc6844169e72155a008d963c3991ed084e0d0890 Mon Sep 17 00:00:00 2001 1From 7982c0bdd92531bca3b829255324a769df9521e1 Mon Sep 17 00:00:00 2001
2From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com> 2From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
3Date: Fri, 22 Jun 2012 01:20:20 +0200 3Date: Fri, 22 Jun 2012 01:20:20 +0200
4Subject: [PATCH 03/38] Disable the warning message for eh_frame_hdr 4Subject: [PATCH 03/38] Disable the warning message for eh_frame_hdr
@@ -7,12 +7,13 @@ Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
7 7
8Conflicts: 8Conflicts:
9 bfd/elf-eh-frame.c 9 bfd/elf-eh-frame.c
10Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
10--- 11---
11 bfd/elf-eh-frame.c | 3 +++ 12 bfd/elf-eh-frame.c | 3 +++
12 1 file changed, 3 insertions(+) 13 1 file changed, 3 insertions(+)
13 14
14diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c 15diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
15index 6ce6d225cff..c6b0c122459 100644 16index 2e22d0c9215..db470ed43c3 100644
16--- a/bfd/elf-eh-frame.c 17--- a/bfd/elf-eh-frame.c
17+++ b/bfd/elf-eh-frame.c 18+++ b/bfd/elf-eh-frame.c
18@@ -1044,10 +1044,13 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info, 19@@ -1044,10 +1044,13 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
@@ -30,5 +31,5 @@ index 6ce6d225cff..c6b0c122459 100644
30 free (sec_info); 31 free (sec_info);
31 success: 32 success:
32-- 33--
332.17.1 342.25.1
34 35
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0004-LOCAL-Fix-relaxation-of-assembler-resolved-reference.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0004-Fix-relaxation-of-assembler-resolved-references-Fixu.patch
index 03b84798..adb6e213 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0004-LOCAL-Fix-relaxation-of-assembler-resolved-reference.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0004-Fix-relaxation-of-assembler-resolved-references-Fixu.patch
@@ -1,11 +1,10 @@
1From 786c2252440ed07d05c1ab37675e5138e7b44bb8 Mon Sep 17 00:00:00 2001 1From 1b47ecbc256f807b239f3f275fefd53bba0f0cde Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Tue, 8 Nov 2016 11:54:08 +0530 3Date: Tue, 8 Nov 2016 11:54:08 +0530
4Subject: [PATCH 04/38] [LOCAL]: Fix relaxation of assembler resolved 4Subject: [PATCH 04/38] Fix relaxation of assembler resolved references,Fixup
5 references,Fixup debug_loc sections after linker relaxation Adds a new 5 debug_loc sections after linker relaxation Adds a new reloctype
6 reloctype R_MICROBLAZE_32_NONE, used for passing reloc info from the 6 R_MICROBLAZE_32_NONE, used for passing reloc info from the assembler to the
7 assembler to the linker when the linker manages to fully resolve a local 7 linker when the linker manages to fully resolve a local symbol reference.
8 symbol reference.
9 8
10This is a workaround for design flaws in the assembler to 9This is a workaround for design flaws in the assembler to
11linker interface with regards to linker relaxation. 10linker interface with regards to linker relaxation.
@@ -20,21 +19,22 @@ Conflicts:
20 19
21Conflicts: 20Conflicts:
22 binutils/readelf.c 21 binutils/readelf.c
22Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
23--- 23---
24 bfd/bfd-in2.h | 5 ++ 24 bfd/bfd-in2.h | 5 ++
25 bfd/elf32-microblaze.c | 126 ++++++++++++++++++++++++++++--------- 25 bfd/elf32-microblaze.c | 118 +++++++++++++++++++++++++++++--------
26 bfd/libbfd.h | 1 + 26 bfd/libbfd.h | 1 +
27 bfd/reloc.c | 6 ++ 27 bfd/reloc.c | 6 ++
28 binutils/readelf.c | 4 ++ 28 binutils/readelf.c | 4 ++
29 gas/config/tc-microblaze.c | 4 ++ 29 gas/config/tc-microblaze.c | 4 ++
30 include/elf/microblaze.h | 2 + 30 include/elf/microblaze.h | 2 +
31 7 files changed, 119 insertions(+), 29 deletions(-) 31 7 files changed, 115 insertions(+), 25 deletions(-)
32 32
33diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h 33diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
34index 9a698316980..943bc2e914c 100644 34index 1f0f18a7e75..26e3bb2b34b 100644
35--- a/bfd/bfd-in2.h 35--- a/bfd/bfd-in2.h
36+++ b/bfd/bfd-in2.h 36+++ b/bfd/bfd-in2.h
37@@ -5423,6 +5423,11 @@ value relative to the read-write small data area anchor */ 37@@ -5379,6 +5379,11 @@ value relative to the read-write small data area anchor */
38 expressions of the form "Symbol Op Symbol" */ 38 expressions of the form "Symbol Op Symbol" */
39 BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, 39 BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
40 40
@@ -47,7 +47,7 @@ index 9a698316980..943bc2e914c 100644
47 value in two words (with an imm instruction). No relocation is 47 value in two words (with an imm instruction). No relocation is
48 done here - only used for relaxing */ 48 done here - only used for relaxing */
49diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 49diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
50index d9c0d93a01a..2316e085d1f 100644 50index 013c32a1e51..e36cd102bd2 100644
51--- a/bfd/elf32-microblaze.c 51--- a/bfd/elf32-microblaze.c
52+++ b/bfd/elf32-microblaze.c 52+++ b/bfd/elf32-microblaze.c
53@@ -175,6 +175,20 @@ static reloc_howto_type microblaze_elf_howto_raw[] = 53@@ -175,6 +175,20 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
@@ -70,7 +70,7 @@ index d9c0d93a01a..2316e085d1f 100644
70+ 70+
71 HOWTO (R_MICROBLAZE_64_NONE, /* Type. */ 71 HOWTO (R_MICROBLAZE_64_NONE, /* Type. */
72 0, /* Rightshift. */ 72 0, /* Rightshift. */
73 3, /* Size (0 = byte, 1 = short, 2 = long). */ 73 0, /* Size. */
74@@ -560,7 +574,10 @@ microblaze_elf_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, 74@@ -560,7 +574,10 @@ microblaze_elf_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
75 case BFD_RELOC_NONE: 75 case BFD_RELOC_NONE:
76 microblaze_reloc = R_MICROBLAZE_NONE; 76 microblaze_reloc = R_MICROBLAZE_NONE;
@@ -83,7 +83,7 @@ index d9c0d93a01a..2316e085d1f 100644
83 microblaze_reloc = R_MICROBLAZE_64_NONE; 83 microblaze_reloc = R_MICROBLAZE_64_NONE;
84 break; 84 break;
85 case BFD_RELOC_32: 85 case BFD_RELOC_32:
86@@ -1910,18 +1927,26 @@ microblaze_elf_relax_section (bfd *abfd, 86@@ -1954,14 +1971,22 @@ microblaze_elf_relax_section (bfd *abfd,
87 } 87 }
88 break; 88 break;
89 case R_MICROBLAZE_NONE: 89 case R_MICROBLAZE_NONE:
@@ -91,30 +91,22 @@ index d9c0d93a01a..2316e085d1f 100644
91 { 91 {
92 /* This was a PC-relative instruction that was 92 /* This was a PC-relative instruction that was
93 completely resolved. */ 93 completely resolved. */
94 int sfix, efix; 94 size_t sfix, efix;
95+ unsigned int val; 95+ unsigned int val;
96 bfd_vma target_address; 96 bfd_vma target_address;
97 target_address = irel->r_addend + irel->r_offset; 97 target_address = irel->r_addend + irel->r_offset;
98 sfix = calc_fixup (irel->r_offset, 0, sec); 98 sfix = calc_fixup (irel->r_offset, 0, sec);
99 efix = calc_fixup (target_address, 0, sec); 99 efix = calc_fixup (target_address, 0, sec);
100- irel->r_addend -= (efix - sfix);
101- /* Should use HOWTO. */
102- microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset,
103- irel->r_addend);
104+ 100+
105+ /* Validate the in-band val. */ 101+ /* Validate the in-band val. */
106+ val = bfd_get_32 (abfd, contents + irel->r_offset); 102+ val = bfd_get_32 (abfd, contents + irel->r_offset);
107+ if (val != irel->r_addend && ELF32_R_TYPE (irel->r_info) == R_MICROBLAZE_32_NONE) { 103+ if (val != irel->r_addend && ELF32_R_TYPE (irel->r_info) == R_MICROBLAZE_32_NONE) {
108+ fprintf(stderr, "%d: CORRUPT relax reloc %x %lx\n", __LINE__, val, irel->r_addend); 104+ fprintf(stderr, "%d: CORRUPT relax reloc %x %lx\n", __LINE__, val, irel->r_addend);
109+ } 105+ }
110+ irel->r_addend -= (efix - sfix); 106 irel->r_addend -= (efix - sfix);
111+ /* Should use HOWTO. */ 107 /* Should use HOWTO. */
112+ microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset, 108 microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset,
113+ irel->r_addend); 109@@ -2009,30 +2034,73 @@ microblaze_elf_relax_section (bfd *abfd,
114 }
115 break;
116 case R_MICROBLAZE_64_NONE:
117@@ -1965,30 +1990,73 @@ microblaze_elf_relax_section (bfd *abfd,
118 irelscanend = irelocs + o->reloc_count; 110 irelscanend = irelocs + o->reloc_count;
119 for (irelscan = irelocs; irelscan < irelscanend; irelscan++) 111 for (irelscan = irelocs; irelscan < irelscanend; irelscan++)
120 { 112 {
@@ -211,7 +203,7 @@ index d9c0d93a01a..2316e085d1f 100644
211 o->rawsize)) 203 o->rawsize))
212 goto error_return; 204 goto error_return;
213 elf_section_data (o)->this_hdr.contents = ocontents; 205 elf_section_data (o)->this_hdr.contents = ocontents;
214@@ -2024,7 +2092,7 @@ microblaze_elf_relax_section (bfd *abfd, 206@@ -2068,7 +2136,7 @@ microblaze_elf_relax_section (bfd *abfd,
215 elf_section_data (o)->this_hdr.contents = ocontents; 207 elf_section_data (o)->this_hdr.contents = ocontents;
216 } 208 }
217 } 209 }
@@ -221,10 +213,10 @@ index d9c0d93a01a..2316e085d1f 100644
221 0, 213 0,
222 sec); 214 sec);
223diff --git a/bfd/libbfd.h b/bfd/libbfd.h 215diff --git a/bfd/libbfd.h b/bfd/libbfd.h
224index c37ddc03cfd..4153b94564d 100644 216index 29e8187f95f..ea2507d1879 100644
225--- a/bfd/libbfd.h 217--- a/bfd/libbfd.h
226+++ b/bfd/libbfd.h 218+++ b/bfd/libbfd.h
227@@ -2988,6 +2988,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", 219@@ -2989,6 +2989,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
228 "BFD_RELOC_MICROBLAZE_32_ROSDA", 220 "BFD_RELOC_MICROBLAZE_32_ROSDA",
229 "BFD_RELOC_MICROBLAZE_32_RWSDA", 221 "BFD_RELOC_MICROBLAZE_32_RWSDA",
230 "BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM", 222 "BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM",
@@ -233,10 +225,10 @@ index c37ddc03cfd..4153b94564d 100644
233 "BFD_RELOC_MICROBLAZE_64_GOTPC", 225 "BFD_RELOC_MICROBLAZE_64_GOTPC",
234 "BFD_RELOC_MICROBLAZE_64_GOT", 226 "BFD_RELOC_MICROBLAZE_64_GOT",
235diff --git a/bfd/reloc.c b/bfd/reloc.c 227diff --git a/bfd/reloc.c b/bfd/reloc.c
236index 6d920e1df06..3a08f7a8a42 100644 228index 36999fe9a40..5ac8a8536a7 100644
237--- a/bfd/reloc.c 229--- a/bfd/reloc.c
238+++ b/bfd/reloc.c 230+++ b/bfd/reloc.c
239@@ -6896,6 +6896,12 @@ ENUM 231@@ -6867,6 +6867,12 @@ ENUM
240 ENUMDOC 232 ENUMDOC
241 This is a 32 bit reloc for the microblaze to handle 233 This is a 32 bit reloc for the microblaze to handle
242 expressions of the form "Symbol Op Symbol" 234 expressions of the form "Symbol Op Symbol"
@@ -250,10 +242,10 @@ index 6d920e1df06..3a08f7a8a42 100644
250 BFD_RELOC_MICROBLAZE_64_NONE 242 BFD_RELOC_MICROBLAZE_64_NONE
251 ENUMDOC 243 ENUMDOC
252diff --git a/binutils/readelf.c b/binutils/readelf.c 244diff --git a/binutils/readelf.c b/binutils/readelf.c
253index a6073f7ec80..5b25fb9a52a 100644 245index 0f5977bc072..acd12713361 100644
254--- a/binutils/readelf.c 246--- a/binutils/readelf.c
255+++ b/binutils/readelf.c 247+++ b/binutils/readelf.c
256@@ -14057,6 +14057,10 @@ is_8bit_abs_reloc (Filedata * filedata, unsigned int reloc_type) 248@@ -14621,6 +14621,10 @@ is_8bit_abs_reloc (Filedata * filedata, unsigned int reloc_type)
257 return reloc_type == 1; /* R_Z80_8. */ 249 return reloc_type == 1; /* R_Z80_8. */
258 default: 250 default:
259 return false; 251 return false;
@@ -265,7 +257,7 @@ index a6073f7ec80..5b25fb9a52a 100644
265 } 257 }
266 258
267diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 259diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
268index d6fc400cef9..87efc2b7a46 100644 260index c927331ea0a..8018d1f5686 100644
269--- a/gas/config/tc-microblaze.c 261--- a/gas/config/tc-microblaze.c
270+++ b/gas/config/tc-microblaze.c 262+++ b/gas/config/tc-microblaze.c
271@@ -2211,9 +2211,12 @@ md_apply_fix (fixS * fixP, 263@@ -2211,9 +2211,12 @@ md_apply_fix (fixS * fixP,
@@ -290,7 +282,7 @@ index d6fc400cef9..87efc2b7a46 100644
290 case BFD_RELOC_32: 282 case BFD_RELOC_32:
291 case BFD_RELOC_MICROBLAZE_32_LO: 283 case BFD_RELOC_MICROBLAZE_32_LO:
292diff --git a/include/elf/microblaze.h b/include/elf/microblaze.h 284diff --git a/include/elf/microblaze.h b/include/elf/microblaze.h
293index 66b4fda8f54..936ef484289 100644 285index 43ad3ad3904..a2e1ce4580f 100644
294--- a/include/elf/microblaze.h 286--- a/include/elf/microblaze.h
295+++ b/include/elf/microblaze.h 287+++ b/include/elf/microblaze.h
296@@ -61,6 +61,8 @@ START_RELOC_NUMBERS (elf_microblaze_reloc_type) 288@@ -61,6 +61,8 @@ START_RELOC_NUMBERS (elf_microblaze_reloc_type)
@@ -303,5 +295,5 @@ index 66b4fda8f54..936ef484289 100644
303 295
304 /* Global base address names. */ 296 /* Global base address names. */
305-- 297--
3062.17.1 2982.25.1
307 299
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0005-upstream-change-to-garbage-collection-sweep-causes-m.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0005-upstream-change-to-garbage-collection-sweep-causes-m.patch
index f2419c4c..ec2a898f 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0005-upstream-change-to-garbage-collection-sweep-causes-m.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0005-upstream-change-to-garbage-collection-sweep-causes-m.patch
@@ -1,4 +1,4 @@
1From 48e989bf1ff9ce0250256afc95d40d75fa098e21 Mon Sep 17 00:00:00 2001 1From 318f98ea7f4271b3dd6e364d751415410a4076ac Mon Sep 17 00:00:00 2001
2From: David Holsgrove <david.holsgrove@xilinx.com> 2From: David Holsgrove <david.holsgrove@xilinx.com>
3Date: Wed, 27 Feb 2013 13:56:11 +1000 3Date: Wed, 27 Feb 2013 13:56:11 +1000
4Subject: [PATCH 05/38] upstream change to garbage collection sweep causes mb 4Subject: [PATCH 05/38] upstream change to garbage collection sweep causes mb
@@ -21,15 +21,16 @@ Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
21 21
22Conflicts: 22Conflicts:
23 bfd/elflink.c 23 bfd/elflink.c
24Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
24--- 25---
25 bfd/elflink.c | 1 - 26 bfd/elflink.c | 1 -
26 1 file changed, 1 deletion(-) 27 1 file changed, 1 deletion(-)
27 28
28diff --git a/bfd/elflink.c b/bfd/elflink.c 29diff --git a/bfd/elflink.c b/bfd/elflink.c
29index 9a05208253c..bdfbcecef92 100644 30index 2b1450fa4e1..c50919060b3 100644
30--- a/bfd/elflink.c 31--- a/bfd/elflink.c
31+++ b/bfd/elflink.c 32+++ b/bfd/elflink.c
32@@ -6432,7 +6432,6 @@ elf_gc_sweep_symbol (struct elf_link_hash_entry *h, void *data) 33@@ -6576,7 +6576,6 @@ elf_gc_sweep_symbol (struct elf_link_hash_entry *h, void *data)
33 34
34 inf = (struct elf_gc_sweep_symbol_info *) data; 35 inf = (struct elf_gc_sweep_symbol_info *) data;
35 (*inf->hide_symbol) (inf->info, h, true); 36 (*inf->hide_symbol) (inf->info, h, true);
@@ -38,5 +39,5 @@ index 9a05208253c..bdfbcecef92 100644
38 h->ref_regular_nonweak = 0; 39 h->ref_regular_nonweak = 0;
39 } 40 }
40-- 41--
412.17.1 422.25.1
42 43
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0006-Fix-bug-in-TLSTPREL-Relocation.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0006-Fix-bug-in-TLSTPREL-Relocation.patch
index 5221bb33..5d42170b 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0006-Fix-bug-in-TLSTPREL-Relocation.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0006-Fix-bug-in-TLSTPREL-Relocation.patch
@@ -1,4 +1,4 @@
1From a150edd000f83578755a749bb8c44553e0dbc1f0 Mon Sep 17 00:00:00 2001 1From 8cfdaf2c7c3b3e8572588e6749f688f6b702fe35 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com> 2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Mon, 15 Jun 2015 16:50:30 +0530 3Date: Mon, 15 Jun 2015 16:50:30 +0530
4Subject: [PATCH 06/38] Fix bug in TLSTPREL Relocation 4Subject: [PATCH 06/38] Fix bug in TLSTPREL Relocation
@@ -8,15 +8,17 @@ When the fixup is applied the addend is not added at the correct offset
8of the instruction. The offset is hard coded considering its big endian 8of the instruction. The offset is hard coded considering its big endian
9and it fails for Little endian. This patch allows support for both 9and it fails for Little endian. This patch allows support for both
10big & little-endian compilers 10big & little-endian compilers
11
12Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
11--- 13---
12 bfd/elf32-microblaze.c | 4 ++-- 14 bfd/elf32-microblaze.c | 4 ++--
13 1 file changed, 2 insertions(+), 2 deletions(-) 15 1 file changed, 2 insertions(+), 2 deletions(-)
14 16
15diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 17diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
16index 2316e085d1f..e0729c6a194 100644 18index e36cd102bd2..c66f4ffef36 100644
17--- a/bfd/elf32-microblaze.c 19--- a/bfd/elf32-microblaze.c
18+++ b/bfd/elf32-microblaze.c 20+++ b/bfd/elf32-microblaze.c
19@@ -1443,9 +1443,9 @@ microblaze_elf_relocate_section (bfd *output_bfd, 21@@ -1484,9 +1484,9 @@ microblaze_elf_relocate_section (bfd *output_bfd,
20 relocation += addend; 22 relocation += addend;
21 relocation -= dtprel_base(info); 23 relocation -= dtprel_base(info);
22 bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff, 24 bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff,
@@ -29,5 +31,5 @@ index 2316e085d1f..e0729c6a194 100644
29 case (int) R_MICROBLAZE_TEXTREL_64: 31 case (int) R_MICROBLAZE_TEXTREL_64:
30 case (int) R_MICROBLAZE_TEXTREL_32_LO: 32 case (int) R_MICROBLAZE_TEXTREL_32_LO:
31-- 33--
322.17.1 342.25.1
33 35
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0007-Added-Address-extension-instructions.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0007-Added-Address-extension-instructions.patch
index 2f1d83d7..b60c9085 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0007-Added-Address-extension-instructions.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0007-Added-Address-extension-instructions.patch
@@ -1,4 +1,4 @@
1From fc3bbcce05e1726bf98948cebfef841b84df73cb Mon Sep 17 00:00:00 2001 1From be2ecb2dd73901484995c39d6c7375be6b8dd545 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com> 2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Mon, 18 Jan 2016 12:28:21 +0530 3Date: Mon, 18 Jan 2016 12:28:21 +0530
4Subject: [PATCH 07/38] Added Address extension instructions 4Subject: [PATCH 07/38] Added Address extension instructions
@@ -18,13 +18,15 @@ ChangeLog:
18 18
19Conflicts: 19Conflicts:
20 opcodes/microblaze-opcm.h 20 opcodes/microblaze-opcm.h
21
22Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
21--- 23---
22 opcodes/microblaze-opc.h | 11 +++++++++++ 24 opcodes/microblaze-opc.h | 11 +++++++++++
23 opcodes/microblaze-opcm.h | 10 +++++----- 25 opcodes/microblaze-opcm.h | 10 +++++-----
24 2 files changed, 16 insertions(+), 5 deletions(-) 26 2 files changed, 16 insertions(+), 5 deletions(-)
25 27
26diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h 28diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
27index 746566fdb87..5d165dcdf91 100644 29index b8a0cf82516..d3f8e36199e 100644
28--- a/opcodes/microblaze-opc.h 30--- a/opcodes/microblaze-opc.h
29+++ b/opcodes/microblaze-opc.h 31+++ b/opcodes/microblaze-opc.h
30@@ -178,8 +178,11 @@ const struct op_code_struct 32@@ -178,8 +178,11 @@ const struct op_code_struct
@@ -74,7 +76,7 @@ index 746566fdb87..5d165dcdf91 100644
74 {"swaph", INST_TYPE_RD_R1, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x900001E2, OPCODE_MASK_H4, swaph, arithmetic_inst }, 76 {"swaph", INST_TYPE_RD_R1, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x900001E2, OPCODE_MASK_H4, swaph, arithmetic_inst },
75 {"", 0, 0, 0, 0, 0, 0, 0, 0}, 77 {"", 0, 0, 0, 0, 0, 0, 0, 0},
76diff --git a/opcodes/microblaze-opcm.h b/opcodes/microblaze-opcm.h 78diff --git a/opcodes/microblaze-opcm.h b/opcodes/microblaze-opcm.h
77index 10d7e883366..250fd6a250a 100644 79index e56c1d2d47c..ad964560c17 100644
78--- a/opcodes/microblaze-opcm.h 80--- a/opcodes/microblaze-opcm.h
79+++ b/opcodes/microblaze-opcm.h 81+++ b/opcodes/microblaze-opcm.h
80@@ -33,13 +33,13 @@ enum microblaze_instr 82@@ -33,13 +33,13 @@ enum microblaze_instr
@@ -95,7 +97,7 @@ index 10d7e883366..250fd6a250a 100644
95+ sb, sbea, sbr, sh, shea, shr, sw, swea, swr, swx, lbui, lhui, lwi, 97+ sb, sbea, sbr, sh, shea, shr, sw, swea, swr, swx, lbui, lhui, lwi,
96 sbi, shi, swi, msrset, msrclr, tuqula, mbi_fadd, frsub, mbi_fmul, mbi_fdiv, 98 sbi, shi, swi, msrset, msrclr, tuqula, mbi_fadd, frsub, mbi_fmul, mbi_fdiv,
97 fcmp_lt, fcmp_eq, fcmp_le, fcmp_gt, fcmp_ne, fcmp_ge, fcmp_un, flt, 99 fcmp_lt, fcmp_eq, fcmp_le, fcmp_gt, fcmp_ne, fcmp_ge, fcmp_un, flt,
98 fint, fsqrt, 100 /* 'fsqrt' is a glibc:math.h symbol. */
99-- 101--
1002.17.1 1022.25.1
101 103
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0008-fixing-the-MAX_OPCODES-to-correct-value.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0008-fixing-the-MAX_OPCODES-to-correct-value.patch
index 4c3caa51..d6faee70 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0008-fixing-the-MAX_OPCODES-to-correct-value.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0008-fixing-the-MAX_OPCODES-to-correct-value.patch
@@ -1,14 +1,15 @@
1From bb27e620e2911e472eee6c1ee4fb2a1e722b65aa Mon Sep 17 00:00:00 2001 1From ba9dde9e1068bb282bb0695d1159cd100bcae54f Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com> 2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Thu, 28 Jan 2016 14:07:34 +0530 3Date: Thu, 28 Jan 2016 14:07:34 +0530
4Subject: [PATCH 08/38] fixing the MAX_OPCODES to correct value 4Subject: [PATCH 08/38] fixing the MAX_OPCODES to correct value
5 5
6Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
6--- 7---
7 opcodes/microblaze-opc.h | 2 +- 8 opcodes/microblaze-opc.h | 2 +-
8 1 file changed, 1 insertion(+), 1 deletion(-) 9 1 file changed, 1 insertion(+), 1 deletion(-)
9 10
10diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h 11diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
11index 5d165dcdf91..bf53e492b9a 100644 12index d3f8e36199e..3b3cdbe710c 100644
12--- a/opcodes/microblaze-opc.h 13--- a/opcodes/microblaze-opc.h
13+++ b/opcodes/microblaze-opc.h 14+++ b/opcodes/microblaze-opc.h
14@@ -102,7 +102,7 @@ 15@@ -102,7 +102,7 @@
@@ -21,5 +22,5 @@ index 5d165dcdf91..bf53e492b9a 100644
21 const struct op_code_struct 22 const struct op_code_struct
22 { 23 {
23-- 24--
242.17.1 252.25.1
25 26
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 5cd7d9c8..85f0bfcf 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
@@ -1,4 +1,4 @@
1From c5c42765e7436fa20cc2069fa0426995cf940e5a Mon Sep 17 00:00:00 2001 1From 3f45718e99e09679472366a2c7e454c75f0383e3 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com> 2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Mon, 18 Jul 2016 12:24:28 +0530 3Date: Mon, 18 Jul 2016 12:24:28 +0530
4Subject: [PATCH 09/38] Add new bit-field instructions 4Subject: [PATCH 09/38] Add new bit-field instructions
@@ -15,6 +15,7 @@ Signed-off-by :Nagaraju Mekala <nmekala@xilix.com>
15 15
16Conflicts: 16Conflicts:
17 opcodes/microblaze-dis.c 17 opcodes/microblaze-dis.c
18Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
18--- 19---
19 gas/config/tc-microblaze.c | 71 +++++++++++++++++++++++++++++++++++++- 20 gas/config/tc-microblaze.c | 71 +++++++++++++++++++++++++++++++++++++-
20 opcodes/microblaze-dis.c | 20 +++++++++-- 21 opcodes/microblaze-dis.c | 20 +++++++++--
@@ -22,10 +23,10 @@ Conflicts:
22 opcodes/microblaze-opcm.h | 6 +++- 23 opcodes/microblaze-opcm.h | 6 +++-
23 4 files changed, 104 insertions(+), 5 deletions(-) 24 4 files changed, 104 insertions(+), 5 deletions(-)
24 25
25Index: git/gas/config/tc-microblaze.c 26diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
26=================================================================== 27index 8018d1f5686..1cb9b2519c3 100644
27--- git.orig/gas/config/tc-microblaze.c 28--- a/gas/config/tc-microblaze.c
28+++ git/gas/config/tc-microblaze.c 29+++ b/gas/config/tc-microblaze.c
29@@ -917,7 +917,7 @@ md_assemble (char * str) 30@@ -917,7 +917,7 @@ md_assemble (char * str)
30 unsigned reg2; 31 unsigned reg2;
31 unsigned reg3; 32 unsigned reg3;
@@ -60,7 +61,7 @@ Index: git/gas/config/tc-microblaze.c
60+ as_fatal (_("Cannot use special register with this instruction")); 61+ as_fatal (_("Cannot use special register with this instruction"));
61+ if (check_spl_reg (&reg2)) 62+ if (check_spl_reg (&reg2))
62+ as_fatal (_("Cannot use special register with this instruction")); 63+ as_fatal (_("Cannot use special register with this instruction"));
63+ 64
64+ /* Width immediate value. */ 65+ /* Width immediate value. */
65+ if (strcmp (op_end, "")) 66+ if (strcmp (op_end, ""))
66+ op_end = parse_imm (op_end + 1, &exp, MIN_IMM_WIDTH, MAX_IMM_WIDTH); 67+ op_end = parse_imm (op_end + 1, &exp, MIN_IMM_WIDTH, MAX_IMM_WIDTH);
@@ -75,7 +76,7 @@ Index: git/gas/config/tc-microblaze.c
75+ immed = exp.X_add_number; 76+ immed = exp.X_add_number;
76+ if (opcode->instr == bsefi && immed > 31) 77+ if (opcode->instr == bsefi && immed > 31)
77+ as_fatal (_("Width value must be less than 32")); 78+ as_fatal (_("Width value must be less than 32"));
78 79+
79+ /* Shift immediate value. */ 80+ /* Shift immediate value. */
80+ if (strcmp (op_end, "")) 81+ if (strcmp (op_end, ""))
81+ op_end = parse_imm (op_end + 1, &exp, MIN_IMM, MAX_IMM); 82+ op_end = parse_imm (op_end + 1, &exp, MIN_IMM, MAX_IMM);
@@ -112,11 +113,11 @@ Index: git/gas/config/tc-microblaze.c
112 case INST_TYPE_R1_R2: 113 case INST_TYPE_R1_R2:
113 if (strcmp (op_end, "")) 114 if (strcmp (op_end, ""))
114 op_end = parse_reg (op_end + 1, &reg1); /* Get r1. */ 115 op_end = parse_reg (op_end + 1, &reg1); /* Get r1. */
115Index: git/opcodes/microblaze-dis.c 116diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c
116=================================================================== 117index b057492ba93..f57b98fc9f7 100644
117--- git.orig/opcodes/microblaze-dis.c 118--- a/opcodes/microblaze-dis.c
118+++ git/opcodes/microblaze-dis.c 119+++ b/opcodes/microblaze-dis.c
119@@ -91,7 +91,19 @@ get_field_imm5_mbar (struct string_buf * 120@@ -91,7 +91,19 @@ get_field_imm5_mbar (struct string_buf *buf, long instr)
120 } 121 }
121 122
122 static char * 123 static char *
@@ -137,7 +138,7 @@ Index: git/opcodes/microblaze-dis.c
137 { 138 {
138 char *p = strbuf (buf); 139 char *p = strbuf (buf);
139 140
140@@ -427,7 +439,11 @@ print_insn_microblaze (bfd_vma memaddr, 141@@ -427,7 +439,11 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
141 /* For mbar 16 or sleep insn. */ 142 /* For mbar 16 or sleep insn. */
142 case INST_TYPE_NONE: 143 case INST_TYPE_NONE:
143 break; 144 break;
@@ -150,10 +151,10 @@ Index: git/opcodes/microblaze-dis.c
150 case INST_TYPE_RD: 151 case INST_TYPE_RD:
151 print_func (stream, "\t%s", get_field_rd (&buf, inst)); 152 print_func (stream, "\t%s", get_field_rd (&buf, inst));
152 break; 153 break;
153Index: git/opcodes/microblaze-opc.h 154diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
154=================================================================== 155index 3b3cdbe710c..825c639a41e 100644
155--- git.orig/opcodes/microblaze-opc.h 156--- a/opcodes/microblaze-opc.h
156+++ git/opcodes/microblaze-opc.h 157+++ b/opcodes/microblaze-opc.h
157@@ -59,6 +59,9 @@ 158@@ -59,6 +59,9 @@
158 /* For mbar. */ 159 /* For mbar. */
159 #define INST_TYPE_IMM5 20 160 #define INST_TYPE_IMM5 20
@@ -201,10 +202,10 @@ Index: git/opcodes/microblaze-opc.h
201+ 202+
202 #endif /* MICROBLAZE_OPC */ 203 #endif /* MICROBLAZE_OPC */
203 204
204Index: git/opcodes/microblaze-opcm.h 205diff --git a/opcodes/microblaze-opcm.h b/opcodes/microblaze-opcm.h
205=================================================================== 206index ad964560c17..aa3401610d9 100644
206--- git.orig/opcodes/microblaze-opcm.h 207--- a/opcodes/microblaze-opcm.h
207+++ git/opcodes/microblaze-opcm.h 208+++ b/opcodes/microblaze-opcm.h
208@@ -29,7 +29,7 @@ enum microblaze_instr 209@@ -29,7 +29,7 @@ enum microblaze_instr
209 addi, rsubi, addic, rsubic, addik, rsubik, addikc, rsubikc, mul, 210 addi, rsubi, addic, rsubic, addik, rsubik, addikc, rsubikc, mul,
210 mulh, mulhu, mulhsu,swapb,swaph, 211 mulh, mulhu, mulhsu,swapb,swaph,
@@ -214,7 +215,7 @@ Index: git/opcodes/microblaze-opcm.h
214 /* 'or/and/xor' are C++ keywords. */ 215 /* 'or/and/xor' are C++ keywords. */
215 microblaze_or, microblaze_and, microblaze_xor, 216 microblaze_or, microblaze_and, microblaze_xor,
216 andn, pcmpbf, pcmpbc, pcmpeq, pcmpne, sra, src, srl, sext8, sext16, 217 andn, pcmpbf, pcmpbc, pcmpeq, pcmpne, sra, src, srl, sext8, sext16,
217@@ -129,6 +129,7 @@ enum microblaze_instr_type 218@@ -130,6 +130,7 @@ enum microblaze_instr_type
218 #define RB_LOW 11 /* Low bit for RB. */ 219 #define RB_LOW 11 /* Low bit for RB. */
219 #define IMM_LOW 0 /* Low bit for immediate. */ 220 #define IMM_LOW 0 /* Low bit for immediate. */
220 #define IMM_MBAR 21 /* low bit for mbar instruction. */ 221 #define IMM_MBAR 21 /* low bit for mbar instruction. */
@@ -222,7 +223,7 @@ Index: git/opcodes/microblaze-opcm.h
222 223
223 #define RD_MASK 0x03E00000 224 #define RD_MASK 0x03E00000
224 #define RA_MASK 0x001F0000 225 #define RA_MASK 0x001F0000
225@@ -141,6 +142,9 @@ enum microblaze_instr_type 226@@ -142,6 +143,9 @@ enum microblaze_instr_type
226 /* Imm mask for mbar. */ 227 /* Imm mask for mbar. */
227 #define IMM5_MBAR_MASK 0x03E00000 228 #define IMM5_MBAR_MASK 0x03E00000
228 229
@@ -232,3 +233,6 @@ Index: git/opcodes/microblaze-opcm.h
232 /* FSL imm mask for get, put instructions. */ 233 /* FSL imm mask for get, put instructions. */
233 #define RFSL_MASK 0x000000F 234 #define RFSL_MASK 0x000000F
234 235
236--
2372.25.1
238
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0010-fixing-the-imm-bug.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0010-fixing-the-imm-bug.-with-relax-option-imm-1-is-also-.patch
index 1c939a84..7cde8147 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0010-fixing-the-imm-bug.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0010-fixing-the-imm-bug.-with-relax-option-imm-1-is-also-.patch
@@ -1,18 +1,19 @@
1From ca1e831754eba0e38c1b7ceefd6a3d25c7d36e59 Mon Sep 17 00:00:00 2001 1From 248b0c67ed37bdc2ab0ba1d2c42a4ce200bbc237 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com> 2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Mon, 10 Jul 2017 16:07:28 +0530 3Date: Mon, 10 Jul 2017 16:07:28 +0530
4Subject: [PATCH 10/38] fixing the imm bug. with relax option imm -1 is also 4Subject: [PATCH 10/38] fixing the imm bug. with relax option imm -1 is also
5 getting removed this is corrected now. 5 getting removed this is corrected now.
6 6
7Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
7--- 8---
8 bfd/elf32-microblaze.c | 3 +-- 9 bfd/elf32-microblaze.c | 3 +--
9 1 file changed, 1 insertion(+), 2 deletions(-) 10 1 file changed, 1 insertion(+), 2 deletions(-)
10 11
11diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 12diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
12index e0729c6a194..e378542b902 100644 13index c66f4ffef36..8c89bdcaeeb 100644
13--- a/bfd/elf32-microblaze.c 14--- a/bfd/elf32-microblaze.c
14+++ b/bfd/elf32-microblaze.c 15+++ b/bfd/elf32-microblaze.c
15@@ -1861,8 +1861,7 @@ microblaze_elf_relax_section (bfd *abfd, 16@@ -1905,8 +1905,7 @@ microblaze_elf_relax_section (bfd *abfd,
16 else 17 else
17 symval += irel->r_addend; 18 symval += irel->r_addend;
18 19
@@ -21,7 +22,7 @@ index e0729c6a194..e378542b902 100644
21+ if ((symval & 0xffff8000) == 0) 22+ if ((symval & 0xffff8000) == 0)
22 { 23 {
23 /* We can delete this instruction. */ 24 /* We can delete this instruction. */
24 sec->relax[sec->relax_count].addr = irel->r_offset; 25 sdata->relax[sdata->relax_count].addr = irel->r_offset;
25-- 26--
262.17.1 272.25.1
27 28
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0011-Patch-Microblaze-fixed-bug-in-GCC-so-that-It-will-su.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0011-fixed-bug-in-GCC-so-that-It-will-support-.long-0U-an.patch
index 3118ea8c..9ab38bbb 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0011-Patch-Microblaze-fixed-bug-in-GCC-so-that-It-will-su.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0011-fixed-bug-in-GCC-so-that-It-will-support-.long-0U-an.patch
@@ -1,15 +1,16 @@
1From b844e6bdbb6aa0dd63055e8c763f68f83ab15318 Mon Sep 17 00:00:00 2001 1From 6d52004e565699474956e8eaf4f11c32b1c2a64a Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Fri, 29 Sep 2017 18:00:23 +0530 3Date: Fri, 29 Sep 2017 18:00:23 +0530
4Subject: [PATCH 11/38] [Patch,Microblaze]: fixed bug in GCC so that It will 4Subject: [PATCH 11/38] fixed bug in GCC so that It will support .long 0U and
5 support .long 0U and .long 0u 5 .long 0u
6 6
7Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
7--- 8---
8 gas/expr.c | 9 +++++++++ 9 gas/expr.c | 9 +++++++++
9 1 file changed, 9 insertions(+) 10 1 file changed, 9 insertions(+)
10 11
11diff --git a/gas/expr.c b/gas/expr.c 12diff --git a/gas/expr.c b/gas/expr.c
12index 03caa91f4d1..469a52cfd56 100644 13index 6ad8bee2733..a1281ef71a8 100644
13--- a/gas/expr.c 14--- a/gas/expr.c
14+++ b/gas/expr.c 15+++ b/gas/expr.c
15@@ -832,6 +832,15 @@ operand (expressionS *expressionP, enum expr_mode mode) 16@@ -832,6 +832,15 @@ operand (expressionS *expressionP, enum expr_mode mode)
@@ -29,5 +30,5 @@ index 03caa91f4d1..469a52cfd56 100644
29 switch (c) 30 switch (c)
30 { 31 {
31-- 32--
322.17.1 332.25.1
33 34
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0012-fixing-the-constant-range-check-issue.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0012-fixing-the-constant-range-check-issue-sample-error-n.patch
index 45953906..9f296ab9 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0012-fixing-the-constant-range-check-issue.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0012-fixing-the-constant-range-check-issue-sample-error-n.patch
@@ -1,15 +1,16 @@
1From 5d4d7383a152bfc87ac7fdf5fcaef7eaca500836 Mon Sep 17 00:00:00 2001 1From 855b983d270911c35c52b181426e9771f0851979 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com> 2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Mon, 16 Oct 2017 15:44:23 +0530 3Date: Mon, 16 Oct 2017 15:44:23 +0530
4Subject: [PATCH 12/38] fixing the constant range check issue sample error: not 4Subject: [PATCH 12/38] fixing the constant range check issue sample error: not
5 in range ffffffff80000000..7fffffff, not ffffffff70000000 5 in range ffffffff80000000..7fffffff, not ffffffff70000000
6 6
7Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
7--- 8---
8 gas/config/tc-microblaze.c | 2 +- 9 gas/config/tc-microblaze.c | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-) 10 1 file changed, 1 insertion(+), 1 deletion(-)
10 11
11diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 12diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
12index aa58a18f05c..98d0c259246 100644 13index 1cb9b2519c3..086f8704156 100644
13--- a/gas/config/tc-microblaze.c 14--- a/gas/config/tc-microblaze.c
14+++ b/gas/config/tc-microblaze.c 15+++ b/gas/config/tc-microblaze.c
15@@ -757,7 +757,7 @@ parse_imm (char * s, expressionS * e, offsetT min, offsetT max) 16@@ -757,7 +757,7 @@ parse_imm (char * s, expressionS * e, offsetT min, offsetT max)
@@ -22,5 +23,5 @@ index aa58a18f05c..98d0c259246 100644
22 as_fatal (_("operand must be absolute in range %lx..%lx, not %lx"), 23 as_fatal (_("operand must be absolute in range %lx..%lx, not %lx"),
23 (long) min, (long) max, (long) e->X_add_number); 24 (long) min, (long) max, (long) e->X_add_number);
24-- 25--
252.17.1 262.25.1
26 27
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0013-Patch-Microblaze-Compiler-will-give-error-messages-i.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0013-Compiler-will-give-error-messages-in-more-detail-for.patch
index 22404408..e76ef442 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0013-Patch-Microblaze-Compiler-will-give-error-messages-i.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0013-Compiler-will-give-error-messages-in-more-detail-for.patch
@@ -1,18 +1,19 @@
1From 094a9534b55a51982857859553c582492bf91815 Mon Sep 17 00:00:00 2001 1From a1169180250097b012ed69e3181ea0b4e22ae022 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Wed, 21 Feb 2018 12:32:02 +0530 3Date: Wed, 21 Feb 2018 12:32:02 +0530
4Subject: [PATCH 13/38] [Patch,Microblaze]: Compiler will give error messages 4Subject: [PATCH 13/38] Compiler will give error messages in more detail for
5 in more detail for mxl-gp-opt flag.. 5 mxl-gp-opt flag..
6 6
7Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
7--- 8---
8 ld/ldmain.c | 12 ++++++++++++ 9 ld/ldmain.c | 12 ++++++++++++
9 1 file changed, 12 insertions(+) 10 1 file changed, 12 insertions(+)
10 11
11diff --git a/ld/ldmain.c b/ld/ldmain.c 12diff --git a/ld/ldmain.c b/ld/ldmain.c
12index 42660eb9a3c..7849f060aad 100644 13index 545f6a0f31a..d4502e7f3b0 100644
13--- a/ld/ldmain.c 14--- a/ld/ldmain.c
14+++ b/ld/ldmain.c 15+++ b/ld/ldmain.c
15@@ -1562,6 +1562,18 @@ reloc_overflow (struct bfd_link_info *info, 16@@ -1566,6 +1566,18 @@ reloc_overflow (struct bfd_link_info *info,
16 break; 17 break;
17 case bfd_link_hash_defined: 18 case bfd_link_hash_defined:
18 case bfd_link_hash_defweak: 19 case bfd_link_hash_defweak:
@@ -32,5 +33,5 @@ index 42660eb9a3c..7849f060aad 100644
32 "%s against symbol `%pT' defined in %pA section in %pB"), 33 "%s against symbol `%pT' defined in %pA section in %pB"),
33 reloc_name, entry->root.string, 34 reloc_name, entry->root.string,
34-- 35--
352.17.1 362.25.1
36 37
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-initial-support-for-MicroBlaze-64-bit-m64.patch
index 0d70bf25..90563dc5 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-initial-support-for-MicroBlaze-64-bit-m64.patch
@@ -1,9 +1,9 @@
1From b53570b1b4eb3e57b21e44515c202dc710b438ce Mon Sep 17 00:00:00 2001 1From fb0b2c799f37daba8aca5d64966f426d16e07cf8 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Mon, 1 Nov 2021 19:06:53 +0530 3Date: Mon, 1 Nov 2021 19:06:53 +0530
4Subject: [PATCH 14/38] [Patch,MicroBlaze] : initial support for MicroBlaze 64 4Subject: [PATCH 14/38] initial support for MicroBlaze 64 bit [-m64]
5 bit [-m64]
6 5
6Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
7--- 7---
8 bfd/Makefile.am | 2 + 8 bfd/Makefile.am | 2 +
9 bfd/Makefile.in | 3 + 9 bfd/Makefile.in | 3 +
@@ -11,9 +11,9 @@ Subject: [PATCH 14/38] [Patch,MicroBlaze] : initial support for MicroBlaze 64
11 bfd/config.bfd | 4 + 11 bfd/config.bfd | 4 +
12 bfd/configure | 2 + 12 bfd/configure | 2 +
13 bfd/configure.ac | 2 + 13 bfd/configure.ac | 2 +
14 bfd/cpu-microblaze.c | 53 +- 14 bfd/cpu-microblaze.c | 55 +-
15 bfd/elf32-microblaze.c | 65 +- 15 bfd/elf32-microblaze.c | 65 +-
16 bfd/elf64-microblaze.c | 3577 ++++++++++++++++++++++++++++ 16 bfd/elf64-microblaze.c | 3622 ++++++++++++++++++++++++++++
17 bfd/libbfd.h | 2 + 17 bfd/libbfd.h | 2 +
18 bfd/reloc.c | 12 + 18 bfd/reloc.c | 12 +
19 bfd/targets.c | 6 + 19 bfd/targets.c | 6 +
@@ -29,15 +29,15 @@ Subject: [PATCH 14/38] [Patch,MicroBlaze] : initial support for MicroBlaze 64
29 opcodes/microblaze-dis.c | 35 +- 29 opcodes/microblaze-dis.c | 35 +-
30 opcodes/microblaze-opc.h | 162 +- 30 opcodes/microblaze-opc.h | 162 +-
31 opcodes/microblaze-opcm.h | 24 +- 31 opcodes/microblaze-opcm.h | 24 +-
32 24 files changed, 4375 insertions(+), 69 deletions(-) 32 24 files changed, 4422 insertions(+), 69 deletions(-)
33 create mode 100644 bfd/elf64-microblaze.c 33 create mode 100644 bfd/elf64-microblaze.c
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
37Index: git/bfd/Makefile.am 37diff --git a/bfd/Makefile.am b/bfd/Makefile.am
38=================================================================== 38index 670e0598f55..c76adec960a 100644
39--- git.orig/bfd/Makefile.am 39--- a/bfd/Makefile.am
40+++ git/bfd/Makefile.am 40+++ b/bfd/Makefile.am
41@@ -563,6 +563,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 \
@@ -46,7 +46,7 @@ Index: git/bfd/Makefile.am
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@@ -599,6 +600,7 @@ BFD64_BACKENDS_CFILES = \ 49@@ -600,6 +601,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: git/bfd/Makefile.am
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 \
57Index: git/bfd/Makefile.in 57diff --git a/bfd/Makefile.in b/bfd/Makefile.in
58=================================================================== 58index 6edacdfeb0e..e2721f43391 100644
59--- git.orig/bfd/Makefile.in 59--- a/bfd/Makefile.in
60+++ git/bfd/Makefile.in 60+++ b/bfd/Makefile.in
61@@ -991,6 +991,7 @@ BFD64_BACKENDS = \ 61@@ -1030,6 +1030,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: git/bfd/Makefile.in
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@@ -1027,6 +1028,7 @@ BFD64_BACKENDS_CFILES = \ 69@@ -1067,6 +1068,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: git/bfd/Makefile.in
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@@ -1535,6 +1537,7 @@ distclean-compile: 77@@ -1650,6 +1652,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,36 +82,36 @@ Index: git/bfd/Makefile.in
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@
85Index: git/bfd/bfd-in2.h 85diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
86=================================================================== 86index 26e3bb2b34b..6cf701abf10 100644
87--- git.orig/bfd/bfd-in2.h 87--- a/bfd/bfd-in2.h
88+++ git/bfd/bfd-in2.h 88+++ b/bfd/bfd-in2.h
89@@ -5436,11 +5436,21 @@ done here - only used for relaxing */ 89@@ -5389,11 +5389,21 @@ value in two words (with an imm instruction). No relocation is
90 done here - only used for relaxing */
90 BFD_RELOC_MICROBLAZE_64_NONE, 91 BFD_RELOC_MICROBLAZE_64_NONE,
91 92
92 /* This is a 64 bit reloc that stores the 32 bit pc relative 93+/* This is a 64 bit reloc that stores the 32 bit pc relative
93+ * +value in two words (with an imml instruction). No relocation is 94+ * +value in two words (with an imml instruction). No relocation is
94+ * +done here - only used for relaxing */ 95+ * +done here - only used for relaxing */
95+ BFD_RELOC_MICROBLAZE_64, 96+ BFD_RELOC_MICROBLAZE_64,
96+ 97+
97+/* This is a 64 bit reloc that stores the 32 bit pc relative 98 /* This is a 64 bit reloc that stores the 32 bit pc relative
98 value in two words (with an imm instruction). The relocation is 99 value in two words (with an imm instruction). The relocation is
99 PC-relative GOT offset */ 100 PC-relative GOT offset */
100 BFD_RELOC_MICROBLAZE_64_GOTPC, 101 BFD_RELOC_MICROBLAZE_64_GOTPC,
101 102
102 /* This is a 64 bit reloc that stores the 32 bit pc relative 103+/* This is a 64 bit reloc that stores the 32 bit pc relative
103+value in two words (with an imml instruction). The relocation is 104+value in two words (with an imml instruction). The relocation is
104+PC-relative GOT offset */ 105+PC-relative GOT offset */
105+ BFD_RELOC_MICROBLAZE_64_GPC, 106+ BFD_RELOC_MICROBLAZE_64_GPC,
106+ 107+
107+/* This is a 64 bit reloc that stores the 32 bit pc relative 108 /* This is a 64 bit reloc that stores the 32 bit pc relative
108 value in two words (with an imm instruction). The relocation is 109 value in two words (with an imm instruction). The relocation is
109 GOT offset */ 110 GOT offset */
110 BFD_RELOC_MICROBLAZE_64_GOT, 111diff --git a/bfd/config.bfd b/bfd/config.bfd
111Index: git/bfd/config.bfd 112index a4c6c8e8854..49208534de3 100644
112=================================================================== 113--- a/bfd/config.bfd
113--- git.orig/bfd/config.bfd 114+++ b/bfd/config.bfd
114+++ git/bfd/config.bfd
115@@ -855,11 +855,15 @@ case "${targ}" in 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
@@ -128,11 +128,11 @@ Index: git/bfd/config.bfd
128 ;; 128 ;;
129 129
130 #ifdef BFD64 130 #ifdef BFD64
131Index: git/bfd/configure 131diff --git a/bfd/configure b/bfd/configure
132=================================================================== 132index d90db11744b..08e33cf64cd 100755
133--- git.orig/bfd/configure 133--- a/bfd/configure
134+++ git/bfd/configure 134+++ b/bfd/configure
135@@ -14198,6 +14198,8 @@ do 135@@ -14196,6 +14196,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: git/bfd/configure
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" ;;
144Index: git/bfd/configure.ac 144diff --git a/bfd/configure.ac b/bfd/configure.ac
145=================================================================== 145index 73e5e03d016..20a50d0f308 100644
146--- git.orig/bfd/configure.ac 146--- a/bfd/configure.ac
147+++ git/bfd/configure.ac 147+++ b/bfd/configure.ac
148@@ -627,6 +627,8 @@ do 148@@ -603,6 +603,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,11 +154,11 @@ Index: git/bfd/configure.ac
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" ;;
157Index: git/bfd/cpu-microblaze.c 157diff --git a/bfd/cpu-microblaze.c b/bfd/cpu-microblaze.c
158=================================================================== 158index 0c1d2b1aa69..f64f659cf44 100644
159--- git.orig/bfd/cpu-microblaze.c 159--- a/bfd/cpu-microblaze.c
160+++ git/bfd/cpu-microblaze.c 160+++ b/bfd/cpu-microblaze.c
161@@ -23,7 +23,24 @@ 161@@ -23,7 +23,25 @@
162 #include "bfd.h" 162 #include "bfd.h"
163 #include "libbfd.h" 163 #include "libbfd.h"
164 164
@@ -177,33 +177,35 @@ Index: git/bfd/cpu-microblaze.c
177+ 3, /* Section align power. */ 177+ 3, /* Section align power. */
178+ false, /* Is this the default architecture ? */ 178+ false, /* Is this the default architecture ? */
179+ bfd_default_compatible, /* Architecture comparison function. */ 179+ bfd_default_compatible, /* Architecture comparison function. */
180+ bfd_default_scan, /* String to architecture conversion. */ 180+ bfd_default_scan, /* String to architecture conversion. */
181+ bfd_arch_default_fill, /* Default fill. */ 181+ bfd_arch_default_fill, /* Default fill. */
182+ &bfd_microblaze_arch[1] /* Next in list. */ 182+ &bfd_microblaze_arch[1], /* Next in list. */
183+ 0 /* Maximum offset of a reloc from the start of an insn. */
183+}, 184+},
184 { 185 {
185 32, /* Bits in a word. */ 186 32, /* Bits in a word. */
186 32, /* Bits in an address. */ 187 32, /* Bits in an address. */
187@@ -39,4 +56,38 @@ const bfd_arch_info_type bfd_microblaze_ 188@@ -39,4 +57,39 @@ const bfd_arch_info_type bfd_microblaze_arch =
188 bfd_arch_default_fill, /* Default fill. */ 189 bfd_arch_default_fill, /* Default fill. */
189 NULL, /* Next in list. */ 190 NULL, /* Next in list. */
190 0 /* Maximum offset of a reloc from the start of an insn. */ 191 0 /* Maximum offset of a reloc from the start of an insn. */
191+} 192+}
192+#else 193+#else
193+{ 194+{
194+ 32, /* 32 bits in a word. */ 195+ 32, /* 32 bits in a word. */
195+ 32, /* 32 bits in an address. */ 196+ 32, /* 32 bits in an address. */
196+ 8, /* 8 bits in a byte. */ 197+ 8, /* 8 bits in a byte. */
197+ bfd_arch_microblaze, /* Architecture. */ 198+ bfd_arch_microblaze, /* Architecture. */
198+ 0, /* Machine number - 0 for now. */ 199+ 0, /* Machine number - 0 for now. */
199+ "microblaze", /* Architecture name. */ 200+ "microblaze", /* Architecture name. */
200+ "MicroBlaze", /* Printable name. */ 201+ "MicroBlaze", /* Printable name. */
201+ 3, /* Section align power. */ 202+ 3, /* Section align power. */
202+ true, /* Is this the default architecture ? */ 203+ true, /* Is this the default architecture ? */
203+ bfd_default_compatible, /* Architecture comparison function. */ 204+ bfd_default_compatible, /* Architecture comparison function. */
204+ bfd_default_scan, /* String to architecture conversion. */ 205+ bfd_default_scan, /* String to architecture conversion. */
205+ bfd_arch_default_fill, /* Default fill. */ 206+ bfd_arch_default_fill, /* Default fill. */
206+ &bfd_microblaze_arch[1] /* Next in list. */ 207+ &bfd_microblaze_arch[1], /* Next in list. */
208+ 0 /* Maximum offset of a reloc from the start of an insn. */
207+}, 209+},
208+{ 210+{
209+ 64, /* 32 bits in a word. */ 211+ 64, /* 32 bits in a word. */
@@ -223,11 +225,11 @@ Index: git/bfd/cpu-microblaze.c
223+} 225+}
224+#endif 226+#endif
225 }; 227 };
226Index: git/bfd/elf32-microblaze.c 228diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
227=================================================================== 229index 8c89bdcaeeb..71ff973573c 100644
228--- git.orig/bfd/elf32-microblaze.c 230--- a/bfd/elf32-microblaze.c
229+++ git/bfd/elf32-microblaze.c 231+++ b/bfd/elf32-microblaze.c
230@@ -114,6 +114,20 @@ static reloc_howto_type microblaze_elf_h 232@@ -114,6 +114,20 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
231 0x0000ffff, /* Dest Mask. */ 233 0x0000ffff, /* Dest Mask. */
232 true), /* PC relative offset? */ 234 true), /* PC relative offset? */
233 235
@@ -248,7 +250,7 @@ Index: git/bfd/elf32-microblaze.c
248 /* A 64 bit relocation. Table entry not really used. */ 250 /* A 64 bit relocation. Table entry not really used. */
249 HOWTO (R_MICROBLAZE_64, /* Type. */ 251 HOWTO (R_MICROBLAZE_64, /* Type. */
250 0, /* Rightshift. */ 252 0, /* Rightshift. */
251@@ -179,15 +193,15 @@ static reloc_howto_type microblaze_elf_h 253@@ -179,15 +193,15 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
252 0, /* Rightshift. */ 254 0, /* Rightshift. */
253 2, /* Size (0 = byte, 1 = short, 2 = long). */ 255 2, /* Size (0 = byte, 1 = short, 2 = long). */
254 32, /* Bitsize. */ 256 32, /* Bitsize. */
@@ -267,7 +269,7 @@ Index: git/bfd/elf32-microblaze.c
267 269
268 HOWTO (R_MICROBLAZE_64_NONE, /* Type. */ 270 HOWTO (R_MICROBLAZE_64_NONE, /* Type. */
269 0, /* Rightshift. */ 271 0, /* Rightshift. */
270@@ -278,6 +292,21 @@ static reloc_howto_type microblaze_elf_h 272@@ -278,6 +292,21 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
271 0x0000ffff, /* Dest Mask. */ 273 0x0000ffff, /* Dest Mask. */
272 true), /* PC relative offset? */ 274 true), /* PC relative offset? */
273 275
@@ -289,7 +291,7 @@ Index: git/bfd/elf32-microblaze.c
289 /* A 64 bit GOT relocation. Table-entry not really used. */ 291 /* A 64 bit GOT relocation. Table-entry not really used. */
290 HOWTO (R_MICROBLAZE_GOT_64, /* Type. */ 292 HOWTO (R_MICROBLAZE_GOT_64, /* Type. */
291 0, /* Rightshift. */ 293 0, /* Rightshift. */
292@@ -617,9 +646,15 @@ microblaze_elf_reloc_type_lookup (bfd * 294@@ -617,9 +646,15 @@ microblaze_elf_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
293 case BFD_RELOC_VTABLE_ENTRY: 295 case BFD_RELOC_VTABLE_ENTRY:
294 microblaze_reloc = R_MICROBLAZE_GNU_VTENTRY; 296 microblaze_reloc = R_MICROBLAZE_GNU_VTENTRY;
295 break; 297 break;
@@ -305,7 +307,7 @@ Index: git/bfd/elf32-microblaze.c
305 case BFD_RELOC_MICROBLAZE_64_GOT: 307 case BFD_RELOC_MICROBLAZE_64_GOT:
306 microblaze_reloc = R_MICROBLAZE_GOT_64; 308 microblaze_reloc = R_MICROBLAZE_GOT_64;
307 break; 309 break;
308@@ -1459,7 +1494,7 @@ microblaze_elf_relocate_section (bfd *ou 310@@ -1500,7 +1535,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
309 if (r_symndx == STN_UNDEF || (input_section->flags & SEC_ALLOC) == 0) 311 if (r_symndx == STN_UNDEF || (input_section->flags & SEC_ALLOC) == 0)
310 { 312 {
311 relocation += addend; 313 relocation += addend;
@@ -314,7 +316,7 @@ Index: git/bfd/elf32-microblaze.c
314 bfd_put_32 (input_bfd, relocation, contents + offset); 316 bfd_put_32 (input_bfd, relocation, contents + offset);
315 else 317 else
316 { 318 {
317@@ -1925,6 +1960,28 @@ microblaze_elf_relax_section (bfd *abfd, 319@@ -1969,6 +2004,28 @@ microblaze_elf_relax_section (bfd *abfd,
318 irel->r_addend -= calc_fixup (irel->r_addend, 0, sec); 320 irel->r_addend -= calc_fixup (irel->r_addend, 0, sec);
319 } 321 }
320 break; 322 break;
@@ -343,11 +345,12 @@ Index: git/bfd/elf32-microblaze.c
343 case R_MICROBLAZE_NONE: 345 case R_MICROBLAZE_NONE:
344 case R_MICROBLAZE_32_NONE: 346 case R_MICROBLAZE_32_NONE:
345 { 347 {
346Index: git/bfd/elf64-microblaze.c 348diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
347=================================================================== 349new file mode 100644
350index 00000000000..7434bef393b
348--- /dev/null 351--- /dev/null
349+++ git/bfd/elf64-microblaze.c 352+++ b/bfd/elf64-microblaze.c
350@@ -0,0 +1,3577 @@ 353@@ -0,0 +1,3622 @@
351+/* Xilinx MicroBlaze-specific support for 32-bit ELF 354+/* Xilinx MicroBlaze-specific support for 32-bit ELF
352+ 355+
353+ Copyright (C) 2009-2021 Free Software Foundation, Inc. 356+ Copyright (C) 2009-2021 Free Software Foundation, Inc.
@@ -1101,6 +1104,47 @@ Index: git/bfd/elf64-microblaze.c
1101+ return true; 1104+ return true;
1102+} 1105+}
1103+ 1106+
1107+/* Relax table contains information about instructions which can
1108+ be removed by relaxation -- replacing a long address with a
1109+ short address. */
1110+struct relax_table
1111+{
1112+ /* Address where bytes may be deleted. */
1113+ bfd_vma addr;
1114+
1115+ /* Number of bytes to be deleted. */
1116+ size_t size;
1117+};
1118+
1119+struct _microblaze_elf_section_data
1120+{
1121+ struct bfd_elf_section_data elf;
1122+ /* Count of used relaxation table entries. */
1123+ size_t relax_count;
1124+ /* Relaxation table. */
1125+ struct relax_table *relax;
1126+};
1127+
1128+#define microblaze_elf_section_data(sec) \
1129+ ((struct _microblaze_elf_section_data *) elf_section_data (sec))
1130+
1131+static bool
1132+microblaze_elf_new_section_hook (bfd *abfd, asection *sec)
1133+{
1134+ if (!sec->used_by_bfd)
1135+ {
1136+ struct _microblaze_elf_section_data *sdata;
1137+ size_t amt = sizeof (*sdata);
1138+
1139+ sdata = bfd_zalloc (abfd, amt);
1140+ if (sdata == NULL)
1141+ return false;
1142+ sec->used_by_bfd = sdata;
1143+ }
1144+
1145+ return _bfd_elf_new_section_hook (abfd, sec);
1146+}
1147+
1104+/* Microblaze ELF local labels start with 'L.' or '$L', not '.L'. */ 1148+/* Microblaze ELF local labels start with 'L.' or '$L', not '.L'. */
1105+ 1149+
1106+static bool 1150+static bool
@@ -2054,19 +2098,20 @@ Index: git/bfd/elf64-microblaze.c
2054+calc_fixup (bfd_vma start, bfd_vma size, asection *sec) 2098+calc_fixup (bfd_vma start, bfd_vma size, asection *sec)
2055+{ 2099+{
2056+ bfd_vma end = start + size; 2100+ bfd_vma end = start + size;
2057+ int i, fixup = 0; 2101+ size_t i, fixup = 0;
2102+ struct _microblaze_elf_section_data *sdata;
2058+ 2103+
2059+ if (sec == NULL || sec->relax == NULL) 2104+ if (sec == NULL || (sdata = microblaze_elf_section_data (sec)) == NULL)
2060+ return 0; 2105+ return 0;
2061+ 2106+
2062+ /* Look for addr in relax table, total fixup value. */ 2107+ /* Look for addr in relax table, total fixup value. */
2063+ for (i = 0; i < sec->relax_count; i++) 2108+ for (i = 0; i < sdata->relax_count; i++)
2064+ { 2109+ {
2065+ if (end <= sec->relax[i].addr) 2110+ if (end <= sdata->relax[i].addr)
2066+ break; 2111+ break;
2067+ if ((end != start) && (start > sec->relax[i].addr)) 2112+ if (end != start && start > sdata->relax[i].addr)
2068+ continue; 2113+ continue;
2069+ fixup += sec->relax[i].size; 2114+ fixup += sdata->relax[i].size;
2070+ } 2115+ }
2071+ return fixup; 2116+ return fixup;
2072+} 2117+}
@@ -2123,6 +2168,7 @@ Index: git/bfd/elf64-microblaze.c
2123+ int symcount; 2168+ int symcount;
2124+ int offset; 2169+ int offset;
2125+ bfd_vma src, dest; 2170+ bfd_vma src, dest;
2171+ struct _microblaze_elf_section_data *sdata;
2126+ 2172+
2127+ /* We only do this once per section. We may be able to delete some code 2173+ /* We only do this once per section. We may be able to delete some code
2128+ by running multiple passes, but it is not worth it. */ 2174+ by running multiple passes, but it is not worth it. */
@@ -2131,8 +2177,9 @@ Index: git/bfd/elf64-microblaze.c
2131+ /* Only do this for a text section. */ 2177+ /* Only do this for a text section. */
2132+ if (bfd_link_relocatable (link_info) 2178+ if (bfd_link_relocatable (link_info)
2133+ || (sec->flags & SEC_RELOC) == 0 2179+ || (sec->flags & SEC_RELOC) == 0
2134+ || (sec->reloc_count == 0) 2180+ || (sec->flags & SEC_CODE) == 0
2135+ || (sec->flags & SEC_CODE) == 0) 2181+ || sec->reloc_count == 0
2182+ || (sdata = microblaze_elf_section_data (sec)) == NULL)
2136+ return true; 2183+ return true;
2137+ 2184+
2138+ BFD_ASSERT ((sec->size > 0) || (sec->rawsize > 0)); 2185+ BFD_ASSERT ((sec->size > 0) || (sec->rawsize > 0));
@@ -2157,11 +2204,11 @@ Index: git/bfd/elf64-microblaze.c
2157+ if (! link_info->keep_memory) 2204+ if (! link_info->keep_memory)
2158+ free_relocs = internal_relocs; 2205+ free_relocs = internal_relocs;
2159+ 2206+
2160+ sec->relax = (struct relax_table *) bfd_malloc ((sec->reloc_count + 1) 2207+ sdata->relax_count = 0;
2161+ * sizeof (struct relax_table)); 2208+ sdata->relax = (struct relax_table *) bfd_malloc ((sec->reloc_count + 1)
2162+ if (sec->relax == NULL) 2209+ * sizeof (*sdata->relax));
2210+ if (sdata->relax == NULL)
2163+ goto error_return; 2211+ goto error_return;
2164+ sec->relax_count = 0;
2165+ 2212+
2166+ irelend = internal_relocs + sec->reloc_count; 2213+ irelend = internal_relocs + sec->reloc_count;
2167+ rel_count = 0; 2214+ rel_count = 0;
@@ -2250,9 +2297,9 @@ Index: git/bfd/elf64-microblaze.c
2250+ if ((symval & 0xffff8000) == 0) 2297+ if ((symval & 0xffff8000) == 0)
2251+ { 2298+ {
2252+ /* We can delete this instruction. */ 2299+ /* We can delete this instruction. */
2253+ sec->relax[sec->relax_count].addr = irel->r_offset; 2300+ sdata->relax[sdata->relax_count].addr = irel->r_offset;
2254+ sec->relax[sec->relax_count].size = INST_WORD_SIZE; 2301+ sdata->relax[sdata->relax_count].size = INST_WORD_SIZE;
2255+ sec->relax_count++; 2302+ sdata->relax_count++;
2256+ 2303+
2257+ /* Rewrite relocation type. */ 2304+ /* Rewrite relocation type. */
2258+ switch ((enum elf_microblaze_reloc_type) ELF64_R_TYPE (irel->r_info)) 2305+ switch ((enum elf_microblaze_reloc_type) ELF64_R_TYPE (irel->r_info))
@@ -2277,11 +2324,11 @@ Index: git/bfd/elf64-microblaze.c
2277+ } /* Loop through all relocations. */ 2324+ } /* Loop through all relocations. */
2278+ 2325+
2279+ /* Loop through the relocs again, and see if anything needs to change. */ 2326+ /* Loop through the relocs again, and see if anything needs to change. */
2280+ if (sec->relax_count > 0) 2327+ if (sdata->relax_count > 0)
2281+ { 2328+ {
2282+ shndx = _bfd_elf_section_from_bfd_section (abfd, sec); 2329+ shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
2283+ rel_count = 0; 2330+ rel_count = 0;
2284+ sec->relax[sec->relax_count].addr = sec->size; 2331+ sdata->relax[sdata->relax_count].addr = sec->size;
2285+ 2332+
2286+ for (irel = internal_relocs; irel < irelend; irel++, rel_count++) 2333+ for (irel = internal_relocs; irel < irelend; irel++, rel_count++)
2287+ { 2334+ {
@@ -2674,15 +2721,16 @@ Index: git/bfd/elf64-microblaze.c
2674+ } 2721+ }
2675+ 2722+
2676+ /* Physically move the code and change the cooked size. */ 2723+ /* Physically move the code and change the cooked size. */
2677+ dest = sec->relax[0].addr; 2724+ dest = sdata->relax[0].addr;
2678+ for (i = 0; i < sec->relax_count; i++) 2725+ for (i = 0; i < sdata->relax_count; i++)
2679+ { 2726+ {
2680+ int len; 2727+ size_t len;
2681+ src = sec->relax[i].addr + sec->relax[i].size; 2728+ src = sdata->relax[i].addr + sdata->relax[i].size;
2682+ len = sec->relax[i+1].addr - sec->relax[i].addr - sec->relax[i].size; 2729+ len = (sdata->relax[i+1].addr - sdata->relax[i].addr
2730+ - sdata->relax[i].size);
2683+ 2731+
2684+ memmove (contents + dest, contents + src, len); 2732+ memmove (contents + dest, contents + src, len);
2685+ sec->size -= sec->relax[i].size; 2733+ sec->size -= sdata->relax[i].size;
2686+ dest += len; 2734+ dest += len;
2687+ } 2735+ }
2688+ 2736+
@@ -2708,11 +2756,11 @@ Index: git/bfd/elf64-microblaze.c
2708+ free_contents = NULL; 2756+ free_contents = NULL;
2709+ } 2757+ }
2710+ 2758+
2711+ if (sec->relax_count == 0) 2759+ if (sdata->relax_count == 0)
2712+ { 2760+ {
2713+ *again = false; 2761+ *again = false;
2714+ free (sec->relax); 2762+ free (sdata->relax);
2715+ sec->relax = NULL; 2763+ sdata->relax = NULL;
2716+ } 2764+ }
2717+ else 2765+ else
2718+ *again = true; 2766+ *again = true;
@@ -2721,9 +2769,9 @@ Index: git/bfd/elf64-microblaze.c
2721+ error_return: 2769+ error_return:
2722+ free (free_relocs); 2770+ free (free_relocs);
2723+ free (free_contents); 2771+ free (free_contents);
2724+ free (sec->relax); 2772+ free (sdata->relax);
2725+ sec->relax = NULL; 2773+ sdata->relax = NULL;
2726+ sec->relax_count = 0; 2774+ sdata->relax_count = 0;
2727+ return false; 2775+ return false;
2728+} 2776+}
2729+ 2777+
@@ -3925,11 +3973,11 @@ Index: git/bfd/elf64-microblaze.c
3925+#define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook 3973+#define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook
3926+ 3974+
3927+#include "elf64-target.h" 3975+#include "elf64-target.h"
3928Index: git/bfd/libbfd.h 3976diff --git a/bfd/libbfd.h b/bfd/libbfd.h
3929=================================================================== 3977index ea2507d1879..e74c051e781 100644
3930--- git.orig/bfd/libbfd.h 3978--- a/bfd/libbfd.h
3931+++ git/bfd/libbfd.h 3979+++ b/bfd/libbfd.h
3932@@ -2994,7 +2994,9 @@ static const char *const bfd_reloc_code_ 3980@@ -2991,7 +2991,9 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
3933 "BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM", 3981 "BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM",
3934 "BFD_RELOC_MICROBLAZE_32_NONE", 3982 "BFD_RELOC_MICROBLAZE_32_NONE",
3935 "BFD_RELOC_MICROBLAZE_64_NONE", 3983 "BFD_RELOC_MICROBLAZE_64_NONE",
@@ -3939,41 +3987,40 @@ Index: git/bfd/libbfd.h
3939 "BFD_RELOC_MICROBLAZE_64_GOT", 3987 "BFD_RELOC_MICROBLAZE_64_GOT",
3940 "BFD_RELOC_MICROBLAZE_64_PLT", 3988 "BFD_RELOC_MICROBLAZE_64_PLT",
3941 "BFD_RELOC_MICROBLAZE_64_GOTOFF", 3989 "BFD_RELOC_MICROBLAZE_64_GOTOFF",
3942Index: git/bfd/reloc.c 3990diff --git a/bfd/reloc.c b/bfd/reloc.c
3943=================================================================== 3991index 5ac8a8536a7..0f99df91299 100644
3944--- git.orig/bfd/reloc.c 3992--- a/bfd/reloc.c
3945+++ git/bfd/reloc.c 3993+++ b/bfd/reloc.c
3946@@ -6907,6 +6907,12 @@ ENUMDOC 3994@@ -6875,12 +6875,24 @@ ENUMDOC
3995 done here - only used for relaxing
3947 ENUM 3996 ENUM
3948 BFD_RELOC_MICROBLAZE_64_NONE 3997 BFD_RELOC_MICROBLAZE_64_NONE
3949 ENUMDOC 3998+ENUMDOC
3950+ This is a 32 bit reloc that stores the 32 bit pc relative 3999+ This is a 32 bit reloc that stores the 32 bit pc relative
3951+ value in two words (with an imml instruction). No relocation is 4000+ value in two words (with an imml instruction). No relocation is
3952+ done here - only used for relaxing 4001+ done here - only used for relaxing
3953+ENUM 4002+ENUM
3954+ BFD_RELOC_MICROBLAZE_64 4003+ BFD_RELOC_MICROBLAZE_64
3955+ENUMDOC 4004 ENUMDOC
3956 This is a 64 bit reloc that stores the 32 bit pc relative 4005 This is a 64 bit reloc that stores the 32 bit pc relative
3957 value in two words (with an imm instruction). No relocation is 4006 value in two words (with an imm instruction). No relocation is
3958 done here - only used for relaxing 4007 done here - only used for relaxing
3959@@ -6914,6 +6920,12 @@ ENUM 4008 ENUM
3960 BFD_RELOC_MICROBLAZE_64_GOTPC 4009 BFD_RELOC_MICROBLAZE_64_GOTPC
3961 ENUMDOC 4010+ENUMDOC
3962 This is a 64 bit reloc that stores the 32 bit pc relative 4011+ This is a 64 bit reloc that stores the 32 bit pc relative
3963+ value in two words (with an imml instruction). No relocation is 4012+ value in two words (with an imml instruction). No relocation is
3964+ done here - only used for relaxing 4013+ done here - only used for relaxing
3965+ENUM 4014+ENUM
3966+ BFD_RELOC_MICROBLAZE_64_GPC 4015+ BFD_RELOC_MICROBLAZE_64_GPC
3967+ENUMDOC 4016 ENUMDOC
3968+ This is a 64 bit reloc that stores the 32 bit pc relative 4017 This is a 64 bit reloc that stores the 32 bit pc relative
3969 value in two words (with an imm instruction). The relocation is 4018 value in two words (with an imm instruction). The relocation is
3970 PC-relative GOT offset 4019diff --git a/bfd/targets.c b/bfd/targets.c
3971 ENUM 4020index 3284bb88aa8..6e93cb2f995 100644
3972Index: git/bfd/targets.c 4021--- a/bfd/targets.c
3973=================================================================== 4022+++ b/bfd/targets.c
3974--- git.orig/bfd/targets.c 4023@@ -791,6 +791,8 @@ extern const bfd_target mep_elf32_le_vec;
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; 4024 extern const bfd_target metag_elf32_vec;
3978 extern const bfd_target microblaze_elf32_vec; 4025 extern const bfd_target microblaze_elf32_vec;
3979 extern const bfd_target microblaze_elf32_le_vec; 4026 extern const bfd_target microblaze_elf32_le_vec;
@@ -3982,7 +4029,7 @@ Index: git/bfd/targets.c
3982 extern const bfd_target mips_ecoff_be_vec; 4029 extern const bfd_target mips_ecoff_be_vec;
3983 extern const bfd_target mips_ecoff_le_vec; 4030 extern const bfd_target mips_ecoff_le_vec;
3984 extern const bfd_target mips_ecoff_bele_vec; 4031 extern const bfd_target mips_ecoff_bele_vec;
3985@@ -1160,6 +1162,10 @@ static const bfd_target * const _bfd_tar 4032@@ -1153,6 +1155,10 @@ static const bfd_target * const _bfd_target_vector[] =
3986 4033
3987 &metag_elf32_vec, 4034 &metag_elf32_vec,
3988 4035
@@ -3993,10 +4040,10 @@ Index: git/bfd/targets.c
3993 &microblaze_elf32_vec, 4040 &microblaze_elf32_vec,
3994 4041
3995 &mips_ecoff_be_vec, 4042 &mips_ecoff_be_vec,
3996Index: git/gas/config/tc-microblaze.c 4043diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
3997=================================================================== 4044index 086f8704156..a6f12dda54a 100644
3998--- git.orig/gas/config/tc-microblaze.c 4045--- a/gas/config/tc-microblaze.c
3999+++ git/gas/config/tc-microblaze.c 4046+++ b/gas/config/tc-microblaze.c
4000@@ -35,10 +35,13 @@ 4047@@ -35,10 +35,13 @@
4001 #define streq(a,b) (strcmp (a, b) == 0) 4048 #define streq(a,b) (strcmp (a, b) == 0)
4002 #endif 4049 #endif
@@ -4048,7 +4095,7 @@ Index: git/gas/config/tc-microblaze.c
4048 {"frame", s_ignore, 0}, 4095 {"frame", s_ignore, 0},
4049 {"mask", s_ignore, 0}, /* Emitted by gcc. */ 4096 {"mask", s_ignore, 0}, /* Emitted by gcc. */
4050 {NULL, NULL, 0} 4097 {NULL, NULL, 0}
4051@@ -773,6 +781,74 @@ parse_imm (char * s, expressionS * e, of 4098@@ -773,6 +781,74 @@ parse_imm (char * s, expressionS * e, offsetT min, offsetT max)
4052 return new_pointer; 4099 return new_pointer;
4053 } 4100 }
4054 4101
@@ -4123,7 +4170,7 @@ Index: git/gas/config/tc-microblaze.c
4123 static char * 4170 static char *
4124 check_got (int * got_type, int * got_len) 4171 check_got (int * got_type, int * got_len)
4125 { 4172 {
4126@@ -827,7 +903,7 @@ check_got (int * got_type, int * got_len 4173@@ -827,7 +903,7 @@ check_got (int * got_type, int * got_len)
4127 extern bfd_reloc_code_real_type 4174 extern bfd_reloc_code_real_type
4128 parse_cons_expression_microblaze (expressionS *exp, int size) 4175 parse_cons_expression_microblaze (expressionS *exp, int size)
4129 { 4176 {
@@ -4132,7 +4179,7 @@ Index: git/gas/config/tc-microblaze.c
4132 { 4179 {
4133 /* Handle @GOTOFF et.al. */ 4180 /* Handle @GOTOFF et.al. */
4134 char *save, *gotfree_copy; 4181 char *save, *gotfree_copy;
4135@@ -859,6 +935,7 @@ parse_cons_expression_microblaze (expres 4182@@ -859,6 +935,7 @@ parse_cons_expression_microblaze (expressionS *exp, int size)
4136 4183
4137 static const char * str_microblaze_ro_anchor = "RO"; 4184 static const char * str_microblaze_ro_anchor = "RO";
4138 static const char * str_microblaze_rw_anchor = "RW"; 4185 static const char * str_microblaze_rw_anchor = "RW";
@@ -4439,7 +4486,7 @@ Index: git/gas/config/tc-microblaze.c
4439 { NULL, no_argument, NULL, 0} 4486 { NULL, no_argument, NULL, 0}
4440 }; 4487 };
4441 4488
4442@@ -1971,13 +2230,23 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UN 4489@@ -1971,13 +2230,23 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
4443 fragP->fr_fix += INST_WORD_SIZE * 2; 4490 fragP->fr_fix += INST_WORD_SIZE * 2;
4444 fragP->fr_var = 0; 4491 fragP->fr_var = 0;
4445 break; 4492 break;
@@ -4555,7 +4602,7 @@ Index: git/gas/config/tc-microblaze.c
4555 else if (fixP->fx_r_type == BFD_RELOC_32) 4602 else if (fixP->fx_r_type == BFD_RELOC_32)
4556 fixP->fx_r_type = BFD_RELOC_MICROBLAZE_32_NONE; 4603 fixP->fx_r_type = BFD_RELOC_MICROBLAZE_32_NONE;
4557 else 4604 else
4558@@ -2323,6 +2614,32 @@ md_estimate_size_before_relax (fragS * f 4605@@ -2323,6 +2614,32 @@ md_estimate_size_before_relax (fragS * fragP,
4559 as_bad (_("Absolute PC-relative value in relaxation code. Assembler error.....")); 4606 as_bad (_("Absolute PC-relative value in relaxation code. Assembler error....."));
4560 abort (); 4607 abort ();
4561 } 4608 }
@@ -4588,7 +4635,7 @@ Index: git/gas/config/tc-microblaze.c
4588 else if (S_GET_SEGMENT (fragP->fr_symbol) == segment_type && 4635 else if (S_GET_SEGMENT (fragP->fr_symbol) == segment_type &&
4589 !S_IS_WEAK (fragP->fr_symbol)) 4636 !S_IS_WEAK (fragP->fr_symbol))
4590 { 4637 {
4591@@ -2330,6 +2647,7 @@ md_estimate_size_before_relax (fragS * f 4638@@ -2330,6 +2647,7 @@ md_estimate_size_before_relax (fragS * fragP,
4592 /* Don't know now whether we need an imm instruction. */ 4639 /* Don't know now whether we need an imm instruction. */
4593 fragP->fr_var = INST_WORD_SIZE; 4640 fragP->fr_var = INST_WORD_SIZE;
4594 } 4641 }
@@ -4596,7 +4643,7 @@ Index: git/gas/config/tc-microblaze.c
4596 else if (S_IS_DEFINED (fragP->fr_symbol) 4643 else if (S_IS_DEFINED (fragP->fr_symbol)
4597 && (((S_GET_SEGMENT (fragP->fr_symbol))->flags & SEC_CODE) == 0)) 4644 && (((S_GET_SEGMENT (fragP->fr_symbol))->flags & SEC_CODE) == 0))
4598 { 4645 {
4599@@ -2432,6 +2750,7 @@ md_estimate_size_before_relax (fragS * f 4646@@ -2432,6 +2750,7 @@ md_estimate_size_before_relax (fragS * fragP,
4600 case TLSLD_OFFSET: 4647 case TLSLD_OFFSET:
4601 case TLSTPREL_OFFSET: 4648 case TLSTPREL_OFFSET:
4602 case TLSDTPREL_OFFSET: 4649 case TLSDTPREL_OFFSET:
@@ -4604,7 +4651,7 @@ Index: git/gas/config/tc-microblaze.c
4604 fragP->fr_var = INST_WORD_SIZE*2; 4651 fragP->fr_var = INST_WORD_SIZE*2;
4605 break; 4652 break;
4606 case DEFINED_RO_SEGMENT: 4653 case DEFINED_RO_SEGMENT:
4607@@ -2485,7 +2804,7 @@ md_pcrel_from_section (fixS * fixp, segT 4654@@ -2485,7 +2804,7 @@ md_pcrel_from_section (fixS * fixp, segT sec ATTRIBUTE_UNUSED)
4608 else 4655 else
4609 { 4656 {
4610 /* The case where we are going to resolve things... */ 4657 /* The case where we are going to resolve things... */
@@ -4613,7 +4660,7 @@ Index: git/gas/config/tc-microblaze.c
4613 return fixp->fx_where + fixp->fx_frag->fr_address + INST_WORD_SIZE; 4660 return fixp->fx_where + fixp->fx_frag->fr_address + INST_WORD_SIZE;
4614 else 4661 else
4615 return fixp->fx_where + fixp->fx_frag->fr_address; 4662 return fixp->fx_where + fixp->fx_frag->fr_address;
4616@@ -2518,6 +2837,8 @@ tc_gen_reloc (asection * section ATTRIBU 4663@@ -2518,6 +2837,8 @@ tc_gen_reloc (asection * section ATTRIBUTE_UNUSED, fixS * fixp)
4617 case BFD_RELOC_MICROBLAZE_32_RWSDA: 4664 case BFD_RELOC_MICROBLAZE_32_RWSDA:
4618 case BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM: 4665 case BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM:
4619 case BFD_RELOC_MICROBLAZE_64_GOTPC: 4666 case BFD_RELOC_MICROBLAZE_64_GOTPC:
@@ -4622,7 +4669,7 @@ Index: git/gas/config/tc-microblaze.c
4622 case BFD_RELOC_MICROBLAZE_64_GOT: 4669 case BFD_RELOC_MICROBLAZE_64_GOT:
4623 case BFD_RELOC_MICROBLAZE_64_PLT: 4670 case BFD_RELOC_MICROBLAZE_64_PLT:
4624 case BFD_RELOC_MICROBLAZE_64_GOTOFF: 4671 case BFD_RELOC_MICROBLAZE_64_GOTOFF:
4625@@ -2578,6 +2899,18 @@ tc_gen_reloc (asection * section ATTRIBU 4672@@ -2578,6 +2899,18 @@ tc_gen_reloc (asection * section ATTRIBUTE_UNUSED, fixS * fixp)
4626 return rel; 4673 return rel;
4627 } 4674 }
4628 4675
@@ -4641,7 +4688,7 @@ Index: git/gas/config/tc-microblaze.c
4641 int 4688 int
4642 md_parse_option (int c, const char * arg ATTRIBUTE_UNUSED) 4689 md_parse_option (int c, const char * arg ATTRIBUTE_UNUSED)
4643 { 4690 {
4644@@ -2591,6 +2924,10 @@ md_parse_option (int c, const char * arg 4691@@ -2591,6 +2924,10 @@ md_parse_option (int c, const char * arg ATTRIBUTE_UNUSED)
4645 case OPTION_LITTLE: 4692 case OPTION_LITTLE:
4646 target_big_endian = 0; 4693 target_big_endian = 0;
4647 break; 4694 break;
@@ -4652,7 +4699,7 @@ Index: git/gas/config/tc-microblaze.c
4652 default: 4699 default:
4653 return 0; 4700 return 0;
4654 } 4701 }
4655@@ -2606,6 +2943,7 @@ md_show_usage (FILE * stream ATTRIBUTE_U 4702@@ -2606,6 +2943,7 @@ md_show_usage (FILE * stream ATTRIBUTE_UNUSED)
4656 fprintf (stream, _(" MicroBlaze specific assembler options:\n")); 4703 fprintf (stream, _(" MicroBlaze specific assembler options:\n"));
4657 fprintf (stream, " -%-23s%s\n", "mbig-endian", N_("assemble for a big endian cpu")); 4704 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")); 4705 fprintf (stream, " -%-23s%s\n", "mlittle-endian", N_("assemble for a little endian cpu"));
@@ -4672,11 +4719,11 @@ Index: git/gas/config/tc-microblaze.c
4672 break; 4719 break;
4673 default: 4720 default:
4674 as_bad (_("unsupported BFD relocation size %u"), size); 4721 as_bad (_("unsupported BFD relocation size %u"), size);
4675Index: git/gas/config/tc-microblaze.h 4722diff --git a/gas/config/tc-microblaze.h b/gas/config/tc-microblaze.h
4676=================================================================== 4723index 36f56725c46..5a97b460212 100644
4677--- git.orig/gas/config/tc-microblaze.h 4724--- a/gas/config/tc-microblaze.h
4678+++ git/gas/config/tc-microblaze.h 4725+++ b/gas/config/tc-microblaze.h
4679@@ -81,7 +81,9 @@ extern const struct relax_type md_relax_ 4726@@ -81,7 +81,9 @@ extern const struct relax_type md_relax_table[];
4680 4727
4681 #ifdef OBJ_ELF 4728 #ifdef OBJ_ELF
4682 4729
@@ -4687,23 +4734,23 @@ Index: git/gas/config/tc-microblaze.h
4687 4734
4688 #define ELF_TC_SPECIAL_SECTIONS \ 4735 #define ELF_TC_SPECIAL_SECTIONS \
4689 { ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, \ 4736 { ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, \
4690Index: git/include/elf/common.h 4737diff --git a/include/elf/common.h b/include/elf/common.h
4691=================================================================== 4738index e4bc53e35b4..1ad565adf7a 100644
4692--- git.orig/include/elf/common.h 4739--- a/include/elf/common.h
4693+++ git/include/elf/common.h 4740+++ b/include/elf/common.h
4694@@ -354,6 +354,7 @@ 4741@@ -360,6 +360,7 @@
4695 #define EM_65816 257 /* WDC 65816/65C816 */ 4742 #define EM_U16_U8CORE 260 /* LAPIS nX-U16/U8 */
4696 #define EM_LOONGARCH 258 /* LoongArch */ 4743 #define EM_TACHYUM 261 /* Tachyum */
4697 #define EM_KF32 259 /* ChipON KungFu32 */ 4744 #define EM_56800EF 262 /* NXP 56800EF Digital Signal Controller (DSC) */
4698+#define EM_MB_64 260 /* Xilinx MicroBlaze 32-bit RISC soft processor core */ 4745+#define EM_MB_64 263 /* Xilinx MicroBlaze 32-bit RISC soft processor core */
4699 4746
4700 /* If it is necessary to assign new unofficial EM_* values, please pick large 4747 /* 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 4748 random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision
4702Index: git/include/elf/microblaze.h 4749diff --git a/include/elf/microblaze.h b/include/elf/microblaze.h
4703=================================================================== 4750index a2e1ce4580f..79799b86a49 100644
4704--- git.orig/include/elf/microblaze.h 4751--- a/include/elf/microblaze.h
4705+++ git/include/elf/microblaze.h 4752+++ b/include/elf/microblaze.h
4706@@ -62,6 +62,8 @@ START_RELOC_NUMBERS (elf_microblaze_relo 4753@@ -62,6 +62,8 @@ START_RELOC_NUMBERS (elf_microblaze_reloc_type)
4707 RELOC_NUMBER (R_MICROBLAZE_TEXTREL_64, 31) /* TEXT Entry offset 64-bit. */ 4754 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. */ 4755 RELOC_NUMBER (R_MICROBLAZE_TEXTREL_32_LO, 32) /* TEXT Entry offset 32-bit. */
4709 RELOC_NUMBER (R_MICROBLAZE_32_NONE, 33) 4756 RELOC_NUMBER (R_MICROBLAZE_32_NONE, 33)
@@ -4712,11 +4759,11 @@ Index: git/include/elf/microblaze.h
4712 4759
4713 END_RELOC_NUMBERS (R_MICROBLAZE_max) 4760 END_RELOC_NUMBERS (R_MICROBLAZE_max)
4714 4761
4715Index: git/ld/Makefile.am 4762diff --git a/ld/Makefile.am b/ld/Makefile.am
4716=================================================================== 4763index 05c7630073d..256a95a2219 100644
4717--- git.orig/ld/Makefile.am 4764--- a/ld/Makefile.am
4718+++ git/ld/Makefile.am 4765+++ b/ld/Makefile.am
4719@@ -448,6 +448,8 @@ ALL_64_EMULATION_SOURCES = \ 4766@@ -445,6 +445,8 @@ ALL_64_EMULATION_SOURCES = \
4720 eelf64lriscv_lp64f.c \ 4767 eelf64lriscv_lp64f.c \
4721 eelf64ltsmip.c \ 4768 eelf64ltsmip.c \
4722 eelf64ltsmip_fbsd.c \ 4769 eelf64ltsmip_fbsd.c \
@@ -4725,7 +4772,7 @@ Index: git/ld/Makefile.am
4725 eelf64mmix.c \ 4772 eelf64mmix.c \
4726 eelf64ppc.c \ 4773 eelf64ppc.c \
4727 eelf64ppc_fbsd.c \ 4774 eelf64ppc_fbsd.c \
4728@@ -916,6 +918,8 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULAT 4775@@ -906,6 +908,8 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
4729 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32.Pc@am__quote@ 4776 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32.Pc@am__quote@
4730 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32_fbsd.Pc@am__quote@ 4777 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32_fbsd.Pc@am__quote@
4731 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32mipswindiss.Pc@am__quote@ 4778 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32mipswindiss.Pc@am__quote@
@@ -4734,11 +4781,11 @@ Index: git/ld/Makefile.am
4734 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_aix.Pc@am__quote@ 4781 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_aix.Pc@am__quote@
4735 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64.Pc@am__quote@ 4782 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64.Pc@am__quote@
4736 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_fbsd.Pc@am__quote@ 4783 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_fbsd.Pc@am__quote@
4737Index: git/ld/Makefile.in 4784diff --git a/ld/Makefile.in b/ld/Makefile.in
4738=================================================================== 4785index 05d0ff5e122..a7f7e841acb 100644
4739--- git.orig/ld/Makefile.in 4786--- a/ld/Makefile.in
4740+++ git/ld/Makefile.in 4787+++ b/ld/Makefile.in
4741@@ -938,6 +938,8 @@ ALL_64_EMULATION_SOURCES = \ 4788@@ -944,6 +944,8 @@ ALL_64_EMULATION_SOURCES = \
4742 eelf64lriscv_lp64f.c \ 4789 eelf64lriscv_lp64f.c \
4743 eelf64ltsmip.c \ 4790 eelf64ltsmip.c \
4744 eelf64ltsmip_fbsd.c \ 4791 eelf64ltsmip_fbsd.c \
@@ -4747,7 +4794,7 @@ Index: git/ld/Makefile.in
4747 eelf64mmix.c \ 4794 eelf64mmix.c \
4748 eelf64ppc.c \ 4795 eelf64ppc.c \
4749 eelf64ppc_fbsd.c \ 4796 eelf64ppc_fbsd.c \
4750@@ -1411,6 +1413,8 @@ distclean-compile: 4797@@ -1410,6 +1412,8 @@ distclean-compile:
4751 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xstormy16.Po@am__quote@ 4798 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xstormy16.Po@am__quote@
4752 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xtensa.Po@am__quote@ 4799 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xtensa.Po@am__quote@
4753 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32z80.Po@am__quote@ 4800 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32z80.Po@am__quote@
@@ -4756,7 +4803,7 @@ Index: git/ld/Makefile.in
4756 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_aix.Po@am__quote@ 4803 @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@ 4804 @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@ 4805 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_fbsd.Po@am__quote@
4759@@ -2583,6 +2587,8 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULAT 4806@@ -2575,6 +2579,8 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
4760 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32.Pc@am__quote@ 4807 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32.Pc@am__quote@
4761 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32_fbsd.Pc@am__quote@ 4808 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32_fbsd.Pc@am__quote@
4762 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32mipswindiss.Pc@am__quote@ 4809 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32mipswindiss.Pc@am__quote@
@@ -4765,11 +4812,11 @@ Index: git/ld/Makefile.in
4765 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_aix.Pc@am__quote@ 4812 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_aix.Pc@am__quote@
4766 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64.Pc@am__quote@ 4813 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64.Pc@am__quote@
4767 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_fbsd.Pc@am__quote@ 4814 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_fbsd.Pc@am__quote@
4768Index: git/ld/configure.tgt 4815diff --git a/ld/configure.tgt b/ld/configure.tgt
4769=================================================================== 4816index 2bae9099b6a..80ffbcf23b3 100644
4770--- git.orig/ld/configure.tgt 4817--- a/ld/configure.tgt
4771+++ git/ld/configure.tgt 4818+++ b/ld/configure.tgt
4772@@ -478,6 +478,9 @@ microblaze*-linux*) targ_emul="elf32mb_l 4819@@ -515,6 +515,9 @@ microblaze*-linux*) targ_emul="elf32mb_linux"
4773 microblazeel*) targ_emul=elf32microblazeel 4820 microblazeel*) targ_emul=elf32microblazeel
4774 targ_extra_emuls=elf32microblaze 4821 targ_extra_emuls=elf32microblaze
4775 ;; 4822 ;;
@@ -4779,10 +4826,11 @@ Index: git/ld/configure.tgt
4779 microblaze*) targ_emul=elf32microblaze 4826 microblaze*) targ_emul=elf32microblaze
4780 targ_extra_emuls=elf32microblazeel 4827 targ_extra_emuls=elf32microblazeel
4781 ;; 4828 ;;
4782Index: git/ld/emulparams/elf64microblaze.sh 4829diff --git a/ld/emulparams/elf64microblaze.sh b/ld/emulparams/elf64microblaze.sh
4783=================================================================== 4830new file mode 100644
4831index 00000000000..9c7b0eb7080
4784--- /dev/null 4832--- /dev/null
4785+++ git/ld/emulparams/elf64microblaze.sh 4833+++ b/ld/emulparams/elf64microblaze.sh
4786@@ -0,0 +1,23 @@ 4834@@ -0,0 +1,23 @@
4787+SCRIPT_NAME=elfmicroblaze 4835+SCRIPT_NAME=elfmicroblaze
4788+OUTPUT_FORMAT="elf64-microblazeel" 4836+OUTPUT_FORMAT="elf64-microblazeel"
@@ -4807,10 +4855,11 @@ Index: git/ld/emulparams/elf64microblaze.sh
4807+ 4855+
4808+TEMPLATE_NAME=elf32 4856+TEMPLATE_NAME=elf32
4809+#GENERATE_SHLIB_SCRIPT=yes 4857+#GENERATE_SHLIB_SCRIPT=yes
4810Index: git/ld/emulparams/elf64microblazeel.sh 4858diff --git a/ld/emulparams/elf64microblazeel.sh b/ld/emulparams/elf64microblazeel.sh
4811=================================================================== 4859new file mode 100644
4860index 00000000000..9c7b0eb7080
4812--- /dev/null 4861--- /dev/null
4813+++ git/ld/emulparams/elf64microblazeel.sh 4862+++ b/ld/emulparams/elf64microblazeel.sh
4814@@ -0,0 +1,23 @@ 4863@@ -0,0 +1,23 @@
4815+SCRIPT_NAME=elfmicroblaze 4864+SCRIPT_NAME=elfmicroblaze
4816+OUTPUT_FORMAT="elf64-microblazeel" 4865+OUTPUT_FORMAT="elf64-microblazeel"
@@ -4835,10 +4884,10 @@ Index: git/ld/emulparams/elf64microblazeel.sh
4835+ 4884+
4836+TEMPLATE_NAME=elf32 4885+TEMPLATE_NAME=elf32
4837+#GENERATE_SHLIB_SCRIPT=yes 4886+#GENERATE_SHLIB_SCRIPT=yes
4838Index: git/opcodes/microblaze-dis.c 4887diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c
4839=================================================================== 4888index f57b98fc9f7..f71589d714d 100644
4840--- git.orig/opcodes/microblaze-dis.c 4889--- a/opcodes/microblaze-dis.c
4841+++ git/opcodes/microblaze-dis.c 4890+++ b/opcodes/microblaze-dis.c
4842@@ -33,6 +33,7 @@ 4891@@ -33,6 +33,7 @@
4843 #define get_field_r1(buf, instr) get_field (buf, instr, RA_MASK, RA_LOW) 4892 #define get_field_r1(buf, instr) get_field (buf, instr, RA_MASK, RA_LOW)
4844 #define get_field_r2(buf, instr) get_field (buf, instr, RB_MASK, RB_LOW) 4893 #define get_field_r2(buf, instr) get_field (buf, instr, RB_MASK, RB_LOW)
@@ -4847,29 +4896,29 @@ Index: git/opcodes/microblaze-dis.c
4847 #define get_int_field_r1(instr) ((instr & RA_MASK) >> RA_LOW) 4896 #define get_int_field_r1(instr) ((instr & RA_MASK) >> RA_LOW)
4848 4897
4849 #define NUM_STRBUFS 3 4898 #define NUM_STRBUFS 3
4850@@ -73,11 +74,19 @@ get_field_imm (struct string_buf *buf, l 4899@@ -73,11 +74,19 @@ get_field_imm (struct string_buf *buf, long instr)
4851 } 4900 }
4852 4901
4853 static char * 4902 static char *
4854-get_field_imm5 (struct string_buf *buf, long instr) 4903-get_field_imm5 (struct string_buf *buf, long instr)
4855+get_field_imml (struct string_buf *buf, long instr) 4904+get_field_imml (struct string_buf *buf, long instr)
4856+{ 4905 {
4857+ char *p = strbuf (buf); 4906 char *p = strbuf (buf);
4858+ sprintf (p, "%d", (short)((instr & IMML_MASK) >> IMM_LOW)); 4907+ sprintf (p, "%d", (short)((instr & IMML_MASK) >> IMM_LOW));
4859+ return p; 4908+ return p;
4860+} 4909+}
4861+
4862+static char *
4863+get_field_imms (struct string_buf *buf, long instr)
4864 {
4865 char *p = strbuf (buf);
4866 4910
4867- sprintf (p, "%d", (short)((instr & IMM5_MASK) >> IMM_LOW)); 4911- sprintf (p, "%d", (short)((instr & IMM5_MASK) >> IMM_LOW));
4912+static char *
4913+get_field_imms (struct string_buf *buf, long instr)
4914+{
4915+ char *p = strbuf (buf);
4916+
4868+ sprintf (p, "%d", (short)((instr & IMM6_MASK) >> IMM_LOW)); 4917+ sprintf (p, "%d", (short)((instr & IMM6_MASK) >> IMM_LOW));
4869 return p; 4918 return p;
4870 } 4919 }
4871 4920
4872@@ -91,14 +100,14 @@ get_field_imm5_mbar (struct string_buf * 4921@@ -91,14 +100,14 @@ get_field_imm5_mbar (struct string_buf *buf, long instr)
4873 } 4922 }
4874 4923
4875 static char * 4924 static char *
@@ -4887,7 +4936,7 @@ Index: git/opcodes/microblaze-dis.c
4887 return p; 4936 return p;
4888 } 4937 }
4889 4938
4890@@ -308,9 +317,13 @@ print_insn_microblaze (bfd_vma memaddr, 4939@@ -308,9 +317,13 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
4891 } 4940 }
4892 } 4941 }
4893 break; 4942 break;
@@ -4903,7 +4952,7 @@ Index: git/opcodes/microblaze-dis.c
4903 break; 4952 break;
4904 case INST_TYPE_RD_RFSL: 4953 case INST_TYPE_RD_RFSL:
4905 print_func (stream, "\t%s, %s", get_field_rd (&buf, inst), 4954 print_func (stream, "\t%s, %s", get_field_rd (&buf, inst),
4906@@ -417,6 +430,10 @@ print_insn_microblaze (bfd_vma memaddr, 4955@@ -417,6 +430,10 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
4907 case INST_TYPE_RD_R2: 4956 case INST_TYPE_RD_R2:
4908 print_func (stream, "\t%s, %s", get_field_rd (&buf, inst), 4957 print_func (stream, "\t%s, %s", get_field_rd (&buf, inst),
4909 get_field_r2 (&buf, inst)); 4958 get_field_r2 (&buf, inst));
@@ -4914,7 +4963,7 @@ Index: git/opcodes/microblaze-dis.c
4914 break; 4963 break;
4915 case INST_TYPE_R2: 4964 case INST_TYPE_R2:
4916 print_func (stream, "\t%s", get_field_r2 (&buf, inst)); 4965 print_func (stream, "\t%s", get_field_r2 (&buf, inst));
4917@@ -440,8 +457,8 @@ print_insn_microblaze (bfd_vma memaddr, 4966@@ -440,8 +457,8 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
4918 case INST_TYPE_NONE: 4967 case INST_TYPE_NONE:
4919 break; 4968 break;
4920 /* For bit field insns. */ 4969 /* For bit field insns. */
@@ -4925,10 +4974,10 @@ Index: git/opcodes/microblaze-dis.c
4925 break; 4974 break;
4926 /* For tuqula instruction */ 4975 /* For tuqula instruction */
4927 case INST_TYPE_RD: 4976 case INST_TYPE_RD:
4928Index: git/opcodes/microblaze-opc.h 4977diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
4929=================================================================== 4978index 825c639a41e..ab90240d88a 100644
4930--- git.orig/opcodes/microblaze-opc.h 4979--- a/opcodes/microblaze-opc.h
4931+++ git/opcodes/microblaze-opc.h 4980+++ b/opcodes/microblaze-opc.h
4932@@ -40,7 +40,7 @@ 4981@@ -40,7 +40,7 @@
4933 #define INST_TYPE_RD_SPECIAL 11 4982 #define INST_TYPE_RD_SPECIAL 11
4934 #define INST_TYPE_R1 12 4983 #define INST_TYPE_R1 12
@@ -5153,10 +5202,10 @@ Index: git/opcodes/microblaze-opc.h
5153+ 5202+
5154 #endif /* MICROBLAZE_OPC */ 5203 #endif /* MICROBLAZE_OPC */
5155 5204
5156Index: git/opcodes/microblaze-opcm.h 5205diff --git a/opcodes/microblaze-opcm.h b/opcodes/microblaze-opcm.h
5157=================================================================== 5206index aa3401610d9..b242ea73c7b 100644
5158--- git.orig/opcodes/microblaze-opcm.h 5207--- a/opcodes/microblaze-opcm.h
5159+++ git/opcodes/microblaze-opcm.h 5208+++ b/opcodes/microblaze-opcm.h
5160@@ -25,6 +25,7 @@ 5209@@ -25,6 +25,7 @@
5161 5210
5162 enum microblaze_instr 5211 enum microblaze_instr
@@ -5174,9 +5223,9 @@ Index: git/opcodes/microblaze-opcm.h
5174+ sb, sbea, sbr, sh, shea, shr, sw, swea, swr, swx, lbui, lhui, lwi, lli, 5223+ sb, sbea, sbr, sh, shea, shr, sw, swea, swr, swx, lbui, lhui, lwi, lli,
5175+ sbi, shi, swi, sli, msrset, msrclr, tuqula, mbi_fadd, frsub, mbi_fmul, mbi_fdiv, 5224+ sbi, shi, swi, sli, msrset, msrclr, tuqula, mbi_fadd, frsub, mbi_fmul, mbi_fdiv,
5176 fcmp_lt, fcmp_eq, fcmp_le, fcmp_gt, fcmp_ne, fcmp_ge, fcmp_un, flt, 5225 fcmp_lt, fcmp_eq, fcmp_le, fcmp_gt, fcmp_ne, fcmp_ge, fcmp_un, flt,
5177 fint, fsqrt, 5226 /* 'fsqrt' is a glibc:math.h symbol. */
5178 tget, tcget, tnget, tncget, tput, tcput, tnput, tncput, 5227 fint, microblaze_fsqrt,
5179@@ -58,6 +59,18 @@ enum microblaze_instr 5228@@ -59,6 +60,18 @@ enum microblaze_instr
5180 aputd, taputd, caputd, tcaputd, naputd, tnaputd, ncaputd, tncaputd, 5229 aputd, taputd, caputd, tcaputd, naputd, tnaputd, ncaputd, tncaputd,
5181 eagetd, teagetd, ecagetd, tecagetd, neagetd, tneagetd, necagetd, tnecagetd, 5230 eagetd, teagetd, ecagetd, tecagetd, neagetd, tneagetd, necagetd, tnecagetd,
5182 eaputd, teaputd, ecaputd, tecaputd, neaputd, tneaputd, necaputd, tnecaputd, 5231 eaputd, teaputd, ecaputd, tecaputd, neaputd, tneaputd, necaputd, tnecaputd,
@@ -5195,7 +5244,7 @@ Index: git/opcodes/microblaze-opcm.h
5195 invalid_inst 5244 invalid_inst
5196 }; 5245 };
5197 5246
5198@@ -135,15 +148,18 @@ enum microblaze_instr_type 5247@@ -136,15 +149,18 @@ enum microblaze_instr_type
5199 #define RA_MASK 0x001F0000 5248 #define RA_MASK 0x001F0000
5200 #define RB_MASK 0x0000F800 5249 #define RB_MASK 0x0000F800
5201 #define IMM_MASK 0x0000FFFF 5250 #define IMM_MASK 0x0000FFFF
@@ -5216,3 +5265,6 @@ Index: git/opcodes/microblaze-opcm.h
5216 5265
5217 /* FSL imm mask for get, put instructions. */ 5266 /* FSL imm mask for get, put instructions. */
5218 #define RFSL_MASK 0x000000F 5267 #define RFSL_MASK 0x000000F
5268--
52692.25.1
5270
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0015-Patch-Microblaze-negl-instruction-is-overriding-rsub.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0015-negl-instruction-is-overriding-rsubl-fixed-it-by-cha.patch
index 0d472331..5b3e3fc6 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0015-Patch-Microblaze-negl-instruction-is-overriding-rsub.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0015-negl-instruction-is-overriding-rsubl-fixed-it-by-cha.patch
@@ -1,15 +1,16 @@
1From e3d5306efa998ff6e72a6b0ca92d1b9bfadf8156 Mon Sep 17 00:00:00 2001 1From a41a5a63d4d52887f1ce5a5cab161670d033c1ce Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Tue, 11 Sep 2018 13:48:33 +0530 3Date: Tue, 11 Sep 2018 13:48:33 +0530
4Subject: [PATCH 15/38] [Patch,Microblaze] : negl instruction is overriding 4Subject: [PATCH 15/38] negl instruction is overriding rsubl,fixed it by
5 rsubl,fixed it by changing the instruction order... 5 changing the instruction order...
6 6
7Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
7--- 8---
8 opcodes/microblaze-opc.h | 4 ++-- 9 opcodes/microblaze-opc.h | 4 ++--
9 1 file changed, 2 insertions(+), 2 deletions(-) 10 1 file changed, 2 insertions(+), 2 deletions(-)
10 11
11diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h 12diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
12index 4a1545d8920..b1635f41529 100644 13index ab90240d88a..5e45df995de 100644
13--- a/opcodes/microblaze-opc.h 14--- a/opcodes/microblaze-opc.h
14+++ b/opcodes/microblaze-opc.h 15+++ b/opcodes/microblaze-opc.h
15@@ -275,9 +275,7 @@ const struct op_code_struct 16@@ -275,9 +275,7 @@ const struct op_code_struct
@@ -32,5 +33,5 @@ index 4a1545d8920..b1635f41529 100644
32 {"", 0, 0, 0, 0, 0, 0, 0, 0}, 33 {"", 0, 0, 0, 0, 0, 0, 0, 0},
33 }; 34 };
34-- 35--
352.17.1 362.25.1
36 37
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0016-Added-relocations-for-MB-X.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0016-Added-relocations-for-MB-X.patch
index c42ad41f..6761f01e 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0016-Added-relocations-for-MB-X.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0016-Added-relocations-for-MB-X.patch
@@ -1,4 +1,4 @@
1From f3d027568966b3c5ff8404656e6aa875c71926a1 Mon Sep 17 00:00:00 2001 1From 3deb533f60bb078f8a7b3f2dde5dc2125552d310 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com> 2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Tue, 11 Sep 2018 17:30:17 +0530 3Date: Tue, 11 Sep 2018 17:30:17 +0530
4Subject: [PATCH 16/38] Added relocations for MB-X 4Subject: [PATCH 16/38] Added relocations for MB-X
@@ -9,6 +9,8 @@ Conflicts:
9 9
10Conflicts: 10Conflicts:
11 gas/config/tc-microblaze.c 11 gas/config/tc-microblaze.c
12
13Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
12--- 14---
13 bfd/bfd-in2.h | 9 +++- 15 bfd/bfd-in2.h | 9 +++-
14 bfd/libbfd.h | 4 +- 16 bfd/libbfd.h | 4 +-
@@ -17,10 +19,10 @@ Conflicts:
17 4 files changed, 61 insertions(+), 68 deletions(-) 19 4 files changed, 61 insertions(+), 68 deletions(-)
18 20
19diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h 21diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
20index 2a1d7563643..568bfafee7c 100644 22index 6cf701abf10..14e228c9c0e 100644
21--- a/bfd/bfd-in2.h 23--- a/bfd/bfd-in2.h
22+++ b/bfd/bfd-in2.h 24+++ b/bfd/bfd-in2.h
23@@ -5431,13 +5431,18 @@ done here - only used for relaxing */ 25@@ -5387,13 +5387,18 @@ done here - only used for relaxing */
24 /* This is a 64 bit reloc that stores the 32 bit pc relative 26 /* This is a 64 bit reloc that stores the 32 bit pc relative
25 value in two words (with an imm instruction). No relocation is 27 value in two words (with an imm instruction). No relocation is
26 done here - only used for relaxing */ 28 done here - only used for relaxing */
@@ -42,10 +44,10 @@ index 2a1d7563643..568bfafee7c 100644
42 value in two words (with an imm instruction). The relocation is 44 value in two words (with an imm instruction). The relocation is
43 PC-relative GOT offset */ 45 PC-relative GOT offset */
44diff --git a/bfd/libbfd.h b/bfd/libbfd.h 46diff --git a/bfd/libbfd.h b/bfd/libbfd.h
45index 2caaf27bcd7..4a21358f5e0 100644 47index e74c051e781..20086ba608b 100644
46--- a/bfd/libbfd.h 48--- a/bfd/libbfd.h
47+++ b/bfd/libbfd.h 49+++ b/bfd/libbfd.h
48@@ -2990,14 +2990,14 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", 50@@ -2991,14 +2991,14 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
49 "BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM", 51 "BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM",
50 "BFD_RELOC_MICROBLAZE_32_NONE", 52 "BFD_RELOC_MICROBLAZE_32_NONE",
51 "BFD_RELOC_MICROBLAZE_64_NONE", 53 "BFD_RELOC_MICROBLAZE_64_NONE",
@@ -63,10 +65,10 @@ index 2caaf27bcd7..4a21358f5e0 100644
63 "BFD_RELOC_MICROBLAZE_64_TLSGD", 65 "BFD_RELOC_MICROBLAZE_64_TLSGD",
64 "BFD_RELOC_MICROBLAZE_64_TLSLD", 66 "BFD_RELOC_MICROBLAZE_64_TLSLD",
65diff --git a/bfd/reloc.c b/bfd/reloc.c 67diff --git a/bfd/reloc.c b/bfd/reloc.c
66index 288a5026d27..472a06a188d 100644 68index 0f99df91299..6165ff3adf1 100644
67--- a/bfd/reloc.c 69--- a/bfd/reloc.c
68+++ b/bfd/reloc.c 70+++ b/bfd/reloc.c
69@@ -6904,24 +6904,12 @@ ENUMDOC 71@@ -6875,24 +6875,12 @@ ENUMDOC
70 done here - only used for relaxing 72 done here - only used for relaxing
71 ENUM 73 ENUM
72 BFD_RELOC_MICROBLAZE_64_NONE 74 BFD_RELOC_MICROBLAZE_64_NONE
@@ -91,7 +93,7 @@ index 288a5026d27..472a06a188d 100644
91 ENUMDOC 93 ENUMDOC
92 This is a 64 bit reloc that stores the 32 bit pc relative 94 This is a 64 bit reloc that stores the 32 bit pc relative
93 value in two words (with an imm instruction). The relocation is 95 value in two words (with an imm instruction). The relocation is
94@@ -7007,6 +6995,20 @@ ENUMDOC 96@@ -6978,6 +6966,20 @@ ENUMDOC
95 value in two words (with an imm instruction). The relocation is 97 value in two words (with an imm instruction). The relocation is
96 relative offset from start of TEXT. 98 relative offset from start of TEXT.
97 99
@@ -113,7 +115,7 @@ index 288a5026d27..472a06a188d 100644
113 BFD_RELOC_AARCH64_RELOC_START 115 BFD_RELOC_AARCH64_RELOC_START
114 ENUMDOC 116 ENUMDOC
115diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 117diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
116index 378fb882f13..685a6e93f2b 100644 118index a6f12dda54a..9d4dbc12ab3 100644
117--- a/gas/config/tc-microblaze.c 119--- a/gas/config/tc-microblaze.c
118+++ b/gas/config/tc-microblaze.c 120+++ b/gas/config/tc-microblaze.c
119@@ -95,6 +95,7 @@ const char FLT_CHARS[] = "rRsSfFdDxXpP"; 121@@ -95,6 +95,7 @@ const char FLT_CHARS[] = "rRsSfFdDxXpP";
@@ -345,5 +347,5 @@ index 378fb882f13..685a6e93f2b 100644
345 case BFD_RELOC_MICROBLAZE_64_PLT: 347 case BFD_RELOC_MICROBLAZE_64_PLT:
346 case BFD_RELOC_MICROBLAZE_64_GOTOFF: 348 case BFD_RELOC_MICROBLAZE_64_GOTOFF:
347-- 349--
3482.17.1 3502.25.1
349 351
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-Added-imml-for-required.patch
index 7b05d13c..c4ccc057 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-Added-imml-for-required.patch
@@ -1,4 +1,4 @@
1From 835389f0f82b69f923aad7148717c48372a28828 Mon Sep 17 00:00:00 2001 1From 40702a32c685ad81803a666858b1b4133b0a9857 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com> 2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Fri, 28 Sep 2018 12:04:55 +0530 3Date: Fri, 28 Sep 2018 12:04:55 +0530
4Subject: [PATCH 17/38] -Fixed MB-x relocation issues -Added imml for required 4Subject: [PATCH 17/38] -Fixed MB-x relocation issues -Added imml for required
@@ -7,17 +7,19 @@ Subject: [PATCH 17/38] -Fixed MB-x relocation issues -Added imml for required
7Conflicts: 7Conflicts:
8 bfd/elf64-microblaze.c 8 bfd/elf64-microblaze.c
9 gas/config/tc-microblaze.c 9 gas/config/tc-microblaze.c
10
11Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
10--- 12---
11 bfd/elf64-microblaze.c | 48 ++++++++++-- 13 bfd/elf64-microblaze.c | 48 ++++++++++--
12 gas/config/tc-microblaze.c | 155 ++++++++++++++++++++++++++----------- 14 gas/config/tc-microblaze.c | 155 ++++++++++++++++++++++++++-----------
13 gas/tc.h | 2 +- 15 gas/tc.h | 2 +-
14 3 files changed, 152 insertions(+), 53 deletions(-) 16 3 files changed, 152 insertions(+), 53 deletions(-)
15 17
16Index: git/bfd/elf64-microblaze.c 18diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
17=================================================================== 19index 7434bef393b..104d7a1334f 100644
18--- git.orig/bfd/elf64-microblaze.c 20--- a/bfd/elf64-microblaze.c
19+++ git/bfd/elf64-microblaze.c 21+++ b/bfd/elf64-microblaze.c
20@@ -1511,6 +1511,14 @@ microblaze_elf_relocate_section (bfd *ou 22@@ -1552,6 +1552,14 @@ microblaze_elf_relocate_section (bfd *output_bfd,
21 bfd_put_16 (input_bfd, relocation & 0xffff, 23 bfd_put_16 (input_bfd, relocation & 0xffff,
22 contents + offset + endian); 24 contents + offset + endian);
23 25
@@ -32,7 +34,7 @@ Index: git/bfd/elf64-microblaze.c
32 else 34 else
33 { 35 {
34 bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff, 36 bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff,
35@@ -1618,6 +1626,14 @@ microblaze_elf_relocate_section (bfd *ou 37@@ -1659,6 +1667,14 @@ microblaze_elf_relocate_section (bfd *output_bfd,
36 bfd_put_16 (input_bfd, relocation & 0xffff, 38 bfd_put_16 (input_bfd, relocation & 0xffff,
37 contents + offset + endian); 39 contents + offset + endian);
38 } 40 }
@@ -47,7 +49,7 @@ Index: git/bfd/elf64-microblaze.c
47 else 49 else
48 { 50 {
49 bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff, 51 bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff,
50@@ -1727,9 +1743,19 @@ static void 52@@ -1769,9 +1785,19 @@ static void
51 microblaze_bfd_write_imm_value_32 (bfd *abfd, bfd_byte *bfd_addr, bfd_vma val) 53 microblaze_bfd_write_imm_value_32 (bfd *abfd, bfd_byte *bfd_addr, bfd_vma val)
52 { 54 {
53 unsigned long instr = bfd_get_32 (abfd, bfd_addr); 55 unsigned long instr = bfd_get_32 (abfd, bfd_addr);
@@ -70,7 +72,7 @@ Index: git/bfd/elf64-microblaze.c
70 } 72 }
71 73
72 /* Read-modify-write into the bfd, an immediate value into appropriate fields of 74 /* 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 * 75@@ -1783,10 +1809,18 @@ microblaze_bfd_write_imm_value_64 (bfd *abfd, bfd_byte *bfd_addr, bfd_vma val)
74 unsigned long instr_lo; 76 unsigned long instr_lo;
75 77
76 instr_hi = bfd_get_32 (abfd, bfd_addr); 78 instr_hi = bfd_get_32 (abfd, bfd_addr);
@@ -93,11 +95,11 @@ Index: git/bfd/elf64-microblaze.c
93 instr_lo = bfd_get_32 (abfd, bfd_addr + INST_WORD_SIZE); 95 instr_lo = bfd_get_32 (abfd, bfd_addr + INST_WORD_SIZE);
94 instr_lo &= ~0x0000ffff; 96 instr_lo &= ~0x0000ffff;
95 instr_lo |= (val & 0x0000ffff); 97 instr_lo |= (val & 0x0000ffff);
96Index: git/gas/config/tc-microblaze.c 98diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
97=================================================================== 99index 9d4dbc12ab3..a0e97231a41 100644
98--- git.orig/gas/config/tc-microblaze.c 100--- a/gas/config/tc-microblaze.c
99+++ git/gas/config/tc-microblaze.c 101+++ b/gas/config/tc-microblaze.c
100@@ -392,7 +392,7 @@ microblaze_s_weakext (int ignore ATTRIBU 102@@ -392,7 +392,7 @@ microblaze_s_weakext (int ignore ATTRIBUTE_UNUSED)
101 Integer arg to pass to the function. */ 103 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, 104 /* 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. */ 105 and then in the read.c table. */
@@ -316,7 +318,7 @@ Index: git/gas/config/tc-microblaze.c
316 if (fixP->fx_r_type == BFD_RELOC_MICROBLAZE_64) 318 if (fixP->fx_r_type == BFD_RELOC_MICROBLAZE_64)
317 fixP->fx_r_type = BFD_RELOC_64; 319 fixP->fx_r_type = BFD_RELOC_64;
318 if (fixP->fx_r_type == BFD_RELOC_MICROBLAZE_64_PCREL) 320 if (fixP->fx_r_type == BFD_RELOC_MICROBLAZE_64_PCREL)
319@@ -2636,7 +2693,14 @@ md_estimate_size_before_relax (fragS * f 321@@ -2636,7 +2693,14 @@ md_estimate_size_before_relax (fragS * fragP,
320 } 322 }
321 else 323 else
322 { 324 {
@@ -332,7 +334,7 @@ Index: git/gas/config/tc-microblaze.c
332 fragP->fr_var = INST_WORD_SIZE*2; 334 fragP->fr_var = INST_WORD_SIZE*2;
333 } 335 }
334 break; 336 break;
335@@ -2913,6 +2977,7 @@ md_parse_option (int c, const char * arg 337@@ -2913,6 +2977,7 @@ md_parse_option (int c, const char * arg ATTRIBUTE_UNUSED)
336 case OPTION_M64: 338 case OPTION_M64:
337 //if (arg != NULL && strcmp (arg, "64") == 0) 339 //if (arg != NULL && strcmp (arg, "64") == 0)
338 microblaze_arch_size = 64; 340 microblaze_arch_size = 64;
@@ -340,10 +342,10 @@ Index: git/gas/config/tc-microblaze.c
340 break; 342 break;
341 default: 343 default:
342 return 0; 344 return 0;
343Index: git/gas/tc.h 345diff --git a/gas/tc.h b/gas/tc.h
344=================================================================== 346index 4a740f9bdd9..bb9a935a353 100644
345--- git.orig/gas/tc.h 347--- a/gas/tc.h
346+++ git/gas/tc.h 348+++ b/gas/tc.h
347@@ -22,7 +22,7 @@ 349@@ -22,7 +22,7 @@
348 /* In theory (mine, at least!) the machine dependent part of the assembler 350 /* In theory (mine, at least!) the machine dependent part of the assembler
349 should only have to include one file. This one. -- JF */ 351 should only have to include one file. This one. -- JF */
@@ -353,3 +355,6 @@ Index: git/gas/tc.h
353 355
354 const char * md_atof (int, char *, int *); 356 const char * md_atof (int, char *, int *);
355 int md_parse_option (int, const char *); 357 int md_parse_option (int, const char *);
358--
3592.25.1
360
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0018-Fixing-the-branch-related-issues.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0018-Fixing-the-branch-related-issues.patch
index 5b76c492..62a8e7de 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0018-Fixing-the-branch-related-issues.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0018-Fixing-the-branch-related-issues.patch
@@ -1,19 +1,21 @@
1From 2ebffe31b57e7fe73ea8dbd60f3330da1f780243 Mon Sep 17 00:00:00 2001 1From 507032ec3840b48dfd709ef7c8f277eb0fabf5bb Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com> 2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Sun, 30 Sep 2018 17:06:58 +0530 3Date: Sun, 30 Sep 2018 17:06:58 +0530
4Subject: [PATCH 18/38] Fixing the branch related issues 4Subject: [PATCH 18/38] Fixing the branch related issues
5 5
6Conflicts: 6Conflicts:
7 bfd/elf64-microblaze.c 7 bfd/elf64-microblaze.c
8
9Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
8--- 10---
9 bfd/elf64-microblaze.c | 3 +++ 11 bfd/elf64-microblaze.c | 3 +++
10 1 file changed, 3 insertions(+) 12 1 file changed, 3 insertions(+)
11 13
12diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 14diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
13index 010ee1d15b4..f68fc344c1a 100644 15index 104d7a1334f..4c79bbe96c6 100644
14--- a/bfd/elf64-microblaze.c 16--- a/bfd/elf64-microblaze.c
15+++ b/bfd/elf64-microblaze.c 17+++ b/bfd/elf64-microblaze.c
16@@ -2521,6 +2521,9 @@ microblaze_elf_check_relocs (bfd * abfd, 18@@ -2566,6 +2566,9 @@ microblaze_elf_check_relocs (bfd * abfd,
17 while (h->root.type == bfd_link_hash_indirect 19 while (h->root.type == bfd_link_hash_indirect
18 || h->root.type == bfd_link_hash_warning) 20 || h->root.type == bfd_link_hash_warning)
19 h = (struct elf_link_hash_entry *) h->root.u.i.link; 21 h = (struct elf_link_hash_entry *) h->root.u.i.link;
@@ -24,5 +26,5 @@ index 010ee1d15b4..f68fc344c1a 100644
24 26
25 switch (r_type) 27 switch (r_type)
26-- 28--
272.17.1 292.25.1
28 30
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0019-Fixed-address-computation-issues-with-64bit-address.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0019-Fixed-address-computation-issues-with-64bit-address-.patch
index 0a5ff410..932ecb01 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0019-Fixed-address-computation-issues-with-64bit-address.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0019-Fixed-address-computation-issues-with-64bit-address-.patch
@@ -1,4 +1,4 @@
1From 46c4a8876203a8799dd4c7fb8b8ae1501e17b672 Mon Sep 17 00:00:00 2001 1From 31e2555754e9830192a56f1b4bc725a10fe7c300 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com> 2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Tue, 9 Oct 2018 10:14:22 +0530 3Date: Tue, 9 Oct 2018 10:14:22 +0530
4Subject: [PATCH 19/38] - Fixed address computation issues with 64bit address - 4Subject: [PATCH 19/38] - Fixed address computation issues with 64bit address -
@@ -10,6 +10,8 @@ Conflicts:
10 10
11Conflicts: 11Conflicts:
12 bfd/elf64-microblaze.c 12 bfd/elf64-microblaze.c
13
14Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
13--- 15---
14 bfd/bfd-in2.h | 5 +++ 16 bfd/bfd-in2.h | 5 +++
15 bfd/elf64-microblaze.c | 14 ++++---- 17 bfd/elf64-microblaze.c | 14 ++++----
@@ -18,10 +20,10 @@ Conflicts:
18 4 files changed, 79 insertions(+), 16 deletions(-) 20 4 files changed, 79 insertions(+), 16 deletions(-)
19 21
20diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h 22diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
21index 568bfafee7c..03794ea1ecf 100644 23index 14e228c9c0e..d4b5006902c 100644
22--- a/bfd/bfd-in2.h 24--- a/bfd/bfd-in2.h
23+++ b/bfd/bfd-in2.h 25+++ b/bfd/bfd-in2.h
24@@ -5438,6 +5438,11 @@ done here - only used for relaxing */ 26@@ -5394,6 +5394,11 @@ done here - only used for relaxing */
25 * +done here - only used for relaxing */ 27 * +done here - only used for relaxing */
26 BFD_RELOC_MICROBLAZE_64, 28 BFD_RELOC_MICROBLAZE_64,
27 29
@@ -34,7 +36,7 @@ index 568bfafee7c..03794ea1ecf 100644
34 * +value in two words (with an imm instruction). No relocation is 36 * +value in two words (with an imm instruction). No relocation is
35 * +done here - only used for relaxing */ 37 * +done here - only used for relaxing */
36diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 38diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
37index f68fc344c1a..2ae1f2b118a 100644 39index 4c79bbe96c6..2d4820c50fe 100644
38--- a/bfd/elf64-microblaze.c 40--- a/bfd/elf64-microblaze.c
39+++ b/bfd/elf64-microblaze.c 41+++ b/bfd/elf64-microblaze.c
40@@ -119,15 +119,15 @@ static reloc_howto_type microblaze_elf_howto_raw[] = 42@@ -119,15 +119,15 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
@@ -77,7 +79,7 @@ index f68fc344c1a..2ae1f2b118a 100644
77 microblaze_reloc = R_MICROBLAZE_IMML_64; 79 microblaze_reloc = R_MICROBLAZE_IMML_64;
78 break; 80 break;
79 case BFD_RELOC_MICROBLAZE_64_GOTPC: 81 case BFD_RELOC_MICROBLAZE_64_GOTPC:
80@@ -2005,7 +2005,7 @@ microblaze_elf_relax_section (bfd *abfd, 82@@ -2049,7 +2049,7 @@ microblaze_elf_relax_section (bfd *abfd,
81 efix = calc_fixup (target_address, 0, sec); 83 efix = calc_fixup (target_address, 0, sec);
82 84
83 /* Validate the in-band val. */ 85 /* Validate the in-band val. */
@@ -87,7 +89,7 @@ index f68fc344c1a..2ae1f2b118a 100644
87 fprintf(stderr, "%d: CORRUPT relax reloc %x %lx\n", __LINE__, val, irel->r_addend); 89 fprintf(stderr, "%d: CORRUPT relax reloc %x %lx\n", __LINE__, val, irel->r_addend);
88 } 90 }
89diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 91diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
90index 9b311ed1450..542c68a0857 100644 92index a0e97231a41..d3de049e9c0 100644
91--- a/gas/config/tc-microblaze.c 93--- a/gas/config/tc-microblaze.c
92+++ b/gas/config/tc-microblaze.c 94+++ b/gas/config/tc-microblaze.c
93@@ -402,7 +402,6 @@ pseudo_typeS md_pseudo_table[] = 95@@ -402,7 +402,6 @@ pseudo_typeS md_pseudo_table[] =
@@ -209,7 +211,7 @@ index 9b311ed1450..542c68a0857 100644
209 default: 211 default:
210 as_bad (_("unsupported BFD relocation size %u"), size); 212 as_bad (_("unsupported BFD relocation size %u"), size);
211diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c 213diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c
212index fc15d210fe0..143a0a9d59e 100644 214index f71589d714d..97e21a38bd2 100644
213--- a/opcodes/microblaze-dis.c 215--- a/opcodes/microblaze-dis.c
214+++ b/opcodes/microblaze-dis.c 216+++ b/opcodes/microblaze-dis.c
215@@ -77,7 +77,7 @@ static char * 217@@ -77,7 +77,7 @@ static char *
@@ -222,5 +224,5 @@ index fc15d210fe0..143a0a9d59e 100644
222 } 224 }
223 225
224-- 226--
2252.17.1 2272.25.1
226 228
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0020-Patch-MicroBlaze-Adding-new-relocation-to-support-64.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0020-Patch-MicroBlaze-Adding-new-relocation-to-support-64.patch
index 43627c29..135af627 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0020-Patch-MicroBlaze-Adding-new-relocation-to-support-64.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0020-Patch-MicroBlaze-Adding-new-relocation-to-support-64.patch
@@ -1,19 +1,20 @@
1From e49fe1aee519af464c873425212914c56fa683bc Mon Sep 17 00:00:00 2001 1From 2034e50763e51635405988d0cf67345cad1b2101 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Tue, 2 Nov 2021 17:28:24 +0530 3Date: Tue, 2 Nov 2021 17:28:24 +0530
4Subject: [PATCH 20/38] [Patch,MicroBlaze : Adding new relocation to support 4Subject: [PATCH 20/38] [Patch,MicroBlaze : Adding new relocation to support
5 64bit rodata. 5 64bit rodata.
6 6
7Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
7--- 8---
8 bfd/elf64-microblaze.c | 11 +++++++-- 9 bfd/elf64-microblaze.c | 11 +++++++--
9 gas/config/tc-microblaze.c | 49 ++++++++++++++++++++++++++++++++++---- 10 gas/config/tc-microblaze.c | 49 ++++++++++++++++++++++++++++++++++----
10 2 files changed, 54 insertions(+), 6 deletions(-) 11 2 files changed, 54 insertions(+), 6 deletions(-)
11 12
12diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 13diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
13index 2ae1f2b118a..55c01b44d29 100644 14index 2d4820c50fe..97131c352c7 100644
14--- a/bfd/elf64-microblaze.c 15--- a/bfd/elf64-microblaze.c
15+++ b/bfd/elf64-microblaze.c 16+++ b/bfd/elf64-microblaze.c
16@@ -1488,6 +1488,7 @@ microblaze_elf_relocate_section (bfd *output_bfd, 17@@ -1529,6 +1529,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
17 case (int) R_MICROBLAZE_64_PCREL : 18 case (int) R_MICROBLAZE_64_PCREL :
18 case (int) R_MICROBLAZE_64: 19 case (int) R_MICROBLAZE_64:
19 case (int) R_MICROBLAZE_32: 20 case (int) R_MICROBLAZE_32:
@@ -21,7 +22,7 @@ index 2ae1f2b118a..55c01b44d29 100644
21 { 22 {
22 /* r_symndx will be STN_UNDEF (zero) only for relocs against symbols 23 /* r_symndx will be STN_UNDEF (zero) only for relocs against symbols
23 from removed linkonce sections, or sections discarded by 24 from removed linkonce sections, or sections discarded by
24@@ -1497,6 +1498,8 @@ microblaze_elf_relocate_section (bfd *output_bfd, 25@@ -1538,6 +1539,8 @@ microblaze_elf_relocate_section (bfd *output_bfd,
25 relocation += addend; 26 relocation += addend;
26 if (r_type == R_MICROBLAZE_32)// || r_type == R_MICROBLAZE_IMML_64) 27 if (r_type == R_MICROBLAZE_32)// || r_type == R_MICROBLAZE_IMML_64)
27 bfd_put_32 (input_bfd, relocation, contents + offset); 28 bfd_put_32 (input_bfd, relocation, contents + offset);
@@ -30,7 +31,7 @@ index 2ae1f2b118a..55c01b44d29 100644
30 else 31 else
31 { 32 {
32 if (r_type == R_MICROBLAZE_64_PCREL) 33 if (r_type == R_MICROBLAZE_64_PCREL)
33@@ -1585,7 +1588,7 @@ microblaze_elf_relocate_section (bfd *output_bfd, 34@@ -1626,7 +1629,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
34 } 35 }
35 else 36 else
36 { 37 {
@@ -39,7 +40,7 @@ index 2ae1f2b118a..55c01b44d29 100644
39 { 40 {
40 outrel.r_info = ELF64_R_INFO (0, R_MICROBLAZE_REL); 41 outrel.r_info = ELF64_R_INFO (0, R_MICROBLAZE_REL);
41 outrel.r_addend = relocation + addend; 42 outrel.r_addend = relocation + addend;
42@@ -1611,6 +1614,8 @@ microblaze_elf_relocate_section (bfd *output_bfd, 43@@ -1652,6 +1655,8 @@ microblaze_elf_relocate_section (bfd *output_bfd,
43 relocation += addend; 44 relocation += addend;
44 if (r_type == R_MICROBLAZE_32) 45 if (r_type == R_MICROBLAZE_32)
45 bfd_put_32 (input_bfd, relocation, contents + offset); 46 bfd_put_32 (input_bfd, relocation, contents + offset);
@@ -48,7 +49,7 @@ index 2ae1f2b118a..55c01b44d29 100644
48 else 49 else
49 { 50 {
50 if (r_type == R_MICROBLAZE_64_PCREL) 51 if (r_type == R_MICROBLAZE_64_PCREL)
51@@ -2121,7 +2126,8 @@ microblaze_elf_relax_section (bfd *abfd, 52@@ -2165,7 +2170,8 @@ microblaze_elf_relax_section (bfd *abfd,
52 microblaze_bfd_write_imm_value_32 (abfd, ocontents + irelscan->r_offset, 53 microblaze_bfd_write_imm_value_32 (abfd, ocontents + irelscan->r_offset,
53 irelscan->r_addend); 54 irelscan->r_addend);
54 } 55 }
@@ -58,7 +59,7 @@ index 2ae1f2b118a..55c01b44d29 100644
58 { 59 {
59 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 60 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
60 61
61@@ -2595,6 +2601,7 @@ microblaze_elf_check_relocs (bfd * abfd, 62@@ -2640,6 +2646,7 @@ microblaze_elf_check_relocs (bfd * abfd,
62 case R_MICROBLAZE_64: 63 case R_MICROBLAZE_64:
63 case R_MICROBLAZE_64_PCREL: 64 case R_MICROBLAZE_64_PCREL:
64 case R_MICROBLAZE_32: 65 case R_MICROBLAZE_32:
@@ -67,7 +68,7 @@ index 2ae1f2b118a..55c01b44d29 100644
67 if (h != NULL && !bfd_link_pic (info)) 68 if (h != NULL && !bfd_link_pic (info))
68 { 69 {
69diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 70diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
70index 542c68a0857..6902a1518a6 100644 71index d3de049e9c0..76ce516d8aa 100644
71--- a/gas/config/tc-microblaze.c 72--- a/gas/config/tc-microblaze.c
72+++ b/gas/config/tc-microblaze.c 73+++ b/gas/config/tc-microblaze.c
73@@ -1119,6 +1119,13 @@ md_assemble (char * str) 74@@ -1119,6 +1119,13 @@ md_assemble (char * str)
@@ -163,5 +164,5 @@ index 542c68a0857..6902a1518a6 100644
163 default: 164 default:
164 as_bad (_("unsupported BFD relocation size %u"), size); 165 as_bad (_("unsupported BFD relocation size %u"), size);
165-- 166--
1662.17.1 1672.25.1
167 168
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0021-fixing-the-.bss-relocation-issue.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0021-fixing-the-.bss-relocation-issue.patch
index bf238389..848770b8 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0021-fixing-the-.bss-relocation-issue.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0021-fixing-the-.bss-relocation-issue.patch
@@ -1,19 +1,21 @@
1From 1131a31133a45553259b3fdb930daae468709bda Mon Sep 17 00:00:00 2001 1From cec495577424c4d5c4c77949a624bc33991ac673 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com> 2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Wed, 24 Oct 2018 12:34:37 +0530 3Date: Wed, 24 Oct 2018 12:34:37 +0530
4Subject: [PATCH 21/38] fixing the .bss relocation issue 4Subject: [PATCH 21/38] fixing the .bss relocation issue
5 5
6Conflicts: 6Conflicts:
7 bfd/elf64-microblaze.c 7 bfd/elf64-microblaze.c
8
9Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
8--- 10---
9 bfd/elf64-microblaze.c | 32 +++++++++++++++++++------------- 11 bfd/elf64-microblaze.c | 32 +++++++++++++++++++-------------
10 1 file changed, 19 insertions(+), 13 deletions(-) 12 1 file changed, 19 insertions(+), 13 deletions(-)
11 13
12diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 14diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
13index 55c01b44d29..6fb88959357 100644 15index 97131c352c7..fe73de86659 100644
14--- a/bfd/elf64-microblaze.c 16--- a/bfd/elf64-microblaze.c
15+++ b/bfd/elf64-microblaze.c 17+++ b/bfd/elf64-microblaze.c
16@@ -1514,14 +1514,14 @@ microblaze_elf_relocate_section (bfd *output_bfd, 18@@ -1555,14 +1555,14 @@ microblaze_elf_relocate_section (bfd *output_bfd,
17 bfd_put_16 (input_bfd, relocation & 0xffff, 19 bfd_put_16 (input_bfd, relocation & 0xffff,
18 contents + offset + endian); 20 contents + offset + endian);
19 21
@@ -36,7 +38,7 @@ index 55c01b44d29..6fb88959357 100644
36 else 38 else
37 { 39 {
38 bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff, 40 bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff,
39@@ -1632,7 +1632,7 @@ microblaze_elf_relocate_section (bfd *output_bfd, 41@@ -1673,7 +1673,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
40 contents + offset + endian); 42 contents + offset + endian);
41 } 43 }
42 unsigned long insn = bfd_get_32 (input_bfd, contents + offset +endian); 44 unsigned long insn = bfd_get_32 (input_bfd, contents + offset +endian);
@@ -45,7 +47,7 @@ index 55c01b44d29..6fb88959357 100644
45 { 47 {
46 insn &= ~0x00ffffff; 48 insn &= ~0x00ffffff;
47 insn |= (relocation >> 16) & 0xffffff; 49 insn |= (relocation >> 16) & 0xffffff;
48@@ -1749,7 +1749,7 @@ microblaze_bfd_write_imm_value_32 (bfd *abfd, bfd_byte *bfd_addr, bfd_vma val) 50@@ -1791,7 +1791,7 @@ microblaze_bfd_write_imm_value_32 (bfd *abfd, bfd_byte *bfd_addr, bfd_vma val)
49 { 51 {
50 unsigned long instr = bfd_get_32 (abfd, bfd_addr); 52 unsigned long instr = bfd_get_32 (abfd, bfd_addr);
51 53
@@ -54,7 +56,7 @@ index 55c01b44d29..6fb88959357 100644
54 { 56 {
55 instr &= ~0x00ffffff; 57 instr &= ~0x00ffffff;
56 instr |= (val & 0xffffff); 58 instr |= (val & 0xffffff);
57@@ -1772,7 +1772,7 @@ microblaze_bfd_write_imm_value_64 (bfd *abfd, bfd_byte *bfd_addr, bfd_vma val) 59@@ -1814,7 +1814,7 @@ microblaze_bfd_write_imm_value_64 (bfd *abfd, bfd_byte *bfd_addr, bfd_vma val)
58 unsigned long instr_lo; 60 unsigned long instr_lo;
59 61
60 instr_hi = bfd_get_32 (abfd, bfd_addr); 62 instr_hi = bfd_get_32 (abfd, bfd_addr);
@@ -63,7 +65,7 @@ index 55c01b44d29..6fb88959357 100644
63 { 65 {
64 instr_hi &= ~0x00ffffff; 66 instr_hi &= ~0x00ffffff;
65 instr_hi |= (val >> 16) & 0xffffff; 67 instr_hi |= (val >> 16) & 0xffffff;
66@@ -2276,7 +2276,10 @@ microblaze_elf_relax_section (bfd *abfd, 68@@ -2320,7 +2320,10 @@ microblaze_elf_relax_section (bfd *abfd,
67 unsigned long instr_lo = bfd_get_32 (abfd, ocontents 69 unsigned long instr_lo = bfd_get_32 (abfd, ocontents
68 + irelscan->r_offset 70 + irelscan->r_offset
69 + INST_WORD_SIZE); 71 + INST_WORD_SIZE);
@@ -75,7 +77,7 @@ index 55c01b44d29..6fb88959357 100644
75 immediate |= (instr_lo & 0x0000ffff); 77 immediate |= (instr_lo & 0x0000ffff);
76 offset = calc_fixup (irelscan->r_addend, 0, sec); 78 offset = calc_fixup (irelscan->r_addend, 0, sec);
77 immediate -= offset; 79 immediate -= offset;
78@@ -2320,7 +2323,10 @@ microblaze_elf_relax_section (bfd *abfd, 80@@ -2364,7 +2367,10 @@ microblaze_elf_relax_section (bfd *abfd,
79 unsigned long instr_lo = bfd_get_32 (abfd, ocontents 81 unsigned long instr_lo = bfd_get_32 (abfd, ocontents
80 + irelscan->r_offset 82 + irelscan->r_offset
81 + INST_WORD_SIZE); 83 + INST_WORD_SIZE);
@@ -88,5 +90,5 @@ index 55c01b44d29..6fb88959357 100644
88 target_address = immediate; 90 target_address = immediate;
89 offset = calc_fixup (target_address, 0, sec); 91 offset = calc_fixup (target_address, 0, sec);
90-- 92--
912.17.1 932.25.1
92 94
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0022-Fixed-the-bug-in-the-R_MICROBLAZE_64_NONE-relocation.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0022-Fixed-the-bug-in-the-R_MICROBLAZE_64_NONE-relocation.patch
index 71098800..2821a1e2 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0022-Fixed-the-bug-in-the-R_MICROBLAZE_64_NONE-relocation.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0022-Fixed-the-bug-in-the-R_MICROBLAZE_64_NONE-relocation.patch
@@ -1,19 +1,20 @@
1From 70b208a66994ba60e36ca3eaa7c525e130b145af Mon Sep 17 00:00:00 2001 1From 622b9e85bde4a88ecfe1884179f547575224b984 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com> 2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Wed, 28 Nov 2018 14:00:29 +0530 3Date: Wed, 28 Nov 2018 14:00:29 +0530
4Subject: [PATCH 22/38] Fixed the bug in the R_MICROBLAZE_64_NONE relocation. 4Subject: [PATCH 22/38] Fixed the bug in the R_MICROBLAZE_64_NONE relocation.
5 It was adjusting only lower 16bits. 5 It was adjusting only lower 16bits.
6 6
7Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
7--- 8---
8 bfd/elf32-microblaze.c | 4 ++-- 9 bfd/elf32-microblaze.c | 4 ++--
9 bfd/elf64-microblaze.c | 4 ++-- 10 bfd/elf64-microblaze.c | 4 ++--
10 2 files changed, 4 insertions(+), 4 deletions(-) 11 2 files changed, 4 insertions(+), 4 deletions(-)
11 12
12diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 13diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
13index 2f2e1ef7f41..2a976ecbe1d 100644 14index 71ff973573c..f41b503cbb5 100644
14--- a/bfd/elf32-microblaze.c 15--- a/bfd/elf32-microblaze.c
15+++ b/bfd/elf32-microblaze.c 16+++ b/bfd/elf32-microblaze.c
16@@ -2015,8 +2015,8 @@ microblaze_elf_relax_section (bfd *abfd, 17@@ -2059,8 +2059,8 @@ microblaze_elf_relax_section (bfd *abfd,
17 sfix = calc_fixup (irel->r_offset + INST_WORD_SIZE, 0, sec); 18 sfix = calc_fixup (irel->r_offset + INST_WORD_SIZE, 0, sec);
18 efix = calc_fixup (target_address, 0, sec); 19 efix = calc_fixup (target_address, 0, sec);
19 irel->r_addend -= (efix - sfix); 20 irel->r_addend -= (efix - sfix);
@@ -25,10 +26,10 @@ index 2f2e1ef7f41..2a976ecbe1d 100644
25 break; 26 break;
26 } 27 }
27diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 28diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
28index 6fb88959357..4d41ddbd953 100644 29index fe73de86659..387ee0da261 100644
29--- a/bfd/elf64-microblaze.c 30--- a/bfd/elf64-microblaze.c
30+++ b/bfd/elf64-microblaze.c 31+++ b/bfd/elf64-microblaze.c
31@@ -2053,8 +2053,8 @@ microblaze_elf_relax_section (bfd *abfd, 32@@ -2097,8 +2097,8 @@ microblaze_elf_relax_section (bfd *abfd,
32 sfix = calc_fixup (irel->r_offset + INST_WORD_SIZE, 0, sec); 33 sfix = calc_fixup (irel->r_offset + INST_WORD_SIZE, 0, sec);
33 efix = calc_fixup (target_address, 0, sec); 34 efix = calc_fixup (target_address, 0, sec);
34 irel->r_addend -= (efix - sfix); 35 irel->r_addend -= (efix - sfix);
@@ -40,5 +41,5 @@ index 6fb88959357..4d41ddbd953 100644
40 break; 41 break;
41 } 42 }
42-- 43--
432.17.1 442.25.1
44 45
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0023-Revert-ld-Remove-unused-expression-state.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0023-Revert-ld-Remove-unused-expression-state-defsym-symb.patch
index 945bad59..7d23ee2c 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0023-Revert-ld-Remove-unused-expression-state.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0023-Revert-ld-Remove-unused-expression-state-defsym-symb.patch
@@ -1,4 +1,4 @@
1From 877ba3fffc2a542580ac95a091f3883d30b7797a Mon Sep 17 00:00:00 2001 1From 99193a486cc44f7bb56019a10bef413f7f7d9fd7 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Wed, 27 Feb 2019 15:12:32 +0530 3Date: Wed, 27 Feb 2019 15:12:32 +0530
4Subject: [PATCH 23/38] Revert "ld: Remove unused expression state" --defsym 4Subject: [PATCH 23/38] Revert "ld: Remove unused expression state" --defsym
@@ -13,16 +13,18 @@ Conflicts:
13Conflicts: 13Conflicts:
14 ld/ldexp.c 14 ld/ldexp.c
15 ld/ldexp.h 15 ld/ldexp.h
16
17Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
16--- 18---
17 ld/ldexp.c | 8 +++++--- 19 ld/ldexp.c | 8 +++++---
18 ld/ldexp.h | 1 + 20 ld/ldexp.h | 1 +
19 2 files changed, 6 insertions(+), 3 deletions(-) 21 2 files changed, 6 insertions(+), 3 deletions(-)
20 22
21diff --git a/ld/ldexp.c b/ld/ldexp.c 23diff --git a/ld/ldexp.c b/ld/ldexp.c
22index 02c76f8b33c..ec6450965c3 100644 24index d4d8706968d..b7f4361129f 100644
23--- a/ld/ldexp.c 25--- a/ld/ldexp.c
24+++ b/ld/ldexp.c 26+++ b/ld/ldexp.c
25@@ -1364,6 +1364,7 @@ static etree_type * 27@@ -1380,6 +1380,7 @@ static etree_type *
26 exp_assop (const char *dst, 28 exp_assop (const char *dst,
27 etree_type *src, 29 etree_type *src,
28 enum node_tree_enum class, 30 enum node_tree_enum class,
@@ -30,7 +32,7 @@ index 02c76f8b33c..ec6450965c3 100644
30 bool hidden) 32 bool hidden)
31 { 33 {
32 etree_type *n; 34 etree_type *n;
33@@ -1375,6 +1376,7 @@ exp_assop (const char *dst, 35@@ -1391,6 +1392,7 @@ exp_assop (const char *dst,
34 n->assign.type.node_class = class; 36 n->assign.type.node_class = class;
35 n->assign.src = src; 37 n->assign.src = src;
36 n->assign.dst = dst; 38 n->assign.dst = dst;
@@ -38,7 +40,7 @@ index 02c76f8b33c..ec6450965c3 100644
38 n->assign.hidden = hidden; 40 n->assign.hidden = hidden;
39 return n; 41 return n;
40 } 42 }
41@@ -1384,7 +1386,7 @@ exp_assop (const char *dst, 43@@ -1400,7 +1402,7 @@ exp_assop (const char *dst,
42 etree_type * 44 etree_type *
43 exp_assign (const char *dst, etree_type *src, bool hidden) 45 exp_assign (const char *dst, etree_type *src, bool hidden)
44 { 46 {
@@ -47,7 +49,7 @@ index 02c76f8b33c..ec6450965c3 100644
47 } 49 }
48 50
49 /* Handle --defsym command-line option. */ 51 /* Handle --defsym command-line option. */
50@@ -1392,7 +1394,7 @@ exp_assign (const char *dst, etree_type *src, bool hidden) 52@@ -1408,7 +1410,7 @@ exp_assign (const char *dst, etree_type *src, bool hidden)
51 etree_type * 53 etree_type *
52 exp_defsym (const char *dst, etree_type *src) 54 exp_defsym (const char *dst, etree_type *src)
53 { 55 {
@@ -56,7 +58,7 @@ index 02c76f8b33c..ec6450965c3 100644
56 } 58 }
57 59
58 /* Handle PROVIDE. */ 60 /* Handle PROVIDE. */
59@@ -1400,7 +1402,7 @@ exp_defsym (const char *dst, etree_type *src) 61@@ -1416,7 +1418,7 @@ exp_defsym (const char *dst, etree_type *src)
60 etree_type * 62 etree_type *
61 exp_provide (const char *dst, etree_type *src, bool hidden) 63 exp_provide (const char *dst, etree_type *src, bool hidden)
62 { 64 {
@@ -66,7 +68,7 @@ index 02c76f8b33c..ec6450965c3 100644
66 68
67 /* Handle ASSERT. */ 69 /* Handle ASSERT. */
68diff --git a/ld/ldexp.h b/ld/ldexp.h 70diff --git a/ld/ldexp.h b/ld/ldexp.h
69index ebe82f6088f..96ac1a8e558 100644 71index ed6fb8be715..e838b736306 100644
70--- a/ld/ldexp.h 72--- a/ld/ldexp.h
71+++ b/ld/ldexp.h 73+++ b/ld/ldexp.h
72@@ -66,6 +66,7 @@ typedef union etree_union { 74@@ -66,6 +66,7 @@ typedef union etree_union {
@@ -78,5 +80,5 @@ index ebe82f6088f..96ac1a8e558 100644
78 } assign; 80 } assign;
79 struct { 81 struct {
80-- 82--
812.17.1 832.25.1
82 84
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0024-fixing-the-long-long-long-mingw-toolchain-issue.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0024-fixing-the-long-long-long-mingw-toolchain-issue.patch
index 37783b08..548d7f61 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0024-fixing-the-long-long-long-mingw-toolchain-issue.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0024-fixing-the-long-long-long-mingw-toolchain-issue.patch
@@ -1,15 +1,16 @@
1From b5d57f6b3d8826400a4e106e08c9387dc3defb11 Mon Sep 17 00:00:00 2001 1From f1c19a5ca7d28745cd9b28f155609eed70c1b349 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com> 2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Thu, 29 Nov 2018 17:59:25 +0530 3Date: Thu, 29 Nov 2018 17:59:25 +0530
4Subject: [PATCH 24/38] fixing the long & long long mingw toolchain issue 4Subject: [PATCH 24/38] fixing the long & long long mingw toolchain issue
5 5
6Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
6--- 7---
7 gas/config/tc-microblaze.c | 10 +++++----- 8 gas/config/tc-microblaze.c | 10 +++++-----
8 opcodes/microblaze-opc.h | 4 ++-- 9 opcodes/microblaze-opc.h | 4 ++--
9 2 files changed, 7 insertions(+), 7 deletions(-) 10 2 files changed, 7 insertions(+), 7 deletions(-)
10 11
11diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 12diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
12index 6902a1518a6..52058d94f98 100644 13index 76ce516d8aa..a1fb6ccbd44 100644
13--- a/gas/config/tc-microblaze.c 14--- a/gas/config/tc-microblaze.c
14+++ b/gas/config/tc-microblaze.c 15+++ b/gas/config/tc-microblaze.c
15@@ -783,7 +783,7 @@ parse_imm (char * s, expressionS * e, offsetT min, offsetT max) 16@@ -783,7 +783,7 @@ parse_imm (char * s, expressionS * e, offsetT min, offsetT max)
@@ -38,7 +39,7 @@ index 6902a1518a6..52058d94f98 100644
38 39
39 if (atp) 40 if (atp)
40diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h 41diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
41index b1635f41529..fff7520ae81 100644 42index 5e45df995de..6b25d12dace 100644
42--- a/opcodes/microblaze-opc.h 43--- a/opcodes/microblaze-opc.h
43+++ b/opcodes/microblaze-opc.h 44+++ b/opcodes/microblaze-opc.h
44@@ -585,8 +585,8 @@ char pvr_register_prefix[] = "rpvr"; 45@@ -585,8 +585,8 @@ char pvr_register_prefix[] = "rpvr";
@@ -53,5 +54,5 @@ index b1635f41529..fff7520ae81 100644
53 #endif /* MICROBLAZE_OPC */ 54 #endif /* MICROBLAZE_OPC */
54 55
55-- 56--
562.17.1 572.25.1
57 58
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 f614a245..ca61b1a6 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
@@ -1,4 +1,4 @@
1From e6c2ad33d4a668107e4828feb174ee08053e8c7e Mon Sep 17 00:00:00 2001 1From 16dfbc9464ebbf642cae6e45edd96f5fe14a6c0f Mon Sep 17 00:00:00 2001
2From: Nagaraju <nmekala@xilinx.com> 2From: Nagaraju <nmekala@xilinx.com>
3Date: Fri, 23 Aug 2019 16:18:43 +0530 3Date: Fri, 23 Aug 2019 16:18:43 +0530
4Subject: [PATCH 25/38] Added support to new arithmetic single register 4Subject: [PATCH 25/38] Added support to new arithmetic single register
@@ -10,6 +10,8 @@ Conflicts:
10Conflicts: 10Conflicts:
11 gas/config/tc-microblaze.c 11 gas/config/tc-microblaze.c
12 opcodes/microblaze-dis.c 12 opcodes/microblaze-dis.c
13
14Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
13--- 15---
14 gas/config/tc-microblaze.c | 147 ++++++++++++++++++++++++++++++++++++- 16 gas/config/tc-microblaze.c | 147 ++++++++++++++++++++++++++++++++++++-
15 opcodes/microblaze-dis.c | 11 +++ 17 opcodes/microblaze-dis.c | 11 +++
@@ -17,10 +19,10 @@ Conflicts:
17 opcodes/microblaze-opcm.h | 5 +- 19 opcodes/microblaze-opcm.h | 5 +-
18 4 files changed, 200 insertions(+), 6 deletions(-) 20 4 files changed, 200 insertions(+), 6 deletions(-)
19 21
20Index: git/gas/config/tc-microblaze.c 22diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
21=================================================================== 23index a1fb6ccbd44..bca3793c2d8 100644
22--- git.orig/gas/config/tc-microblaze.c 24--- a/gas/config/tc-microblaze.c
23+++ git/gas/config/tc-microblaze.c 25+++ b/gas/config/tc-microblaze.c
24@@ -423,12 +423,33 @@ void 26@@ -423,12 +423,33 @@ void
25 md_begin (void) 27 md_begin (void)
26 { 28 {
@@ -209,11 +211,11 @@ Index: git/gas/config/tc-microblaze.c
209 case INST_TYPE_R1_RFSL: 211 case INST_TYPE_R1_RFSL:
210 if (strcmp (op_end, "")) 212 if (strcmp (op_end, ""))
211 op_end = parse_reg (op_end + 1, &reg1); /* Get r1. */ 213 op_end = parse_reg (op_end + 1, &reg1); /* Get r1. */
212Index: git/opcodes/microblaze-dis.c 214diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c
213=================================================================== 215index 97e21a38bd2..0814cab5bdb 100644
214--- git.orig/opcodes/microblaze-dis.c 216--- a/opcodes/microblaze-dis.c
215+++ git/opcodes/microblaze-dis.c 217+++ b/opcodes/microblaze-dis.c
216@@ -130,6 +130,14 @@ get_field_imm15 (struct string_buf *buf, 218@@ -130,6 +130,14 @@ get_field_imm15 (struct string_buf *buf, long instr)
217 return p; 219 return p;
218 } 220 }
219 221
@@ -228,7 +230,7 @@ Index: git/opcodes/microblaze-dis.c
228 static char * 230 static char *
229 get_field_special (struct string_buf *buf, long instr, 231 get_field_special (struct string_buf *buf, long instr,
230 const struct op_code_struct *op) 232 const struct op_code_struct *op)
231@@ -456,6 +464,9 @@ print_insn_microblaze (bfd_vma memaddr, 233@@ -456,6 +464,9 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
232 /* For mbar 16 or sleep insn. */ 234 /* For mbar 16 or sleep insn. */
233 case INST_TYPE_NONE: 235 case INST_TYPE_NONE:
234 break; 236 break;
@@ -238,10 +240,10 @@ Index: git/opcodes/microblaze-dis.c
238 /* For bit field insns. */ 240 /* For bit field insns. */
239 case INST_TYPE_RD_R1_IMMW_IMMS: 241 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)); 242 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));
241Index: git/opcodes/microblaze-opc.h 243diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
242=================================================================== 244index 6b25d12dace..82da7f1179a 100644
243--- git.orig/opcodes/microblaze-opc.h 245--- a/opcodes/microblaze-opc.h
244+++ git/opcodes/microblaze-opc.h 246+++ b/opcodes/microblaze-opc.h
245@@ -69,6 +69,7 @@ 247@@ -69,6 +69,7 @@
246 #define INST_TYPE_RD_R1_IMMW_IMMS 21 248 #define INST_TYPE_RD_R1_IMMW_IMMS 21
247 249
@@ -337,11 +339,11 @@ Index: git/opcodes/microblaze-opc.h
337 {"imml", INST_TYPE_IMML, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0xB2000000, OPCODE_MASK_H8, imml, immediate_inst }, 339 {"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 }, 340 {"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 }, 341 {"breaid", INST_TYPE_IMM, INST_PC_OFFSET, DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0xB8110000, OPCODE_MASK_H12, breaid, branch_inst },
340Index: git/opcodes/microblaze-opcm.h 342diff --git a/opcodes/microblaze-opcm.h b/opcodes/microblaze-opcm.h
341=================================================================== 343index b242ea73c7b..5c44a5ff0ac 100644
342--- git.orig/opcodes/microblaze-opcm.h 344--- a/opcodes/microblaze-opcm.h
343+++ git/opcodes/microblaze-opcm.h 345+++ b/opcodes/microblaze-opcm.h
344@@ -61,7 +61,9 @@ enum microblaze_instr 346@@ -62,7 +62,9 @@ enum microblaze_instr
345 eaputd, teaputd, ecaputd, tecaputd, neaputd, tneaputd, necaputd, tnecaputd, 347 eaputd, teaputd, ecaputd, tecaputd, neaputd, tneaputd, necaputd, tnecaputd,
346 348
347 /* 64-bit instructions */ 349 /* 64-bit instructions */
@@ -352,10 +354,13 @@ Index: git/opcodes/microblaze-opcm.h
352 bslll, bslra, bslrl, bsllli, bslrai, bslrli, bslefi, bslifi, orl, andl, xorl, 354 bslll, bslra, bslrl, bsllli, bslrai, bslrli, bslefi, bslifi, orl, andl, xorl,
353 andnl, pcmplbf, pcmpleq, pcmplne, srla, srlc, srll, sextl8, sextl16, sextl32, 355 andnl, pcmplbf, pcmpleq, pcmplne, srla, srlc, srll, sextl8, sextl16, sextl32,
354 brea, bread, breald, beaeq, bealeq, beaeqd, bealeqd, beane, bealne, beaned, 356 brea, bread, breald, beaeq, bealeq, beaeqd, bealeqd, beane, bealne, beaned,
355@@ -166,5 +168,6 @@ enum microblaze_instr_type 357@@ -167,5 +169,6 @@ enum microblaze_instr_type
356 358
357 /* Imm mask for msrset, msrclr instructions. */ 359 /* Imm mask for msrset, msrclr instructions. */
358 #define IMM15_MASK 0x00007FFF 360 #define IMM15_MASK 0x00007FFF
359+#define IMM16_MASK 0x0000FFFF 361+#define IMM16_MASK 0x0000FFFF
360 362
361 #endif /* MICROBLAZE-OPCM */ 363 #endif /* MICROBLAZE-OPCM */
364--
3652.25.1
366
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0026-Patch-MicroBlaze-double-imml-generation-for-64-bit-v.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0026-double-imml-generation-for-64-bit-values.patch
index cdf2854c..50ce1c4e 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0026-Patch-MicroBlaze-double-imml-generation-for-64-bit-v.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0026-double-imml-generation-for-64-bit-values.patch
@@ -1,18 +1,19 @@
1From 65677ff251b88389b3de4837f57215dc088dd716 Mon Sep 17 00:00:00 2001 1From 214d99aef9b21ddbb07c120495203861dfe52c43 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Mon, 26 Aug 2019 15:29:42 +0530 3Date: Mon, 26 Aug 2019 15:29:42 +0530
4Subject: [PATCH 26/38] [Patch,MicroBlaze] : double imml generation for 64 bit 4Subject: [PATCH 26/38] double imml generation for 64 bit values.
5 values.
6 5
7Conflicts: 6Conflicts:
8 gas/config/tc-microblaze.c 7 gas/config/tc-microblaze.c
8
9Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
9--- 10---
10 gas/config/tc-microblaze.c | 321 ++++++++++++++++++++++++++++++------- 11 gas/config/tc-microblaze.c | 321 ++++++++++++++++++++++++++++++-------
11 opcodes/microblaze-opc.h | 4 +- 12 opcodes/microblaze-opc.h | 4 +-
12 2 files changed, 262 insertions(+), 63 deletions(-) 13 2 files changed, 262 insertions(+), 63 deletions(-)
13 14
14diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 15diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
15index 1a543c328f2..18dd8524949 100644 16index bca3793c2d8..454d4875ee1 100644
16--- a/gas/config/tc-microblaze.c 17--- a/gas/config/tc-microblaze.c
17+++ b/gas/config/tc-microblaze.c 18+++ b/gas/config/tc-microblaze.c
18@@ -1008,7 +1008,7 @@ md_assemble (char * str) 19@@ -1008,7 +1008,7 @@ md_assemble (char * str)
@@ -526,7 +527,7 @@ index 1a543c328f2..18dd8524949 100644
526 within the same section only. */ 527 within the same section only. */
527 buf[0] = INST_BYTE0 (inst1); 528 buf[0] = INST_BYTE0 (inst1);
528diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h 529diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
529index c25383f2de9..6f9a5a60dab 100644 530index 82da7f1179a..e65f4b58233 100644
530--- a/opcodes/microblaze-opc.h 531--- a/opcodes/microblaze-opc.h
531+++ b/opcodes/microblaze-opc.h 532+++ b/opcodes/microblaze-opc.h
532@@ -626,8 +626,8 @@ char pvr_register_prefix[] = "rpvr"; 533@@ -626,8 +626,8 @@ char pvr_register_prefix[] = "rpvr";
@@ -541,5 +542,5 @@ index c25383f2de9..6f9a5a60dab 100644
541 #endif /* MICROBLAZE_OPC */ 542 #endif /* MICROBLAZE_OPC */
542 543
543-- 544--
5442.17.1 5452.25.1
545 546
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0027-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0027-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch
index 02940730..13963265 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0027-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0027-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch
@@ -1,15 +1,17 @@
1From 6b6b0332aa2dcb4fa86911031cafd1cc5442b17f Mon Sep 17 00:00:00 2001 1From 1b2e218f16714358ffc0cbffedeaa36725f56819 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Wed, 3 Nov 2021 12:13:32 +0530 3Date: Wed, 3 Nov 2021 12:13:32 +0530
4Subject: [PATCH 27/38] Fixed bug in generation of IMML instruction for the 4Subject: [PATCH 27/38] Fixed bug in generation of IMML instruction for the
5 5
6new MB-64 instructions with single register. 6new MB-64 instructions with single register.
7
8Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
7--- 9---
8 gas/config/tc-microblaze.c | 50 +++++++++++++++++++++++++++++++++++--- 10 gas/config/tc-microblaze.c | 50 +++++++++++++++++++++++++++++++++++---
9 1 file changed, 47 insertions(+), 3 deletions(-) 11 1 file changed, 47 insertions(+), 3 deletions(-)
10 12
11diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 13diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
12index 18dd8524949..68f19c965ef 100644 14index 454d4875ee1..23c0d080d9d 100644
13--- a/gas/config/tc-microblaze.c 15--- a/gas/config/tc-microblaze.c
14+++ b/gas/config/tc-microblaze.c 16+++ b/gas/config/tc-microblaze.c
15@@ -1643,12 +1643,56 @@ md_assemble (char * str) 17@@ -1643,12 +1643,56 @@ md_assemble (char * str)
@@ -82,5 +84,5 @@ index 18dd8524949..68f19c965ef 100644
82 /* Needs an immediate inst. */ 84 /* Needs an immediate inst. */
83 if (((long long)immed) > (long long)-549755813888 && ((long long)immed) < (long long)549755813887) 85 if (((long long)immed) > (long long)-549755813888 && ((long long)immed) < (long long)549755813887)
84-- 86--
852.17.1 872.25.1
86 88
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0028-Patch-MicroBlaze-m64-This-patch-will-remove-imml-0-a.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0028-This-patch-will-remove-imml-0-and-imml-1-instruction.patch
index d738e930..afc0e67b 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0028-Patch-MicroBlaze-m64-This-patch-will-remove-imml-0-a.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0028-This-patch-will-remove-imml-0-and-imml-1-instruction.patch
@@ -1,16 +1,16 @@
1From 851a3d7218539c1a886edd92c57efe36b85e29be Mon Sep 17 00:00:00 2001 1From 3b7579366a80e4f8585f6bd5ab22a595909f6057 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Thu, 16 Apr 2020 18:08:58 +0530 3Date: Thu, 16 Apr 2020 18:08:58 +0530
4Subject: [PATCH 28/38] [Patch,MicroBlaze m64] : This patch will remove imml 0 4Subject: [PATCH 28/38] This patch will remove imml 0 and imml -1 instructions
5 and imml -1 instructions when the offset is less than 16 bit for Type A 5 when the offset is less than 16 bit for Type A branch EA instructions.
6 branch EA instructions.
7 6
7Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
8--- 8---
9 gas/config/tc-microblaze.c | 6 ++---- 9 gas/config/tc-microblaze.c | 6 ++----
10 1 file changed, 2 insertions(+), 4 deletions(-) 10 1 file changed, 2 insertions(+), 4 deletions(-)
11 11
12diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 12diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
13index 68f19c965ef..805d250b6ac 100644 13index 23c0d080d9d..2378e5037a8 100644
14--- a/gas/config/tc-microblaze.c 14--- a/gas/config/tc-microblaze.c
15+++ b/gas/config/tc-microblaze.c 15+++ b/gas/config/tc-microblaze.c
16@@ -2158,9 +2158,7 @@ md_assemble (char * str) 16@@ -2158,9 +2158,7 @@ md_assemble (char * str)
@@ -34,5 +34,5 @@ index 68f19c965ef..805d250b6ac 100644
34 /* Generate the imm instruction. */ 34 /* Generate the imm instruction. */
35 if (((long long)val) > (long long)-549755813888 && ((long long)val) < (long long)549755813887) 35 if (((long long)val) > (long long)-549755813888 && ((long long)val) < (long long)549755813887)
36-- 36--
372.17.1 372.25.1
38 38
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0029-Patch-MicroBlaze-improper-address-mapping-of-PROVIDE.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0029-improper-address-mapping-of-PROVIDE-directive-symbol.patch
index f220f611..80f8c526 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0029-Patch-MicroBlaze-improper-address-mapping-of-PROVIDE.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0029-improper-address-mapping-of-PROVIDE-directive-symbol.patch
@@ -1,20 +1,21 @@
1From aa1705bc097efd5003e5d818e1e2d12ff5fc0c94 Mon Sep 17 00:00:00 2001 1From 8124e17da0056fa6c9f650a0ee5631261e78b93e Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Wed, 17 Jun 2020 21:20:26 +0530 3Date: Wed, 17 Jun 2020 21:20:26 +0530
4Subject: [PATCH 29/38] [Patch,MicroBlaze] : improper address mapping of 4Subject: [PATCH 29/38] improper address mapping of PROVIDE directive
5 PROVIDE directive symbols[DTOR_END] are causing runtime loops and we don't 5 symbols[DTOR_END] are causing runtime loops and we don't need to override
6 need to override PROVIDE symbols if symbols are defined in libraries and 6 PROVIDE symbols if symbols are defined in libraries and linker so I am
7 linker so I am disabling override for PROVIDE symbols. 7 disabling override for PROVIDE symbols.
8 8
9Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
9--- 10---
10 ld/ldlang.c | 12 +++++++++--- 11 ld/ldlang.c | 12 +++++++++---
11 1 file changed, 9 insertions(+), 3 deletions(-) 12 1 file changed, 9 insertions(+), 3 deletions(-)
12 13
13diff --git a/ld/ldlang.c b/ld/ldlang.c 14diff --git a/ld/ldlang.c b/ld/ldlang.c
14index 37b64c89ee1..5b179daf8f1 100644 15index f12c09633a7..4a71abc7cbc 100644
15--- a/ld/ldlang.c 16--- a/ld/ldlang.c
16+++ b/ld/ldlang.c 17+++ b/ld/ldlang.c
17@@ -3657,10 +3657,16 @@ open_input_bfds (lang_statement_union_type *s, enum open_bfd_mode mode) 18@@ -3692,10 +3692,16 @@ open_input_bfds (lang_statement_union_type *s, enum open_bfd_mode mode)
18 plugin_insert = NULL; 19 plugin_insert = NULL;
19 #endif 20 #endif
20 break; 21 break;
@@ -35,5 +36,5 @@ index 37b64c89ee1..5b179daf8f1 100644
35 break; 36 break;
36 } 37 }
37-- 38--
382.17.1 392.25.1
39 40
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-Changing-the-long-to-long-long-as-in-Windows-long-is.patch
index d1997929..045dbbb1 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-Changing-the-long-to-long-long-as-in-Windows-long-is.patch
@@ -1,18 +1,19 @@
1From 34c213ce7e7ef7e1f8fd91b686da655df43efca2 Mon Sep 17 00:00:00 2001 1From 6af09208c03034774aca624b50b2526878ea210e Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilinx.com> 2From: Nagaraju Mekala <nmekala@xilinx.com>
3Date: Tue, 20 Apr 2021 21:22:06 +0530 3Date: Tue, 20 Apr 2021 21:22:06 +0530
4Subject: [PATCH 30/38] [Patch, microblaze]:Changing the long to long long as 4Subject: [PATCH 30/38] Changing the long to long long as in Windows long is
5 in Windows long is 32-bit but we need the variable to be 64-bit 5 32-bit but we need the variable to be 64-bit
6 6
7Signed-off-by :Nagaraju Mekala <nmekala@xilix.com> 7Signed-off-by :Nagaraju Mekala <nmekala@xilix.com>
8Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
8--- 9---
9 gas/config/tc-microblaze.c | 2 +- 10 gas/config/tc-microblaze.c | 2 +-
10 1 file changed, 1 insertion(+), 1 deletion(-) 11 1 file changed, 1 insertion(+), 1 deletion(-)
11 12
12Index: git/gas/config/tc-microblaze.c 13diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
13=================================================================== 14index 2378e5037a8..604a8df86a2 100644
14--- git.orig/gas/config/tc-microblaze.c 15--- a/gas/config/tc-microblaze.c
15+++ git/gas/config/tc-microblaze.c 16+++ b/gas/config/tc-microblaze.c
16@@ -1017,7 +1017,7 @@ md_assemble (char * str) 17@@ -1017,7 +1017,7 @@ md_assemble (char * str)
17 unsigned reg2; 18 unsigned reg2;
18 unsigned reg3; 19 unsigned reg3;
@@ -22,3 +23,6 @@ Index: git/gas/config/tc-microblaze.c
22 expressionS exp, exp1; 23 expressionS exp, exp1;
23 char name[20]; 24 char name[20];
24 long immedl; 25 long immedl;
26--
272.25.1
28
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0031-gas-revert-moving-of-md_pseudo_table-from-const.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0031-gas-revert-moving-of-md_pseudo_table-from-const.patch
index c96b5757..df7a72d4 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0031-gas-revert-moving-of-md_pseudo_table-from-const.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0031-gas-revert-moving-of-md_pseudo_table-from-const.patch
@@ -1,4 +1,4 @@
1From 2a8a925c35909543738ccacafcdc7000525a27c6 Mon Sep 17 00:00:00 2001 1From 276d9d6138efbe27d2542f9b3dfb2a47072ec588 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Mon, 8 Nov 2021 21:57:13 +0530 3Date: Mon, 8 Nov 2021 21:57:13 +0530
4Subject: [PATCH 31/38] gas: revert moving of md_pseudo_table from const 4Subject: [PATCH 31/38] gas: revert moving of md_pseudo_table from const
@@ -18,7 +18,7 @@ Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
18 2 files changed, 14 insertions(+), 4 deletions(-) 18 2 files changed, 14 insertions(+), 4 deletions(-)
19 19
20diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 20diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
21index 84f60c029c1..dfcd0ab1569 100644 21index 604a8df86a2..123d5ba6214 100644
22--- a/gas/config/tc-microblaze.c 22--- a/gas/config/tc-microblaze.c
23+++ b/gas/config/tc-microblaze.c 23+++ b/gas/config/tc-microblaze.c
24@@ -385,6 +385,17 @@ microblaze_s_weakext (int ignore ATTRIBUTE_UNUSED) 24@@ -385,6 +385,17 @@ microblaze_s_weakext (int ignore ATTRIBUTE_UNUSED)
@@ -66,7 +66,7 @@ index 84f60c029c1..dfcd0ab1569 100644
66 default: 66 default:
67 return 0; 67 return 0;
68diff --git a/gas/tc.h b/gas/tc.h 68diff --git a/gas/tc.h b/gas/tc.h
69index f1fa7495e29..c9722307dea 100644 69index bb9a935a353..4a740f9bdd9 100644
70--- a/gas/tc.h 70--- a/gas/tc.h
71+++ b/gas/tc.h 71+++ b/gas/tc.h
72@@ -22,7 +22,7 @@ 72@@ -22,7 +22,7 @@
@@ -79,5 +79,5 @@ index f1fa7495e29..c9722307dea 100644
79 const char * md_atof (int, char *, int *); 79 const char * md_atof (int, char *, int *);
80 int md_parse_option (int, const char *); 80 int md_parse_option (int, const char *);
81-- 81--
822.17.1 822.25.1
83 83
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0032-ld-emulparams-elf64microblaze-Fix-emulation-generati.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0032-ld-emulparams-elf64microblaze-Fix-emulation-generati.patch
index 83e5a42b..9146144a 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0032-ld-emulparams-elf64microblaze-Fix-emulation-generati.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0032-ld-emulparams-elf64microblaze-Fix-emulation-generati.patch
@@ -1,4 +1,4 @@
1From 231121a6d5ff51bcf578c06288181db5f800d66f Mon Sep 17 00:00:00 2001 1From 23b792fc927b4f24eb20f841cfef6b9548c1d547 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Mon, 8 Nov 2021 22:01:23 +0530 3Date: Mon, 8 Nov 2021 22:01:23 +0530
4Subject: [PATCH 32/38] ld/emulparams/elf64microblaze: Fix emulation generation 4Subject: [PATCH 32/38] ld/emulparams/elf64microblaze: Fix emulation generation
@@ -11,6 +11,7 @@ ldemul.o:(.data.rel+0x828): undefined reference to `ld_elf64microblaze_emulation
11The error appears to be that the elf64 files were referencing the elf32 emulation. 11The error appears to be that the elf64 files were referencing the elf32 emulation.
12 12
13Signed-off-by: Mark Hatle <mark.hatle@xilinx.com> 13Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
14Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
14--- 15---
15 ld/emulparams/elf64microblaze.sh | 2 +- 16 ld/emulparams/elf64microblaze.sh | 2 +-
16 ld/emulparams/elf64microblazeel.sh | 2 +- 17 ld/emulparams/elf64microblazeel.sh | 2 +-
@@ -39,5 +40,5 @@ index 9c7b0eb7080..7b4c7c411bd 100644
39+TEMPLATE_NAME=elf 40+TEMPLATE_NAME=elf
40 #GENERATE_SHLIB_SCRIPT=yes 41 #GENERATE_SHLIB_SCRIPT=yes
41-- 42--
422.17.1 432.25.1
43 44
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-add-gdb_proc_ser.patch
index c08a06e1..d2753fe9 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-add-gdb_proc_ser.patch
@@ -1,4 +1,4 @@
1From bf7c7531e54e2f1b995e7ba52213c1df585d7fcc Mon Sep 17 00:00:00 2001 1From 48166e74b46787b10073fcec3c133463504e2dbc Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Mon, 23 Jan 2017 19:07:44 +0530 3Date: Mon, 23 Jan 2017 19:07:44 +0530
4Subject: [PATCH 33/38] Add initial port of linux gdbserver add 4Subject: [PATCH 33/38] Add initial port of linux gdbserver add
@@ -23,6 +23,7 @@ Signed-off-by: Nathan Rossi <nathan.rossi@petalogix.com>
23Conflicts: 23Conflicts:
24 gdb/gdbserver/Makefile.in 24 gdb/gdbserver/Makefile.in
25 gdb/gdbserver/configure.srv 25 gdb/gdbserver/configure.srv
26Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
26--- 27---
27 gdb/configure.host | 3 + 28 gdb/configure.host | 3 +
28 gdb/features/microblaze-linux.xml | 12 + 29 gdb/features/microblaze-linux.xml | 12 +
@@ -40,19 +41,19 @@ Conflicts:
40 create mode 100644 gdb/gdbserver/linux-microblaze-low.c 41 create mode 100644 gdb/gdbserver/linux-microblaze-low.c
41 create mode 100644 gdb/regformats/reg-microblaze.dat 42 create mode 100644 gdb/regformats/reg-microblaze.dat
42 43
43Index: git/gdb/configure.host 44diff --git a/gdb/configure.host b/gdb/configure.host
44=================================================================== 45index da71675b201..3a0c4443a93 100644
45--- git.orig/gdb/configure.host 46--- a/gdb/configure.host
46+++ git/gdb/configure.host 47+++ b/gdb/configure.host
47@@ -60,6 +60,7 @@ hppa*) gdb_host_cpu=pa ;; 48@@ -61,6 +61,7 @@ i[34567]86*) gdb_host_cpu=i386 ;;
48 i[34567]86*) gdb_host_cpu=i386 ;; 49 loongarch*) gdb_host_cpu=loongarch ;;
49 m68*) gdb_host_cpu=m68k ;; 50 m68*) gdb_host_cpu=m68k ;;
50 mips*) gdb_host_cpu=mips ;; 51 mips*) gdb_host_cpu=mips ;;
51+microblaze*) gdb_host_cpu=microblaze ;; 52+microblaze*) gdb_host_cpu=microblaze ;;
52 powerpc* | rs6000) gdb_host_cpu=powerpc ;; 53 powerpc* | rs6000) gdb_host_cpu=powerpc ;;
53 sparcv9 | sparc64) gdb_host_cpu=sparc ;; 54 sparcv9 | sparc64) gdb_host_cpu=sparc ;;
54 s390*) gdb_host_cpu=s390 ;; 55 s390*) gdb_host_cpu=s390 ;;
55@@ -132,6 +133,8 @@ mips64*-*-openbsd*) gdb_host=obsd64 ;; 56@@ -135,6 +136,8 @@ mips64*-*-openbsd*) gdb_host=obsd64 ;;
56 57
57 or1k-*-linux*) gdb_host=linux ;; 58 or1k-*-linux*) gdb_host=linux ;;
58 59
@@ -61,10 +62,11 @@ Index: git/gdb/configure.host
61 powerpc-*-aix* | rs6000-*-* | powerpc64-*-aix*) 62 powerpc-*-aix* | rs6000-*-* | powerpc64-*-aix*)
62 gdb_host=aix ;; 63 gdb_host=aix ;;
63 powerpc*-*-freebsd*) gdb_host=fbsd ;; 64 powerpc*-*-freebsd*) gdb_host=fbsd ;;
64Index: git/gdb/features/microblaze-linux.xml 65diff --git a/gdb/features/microblaze-linux.xml b/gdb/features/microblaze-linux.xml
65=================================================================== 66new file mode 100644
67index 00000000000..8983e66eb3d
66--- /dev/null 68--- /dev/null
67+++ git/gdb/features/microblaze-linux.xml 69+++ b/gdb/features/microblaze-linux.xml
68@@ -0,0 +1,12 @@ 70@@ -0,0 +1,12 @@
69+<?xml version="1.0"?> 71+<?xml version="1.0"?>
70+<!-- Copyright (C) 2014-2018 Free Software Foundation, Inc. 72+<!-- Copyright (C) 2014-2018 Free Software Foundation, Inc.
@@ -78,10 +80,11 @@ Index: git/gdb/features/microblaze-linux.xml
78+ <osabi>GNU/Linux</osabi> 80+ <osabi>GNU/Linux</osabi>
79+ <xi:include href="microblaze-core.xml"/> 81+ <xi:include href="microblaze-core.xml"/>
80+</target> 82+</target>
81Index: git/gdb/gdbserver/Makefile.in 83diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
82=================================================================== 84new file mode 100644
85index 00000000000..fb4762a22d5
83--- /dev/null 86--- /dev/null
84+++ git/gdb/gdbserver/Makefile.in 87+++ b/gdb/gdbserver/Makefile.in
85@@ -0,0 +1,712 @@ 88@@ -0,0 +1,712 @@
86+# Copyright (C) 1989-2020 Free Software Foundation, Inc. 89+# Copyright (C) 1989-2020 Free Software Foundation, Inc.
87+ 90+
@@ -795,10 +798,11 @@ Index: git/gdb/gdbserver/Makefile.in
795+.SECONDARY: 798+.SECONDARY:
796+ 799+
797+# This is the end of "Makefile.in". 800+# This is the end of "Makefile.in".
798Index: git/gdb/gdbserver/configure.srv 801diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
799=================================================================== 802new file mode 100644
803index 00000000000..e0d2b2fe04a
800--- /dev/null 804--- /dev/null
801+++ git/gdb/gdbserver/configure.srv 805+++ b/gdb/gdbserver/configure.srv
802@@ -0,0 +1,398 @@ 806@@ -0,0 +1,398 @@
803+# Mappings from configuration triplets to gdbserver build options. 807+# Mappings from configuration triplets to gdbserver build options.
804+# This is invoked from the autoconf-generated configure script, to 808+# This is invoked from the autoconf-generated configure script, to
@@ -1198,10 +1202,11 @@ Index: git/gdb/gdbserver/configure.srv
1198+ exit 1 1202+ exit 1
1199+ ;; 1203+ ;;
1200+esac 1204+esac
1201Index: git/gdb/gdbserver/linux-microblaze-low.c 1205diff --git a/gdb/gdbserver/linux-microblaze-low.c b/gdb/gdbserver/linux-microblaze-low.c
1202=================================================================== 1206new file mode 100644
1207index 00000000000..cba5d6fc585
1203--- /dev/null 1208--- /dev/null
1204+++ git/gdb/gdbserver/linux-microblaze-low.c 1209+++ b/gdb/gdbserver/linux-microblaze-low.c
1205@@ -0,0 +1,189 @@ 1210@@ -0,0 +1,189 @@
1206+/* GNU/Linux/Microblaze specific low level interface, for the remote server for 1211+/* GNU/Linux/Microblaze specific low level interface, for the remote server for
1207+ GDB. 1212+ GDB.
@@ -1392,10 +1397,10 @@ Index: git/gdb/gdbserver/linux-microblaze-low.c
1392+ microblaze_collect_ptrace_register, 1397+ microblaze_collect_ptrace_register,
1393+ microblaze_supply_ptrace_register, 1398+ microblaze_supply_ptrace_register,
1394+}; 1399+};
1395Index: git/gdb/microblaze-linux-tdep.c 1400diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c
1396=================================================================== 1401index daa7ddf7e4d..5748556a556 100644
1397--- git.orig/gdb/microblaze-linux-tdep.c 1402--- a/gdb/microblaze-linux-tdep.c
1398+++ git/gdb/microblaze-linux-tdep.c 1403+++ b/gdb/microblaze-linux-tdep.c
1399@@ -37,6 +37,22 @@ 1404@@ -37,6 +37,22 @@
1400 #include "tramp-frame.h" 1405 #include "tramp-frame.h"
1401 #include "linux-tdep.h" 1406 #include "linux-tdep.h"
@@ -1419,7 +1424,7 @@ Index: git/gdb/microblaze-linux-tdep.c
1419 static int 1424 static int
1420 microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, 1425 microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
1421 struct bp_target_info *bp_tgt) 1426 struct bp_target_info *bp_tgt)
1422@@ -50,13 +66,20 @@ microblaze_linux_memory_remove_breakpoin 1427@@ -50,13 +66,20 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
1423 /* Determine appropriate breakpoint contents and size for this address. */ 1428 /* Determine appropriate breakpoint contents and size for this address. */
1424 bp = gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen); 1429 bp = gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen);
1425 1430
@@ -1441,7 +1446,7 @@ Index: git/gdb/microblaze-linux-tdep.c
1441 1446
1442 return val; 1447 return val;
1443 } 1448 }
1444@@ -129,6 +152,10 @@ microblaze_linux_init_abi (struct gdbarc 1449@@ -129,6 +152,10 @@ microblaze_linux_init_abi (struct gdbarch_info info,
1445 /* Trampolines. */ 1450 /* Trampolines. */
1446 tramp_frame_prepend_unwinder (gdbarch, 1451 tramp_frame_prepend_unwinder (gdbarch,
1447 &microblaze_linux_sighandler_tramp_frame); 1452 &microblaze_linux_sighandler_tramp_frame);
@@ -1452,14 +1457,15 @@ Index: git/gdb/microblaze-linux-tdep.c
1452 } 1457 }
1453 1458
1454 void _initialize_microblaze_linux_tdep (); 1459 void _initialize_microblaze_linux_tdep ();
1455Index: git/gdb/microblaze-tdep.c 1460diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
1456=================================================================== 1461index 3d5dd669341..3e8e8fe35b9 100644
1457--- git.orig/gdb/microblaze-tdep.c 1462--- a/gdb/microblaze-tdep.c
1458+++ git/gdb/microblaze-tdep.c 1463+++ b/gdb/microblaze-tdep.c
1459@@ -128,7 +128,38 @@ microblaze_fetch_instruction (CORE_ADDR 1464@@ -128,7 +128,38 @@ microblaze_fetch_instruction (CORE_ADDR pc)
1460 constexpr gdb_byte microblaze_break_insn[] = MICROBLAZE_BREAKPOINT; 1465 constexpr gdb_byte microblaze_break_insn[] = MICROBLAZE_BREAKPOINT;
1461 1466
1462 typedef BP_MANIPULATION (microblaze_break_insn) microblaze_breakpoint; 1467 typedef BP_MANIPULATION (microblaze_break_insn) microblaze_breakpoint;
1468-
1463+static int 1469+static int
1464+microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, 1470+microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
1465+ struct bp_target_info *bp_tgt) 1471+ struct bp_target_info *bp_tgt)
@@ -1489,13 +1495,13 @@ Index: git/gdb/microblaze-tdep.c
1489+ val = target_write_raw_memory (addr, bp_tgt->shadow_contents, bplen); 1495+ val = target_write_raw_memory (addr, bp_tgt->shadow_contents, bplen);
1490+ microblaze_debug ("microblaze_linux_memory_remove_breakpoint writing back to memory at addr 0x%lx\n", addr); 1496+ microblaze_debug ("microblaze_linux_memory_remove_breakpoint writing back to memory at addr 0x%lx\n", addr);
1491+ } 1497+ }
1492 1498+
1493+ return val; 1499+ return val;
1494+} 1500+}
1495 1501
1496 /* Allocate and initialize a frame cache. */ 1502 /* Allocate and initialize a frame cache. */
1497 1503
1498@@ -716,6 +747,7 @@ microblaze_gdbarch_init (struct gdbarch_ 1504@@ -716,6 +747,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
1499 microblaze_breakpoint::kind_from_pc); 1505 microblaze_breakpoint::kind_from_pc);
1500 set_gdbarch_sw_breakpoint_from_kind (gdbarch, 1506 set_gdbarch_sw_breakpoint_from_kind (gdbarch,
1501 microblaze_breakpoint::bp_from_kind); 1507 microblaze_breakpoint::bp_from_kind);
@@ -1503,16 +1509,16 @@ Index: git/gdb/microblaze-tdep.c
1503 1509
1504 set_gdbarch_frame_args_skip (gdbarch, 8); 1510 set_gdbarch_frame_args_skip (gdbarch, 8);
1505 1511
1506@@ -756,4 +788,5 @@ When non-zero, microblaze specific debug 1512@@ -756,4 +788,5 @@ When non-zero, microblaze specific debugging is enabled."),
1507 NULL, 1513 NULL,
1508 &setdebuglist, &showdebuglist); 1514 &setdebuglist, &showdebuglist);
1509 1515
1510+ 1516+
1511 } 1517 }
1512Index: git/gdb/microblaze-tdep.h 1518diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h
1513=================================================================== 1519index 4d90e8785dc..53fcb2297e6 100644
1514--- git.orig/gdb/microblaze-tdep.h 1520--- a/gdb/microblaze-tdep.h
1515+++ git/gdb/microblaze-tdep.h 1521+++ b/gdb/microblaze-tdep.h
1516@@ -118,6 +118,8 @@ struct microblaze_frame_cache 1522@@ -118,6 +118,8 @@ struct microblaze_frame_cache
1517 1523
1518 /* MICROBLAZE_BREAKPOINT defines the breakpoint that should be used. 1524 /* MICROBLAZE_BREAKPOINT defines the breakpoint that should be used.
@@ -1523,10 +1529,11 @@ Index: git/gdb/microblaze-tdep.h
1523+ 1529+
1524 1530
1525 #endif /* microblaze-tdep.h */ 1531 #endif /* microblaze-tdep.h */
1526Index: git/gdb/regformats/reg-microblaze.dat 1532diff --git a/gdb/regformats/reg-microblaze.dat b/gdb/regformats/reg-microblaze.dat
1527=================================================================== 1533new file mode 100644
1534index 00000000000..bd8a4384424
1528--- /dev/null 1535--- /dev/null
1529+++ git/gdb/regformats/reg-microblaze.dat 1536+++ b/gdb/regformats/reg-microblaze.dat
1530@@ -0,0 +1,41 @@ 1537@@ -0,0 +1,41 @@
1531+name:microblaze 1538+name:microblaze
1532+expedite:r1,pc 1539+expedite:r1,pc
@@ -1569,3 +1576,6 @@ Index: git/gdb/regformats/reg-microblaze.dat
1569+32:fsr 1576+32:fsr
1570+32:slr 1577+32:slr
1571+32:shr 1578+32:shr
1579--
15802.25.1
1581
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-Added-support-f.patch
index a9e9c001..18a1da90 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-Added-support-f.patch
@@ -1,4 +1,4 @@
1From 9b17875cc7584d41953d9a6f46558482e691881b Mon Sep 17 00:00:00 2001 1From 98f1df0f21b6c44eb8b5bac070a748c4a16d3f66 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Tue, 24 Jan 2017 14:55:56 +0530 3Date: Tue, 24 Jan 2017 14:55:56 +0530
4Subject: [PATCH 34/38] Initial port of core reading support Added support for 4Subject: [PATCH 34/38] Initial port of core reading support Added support for
@@ -11,6 +11,7 @@ Signed-off-by: Nathan Rossi <nathan.rossi@petalogix.com>
11Conflicts: 11Conflicts:
12 gdb/microblaze-linux-tdep.c 12 gdb/microblaze-linux-tdep.c
13 gdb/microblaze-tdep.c 13 gdb/microblaze-tdep.c
14Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
14--- 15---
15 bfd/elf32-microblaze.c | 84 +++++++++++++++++++++++++++++++++++++ 16 bfd/elf32-microblaze.c | 84 +++++++++++++++++++++++++++++++++++++
16 gdb/configure.tgt | 2 +- 17 gdb/configure.tgt | 2 +-
@@ -19,11 +20,11 @@ Conflicts:
19 gdb/microblaze-tdep.h | 27 ++++++++++++ 20 gdb/microblaze-tdep.h | 27 ++++++++++++
20 5 files changed, 176 insertions(+), 2 deletions(-) 21 5 files changed, 176 insertions(+), 2 deletions(-)
21 22
22Index: git/bfd/elf32-microblaze.c 23diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
23=================================================================== 24index f41b503cbb5..9c6d0411420 100644
24--- git.orig/bfd/elf32-microblaze.c 25--- a/bfd/elf32-microblaze.c
25+++ git/bfd/elf32-microblaze.c 26+++ b/bfd/elf32-microblaze.c
26@@ -765,6 +765,87 @@ microblaze_elf_is_local_label_name (bfd 27@@ -806,6 +806,87 @@ microblaze_elf_is_local_label_name (bfd *abfd, const char *name)
27 return _bfd_elf_is_local_label_name (abfd, name); 28 return _bfd_elf_is_local_label_name (abfd, name);
28 } 29 }
29 30
@@ -111,7 +112,7 @@ Index: git/bfd/elf32-microblaze.c
111 /* ELF linker hash entry. */ 112 /* ELF linker hash entry. */
112 113
113 struct elf32_mb_link_hash_entry 114 struct elf32_mb_link_hash_entry
114@@ -3558,4 +3639,7 @@ microblaze_elf_add_symbol_hook (bfd *abf 115@@ -3604,4 +3685,7 @@ microblaze_elf_add_symbol_hook (bfd *abfd,
115 #define elf_backend_size_dynamic_sections microblaze_elf_size_dynamic_sections 116 #define elf_backend_size_dynamic_sections microblaze_elf_size_dynamic_sections
116 #define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook 117 #define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook
117 118
@@ -119,11 +120,11 @@ Index: git/bfd/elf32-microblaze.c
119+#define elf_backend_grok_psinfo microblaze_elf_grok_psinfo 120+#define elf_backend_grok_psinfo microblaze_elf_grok_psinfo
120+ 121+
121 #include "elf32-target.h" 122 #include "elf32-target.h"
122Index: git/gdb/configure.tgt 123diff --git a/gdb/configure.tgt b/gdb/configure.tgt
123=================================================================== 124index 0705ccf32b8..7ea186481f3 100644
124--- git.orig/gdb/configure.tgt 125--- a/gdb/configure.tgt
125+++ git/gdb/configure.tgt 126+++ b/gdb/configure.tgt
126@@ -389,7 +389,7 @@ mep-*-*) 127@@ -400,7 +400,7 @@ mep-*-*)
127 128
128 microblaze*-linux-*|microblaze*-*-linux*) 129 microblaze*-linux-*|microblaze*-*-linux*)
129 # Target: Xilinx MicroBlaze running Linux 130 # Target: Xilinx MicroBlaze running Linux
@@ -132,10 +133,10 @@ Index: git/gdb/configure.tgt
132 symfile-mem.o linux-tdep.o" 133 symfile-mem.o linux-tdep.o"
133 ;; 134 ;;
134 microblaze*-*-*) 135 microblaze*-*-*)
135Index: git/gdb/microblaze-linux-tdep.c 136diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c
136=================================================================== 137index 5748556a556..1e1f03fc154 100644
137--- git.orig/gdb/microblaze-linux-tdep.c 138--- a/gdb/microblaze-linux-tdep.c
138+++ git/gdb/microblaze-linux-tdep.c 139+++ b/gdb/microblaze-linux-tdep.c
139@@ -36,6 +36,7 @@ 140@@ -36,6 +36,7 @@
140 #include "frame-unwind.h" 141 #include "frame-unwind.h"
141 #include "tramp-frame.h" 142 #include "tramp-frame.h"
@@ -144,7 +145,7 @@ Index: git/gdb/microblaze-linux-tdep.c
144 145
145 static int microblaze_debug_flag = 0; 146 static int microblaze_debug_flag = 0;
146 147
147@@ -135,13 +136,16 @@ static struct tramp_frame microblaze_lin 148@@ -135,13 +136,16 @@ static struct tramp_frame microblaze_linux_sighandler_tramp_frame =
148 microblaze_linux_sighandler_cache_init 149 microblaze_linux_sighandler_cache_init
149 }; 150 };
150 151
@@ -162,7 +163,7 @@ Index: git/gdb/microblaze-linux-tdep.c
162 set_gdbarch_memory_remove_breakpoint (gdbarch, 163 set_gdbarch_memory_remove_breakpoint (gdbarch,
163 microblaze_linux_memory_remove_breakpoint); 164 microblaze_linux_memory_remove_breakpoint);
164 165
165@@ -153,6 +157,17 @@ microblaze_linux_init_abi (struct gdbarc 166@@ -153,6 +157,17 @@ microblaze_linux_init_abi (struct gdbarch_info info,
166 tramp_frame_prepend_unwinder (gdbarch, 167 tramp_frame_prepend_unwinder (gdbarch,
167 &microblaze_linux_sighandler_tramp_frame); 168 &microblaze_linux_sighandler_tramp_frame);
168 169
@@ -180,11 +181,11 @@ Index: git/gdb/microblaze-linux-tdep.c
180 /* Enable TLS support. */ 181 /* Enable TLS support. */
181 set_gdbarch_fetch_tls_load_module_address (gdbarch, 182 set_gdbarch_fetch_tls_load_module_address (gdbarch,
182 svr4_fetch_objfile_link_map); 183 svr4_fetch_objfile_link_map);
183Index: git/gdb/microblaze-tdep.c 184diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
184=================================================================== 185index 3e8e8fe35b9..31005332104 100644
185--- git.orig/gdb/microblaze-tdep.c 186--- a/gdb/microblaze-tdep.c
186+++ git/gdb/microblaze-tdep.c 187+++ b/gdb/microblaze-tdep.c
187@@ -666,6 +666,43 @@ microblaze_register_g_packet_guesses (st 188@@ -666,6 +666,43 @@ microblaze_register_g_packet_guesses (struct gdbarch *gdbarch)
188 tdesc_microblaze_with_stack_protect); 189 tdesc_microblaze_with_stack_protect);
189 } 190 }
190 191
@@ -228,7 +229,7 @@ Index: git/gdb/microblaze-tdep.c
228 static struct gdbarch * 229 static struct gdbarch *
229 microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 230 microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
230 { 231 {
231@@ -718,6 +755,10 @@ microblaze_gdbarch_init (struct gdbarch_ 232@@ -718,6 +755,10 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
232 microblaze_gdbarch_tdep *tdep = new microblaze_gdbarch_tdep; 233 microblaze_gdbarch_tdep *tdep = new microblaze_gdbarch_tdep;
233 gdbarch = gdbarch_alloc (&info, tdep); 234 gdbarch = gdbarch_alloc (&info, tdep);
234 235
@@ -239,7 +240,7 @@ Index: git/gdb/microblaze-tdep.c
239 set_gdbarch_long_double_bit (gdbarch, 128); 240 set_gdbarch_long_double_bit (gdbarch, 128);
240 241
241 set_gdbarch_num_regs (gdbarch, MICROBLAZE_NUM_REGS); 242 set_gdbarch_num_regs (gdbarch, MICROBLAZE_NUM_REGS);
242@@ -766,6 +807,13 @@ microblaze_gdbarch_init (struct gdbarch_ 243@@ -766,6 +807,13 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
243 frame_base_append_sniffer (gdbarch, dwarf2_frame_base_sniffer); 244 frame_base_append_sniffer (gdbarch, dwarf2_frame_base_sniffer);
244 if (tdesc_data != NULL) 245 if (tdesc_data != NULL)
245 tdesc_use_registers (gdbarch, tdesc, std::move (tdesc_data)); 246 tdesc_use_registers (gdbarch, tdesc, std::move (tdesc_data));
@@ -253,10 +254,10 @@ Index: git/gdb/microblaze-tdep.c
253 254
254 return gdbarch; 255 return gdbarch;
255 } 256 }
256Index: git/gdb/microblaze-tdep.h 257diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h
257=================================================================== 258index 53fcb2297e6..6f5bd5903a7 100644
258--- git.orig/gdb/microblaze-tdep.h 259--- a/gdb/microblaze-tdep.h
259+++ git/gdb/microblaze-tdep.h 260+++ b/gdb/microblaze-tdep.h
260@@ -23,8 +23,22 @@ 261@@ -23,8 +23,22 @@
261 #include "gdbarch.h" 262 #include "gdbarch.h"
262 263
@@ -299,3 +300,6 @@ Index: git/gdb/microblaze-tdep.h
299+ const char *sect_name, size_t sect_size); 300+ const char *sect_name, size_t sect_size);
300 301
301 #endif /* microblaze-tdep.h */ 302 #endif /* microblaze-tdep.h */
303--
3042.25.1
305
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0038-Patch-MB-MB-binutils-Upstream-port-issues.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0035-MB-binutils-Upstream-port-issues.patch
index 1fb73946..d152334b 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0038-Patch-MB-MB-binutils-Upstream-port-issues.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0035-MB-binutils-Upstream-port-issues.patch
@@ -1,20 +1,21 @@
1From 5e492aae0baf2ed8593c2fb2df03c54fbb180e57 Mon Sep 17 00:00:00 2001 1From 020b77092a7a86795551a97469134c1e6f72b0cd Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sun, 28 Nov 2021 17:17:15 +0530 3Date: Sun, 28 Nov 2021 17:17:15 +0530
4Subject: [PATCH 38/38] [Patch,MB]: MB binutils Upstream port issues. 4Subject: [PATCH 35/38] MB binutils Upstream port issues.
5 5
6Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
6--- 7---
7 bfd/elf64-microblaze.c | 266 ++++++++++++++++++++++++++++--------- 8 bfd/elf64-microblaze.c | 250 +++++++++++++++++++++++++++----------
8 gas/config/tc-microblaze.c | 2 +- 9 gas/config/tc-microblaze.c | 2 +-
9 opcodes/microblaze-dis.c | 12 +- 10 opcodes/microblaze-dis.c | 12 +-
10 opcodes/microblaze-opc.h | 2 +- 11 opcodes/microblaze-opc.h | 2 +-
11 4 files changed, 208 insertions(+), 74 deletions(-) 12 4 files changed, 193 insertions(+), 73 deletions(-)
12 13
13diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 14diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
14index 4d41ddbd953..210b84b2a50 100644 15index 387ee0da261..2e42366d8d6 100644
15--- a/bfd/elf64-microblaze.c 16--- a/bfd/elf64-microblaze.c
16+++ b/bfd/elf64-microblaze.c 17+++ b/bfd/elf64-microblaze.c
17@@ -767,12 +767,35 @@ microblaze_elf_is_local_label_name (bfd *abfd, const char *name) 18@@ -808,12 +808,35 @@ microblaze_elf_is_local_label_name (bfd *abfd, const char *name)
18 return _bfd_elf_is_local_label_name (abfd, name); 19 return _bfd_elf_is_local_label_name (abfd, name);
19 } 20 }
20 21
@@ -50,7 +51,7 @@ index 4d41ddbd953..210b84b2a50 100644
50 /* TLS Reference Types for the symbol; Updated by check_relocs */ 51 /* TLS Reference Types for the symbol; Updated by check_relocs */
51 #define TLS_GD 1 /* GD reloc. */ 52 #define TLS_GD 1 /* GD reloc. */
52 #define TLS_LD 2 /* LD reloc. */ 53 #define TLS_LD 2 /* LD reloc. */
53@@ -796,6 +819,18 @@ struct elf64_mb_link_hash_table 54@@ -837,6 +860,18 @@ struct elf64_mb_link_hash_table
54 { 55 {
55 struct elf_link_hash_table elf; 56 struct elf_link_hash_table elf;
56 57
@@ -69,7 +70,7 @@ index 4d41ddbd953..210b84b2a50 100644
69 /* TLS Local Dynamic GOT Entry */ 70 /* TLS Local Dynamic GOT Entry */
70 union { 71 union {
71 bfd_signed_vma refcount; 72 bfd_signed_vma refcount;
72@@ -1335,8 +1370,7 @@ microblaze_elf_relocate_section (bfd *output_bfd, 73@@ -1376,8 +1411,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
73 /* Need to generate relocs ? */ 74 /* Need to generate relocs ? */
74 if ((bfd_link_pic (info) || indx != 0) 75 if ((bfd_link_pic (info) || indx != 0)
75 && (h == NULL 76 && (h == NULL
@@ -79,7 +80,7 @@ index 4d41ddbd953..210b84b2a50 100644
79 || h->root.type != bfd_link_hash_undefweak)) 80 || h->root.type != bfd_link_hash_undefweak))
80 need_relocs = true; 81 need_relocs = true;
81 82
82@@ -1523,13 +1557,11 @@ microblaze_elf_relocate_section (bfd *output_bfd, 83@@ -1564,13 +1598,11 @@ microblaze_elf_relocate_section (bfd *output_bfd,
83 contents + offset + endian); 84 contents + offset + endian);
84 } 85 }
85 else 86 else
@@ -97,7 +98,7 @@ index 4d41ddbd953..210b84b2a50 100644
97 break; 98 break;
98 } 99 }
99 100
100@@ -1619,9 +1651,16 @@ microblaze_elf_relocate_section (bfd *output_bfd, 101@@ -1660,9 +1692,16 @@ microblaze_elf_relocate_section (bfd *output_bfd,
101 else 102 else
102 { 103 {
103 if (r_type == R_MICROBLAZE_64_PCREL) 104 if (r_type == R_MICROBLAZE_64_PCREL)
@@ -116,7 +117,7 @@ index 4d41ddbd953..210b84b2a50 100644
116 else if (r_type == R_MICROBLAZE_TEXTREL_64 117 else if (r_type == R_MICROBLAZE_TEXTREL_64
117 || r_type == R_MICROBLAZE_TEXTREL_32_LO) 118 || r_type == R_MICROBLAZE_TEXTREL_32_LO)
118 relocation -= input_section->output_section->vma; 119 relocation -= input_section->output_section->vma;
119@@ -1640,14 +1679,11 @@ microblaze_elf_relocate_section (bfd *output_bfd, 120@@ -1681,14 +1720,11 @@ microblaze_elf_relocate_section (bfd *output_bfd,
120 contents + offset + endian); 121 contents + offset + endian);
121 } 122 }
122 else 123 else
@@ -136,29 +137,15 @@ index 4d41ddbd953..210b84b2a50 100644
136 break; 137 break;
137 } 138 }
138 } 139 }
139@@ -1718,6 +1754,21 @@ microblaze_elf_relocate_section (bfd *output_bfd, 140@@ -1759,6 +1795,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
140 141
141 return ret; 142 return ret;
142 } 143 }
143+ 144+
144+/* Merge backend specific data from an object file to the output
145+ object file when linking.
146+
147+ Note: We only use this hook to catch endian mismatches. */
148+static bool
149+microblaze_elf_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
150+{
151+ /* Check if we have the same endianess. */
152+ if (! _bfd_generic_verify_endian_match (ibfd, obfd))
153+ return false;
154+
155+ return true;
156+}
157+
158 145
159 /* Calculate fixup value for reference. */ 146 /* Calculate fixup value for reference. */
160 147
161@@ -2391,8 +2442,11 @@ microblaze_elf_relax_section (bfd *abfd, 148@@ -2436,8 +2473,11 @@ microblaze_elf_relax_section (bfd *abfd,
162 symtab_hdr->contents = (bfd_byte *) isymbuf; 149 symtab_hdr->contents = (bfd_byte *) isymbuf;
163 } 150 }
164 151
@@ -172,29 +159,29 @@ index 4d41ddbd953..210b84b2a50 100644
172 159
173 if (free_contents != NULL) 160 if (free_contents != NULL)
174 { 161 {
175@@ -2415,11 +2469,16 @@ microblaze_elf_relax_section (bfd *abfd, 162@@ -2460,11 +2500,16 @@ microblaze_elf_relax_section (bfd *abfd,
176 return true; 163 return true;
177 164
178 error_return: 165 error_return:
179- free (free_relocs); 166- free (free_relocs);
180- free (free_contents); 167- free (free_contents);
181- free (sec->relax); 168- free (sdata->relax);
182- sec->relax = NULL; 169- sdata->relax = NULL;
183- sec->relax_count = 0; 170- sdata->relax_count = 0;
184+ if (free_relocs != NULL) 171+ if (free_relocs != NULL)
185+ free (free_relocs); 172+ free (free_relocs);
186+ if (free_contents != NULL) 173+ if (free_contents != NULL)
187+ free (free_contents); 174+ free (free_contents);
188+ if (sec->relax != NULL) 175+ if (sdata->relax != NULL)
189+ { 176+ {
190+ free (sec->relax); 177+ free (sdata->relax);
191+ sec->relax = NULL; 178+ sdata->relax = NULL;
192+ sec->relax_count = 0; 179+ sdata->relax_count = 0;
193+ } 180+ }
194 return false; 181 return false;
195 } 182 }
196 183
197@@ -2444,6 +2503,17 @@ microblaze_elf_gc_mark_hook (asection *sec, 184@@ -2489,6 +2534,17 @@ microblaze_elf_gc_mark_hook (asection *sec,
198 return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); 185 return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
199 } 186 }
200 187
@@ -212,7 +199,7 @@ index 4d41ddbd953..210b84b2a50 100644
212 /* PIC support. */ 199 /* PIC support. */
213 200
214 #define PLT_ENTRY_SIZE 16 201 #define PLT_ENTRY_SIZE 16
215@@ -2650,14 +2720,14 @@ microblaze_elf_check_relocs (bfd * abfd, 202@@ -2695,14 +2751,14 @@ microblaze_elf_check_relocs (bfd * abfd,
216 && (! info->symbolic 203 && (! info->symbolic
217 || h->root.type == bfd_link_hash_defweak 204 || h->root.type == bfd_link_hash_defweak
218 || !h->def_regular)))) 205 || !h->def_regular))))
@@ -235,7 +222,7 @@ index 4d41ddbd953..210b84b2a50 100644
235 222
236 /* When creating a shared object, we must copy these 223 /* When creating a shared object, we must copy these
237 relocs into the output file. We create a reloc 224 relocs into the output file. We create a reloc
238@@ -2701,14 +2771,14 @@ microblaze_elf_check_relocs (bfd * abfd, 225@@ -2746,14 +2802,14 @@ microblaze_elf_check_relocs (bfd * abfd,
239 return false; 226 return false;
240 227
241 vpp = &elf_section_data (s)->local_dynrel; 228 vpp = &elf_section_data (s)->local_dynrel;
@@ -252,7 +239,7 @@ index 4d41ddbd953..210b84b2a50 100644
252 bfd_alloc (htab->elf.dynobj, amt)); 239 bfd_alloc (htab->elf.dynobj, amt));
253 if (p == NULL) 240 if (p == NULL)
254 return false; 241 return false;
255@@ -2731,6 +2801,34 @@ microblaze_elf_check_relocs (bfd * abfd, 242@@ -2776,6 +2832,34 @@ microblaze_elf_check_relocs (bfd * abfd,
256 return true; 243 return true;
257 } 244 }
258 245
@@ -287,7 +274,7 @@ index 4d41ddbd953..210b84b2a50 100644
287 /* Copy the extra info we tack onto an elf_link_hash_entry. */ 274 /* Copy the extra info we tack onto an elf_link_hash_entry. */
288 275
289 static void 276 static void
290@@ -2743,6 +2841,40 @@ microblaze_elf_copy_indirect_symbol (struct bfd_link_info *info, 277@@ -2788,6 +2872,40 @@ microblaze_elf_copy_indirect_symbol (struct bfd_link_info *info,
291 edir = (struct elf64_mb_link_hash_entry *) dir; 278 edir = (struct elf64_mb_link_hash_entry *) dir;
292 eind = (struct elf64_mb_link_hash_entry *) ind; 279 eind = (struct elf64_mb_link_hash_entry *) ind;
293 280
@@ -328,7 +315,7 @@ index 4d41ddbd953..210b84b2a50 100644
328 edir->tls_mask |= eind->tls_mask; 315 edir->tls_mask |= eind->tls_mask;
329 316
330 _bfd_elf_link_hash_copy_indirect (info, dir, ind); 317 _bfd_elf_link_hash_copy_indirect (info, dir, ind);
331@@ -2828,9 +2960,17 @@ microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info, 318@@ -2873,9 +2991,17 @@ microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
332 return true; 319 return true;
333 } 320 }
334 321
@@ -348,7 +335,7 @@ index 4d41ddbd953..210b84b2a50 100644
348 { 335 {
349 h->non_got_ref = 0; 336 h->non_got_ref = 0;
350 return true; 337 return true;
351@@ -2849,19 +2989,11 @@ microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info, 338@@ -2894,19 +3020,11 @@ microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
352 /* We must generate a R_MICROBLAZE_COPY reloc to tell the dynamic linker 339 /* We must generate a R_MICROBLAZE_COPY reloc to tell the dynamic linker
353 to copy the initial value out of the dynamic object and into the 340 to copy the initial value out of the dynamic object and into the
354 runtime process image. */ 341 runtime process image. */
@@ -371,7 +358,7 @@ index 4d41ddbd953..210b84b2a50 100644
371 h->needs_copy = 1; 358 h->needs_copy = 1;
372 } 359 }
373 360
374@@ -2871,11 +3003,12 @@ microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info, 361@@ -2916,11 +3034,12 @@ microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
375 if (power_of_two > 3) 362 if (power_of_two > 3)
376 power_of_two = 3; 363 power_of_two = 3;
377 364
@@ -387,7 +374,7 @@ index 4d41ddbd953..210b84b2a50 100644
387 return false; 374 return false;
388 } 375 }
389 376
390@@ -2897,7 +3030,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat) 377@@ -2942,7 +3061,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat)
391 struct bfd_link_info *info; 378 struct bfd_link_info *info;
392 struct elf64_mb_link_hash_table *htab; 379 struct elf64_mb_link_hash_table *htab;
393 struct elf64_mb_link_hash_entry *eh; 380 struct elf64_mb_link_hash_entry *eh;
@@ -396,7 +383,7 @@ index 4d41ddbd953..210b84b2a50 100644
396 383
397 if (h->root.type == bfd_link_hash_indirect) 384 if (h->root.type == bfd_link_hash_indirect)
398 return true; 385 return true;
399@@ -2949,7 +3082,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat) 386@@ -2994,7 +3113,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat)
400 htab->elf.sgotplt->size += 4; 387 htab->elf.sgotplt->size += 4;
401 388
402 /* We also need to make an entry in the .rel.plt section. */ 389 /* We also need to make an entry in the .rel.plt section. */
@@ -405,7 +392,7 @@ index 4d41ddbd953..210b84b2a50 100644
405 } 392 }
406 else 393 else
407 { 394 {
408@@ -3015,7 +3148,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat) 395@@ -3060,7 +3179,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat)
409 else 396 else
410 h->got.offset = (bfd_vma) -1; 397 h->got.offset = (bfd_vma) -1;
411 398
@@ -414,7 +401,7 @@ index 4d41ddbd953..210b84b2a50 100644
414 return true; 401 return true;
415 402
416 /* In the shared -Bsymbolic case, discard space allocated for 403 /* In the shared -Bsymbolic case, discard space allocated for
417@@ -3030,9 +3163,9 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat) 404@@ -3075,9 +3194,9 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat)
418 && (h->forced_local 405 && (h->forced_local
419 || info->symbolic)) 406 || info->symbolic))
420 { 407 {
@@ -426,7 +413,7 @@ index 4d41ddbd953..210b84b2a50 100644
426 { 413 {
427 p->count -= p->pc_count; 414 p->count -= p->pc_count;
428 p->pc_count = 0; 415 p->pc_count = 0;
429@@ -3124,7 +3257,7 @@ microblaze_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, 416@@ -3169,7 +3288,7 @@ microblaze_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
430 { 417 {
431 struct elf_dyn_relocs *p; 418 struct elf_dyn_relocs *p;
432 419
@@ -435,12 +422,7 @@ index 4d41ddbd953..210b84b2a50 100644
435 elf_section_data (s)->local_dynrel); 422 elf_section_data (s)->local_dynrel);
436 p != NULL; 423 p != NULL;
437 p = p->next) 424 p = p->next)
438@@ -3601,13 +3734,14 @@ microblaze_elf_add_symbol_hook (bfd *abfd, 425@@ -3650,9 +3769,10 @@ microblaze_elf_add_symbol_hook (bfd *abfd,
439 #define bfd_elf64_bfd_is_local_label_name microblaze_elf_is_local_label_name
440 #define elf_backend_relocate_section microblaze_elf_relocate_section
441 #define bfd_elf64_bfd_relax_section microblaze_elf_relax_section
442-#define bfd_elf64_bfd_merge_private_bfd_data _bfd_generic_verify_endian_match
443+#define bfd_elf64_bfd_merge_private_bfd_data microblaze_elf_merge_private_bfd_data
444 #define bfd_elf64_bfd_reloc_name_lookup microblaze_elf_reloc_name_lookup 426 #define bfd_elf64_bfd_reloc_name_lookup microblaze_elf_reloc_name_lookup
445 427
446 #define elf_backend_gc_mark_hook microblaze_elf_gc_mark_hook 428 #define elf_backend_gc_mark_hook microblaze_elf_gc_mark_hook
@@ -454,7 +436,7 @@ index 4d41ddbd953..210b84b2a50 100644
454 #define elf_backend_can_gc_sections 1 436 #define elf_backend_can_gc_sections 1
455 #define elf_backend_can_refcount 1 437 #define elf_backend_can_refcount 1
456 #define elf_backend_want_got_plt 1 438 #define elf_backend_want_got_plt 1
457@@ -3617,11 +3751,11 @@ microblaze_elf_add_symbol_hook (bfd *abfd, 439@@ -3662,11 +3782,11 @@ microblaze_elf_add_symbol_hook (bfd *abfd,
458 #define elf_backend_rela_normal 1 440 #define elf_backend_rela_normal 1
459 #define elf_backend_dtrel_excludes_plt 1 441 #define elf_backend_dtrel_excludes_plt 1
460 442
@@ -472,7 +454,7 @@ index 4d41ddbd953..210b84b2a50 100644
472 454
473 #include "elf64-target.h" 455 #include "elf64-target.h"
474diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 456diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
475index dfcd0ab1569..e34af099640 100644 457index 123d5ba6214..41d51007273 100644
476--- a/gas/config/tc-microblaze.c 458--- a/gas/config/tc-microblaze.c
477+++ b/gas/config/tc-microblaze.c 459+++ b/gas/config/tc-microblaze.c
478@@ -433,7 +433,7 @@ const pseudo_typeS md_pseudo_table[] = 460@@ -433,7 +433,7 @@ const pseudo_typeS md_pseudo_table[] =
@@ -485,7 +467,7 @@ index dfcd0ab1569..e34af099640 100644
485 467
486 opcode_hash_control = str_htab_create (); 468 opcode_hash_control = str_htab_create ();
487diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c 469diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c
488index d945d144c44..5e8ebb28b8f 100644 470index 0814cab5bdb..95c2147f86e 100644
489--- a/opcodes/microblaze-dis.c 471--- a/opcodes/microblaze-dis.c
490+++ b/opcodes/microblaze-dis.c 472+++ b/opcodes/microblaze-dis.c
491@@ -140,7 +140,7 @@ get_field_imm16 (struct string_buf *buf, long instr) 473@@ -140,7 +140,7 @@ get_field_imm16 (struct string_buf *buf, long instr)
@@ -539,7 +521,7 @@ index d945d144c44..5e8ebb28b8f 100644
539 521
540 *unconditionalbranch = false; 522 *unconditionalbranch = false;
541diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h 523diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
542index 6f9a5a60dab..a6165649793 100644 524index e65f4b58233..4a415495113 100644
543--- a/opcodes/microblaze-opc.h 525--- a/opcodes/microblaze-opc.h
544+++ b/opcodes/microblaze-opc.h 526+++ b/opcodes/microblaze-opc.h
545@@ -145,7 +145,7 @@ 527@@ -145,7 +145,7 @@
@@ -552,5 +534,5 @@ index 6f9a5a60dab..a6165649793 100644
552 const char * name; 534 const char * name;
553 short inst_type; /* Registers and immediate values involved. */ 535 short inst_type; /* Registers and immediate values involved. */
554-- 536--
5552.17.1 5372.25.1
556 538
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/0036-Double-free-with-ld-no-keep-memory.-Proposed-patches.patch
index 89257eb4..04a1ea67 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/0036-Double-free-with-ld-no-keep-memory.-Proposed-patches.patch
@@ -1,20 +1,20 @@
1From 64b96c071b051cb4eb7471ee016e12c50a00c9d0 Mon Sep 17 00:00:00 2001 1From 24272469bcd56fd8f1e0095e0b2650f03c2cd962 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Mon, 24 Jan 2022 16:59:19 +0530 3Date: Mon, 24 Jan 2022 16:59:19 +0530
4Subject: [PATCH] [Patch,MicroBlaze] : Double free with ld --no-keep-memory. 4Subject: [PATCH 36/38] Double free with ld --no-keep-memory. Proposed patches
5 Proposed patches from the community member (dednev@rambler.ru) for 2021.1. 5 from the community member (dednev@rambler.ru) for 2021.1. [CR-1115233]
6 [CR-1115233]
7 6
7Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
8--- 8---
9 bfd/elf32-microblaze.c | 39 ++++++++++++++++++++------------------ 9 bfd/elf32-microblaze.c | 39 ++++++++++++++++++++------------------
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
13Index: git/bfd/elf32-microblaze.c 13diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
14=================================================================== 14index 9c6d0411420..e284b0e5398 100644
15--- git.orig/bfd/elf32-microblaze.c 15--- a/bfd/elf32-microblaze.c
16+++ git/bfd/elf32-microblaze.c 16+++ b/bfd/elf32-microblaze.c
17@@ -1839,10 +1839,8 @@ microblaze_elf_relax_section (bfd *abfd, 17@@ -1881,10 +1881,8 @@ microblaze_elf_relax_section (bfd *abfd,
18 { 18 {
19 Elf_Internal_Shdr *symtab_hdr; 19 Elf_Internal_Shdr *symtab_hdr;
20 Elf_Internal_Rela *internal_relocs; 20 Elf_Internal_Rela *internal_relocs;
@@ -24,17 +24,17 @@ Index: git/bfd/elf32-microblaze.c
24- bfd_byte *free_contents = NULL; 24- bfd_byte *free_contents = NULL;
25 int rel_count; 25 int rel_count;
26 unsigned int shndx; 26 unsigned int shndx;
27 int i, sym_index; 27 size_t i, sym_index;
28@@ -1884,8 +1882,6 @@ microblaze_elf_relax_section (bfd *abfd, 28@@ -1928,8 +1926,6 @@ microblaze_elf_relax_section (bfd *abfd,
29 internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, link_info->keep_memory); 29 internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, link_info->keep_memory);
30 if (internal_relocs == NULL) 30 if (internal_relocs == NULL)
31 goto error_return; 31 goto error_return;
32- if (! link_info->keep_memory) 32- if (! link_info->keep_memory)
33- free_relocs = internal_relocs; 33- free_relocs = internal_relocs;
34 34
35 sec->relax = (struct relax_table *) bfd_malloc ((sec->reloc_count + 1) 35 sdata->relax_count = 0;
36 * sizeof (struct relax_table)); 36 sdata->relax = (struct relax_table *) bfd_malloc ((sec->reloc_count + 1)
37@@ -1913,7 +1909,6 @@ microblaze_elf_relax_section (bfd *abfd, 37@@ -1957,7 +1953,6 @@ microblaze_elf_relax_section (bfd *abfd,
38 contents = (bfd_byte *) bfd_malloc (sec->size); 38 contents = (bfd_byte *) bfd_malloc (sec->size);
39 if (contents == NULL) 39 if (contents == NULL)
40 goto error_return; 40 goto error_return;
@@ -42,7 +42,7 @@ Index: git/bfd/elf32-microblaze.c
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@@ -2413,25 +2408,26 @@ microblaze_elf_relax_section (bfd *abfd, 45@@ -2458,25 +2453,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,15 +56,14 @@ Index: git/bfd/elf32-microblaze.c
56 56
57- free (free_relocs); 57- free (free_relocs);
58- free_relocs = NULL; 58- free_relocs = NULL;
59- 59+ if (internal_relocs != NULL
60+ && elf_section_data (sec)->relocs != internal_relocs)
61+ free (internal_relocs);
62
60- if (free_contents != NULL) 63- if (free_contents != NULL)
61- { 64- {
62- if (!link_info->keep_memory) 65- if (!link_info->keep_memory)
63- free (free_contents); 66- free (free_contents);
64+ if (internal_relocs != NULL
65+ && elf_section_data (sec)->relocs != internal_relocs)
66+ free (internal_relocs);
67+
68+ if (contents != NULL 67+ if (contents != NULL
69+ && elf_section_data (sec)->this_hdr.contents != contents) 68+ && elf_section_data (sec)->this_hdr.contents != contents)
70+ { 69+ {
@@ -80,8 +79,8 @@ Index: git/bfd/elf32-microblaze.c
80+ } 79+ }
81 } 80 }
82 81
83 if (sec->relax_count == 0) 82 if (sdata->relax_count == 0)
84@@ -2445,8 +2441,15 @@ microblaze_elf_relax_section (bfd *abfd, 83@@ -2490,8 +2486,15 @@ microblaze_elf_relax_section (bfd *abfd,
85 return true; 84 return true;
86 85
87 error_return: 86 error_return:
@@ -96,14 +95,14 @@ Index: git/bfd/elf32-microblaze.c
96+ if (contents != NULL 95+ if (contents != NULL
97+ && elf_section_data (sec)->this_hdr.contents != contents) 96+ && elf_section_data (sec)->this_hdr.contents != contents)
98+ free (contents); 97+ free (contents);
99 free (sec->relax); 98 free (sdata->relax);
100 sec->relax = NULL; 99 sdata->relax = NULL;
101 sec->relax_count = 0; 100 sdata->relax_count = 0;
102Index: git/bfd/elf64-microblaze.c 101diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
103=================================================================== 102index 2e42366d8d6..3b6e6aa47bd 100644
104--- git.orig/bfd/elf64-microblaze.c 103--- a/bfd/elf64-microblaze.c
105+++ git/bfd/elf64-microblaze.c 104+++ b/bfd/elf64-microblaze.c
106@@ -1849,10 +1849,8 @@ microblaze_elf_relax_section (bfd *abfd, 105@@ -1877,10 +1877,8 @@ microblaze_elf_relax_section (bfd *abfd,
107 { 106 {
108 Elf_Internal_Shdr *symtab_hdr; 107 Elf_Internal_Shdr *symtab_hdr;
109 Elf_Internal_Rela *internal_relocs; 108 Elf_Internal_Rela *internal_relocs;
@@ -114,16 +113,16 @@ Index: git/bfd/elf64-microblaze.c
114 int rel_count; 113 int rel_count;
115 unsigned int shndx; 114 unsigned int shndx;
116 int i, sym_index; 115 int i, sym_index;
117@@ -1894,8 +1892,6 @@ microblaze_elf_relax_section (bfd *abfd, 116@@ -1924,8 +1922,6 @@ microblaze_elf_relax_section (bfd *abfd,
118 internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, link_info->keep_memory); 117 internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, link_info->keep_memory);
119 if (internal_relocs == NULL) 118 if (internal_relocs == NULL)
120 goto error_return; 119 goto error_return;
121- if (! link_info->keep_memory) 120- if (! link_info->keep_memory)
122- free_relocs = internal_relocs; 121- free_relocs = internal_relocs;
123 122
124 sec->relax = (struct relax_table *) bfd_malloc ((sec->reloc_count + 1) 123 sdata->relax_count = 0;
125 * sizeof (struct relax_table)); 124 sdata->relax = (struct relax_table *) bfd_malloc ((sec->reloc_count + 1)
126@@ -1923,8 +1919,6 @@ microblaze_elf_relax_section (bfd *abfd, 125@@ -1953,8 +1949,6 @@ microblaze_elf_relax_section (bfd *abfd,
127 contents = (bfd_byte *) bfd_malloc (sec->size); 126 contents = (bfd_byte *) bfd_malloc (sec->size);
128 if (contents == NULL) 127 if (contents == NULL)
129 goto error_return; 128 goto error_return;
@@ -132,7 +131,7 @@ Index: git/bfd/elf64-microblaze.c
132 if (!bfd_get_section_contents (abfd, sec, contents, 131 if (!bfd_get_section_contents (abfd, sec, contents,
133 (file_ptr) 0, sec->size)) 132 (file_ptr) 0, sec->size))
134 goto error_return; 133 goto error_return;
135@@ -2434,28 +2428,26 @@ microblaze_elf_relax_section (bfd *abfd, 134@@ -2465,28 +2459,26 @@ microblaze_elf_relax_section (bfd *abfd,
136 } 135 }
137 136
138 elf_section_data (sec)->relocs = internal_relocs; 137 elf_section_data (sec)->relocs = internal_relocs;
@@ -171,8 +170,8 @@ Index: git/bfd/elf64-microblaze.c
171+ } 170+ }
172 } 171 }
173 172
174 if (sec->relax_count == 0) 173 if (sdata->relax_count == 0)
175@@ -2469,10 +2461,15 @@ microblaze_elf_relax_section (bfd *abfd, 174@@ -2500,10 +2492,15 @@ microblaze_elf_relax_section (bfd *abfd,
176 return true; 175 return true;
177 176
178 error_return: 177 error_return:
@@ -189,6 +188,9 @@ Index: git/bfd/elf64-microblaze.c
189+ if (contents != NULL 188+ if (contents != NULL
190+ && elf_section_data (sec)->this_hdr.contents != contents) 189+ && elf_section_data (sec)->this_hdr.contents != contents)
191+ free (contents); 190+ free (contents);
192 if (sec->relax != NULL) 191 if (sdata->relax != NULL)
193 { 192 {
194 free (sec->relax); 193 free (sdata->relax);
194--
1952.25.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/0037-Fixing-the-imm-imml-generation-for-16-bit-argument-C.patch
index 30ba75ba..5c69eed7 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/0037-Fixing-the-imm-imml-generation-for-16-bit-argument-C.patch
@@ -1,19 +1,20 @@
1From 0435ac5ae5d2fa9da8561fd47802ca742061e462 Mon Sep 17 00:00:00 2001 1From 9f2319c6e32c4449604c2ec26042123a88eeb87c Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Mon, 24 Jan 2022 16:21:33 +0530 3Date: Mon, 24 Jan 2022 16:21:33 +0530
4Subject: [PATCH] [Patch,MicroBlaze] : Fixing the imm/imml generation for 16 4Subject: [PATCH 37/38] Fixing the imm/imml generation for 16 bit argument
5 bit argument [CR-1115234]. 5 [CR-1115234].
6 6
7Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
7--- 8---
8 bfd/elf32-microblaze.c | 6 +++++- 9 bfd/elf32-microblaze.c | 6 +++++-
9 bfd/elf64-microblaze.c | 5 ++++- 10 bfd/elf64-microblaze.c | 5 ++++-
10 2 files changed, 9 insertions(+), 2 deletions(-) 11 2 files changed, 9 insertions(+), 2 deletions(-)
11 12
12Index: git/bfd/elf32-microblaze.c 13diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
13=================================================================== 14index e284b0e5398..8b947a6ec79 100644
14--- git.orig/bfd/elf32-microblaze.c 15--- a/bfd/elf32-microblaze.c
15+++ git/bfd/elf32-microblaze.c 16+++ b/bfd/elf32-microblaze.c
16@@ -1972,7 +1972,11 @@ microblaze_elf_relax_section (bfd *abfd, 17@@ -2016,7 +2016,11 @@ microblaze_elf_relax_section (bfd *abfd,
17 else 18 else
18 symval += irel->r_addend; 19 symval += irel->r_addend;
19 20
@@ -25,12 +26,12 @@ Index: git/bfd/elf32-microblaze.c
25+ 26+
26 { 27 {
27 /* We can delete this instruction. */ 28 /* We can delete this instruction. */
28 sec->relax[sec->relax_count].addr = irel->r_offset; 29 sdata->relax[sdata->relax_count].addr = irel->r_offset;
29Index: git/bfd/elf64-microblaze.c 30diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
30=================================================================== 31index 3b6e6aa47bd..cecfb5506f8 100644
31--- git.orig/bfd/elf64-microblaze.c 32--- a/bfd/elf64-microblaze.c
32+++ git/bfd/elf64-microblaze.c 33+++ b/bfd/elf64-microblaze.c
33@@ -1981,7 +1981,10 @@ microblaze_elf_relax_section (bfd *abfd, 34@@ -2011,7 +2011,10 @@ microblaze_elf_relax_section (bfd *abfd,
34 else 35 else
35 symval += irel->r_addend; 36 symval += irel->r_addend;
36 37
@@ -41,4 +42,7 @@ Index: git/bfd/elf64-microblaze.c
41+ || (symval & 0xffff8000) == 0xffff8000) 42+ || (symval & 0xffff8000) == 0xffff8000)
42 { 43 {
43 /* We can delete this instruction. */ 44 /* We can delete this instruction. */
44 sec->relax[sec->relax_count].addr = irel->r_offset; 45 sdata->relax[sdata->relax_count].addr = irel->r_offset;
46--
472.25.1
48
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/0038-Invalid-data-offsets-pointer-after-relaxation.-Propo.patch
index ed32dedc..a34478f2 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0041-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0038-Invalid-data-offsets-pointer-after-relaxation.-Propo.patch
@@ -1,20 +1,21 @@
1From 9fb3bc7ade713f55182aae4c57f8504cc07c366b Mon Sep 17 00:00:00 2001 1From 7eddc47ff5eecc2e383c96f4712185c42347105b Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Mon, 24 Jan 2022 16:04:07 +0530 3Date: Mon, 24 Jan 2022 16:04:07 +0530
4Subject: [PATCH] [Patch,MicroBlaze] : Invalid data offsets (pointer) after 4Subject: [PATCH 38/38] Invalid data offsets (pointer) after relaxation.
5 relaxation. Proposed patch from community member (dednev@rambler.ru) against 5 Proposed patch from community member (dednev@rambler.ru) against 2021.1
6 2021.1 [CR-1115232] 6 [CR-1115232]
7 7
8Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
8--- 9---
9 bfd/elf32-microblaze.c | 18 ++++++++++++++++++ 10 bfd/elf32-microblaze.c | 18 ++++++++++++++++++
10 bfd/elf64-microblaze.c | 17 +++++++++++++++++ 11 bfd/elf64-microblaze.c | 17 +++++++++++++++++
11 2 files changed, 35 insertions(+) 12 2 files changed, 35 insertions(+)
12 13
13Index: git/bfd/elf32-microblaze.c 14diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
14=================================================================== 15index 8b947a6ec79..0655d0fe975 100644
15--- git.orig/bfd/elf32-microblaze.c 16--- a/bfd/elf32-microblaze.c
16+++ git/bfd/elf32-microblaze.c 17+++ b/bfd/elf32-microblaze.c
17@@ -2130,6 +2130,9 @@ microblaze_elf_relax_section (bfd *abfd, 18@@ -2174,6 +2174,9 @@ microblaze_elf_relax_section (bfd *abfd,
18 { 19 {
19 unsigned int val; 20 unsigned int val;
20 21
@@ -24,7 +25,7 @@ Index: git/bfd/elf32-microblaze.c
24 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 25 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
25 26
26 /* hax: We only do the following fixup for debug location lists. */ 27 /* hax: We only do the following fixup for debug location lists. */
27@@ -2171,6 +2174,9 @@ microblaze_elf_relax_section (bfd *abfd, 28@@ -2215,6 +2218,9 @@ microblaze_elf_relax_section (bfd *abfd,
28 } 29 }
29 if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32) 30 if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32)
30 { 31 {
@@ -34,7 +35,7 @@ Index: git/bfd/elf32-microblaze.c
34 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 35 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
35 36
36 /* Look at the reloc only if the value has been resolved. */ 37 /* Look at the reloc only if the value has been resolved. */
37@@ -2203,6 +2209,9 @@ microblaze_elf_relax_section (bfd *abfd, 38@@ -2247,6 +2253,9 @@ microblaze_elf_relax_section (bfd *abfd,
38 } 39 }
39 else if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_SYM_OP_SYM) 40 else if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_SYM_OP_SYM)
40 { 41 {
@@ -44,7 +45,7 @@ Index: git/bfd/elf32-microblaze.c
44 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 45 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
45 46
46 /* Look at the reloc only if the value has been resolved. */ 47 /* Look at the reloc only if the value has been resolved. */
47@@ -2240,6 +2249,9 @@ microblaze_elf_relax_section (bfd *abfd, 48@@ -2284,6 +2293,9 @@ microblaze_elf_relax_section (bfd *abfd,
48 || (ELF32_R_TYPE (irelscan->r_info) 49 || (ELF32_R_TYPE (irelscan->r_info)
49 == (int) R_MICROBLAZE_TEXTREL_32_LO)) 50 == (int) R_MICROBLAZE_TEXTREL_32_LO))
50 { 51 {
@@ -54,7 +55,7 @@ Index: git/bfd/elf32-microblaze.c
54 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 55 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
55 56
56 /* Look at the reloc only if the value has been resolved. */ 57 /* Look at the reloc only if the value has been resolved. */
57@@ -2286,6 +2298,9 @@ microblaze_elf_relax_section (bfd *abfd, 58@@ -2330,6 +2342,9 @@ microblaze_elf_relax_section (bfd *abfd,
58 || (ELF32_R_TYPE (irelscan->r_info) 59 || (ELF32_R_TYPE (irelscan->r_info)
59 == (int) R_MICROBLAZE_TEXTREL_64)) 60 == (int) R_MICROBLAZE_TEXTREL_64))
60 { 61 {
@@ -64,7 +65,7 @@ Index: git/bfd/elf32-microblaze.c
64 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 65 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
65 66
66 /* Look at the reloc only if the value has been resolved. */ 67 /* Look at the reloc only if the value has been resolved. */
67@@ -2320,6 +2335,9 @@ microblaze_elf_relax_section (bfd *abfd, 68@@ -2364,6 +2379,9 @@ microblaze_elf_relax_section (bfd *abfd,
68 } 69 }
69 else if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_PCREL) 70 else if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_PCREL)
70 { 71 {
@@ -74,11 +75,11 @@ Index: git/bfd/elf32-microblaze.c
74 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 75 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
75 76
76 /* Look at the reloc only if the value has been resolved. */ 77 /* Look at the reloc only if the value has been resolved. */
77Index: git/bfd/elf64-microblaze.c 78diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
78=================================================================== 79index cecfb5506f8..c7bf5a71f08 100644
79--- git.orig/bfd/elf64-microblaze.c 80--- a/bfd/elf64-microblaze.c
80+++ git/bfd/elf64-microblaze.c 81+++ b/bfd/elf64-microblaze.c
81@@ -2135,6 +2135,8 @@ microblaze_elf_relax_section (bfd *abfd, 82@@ -2165,6 +2165,8 @@ microblaze_elf_relax_section (bfd *abfd,
82 if (1 && ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_NONE) 83 if (1 && ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_NONE)
83 { 84 {
84 unsigned int val; 85 unsigned int val;
@@ -87,7 +88,7 @@ Index: git/bfd/elf64-microblaze.c
87 88
88 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 89 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
89 90
90@@ -2177,6 +2179,9 @@ microblaze_elf_relax_section (bfd *abfd, 91@@ -2207,6 +2209,9 @@ microblaze_elf_relax_section (bfd *abfd,
91 if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32 92 if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32
92 || ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_IMML_64) 93 || ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_IMML_64)
93 { 94 {
@@ -97,7 +98,7 @@ Index: git/bfd/elf64-microblaze.c
97 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 98 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
98 99
99 /* Look at the reloc only if the value has been resolved. */ 100 /* Look at the reloc only if the value has been resolved. */
100@@ -2209,6 +2214,9 @@ microblaze_elf_relax_section (bfd *abfd, 101@@ -2239,6 +2244,9 @@ microblaze_elf_relax_section (bfd *abfd,
101 } 102 }
102 else if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_SYM_OP_SYM) 103 else if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_SYM_OP_SYM)
103 { 104 {
@@ -107,7 +108,7 @@ Index: git/bfd/elf64-microblaze.c
107 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 108 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
108 109
109 /* Look at the reloc only if the value has been resolved. */ 110 /* Look at the reloc only if the value has been resolved. */
110@@ -2244,6 +2252,9 @@ microblaze_elf_relax_section (bfd *abfd, 111@@ -2274,6 +2282,9 @@ microblaze_elf_relax_section (bfd *abfd,
111 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_LO) 112 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_LO)
112 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_TEXTREL_32_LO)) 113 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_TEXTREL_32_LO))
113 { 114 {
@@ -117,7 +118,7 @@ Index: git/bfd/elf64-microblaze.c
117 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 118 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
118 119
119 /* Look at the reloc only if the value has been resolved. */ 120 /* Look at the reloc only if the value has been resolved. */
120@@ -2289,6 +2300,9 @@ microblaze_elf_relax_section (bfd *abfd, 121@@ -2319,6 +2330,9 @@ microblaze_elf_relax_section (bfd *abfd,
121 if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64 122 if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64
122 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_TEXTREL_64)) 123 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_TEXTREL_64))
123 { 124 {
@@ -127,7 +128,7 @@ Index: git/bfd/elf64-microblaze.c
127 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 128 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
128 129
129 /* Look at the reloc only if the value has been resolved. */ 130 /* Look at the reloc only if the value has been resolved. */
130@@ -2336,6 +2350,9 @@ microblaze_elf_relax_section (bfd *abfd, 131@@ -2366,6 +2380,9 @@ microblaze_elf_relax_section (bfd *abfd,
131 } 132 }
132 else if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_PCREL) 133 else if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_PCREL)
133 { 134 {
@@ -137,3 +138,6 @@ Index: git/bfd/elf64-microblaze.c
137 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 138 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
138 139
139 /* Look at the reloc only if the value has been resolved. */ 140 /* Look at the reloc only if the value has been resolved. */
141--
1422.25.1
143