summaryrefslogtreecommitdiffstats
path: root/meta-microblaze
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@amd.com>2022-11-04 15:07:16 -0500
committerMark Hatle <mark.hatle@amd.com>2022-11-07 08:05:23 -0600
commit75c67a6c15fed677378ab52ed90b6ca0e5125936 (patch)
treeb72dde036d0881b263b92707e4f457b7873d2f50 /meta-microblaze
parent675cc3174baed5028c647eb829570501c34eddb9 (diff)
downloadmeta-xilinx-75c67a6c15fed677378ab52ed90b6ca0e5125936.tar.gz
binutils-microblaze: Update to new version of the port
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-microblaze')
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils-microblaze.inc61
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0001-Add-wdc.ext.clear-and-wdc.ext.flush-insns.patch7
-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-LOCAL-Fix-relaxation-of-assembler-resolved-reference.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0004-Fix-relaxation-of-assembler-resolved-references-Fixu.patch)57
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0005-upstream-change-to-garbage-collection-sweep-causes-m.patch7
-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.patch8
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0008-Add-new-bit-field-instructions.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0009-Add-new-bit-field-instructions.patch)15
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0008-fixing-the-MAX_OPCODES-to-correct-value.patch26
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0009-Patch-Microblaze-fixed-bug-in-GCC-so-that-It-will-su.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0011-fixed-bug-in-GCC-so-that-It-will-support-.long-0U-an.patch)9
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0010-fixing-the-constant-range-check-issue.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0012-fixing-the-constant-range-check-issue-sample-error-n.patch)7
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0010-fixing-the-imm-bug.-with-relax-option-imm-1-is-also-.patch28
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0011-Patch-Microblaze-Compiler-will-give-error-messages-i.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0013-Compiler-will-give-error-messages-in-more-detail-for.patch)13
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0012-Patch-MicroBlaze-initial-support-for-MicroBlaze-64-b.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0014-initial-support-for-MicroBlaze-64-bit-m64.patch)827
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0013-Patch-Microblaze-negl-instruction-is-overriding-rsub.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0015-negl-instruction-is-overriding-rsubl-fixed-it-by-cha.patch)9
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0014-Added-relocations-for-MB-X.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0016-Added-relocations-for-MB-X.patch)8
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0015-Fixed-MB-x-relocation-issues.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0017-Fixed-MB-x-relocation-issues-Added-imml-for-required.patch)11
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0016-Fixing-the-branch-related-issues.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0018-Fixing-the-branch-related-issues.patch)12
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0017-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)29
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0018-Patch-MicroBlaze-Adding-new-relocation-to-support-64.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0020-Patch-MicroBlaze-Adding-new-relocation-to-support-64.patch)13
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0019-fixing-the-.bss-relocation-issue.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0021-fixing-the-.bss-relocation-issue.patch)57
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0020-Fixed-the-bug-in-the-R_MICROBLAZE_64_NONE-relocation.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0022-Fixed-the-bug-in-the-R_MICROBLAZE_64_NONE-relocation.patch)19
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0021-Revert-ld-Remove-unused-expression-state.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0023-Revert-ld-Remove-unused-expression-state-defsym-symb.patch)8
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0022-fixing-the-long-long-long-mingw-toolchain-issue.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0024-fixing-the-long-long-long-mingw-toolchain-issue.patch)7
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0023-Added-support-to-new-arithmetic-single-register-inst.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0025-Added-support-to-new-arithmetic-single-register-inst.patch)21
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0024-Patch-MicroBlaze-double-imml-generation-for-64-bit-v.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0026-double-imml-generation-for-64-bit-values.patch)11
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0025-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0027-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch)10
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0026-Patch-MicroBlaze-m64-This-patch-will-remove-imml-0-a.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0028-This-patch-will-remove-imml-0-and-imml-1-instruction.patch)12
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0027-Patch-MicroBlaze-improper-address-mapping-of-PROVIDE.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0029-improper-address-mapping-of-PROVIDE-directive-symbol.patch)13
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0028-Patch-microblaze-Changing-the-long-to-long-long-as-i.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0030-Changing-the-long-to-long-long-as-in-Windows-long-is.patch)16
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0029-gas-revert-moving-of-md_pseudo_table-from-const.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0031-gas-revert-moving-of-md_pseudo_table-from-const.patch)8
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0030-ld-emulparams-elf64microblaze-Fix-emulation-generati.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0032-ld-emulparams-elf64microblaze-Fix-emulation-generati.patch)7
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0031-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0038-Invalid-data-offsets-pointer-after-relaxation.-Propo.patch)43
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0032-Patch-MicroBlaze-Double-free-with-ld-no-keep-memory.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0036-Double-free-with-ld-no-keep-memory.-Proposed-patches.patch)67
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0033-Add-initial-port-of-linux-gdbserver-add-gdb_proc_ser.patch1581
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0033-Patch-MB-MB-binutils-Upstream-port-issues.patch (renamed from meta-microblaze/recipes-devtools/binutils/binutils/0035-MB-binutils-Upstream-port-issues.patch)130
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0034-Initial-port-of-core-reading-support-Added-support-f.patch305
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0034-Patch-MicroBlaze-By-default-the-linker-will-generate.patch27
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0037-Fixing-the-imm-imml-generation-for-16-bit-argument-C.patch48
40 files changed, 792 insertions, 2769 deletions
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils-microblaze.inc b/meta-microblaze/recipes-devtools/binutils/binutils-microblaze.inc
index 24702838..2aecd24d 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils-microblaze.inc
+++ b/meta-microblaze/recipes-devtools/binutils/binutils-microblaze.inc
@@ -4,39 +4,36 @@ 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-Fix-relaxation-of-assembler-resolved-references-Fixu.patch \ 7 file://0004-LOCAL-Fix-relaxation-of-assembler-resolved-reference.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-Add-new-bit-field-instructions.patch \
12 file://0009-Add-new-bit-field-instructions.patch \ 12 file://0009-Patch-Microblaze-fixed-bug-in-GCC-so-that-It-will-su.patch \
13 file://0010-fixing-the-imm-bug.-with-relax-option-imm-1-is-also-.patch \ 13 file://0010-fixing-the-constant-range-check-issue.patch \
14 file://0011-fixed-bug-in-GCC-so-that-It-will-support-.long-0U-an.patch \ 14 file://0011-Patch-Microblaze-Compiler-will-give-error-messages-i.patch \
15 file://0012-fixing-the-constant-range-check-issue-sample-error-n.patch \ 15 file://0012-Patch-MicroBlaze-initial-support-for-MicroBlaze-64-b.patch \
16 file://0013-Compiler-will-give-error-messages-in-more-detail-for.patch \ 16 file://0013-Patch-Microblaze-negl-instruction-is-overriding-rsub.patch \
17 file://0014-initial-support-for-MicroBlaze-64-bit-m64.patch \ 17 file://0014-Added-relocations-for-MB-X.patch \
18 file://0015-negl-instruction-is-overriding-rsubl-fixed-it-by-cha.patch \ 18 file://0015-Fixed-MB-x-relocation-issues.patch \
19 file://0016-Added-relocations-for-MB-X.patch \ 19 file://0016-Fixing-the-branch-related-issues.patch \
20 file://0017-Fixed-MB-x-relocation-issues-Added-imml-for-required.patch \ 20 file://0017-Fixed-address-computation-issues-with-64bit-address.patch \
21 file://0018-Fixing-the-branch-related-issues.patch \ 21 file://0018-Patch-MicroBlaze-Adding-new-relocation-to-support-64.patch \
22 file://0019-Fixed-address-computation-issues-with-64bit-address-.patch \ 22 file://0019-fixing-the-.bss-relocation-issue.patch \
23 file://0020-Patch-MicroBlaze-Adding-new-relocation-to-support-64.patch \ 23 file://0020-Fixed-the-bug-in-the-R_MICROBLAZE_64_NONE-relocation.patch \
24 file://0021-fixing-the-.bss-relocation-issue.patch \ 24 file://0021-Revert-ld-Remove-unused-expression-state.patch \
25 file://0022-Fixed-the-bug-in-the-R_MICROBLAZE_64_NONE-relocation.patch \ 25 file://0022-fixing-the-long-long-long-mingw-toolchain-issue.patch \
26 file://0023-Revert-ld-Remove-unused-expression-state-defsym-symb.patch \ 26 file://0023-Added-support-to-new-arithmetic-single-register-inst.patch \
27 file://0024-fixing-the-long-long-long-mingw-toolchain-issue.patch \ 27 file://0024-Patch-MicroBlaze-double-imml-generation-for-64-bit-v.patch \
28 file://0025-Added-support-to-new-arithmetic-single-register-inst.patch \ 28 file://0025-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch \
29 file://0026-double-imml-generation-for-64-bit-values.patch \ 29 file://0026-Patch-MicroBlaze-m64-This-patch-will-remove-imml-0-a.patch \
30 file://0027-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch \ 30 file://0027-Patch-MicroBlaze-improper-address-mapping-of-PROVIDE.patch \
31 file://0028-This-patch-will-remove-imml-0-and-imml-1-instruction.patch \ 31 file://0028-Patch-microblaze-Changing-the-long-to-long-long-as-i.patch \
32 file://0029-improper-address-mapping-of-PROVIDE-directive-symbol.patch \ 32 file://0029-gas-revert-moving-of-md_pseudo_table-from-const.patch \
33 file://0030-Changing-the-long-to-long-long-as-in-Windows-long-is.patch \ 33 file://0030-ld-emulparams-elf64microblaze-Fix-emulation-generati.patch \
34 file://0031-gas-revert-moving-of-md_pseudo_table-from-const.patch \ 34 file://0031-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch \
35 file://0032-ld-emulparams-elf64microblaze-Fix-emulation-generati.patch \ 35 file://0032-Patch-MicroBlaze-Double-free-with-ld-no-keep-memory.patch \
36 file://0033-Add-initial-port-of-linux-gdbserver-add-gdb_proc_ser.patch \ 36 file://0033-Patch-MB-MB-binutils-Upstream-port-issues.patch \
37 file://0034-Initial-port-of-core-reading-support-Added-support-f.patch \ 37 file://0034-Patch-MicroBlaze-By-default-the-linker-will-generate.patch \
38 file://0035-MB-binutils-Upstream-port-issues.patch \
39 file://0036-Double-free-with-ld-no-keep-memory.-Proposed-patches.patch \
40 file://0037-Fixing-the-imm-imml-generation-for-16-bit-argument-C.patch \
41 file://0038-Invalid-data-offsets-pointer-after-relaxation.-Propo.patch \
42 " 38 "
39
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 53416280..d5fa21ce 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,7 +1,7 @@
1From fd654b0c7b88cd55fa659e0acea91296c7ed8e80 Mon Sep 17 00:00:00 2001 1From 38ae9c3ae1270b9873e1cfa4397bae4a5269d1aa 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/34] Add wdc.ext.clear and wdc.ext.flush insns
5 5
6Added two new instructions, wdc.ext.clear and wdc.ext.flush, 6Added two new instructions, wdc.ext.clear and wdc.ext.flush,
7to enable MicroBlaze to flush an external cache, which is 7to enable MicroBlaze to flush an external cache, which is
@@ -9,7 +9,6 @@ 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>
13--- 12---
14 opcodes/microblaze-opc.h | 5 ++++- 13 opcodes/microblaze-opc.h | 5 ++++-
15 opcodes/microblaze-opcm.h | 4 ++-- 14 opcodes/microblaze-opcm.h | 4 ++--
@@ -62,5 +61,5 @@ index 8e293465fec..e56c1d2d47c 100644
62 imm, rtsd, rtid, rtbd, rted, bri, brid, brlid, brai, braid, bralid, 61 imm, rtsd, rtid, rtbd, rted, bri, brid, brlid, brai, braid, bralid,
63 brki, beqi, beqid, bnei, bneid, blti, bltid, blei, bleid, bgti, 62 brki, beqi, beqid, bnei, bneid, blti, bltid, blei, bleid, bgti,
64-- 63--
652.25.1 642.37.1 (Apple Git-137.1)
66 65
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 ace172b6..836d5b08 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,7 +1,7 @@
1From 2daa3e3863ee052020ad07ac59c49b7f82f7a9d1 Mon Sep 17 00:00:00 2001 1From d5645c82ce39b1950a6d0ee279088d10af390642 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/34] Add mlittle-endian and mbig-endian flags
5 5
6Added support in gas for mlittle-endian and mbig-endian flags 6Added support in gas for mlittle-endian and mbig-endian flags
7as options. 7as options.
@@ -11,7 +11,6 @@ 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>
15--- 14---
16 gas/config/tc-microblaze.c | 9 +++++++++ 15 gas/config/tc-microblaze.c | 9 +++++++++
17 1 file changed, 9 insertions(+) 16 1 file changed, 9 insertions(+)
@@ -61,5 +60,5 @@ index 3db17a76ee7..c927331ea0a 100644
61 60
62 61
63-- 62--
642.25.1 632.37.1 (Apple Git-137.1)
65 64
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 09af3e82..156f5c78 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,13 +1,12 @@
1From 7982c0bdd92531bca3b829255324a769df9521e1 Mon Sep 17 00:00:00 2001 1From 6f53d25f9817f4d9fbc8d838b36d7026d184e63f 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/34] Disable the warning message for eh_frame_hdr
5 5
6Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> 6Signed-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>
11--- 10---
12 bfd/elf-eh-frame.c | 3 +++ 11 bfd/elf-eh-frame.c | 3 +++
13 1 file changed, 3 insertions(+) 12 1 file changed, 3 insertions(+)
@@ -31,5 +30,5 @@ index 2e22d0c9215..db470ed43c3 100644
31 free (sec_info); 30 free (sec_info);
32 success: 31 success:
33-- 32--
342.25.1 332.37.1 (Apple Git-137.1)
35 34
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0004-Fix-relaxation-of-assembler-resolved-references-Fixu.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0004-LOCAL-Fix-relaxation-of-assembler-resolved-reference.patch
index adb6e213..e0bd25b9 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0004-Fix-relaxation-of-assembler-resolved-references-Fixu.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0004-LOCAL-Fix-relaxation-of-assembler-resolved-reference.patch
@@ -1,10 +1,11 @@
1From 1b47ecbc256f807b239f3f275fefd53bba0f0cde Mon Sep 17 00:00:00 2001 1From f7c540994e73e430e73d220109e911dff5961f16 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] Fix relaxation of assembler resolved references,Fixup 4Subject: [PATCH 04/34] [LOCAL]: Fix relaxation of assembler resolved
5 debug_loc sections after linker relaxation Adds a new reloctype 5 references,Fixup debug_loc sections after linker relaxation Adds a new
6 R_MICROBLAZE_32_NONE, used for passing reloc info from the assembler to the 6 reloctype R_MICROBLAZE_32_NONE, used for passing reloc info from the
7 linker when the linker manages to fully resolve a local symbol reference. 7 assembler to the linker when the linker manages to fully resolve a local
8 symbol reference.
8 9
9This is a workaround for design flaws in the assembler to 10This is a workaround for design flaws in the assembler to
10linker interface with regards to linker relaxation. 11linker interface with regards to linker relaxation.
@@ -19,16 +20,18 @@ Conflicts:
19 20
20Conflicts: 21Conflicts:
21 binutils/readelf.c 22 binutils/readelf.c
22Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> 23
24Conflicts:
25 bfd/elf32-microblaze.c
23--- 26---
24 bfd/bfd-in2.h | 5 ++ 27 bfd/bfd-in2.h | 5 ++
25 bfd/elf32-microblaze.c | 118 +++++++++++++++++++++++++++++-------- 28 bfd/elf32-microblaze.c | 126 ++++++++++++++++++++++++++++---------
26 bfd/libbfd.h | 1 + 29 bfd/libbfd.h | 1 +
27 bfd/reloc.c | 6 ++ 30 bfd/reloc.c | 6 ++
28 binutils/readelf.c | 4 ++ 31 binutils/readelf.c | 4 ++
29 gas/config/tc-microblaze.c | 4 ++ 32 gas/config/tc-microblaze.c | 4 ++
30 include/elf/microblaze.h | 2 + 33 include/elf/microblaze.h | 2 +
31 7 files changed, 115 insertions(+), 25 deletions(-) 34 7 files changed, 119 insertions(+), 29 deletions(-)
32 35
33diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h 36diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
34index 1f0f18a7e75..26e3bb2b34b 100644 37index 1f0f18a7e75..26e3bb2b34b 100644
@@ -47,7 +50,7 @@ index 1f0f18a7e75..26e3bb2b34b 100644
47 value in two words (with an imm instruction). No relocation is 50 value in two words (with an imm instruction). No relocation is
48 done here - only used for relaxing */ 51 done here - only used for relaxing */
49diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 52diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
50index 013c32a1e51..e36cd102bd2 100644 53index 013c32a1e51..7cf1b6eab5b 100644
51--- a/bfd/elf32-microblaze.c 54--- a/bfd/elf32-microblaze.c
52+++ b/bfd/elf32-microblaze.c 55+++ b/bfd/elf32-microblaze.c
53@@ -175,6 +175,20 @@ static reloc_howto_type microblaze_elf_howto_raw[] = 56@@ -175,6 +175,20 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
@@ -58,15 +61,15 @@ index 013c32a1e51..e36cd102bd2 100644
58+ 0, /* Rightshift. */ 61+ 0, /* Rightshift. */
59+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 62+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
60+ 32, /* Bitsize. */ 63+ 32, /* Bitsize. */
61+ TRUE, /* PC_relative. */ 64+ true, /* PC_relative. */
62+ 0, /* Bitpos. */ 65+ 0, /* Bitpos. */
63+ complain_overflow_bitfield, /* Complain on overflow. */ 66+ complain_overflow_bitfield, /* Complain on overflow. */
64+ NULL, /* Special Function. */ 67+ NULL, /* Special Function. */
65+ "R_MICROBLAZE_32_NONE",/* Name. */ 68+ "R_MICROBLAZE_32_NONE",/* Name. */
66+ FALSE, /* Partial Inplace. */ 69+ false, /* Partial Inplace. */
67+ 0, /* Source Mask. */ 70+ 0, /* Source Mask. */
68+ 0, /* Dest Mask. */ 71+ 0, /* Dest Mask. */
69+ FALSE), /* PC relative offset? */ 72+ false), /* PC relative offset? */
70+ 73+
71 HOWTO (R_MICROBLAZE_64_NONE, /* Type. */ 74 HOWTO (R_MICROBLAZE_64_NONE, /* Type. */
72 0, /* Rightshift. */ 75 0, /* Rightshift. */
@@ -83,7 +86,7 @@ index 013c32a1e51..e36cd102bd2 100644
83 microblaze_reloc = R_MICROBLAZE_64_NONE; 86 microblaze_reloc = R_MICROBLAZE_64_NONE;
84 break; 87 break;
85 case BFD_RELOC_32: 88 case BFD_RELOC_32:
86@@ -1954,14 +1971,22 @@ microblaze_elf_relax_section (bfd *abfd, 89@@ -1954,18 +1971,26 @@ microblaze_elf_relax_section (bfd *abfd,
87 } 90 }
88 break; 91 break;
89 case R_MICROBLAZE_NONE: 92 case R_MICROBLAZE_NONE:
@@ -92,20 +95,28 @@ index 013c32a1e51..e36cd102bd2 100644
92 /* This was a PC-relative instruction that was 95 /* This was a PC-relative instruction that was
93 completely resolved. */ 96 completely resolved. */
94 size_t sfix, efix; 97 size_t sfix, efix;
95+ unsigned int val; 98+ unsigned int val;
96 bfd_vma target_address; 99 bfd_vma target_address;
97 target_address = irel->r_addend + irel->r_offset; 100 target_address = irel->r_addend + irel->r_offset;
98 sfix = calc_fixup (irel->r_offset, 0, sec); 101 sfix = calc_fixup (irel->r_offset, 0, sec);
99 efix = calc_fixup (target_address, 0, sec); 102 efix = calc_fixup (target_address, 0, sec);
103- irel->r_addend -= (efix - sfix);
104- /* Should use HOWTO. */
105- microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset,
106- irel->r_addend);
100+ 107+
101+ /* Validate the in-band val. */ 108+ /* Validate the in-band val. */
102+ val = bfd_get_32 (abfd, contents + irel->r_offset); 109+ val = bfd_get_32 (abfd, contents + irel->r_offset);
103+ if (val != irel->r_addend && ELF32_R_TYPE (irel->r_info) == R_MICROBLAZE_32_NONE) { 110+ if (val != irel->r_addend && ELF32_R_TYPE (irel->r_info) == R_MICROBLAZE_32_NONE) {
104+ fprintf(stderr, "%d: CORRUPT relax reloc %x %lx\n", __LINE__, val, irel->r_addend); 111+ fprintf(stderr, "%d: CORRUPT relax reloc %x %lx\n", __LINE__, val, irel->r_addend);
105+ } 112+ }
106 irel->r_addend -= (efix - sfix); 113+ irel->r_addend -= (efix - sfix);
107 /* Should use HOWTO. */ 114+ /* Should use HOWTO. */
108 microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset, 115+ microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset,
116+ irel->r_addend);
117 }
118 break;
119 case R_MICROBLAZE_64_NONE:
109@@ -2009,30 +2034,73 @@ microblaze_elf_relax_section (bfd *abfd, 120@@ -2009,30 +2034,73 @@ microblaze_elf_relax_section (bfd *abfd,
110 irelscanend = irelocs + o->reloc_count; 121 irelscanend = irelocs + o->reloc_count;
111 for (irelscan = irelocs; irelscan < irelscanend; irelscan++) 122 for (irelscan = irelocs; irelscan < irelscanend; irelscan++)
@@ -295,5 +306,5 @@ index 43ad3ad3904..a2e1ce4580f 100644
295 306
296 /* Global base address names. */ 307 /* Global base address names. */
297-- 308--
2982.25.1 3092.37.1 (Apple Git-137.1)
299 310
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 ec2a898f..20dd1859 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,7 +1,7 @@
1From 318f98ea7f4271b3dd6e364d751415410a4076ac Mon Sep 17 00:00:00 2001 1From 5f27701e5c8bd1784e1c814fb527a1f8f7755ad9 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/34] upstream change to garbage collection sweep causes mb
5 regression 5 regression
6 6
7Upstream change for PR13177 now clears the def_regular during gc_sweep of a 7Upstream change for PR13177 now clears the def_regular during gc_sweep of a
@@ -21,7 +21,6 @@ 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>
25--- 24---
26 bfd/elflink.c | 1 - 25 bfd/elflink.c | 1 -
27 1 file changed, 1 deletion(-) 26 1 file changed, 1 deletion(-)
@@ -39,5 +38,5 @@ index 2b1450fa4e1..c50919060b3 100644
39 h->ref_regular_nonweak = 0; 38 h->ref_regular_nonweak = 0;
40 } 39 }
41-- 40--
422.25.1 412.37.1 (Apple Git-137.1)
43 42
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 5d42170b..68a5d684 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,21 +1,19 @@
1From 8cfdaf2c7c3b3e8572588e6749f688f6b702fe35 Mon Sep 17 00:00:00 2001 1From 63c56c953483dd62a2c2ac8e750947a4673f9e86 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/34] Fix bug in TLSTPREL Relocation
5 5
6Fixed the problem related to the fixup/relocations TLSTPREL. 6Fixed the problem related to the fixup/relocations TLSTPREL.
7When the fixup is applied the addend is not added at the correct offset 7When 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>
13--- 11---
14 bfd/elf32-microblaze.c | 4 ++-- 12 bfd/elf32-microblaze.c | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-) 13 1 file changed, 2 insertions(+), 2 deletions(-)
16 14
17diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 15diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
18index e36cd102bd2..c66f4ffef36 100644 16index 7cf1b6eab5b..edde04bafe4 100644
19--- a/bfd/elf32-microblaze.c 17--- a/bfd/elf32-microblaze.c
20+++ b/bfd/elf32-microblaze.c 18+++ b/bfd/elf32-microblaze.c
21@@ -1484,9 +1484,9 @@ microblaze_elf_relocate_section (bfd *output_bfd, 19@@ -1484,9 +1484,9 @@ microblaze_elf_relocate_section (bfd *output_bfd,
@@ -31,5 +29,5 @@ index e36cd102bd2..c66f4ffef36 100644
31 case (int) R_MICROBLAZE_TEXTREL_64: 29 case (int) R_MICROBLAZE_TEXTREL_64:
32 case (int) R_MICROBLAZE_TEXTREL_32_LO: 30 case (int) R_MICROBLAZE_TEXTREL_32_LO:
33-- 31--
342.25.1 322.37.1 (Apple Git-137.1)
35 33
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 b60c9085..ffaf6236 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,7 +1,7 @@
1From be2ecb2dd73901484995c39d6c7375be6b8dd545 Mon Sep 17 00:00:00 2001 1From 7e1cbc2f96a1905eecf3a211153735ed915a5ad5 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/34] Added Address extension instructions
5 5
6This patch adds the support of new instructions which are required 6This patch adds the support of new instructions which are required
7for supporting Address extension feature. 7for supporting Address extension feature.
@@ -18,8 +18,6 @@ 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>
23--- 21---
24 opcodes/microblaze-opc.h | 11 +++++++++++ 22 opcodes/microblaze-opc.h | 11 +++++++++++
25 opcodes/microblaze-opcm.h | 10 +++++----- 23 opcodes/microblaze-opcm.h | 10 +++++-----
@@ -99,5 +97,5 @@ index e56c1d2d47c..ad964560c17 100644
99 fcmp_lt, fcmp_eq, fcmp_le, fcmp_gt, fcmp_ne, fcmp_ge, fcmp_un, flt, 97 fcmp_lt, fcmp_eq, fcmp_le, fcmp_gt, fcmp_ne, fcmp_ge, fcmp_un, flt,
100 /* 'fsqrt' is a glibc:math.h symbol. */ 98 /* 'fsqrt' is a glibc:math.h symbol. */
101-- 99--
1022.25.1 1002.37.1 (Apple Git-137.1)
103 101
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0009-Add-new-bit-field-instructions.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0008-Add-new-bit-field-instructions.patch
index 85f0bfcf..3966566d 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0009-Add-new-bit-field-instructions.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0008-Add-new-bit-field-instructions.patch
@@ -1,7 +1,7 @@
1From 3f45718e99e09679472366a2c7e454c75f0383e3 Mon Sep 17 00:00:00 2001 1From c02813b6a27e6eed281609e5d696bb67ac74c804 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 08/34] Add new bit-field instructions
5 5
6This patches adds new bsefi and bsifi instructions. 6This patches adds new bsefi and bsifi instructions.
7BSEFI- The instruction shall extract a bit field from a 7BSEFI- The instruction shall extract a bit field from a
@@ -15,7 +15,10 @@ 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
19Conflicts:
20 gas/config/tc-microblaze.c
21 opcodes/microblaze-opc.h
19--- 22---
20 gas/config/tc-microblaze.c | 71 +++++++++++++++++++++++++++++++++++++- 23 gas/config/tc-microblaze.c | 71 +++++++++++++++++++++++++++++++++++++-
21 opcodes/microblaze-dis.c | 20 +++++++++-- 24 opcodes/microblaze-dis.c | 20 +++++++++--
@@ -152,7 +155,7 @@ index b057492ba93..f57b98fc9f7 100644
152 print_func (stream, "\t%s", get_field_rd (&buf, inst)); 155 print_func (stream, "\t%s", get_field_rd (&buf, inst));
153 break; 156 break;
154diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h 157diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
155index 3b3cdbe710c..825c639a41e 100644 158index d3f8e36199e..825c639a41e 100644
156--- a/opcodes/microblaze-opc.h 159--- a/opcodes/microblaze-opc.h
157+++ b/opcodes/microblaze-opc.h 160+++ b/opcodes/microblaze-opc.h
158@@ -59,6 +59,9 @@ 161@@ -59,6 +59,9 @@
@@ -179,7 +182,7 @@ index 3b3cdbe710c..825c639a41e 100644
179 #define DELAY_SLOT 1 182 #define DELAY_SLOT 1
180 #define NO_DELAY_SLOT 0 183 #define NO_DELAY_SLOT 0
181 184
182-#define MAX_OPCODES 299 185-#define MAX_OPCODES 291
183+#define MAX_OPCODES 301 186+#define MAX_OPCODES 301
184 187
185 const struct op_code_struct 188 const struct op_code_struct
@@ -234,5 +237,5 @@ index ad964560c17..aa3401610d9 100644
234 #define RFSL_MASK 0x000000F 237 #define RFSL_MASK 0x000000F
235 238
236-- 239--
2372.25.1 2402.37.1 (Apple Git-137.1)
238 241
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
deleted file mode 100644
index d6faee70..00000000
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0008-fixing-the-MAX_OPCODES-to-correct-value.patch
+++ /dev/null
@@ -1,26 +0,0 @@
1From ba9dde9e1068bb282bb0695d1159cd100bcae54f Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Thu, 28 Jan 2016 14:07:34 +0530
4Subject: [PATCH 08/38] fixing the MAX_OPCODES to correct value
5
6Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
7---
8 opcodes/microblaze-opc.h | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
12index d3f8e36199e..3b3cdbe710c 100644
13--- a/opcodes/microblaze-opc.h
14+++ b/opcodes/microblaze-opc.h
15@@ -102,7 +102,7 @@
16 #define DELAY_SLOT 1
17 #define NO_DELAY_SLOT 0
18
19-#define MAX_OPCODES 291
20+#define MAX_OPCODES 299
21
22 const struct op_code_struct
23 {
24--
252.25.1
26
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0011-fixed-bug-in-GCC-so-that-It-will-support-.long-0U-an.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0009-Patch-Microblaze-fixed-bug-in-GCC-so-that-It-will-su.patch
index 9ab38bbb..47caf9ed 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0011-fixed-bug-in-GCC-so-that-It-will-support-.long-0U-an.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0009-Patch-Microblaze-fixed-bug-in-GCC-so-that-It-will-su.patch
@@ -1,10 +1,9 @@
1From 6d52004e565699474956e8eaf4f11c32b1c2a64a Mon Sep 17 00:00:00 2001 1From 81fc7ef231ca2890dfa827b4e8f3d0da107f9be2 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] fixed bug in GCC so that It will support .long 0U and 4Subject: [PATCH 09/34] [Patch,Microblaze]: fixed bug in GCC so that It will
5 .long 0u 5 support .long 0U and .long 0u
6 6
7Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
8--- 7---
9 gas/expr.c | 9 +++++++++ 8 gas/expr.c | 9 +++++++++
10 1 file changed, 9 insertions(+) 9 1 file changed, 9 insertions(+)
@@ -30,5 +29,5 @@ index 6ad8bee2733..a1281ef71a8 100644
30 switch (c) 29 switch (c)
31 { 30 {
32-- 31--
332.25.1 322.37.1 (Apple Git-137.1)
34 33
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0012-fixing-the-constant-range-check-issue-sample-error-n.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0010-fixing-the-constant-range-check-issue.patch
index 9f296ab9..1b279f7e 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0012-fixing-the-constant-range-check-issue-sample-error-n.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0010-fixing-the-constant-range-check-issue.patch
@@ -1,10 +1,9 @@
1From 855b983d270911c35c52b181426e9771f0851979 Mon Sep 17 00:00:00 2001 1From adfa8ca9782799670d87d03a01414aca5d9cc9e5 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 10/34] 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>
8--- 7---
9 gas/config/tc-microblaze.c | 2 +- 8 gas/config/tc-microblaze.c | 2 +-
10 1 file changed, 1 insertion(+), 1 deletion(-) 9 1 file changed, 1 insertion(+), 1 deletion(-)
@@ -23,5 +22,5 @@ index 1cb9b2519c3..086f8704156 100644
23 as_fatal (_("operand must be absolute in range %lx..%lx, not %lx"), 22 as_fatal (_("operand must be absolute in range %lx..%lx, not %lx"),
24 (long) min, (long) max, (long) e->X_add_number); 23 (long) min, (long) max, (long) e->X_add_number);
25-- 24--
262.25.1 252.37.1 (Apple Git-137.1)
27 26
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0010-fixing-the-imm-bug.-with-relax-option-imm-1-is-also-.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0010-fixing-the-imm-bug.-with-relax-option-imm-1-is-also-.patch
deleted file mode 100644
index 7cde8147..00000000
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0010-fixing-the-imm-bug.-with-relax-option-imm-1-is-also-.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From 248b0c67ed37bdc2ab0ba1d2c42a4ce200bbc237 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Mon, 10 Jul 2017 16:07:28 +0530
4Subject: [PATCH 10/38] fixing the imm bug. with relax option imm -1 is also
5 getting removed this is corrected now.
6
7Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
8---
9 bfd/elf32-microblaze.c | 3 +--
10 1 file changed, 1 insertion(+), 2 deletions(-)
11
12diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
13index c66f4ffef36..8c89bdcaeeb 100644
14--- a/bfd/elf32-microblaze.c
15+++ b/bfd/elf32-microblaze.c
16@@ -1905,8 +1905,7 @@ microblaze_elf_relax_section (bfd *abfd,
17 else
18 symval += irel->r_addend;
19
20- if ((symval & 0xffff8000) == 0
21- || (symval & 0xffff8000) == 0xffff8000)
22+ if ((symval & 0xffff8000) == 0)
23 {
24 /* We can delete this instruction. */
25 sdata->relax[sdata->relax_count].addr = irel->r_offset;
26--
272.25.1
28
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0013-Compiler-will-give-error-messages-in-more-detail-for.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0011-Patch-Microblaze-Compiler-will-give-error-messages-i.patch
index e76ef442..81949e66 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0013-Compiler-will-give-error-messages-in-more-detail-for.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0011-Patch-Microblaze-Compiler-will-give-error-messages-i.patch
@@ -1,19 +1,18 @@
1From a1169180250097b012ed69e3181ea0b4e22ae022 Mon Sep 17 00:00:00 2001 1From 3efcb580af783ace64a9485af6bfee6dc18499ba 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] Compiler will give error messages in more detail for 4Subject: [PATCH 11/34] [Patch,Microblaze]: Compiler will give error messages
5 mxl-gp-opt flag.. 5 in more detail for mxl-gp-opt flag..
6 6
7Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
8--- 7---
9 ld/ldmain.c | 12 ++++++++++++ 8 ld/ldmain.c | 12 ++++++++++++
10 1 file changed, 12 insertions(+) 9 1 file changed, 12 insertions(+)
11 10
12diff --git a/ld/ldmain.c b/ld/ldmain.c 11diff --git a/ld/ldmain.c b/ld/ldmain.c
13index 545f6a0f31a..d4502e7f3b0 100644 12index ea72b14a301..4e63b8fdf3b 100644
14--- a/ld/ldmain.c 13--- a/ld/ldmain.c
15+++ b/ld/ldmain.c 14+++ b/ld/ldmain.c
16@@ -1566,6 +1566,18 @@ reloc_overflow (struct bfd_link_info *info, 15@@ -1564,6 +1564,18 @@ reloc_overflow (struct bfd_link_info *info,
17 break; 16 break;
18 case bfd_link_hash_defined: 17 case bfd_link_hash_defined:
19 case bfd_link_hash_defweak: 18 case bfd_link_hash_defweak:
@@ -33,5 +32,5 @@ index 545f6a0f31a..d4502e7f3b0 100644
33 "%s against symbol `%pT' defined in %pA section in %pB"), 32 "%s against symbol `%pT' defined in %pA section in %pB"),
34 reloc_name, entry->root.string, 33 reloc_name, entry->root.string,
35-- 34--
362.25.1 352.37.1 (Apple Git-137.1)
37 36
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0014-initial-support-for-MicroBlaze-64-bit-m64.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0012-Patch-MicroBlaze-initial-support-for-MicroBlaze-64-b.patch
index 90563dc5..e0166274 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0014-initial-support-for-MicroBlaze-64-bit-m64.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0012-Patch-MicroBlaze-initial-support-for-MicroBlaze-64-b.patch
@@ -1,9 +1,16 @@
1From fb0b2c799f37daba8aca5d64966f426d16e07cf8 Mon Sep 17 00:00:00 2001 1From 6d3b976c0f75225614d299faca766f9043bbd2d0 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] initial support for MicroBlaze 64 bit [-m64] 4Subject: [PATCH 12/34] [Patch,MicroBlaze] : initial support for MicroBlaze 64
5 bit [-m64]
5 6
6Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> 7Conflicts:
8 bfd/elf32-microblaze.c
9 include/elf/common.h
10 ld/Makefile.am
11 ld/Makefile.in
12signed-off-by:Nagaraju Mekala<nmekala@xilinx.com>
13 Mahesh Bodapati<mbodapat@xilinx.com>
7--- 14---
8 bfd/Makefile.am | 2 + 15 bfd/Makefile.am | 2 +
9 bfd/Makefile.in | 3 + 16 bfd/Makefile.in | 3 +
@@ -11,9 +18,9 @@ Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
11 bfd/config.bfd | 4 + 18 bfd/config.bfd | 4 +
12 bfd/configure | 2 + 19 bfd/configure | 2 +
13 bfd/configure.ac | 2 + 20 bfd/configure.ac | 2 +
14 bfd/cpu-microblaze.c | 55 +- 21 bfd/cpu-microblaze.c | 53 +-
15 bfd/elf32-microblaze.c | 65 +- 22 bfd/elf32-microblaze.c | 59 +-
16 bfd/elf64-microblaze.c | 3622 ++++++++++++++++++++++++++++ 23 bfd/elf64-microblaze.c | 3612 ++++++++++++++++++++++++++++
17 bfd/libbfd.h | 2 + 24 bfd/libbfd.h | 2 +
18 bfd/reloc.c | 12 + 25 bfd/reloc.c | 12 +
19 bfd/targets.c | 6 + 26 bfd/targets.c | 6 +
@@ -26,10 +33,10 @@ Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
26 ld/configure.tgt | 3 + 33 ld/configure.tgt | 3 +
27 ld/emulparams/elf64microblaze.sh | 23 + 34 ld/emulparams/elf64microblaze.sh | 23 +
28 ld/emulparams/elf64microblazeel.sh | 23 + 35 ld/emulparams/elf64microblazeel.sh | 23 +
29 opcodes/microblaze-dis.c | 35 +- 36 opcodes/microblaze-dis.c | 36 +-
30 opcodes/microblaze-opc.h | 162 +- 37 opcodes/microblaze-opc.h | 162 +-
31 opcodes/microblaze-opcm.h | 24 +- 38 opcodes/microblaze-opcm.h | 24 +-
32 24 files changed, 4422 insertions(+), 69 deletions(-) 39 24 files changed, 4408 insertions(+), 66 deletions(-)
33 create mode 100644 bfd/elf64-microblaze.c 40 create mode 100644 bfd/elf64-microblaze.c
34 create mode 100644 ld/emulparams/elf64microblaze.sh 41 create mode 100644 ld/emulparams/elf64microblaze.sh
35 create mode 100644 ld/emulparams/elf64microblazeel.sh 42 create mode 100644 ld/emulparams/elf64microblazeel.sh
@@ -55,10 +62,10 @@ index 670e0598f55..c76adec960a 100644
55 elf64-tilegx.c \ 62 elf64-tilegx.c \
56 elf64-x86-64.c \ 63 elf64-x86-64.c \
57diff --git a/bfd/Makefile.in b/bfd/Makefile.in 64diff --git a/bfd/Makefile.in b/bfd/Makefile.in
58index 6edacdfeb0e..e2721f43391 100644 65index a26f74d7199..b0420bd440f 100644
59--- a/bfd/Makefile.in 66--- a/bfd/Makefile.in
60+++ b/bfd/Makefile.in 67+++ b/bfd/Makefile.in
61@@ -1030,6 +1030,7 @@ BFD64_BACKENDS = \ 68@@ -1027,6 +1027,7 @@ BFD64_BACKENDS = \
62 elf64-riscv.lo \ 69 elf64-riscv.lo \
63 elfxx-riscv.lo \ 70 elfxx-riscv.lo \
64 elf64-s390.lo \ 71 elf64-s390.lo \
@@ -66,7 +73,7 @@ index 6edacdfeb0e..e2721f43391 100644
66 elf64-sparc.lo \ 73 elf64-sparc.lo \
67 elf64-tilegx.lo \ 74 elf64-tilegx.lo \
68 elf64-x86-64.lo \ 75 elf64-x86-64.lo \
69@@ -1067,6 +1068,7 @@ BFD64_BACKENDS_CFILES = \ 76@@ -1064,6 +1065,7 @@ BFD64_BACKENDS_CFILES = \
70 elf64-nfp.c \ 77 elf64-nfp.c \
71 elf64-ppc.c \ 78 elf64-ppc.c \
72 elf64-s390.c \ 79 elf64-s390.c \
@@ -74,7 +81,7 @@ index 6edacdfeb0e..e2721f43391 100644
74 elf64-sparc.c \ 81 elf64-sparc.c \
75 elf64-tilegx.c \ 82 elf64-tilegx.c \
76 elf64-x86-64.c \ 83 elf64-x86-64.c \
77@@ -1650,6 +1652,7 @@ distclean-compile: 84@@ -1647,6 +1649,7 @@ distclean-compile:
78 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-ppc.Plo@am__quote@ 85 @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@ 86 @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@ 87 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-s390.Plo@am__quote@
@@ -129,10 +136,10 @@ index a4c6c8e8854..49208534de3 100644
129 136
130 #ifdef BFD64 137 #ifdef BFD64
131diff --git a/bfd/configure b/bfd/configure 138diff --git a/bfd/configure b/bfd/configure
132index d90db11744b..08e33cf64cd 100755 139index 4f591b750d8..efeb1c2d717 100755
133--- a/bfd/configure 140--- a/bfd/configure
134+++ b/bfd/configure 141+++ b/bfd/configure
135@@ -14196,6 +14196,8 @@ do 142@@ -13546,6 +13546,8 @@ do
136 s390_elf64_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; 143 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 ;; 144 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 ;; 145 score_elf32_le_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo elf64.lo $elf"; want64=true; target_size=64 ;;
@@ -142,7 +149,7 @@ index d90db11744b..08e33cf64cd 100755
142 sh_coff_le_vec) tb="$tb coff-sh.lo $coff" ;; 149 sh_coff_le_vec) tb="$tb coff-sh.lo $coff" ;;
143 sh_coff_small_vec) tb="$tb coff-sh.lo $coff" ;; 150 sh_coff_small_vec) tb="$tb coff-sh.lo $coff" ;;
144diff --git a/bfd/configure.ac b/bfd/configure.ac 151diff --git a/bfd/configure.ac b/bfd/configure.ac
145index 73e5e03d016..20a50d0f308 100644 152index 6146efb5ae3..387a0af3703 100644
146--- a/bfd/configure.ac 153--- a/bfd/configure.ac
147+++ b/bfd/configure.ac 154+++ b/bfd/configure.ac
148@@ -603,6 +603,8 @@ do 155@@ -603,6 +603,8 @@ do
@@ -155,10 +162,10 @@ index 73e5e03d016..20a50d0f308 100644
155 sh_coff_le_vec) tb="$tb coff-sh.lo $coff" ;; 162 sh_coff_le_vec) tb="$tb coff-sh.lo $coff" ;;
156 sh_coff_small_vec) tb="$tb coff-sh.lo $coff" ;; 163 sh_coff_small_vec) tb="$tb coff-sh.lo $coff" ;;
157diff --git a/bfd/cpu-microblaze.c b/bfd/cpu-microblaze.c 164diff --git a/bfd/cpu-microblaze.c b/bfd/cpu-microblaze.c
158index 0c1d2b1aa69..f64f659cf44 100644 165index 0c1d2b1aa69..a9abb9166cc 100644
159--- a/bfd/cpu-microblaze.c 166--- a/bfd/cpu-microblaze.c
160+++ b/bfd/cpu-microblaze.c 167+++ b/bfd/cpu-microblaze.c
161@@ -23,7 +23,25 @@ 168@@ -23,7 +23,24 @@
162 #include "bfd.h" 169 #include "bfd.h"
163 #include "libbfd.h" 170 #include "libbfd.h"
164 171
@@ -177,35 +184,33 @@ index 0c1d2b1aa69..f64f659cf44 100644
177+ 3, /* Section align power. */ 184+ 3, /* Section align power. */
178+ false, /* Is this the default architecture ? */ 185+ false, /* Is this the default architecture ? */
179+ bfd_default_compatible, /* Architecture comparison function. */ 186+ bfd_default_compatible, /* Architecture comparison function. */
180+ bfd_default_scan, /* String to architecture conversion. */ 187+ bfd_default_scan, /* String to architecture conversion. */
181+ bfd_arch_default_fill, /* Default fill. */ 188+ bfd_arch_default_fill, /* Default fill. */
182+ &bfd_microblaze_arch[1], /* Next in list. */ 189+ &bfd_microblaze_arch[1] /* Next in list. */
183+ 0 /* Maximum offset of a reloc from the start of an insn. */
184+}, 190+},
185 { 191 {
186 32, /* Bits in a word. */ 192 32, /* Bits in a word. */
187 32, /* Bits in an address. */ 193 32, /* Bits in an address. */
188@@ -39,4 +57,39 @@ const bfd_arch_info_type bfd_microblaze_arch = 194@@ -39,4 +56,38 @@ const bfd_arch_info_type bfd_microblaze_arch =
189 bfd_arch_default_fill, /* Default fill. */ 195 bfd_arch_default_fill, /* Default fill. */
190 NULL, /* Next in list. */ 196 NULL, /* Next in list. */
191 0 /* Maximum offset of a reloc from the start of an insn. */ 197 0 /* Maximum offset of a reloc from the start of an insn. */
192+} 198+}
193+#else 199+#else
194+{ 200+{
195+ 32, /* 32 bits in a word. */ 201+ 32, /* 32 bits in a word. */
196+ 32, /* 32 bits in an address. */ 202+ 32, /* 32 bits in an address. */
197+ 8, /* 8 bits in a byte. */ 203+ 8, /* 8 bits in a byte. */
198+ bfd_arch_microblaze, /* Architecture. */ 204+ bfd_arch_microblaze, /* Architecture. */
199+ 0, /* Machine number - 0 for now. */ 205+ 0, /* Machine number - 0 for now. */
200+ "microblaze", /* Architecture name. */ 206+ "microblaze", /* Architecture name. */
201+ "MicroBlaze", /* Printable name. */ 207+ "MicroBlaze", /* Printable name. */
202+ 3, /* Section align power. */ 208+ 3, /* Section align power. */
203+ true, /* Is this the default architecture ? */ 209+ true, /* Is this the default architecture ? */
204+ bfd_default_compatible, /* Architecture comparison function. */ 210+ bfd_default_compatible, /* Architecture comparison function. */
205+ bfd_default_scan, /* String to architecture conversion. */ 211+ bfd_default_scan, /* String to architecture conversion. */
206+ bfd_arch_default_fill, /* Default fill. */ 212+ bfd_arch_default_fill, /* Default fill. */
207+ &bfd_microblaze_arch[1], /* Next in list. */ 213+ &bfd_microblaze_arch[1] /* Next in list. */
208+ 0 /* Maximum offset of a reloc from the start of an insn. */
209+}, 214+},
210+{ 215+{
211+ 64, /* 32 bits in a word. */ 216+ 64, /* 32 bits in a word. */
@@ -226,7 +231,7 @@ index 0c1d2b1aa69..f64f659cf44 100644
226+#endif 231+#endif
227 }; 232 };
228diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 233diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
229index 8c89bdcaeeb..71ff973573c 100644 234index edde04bafe4..f20adb6fd73 100644
230--- a/bfd/elf32-microblaze.c 235--- a/bfd/elf32-microblaze.c
231+++ b/bfd/elf32-microblaze.c 236+++ b/bfd/elf32-microblaze.c
232@@ -114,6 +114,20 @@ static reloc_howto_type microblaze_elf_howto_raw[] = 237@@ -114,6 +114,20 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
@@ -250,25 +255,6 @@ index 8c89bdcaeeb..71ff973573c 100644
250 /* A 64 bit relocation. Table entry not really used. */ 255 /* A 64 bit relocation. Table entry not really used. */
251 HOWTO (R_MICROBLAZE_64, /* Type. */ 256 HOWTO (R_MICROBLAZE_64, /* Type. */
252 0, /* Rightshift. */ 257 0, /* Rightshift. */
253@@ -179,15 +193,15 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
254 0, /* Rightshift. */
255 2, /* Size (0 = byte, 1 = short, 2 = long). */
256 32, /* Bitsize. */
257- TRUE, /* PC_relative. */
258+ false, /* PC_relative. */
259 0, /* Bitpos. */
260 complain_overflow_bitfield, /* Complain on overflow. */
261 NULL, /* Special Function. */
262 "R_MICROBLAZE_32_NONE",/* Name. */
263- FALSE, /* Partial Inplace. */
264+ false, /* Partial Inplace. */
265 0, /* Source Mask. */
266 0, /* Dest Mask. */
267- FALSE), /* PC relative offset? */
268+ false), /* PC relative offset? */
269
270 HOWTO (R_MICROBLAZE_64_NONE, /* Type. */
271 0, /* Rightshift. */
272@@ -278,6 +292,21 @@ static reloc_howto_type microblaze_elf_howto_raw[] = 258@@ -278,6 +292,21 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
273 0x0000ffff, /* Dest Mask. */ 259 0x0000ffff, /* Dest Mask. */
274 true), /* PC relative offset? */ 260 true), /* PC relative offset? */
@@ -316,7 +302,7 @@ index 8c89bdcaeeb..71ff973573c 100644
316 bfd_put_32 (input_bfd, relocation, contents + offset); 302 bfd_put_32 (input_bfd, relocation, contents + offset);
317 else 303 else
318 { 304 {
319@@ -1969,6 +2004,28 @@ microblaze_elf_relax_section (bfd *abfd, 305@@ -1970,6 +2005,28 @@ microblaze_elf_relax_section (bfd *abfd,
320 irel->r_addend -= calc_fixup (irel->r_addend, 0, sec); 306 irel->r_addend -= calc_fixup (irel->r_addend, 0, sec);
321 } 307 }
322 break; 308 break;
@@ -347,10 +333,10 @@ index 8c89bdcaeeb..71ff973573c 100644
347 { 333 {
348diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 334diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
349new file mode 100644 335new file mode 100644
350index 00000000000..7434bef393b 336index 00000000000..0faa8de73c8
351--- /dev/null 337--- /dev/null
352+++ b/bfd/elf64-microblaze.c 338+++ b/bfd/elf64-microblaze.c
353@@ -0,0 +1,3622 @@ 339@@ -0,0 +1,3612 @@
354+/* Xilinx MicroBlaze-specific support for 32-bit ELF 340+/* Xilinx MicroBlaze-specific support for 32-bit ELF
355+ 341+
356+ Copyright (C) 2009-2021 Free Software Foundation, Inc. 342+ Copyright (C) 2009-2021 Free Software Foundation, Inc.
@@ -394,80 +380,79 @@ index 00000000000..7434bef393b
394+{ 380+{
395+ /* This reloc does nothing. */ 381+ /* This reloc does nothing. */
396+ HOWTO (R_MICROBLAZE_NONE, /* Type. */ 382+ HOWTO (R_MICROBLAZE_NONE, /* Type. */
397+ 0, /* Rightshift. */ 383+ 0, /* Rightshift. */
398+ 3, /* Size (0 = byte, 1 = short, 2 = long). */ 384+ 0, /* Size. */
399+ 0, /* Bitsize. */ 385+ 0, /* Bitsize. */
400+ false, /* PC_relative. */ 386+ false, /* PC_relative. */
401+ 0, /* Bitpos. */ 387+ 0, /* Bitpos. */
402+ complain_overflow_dont, /* Complain on overflow. */ 388+ complain_overflow_dont, /* Complain on overflow. */
403+ NULL, /* Special Function. */ 389+ NULL, /* Special Function. */
404+ "R_MICROBLAZE_NONE", /* Name. */ 390+ "R_MICROBLAZE_NONE", /* Name. */
405+ false, /* Partial Inplace. */ 391+ false, /* Partial Inplace. */
406+ 0, /* Source Mask. */ 392+ 0, /* Source Mask. */
407+ 0, /* Dest Mask. */ 393+ 0, /* Dest Mask. */
408+ false), /* PC relative offset? */ 394+ false), /* PC relative offset? */
409+ 395+
410+ /* A standard 32 bit relocation. */ 396+ /* A standard 32 bit relocation. */
411+ HOWTO (R_MICROBLAZE_32, /* Type. */ 397+ HOWTO (R_MICROBLAZE_32, /* Type. */
412+ 0, /* Rightshift. */ 398+ 0, /* Rightshift. */
413+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 399+ 4, /* Size. */
414+ 32, /* Bitsize. */ 400+ 32, /* Bitsize. */
415+ false, /* PC_relative. */ 401+ false, /* PC_relative. */
416+ 0, /* Bitpos. */ 402+ 0, /* Bitpos. */
417+ complain_overflow_bitfield, /* Complain on overflow. */ 403+ complain_overflow_bitfield, /* Complain on overflow. */
418+ bfd_elf_generic_reloc,/* Special Function. */ 404+ bfd_elf_generic_reloc,/* Special Function. */
419+ "R_MICROBLAZE_32", /* Name. */ 405+ "R_MICROBLAZE_32", /* Name. */
420+ false, /* Partial Inplace. */ 406+ false, /* Partial Inplace. */
421+ 0, /* Source Mask. */ 407+ 0, /* Source Mask. */
422+ 0xffffffff, /* Dest Mask. */ 408+ 0xffffffff, /* Dest Mask. */
423+ false), /* PC relative offset? */ 409+ false), /* PC relative offset? */
424+ 410+
425+ /* A standard PCREL 32 bit relocation. */ 411+ /* A standard PCREL 32 bit relocation. */
426+ HOWTO (R_MICROBLAZE_32_PCREL,/* Type. */ 412+ HOWTO (R_MICROBLAZE_32_PCREL,/* Type. */
427+ 0, /* Rightshift. */ 413+ 0, /* Rightshift. */
428+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 414+ 4, /* Size. */
429+ 32, /* Bitsize. */ 415+ 32, /* Bitsize. */
430+ true, /* PC_relative. */ 416+ true, /* PC_relative. */
431+ 0, /* Bitpos. */ 417+ 0, /* Bitpos. */
432+ complain_overflow_bitfield, /* Complain on overflow. */ 418+ complain_overflow_bitfield, /* Complain on overflow. */
433+ bfd_elf_generic_reloc,/* Special Function. */ 419+ bfd_elf_generic_reloc,/* Special Function. */
434+ "R_MICROBLAZE_32_PCREL", /* Name. */ 420+ "R_MICROBLAZE_32_PCREL", /* Name. */
435+ true, /* Partial Inplace. */ 421+ true, /* Partial Inplace. */
436+ 0, /* Source Mask. */ 422+ 0, /* Source Mask. */
437+ 0xffffffff, /* Dest Mask. */ 423+ 0xffffffff, /* Dest Mask. */
438+ true), /* PC relative offset? */ 424+ true), /* PC relative offset? */
439+ 425+
440+ /* A 64 bit PCREL relocation. Table-entry not really used. */ 426+ /* A 64 bit PCREL relocation. Table-entry not really used. */
441+ HOWTO (R_MICROBLAZE_64_PCREL,/* Type. */ 427+ HOWTO (R_MICROBLAZE_64_PCREL,/* Type. */
442+ 0, /* Rightshift. */ 428+ 0, /* Rightshift. */
443+ 4, /* Size (0 = byte, 1 = short, 2 = long). */ 429+ 4, /* Size. */
444+ 64, /* Bitsize. */ 430+ 16, /* Bitsize. */
445+ true, /* PC_relative. */ 431+ true, /* PC_relative. */
446+ 0, /* Bitpos. */ 432+ 0, /* Bitpos. */
447+ complain_overflow_dont, /* Complain on overflow. */ 433+ complain_overflow_dont, /* Complain on overflow. */
448+ bfd_elf_generic_reloc,/* Special Function. */ 434+ bfd_elf_generic_reloc,/* Special Function. */
449+ "R_MICROBLAZE_64_PCREL", /* Name. */ 435+ "R_MICROBLAZE_64_PCREL", /* Name. */
450+ false, /* Partial Inplace. */ 436+ false, /* Partial Inplace. */
451+ 0, /* Source Mask. */ 437+ 0, /* Source Mask. */
452+ 0x0000ffff, /* Dest Mask. */ 438+ 0x0000ffff, /* Dest Mask. */
453+ true), /* PC relative offset? */ 439+ true), /* PC relative offset? */
454+ 440+
455+ /* The low half of a PCREL 32 bit relocation. */ 441+ /* The low half of a PCREL 32 bit relocation. */
456+ HOWTO (R_MICROBLAZE_32_PCREL_LO, /* Type. */ 442+ HOWTO (R_MICROBLAZE_32_PCREL_LO, /* Type. */
457+ 0, /* Rightshift. */ 443+ 0, /* Rightshift. */
458+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 444+ 4, /* Size. */
459+ 16, /* Bitsize. */ 445+ 16, /* Bitsize. */
460+ true, /* PC_relative. */ 446+ true, /* PC_relative. */
461+ 0, /* Bitpos. */ 447+ 0, /* Bitpos. */
462+ complain_overflow_signed, /* Complain on overflow. */ 448+ complain_overflow_signed, /* Complain on overflow. */
463+ bfd_elf_generic_reloc, /* Special Function. */ 449+ bfd_elf_generic_reloc, /* Special Function. */
464+ "R_MICROBLAZE_32_PCREL_LO", /* Name. */ 450+ "R_MICROBLAZE_32_PCREL_LO", /* Name. */
465+ false, /* Partial Inplace. */ 451+ false, /* Partial Inplace. */
466+ 0, /* Source Mask. */ 452+ 0, /* Source Mask. */
467+ 0x0000ffff, /* Dest Mask. */ 453+ 0x0000ffff, /* Dest Mask. */
468+ true), /* PC relative offset? */ 454+ true), /* PC relative offset? */
469+ 455+
470+ /* A 64 bit relocation. Table entry not really used. */
471+ HOWTO (R_MICROBLAZE_IMML_64, /* Type. */ 456+ HOWTO (R_MICROBLAZE_IMML_64, /* Type. */
472+ 0, /* Rightshift. */ 457+ 0, /* Rightshift. */
473+ 4, /* Size (0 = byte, 1 = short, 2 = long). */ 458+ 4, /* Size (0 = byte, 1 = short, 2 = long). */
@@ -480,7 +465,7 @@ index 00000000000..7434bef393b
480+ false, /* Partial Inplace. */ 465+ false, /* Partial Inplace. */
481+ 0, /* Source Mask. */ 466+ 0, /* Source Mask. */
482+ 0x0000ffff, /* Dest Mask. */ 467+ 0x0000ffff, /* Dest Mask. */
483+ true), /* PC relative offset? */ 468+ false), /* PC relative offset? */
484+ 469+
485+ /* A 64 bit relocation. Table entry not really used. */ 470+ /* A 64 bit relocation. Table entry not really used. */
486+ HOWTO (R_MICROBLAZE_64, /* Type. */ 471+ HOWTO (R_MICROBLAZE_64, /* Type. */
@@ -498,139 +483,139 @@ index 00000000000..7434bef393b
498+ false), /* PC relative offset? */ 483+ false), /* PC relative offset? */
499+ 484+
500+ /* The low half of a 32 bit relocation. */ 485+ /* The low half of a 32 bit relocation. */
501+ HOWTO (R_MICROBLAZE_32_LO, /* Type. */ 486+ HOWTO (R_MICROBLAZE_32_LO, /* Type. */
502+ 0, /* Rightshift. */ 487+ 0, /* Rightshift. */
503+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 488+ 4, /* Size. */
504+ 16, /* Bitsize. */ 489+ 16, /* Bitsize. */
505+ false, /* PC_relative. */ 490+ false, /* PC_relative. */
506+ 0, /* Bitpos. */ 491+ 0, /* Bitpos. */
507+ complain_overflow_signed, /* Complain on overflow. */ 492+ complain_overflow_signed, /* Complain on overflow. */
508+ bfd_elf_generic_reloc,/* Special Function. */ 493+ bfd_elf_generic_reloc,/* Special Function. */
509+ "R_MICROBLAZE_32_LO", /* Name. */ 494+ "R_MICROBLAZE_32_LO", /* Name. */
510+ false, /* Partial Inplace. */ 495+ false, /* Partial Inplace. */
511+ 0, /* Source Mask. */ 496+ 0, /* Source Mask. */
512+ 0x0000ffff, /* Dest Mask. */ 497+ 0x0000ffff, /* Dest Mask. */
513+ false), /* PC relative offset? */ 498+ false), /* PC relative offset? */
514+ 499+
515+ /* Read-only small data section relocation. */ 500+ /* Read-only small data section relocation. */
516+ HOWTO (R_MICROBLAZE_SRO32, /* Type. */ 501+ HOWTO (R_MICROBLAZE_SRO32, /* Type. */
517+ 0, /* Rightshift. */ 502+ 0, /* Rightshift. */
518+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 503+ 4, /* Size. */
519+ 16, /* Bitsize. */ 504+ 16, /* Bitsize. */
520+ false, /* PC_relative. */ 505+ false, /* PC_relative. */
521+ 0, /* Bitpos. */ 506+ 0, /* Bitpos. */
522+ complain_overflow_bitfield, /* Complain on overflow. */ 507+ complain_overflow_bitfield, /* Complain on overflow. */
523+ bfd_elf_generic_reloc,/* Special Function. */ 508+ bfd_elf_generic_reloc,/* Special Function. */
524+ "R_MICROBLAZE_SRO32", /* Name. */ 509+ "R_MICROBLAZE_SRO32", /* Name. */
525+ false, /* Partial Inplace. */ 510+ false, /* Partial Inplace. */
526+ 0, /* Source Mask. */ 511+ 0, /* Source Mask. */
527+ 0x0000ffff, /* Dest Mask. */ 512+ 0x0000ffff, /* Dest Mask. */
528+ false), /* PC relative offset? */ 513+ false), /* PC relative offset? */
529+ 514+
530+ /* Read-write small data area relocation. */ 515+ /* Read-write small data area relocation. */
531+ HOWTO (R_MICROBLAZE_SRW32, /* Type. */ 516+ HOWTO (R_MICROBLAZE_SRW32, /* Type. */
517+ 0, /* Rightshift. */
518+ 4, /* Size. */
519+ 16, /* Bitsize. */
520+ false, /* PC_relative. */
521+ 0, /* Bitpos. */
522+ complain_overflow_bitfield, /* Complain on overflow. */
523+ bfd_elf_generic_reloc,/* Special Function. */
524+ "R_MICROBLAZE_SRW32", /* Name. */
525+ false, /* Partial Inplace. */
526+ 0, /* Source Mask. */
527+ 0x0000ffff, /* Dest Mask. */
528+ false), /* PC relative offset? */
529+
530+ /* This reloc does nothing. Used for relaxation. */
531+ HOWTO (R_MICROBLAZE_32_NONE, /* Type. */
532+ 0, /* Rightshift. */ 532+ 0, /* Rightshift. */
533+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 533+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
534+ 16, /* Bitsize. */ 534+ 32, /* Bitsize. */
535+ false, /* PC_relative. */ 535+ true, /* PC_relative. */
536+ 0, /* Bitpos. */ 536+ 0, /* Bitpos. */
537+ complain_overflow_bitfield, /* Complain on overflow. */
538+ bfd_elf_generic_reloc,/* Special Function. */
539+ "R_MICROBLAZE_SRW32", /* Name. */
540+ false, /* Partial Inplace. */
541+ 0, /* Source Mask. */
542+ 0x0000ffff, /* Dest Mask. */
543+ false), /* PC relative offset? */
544+
545+ HOWTO (R_MICROBLAZE_32_NONE, /* Type. */
546+ 0, /* Rightshift. */
547+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
548+ 32, /* Bitsize. */
549+ true, /* PC_relative. */
550+ 0, /* Bitpos. */
551+ complain_overflow_bitfield, /* Complain on overflow. */ 537+ complain_overflow_bitfield, /* Complain on overflow. */
552+ NULL, /* Special Function. */ 538+ NULL, /* Special Function. */
553+ "R_MICROBLAZE_32_NONE",/* Name. */ 539+ "R_MICROBLAZE_32_NONE",/* Name. */
554+ false, /* Partial Inplace. */
555+ 0, /* Source Mask. */
556+ 0, /* Dest Mask. */
557+ false), /* PC relative offset? */
558+
559+ /* This reloc does nothing. Used for relaxation. */
560+ HOWTO (R_MICROBLAZE_64_NONE, /* Type. */
561+ 0, /* Rightshift. */
562+ 3, /* Size (0 = byte, 1 = short, 2 = long). */
563+ 0, /* Bitsize. */
564+ true, /* PC_relative. */
565+ 0, /* Bitpos. */
566+ complain_overflow_dont, /* Complain on overflow. */
567+ NULL, /* Special Function. */
568+ "R_MICROBLAZE_64_NONE",/* Name. */
569+ false, /* Partial Inplace. */ 540+ false, /* Partial Inplace. */
570+ 0, /* Source Mask. */ 541+ 0, /* Source Mask. */
571+ 0, /* Dest Mask. */ 542+ 0, /* Dest Mask. */
572+ false), /* PC relative offset? */ 543+ false), /* PC relative offset? */
573+ 544+
545+ /* This reloc does nothing. Used for relaxation. */
546+ HOWTO (R_MICROBLAZE_64_NONE, /* Type. */
547+ 0, /* Rightshift. */
548+ 0, /* Size. */
549+ 0, /* Bitsize. */
550+ true, /* PC_relative. */
551+ 0, /* Bitpos. */
552+ complain_overflow_dont, /* Complain on overflow. */
553+ NULL, /* Special Function. */
554+ "R_MICROBLAZE_64_NONE",/* Name. */
555+ false, /* Partial Inplace. */
556+ 0, /* Source Mask. */
557+ 0, /* Dest Mask. */
558+ false), /* PC relative offset? */
559+
574+ /* Symbol Op Symbol relocation. */ 560+ /* Symbol Op Symbol relocation. */
575+ HOWTO (R_MICROBLAZE_32_SYM_OP_SYM, /* Type. */ 561+ HOWTO (R_MICROBLAZE_32_SYM_OP_SYM, /* Type. */
576+ 0, /* Rightshift. */ 562+ 0, /* Rightshift. */
577+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 563+ 4, /* Size. */
578+ 32, /* Bitsize. */ 564+ 32, /* Bitsize. */
579+ false, /* PC_relative. */ 565+ false, /* PC_relative. */
580+ 0, /* Bitpos. */ 566+ 0, /* Bitpos. */
581+ complain_overflow_bitfield, /* Complain on overflow. */ 567+ complain_overflow_bitfield, /* Complain on overflow. */
582+ bfd_elf_generic_reloc,/* Special Function. */ 568+ bfd_elf_generic_reloc,/* Special Function. */
583+ "R_MICROBLAZE_32_SYM_OP_SYM", /* Name. */ 569+ "R_MICROBLAZE_32_SYM_OP_SYM", /* Name. */
584+ false, /* Partial Inplace. */ 570+ false, /* Partial Inplace. */
585+ 0, /* Source Mask. */ 571+ 0, /* Source Mask. */
586+ 0xffffffff, /* Dest Mask. */ 572+ 0xffffffff, /* Dest Mask. */
587+ false), /* PC relative offset? */ 573+ false), /* PC relative offset? */
588+ 574+
589+ /* GNU extension to record C++ vtable hierarchy. */ 575+ /* GNU extension to record C++ vtable hierarchy. */
590+ HOWTO (R_MICROBLAZE_GNU_VTINHERIT, /* Type. */ 576+ HOWTO (R_MICROBLAZE_GNU_VTINHERIT, /* Type. */
591+ 0, /* Rightshift. */ 577+ 0, /* Rightshift. */
592+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 578+ 4, /* Size. */
593+ 0, /* Bitsize. */ 579+ 0, /* Bitsize. */
594+ false, /* PC_relative. */ 580+ false, /* PC_relative. */
595+ 0, /* Bitpos. */ 581+ 0, /* Bitpos. */
596+ complain_overflow_dont,/* Complain on overflow. */ 582+ complain_overflow_dont,/* Complain on overflow. */
597+ NULL, /* Special Function. */ 583+ NULL, /* Special Function. */
598+ "R_MICROBLAZE_GNU_VTINHERIT", /* Name. */ 584+ "R_MICROBLAZE_GNU_VTINHERIT", /* Name. */
599+ false, /* Partial Inplace. */ 585+ false, /* Partial Inplace. */
600+ 0, /* Source Mask. */ 586+ 0, /* Source Mask. */
601+ 0, 587+ 0, /* Dest Mask. */
602+ /* Dest Mask. */ 588+ false), /* PC relative offset? */
603+ false), /* PC relative offset? */
604+ 589+
605+ /* GNU extension to record C++ vtable member usage. */ 590+ /* GNU extension to record C++ vtable member usage. */
606+ HOWTO (R_MICROBLAZE_GNU_VTENTRY, /* Type. */ 591+ HOWTO (R_MICROBLAZE_GNU_VTENTRY, /* Type. */
607+ 0, /* Rightshift. */ 592+ 0, /* Rightshift. */
608+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 593+ 4, /* Size. */
609+ 0, /* Bitsize. */ 594+ 0, /* Bitsize. */
610+ false, /* PC_relative. */ 595+ false, /* PC_relative. */
611+ 0, /* Bitpos. */ 596+ 0, /* Bitpos. */
612+ complain_overflow_dont,/* Complain on overflow. */ 597+ complain_overflow_dont,/* Complain on overflow. */
613+ _bfd_elf_rel_vtable_reloc_fn, /* Special Function. */ 598+ _bfd_elf_rel_vtable_reloc_fn, /* Special Function. */
614+ "R_MICROBLAZE_GNU_VTENTRY", /* Name. */ 599+ "R_MICROBLAZE_GNU_VTENTRY", /* Name. */
615+ false, /* Partial Inplace. */ 600+ false, /* Partial Inplace. */
616+ 0, /* Source Mask. */ 601+ 0, /* Source Mask. */
617+ 0, /* Dest Mask. */ 602+ 0, /* Dest Mask. */
618+ false), /* PC relative offset? */ 603+ false), /* PC relative offset? */
619+ 604+
620+ /* A 64 bit GOTPC relocation. Table-entry not really used. */ 605+ /* A 64 bit GOTPC relocation. Table-entry not really used. */
621+ HOWTO (R_MICROBLAZE_GOTPC_64, /* Type. */ 606+ HOWTO (R_MICROBLAZE_GOTPC_64, /* Type. */
622+ 0, /* Rightshift. */ 607+ 0, /* Rightshift. */
623+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 608+ 4, /* Size. */
624+ 16, /* Bitsize. */ 609+ 16, /* Bitsize. */
625+ true, /* PC_relative. */ 610+ true, /* PC_relative. */
626+ 0, /* Bitpos. */ 611+ 0, /* Bitpos. */
627+ complain_overflow_dont, /* Complain on overflow. */ 612+ complain_overflow_dont, /* Complain on overflow. */
628+ bfd_elf_generic_reloc, /* Special Function. */ 613+ bfd_elf_generic_reloc, /* Special Function. */
629+ "R_MICROBLAZE_GOTPC_64", /* Name. */ 614+ "R_MICROBLAZE_GOTPC_64", /* Name. */
630+ false, /* Partial Inplace. */ 615+ false, /* Partial Inplace. */
631+ 0, /* Source Mask. */ 616+ 0, /* Source Mask. */
632+ 0x0000ffff, /* Dest Mask. */ 617+ 0x0000ffff, /* Dest Mask. */
633+ true), /* PC relative offset? */ 618+ true), /* PC relative offset? */
634+ 619+
635+ /* A 64 bit TEXTPCREL relocation. Table-entry not really used. */ 620+ /* A 64 bit TEXTPCREL relocation. Table-entry not really used. */
636+ HOWTO (R_MICROBLAZE_TEXTPCREL_64, /* Type. */ 621+ HOWTO (R_MICROBLAZE_TEXTPCREL_64, /* Type. */
@@ -694,108 +679,108 @@ index 00000000000..7434bef393b
694+ 679+
695+ /* A 64 bit PLT relocation. Table-entry not really used. */ 680+ /* A 64 bit PLT relocation. Table-entry not really used. */
696+ HOWTO (R_MICROBLAZE_PLT_64, /* Type. */ 681+ HOWTO (R_MICROBLAZE_PLT_64, /* Type. */
697+ 0, /* Rightshift. */ 682+ 0, /* Rightshift. */
698+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 683+ 4, /* Size. */
699+ 16, /* Bitsize. */ 684+ 16, /* Bitsize. */
700+ true, /* PC_relative. */ 685+ true, /* PC_relative. */
701+ 0, /* Bitpos. */ 686+ 0, /* Bitpos. */
702+ complain_overflow_dont, /* Complain on overflow. */ 687+ complain_overflow_dont, /* Complain on overflow. */
703+ bfd_elf_generic_reloc,/* Special Function. */ 688+ bfd_elf_generic_reloc,/* Special Function. */
704+ "R_MICROBLAZE_PLT_64",/* Name. */ 689+ "R_MICROBLAZE_PLT_64",/* Name. */
705+ false, /* Partial Inplace. */ 690+ false, /* Partial Inplace. */
706+ 0, /* Source Mask. */ 691+ 0, /* Source Mask. */
707+ 0x0000ffff, /* Dest Mask. */ 692+ 0x0000ffff, /* Dest Mask. */
708+ true), /* PC relative offset? */ 693+ true), /* PC relative offset? */
709+ 694+
710+ /* Table-entry not really used. */ 695+ /* Table-entry not really used. */
711+ HOWTO (R_MICROBLAZE_REL, /* Type. */ 696+ HOWTO (R_MICROBLAZE_REL, /* Type. */
712+ 0, /* Rightshift. */ 697+ 0, /* Rightshift. */
713+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 698+ 4, /* Size. */
714+ 16, /* Bitsize. */ 699+ 16, /* Bitsize. */
715+ true, /* PC_relative. */ 700+ true, /* PC_relative. */
716+ 0, /* Bitpos. */ 701+ 0, /* Bitpos. */
717+ complain_overflow_dont, /* Complain on overflow. */ 702+ complain_overflow_dont, /* Complain on overflow. */
718+ bfd_elf_generic_reloc,/* Special Function. */ 703+ bfd_elf_generic_reloc,/* Special Function. */
719+ "R_MICROBLAZE_REL", /* Name. */ 704+ "R_MICROBLAZE_REL", /* Name. */
720+ false, /* Partial Inplace. */ 705+ false, /* Partial Inplace. */
721+ 0, /* Source Mask. */ 706+ 0, /* Source Mask. */
722+ 0x0000ffff, /* Dest Mask. */ 707+ 0x0000ffff, /* Dest Mask. */
723+ true), /* PC relative offset? */ 708+ true), /* PC relative offset? */
724+ 709+
725+ /* Table-entry not really used. */ 710+ /* Table-entry not really used. */
726+ HOWTO (R_MICROBLAZE_JUMP_SLOT,/* Type. */ 711+ HOWTO (R_MICROBLAZE_JUMP_SLOT,/* Type. */
727+ 0, /* Rightshift. */ 712+ 0, /* Rightshift. */
728+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 713+ 4, /* Size. */
729+ 16, /* Bitsize. */ 714+ 16, /* Bitsize. */
730+ true, /* PC_relative. */ 715+ true, /* PC_relative. */
731+ 0, /* Bitpos. */ 716+ 0, /* Bitpos. */
732+ complain_overflow_dont, /* Complain on overflow. */ 717+ complain_overflow_dont, /* Complain on overflow. */
733+ bfd_elf_generic_reloc,/* Special Function. */ 718+ bfd_elf_generic_reloc,/* Special Function. */
734+ "R_MICROBLAZE_JUMP_SLOT", /* Name. */ 719+ "R_MICROBLAZE_JUMP_SLOT", /* Name. */
735+ false, /* Partial Inplace. */ 720+ false, /* Partial Inplace. */
736+ 0, /* Source Mask. */ 721+ 0, /* Source Mask. */
737+ 0x0000ffff, /* Dest Mask. */ 722+ 0x0000ffff, /* Dest Mask. */
738+ true), /* PC relative offset? */ 723+ true), /* PC relative offset? */
739+ 724+
740+ /* Table-entry not really used. */ 725+ /* Table-entry not really used. */
741+ HOWTO (R_MICROBLAZE_GLOB_DAT,/* Type. */ 726+ HOWTO (R_MICROBLAZE_GLOB_DAT,/* Type. */
742+ 0, /* Rightshift. */ 727+ 0, /* Rightshift. */
743+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 728+ 4, /* Size. */
744+ 16, /* Bitsize. */ 729+ 16, /* Bitsize. */
745+ true, /* PC_relative. */ 730+ true, /* PC_relative. */
746+ 0, /* Bitpos. */ 731+ 0, /* Bitpos. */
747+ complain_overflow_dont, /* Complain on overflow. */ 732+ complain_overflow_dont, /* Complain on overflow. */
748+ bfd_elf_generic_reloc,/* Special Function. */ 733+ bfd_elf_generic_reloc,/* Special Function. */
749+ "R_MICROBLAZE_GLOB_DAT", /* Name. */ 734+ "R_MICROBLAZE_GLOB_DAT", /* Name. */
750+ false, /* Partial Inplace. */ 735+ false, /* Partial Inplace. */
751+ 0, /* Source Mask. */ 736+ 0, /* Source Mask. */
752+ 0x0000ffff, /* Dest Mask. */ 737+ 0x0000ffff, /* Dest Mask. */
753+ true), /* PC relative offset? */ 738+ true), /* PC relative offset? */
754+ 739+
755+ /* A 64 bit GOT relative relocation. Table-entry not really used. */ 740+ /* A 64 bit GOT relative relocation. Table-entry not really used. */
756+ HOWTO (R_MICROBLAZE_GOTOFF_64, /* Type. */ 741+ HOWTO (R_MICROBLAZE_GOTOFF_64, /* Type. */
757+ 0, /* Rightshift. */ 742+ 0, /* Rightshift. */
758+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 743+ 4, /* Size. */
759+ 16, /* Bitsize. */ 744+ 16, /* Bitsize. */
760+ false, /* PC_relative. */ 745+ false, /* PC_relative. */
761+ 0, /* Bitpos. */ 746+ 0, /* Bitpos. */
762+ complain_overflow_dont, /* Complain on overflow. */ 747+ complain_overflow_dont, /* Complain on overflow. */
763+ bfd_elf_generic_reloc,/* Special Function. */ 748+ bfd_elf_generic_reloc,/* Special Function. */
764+ "R_MICROBLAZE_GOTOFF_64", /* Name. */ 749+ "R_MICROBLAZE_GOTOFF_64", /* Name. */
765+ false, /* Partial Inplace. */ 750+ false, /* Partial Inplace. */
766+ 0, /* Source Mask. */ 751+ 0, /* Source Mask. */
767+ 0x0000ffff, /* Dest Mask. */ 752+ 0x0000ffff, /* Dest Mask. */
768+ false), /* PC relative offset? */ 753+ false), /* PC relative offset? */
769+ 754+
770+ /* A 32 bit GOT relative relocation. Table-entry not really used. */ 755+ /* A 32 bit GOT relative relocation. Table-entry not really used. */
771+ HOWTO (R_MICROBLAZE_GOTOFF_32, /* Type. */ 756+ HOWTO (R_MICROBLAZE_GOTOFF_32, /* Type. */
772+ 0, /* Rightshift. */ 757+ 0, /* Rightshift. */
773+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 758+ 4, /* Size. */
774+ 16, /* Bitsize. */ 759+ 16, /* Bitsize. */
775+ false, /* PC_relative. */ 760+ false, /* PC_relative. */
776+ 0, /* Bitpos. */ 761+ 0, /* Bitpos. */
777+ complain_overflow_dont, /* Complain on overflow. */ 762+ complain_overflow_dont, /* Complain on overflow. */
778+ bfd_elf_generic_reloc, /* Special Function. */ 763+ bfd_elf_generic_reloc, /* Special Function. */
779+ "R_MICROBLAZE_GOTOFF_32", /* Name. */ 764+ "R_MICROBLAZE_GOTOFF_32", /* Name. */
780+ false, /* Partial Inplace. */ 765+ false, /* Partial Inplace. */
781+ 0, /* Source Mask. */ 766+ 0, /* Source Mask. */
782+ 0x0000ffff, /* Dest Mask. */ 767+ 0x0000ffff, /* Dest Mask. */
783+ false), /* PC relative offset? */ 768+ false), /* PC relative offset? */
784+ 769+
785+ /* COPY relocation. Table-entry not really used. */ 770+ /* COPY relocation. Table-entry not really used. */
786+ HOWTO (R_MICROBLAZE_COPY, /* Type. */ 771+ HOWTO (R_MICROBLAZE_COPY, /* Type. */
787+ 0, /* Rightshift. */ 772+ 0, /* Rightshift. */
788+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ 773+ 4, /* Size. */
789+ 16, /* Bitsize. */ 774+ 16, /* Bitsize. */
790+ false, /* PC_relative. */ 775+ false, /* PC_relative. */
791+ 0, /* Bitpos. */ 776+ 0, /* Bitpos. */
792+ complain_overflow_dont, /* Complain on overflow. */ 777+ complain_overflow_dont, /* Complain on overflow. */
793+ bfd_elf_generic_reloc,/* Special Function. */ 778+ bfd_elf_generic_reloc,/* Special Function. */
794+ "R_MICROBLAZE_COPY", /* Name. */ 779+ "R_MICROBLAZE_COPY", /* Name. */
795+ false, /* Partial Inplace. */ 780+ false, /* Partial Inplace. */
796+ 0, /* Source Mask. */ 781+ 0, /* Source Mask. */
797+ 0x0000ffff, /* Dest Mask. */ 782+ 0x0000ffff, /* Dest Mask. */
798+ false), /* PC relative offset? */ 783+ false), /* PC relative offset? */
799+ 784+
800+ /* Marker relocs for TLS. */ 785+ /* Marker relocs for TLS. */
801+ HOWTO (R_MICROBLAZE_TLS, 786+ HOWTO (R_MICROBLAZE_TLS,
@@ -814,7 +799,7 @@ index 00000000000..7434bef393b
814+ 799+
815+ HOWTO (R_MICROBLAZE_TLSGD, 800+ HOWTO (R_MICROBLAZE_TLSGD,
816+ 0, /* rightshift */ 801+ 0, /* rightshift */
817+ 2, /* size (0 = byte, 1 = short, 2 = long) */ 802+ 4, /* size */
818+ 32, /* bitsize */ 803+ 32, /* bitsize */
819+ false, /* pc_relative */ 804+ false, /* pc_relative */
820+ 0, /* bitpos */ 805+ 0, /* bitpos */
@@ -861,7 +846,7 @@ index 00000000000..7434bef393b
861+ contains the definition of sym, minus 0x8000. Used for initializing GOT */ 846+ contains the definition of sym, minus 0x8000. Used for initializing GOT */
862+ HOWTO (R_MICROBLAZE_TLSDTPREL32, 847+ HOWTO (R_MICROBLAZE_TLSDTPREL32,
863+ 0, /* rightshift */ 848+ 0, /* rightshift */
864+ 2, /* size (0 = byte, 1 = short, 2 = long) */ 849+ 4, /* size */
865+ 32, /* bitsize */ 850+ 32, /* bitsize */
866+ false, /* pc_relative */ 851+ false, /* pc_relative */
867+ 0, /* bitpos */ 852+ 0, /* bitpos */
@@ -878,7 +863,7 @@ index 00000000000..7434bef393b
878+ contains the definition of sym, minus 0x8000. */ 863+ contains the definition of sym, minus 0x8000. */
879+ HOWTO (R_MICROBLAZE_TLSDTPREL64, 864+ HOWTO (R_MICROBLAZE_TLSDTPREL64,
880+ 0, /* rightshift */ 865+ 0, /* rightshift */
881+ 2, /* size (0 = byte, 1 = short, 2 = long) */ 866+ 4, /* size */
882+ 32, /* bitsize */ 867+ 32, /* bitsize */
883+ false, /* pc_relative */ 868+ false, /* pc_relative */
884+ 0, /* bitpos */ 869+ 0, /* bitpos */
@@ -894,7 +879,7 @@ index 00000000000..7434bef393b
894+ sym+add and the value of the thread pointer (r13). */ 879+ sym+add and the value of the thread pointer (r13). */
895+ HOWTO (R_MICROBLAZE_TLSGOTTPREL32, 880+ HOWTO (R_MICROBLAZE_TLSGOTTPREL32,
896+ 0, /* rightshift */ 881+ 0, /* rightshift */
897+ 2, /* size (0 = byte, 1 = short, 2 = long) */ 882+ 4, /* size */
898+ 32, /* bitsize */ 883+ 32, /* bitsize */
899+ false, /* pc_relative */ 884+ false, /* pc_relative */
900+ 0, /* bitpos */ 885+ 0, /* bitpos */
@@ -910,7 +895,7 @@ index 00000000000..7434bef393b
910+ sym+add and the value of the thread pointer (r13). */ 895+ sym+add and the value of the thread pointer (r13). */
911+ HOWTO (R_MICROBLAZE_TLSTPREL32, 896+ HOWTO (R_MICROBLAZE_TLSTPREL32,
912+ 0, /* rightshift */ 897+ 0, /* rightshift */
913+ 2, /* size (0 = byte, 1 = short, 2 = long) */ 898+ 4, /* size */
914+ 32, /* bitsize */ 899+ 32, /* bitsize */
915+ false, /* pc_relative */ 900+ false, /* pc_relative */
916+ 0, /* bitpos */ 901+ 0, /* bitpos */
@@ -1138,7 +1123,7 @@ index 00000000000..7434bef393b
1138+ 1123+
1139+ sdata = bfd_zalloc (abfd, amt); 1124+ sdata = bfd_zalloc (abfd, amt);
1140+ if (sdata == NULL) 1125+ if (sdata == NULL)
1141+ return false; 1126+ return false;
1142+ sec->used_by_bfd = sdata; 1127+ sec->used_by_bfd = sdata;
1143+ } 1128+ }
1144+ 1129+
@@ -1271,15 +1256,15 @@ index 00000000000..7434bef393b
1271+ if (h != (struct bfd_link_hash_entry *) NULL 1256+ if (h != (struct bfd_link_hash_entry *) NULL
1272+ && h->type == bfd_link_hash_defined) 1257+ && h->type == bfd_link_hash_defined)
1273+ ro_small_data_pointer = (h->u.def.value 1258+ ro_small_data_pointer = (h->u.def.value
1274+ + h->u.def.section->output_section->vma 1259+ + h->u.def.section->output_section->vma
1275+ + h->u.def.section->output_offset); 1260+ + h->u.def.section->output_offset);
1276+ 1261+
1277+ h = bfd_link_hash_lookup (info->hash, RW_SDA_ANCHOR_NAME, false, false, true); 1262+ h = bfd_link_hash_lookup (info->hash, RW_SDA_ANCHOR_NAME, false, false, true);
1278+ if (h != (struct bfd_link_hash_entry *) NULL 1263+ if (h != (struct bfd_link_hash_entry *) NULL
1279+ && h->type == bfd_link_hash_defined) 1264+ && h->type == bfd_link_hash_defined)
1280+ rw_small_data_pointer = (h->u.def.value 1265+ rw_small_data_pointer = (h->u.def.value
1281+ + h->u.def.section->output_section->vma 1266+ + h->u.def.section->output_section->vma
1282+ + h->u.def.section->output_offset); 1267+ + h->u.def.section->output_offset);
1283+} 1268+}
1284+ 1269+
1285+static bfd_vma 1270+static bfd_vma
@@ -1623,9 +1608,9 @@ index 00000000000..7434bef393b
1623+ + offset + INST_WORD_SIZE); 1608+ + offset + INST_WORD_SIZE);
1624+ relocation += addend; 1609+ relocation += addend;
1625+ bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff, 1610+ bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff,
1626+ contents + offset + endian); 1611+ contents + offset + endian);
1627+ bfd_put_16 (input_bfd, relocation & 0xffff, 1612+ bfd_put_16 (input_bfd, relocation & 0xffff,
1628+ contents + offset + endian + INST_WORD_SIZE); 1613+ contents + offset + endian + INST_WORD_SIZE);
1629+ break; 1614+ break;
1630+ 1615+
1631+ case (int) R_MICROBLAZE_PLT_64: 1616+ case (int) R_MICROBLAZE_PLT_64:
@@ -1642,9 +1627,9 @@ index 00000000000..7434bef393b
1642+ + input_section->output_offset 1627+ + input_section->output_offset
1643+ + offset + INST_WORD_SIZE); 1628+ + offset + INST_WORD_SIZE);
1644+ bfd_put_16 (input_bfd, (immediate >> 16) & 0xffff, 1629+ bfd_put_16 (input_bfd, (immediate >> 16) & 0xffff,
1645+ contents + offset + endian); 1630+ contents + offset + endian);
1646+ bfd_put_16 (input_bfd, immediate & 0xffff, 1631+ bfd_put_16 (input_bfd, immediate & 0xffff,
1647+ contents + offset + endian + INST_WORD_SIZE); 1632+ contents + offset + endian + INST_WORD_SIZE);
1648+ } 1633+ }
1649+ else 1634+ else
1650+ { 1635+ {
@@ -1653,9 +1638,9 @@ index 00000000000..7434bef393b
1653+ + offset + INST_WORD_SIZE); 1638+ + offset + INST_WORD_SIZE);
1654+ immediate = relocation; 1639+ immediate = relocation;
1655+ bfd_put_16 (input_bfd, (immediate >> 16) & 0xffff, 1640+ bfd_put_16 (input_bfd, (immediate >> 16) & 0xffff,
1656+ contents + offset + endian); 1641+ contents + offset + endian);
1657+ bfd_put_16 (input_bfd, immediate & 0xffff, 1642+ bfd_put_16 (input_bfd, immediate & 0xffff,
1658+ contents + offset + endian + INST_WORD_SIZE); 1643+ contents + offset + endian + INST_WORD_SIZE);
1659+ } 1644+ }
1660+ break; 1645+ break;
1661+ } 1646+ }
@@ -1665,6 +1650,7 @@ index 00000000000..7434bef393b
1665+ goto dogot; 1650+ goto dogot;
1666+ case (int) R_MICROBLAZE_TLSLD: 1651+ case (int) R_MICROBLAZE_TLSLD:
1667+ tls_type = (TLS_TLS | TLS_LD); 1652+ tls_type = (TLS_TLS | TLS_LD);
1653+ /* Fall through. */
1668+ dogot: 1654+ dogot:
1669+ case (int) R_MICROBLAZE_GOT_64: 1655+ case (int) R_MICROBLAZE_GOT_64:
1670+ { 1656+ {
@@ -1694,7 +1680,7 @@ index 00000000000..7434bef393b
1694+ && h->got.offset != (bfd_vma) -1) 1680+ && h->got.offset != (bfd_vma) -1)
1695+ offp = &h->got.offset; 1681+ offp = &h->got.offset;
1696+ else 1682+ else
1697+ abort (); 1683+ abort ();
1698+ } 1684+ }
1699+ else 1685+ else
1700+ { 1686+ {
@@ -1834,9 +1820,9 @@ index 00000000000..7434bef393b
1834+ 1820+
1835+ /* Apply Current Relocation */ 1821+ /* Apply Current Relocation */
1836+ bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff, 1822+ bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff,
1837+ contents + offset + endian); 1823+ contents + offset + endian);
1838+ bfd_put_16 (input_bfd, relocation & 0xffff, 1824+ bfd_put_16 (input_bfd, relocation & 0xffff,
1839+ contents + offset + endian + INST_WORD_SIZE); 1825+ contents + offset + endian + INST_WORD_SIZE);
1840+ 1826+
1841+ unresolved_reloc = false; 1827+ unresolved_reloc = false;
1842+ break; 1828+ break;
@@ -2094,7 +2080,7 @@ index 00000000000..7434bef393b
2094+ 2080+
2095+/* Calculate fixup value for reference. */ 2081+/* Calculate fixup value for reference. */
2096+ 2082+
2097+static int 2083+static size_t
2098+calc_fixup (bfd_vma start, bfd_vma size, asection *sec) 2084+calc_fixup (bfd_vma start, bfd_vma size, asection *sec)
2099+{ 2085+{
2100+ bfd_vma end = start + size; 2086+ bfd_vma end = start + size;
@@ -2108,9 +2094,9 @@ index 00000000000..7434bef393b
2108+ for (i = 0; i < sdata->relax_count; i++) 2094+ for (i = 0; i < sdata->relax_count; i++)
2109+ { 2095+ {
2110+ if (end <= sdata->relax[i].addr) 2096+ if (end <= sdata->relax[i].addr)
2111+ break; 2097+ break;
2112+ if (end != start && start > sdata->relax[i].addr) 2098+ if (end != start && start > sdata->relax[i].addr)
2113+ continue; 2099+ continue;
2114+ fixup += sdata->relax[i].size; 2100+ fixup += sdata->relax[i].size;
2115+ } 2101+ }
2116+ return fixup; 2102+ return fixup;
@@ -2160,13 +2146,13 @@ index 00000000000..7434bef393b
2160+ bfd_byte *free_contents = NULL; 2146+ bfd_byte *free_contents = NULL;
2161+ int rel_count; 2147+ int rel_count;
2162+ unsigned int shndx; 2148+ unsigned int shndx;
2163+ int i, sym_index; 2149+ size_t i, sym_index;
2164+ asection *o; 2150+ asection *o;
2165+ struct elf_link_hash_entry *sym_hash; 2151+ struct elf_link_hash_entry *sym_hash;
2166+ Elf_Internal_Sym *isymbuf, *isymend; 2152+ Elf_Internal_Sym *isymbuf, *isymend;
2167+ Elf_Internal_Sym *isym; 2153+ Elf_Internal_Sym *isym;
2168+ int symcount; 2154+ size_t symcount;
2169+ int offset; 2155+ size_t offset;
2170+ bfd_vma src, dest; 2156+ bfd_vma src, dest;
2171+ struct _microblaze_elf_section_data *sdata; 2157+ struct _microblaze_elf_section_data *sdata;
2172+ 2158+
@@ -2206,7 +2192,7 @@ index 00000000000..7434bef393b
2206+ 2192+
2207+ sdata->relax_count = 0; 2193+ sdata->relax_count = 0;
2208+ sdata->relax = (struct relax_table *) bfd_malloc ((sec->reloc_count + 1) 2194+ sdata->relax = (struct relax_table *) bfd_malloc ((sec->reloc_count + 1)
2209+ * sizeof (*sdata->relax)); 2195+ * sizeof (*sdata->relax));
2210+ if (sdata->relax == NULL) 2196+ if (sdata->relax == NULL)
2211+ goto error_return; 2197+ goto error_return;
2212+ 2198+
@@ -2294,12 +2280,13 @@ index 00000000000..7434bef393b
2294+ else 2280+ else
2295+ symval += irel->r_addend; 2281+ symval += irel->r_addend;
2296+ 2282+
2297+ if ((symval & 0xffff8000) == 0) 2283+ if ((symval & 0xffff8000) == 0
2284+ || (symval & 0xffff8000) == 0xffff8000)
2298+ { 2285+ {
2299+ /* We can delete this instruction. */ 2286+ /* We can delete this instruction. */
2300+ sdata->relax[sdata->relax_count].addr = irel->r_offset; 2287+ sdata->relax[sdata->relax_count].addr = irel->r_offset;
2301+ sdata->relax[sdata->relax_count].size = INST_WORD_SIZE; 2288+ sdata->relax[sdata->relax_count].size = INST_WORD_SIZE;
2302+ sdata->relax_count++; 2289+ sdata->relax_count++;
2303+ 2290+
2304+ /* Rewrite relocation type. */ 2291+ /* Rewrite relocation type. */
2305+ switch ((enum elf_microblaze_reloc_type) ELF64_R_TYPE (irel->r_info)) 2292+ switch ((enum elf_microblaze_reloc_type) ELF64_R_TYPE (irel->r_info))
@@ -2381,14 +2368,14 @@ index 00000000000..7434bef393b
2381+ case R_MICROBLAZE_NONE: 2368+ case R_MICROBLAZE_NONE:
2382+ case R_MICROBLAZE_32_NONE: 2369+ case R_MICROBLAZE_32_NONE:
2383+ { 2370+ {
2384+ /* This was a PC-relative instruction that was 2371+ /* This was a PC-relative instruction that was
2385+ completely resolved. */ 2372+ completely resolved. */
2386+ int sfix, efix; 2373+ size_t sfix, efix;
2387+ unsigned int val; 2374+ unsigned int val;
2388+ bfd_vma target_address; 2375+ bfd_vma target_address;
2389+ target_address = irel->r_addend + irel->r_offset; 2376+ target_address = irel->r_addend + irel->r_offset;
2390+ sfix = calc_fixup (irel->r_offset, 0, sec); 2377+ sfix = calc_fixup (irel->r_offset, 0, sec);
2391+ efix = calc_fixup (target_address, 0, sec); 2378+ efix = calc_fixup (target_address, 0, sec);
2392+ 2379+
2393+ /* Validate the in-band val. */ 2380+ /* Validate the in-band val. */
2394+ val = bfd_get_32 (abfd, contents + irel->r_offset); 2381+ val = bfd_get_32 (abfd, contents + irel->r_offset);
@@ -2403,16 +2390,16 @@ index 00000000000..7434bef393b
2403+ break; 2390+ break;
2404+ case R_MICROBLAZE_64_NONE: 2391+ case R_MICROBLAZE_64_NONE:
2405+ { 2392+ {
2406+ /* This was a PC-relative 64-bit instruction that was 2393+ /* This was a PC-relative 64-bit instruction that was
2407+ completely resolved. */ 2394+ completely resolved. */
2408+ int sfix, efix; 2395+ size_t sfix, efix;
2409+ bfd_vma target_address; 2396+ bfd_vma target_address;
2410+ target_address = irel->r_addend + irel->r_offset + INST_WORD_SIZE; 2397+ target_address = irel->r_addend + irel->r_offset + INST_WORD_SIZE;
2411+ sfix = calc_fixup (irel->r_offset + INST_WORD_SIZE, 0, sec); 2398+ sfix = calc_fixup (irel->r_offset + INST_WORD_SIZE, 0, sec);
2412+ efix = calc_fixup (target_address, 0, sec); 2399+ efix = calc_fixup (target_address, 0, sec);
2413+ irel->r_addend -= (efix - sfix); 2400+ irel->r_addend -= (efix - sfix);
2414+ microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset 2401+ microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset
2415+ + INST_WORD_SIZE, irel->r_addend); 2402+ + INST_WORD_SIZE, irel->r_addend);
2416+ } 2403+ }
2417+ break; 2404+ break;
2418+ } 2405+ }
@@ -2549,9 +2536,11 @@ index 00000000000..7434bef393b
2549+ sec); 2536+ sec);
2550+ } 2537+ }
2551+ } 2538+ }
2552+ else if ((ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_PCREL_LO) 2539+ else if ((ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_PCREL_LO)
2553+ || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_LO) 2540+ || (ELF32_R_TYPE (irelscan->r_info)
2554+ || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_TEXTREL_32_LO)) 2541+ == (int) R_MICROBLAZE_32_LO)
2542+ || (ELF32_R_TYPE (irelscan->r_info)
2543+ == (int) R_MICROBLAZE_TEXTREL_32_LO))
2555+ { 2544+ {
2556+ isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 2545+ isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
2557+ 2546+
@@ -2604,8 +2593,6 @@ index 00000000000..7434bef393b
2604+ if (isym->st_shndx == shndx 2593+ if (isym->st_shndx == shndx
2605+ && (ELF64_ST_TYPE (isym->st_info) == STT_SECTION)) 2594+ && (ELF64_ST_TYPE (isym->st_info) == STT_SECTION))
2606+ { 2595+ {
2607+ bfd_vma immediate;
2608+
2609+ if (ocontents == NULL) 2596+ if (ocontents == NULL)
2610+ { 2597+ {
2611+ if (elf_section_data (o)->this_hdr.contents != NULL) 2598+ if (elf_section_data (o)->this_hdr.contents != NULL)
@@ -2628,15 +2615,7 @@ index 00000000000..7434bef393b
2628+ elf_section_data (o)->this_hdr.contents = ocontents; 2615+ elf_section_data (o)->this_hdr.contents = ocontents;
2629+ } 2616+ }
2630+ } 2617+ }
2631+ unsigned long instr_hi = bfd_get_32 (abfd, ocontents
2632+ + irelscan->r_offset);
2633+ unsigned long instr_lo = bfd_get_32 (abfd, ocontents
2634+ + irelscan->r_offset
2635+ + INST_WORD_SIZE);
2636+ immediate = (instr_hi & 0x0000ffff) << 16;
2637+ immediate |= (instr_lo & 0x0000ffff);
2638+ offset = calc_fixup (irelscan->r_addend, 0, sec); 2618+ offset = calc_fixup (irelscan->r_addend, 0, sec);
2639+ immediate -= offset;
2640+ irelscan->r_addend -= offset; 2619+ irelscan->r_addend -= offset;
2641+ } 2620+ }
2642+ } 2621+ }
@@ -2723,16 +2702,16 @@ index 00000000000..7434bef393b
2723+ /* Physically move the code and change the cooked size. */ 2702+ /* Physically move the code and change the cooked size. */
2724+ dest = sdata->relax[0].addr; 2703+ dest = sdata->relax[0].addr;
2725+ for (i = 0; i < sdata->relax_count; i++) 2704+ for (i = 0; i < sdata->relax_count; i++)
2726+ { 2705+ {
2727+ size_t len; 2706+ size_t len;
2728+ src = sdata->relax[i].addr + sdata->relax[i].size; 2707+ src = sdata->relax[i].addr + sdata->relax[i].size;
2729+ len = (sdata->relax[i+1].addr - sdata->relax[i].addr 2708+ len = (sdata->relax[i+1].addr - sdata->relax[i].addr
2730+ - sdata->relax[i].size); 2709+ - sdata->relax[i].size);
2731+ 2710+
2732+ memmove (contents + dest, contents + src, len); 2711+ memmove (contents + dest, contents + src, len);
2733+ sec->size -= sdata->relax[i].size; 2712+ sec->size -= sdata->relax[i].size;
2734+ dest += len; 2713+ dest += len;
2735+ } 2714+ }
2736+ 2715+
2737+ elf_section_data (sec)->relocs = internal_relocs; 2716+ elf_section_data (sec)->relocs = internal_relocs;
2738+ free_relocs = NULL; 2717+ free_relocs = NULL;
@@ -3101,12 +3080,8 @@ index 00000000000..7434bef393b
3101+ struct elf_link_hash_entry *h) 3080+ struct elf_link_hash_entry *h)
3102+{ 3081+{
3103+ struct elf64_mb_link_hash_table *htab; 3082+ struct elf64_mb_link_hash_table *htab;
3104+ struct elf64_mb_link_hash_entry * eh;
3105+ struct elf64_mb_dyn_relocs *p;
3106+ asection *sdynbss;
3107+ asection *s, *srel; 3083+ asection *s, *srel;
3108+ unsigned int power_of_two; 3084+ unsigned int power_of_two;
3109+ bfd *dynobj;
3110+ 3085+
3111+ htab = elf64_mb_hash_table (info); 3086+ htab = elf64_mb_hash_table (info);
3112+ if (htab == NULL) 3087+ if (htab == NULL)
@@ -3823,8 +3798,8 @@ index 00000000000..7434bef393b
3823+ asection *splt; 3798+ asection *splt;
3824+ Elf64_External_Dyn *dyncon, *dynconend; 3799+ Elf64_External_Dyn *dyncon, *dynconend;
3825+ 3800+
3826+ dyncon = (Elf32_External_Dyn *) sdyn->contents; 3801+ dyncon = (Elf64_External_Dyn *) sdyn->contents;
3827+ dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size); 3802+ dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->size);
3828+ for (; dyncon < dynconend; dyncon++) 3803+ for (; dyncon < dynconend; dyncon++)
3829+ { 3804+ {
3830+ Elf_Internal_Dyn dyn; 3805+ Elf_Internal_Dyn dyn;
@@ -3947,6 +3922,7 @@ index 00000000000..7434bef393b
3947+ 3922+
3948+#define bfd_elf64_bfd_reloc_type_lookup microblaze_elf_reloc_type_lookup 3923+#define bfd_elf64_bfd_reloc_type_lookup microblaze_elf_reloc_type_lookup
3949+#define bfd_elf64_bfd_is_local_label_name microblaze_elf_is_local_label_name 3924+#define bfd_elf64_bfd_is_local_label_name microblaze_elf_is_local_label_name
3925+#define bfd_elf64_new_section_hook microblaze_elf_new_section_hook
3950+#define elf_backend_relocate_section microblaze_elf_relocate_section 3926+#define elf_backend_relocate_section microblaze_elf_relocate_section
3951+#define bfd_elf64_bfd_relax_section microblaze_elf_relax_section 3927+#define bfd_elf64_bfd_relax_section microblaze_elf_relax_section
3952+#define bfd_elf64_bfd_merge_private_bfd_data _bfd_generic_verify_endian_match 3928+#define bfd_elf64_bfd_merge_private_bfd_data _bfd_generic_verify_endian_match
@@ -3955,7 +3931,7 @@ index 00000000000..7434bef393b
3955+#define elf_backend_gc_mark_hook microblaze_elf_gc_mark_hook 3931+#define elf_backend_gc_mark_hook microblaze_elf_gc_mark_hook
3956+#define elf_backend_check_relocs microblaze_elf_check_relocs 3932+#define elf_backend_check_relocs microblaze_elf_check_relocs
3957+#define elf_backend_copy_indirect_symbol microblaze_elf_copy_indirect_symbol 3933+#define elf_backend_copy_indirect_symbol microblaze_elf_copy_indirect_symbol
3958+#define bfd_elf32_bfd_link_hash_table_create microblaze_elf_link_hash_table_create 3934+#define bfd_elf64_bfd_link_hash_table_create microblaze_elf_link_hash_table_create
3959+#define elf_backend_can_gc_sections 1 3935+#define elf_backend_can_gc_sections 1
3960+#define elf_backend_can_refcount 1 3936+#define elf_backend_can_refcount 1
3961+#define elf_backend_want_got_plt 1 3937+#define elf_backend_want_got_plt 1
@@ -4760,18 +4736,18 @@ index a2e1ce4580f..79799b86a49 100644
4760 END_RELOC_NUMBERS (R_MICROBLAZE_max) 4736 END_RELOC_NUMBERS (R_MICROBLAZE_max)
4761 4737
4762diff --git a/ld/Makefile.am b/ld/Makefile.am 4738diff --git a/ld/Makefile.am b/ld/Makefile.am
4763index 05c7630073d..256a95a2219 100644 4739index d31021c13e2..bd1a2e5a625 100644
4764--- a/ld/Makefile.am 4740--- a/ld/Makefile.am
4765+++ b/ld/Makefile.am 4741+++ b/ld/Makefile.am
4766@@ -445,6 +445,8 @@ ALL_64_EMULATION_SOURCES = \ 4742@@ -418,6 +418,8 @@ ALL_64_EMULATION_SOURCES = \
4767 eelf64lriscv_lp64f.c \ 4743 eelf32ltsmipn32.c \
4768 eelf64ltsmip.c \ 4744 eelf32ltsmipn32_fbsd.c \
4769 eelf64ltsmip_fbsd.c \ 4745 eelf32mipswindiss.c \
4770+ eelf64microblazeel.c \ 4746+ eelf64microblazeel.c \
4771+ eelf64microblaze.c \ 4747+ eelf64microblaze.c \
4772 eelf64mmix.c \ 4748 eelf64_aix.c \
4773 eelf64ppc.c \ 4749 eelf64_ia64.c \
4774 eelf64ppc_fbsd.c \ 4750 eelf64_ia64_fbsd.c \
4775@@ -906,6 +908,8 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS) 4751@@ -906,6 +908,8 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
4776 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32.Pc@am__quote@ 4752 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32.Pc@am__quote@
4777 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32_fbsd.Pc@am__quote@ 4753 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32_fbsd.Pc@am__quote@
@@ -4782,19 +4758,19 @@ index 05c7630073d..256a95a2219 100644
4782 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64.Pc@am__quote@ 4758 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64.Pc@am__quote@
4783 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_fbsd.Pc@am__quote@ 4759 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_fbsd.Pc@am__quote@
4784diff --git a/ld/Makefile.in b/ld/Makefile.in 4760diff --git a/ld/Makefile.in b/ld/Makefile.in
4785index 05d0ff5e122..a7f7e841acb 100644 4761index ee0c98f65b0..f4b7ee0623e 100644
4786--- a/ld/Makefile.in 4762--- a/ld/Makefile.in
4787+++ b/ld/Makefile.in 4763+++ b/ld/Makefile.in
4788@@ -944,6 +944,8 @@ ALL_64_EMULATION_SOURCES = \ 4764@@ -914,6 +914,8 @@ ALL_64_EMULATION_SOURCES = \
4789 eelf64lriscv_lp64f.c \ 4765 eelf32ltsmipn32.c \
4790 eelf64ltsmip.c \ 4766 eelf32ltsmipn32_fbsd.c \
4791 eelf64ltsmip_fbsd.c \ 4767 eelf32mipswindiss.c \
4792+ eelf64microblazeel.c \ 4768+ eelf64microblazeel.c \
4793+ eelf64microblaze.c \ 4769+ eelf64microblaze.c \
4794 eelf64mmix.c \ 4770 eelf64_aix.c \
4795 eelf64ppc.c \ 4771 eelf64_ia64.c \
4796 eelf64ppc_fbsd.c \ 4772 eelf64_ia64_fbsd.c \
4797@@ -1410,6 +1412,8 @@ distclean-compile: 4773@@ -1407,6 +1409,8 @@ distclean-compile:
4798 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xstormy16.Po@am__quote@ 4774 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xstormy16.Po@am__quote@
4799 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xtensa.Po@am__quote@ 4775 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xtensa.Po@am__quote@
4800 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32z80.Po@am__quote@ 4776 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32z80.Po@am__quote@
@@ -4803,7 +4779,7 @@ index 05d0ff5e122..a7f7e841acb 100644
4803 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_aix.Po@am__quote@ 4779 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_aix.Po@am__quote@
4804 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64.Po@am__quote@ 4780 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64.Po@am__quote@
4805 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_fbsd.Po@am__quote@ 4781 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_fbsd.Po@am__quote@
4806@@ -2575,6 +2579,8 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS) 4782@@ -2572,6 +2576,8 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
4807 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32.Pc@am__quote@ 4783 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32.Pc@am__quote@
4808 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32_fbsd.Pc@am__quote@ 4784 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmipn32_fbsd.Pc@am__quote@
4809 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32mipswindiss.Pc@am__quote@ 4785 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32mipswindiss.Pc@am__quote@
@@ -4885,7 +4861,7 @@ index 00000000000..9c7b0eb7080
4885+TEMPLATE_NAME=elf32 4861+TEMPLATE_NAME=elf32
4886+#GENERATE_SHLIB_SCRIPT=yes 4862+#GENERATE_SHLIB_SCRIPT=yes
4887diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c 4863diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c
4888index f57b98fc9f7..f71589d714d 100644 4864index f57b98fc9f7..921adce04ea 100644
4889--- a/opcodes/microblaze-dis.c 4865--- a/opcodes/microblaze-dis.c
4890+++ b/opcodes/microblaze-dis.c 4866+++ b/opcodes/microblaze-dis.c
4891@@ -33,6 +33,7 @@ 4867@@ -33,6 +33,7 @@
@@ -4902,18 +4878,18 @@ index f57b98fc9f7..f71589d714d 100644
4902 static char * 4878 static char *
4903-get_field_imm5 (struct string_buf *buf, long instr) 4879-get_field_imm5 (struct string_buf *buf, long instr)
4904+get_field_imml (struct string_buf *buf, long instr) 4880+get_field_imml (struct string_buf *buf, long instr)
4905 { 4881+{
4906 char *p = strbuf (buf); 4882+ char *p = strbuf (buf);
4907+ sprintf (p, "%d", (short)((instr & IMML_MASK) >> IMM_LOW)); 4883+ sprintf (p, "%d", (short)((instr & IMML_MASK) >> IMM_LOW));
4908+ return p; 4884+ return p;
4909+} 4885+}
4910 4886+
4911- sprintf (p, "%d", (short)((instr & IMM5_MASK) >> IMM_LOW));
4912+static char * 4887+static char *
4913+get_field_imms (struct string_buf *buf, long instr) 4888+get_field_imms (struct string_buf *buf, long instr)
4914+{ 4889 {
4915+ char *p = strbuf (buf); 4890 char *p = strbuf (buf);
4916+ 4891
4892- sprintf (p, "%d", (short)((instr & IMM5_MASK) >> IMM_LOW));
4917+ sprintf (p, "%d", (short)((instr & IMM6_MASK) >> IMM_LOW)); 4893+ sprintf (p, "%d", (short)((instr & IMM6_MASK) >> IMM_LOW));
4918 return p; 4894 return p;
4919 } 4895 }
@@ -4936,23 +4912,24 @@ index f57b98fc9f7..f71589d714d 100644
4936 return p; 4912 return p;
4937 } 4913 }
4938 4914
4939@@ -308,9 +317,13 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info) 4915@@ -308,9 +317,14 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
4940 } 4916 }
4941 } 4917 }
4942 break; 4918 break;
4943- case INST_TYPE_RD_R1_IMM5: 4919- case INST_TYPE_RD_R1_IMM5:
4944+ case INST_TYPE_RD_R1_IMML: 4920+ case INST_TYPE_RD_R1_IMML:
4945+ print_func (stream, "\t%s, %s, %s", get_field_rd (&buf, inst), 4921 print_func (stream, "\t%s, %s, %s", get_field_rd (&buf, inst),
4922- get_field_r1 (&buf, inst), get_field_imm5 (&buf, inst));
4946+ get_field_r1 (&buf, inst), get_field_imm (&buf, inst)); 4923+ get_field_r1 (&buf, inst), get_field_imm (&buf, inst));
4947+ /* TODO: Also print symbol */ 4924+ /* TODO: Also print symbol */
4925+ break;
4948+ case INST_TYPE_RD_R1_IMMS: 4926+ case INST_TYPE_RD_R1_IMMS:
4949 print_func (stream, "\t%s, %s, %s", get_field_rd (&buf, inst), 4927+ print_func (stream, "\t%s, %s, %s", get_field_rd (&buf, inst),
4950- get_field_r1 (&buf, inst), get_field_imm5 (&buf, inst));
4951+ get_field_r1(&buf, inst), get_field_imms (&buf, inst)); 4928+ get_field_r1(&buf, inst), get_field_imms (&buf, inst));
4952 break; 4929 break;
4953 case INST_TYPE_RD_RFSL: 4930 case INST_TYPE_RD_RFSL:
4954 print_func (stream, "\t%s, %s", get_field_rd (&buf, inst), 4931 print_func (stream, "\t%s, %s", get_field_rd (&buf, inst),
4955@@ -417,6 +430,10 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info) 4932@@ -417,6 +431,10 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
4956 case INST_TYPE_RD_R2: 4933 case INST_TYPE_RD_R2:
4957 print_func (stream, "\t%s, %s", get_field_rd (&buf, inst), 4934 print_func (stream, "\t%s, %s", get_field_rd (&buf, inst),
4958 get_field_r2 (&buf, inst)); 4935 get_field_r2 (&buf, inst));
@@ -4963,7 +4940,7 @@ index f57b98fc9f7..f71589d714d 100644
4963 break; 4940 break;
4964 case INST_TYPE_R2: 4941 case INST_TYPE_R2:
4965 print_func (stream, "\t%s", get_field_r2 (&buf, inst)); 4942 print_func (stream, "\t%s", get_field_r2 (&buf, inst));
4966@@ -440,8 +457,8 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info) 4943@@ -440,8 +458,8 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
4967 case INST_TYPE_NONE: 4944 case INST_TYPE_NONE:
4968 break; 4945 break;
4969 /* For bit field insns. */ 4946 /* For bit field insns. */
@@ -5266,5 +5243,5 @@ index aa3401610d9..b242ea73c7b 100644
5266 /* FSL imm mask for get, put instructions. */ 5243 /* FSL imm mask for get, put instructions. */
5267 #define RFSL_MASK 0x000000F 5244 #define RFSL_MASK 0x000000F
5268-- 5245--
52692.25.1 52462.37.1 (Apple Git-137.1)
5270 5247
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0015-negl-instruction-is-overriding-rsubl-fixed-it-by-cha.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0013-Patch-Microblaze-negl-instruction-is-overriding-rsub.patch
index 5b3e3fc6..01aff144 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0015-negl-instruction-is-overriding-rsubl-fixed-it-by-cha.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0013-Patch-Microblaze-negl-instruction-is-overriding-rsub.patch
@@ -1,10 +1,9 @@
1From a41a5a63d4d52887f1ce5a5cab161670d033c1ce Mon Sep 17 00:00:00 2001 1From 667611ec2dfb22bf13d5c6af65ea62e9c13a68de 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] negl instruction is overriding rsubl,fixed it by 4Subject: [PATCH 13/34] [Patch,Microblaze] : negl instruction is overriding
5 changing the instruction order... 5 rsubl,fixed it by changing the instruction order...
6 6
7Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
8--- 7---
9 opcodes/microblaze-opc.h | 4 ++-- 8 opcodes/microblaze-opc.h | 4 ++--
10 1 file changed, 2 insertions(+), 2 deletions(-) 9 1 file changed, 2 insertions(+), 2 deletions(-)
@@ -33,5 +32,5 @@ index ab90240d88a..5e45df995de 100644
33 {"", 0, 0, 0, 0, 0, 0, 0, 0}, 32 {"", 0, 0, 0, 0, 0, 0, 0, 0},
34 }; 33 };
35-- 34--
362.25.1 352.37.1 (Apple Git-137.1)
37 36
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0016-Added-relocations-for-MB-X.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0014-Added-relocations-for-MB-X.patch
index 6761f01e..404081e0 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0016-Added-relocations-for-MB-X.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0014-Added-relocations-for-MB-X.patch
@@ -1,7 +1,7 @@
1From 3deb533f60bb078f8a7b3f2dde5dc2125552d310 Mon Sep 17 00:00:00 2001 1From 4e94c1683a806ac46f3a0d54bfe8f7247d5f0cbd 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 14/34] Added relocations for MB-X
5 5
6Conflicts: 6Conflicts:
7 bfd/bfd-in2.h 7 bfd/bfd-in2.h
@@ -9,8 +9,6 @@ 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>
14--- 12---
15 bfd/bfd-in2.h | 9 +++- 13 bfd/bfd-in2.h | 9 +++-
16 bfd/libbfd.h | 4 +- 14 bfd/libbfd.h | 4 +-
@@ -347,5 +345,5 @@ index a6f12dda54a..9d4dbc12ab3 100644
347 case BFD_RELOC_MICROBLAZE_64_PLT: 345 case BFD_RELOC_MICROBLAZE_64_PLT:
348 case BFD_RELOC_MICROBLAZE_64_GOTOFF: 346 case BFD_RELOC_MICROBLAZE_64_GOTOFF:
349-- 347--
3502.25.1 3482.37.1 (Apple Git-137.1)
351 349
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0017-Fixed-MB-x-relocation-issues-Added-imml-for-required.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0015-Fixed-MB-x-relocation-issues.patch
index c4ccc057..e93e3476 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0017-Fixed-MB-x-relocation-issues-Added-imml-for-required.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0015-Fixed-MB-x-relocation-issues.patch
@@ -1,14 +1,15 @@
1From 40702a32c685ad81803a666858b1b4133b0a9857 Mon Sep 17 00:00:00 2001 1From da36307dff05dff1eebd44aec56f9bdc196ad632 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 15/34] -Fixed MB-x relocation issues -Added imml for required
5 MB-x instructions 5 MB-x instructions
6 6
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 10
11Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> 11Conflicts:
12 gas/config/tc-microblaze.c
12--- 13---
13 bfd/elf64-microblaze.c | 48 ++++++++++-- 14 bfd/elf64-microblaze.c | 48 ++++++++++--
14 gas/config/tc-microblaze.c | 155 ++++++++++++++++++++++++++----------- 15 gas/config/tc-microblaze.c | 155 ++++++++++++++++++++++++++-----------
@@ -16,7 +17,7 @@ Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
16 3 files changed, 152 insertions(+), 53 deletions(-) 17 3 files changed, 152 insertions(+), 53 deletions(-)
17 18
18diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 19diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
19index 7434bef393b..104d7a1334f 100644 20index 0faa8de73c8..951bb36506d 100644
20--- a/bfd/elf64-microblaze.c 21--- a/bfd/elf64-microblaze.c
21+++ b/bfd/elf64-microblaze.c 22+++ b/bfd/elf64-microblaze.c
22@@ -1552,6 +1552,14 @@ microblaze_elf_relocate_section (bfd *output_bfd, 23@@ -1552,6 +1552,14 @@ microblaze_elf_relocate_section (bfd *output_bfd,
@@ -356,5 +357,5 @@ index 4a740f9bdd9..bb9a935a353 100644
356 const char * md_atof (int, char *, int *); 357 const char * md_atof (int, char *, int *);
357 int md_parse_option (int, const char *); 358 int md_parse_option (int, const char *);
358-- 359--
3592.25.1 3602.37.1 (Apple Git-137.1)
360 361
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0018-Fixing-the-branch-related-issues.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0016-Fixing-the-branch-related-issues.patch
index 62a8e7de..f3a7267d 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0018-Fixing-the-branch-related-issues.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0016-Fixing-the-branch-related-issues.patch
@@ -1,21 +1,19 @@
1From 507032ec3840b48dfd709ef7c8f277eb0fabf5bb Mon Sep 17 00:00:00 2001 1From 3a46bc21f52c7b5ccbd408eeecd7145b856f6b1d 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 16/34] 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>
10--- 8---
11 bfd/elf64-microblaze.c | 3 +++ 9 bfd/elf64-microblaze.c | 3 +++
12 1 file changed, 3 insertions(+) 10 1 file changed, 3 insertions(+)
13 11
14diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 12diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
15index 104d7a1334f..4c79bbe96c6 100644 13index 951bb36506d..6d698383404 100644
16--- a/bfd/elf64-microblaze.c 14--- a/bfd/elf64-microblaze.c
17+++ b/bfd/elf64-microblaze.c 15+++ b/bfd/elf64-microblaze.c
18@@ -2566,6 +2566,9 @@ microblaze_elf_check_relocs (bfd * abfd, 16@@ -2559,6 +2559,9 @@ microblaze_elf_check_relocs (bfd * abfd,
19 while (h->root.type == bfd_link_hash_indirect 17 while (h->root.type == bfd_link_hash_indirect
20 || h->root.type == bfd_link_hash_warning) 18 || h->root.type == bfd_link_hash_warning)
21 h = (struct elf_link_hash_entry *) h->root.u.i.link; 19 h = (struct elf_link_hash_entry *) h->root.u.i.link;
@@ -26,5 +24,5 @@ index 104d7a1334f..4c79bbe96c6 100644
26 24
27 switch (r_type) 25 switch (r_type)
28-- 26--
292.25.1 272.37.1 (Apple Git-137.1)
30 28
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/0017-Fixed-address-computation-issues-with-64bit-address.patch
index 932ecb01..4c0496c3 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0019-Fixed-address-computation-issues-with-64bit-address-.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0017-Fixed-address-computation-issues-with-64bit-address.patch
@@ -1,7 +1,7 @@
1From 31e2555754e9830192a56f1b4bc725a10fe7c300 Mon Sep 17 00:00:00 2001 1From a6003437722a8f04c1e31435eb7f9101c50cc292 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 17/34] - Fixed address computation issues with 64bit address -
5 Fixed imml dissassamble issue 5 Fixed imml dissassamble issue
6 6
7Conflicts: 7Conflicts:
@@ -11,13 +11,14 @@ Conflicts:
11Conflicts: 11Conflicts:
12 bfd/elf64-microblaze.c 12 bfd/elf64-microblaze.c
13 13
14Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> 14Conflicts:
15 bfd/elf64-microblaze.c
15--- 16---
16 bfd/bfd-in2.h | 5 +++ 17 bfd/bfd-in2.h | 5 +++
17 bfd/elf64-microblaze.c | 14 ++++---- 18 bfd/elf64-microblaze.c | 12 +++----
18 gas/config/tc-microblaze.c | 74 +++++++++++++++++++++++++++++++++----- 19 gas/config/tc-microblaze.c | 74 +++++++++++++++++++++++++++++++++-----
19 opcodes/microblaze-dis.c | 2 +- 20 opcodes/microblaze-dis.c | 2 +-
20 4 files changed, 79 insertions(+), 16 deletions(-) 21 4 files changed, 78 insertions(+), 15 deletions(-)
21 22
22diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h 23diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
23index 14e228c9c0e..d4b5006902c 100644 24index 14e228c9c0e..d4b5006902c 100644
@@ -36,10 +37,10 @@ index 14e228c9c0e..d4b5006902c 100644
36 * +value in two words (with an imm instruction). No relocation is 37 * +value in two words (with an imm instruction). No relocation is
37 * +done here - only used for relaxing */ 38 * +done here - only used for relaxing */
38diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 39diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
39index 4c79bbe96c6..2d4820c50fe 100644 40index 6d698383404..f16b544b1fc 100644
40--- a/bfd/elf64-microblaze.c 41--- a/bfd/elf64-microblaze.c
41+++ b/bfd/elf64-microblaze.c 42+++ b/bfd/elf64-microblaze.c
42@@ -119,15 +119,15 @@ static reloc_howto_type microblaze_elf_howto_raw[] = 43@@ -118,14 +118,14 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
43 0, /* Rightshift. */ 44 0, /* Rightshift. */
44 4, /* Size (0 = byte, 1 = short, 2 = long). */ 45 4, /* Size (0 = byte, 1 = short, 2 = long). */
45 64, /* Bitsize. */ 46 64, /* Bitsize. */
@@ -52,13 +53,11 @@ index 4c79bbe96c6..2d4820c50fe 100644
52 false, /* Partial Inplace. */ 53 false, /* Partial Inplace. */
53 0, /* Source Mask. */ 54 0, /* Source Mask. */
54- 0x0000ffff, /* Dest Mask. */ 55- 0x0000ffff, /* Dest Mask. */
55- true), /* PC relative offset? */
56+ 0xffffffffffffff, /* Dest Mask. */ 56+ 0xffffffffffffff, /* Dest Mask. */
57+ false), /* PC relative offset? */ 57 false), /* PC relative offset? */
58 58
59 /* A 64 bit relocation. Table entry not really used. */ 59 /* A 64 bit relocation. Table entry not really used. */
60 HOWTO (R_MICROBLAZE_64, /* Type. */ 60@@ -613,9 +613,9 @@ microblaze_elf_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
61@@ -614,9 +614,9 @@ microblaze_elf_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
62 case BFD_RELOC_32: 61 case BFD_RELOC_32:
63 microblaze_reloc = R_MICROBLAZE_32; 62 microblaze_reloc = R_MICROBLAZE_32;
64 break; 63 break;
@@ -70,7 +69,7 @@ index 4c79bbe96c6..2d4820c50fe 100644
70 break; 69 break;
71 case BFD_RELOC_32_PCREL: 70 case BFD_RELOC_32_PCREL:
72 microblaze_reloc = R_MICROBLAZE_32_PCREL; 71 microblaze_reloc = R_MICROBLAZE_32_PCREL;
73@@ -648,7 +648,7 @@ microblaze_elf_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, 72@@ -647,7 +647,7 @@ microblaze_elf_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
74 case BFD_RELOC_VTABLE_ENTRY: 73 case BFD_RELOC_VTABLE_ENTRY:
75 microblaze_reloc = R_MICROBLAZE_GNU_VTENTRY; 74 microblaze_reloc = R_MICROBLAZE_GNU_VTENTRY;
76 break; 75 break;
@@ -79,7 +78,7 @@ index 4c79bbe96c6..2d4820c50fe 100644
79 microblaze_reloc = R_MICROBLAZE_IMML_64; 78 microblaze_reloc = R_MICROBLAZE_IMML_64;
80 break; 79 break;
81 case BFD_RELOC_MICROBLAZE_64_GOTPC: 80 case BFD_RELOC_MICROBLAZE_64_GOTPC:
82@@ -2049,7 +2049,7 @@ microblaze_elf_relax_section (bfd *abfd, 81@@ -2050,7 +2050,7 @@ microblaze_elf_relax_section (bfd *abfd,
83 efix = calc_fixup (target_address, 0, sec); 82 efix = calc_fixup (target_address, 0, sec);
84 83
85 /* Validate the in-band val. */ 84 /* Validate the in-band val. */
@@ -211,7 +210,7 @@ index a0e97231a41..d3de049e9c0 100644
211 default: 210 default:
212 as_bad (_("unsupported BFD relocation size %u"), size); 211 as_bad (_("unsupported BFD relocation size %u"), size);
213diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c 212diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c
214index f71589d714d..97e21a38bd2 100644 213index 921adce04ea..d837ebb38e2 100644
215--- a/opcodes/microblaze-dis.c 214--- a/opcodes/microblaze-dis.c
216+++ b/opcodes/microblaze-dis.c 215+++ b/opcodes/microblaze-dis.c
217@@ -77,7 +77,7 @@ static char * 216@@ -77,7 +77,7 @@ static char *
@@ -224,5 +223,5 @@ index f71589d714d..97e21a38bd2 100644
224 } 223 }
225 224
226-- 225--
2272.25.1 2262.37.1 (Apple Git-137.1)
228 227
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/0018-Patch-MicroBlaze-Adding-new-relocation-to-support-64.patch
index 135af627..6a70dbfb 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/0018-Patch-MicroBlaze-Adding-new-relocation-to-support-64.patch
@@ -1,17 +1,16 @@
1From 2034e50763e51635405988d0cf67345cad1b2101 Mon Sep 17 00:00:00 2001 1From 6209a572f4ec70608564fa7aa0270d640aa421f0 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 18/34] [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>
8--- 7---
9 bfd/elf64-microblaze.c | 11 +++++++-- 8 bfd/elf64-microblaze.c | 11 +++++++--
10 gas/config/tc-microblaze.c | 49 ++++++++++++++++++++++++++++++++++---- 9 gas/config/tc-microblaze.c | 49 ++++++++++++++++++++++++++++++++++----
11 2 files changed, 54 insertions(+), 6 deletions(-) 10 2 files changed, 54 insertions(+), 6 deletions(-)
12 11
13diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 12diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
14index 2d4820c50fe..97131c352c7 100644 13index f16b544b1fc..355e9131987 100644
15--- a/bfd/elf64-microblaze.c 14--- a/bfd/elf64-microblaze.c
16+++ b/bfd/elf64-microblaze.c 15+++ b/bfd/elf64-microblaze.c
17@@ -1529,6 +1529,7 @@ microblaze_elf_relocate_section (bfd *output_bfd, 16@@ -1529,6 +1529,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
@@ -49,7 +48,7 @@ index 2d4820c50fe..97131c352c7 100644
49 else 48 else
50 { 49 {
51 if (r_type == R_MICROBLAZE_64_PCREL) 50 if (r_type == R_MICROBLAZE_64_PCREL)
52@@ -2165,7 +2170,8 @@ microblaze_elf_relax_section (bfd *abfd, 51@@ -2166,7 +2171,8 @@ microblaze_elf_relax_section (bfd *abfd,
53 microblaze_bfd_write_imm_value_32 (abfd, ocontents + irelscan->r_offset, 52 microblaze_bfd_write_imm_value_32 (abfd, ocontents + irelscan->r_offset,
54 irelscan->r_addend); 53 irelscan->r_addend);
55 } 54 }
@@ -59,7 +58,7 @@ index 2d4820c50fe..97131c352c7 100644
59 { 58 {
60 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 59 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
61 60
62@@ -2640,6 +2646,7 @@ microblaze_elf_check_relocs (bfd * abfd, 61@@ -2633,6 +2639,7 @@ microblaze_elf_check_relocs (bfd * abfd,
63 case R_MICROBLAZE_64: 62 case R_MICROBLAZE_64:
64 case R_MICROBLAZE_64_PCREL: 63 case R_MICROBLAZE_64_PCREL:
65 case R_MICROBLAZE_32: 64 case R_MICROBLAZE_32:
@@ -164,5 +163,5 @@ index d3de049e9c0..76ce516d8aa 100644
164 default: 163 default:
165 as_bad (_("unsupported BFD relocation size %u"), size); 164 as_bad (_("unsupported BFD relocation size %u"), size);
166-- 165--
1672.25.1 1662.37.1 (Apple Git-137.1)
168 167
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0021-fixing-the-.bss-relocation-issue.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0019-fixing-the-.bss-relocation-issue.patch
index 848770b8..5826f0a3 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0021-fixing-the-.bss-relocation-issue.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0019-fixing-the-.bss-relocation-issue.patch
@@ -1,18 +1,19 @@
1From cec495577424c4d5c4c77949a624bc33991ac673 Mon Sep 17 00:00:00 2001 1From 35e89c09636e2ce2f5eafcf62941d15ece79a172 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 19/34] fixing the .bss relocation issue
5 5
6Conflicts: 6Conflicts:
7 bfd/elf64-microblaze.c 7 bfd/elf64-microblaze.c
8 8
9Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> 9Conflicts:
10 bfd/elf64-microblaze.c
10--- 11---
11 bfd/elf64-microblaze.c | 32 +++++++++++++++++++------------- 12 bfd/elf64-microblaze.c | 41 +++++++++++++++++++++++++++++------------
12 1 file changed, 19 insertions(+), 13 deletions(-) 13 1 file changed, 29 insertions(+), 12 deletions(-)
13 14
14diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 15diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
15index 97131c352c7..fe73de86659 100644 16index 355e9131987..eb7f9138884 100644
16--- a/bfd/elf64-microblaze.c 17--- a/bfd/elf64-microblaze.c
17+++ b/bfd/elf64-microblaze.c 18+++ b/bfd/elf64-microblaze.c
18@@ -1555,14 +1555,14 @@ microblaze_elf_relocate_section (bfd *output_bfd, 19@@ -1555,14 +1555,14 @@ microblaze_elf_relocate_section (bfd *output_bfd,
@@ -65,19 +66,37 @@ index 97131c352c7..fe73de86659 100644
65 { 66 {
66 instr_hi &= ~0x00ffffff; 67 instr_hi &= ~0x00ffffff;
67 instr_hi |= (val >> 16) & 0xffffff; 68 instr_hi |= (val >> 16) & 0xffffff;
68@@ -2320,7 +2320,10 @@ microblaze_elf_relax_section (bfd *abfd, 69@@ -2294,6 +2294,8 @@ microblaze_elf_relax_section (bfd *abfd,
69 unsigned long instr_lo = bfd_get_32 (abfd, ocontents 70 if (isym->st_shndx == shndx
70 + irelscan->r_offset 71 && (ELF64_ST_TYPE (isym->st_info) == STT_SECTION))
71 + INST_WORD_SIZE); 72 {
72- immediate = (instr_hi & 0x0000ffff) << 16; 73+ bfd_vma immediate;
73+ if ((instr_hi & 0xff000000) == 0xb2000000) 74+
74+ immediate = (instr_hi & 0x00ffffff) << 24; 75 if (ocontents == NULL)
75+ else 76 {
76+ immediate = (instr_hi & 0x0000ffff) << 16; 77 if (elf_section_data (o)->this_hdr.contents != NULL)
77 immediate |= (instr_lo & 0x0000ffff); 78@@ -2316,8 +2318,20 @@ microblaze_elf_relax_section (bfd *abfd,
79 elf_section_data (o)->this_hdr.contents = ocontents;
80 }
81 }
82+ unsigned long instr_hi = bfd_get_32 (abfd, ocontents
83+ + irelscan->r_offset);
84+ unsigned long instr_lo = bfd_get_32 (abfd, ocontents
85+ + irelscan->r_offset
86+ + INST_WORD_SIZE);
87+ if ((instr_hi & 0xff000000) == 0xb2000000)
88+ immediate = (instr_hi & 0x00ffffff) << 24;
89+ else
90+ immediate = (instr_hi & 0x0000ffff) << 16;
91+ immediate |= (instr_lo & 0x0000ffff);
78 offset = calc_fixup (irelscan->r_addend, 0, sec); 92 offset = calc_fixup (irelscan->r_addend, 0, sec);
79 immediate -= offset; 93+ immediate -= offset;
80@@ -2364,7 +2367,10 @@ microblaze_elf_relax_section (bfd *abfd, 94 irelscan->r_addend -= offset;
95+
96 }
97 }
98 else if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_PCREL)
99@@ -2357,7 +2371,10 @@ microblaze_elf_relax_section (bfd *abfd,
81 unsigned long instr_lo = bfd_get_32 (abfd, ocontents 100 unsigned long instr_lo = bfd_get_32 (abfd, ocontents
82 + irelscan->r_offset 101 + irelscan->r_offset
83 + INST_WORD_SIZE); 102 + INST_WORD_SIZE);
@@ -90,5 +109,5 @@ index 97131c352c7..fe73de86659 100644
90 target_address = immediate; 109 target_address = immediate;
91 offset = calc_fixup (target_address, 0, sec); 110 offset = calc_fixup (target_address, 0, sec);
92-- 111--
932.25.1 1122.37.1 (Apple Git-137.1)
94 113
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/0020-Fixed-the-bug-in-the-R_MICROBLAZE_64_NONE-relocation.patch
index 2821a1e2..21fab2de 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/0020-Fixed-the-bug-in-the-R_MICROBLAZE_64_NONE-relocation.patch
@@ -1,20 +1,21 @@
1From 622b9e85bde4a88ecfe1884179f547575224b984 Mon Sep 17 00:00:00 2001 1From 6c6490ed5a5c5c00d1b18a1f446280689bb572d1 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 20/34] 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> 7Conflicts:
8 bfd/elf64-microblaze.c
8--- 9---
9 bfd/elf32-microblaze.c | 4 ++-- 10 bfd/elf32-microblaze.c | 4 ++--
10 bfd/elf64-microblaze.c | 4 ++-- 11 bfd/elf64-microblaze.c | 4 ++--
11 2 files changed, 4 insertions(+), 4 deletions(-) 12 2 files changed, 4 insertions(+), 4 deletions(-)
12 13
13diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 14diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
14index 71ff973573c..f41b503cbb5 100644 15index f20adb6fd73..88ac730582b 100644
15--- a/bfd/elf32-microblaze.c 16--- a/bfd/elf32-microblaze.c
16+++ b/bfd/elf32-microblaze.c 17+++ b/bfd/elf32-microblaze.c
17@@ -2059,8 +2059,8 @@ microblaze_elf_relax_section (bfd *abfd, 18@@ -2060,8 +2060,8 @@ microblaze_elf_relax_section (bfd *abfd,
18 sfix = calc_fixup (irel->r_offset + INST_WORD_SIZE, 0, sec); 19 sfix = calc_fixup (irel->r_offset + INST_WORD_SIZE, 0, sec);
19 efix = calc_fixup (target_address, 0, sec); 20 efix = calc_fixup (target_address, 0, sec);
20 irel->r_addend -= (efix - sfix); 21 irel->r_addend -= (efix - sfix);
@@ -26,20 +27,20 @@ index 71ff973573c..f41b503cbb5 100644
26 break; 27 break;
27 } 28 }
28diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 29diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
29index fe73de86659..387ee0da261 100644 30index eb7f9138884..03fe9eba53a 100644
30--- a/bfd/elf64-microblaze.c 31--- a/bfd/elf64-microblaze.c
31+++ b/bfd/elf64-microblaze.c 32+++ b/bfd/elf64-microblaze.c
32@@ -2097,8 +2097,8 @@ microblaze_elf_relax_section (bfd *abfd, 33@@ -2098,8 +2098,8 @@ microblaze_elf_relax_section (bfd *abfd,
33 sfix = calc_fixup (irel->r_offset + INST_WORD_SIZE, 0, sec); 34 sfix = calc_fixup (irel->r_offset + INST_WORD_SIZE, 0, sec);
34 efix = calc_fixup (target_address, 0, sec); 35 efix = calc_fixup (target_address, 0, sec);
35 irel->r_addend -= (efix - sfix); 36 irel->r_addend -= (efix - sfix);
36- microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset 37- microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset
37- + INST_WORD_SIZE, irel->r_addend); 38- + INST_WORD_SIZE, irel->r_addend);
38+ microblaze_bfd_write_imm_value_64 (abfd, contents + irel->r_offset, 39+ microblaze_bfd_write_imm_value_64 (abfd, contents + irel->r_offset,
39+ irel->r_addend); 40+ irel->r_addend);
40 } 41 }
41 break; 42 break;
42 } 43 }
43-- 44--
442.25.1 452.37.1 (Apple Git-137.1)
45 46
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0023-Revert-ld-Remove-unused-expression-state-defsym-symb.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0021-Revert-ld-Remove-unused-expression-state.patch
index 7d23ee2c..ab7f2077 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0023-Revert-ld-Remove-unused-expression-state-defsym-symb.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0021-Revert-ld-Remove-unused-expression-state.patch
@@ -1,7 +1,7 @@
1From 99193a486cc44f7bb56019a10bef413f7f7d9fd7 Mon Sep 17 00:00:00 2001 1From 6238123cdc680941f3b3a253cca5be06d5c81492 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 21/34] Revert "ld: Remove unused expression state" --defsym
5 symbol=expression Create a global symbol in the output file, containing the 5 symbol=expression Create a global symbol in the output file, containing the
6 absolute address given by expression. 6 absolute address given by expression.
7 7
@@ -13,8 +13,6 @@ 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>
18--- 16---
19 ld/ldexp.c | 8 +++++--- 17 ld/ldexp.c | 8 +++++---
20 ld/ldexp.h | 1 + 18 ld/ldexp.h | 1 +
@@ -80,5 +78,5 @@ index ed6fb8be715..e838b736306 100644
80 } assign; 78 } assign;
81 struct { 79 struct {
82-- 80--
832.25.1 812.37.1 (Apple Git-137.1)
84 82
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/0022-fixing-the-long-long-long-mingw-toolchain-issue.patch
index 548d7f61..bfb68360 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/0022-fixing-the-long-long-long-mingw-toolchain-issue.patch
@@ -1,9 +1,8 @@
1From f1c19a5ca7d28745cd9b28f155609eed70c1b349 Mon Sep 17 00:00:00 2001 1From 24269bd086efcd37f702b92fd25dfe45faa7dfb6 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 22/34] fixing the long & long long mingw toolchain issue
5 5
6Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
7--- 6---
8 gas/config/tc-microblaze.c | 10 +++++----- 7 gas/config/tc-microblaze.c | 10 +++++-----
9 opcodes/microblaze-opc.h | 4 ++-- 8 opcodes/microblaze-opc.h | 4 ++--
@@ -54,5 +53,5 @@ index 5e45df995de..6b25d12dace 100644
54 #endif /* MICROBLAZE_OPC */ 53 #endif /* MICROBLAZE_OPC */
55 54
56-- 55--
572.25.1 562.37.1 (Apple Git-137.1)
58 57
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/0023-Added-support-to-new-arithmetic-single-register-inst.patch
index ca61b1a6..0b8c83cd 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/0023-Added-support-to-new-arithmetic-single-register-inst.patch
@@ -1,7 +1,7 @@
1From 16dfbc9464ebbf642cae6e45edd96f5fe14a6c0f Mon Sep 17 00:00:00 2001 1From 3c197b12c4b680a230e8350ecd9a523be804fe3c 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 23/34] Added support to new arithmetic single register
5 instructions 5 instructions
6 6
7Conflicts: 7Conflicts:
@@ -11,7 +11,10 @@ Conflicts:
11 gas/config/tc-microblaze.c 11 gas/config/tc-microblaze.c
12 opcodes/microblaze-dis.c 12 opcodes/microblaze-dis.c
13 13
14Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> 14Conflicts:
15 gas/config/tc-microblaze.c
16signed-off-by:Nagaraju <nmekala@xilinx.com>
17 Mahesh <mbodapat@xilinx.com>
15--- 18---
16 gas/config/tc-microblaze.c | 147 ++++++++++++++++++++++++++++++++++++- 19 gas/config/tc-microblaze.c | 147 ++++++++++++++++++++++++++++++++++++-
17 opcodes/microblaze-dis.c | 11 +++ 20 opcodes/microblaze-dis.c | 11 +++
@@ -20,7 +23,7 @@ Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
20 4 files changed, 200 insertions(+), 6 deletions(-) 23 4 files changed, 200 insertions(+), 6 deletions(-)
21 24
22diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 25diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
23index a1fb6ccbd44..bca3793c2d8 100644 26index a1fb6ccbd44..27544b60ea3 100644
24--- a/gas/config/tc-microblaze.c 27--- a/gas/config/tc-microblaze.c
25+++ b/gas/config/tc-microblaze.c 28+++ b/gas/config/tc-microblaze.c
26@@ -423,12 +423,33 @@ void 29@@ -423,12 +423,33 @@ void
@@ -72,10 +75,10 @@ index a1fb6ccbd44..bca3793c2d8 100644
72 unsigned isize; 75 unsigned isize;
73 unsigned long immed = 0, immed2 = 0, temp; 76 unsigned long immed = 0, immed2 = 0, temp;
74- expressionS exp; 77- expressionS exp;
75+ expressionS exp, exp1; 78+ expressionS exp,exp1;
76 char name[20]; 79 char name[20];
77 long immedl; 80 long immedl;
78+ int reg = 0; 81+ int reg=0;
79 82
80 /* Drop leading whitespace. */ 83 /* Drop leading whitespace. */
81 while (ISSPACE (* str)) 84 while (ISSPACE (* str))
@@ -212,7 +215,7 @@ index a1fb6ccbd44..bca3793c2d8 100644
212 if (strcmp (op_end, "")) 215 if (strcmp (op_end, ""))
213 op_end = parse_reg (op_end + 1, &reg1); /* Get r1. */ 216 op_end = parse_reg (op_end + 1, &reg1); /* Get r1. */
214diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c 217diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c
215index 97e21a38bd2..0814cab5bdb 100644 218index d837ebb38e2..b5a78dcfe09 100644
216--- a/opcodes/microblaze-dis.c 219--- a/opcodes/microblaze-dis.c
217+++ b/opcodes/microblaze-dis.c 220+++ b/opcodes/microblaze-dis.c
218@@ -130,6 +130,14 @@ get_field_imm15 (struct string_buf *buf, long instr) 221@@ -130,6 +130,14 @@ get_field_imm15 (struct string_buf *buf, long instr)
@@ -230,7 +233,7 @@ index 97e21a38bd2..0814cab5bdb 100644
230 static char * 233 static char *
231 get_field_special (struct string_buf *buf, long instr, 234 get_field_special (struct string_buf *buf, long instr,
232 const struct op_code_struct *op) 235 const struct op_code_struct *op)
233@@ -456,6 +464,9 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info) 236@@ -457,6 +465,9 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
234 /* For mbar 16 or sleep insn. */ 237 /* For mbar 16 or sleep insn. */
235 case INST_TYPE_NONE: 238 case INST_TYPE_NONE:
236 break; 239 break;
@@ -362,5 +365,5 @@ index b242ea73c7b..5c44a5ff0ac 100644
362 365
363 #endif /* MICROBLAZE-OPCM */ 366 #endif /* MICROBLAZE-OPCM */
364-- 367--
3652.25.1 3682.37.1 (Apple Git-137.1)
366 369
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0026-double-imml-generation-for-64-bit-values.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0024-Patch-MicroBlaze-double-imml-generation-for-64-bit-v.patch
index 50ce1c4e..6d0df558 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0026-double-imml-generation-for-64-bit-values.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0024-Patch-MicroBlaze-double-imml-generation-for-64-bit-v.patch
@@ -1,19 +1,18 @@
1From 214d99aef9b21ddbb07c120495203861dfe52c43 Mon Sep 17 00:00:00 2001 1From ec5bfe546213b2cb7fe2a51f9f9571597b2c5aa9 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] double imml generation for 64 bit values. 4Subject: [PATCH 24/34] [Patch,MicroBlaze] : double imml generation for 64 bit
5 values.
5 6
6Conflicts: 7Conflicts:
7 gas/config/tc-microblaze.c 8 gas/config/tc-microblaze.c
8
9Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
10--- 9---
11 gas/config/tc-microblaze.c | 321 ++++++++++++++++++++++++++++++------- 10 gas/config/tc-microblaze.c | 321 ++++++++++++++++++++++++++++++-------
12 opcodes/microblaze-opc.h | 4 +- 11 opcodes/microblaze-opc.h | 4 +-
13 2 files changed, 262 insertions(+), 63 deletions(-) 12 2 files changed, 262 insertions(+), 63 deletions(-)
14 13
15diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 14diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
16index bca3793c2d8..454d4875ee1 100644 15index 27544b60ea3..4c455ff02b8 100644
17--- a/gas/config/tc-microblaze.c 16--- a/gas/config/tc-microblaze.c
18+++ b/gas/config/tc-microblaze.c 17+++ b/gas/config/tc-microblaze.c
19@@ -1008,7 +1008,7 @@ md_assemble (char * str) 18@@ -1008,7 +1008,7 @@ md_assemble (char * str)
@@ -542,5 +541,5 @@ index 82da7f1179a..e65f4b58233 100644
542 #endif /* MICROBLAZE_OPC */ 541 #endif /* MICROBLAZE_OPC */
543 542
544-- 543--
5452.25.1 5442.37.1 (Apple Git-137.1)
546 545
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/0025-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch
index 13963265..74fcea81 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/0025-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch
@@ -1,17 +1,15 @@
1From 1b2e218f16714358ffc0cbffedeaa36725f56819 Mon Sep 17 00:00:00 2001 1From 0ba14f999b266406e7e86fc0e7311ebb275e7b97 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 25/34] 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>
9--- 7---
10 gas/config/tc-microblaze.c | 50 +++++++++++++++++++++++++++++++++++--- 8 gas/config/tc-microblaze.c | 50 +++++++++++++++++++++++++++++++++++---
11 1 file changed, 47 insertions(+), 3 deletions(-) 9 1 file changed, 47 insertions(+), 3 deletions(-)
12 10
13diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 11diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
14index 454d4875ee1..23c0d080d9d 100644 12index 4c455ff02b8..bccaafe296c 100644
15--- a/gas/config/tc-microblaze.c 13--- a/gas/config/tc-microblaze.c
16+++ b/gas/config/tc-microblaze.c 14+++ b/gas/config/tc-microblaze.c
17@@ -1643,12 +1643,56 @@ md_assemble (char * str) 15@@ -1643,12 +1643,56 @@ md_assemble (char * str)
@@ -84,5 +82,5 @@ index 454d4875ee1..23c0d080d9d 100644
84 /* Needs an immediate inst. */ 82 /* Needs an immediate inst. */
85 if (((long long)immed) > (long long)-549755813888 && ((long long)immed) < (long long)549755813887) 83 if (((long long)immed) > (long long)-549755813888 && ((long long)immed) < (long long)549755813887)
86-- 84--
872.25.1 852.37.1 (Apple Git-137.1)
88 86
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0028-This-patch-will-remove-imml-0-and-imml-1-instruction.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0026-Patch-MicroBlaze-m64-This-patch-will-remove-imml-0-a.patch
index afc0e67b..8058c6a6 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0028-This-patch-will-remove-imml-0-and-imml-1-instruction.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0026-Patch-MicroBlaze-m64-This-patch-will-remove-imml-0-a.patch
@@ -1,16 +1,16 @@
1From 3b7579366a80e4f8585f6bd5ab22a595909f6057 Mon Sep 17 00:00:00 2001 1From 6e92cc2429ec37ced6cc70596ad7c6217d25e806 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] This patch will remove imml 0 and imml -1 instructions 4Subject: [PATCH 26/34] [Patch,MicroBlaze m64] : This patch will remove imml 0
5 when the offset is less than 16 bit for Type A branch EA instructions. 5 and imml -1 instructions when the offset is less than 16 bit for Type A
6 branch EA instructions.
6 7
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 23c0d080d9d..2378e5037a8 100644 13index bccaafe296c..85509011f8c 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 23c0d080d9d..2378e5037a8 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.25.1 372.37.1 (Apple Git-137.1)
38 38
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0029-improper-address-mapping-of-PROVIDE-directive-symbol.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0027-Patch-MicroBlaze-improper-address-mapping-of-PROVIDE.patch
index 80f8c526..50819300 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0029-improper-address-mapping-of-PROVIDE-directive-symbol.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0027-Patch-MicroBlaze-improper-address-mapping-of-PROVIDE.patch
@@ -1,12 +1,11 @@
1From 8124e17da0056fa6c9f650a0ee5631261e78b93e Mon Sep 17 00:00:00 2001 1From 7f4c17e26065d8194a2512f2982c245afa0e7e40 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] improper address mapping of PROVIDE directive 4Subject: [PATCH 27/34] [Patch,MicroBlaze] : improper address mapping of
5 symbols[DTOR_END] are causing runtime loops and we don't need to override 5 PROVIDE directive symbols[DTOR_END] are causing runtime loops and we don't
6 PROVIDE symbols if symbols are defined in libraries and linker so I am 6 need to override PROVIDE symbols if symbols are defined in libraries and
7 disabling override for PROVIDE symbols. 7 linker so I am disabling override for PROVIDE symbols.
8 8
9Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
10--- 9---
11 ld/ldlang.c | 12 +++++++++--- 10 ld/ldlang.c | 12 +++++++++---
12 1 file changed, 9 insertions(+), 3 deletions(-) 11 1 file changed, 9 insertions(+), 3 deletions(-)
@@ -36,5 +35,5 @@ index f12c09633a7..4a71abc7cbc 100644
36 break; 35 break;
37 } 36 }
38-- 37--
392.25.1 382.37.1 (Apple Git-137.1)
40 39
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0030-Changing-the-long-to-long-long-as-in-Windows-long-is.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0028-Patch-microblaze-Changing-the-long-to-long-long-as-i.patch
index 045dbbb1..c7c4f1d1 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0030-Changing-the-long-to-long-long-as-in-Windows-long-is.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0028-Patch-microblaze-Changing-the-long-to-long-long-as-i.patch
@@ -1,17 +1,19 @@
1From 6af09208c03034774aca624b50b2526878ea210e Mon Sep 17 00:00:00 2001 1From 3e308d91912ade69f914383fd9c13f934da37be4 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] Changing the long to long long as in Windows long is 4Subject: [PATCH 28/34] [Patch, microblaze]:Changing the long to long long as
5 32-bit but we need the variable to be 64-bit 5 in Windows long is 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
9Conflicts:
10 gas/config/tc-microblaze.c
9--- 11---
10 gas/config/tc-microblaze.c | 2 +- 12 gas/config/tc-microblaze.c | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-) 13 1 file changed, 1 insertion(+), 1 deletion(-)
12 14
13diff --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
14index 2378e5037a8..604a8df86a2 100644 16index 85509011f8c..31677446114 100644
15--- a/gas/config/tc-microblaze.c 17--- a/gas/config/tc-microblaze.c
16+++ b/gas/config/tc-microblaze.c 18+++ b/gas/config/tc-microblaze.c
17@@ -1017,7 +1017,7 @@ md_assemble (char * str) 19@@ -1017,7 +1017,7 @@ md_assemble (char * str)
@@ -20,9 +22,9 @@ index 2378e5037a8..604a8df86a2 100644
20 unsigned isize; 22 unsigned isize;
21- unsigned long immed = 0, immed2 = 0, temp; 23- unsigned long immed = 0, immed2 = 0, temp;
22+ unsigned long long immed = 0, immed2 = 0, temp; 24+ unsigned long long immed = 0, immed2 = 0, temp;
23 expressionS exp, exp1; 25 expressionS exp,exp1;
24 char name[20]; 26 char name[20];
25 long immedl; 27 long immedl;
26-- 28--
272.25.1 292.37.1 (Apple Git-137.1)
28 30
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/0029-gas-revert-moving-of-md_pseudo_table-from-const.patch
index df7a72d4..205f04fe 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/0029-gas-revert-moving-of-md_pseudo_table-from-const.patch
@@ -1,7 +1,7 @@
1From 276d9d6138efbe27d2542f9b3dfb2a47072ec588 Mon Sep 17 00:00:00 2001 1From 24d43f5ce8746c653de7de3fad46915755ba789d 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 29/34] gas: revert moving of md_pseudo_table from const
5 5
6The base system expect md_pseudo_table to be constant, Changing the 6The base system expect md_pseudo_table to be constant, Changing the
7definition will break other architectures when compiled with a 7definition will break other architectures when compiled with a
@@ -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 604a8df86a2..123d5ba6214 100644 21index 31677446114..6b398ab5605 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)
@@ -79,5 +79,5 @@ index bb9a935a353..4a740f9bdd9 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.25.1 822.37.1 (Apple Git-137.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/0030-ld-emulparams-elf64microblaze-Fix-emulation-generati.patch
index 9146144a..bfb65224 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0032-ld-emulparams-elf64microblaze-Fix-emulation-generati.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0030-ld-emulparams-elf64microblaze-Fix-emulation-generati.patch
@@ -1,7 +1,7 @@
1From 23b792fc927b4f24eb20f841cfef6b9548c1d547 Mon Sep 17 00:00:00 2001 1From 62107ba949fe70e5ae0573147d82cbb52bd1fc08 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 30/34] ld/emulparams/elf64microblaze: Fix emulation generation
5 5
6Compilation fails when building ld-new with: 6Compilation fails when building ld-new with:
7 7
@@ -11,7 +11,6 @@ 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>
15--- 14---
16 ld/emulparams/elf64microblaze.sh | 2 +- 15 ld/emulparams/elf64microblaze.sh | 2 +-
17 ld/emulparams/elf64microblazeel.sh | 2 +- 16 ld/emulparams/elf64microblazeel.sh | 2 +-
@@ -40,5 +39,5 @@ index 9c7b0eb7080..7b4c7c411bd 100644
40+TEMPLATE_NAME=elf 39+TEMPLATE_NAME=elf
41 #GENERATE_SHLIB_SCRIPT=yes 40 #GENERATE_SHLIB_SCRIPT=yes
42-- 41--
432.25.1 422.37.1 (Apple Git-137.1)
44 43
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0038-Invalid-data-offsets-pointer-after-relaxation.-Propo.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0031-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch
index a34478f2..cb31c0d7 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0038-Invalid-data-offsets-pointer-after-relaxation.-Propo.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0031-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch
@@ -1,21 +1,20 @@
1From 7eddc47ff5eecc2e383c96f4712185c42347105b Mon Sep 17 00:00:00 2001 1From 7bddfaf3ad574aa738ab903f63a345ebde134f9e 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 38/38] Invalid data offsets (pointer) after relaxation. 4Subject: [PATCH 31/34] [Patch,MicroBlaze] : Invalid data offsets (pointer)
5 Proposed patch from community member (dednev@rambler.ru) against 2021.1 5 after relaxation. Proposed patch from community member (dednev@rambler.ru)
6 [CR-1115232] 6 against 2021.1 [CR-1115232]
7 7
8Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
9--- 8---
10 bfd/elf32-microblaze.c | 18 ++++++++++++++++++ 9 bfd/elf32-microblaze.c | 18 ++++++++++++++++++
11 bfd/elf64-microblaze.c | 17 +++++++++++++++++ 10 bfd/elf64-microblaze.c | 17 +++++++++++++++++
12 2 files changed, 35 insertions(+) 11 2 files changed, 35 insertions(+)
13 12
14diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 13diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
15index 8b947a6ec79..0655d0fe975 100644 14index 88ac730582b..588367ebcbb 100644
16--- a/bfd/elf32-microblaze.c 15--- a/bfd/elf32-microblaze.c
17+++ b/bfd/elf32-microblaze.c 16+++ b/bfd/elf32-microblaze.c
18@@ -2174,6 +2174,9 @@ microblaze_elf_relax_section (bfd *abfd, 17@@ -2095,6 +2095,9 @@ microblaze_elf_relax_section (bfd *abfd,
19 { 18 {
20 unsigned int val; 19 unsigned int val;
21 20
@@ -25,7 +24,7 @@ index 8b947a6ec79..0655d0fe975 100644
25 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 24 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
26 25
27 /* hax: We only do the following fixup for debug location lists. */ 26 /* hax: We only do the following fixup for debug location lists. */
28@@ -2215,6 +2218,9 @@ microblaze_elf_relax_section (bfd *abfd, 27@@ -2136,6 +2139,9 @@ microblaze_elf_relax_section (bfd *abfd,
29 } 28 }
30 if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32) 29 if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32)
31 { 30 {
@@ -35,7 +34,7 @@ index 8b947a6ec79..0655d0fe975 100644
35 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 34 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
36 35
37 /* Look at the reloc only if the value has been resolved. */ 36 /* Look at the reloc only if the value has been resolved. */
38@@ -2247,6 +2253,9 @@ microblaze_elf_relax_section (bfd *abfd, 37@@ -2168,6 +2174,9 @@ microblaze_elf_relax_section (bfd *abfd,
39 } 38 }
40 else if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_SYM_OP_SYM) 39 else if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_SYM_OP_SYM)
41 { 40 {
@@ -45,7 +44,7 @@ index 8b947a6ec79..0655d0fe975 100644
45 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 44 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
46 45
47 /* Look at the reloc only if the value has been resolved. */ 46 /* Look at the reloc only if the value has been resolved. */
48@@ -2284,6 +2293,9 @@ microblaze_elf_relax_section (bfd *abfd, 47@@ -2205,6 +2214,9 @@ microblaze_elf_relax_section (bfd *abfd,
49 || (ELF32_R_TYPE (irelscan->r_info) 48 || (ELF32_R_TYPE (irelscan->r_info)
50 == (int) R_MICROBLAZE_TEXTREL_32_LO)) 49 == (int) R_MICROBLAZE_TEXTREL_32_LO))
51 { 50 {
@@ -55,7 +54,7 @@ index 8b947a6ec79..0655d0fe975 100644
55 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 54 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
56 55
57 /* Look at the reloc only if the value has been resolved. */ 56 /* Look at the reloc only if the value has been resolved. */
58@@ -2330,6 +2342,9 @@ microblaze_elf_relax_section (bfd *abfd, 57@@ -2251,6 +2263,9 @@ microblaze_elf_relax_section (bfd *abfd,
59 || (ELF32_R_TYPE (irelscan->r_info) 58 || (ELF32_R_TYPE (irelscan->r_info)
60 == (int) R_MICROBLAZE_TEXTREL_64)) 59 == (int) R_MICROBLAZE_TEXTREL_64))
61 { 60 {
@@ -65,7 +64,7 @@ index 8b947a6ec79..0655d0fe975 100644
65 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 64 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
66 65
67 /* Look at the reloc only if the value has been resolved. */ 66 /* Look at the reloc only if the value has been resolved. */
68@@ -2364,6 +2379,9 @@ microblaze_elf_relax_section (bfd *abfd, 67@@ -2285,6 +2300,9 @@ microblaze_elf_relax_section (bfd *abfd,
69 } 68 }
70 else if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_PCREL) 69 else if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_PCREL)
71 { 70 {
@@ -76,10 +75,10 @@ index 8b947a6ec79..0655d0fe975 100644
76 75
77 /* Look at the reloc only if the value has been resolved. */ 76 /* Look at the reloc only if the value has been resolved. */
78diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 77diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
79index cecfb5506f8..c7bf5a71f08 100644 78index 03fe9eba53a..76aec43ec7a 100644
80--- a/bfd/elf64-microblaze.c 79--- a/bfd/elf64-microblaze.c
81+++ b/bfd/elf64-microblaze.c 80+++ b/bfd/elf64-microblaze.c
82@@ -2165,6 +2165,8 @@ microblaze_elf_relax_section (bfd *abfd, 81@@ -2132,6 +2132,8 @@ microblaze_elf_relax_section (bfd *abfd,
83 if (1 && ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_NONE) 82 if (1 && ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_NONE)
84 { 83 {
85 unsigned int val; 84 unsigned int val;
@@ -88,7 +87,7 @@ index cecfb5506f8..c7bf5a71f08 100644
88 87
89 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 88 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
90 89
91@@ -2207,6 +2209,9 @@ microblaze_elf_relax_section (bfd *abfd, 90@@ -2174,6 +2176,9 @@ microblaze_elf_relax_section (bfd *abfd,
92 if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32 91 if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32
93 || ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_IMML_64) 92 || ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_IMML_64)
94 { 93 {
@@ -98,7 +97,7 @@ index cecfb5506f8..c7bf5a71f08 100644
98 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 97 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
99 98
100 /* Look at the reloc only if the value has been resolved. */ 99 /* Look at the reloc only if the value has been resolved. */
101@@ -2239,6 +2244,9 @@ microblaze_elf_relax_section (bfd *abfd, 100@@ -2206,6 +2211,9 @@ microblaze_elf_relax_section (bfd *abfd,
102 } 101 }
103 else if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_SYM_OP_SYM) 102 else if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_SYM_OP_SYM)
104 { 103 {
@@ -108,9 +107,9 @@ index cecfb5506f8..c7bf5a71f08 100644
108 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 107 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
109 108
110 /* Look at the reloc only if the value has been resolved. */ 109 /* Look at the reloc only if the value has been resolved. */
111@@ -2274,6 +2282,9 @@ microblaze_elf_relax_section (bfd *abfd, 110@@ -2243,6 +2251,9 @@ microblaze_elf_relax_section (bfd *abfd,
112 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_LO) 111 || (ELF32_R_TYPE (irelscan->r_info)
113 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_TEXTREL_32_LO)) 112 == (int) R_MICROBLAZE_TEXTREL_32_LO))
114 { 113 {
115+ if (ELF64_R_SYM (irelscan->r_info) >= symtab_hdr->sh_info) 114+ if (ELF64_R_SYM (irelscan->r_info) >= symtab_hdr->sh_info)
116+ continue; 115+ continue;
@@ -118,7 +117,7 @@ index cecfb5506f8..c7bf5a71f08 100644
118 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 117 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
119 118
120 /* Look at the reloc only if the value has been resolved. */ 119 /* Look at the reloc only if the value has been resolved. */
121@@ -2319,6 +2330,9 @@ microblaze_elf_relax_section (bfd *abfd, 120@@ -2288,6 +2299,9 @@ microblaze_elf_relax_section (bfd *abfd,
122 if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64 121 if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64
123 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_TEXTREL_64)) 122 || (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_TEXTREL_64))
124 { 123 {
@@ -128,7 +127,7 @@ index cecfb5506f8..c7bf5a71f08 100644
128 isym = isymbuf + ELF64_R_SYM (irelscan->r_info); 127 isym = isymbuf + ELF64_R_SYM (irelscan->r_info);
129 128
130 /* Look at the reloc only if the value has been resolved. */ 129 /* Look at the reloc only if the value has been resolved. */
131@@ -2366,6 +2380,9 @@ microblaze_elf_relax_section (bfd *abfd, 130@@ -2336,6 +2350,9 @@ microblaze_elf_relax_section (bfd *abfd,
132 } 131 }
133 else if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_PCREL) 132 else if (ELF64_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_PCREL)
134 { 133 {
@@ -139,5 +138,5 @@ index cecfb5506f8..c7bf5a71f08 100644
139 138
140 /* Look at the reloc only if the value has been resolved. */ 139 /* Look at the reloc only if the value has been resolved. */
141-- 140--
1422.25.1 1412.37.1 (Apple Git-137.1)
143 142
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0036-Double-free-with-ld-no-keep-memory.-Proposed-patches.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0032-Patch-MicroBlaze-Double-free-with-ld-no-keep-memory.patch
index 04a1ea67..e9556bf5 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0036-Double-free-with-ld-no-keep-memory.-Proposed-patches.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0032-Patch-MicroBlaze-Double-free-with-ld-no-keep-memory.patch
@@ -1,20 +1,23 @@
1From 24272469bcd56fd8f1e0095e0b2650f03c2cd962 Mon Sep 17 00:00:00 2001 1From 70268d8d38851d06bd66f9c7cc85865f2f3c0e48 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 36/38] Double free with ld --no-keep-memory. Proposed patches 4Subject: [PATCH 32/34] [Patch,MicroBlaze] : Double free with ld
5 from the community member (dednev@rambler.ru) for 2021.1. [CR-1115233] 5 --no-keep-memory. Proposed patches from the community member
6 (dednev@rambler.ru) for 2021.1. [CR-1115233]
6 7
7Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> 8Conflicts:
9 bfd/elf32-microblaze.c
10 bfd/elf64-microblaze.c
8--- 11---
9 bfd/elf32-microblaze.c | 39 ++++++++++++++++++++------------------ 12 bfd/elf32-microblaze.c | 40 ++++++++++++++++++++++------------------
10 bfd/elf64-microblaze.c | 43 ++++++++++++++++++++---------------------- 13 bfd/elf64-microblaze.c | 38 ++++++++++++++++++++------------------
11 2 files changed, 41 insertions(+), 41 deletions(-) 14 2 files changed, 42 insertions(+), 36 deletions(-)
12 15
13diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 16diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
14index 9c6d0411420..e284b0e5398 100644 17index 588367ebcbb..28589db662f 100644
15--- a/bfd/elf32-microblaze.c 18--- a/bfd/elf32-microblaze.c
16+++ b/bfd/elf32-microblaze.c 19+++ b/bfd/elf32-microblaze.c
17@@ -1881,10 +1881,8 @@ microblaze_elf_relax_section (bfd *abfd, 20@@ -1800,10 +1800,8 @@ microblaze_elf_relax_section (bfd *abfd,
18 { 21 {
19 Elf_Internal_Shdr *symtab_hdr; 22 Elf_Internal_Shdr *symtab_hdr;
20 Elf_Internal_Rela *internal_relocs; 23 Elf_Internal_Rela *internal_relocs;
@@ -25,7 +28,7 @@ index 9c6d0411420..e284b0e5398 100644
25 int rel_count; 28 int rel_count;
26 unsigned int shndx; 29 unsigned int shndx;
27 size_t i, sym_index; 30 size_t i, sym_index;
28@@ -1928,8 +1926,6 @@ microblaze_elf_relax_section (bfd *abfd, 31@@ -1847,8 +1845,6 @@ microblaze_elf_relax_section (bfd *abfd,
29 internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, link_info->keep_memory); 32 internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, link_info->keep_memory);
30 if (internal_relocs == NULL) 33 if (internal_relocs == NULL)
31 goto error_return; 34 goto error_return;
@@ -34,7 +37,7 @@ index 9c6d0411420..e284b0e5398 100644
34 37
35 sdata->relax_count = 0; 38 sdata->relax_count = 0;
36 sdata->relax = (struct relax_table *) bfd_malloc ((sec->reloc_count + 1) 39 sdata->relax = (struct relax_table *) bfd_malloc ((sec->reloc_count + 1)
37@@ -1957,7 +1953,6 @@ microblaze_elf_relax_section (bfd *abfd, 40@@ -1876,7 +1872,6 @@ microblaze_elf_relax_section (bfd *abfd,
38 contents = (bfd_byte *) bfd_malloc (sec->size); 41 contents = (bfd_byte *) bfd_malloc (sec->size);
39 if (contents == NULL) 42 if (contents == NULL)
40 goto error_return; 43 goto error_return;
@@ -42,7 +45,7 @@ index 9c6d0411420..e284b0e5398 100644
42 45
43 if (!bfd_get_section_contents (abfd, sec, contents, 46 if (!bfd_get_section_contents (abfd, sec, contents,
44 (file_ptr) 0, sec->size)) 47 (file_ptr) 0, sec->size))
45@@ -2458,25 +2453,26 @@ microblaze_elf_relax_section (bfd *abfd, 48@@ -2396,25 +2391,26 @@ microblaze_elf_relax_section (bfd *abfd,
46 } 49 }
47 50
48 elf_section_data (sec)->relocs = internal_relocs; 51 elf_section_data (sec)->relocs = internal_relocs;
@@ -80,12 +83,13 @@ index 9c6d0411420..e284b0e5398 100644
80 } 83 }
81 84
82 if (sdata->relax_count == 0) 85 if (sdata->relax_count == 0)
83@@ -2490,8 +2486,15 @@ microblaze_elf_relax_section (bfd *abfd, 86@@ -2428,8 +2424,16 @@ microblaze_elf_relax_section (bfd *abfd,
84 return true; 87 return true;
85 88
86 error_return: 89 error_return:
87- free (free_relocs); 90- free (free_relocs);
88- free (free_contents); 91- free (free_contents);
92+
89+ if (isymbuf != NULL 93+ if (isymbuf != NULL
90+ && symtab_hdr->contents != (unsigned char *) isymbuf) 94+ && symtab_hdr->contents != (unsigned char *) isymbuf)
91+ free (isymbuf); 95+ free (isymbuf);
@@ -99,10 +103,10 @@ index 9c6d0411420..e284b0e5398 100644
99 sdata->relax = NULL; 103 sdata->relax = NULL;
100 sdata->relax_count = 0; 104 sdata->relax_count = 0;
101diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 105diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
102index 2e42366d8d6..3b6e6aa47bd 100644 106index 76aec43ec7a..77872cef1ab 100644
103--- a/bfd/elf64-microblaze.c 107--- a/bfd/elf64-microblaze.c
104+++ b/bfd/elf64-microblaze.c 108+++ b/bfd/elf64-microblaze.c
105@@ -1877,10 +1877,8 @@ microblaze_elf_relax_section (bfd *abfd, 109@@ -1840,10 +1840,8 @@ microblaze_elf_relax_section (bfd *abfd,
106 { 110 {
107 Elf_Internal_Shdr *symtab_hdr; 111 Elf_Internal_Shdr *symtab_hdr;
108 Elf_Internal_Rela *internal_relocs; 112 Elf_Internal_Rela *internal_relocs;
@@ -112,8 +116,8 @@ index 2e42366d8d6..3b6e6aa47bd 100644
112- bfd_byte *free_contents = NULL; 116- bfd_byte *free_contents = NULL;
113 int rel_count; 117 int rel_count;
114 unsigned int shndx; 118 unsigned int shndx;
115 int i, sym_index; 119 size_t i, sym_index;
116@@ -1924,8 +1922,6 @@ microblaze_elf_relax_section (bfd *abfd, 120@@ -1887,8 +1885,6 @@ microblaze_elf_relax_section (bfd *abfd,
117 internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, link_info->keep_memory); 121 internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, link_info->keep_memory);
118 if (internal_relocs == NULL) 122 if (internal_relocs == NULL)
119 goto error_return; 123 goto error_return;
@@ -122,7 +126,7 @@ index 2e42366d8d6..3b6e6aa47bd 100644
122 126
123 sdata->relax_count = 0; 127 sdata->relax_count = 0;
124 sdata->relax = (struct relax_table *) bfd_malloc ((sec->reloc_count + 1) 128 sdata->relax = (struct relax_table *) bfd_malloc ((sec->reloc_count + 1)
125@@ -1953,8 +1949,6 @@ microblaze_elf_relax_section (bfd *abfd, 129@@ -1916,8 +1912,6 @@ microblaze_elf_relax_section (bfd *abfd,
126 contents = (bfd_byte *) bfd_malloc (sec->size); 130 contents = (bfd_byte *) bfd_malloc (sec->size);
127 if (contents == NULL) 131 if (contents == NULL)
128 goto error_return; 132 goto error_return;
@@ -131,8 +135,8 @@ index 2e42366d8d6..3b6e6aa47bd 100644
131 if (!bfd_get_section_contents (abfd, sec, contents, 135 if (!bfd_get_section_contents (abfd, sec, contents,
132 (file_ptr) 0, sec->size)) 136 (file_ptr) 0, sec->size))
133 goto error_return; 137 goto error_return;
134@@ -2465,28 +2459,26 @@ microblaze_elf_relax_section (bfd *abfd, 138@@ -2449,25 +2443,26 @@ microblaze_elf_relax_section (bfd *abfd,
135 } 139 }
136 140
137 elf_section_data (sec)->relocs = internal_relocs; 141 elf_section_data (sec)->relocs = internal_relocs;
138- free_relocs = NULL; 142- free_relocs = NULL;
@@ -143,11 +147,8 @@ index 2e42366d8d6..3b6e6aa47bd 100644
143 symtab_hdr->contents = (bfd_byte *) isymbuf; 147 symtab_hdr->contents = (bfd_byte *) isymbuf;
144 } 148 }
145 149
146- if (free_relocs != NULL) 150- free (free_relocs);
147- { 151- free_relocs = NULL;
148- free (free_relocs);
149- free_relocs = NULL;
150- }
151+ if (internal_relocs != NULL 152+ if (internal_relocs != NULL
152+ && elf_section_data (sec)->relocs != internal_relocs) 153+ && elf_section_data (sec)->relocs != internal_relocs)
153+ free (internal_relocs); 154+ free (internal_relocs);
@@ -171,14 +172,12 @@ index 2e42366d8d6..3b6e6aa47bd 100644
171 } 172 }
172 173
173 if (sdata->relax_count == 0) 174 if (sdata->relax_count == 0)
174@@ -2500,10 +2492,15 @@ microblaze_elf_relax_section (bfd *abfd, 175@@ -2481,8 +2476,15 @@ microblaze_elf_relax_section (bfd *abfd,
175 return true; 176 return true;
176 177
177 error_return: 178 error_return:
178- if (free_relocs != NULL) 179- free (free_relocs);
179- free (free_relocs); 180- free (free_contents);
180- if (free_contents != NULL)
181- free (free_contents);
182+ if (isymbuf != NULL 181+ if (isymbuf != NULL
183+ && symtab_hdr->contents != (unsigned char *) isymbuf) 182+ && symtab_hdr->contents != (unsigned char *) isymbuf)
184+ free (isymbuf); 183+ free (isymbuf);
@@ -188,9 +187,9 @@ index 2e42366d8d6..3b6e6aa47bd 100644
188+ if (contents != NULL 187+ if (contents != NULL
189+ && elf_section_data (sec)->this_hdr.contents != contents) 188+ && elf_section_data (sec)->this_hdr.contents != contents)
190+ free (contents); 189+ free (contents);
191 if (sdata->relax != NULL) 190 free (sdata->relax);
192 { 191 sdata->relax = NULL;
193 free (sdata->relax); 192 sdata->relax_count = 0;
194-- 193--
1952.25.1 1942.37.1 (Apple Git-137.1)
196 195
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0033-Add-initial-port-of-linux-gdbserver-add-gdb_proc_ser.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0033-Add-initial-port-of-linux-gdbserver-add-gdb_proc_ser.patch
deleted file mode 100644
index d2753fe9..00000000
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0033-Add-initial-port-of-linux-gdbserver-add-gdb_proc_ser.patch
+++ /dev/null
@@ -1,1581 +0,0 @@
1From 48166e74b46787b10073fcec3c133463504e2dbc Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Mon, 23 Jan 2017 19:07:44 +0530
4Subject: [PATCH 33/38] Add initial port of linux gdbserver add
5 gdb_proc_service_h to gdbserver microblaze-linux
6
7gdbserver needs to initialise the microblaze registers
8
9other archs use this step to run a *_arch_setup() to carry out all
10architecture specific setup - may need to add in future
11
12 * add linux-ptrace.o to gdbserver configure
13 * Update breakpoint opcode
14 * fix segfault on connecting gdbserver
15 * add microblaze_linux_memory_remove_breakpoint
16 * add set_solib_svr4_fetch_link_map_offsets
17 * add set_gdbarch_fetch_tls_load_module_address
18 * Force reading of r0 as 0, prevent stores
19
20Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
21Signed-off-by: Nathan Rossi <nathan.rossi@petalogix.com>
22
23Conflicts:
24 gdb/gdbserver/Makefile.in
25 gdb/gdbserver/configure.srv
26Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
27---
28 gdb/configure.host | 3 +
29 gdb/features/microblaze-linux.xml | 12 +
30 gdb/gdbserver/Makefile.in | 712 +++++++++++++++++++++++++++
31 gdb/gdbserver/configure.srv | 398 +++++++++++++++
32 gdb/gdbserver/linux-microblaze-low.c | 189 +++++++
33 gdb/microblaze-linux-tdep.c | 29 +-
34 gdb/microblaze-tdep.c | 35 +-
35 gdb/microblaze-tdep.h | 4 +-
36 gdb/regformats/reg-microblaze.dat | 41 ++
37 9 files changed, 1420 insertions(+), 3 deletions(-)
38 create mode 100644 gdb/features/microblaze-linux.xml
39 create mode 100644 gdb/gdbserver/Makefile.in
40 create mode 100644 gdb/gdbserver/configure.srv
41 create mode 100644 gdb/gdbserver/linux-microblaze-low.c
42 create mode 100644 gdb/regformats/reg-microblaze.dat
43
44diff --git a/gdb/configure.host b/gdb/configure.host
45index da71675b201..3a0c4443a93 100644
46--- a/gdb/configure.host
47+++ b/gdb/configure.host
48@@ -61,6 +61,7 @@ i[34567]86*) gdb_host_cpu=i386 ;;
49 loongarch*) gdb_host_cpu=loongarch ;;
50 m68*) gdb_host_cpu=m68k ;;
51 mips*) gdb_host_cpu=mips ;;
52+microblaze*) gdb_host_cpu=microblaze ;;
53 powerpc* | rs6000) gdb_host_cpu=powerpc ;;
54 sparcv9 | sparc64) gdb_host_cpu=sparc ;;
55 s390*) gdb_host_cpu=s390 ;;
56@@ -135,6 +136,8 @@ mips64*-*-openbsd*) gdb_host=obsd64 ;;
57
58 or1k-*-linux*) gdb_host=linux ;;
59
60+microblaze*-*linux*) gdb_host=linux ;;
61+
62 powerpc-*-aix* | rs6000-*-* | powerpc64-*-aix*)
63 gdb_host=aix ;;
64 powerpc*-*-freebsd*) gdb_host=fbsd ;;
65diff --git a/gdb/features/microblaze-linux.xml b/gdb/features/microblaze-linux.xml
66new file mode 100644
67index 00000000000..8983e66eb3d
68--- /dev/null
69+++ b/gdb/features/microblaze-linux.xml
70@@ -0,0 +1,12 @@
71+<?xml version="1.0"?>
72+<!-- Copyright (C) 2014-2018 Free Software Foundation, Inc.
73+
74+ Copying and distribution of this file, with or without modification,
75+ are permitted in any medium without royalty provided the copyright
76+ notice and this notice are preserved. -->
77+
78+<!DOCTYPE target SYSTEM "gdb-target.dtd">
79+<target>
80+ <osabi>GNU/Linux</osabi>
81+ <xi:include href="microblaze-core.xml"/>
82+</target>
83diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
84new file mode 100644
85index 00000000000..fb4762a22d5
86--- /dev/null
87+++ b/gdb/gdbserver/Makefile.in
88@@ -0,0 +1,712 @@
89+# Copyright (C) 1989-2020 Free Software Foundation, Inc.
90+
91+# This file is part of GDB.
92+
93+# This program is free software; you can redistribute it and/or modify
94+# it under the terms of the GNU General Public License as published by
95+# the Free Software Foundation; either version 3 of the License, or
96+# (at your option) any later version.
97+#
98+# This program is distributed in the hope that it will be useful,
99+# but WITHOUT ANY WARRANTY; without even the implied warranty of
100+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
101+# GNU General Public License for more details.
102+#
103+# You should have received a copy of the GNU General Public License
104+# along with this program. If not, see <http://www.gnu.org/licenses/>.
105+
106+# Please keep lists in this file sorted alphabetically, with one item per line.
107+# See gdb/Makefile.in for guidelines on ordering files and directories.
108+
109+prefix = @prefix@
110+exec_prefix = @exec_prefix@
111+
112+host_alias = @host_noncanonical@
113+target_alias = @target_noncanonical@
114+program_transform_name = @program_transform_name@
115+bindir = @bindir@
116+libdir = @libdir@
117+tooldir = $(libdir)/$(target_alias)
118+
119+datarootdir = @datarootdir@
120+datadir = @datadir@
121+mandir = @mandir@
122+man1dir = $(mandir)/man1
123+man2dir = $(mandir)/man2
124+man3dir = $(mandir)/man3
125+man4dir = $(mandir)/man4
126+man5dir = $(mandir)/man5
127+man6dir = $(mandir)/man6
128+man7dir = $(mandir)/man7
129+man8dir = $(mandir)/man8
130+man9dir = $(mandir)/man9
131+infodir = @infodir@
132+htmldir = $(prefix)/html
133+includedir = @includedir@
134+CONFIG_SRC_SUBDIR = @CONFIG_SRC_SUBDIR@
135+
136+SHELL = @SHELL@
137+EXEEXT = @EXEEXT@
138+
139+INSTALL = @INSTALL@
140+INSTALL_PROGRAM = @INSTALL_PROGRAM@
141+INSTALL_DATA = @INSTALL_DATA@
142+RANLIB = @RANLIB@
143+
144+CC = @CC@
145+CXX = @CXX@
146+CXX_DIALECT = @CXX_DIALECT@
147+AR = @AR@
148+AR_FLAGS = rc
149+
150+# Dependency tracking information.
151+DEPMODE = @CCDEPMODE@
152+DEPDIR = @DEPDIR@
153+depcomp = $(SHELL) $(srcdir)/../../depcomp
154+
155+# Directory containing source files. Don't clean up the spacing,
156+# this exact string is matched for by the "configure" script.
157+srcdir = @srcdir@
158+abs_top_srcdir = @abs_top_srcdir@
159+abs_srcdir = @abs_srcdir@
160+VPATH = @srcdir@
161+
162+include $(srcdir)/../silent-rules.mk
163+
164+# Note that these are overridden by GNU make-specific code below if
165+# GNU make is used. The overrides implement dependency tracking.
166+COMPILE.pre = $(CXX) -x c++ $(CXX_DIALECT)
167+COMPILE.post = -c -o $@
168+COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post)
169+POSTCOMPILE = @true
170+
171+# It is also possible that you will need to add -I/usr/include/sys to the
172+# CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
173+# is where it should be according to Posix).
174+
175+# Set this up with gcc if you have gnu ld and the loader will print out
176+# line numbers for undefinded refs.
177+#CC_LD = g++ -static
178+CC_LD = $(CXX) $(CXX_DIALECT)
179+
180+# Where is the "include" directory? Traditionally ../include or ./include
181+INCLUDE_DIR = ${srcdir}/../../include
182+INCLUDE_DEP = $$(INCLUDE_DIR)
183+
184+LIBIBERTY_BUILDDIR = build-libiberty-gdbserver
185+LIBIBERTY = $(LIBIBERTY_BUILDDIR)/libiberty.a
186+
187+# Where is ust? These will be empty if ust was not available.
188+ustlibs = @ustlibs@
189+ustinc = @ustinc@
190+
191+# gnulib
192+GNULIB_BUILDDIR = build-gnulib-gdbserver
193+LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a
194+INCGNU = -I$(srcdir)/../../gnulib/import -I$(GNULIB_BUILDDIR)/import
195+
196+# Generated headers in the gnulib directory. These must be listed
197+# so that they are generated before other files are compiled.
198+GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h @GNULIB_STDINT_H@
199+
200+# All the includes used for CFLAGS and for lint.
201+# -I. for config files.
202+# -I${srcdir} for our headers.
203+# -I$(srcdir)/../regformats for regdef.h.
204+#
205+# We do not include ../target or ../nat in here because headers
206+# in those directories should be included with the subdirectory.
207+# e.g.: "target/wait.h".
208+#
209+INCLUDE_CFLAGS = -I. -I${srcdir} \
210+ -I$(srcdir)/../regformats -I$(srcdir)/.. -I$(INCLUDE_DIR) \
211+ $(INCGNU)
212+
213+# M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
214+# from the config/ directory.
215+GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS}
216+#PROFILE_CFLAGS = -pg
217+
218+WARN_CFLAGS = @WARN_CFLAGS@
219+WERROR_CFLAGS = @WERROR_CFLAGS@
220+
221+WARN_CFLAGS_NO_FORMAT = `echo " $(WARN_CFLAGS) " \
222+ | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"`
223+
224+# These are specifically reserved for setting from the command line
225+# when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
226+CFLAGS = @CFLAGS@
227+CXXFLAGS = @CXXFLAGS@
228+CPPFLAGS = @CPPFLAGS@
229+
230+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
231+PTHREAD_LIBS = @PTHREAD_LIBS@
232+
233+# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
234+INTERNAL_CFLAGS_BASE = ${CXXFLAGS} ${GLOBAL_CFLAGS} \
235+ ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS} $(PTHREAD_CFLAGS)
236+INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS)
237+INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER
238+
239+# LDFLAGS is specifically reserved for setting from the command line
240+# when running make.
241+LDFLAGS = @LDFLAGS@
242+INTERNAL_LDFLAGS = $(LDFLAGS) @RDYNAMIC@
243+
244+# All source files that go into linking GDB remote server.
245+
246+SFILES = \
247+ $(srcdir)/debug.c \
248+ $(srcdir)/dll.c \
249+ $(srcdir)/gdbreplay.c \
250+ $(srcdir)/hostio.c \
251+ $(srcdir)/hostio-errno.c \
252+ $(srcdir)/i387-fp.c \
253+ $(srcdir)/inferiors.c \
254+ $(srcdir)/linux-aarch64-low.c \
255+ $(srcdir)/linux-arm-low.c \
256+ $(srcdir)/linux-bfin-low.c \
257+ $(srcdir)/linux-cris-low.c \
258+ $(srcdir)/linux-crisv32-low.c \
259+ $(srcdir)/linux-ia64-low.c \
260+ $(srcdir)/linux-low.c \
261+ $(srcdir)/linux-m32r-low.c \
262+ $(srcdir)/linux-m68k-low.c \
263+ $(srcdir)/linux-microblaze-low.c \
264+ $(srcdir)/linux-mips-low.c \
265+ $(srcdir)/linux-nios2-low.c \
266+ $(srcdir)/linux-ppc-low.c \
267+ $(srcdir)/linux-s390-low.c \
268+ $(srcdir)/linux-sh-low.c \
269+ $(srcdir)/linux-sparc-low.c \
270+ $(srcdir)/linux-tile-low.c \
271+ $(srcdir)/linux-x86-low.c \
272+ $(srcdir)/linux-xtensa-low.c \
273+ $(srcdir)/mem-break.c \
274+ $(srcdir)/proc-service.c \
275+ $(srcdir)/proc-service.list \
276+ $(srcdir)/regcache.c \
277+ $(srcdir)/remote-utils.c \
278+ $(srcdir)/server.c \
279+ $(srcdir)/symbol.c \
280+ $(srcdir)/target.c \
281+ $(srcdir)/thread-db.c \
282+ $(srcdir)/utils.c \
283+ $(srcdir)/win32-arm-low.c \
284+ $(srcdir)/win32-i386-low.c \
285+ $(srcdir)/win32-low.c \
286+ $(srcdir)/wincecompat.c \
287+ $(srcdir)/x86-low.c \
288+ $(srcdir)/arch/arm.c \
289+ $(srcdir)/arch/arm-get-next-pcs.c \
290+ $(srcdir)/arch/arm-linux.c \
291+ $(srcdir)/arch/ppc-linux-common.c \
292+ $(srcdir)/../alloc.c \
293+ $(srcdir)/gdbsupport/btrace-common.c \
294+ $(srcdir)/gdbsupport/buffer.c \
295+ $(srcdir)/gdbsupport/cleanups.c \
296+ $(srcdir)/gdbsupport/common-debug.c \
297+ $(srcdir)/gdbsupport/common-exceptions.c \
298+ $(srcdir)/gdbsupport/common-inferior.c \
299+ $(srcdir)/gdbsupport/common-regcache.c \
300+ $(srcdir)/gdbsupport/common-utils.c \
301+ $(srcdir)/gdbsupport/errors.c \
302+ $(srcdir)/gdbsupport/environ.c \
303+ $(srcdir)/gdbsupport/fileio.c \
304+ $(srcdir)/gdbsupport/filestuff.c \
305+ $(srcdir)/gdbsupport/job-control.c \
306+ $(srcdir)/gdbsupport/gdb-dlfcn.c \
307+ $(srcdir)/gdbsupport/gdb_tilde_expand.c \
308+ $(srcdir)/gdbsupport/gdb_vecs.c \
309+ $(srcdir)/gdbsupport/netstuff.c \
310+ $(srcdir)/gdbsupport/new-op.c \
311+ $(srcdir)/gdbsupport/pathstuff.c \
312+ $(srcdir)/gdbsupport/print-utils.c \
313+ $(srcdir)/gdbsupport/ptid.c \
314+ $(srcdir)/gdbsupport/rsp-low.c \
315+ $(srcdir)/gdbsupport/safe-strerror.c \
316+ $(srcdir)/gdbsupport/tdesc.c \
317+ $(srcdir)/gdbsupport/xml-utils.c \
318+ $(srcdir)/nat/aarch64-sve-linux-ptrace.c \
319+ $(srcdir)/nat/linux-btrace.c \
320+ $(srcdir)/nat/linux-namespaces.c \
321+ $(srcdir)/nat/linux-osdata.c \
322+ $(srcdir)/nat/linux-personality.c \
323+ $(srcdir)/nat/microblaze-linux.c \
324+ $(srcdir)/nat/mips-linux-watch.c \
325+ $(srcdir)/nat/ppc-linux.c \
326+ $(srcdir)/nat/fork-inferior.c \
327+ $(srcdir)/target/waitstatus.c
328+
329+DEPFILES = @GDBSERVER_DEPFILES@
330+
331+LIBOBJS = @LIBOBJS@
332+
333+SOURCES = $(SFILES)
334+TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
335+
336+OBS = \
337+ alloc.o \
338+ ax.o \
339+ gdbsupport/agent.o \
340+ gdbsupport/btrace-common.o \
341+ gdbsupport/buffer.o \
342+ gdbsupport/cleanups.o \
343+ gdbsupport/common-debug.o \
344+ gdbsupport/common-exceptions.o \
345+ gdbsupport/common-inferior.o \
346+ gdbsupport/job-control.o \
347+ gdbsupport/common-regcache.o \
348+ gdbsupport/common-utils.o \
349+ gdbsupport/errors.o \
350+ gdbsupport/environ.o \
351+ gdbsupport/fileio.o \
352+ gdbsupport/filestuff.o \
353+ gdbsupport/format.o \
354+ gdbsupport/gdb-dlfcn.o \
355+ gdbsupport/gdb_tilde_expand.o \
356+ gdbsupport/gdb_vecs.o \
357+ gdbsupport/netstuff.o \
358+ gdbsupport/new-op.o \
359+ gdbsupport/pathstuff.o \
360+ gdbsupport/print-utils.o \
361+ gdbsupport/ptid.o \
362+ gdbsupport/rsp-low.o \
363+ gdbsupport/safe-strerror.o \
364+ gdbsupport/signals.o \
365+ gdbsupport/signals-state-save-restore.o \
366+ gdbsupport/tdesc.o \
367+ gdbsupport/xml-utils.o \
368+ debug.o \
369+ dll.o \
370+ event-loop.o \
371+ hostio.o \
372+ inferiors.o \
373+ mem-break.o \
374+ notif.o \
375+ regcache.o \
376+ remote-utils.o \
377+ server.o \
378+ symbol.o \
379+ target.o \
380+ tdesc.o \
381+ tracepoint.o \
382+ utils.o \
383+ version.o \
384+ waitstatus.o \
385+ $(DEPFILES) \
386+ $(LIBOBJS) \
387+ $(XML_BUILTIN)
388+
389+GDBREPLAY_OBS = \
390+ gdbsupport/cleanups.o \
391+ gdbsupport/common-exceptions.o \
392+ gdbsupport/common-utils.o \
393+ gdbsupport/rsp-low.o \
394+ gdbsupport/errors.o \
395+ gdbsupport/netstuff.o \
396+ gdbsupport/print-utils.o \
397+ gdbsupport/safe-strerror.o \
398+ gdbreplay.o \
399+ utils.o \
400+ version.o
401+
402+GDBSERVER_LIBS = @GDBSERVER_LIBS@ $(PTHREAD_LIBS)
403+XM_CLIBS = @LIBS@
404+CDEPS = $(srcdir)/proc-service.list
405+
406+# XML files to compile in to gdbserver, if any.
407+XML_DIR = $(srcdir)/../features
408+XML_FILES = @srv_xmlfiles@
409+XML_BUILTIN = @srv_xmlbuiltin@
410+
411+IPA_DEPFILES = @IPA_DEPFILES@
412+extra_libraries = @extra_libraries@
413+
414+SUBDIRS = $(GNULIB_BUILDDIR) $(LIBIBERTY_BUILDDIR)
415+CLEANDIRS = $(SUBDIRS)
416+
417+# List of subdirectories in the build tree that must exist.
418+# This is used to force build failures in existing trees when
419+# a new directory is added.
420+# The format here is for the `case' shell command.
421+REQUIRED_SUBDIRS = $(GNULIB_BUILDDIR) | $(LIBIBERTY_BUILDDIR)
422+
423+FLAGS_TO_PASS = \
424+ "prefix=$(prefix)" \
425+ "exec_prefix=$(exec_prefix)" \
426+ "infodir=$(infodir)" \
427+ "datarootdir=$(datarootdir)" \
428+ "docdir=$(docdir)" \
429+ "htmldir=$(htmldir)" \
430+ "pdfdir=$(pdfdir)" \
431+ "libdir=$(libdir)" \
432+ "mandir=$(mandir)" \
433+ "datadir=$(datadir)" \
434+ "includedir=$(includedir)" \
435+ "against=$(against)" \
436+ "DESTDIR=$(DESTDIR)" \
437+ "AR=$(AR)" \
438+ "AR_FLAGS=$(AR_FLAGS)" \
439+ "CC=$(CC)" \
440+ "CFLAGS=$(CFLAGS)" \
441+ "CXX=$(CXX)" \
442+ "CXXFLAGS=$(CXXFLAGS)" \
443+ "DLLTOOL=$(DLLTOOL)" \
444+ "LDFLAGS=$(LDFLAGS)" \
445+ "RANLIB=$(RANLIB)" \
446+ "MAKEINFO=$(MAKEINFO)" \
447+ "MAKEHTML=$(MAKEHTML)" \
448+ "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
449+ "INSTALL=$(INSTALL)" \
450+ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
451+ "INSTALL_DATA=$(INSTALL_DATA)" \
452+ "RUNTEST=$(RUNTEST)" \
453+ "RUNTESTFLAGS=$(RUNTESTFLAGS)"
454+
455+# All generated files which can be included by another file.
456+generated_files = config.h $(GNULIB_H)
457+
458+all: gdbserver$(EXEEXT) gdbreplay$(EXEEXT) $(extra_libraries)
459+ @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
460+
461+# Traditionally "install" depends on "all". But it may be useful
462+# not to; for example, if the user has made some trivial change to a
463+# source file and doesn't care about rebuilding or just wants to save the
464+# time it takes for make to check that all is up to date.
465+# install-only is intended to address that need.
466+install: all
467+ @$(MAKE) $(FLAGS_TO_PASS) install-only
468+
469+install-only:
470+ n=`echo gdbserver | sed '$(program_transform_name)'`; \
471+ if [ x$$n = x ]; then n=gdbserver; else true; fi; \
472+ if [ x"$(IPA_DEPFILES)" != x ]; then \
473+ $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(libdir); \
474+ $(INSTALL_PROGRAM) $(IPA_LIB) $(DESTDIR)$(libdir)/$(IPA_LIB); \
475+ fi; \
476+ $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir); \
477+ $(INSTALL_PROGRAM) gdbserver$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
478+ # Note that we run install and not install-only, as the latter
479+ # is not part of GNU standards and in particular not provided
480+ # in libiberty.
481+ @$(MAKE) $(FLAGS_TO_PASS) DO=install "DODIRS=$(SUBDIRS)" subdir_do
482+
483+uninstall: force
484+ n=`echo gdbserver | sed '$(program_transform_name)'`; \
485+ if [ x$$n = x ]; then n=gdbserver; else true; fi; \
486+ rm -f $(DESTDIR)/$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(man1dir)/$$n.1
487+ @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
488+
489+installcheck:
490+check:
491+info dvi pdf:
492+install-info:
493+install-pdf:
494+html:
495+install-html:
496+clean-info: force
497+ @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
498+
499+gdbserver$(EXEEXT): $(sort $(OBS)) ${CDEPS} $(LIBGNU) $(LIBIBERTY)
500+ $(SILENCE) rm -f gdbserver$(EXEEXT)
501+ $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
502+ -o gdbserver$(EXEEXT) $(OBS) $(LIBGNU) $(LIBIBERTY) \
503+ $(GDBSERVER_LIBS) $(XM_CLIBS)
504+
505+$(LIBGNU) $(LIBIBERTY) $(GNULIB_H): all-lib
506+all-lib: $(GNULIB_BUILDDIR)/Makefile $(LIBIBERTY_BUILDDIR)/Makefile
507+ @$(MAKE) $(FLAGS_TO_PASS) DO=all DODIRS="$(SUBDIRS)" subdir_do
508+.PHONY: all-lib
509+
510+gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY)
511+ $(SILENCE) rm -f gdbreplay$(EXEEXT)
512+ $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
513+ -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) $(LIBGNU) \
514+ $(LIBIBERTY)
515+
516+IPA_OBJS = \
517+ alloc-ipa.o \
518+ ax-ipa.o \
519+ gdbsupport/common-utils-ipa.o \
520+ gdbsupport/errors-ipa.o \
521+ gdbsupport/format-ipa.o \
522+ gdbsupport/print-utils-ipa.o \
523+ gdbsupport/rsp-low-ipa.o \
524+ gdbsupport/safe-strerror-ipa.o \
525+ gdbsupport/tdesc-ipa.o \
526+ regcache-ipa.o \
527+ remote-utils-ipa.o \
528+ tdesc-ipa.o \
529+ tracepoint-ipa.o \
530+ utils-ipa.o \
531+ ${IPA_DEPFILES}
532+
533+IPA_LIB = libinproctrace.so
534+
535+$(IPA_LIB): $(sort $(IPA_OBJS)) ${CDEPS}
536+ $(SILENCE) rm -f $(IPA_LIB)
537+ $(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \
538+ -Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
539+ -o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread
540+
541+# Put the proper machine-specific files first, so M-. on a machine
542+# specific routine gets the one for the correct machine.
543+# The xyzzy stuff below deals with empty DEPFILES
544+TAGS: ${TAGFILES}
545+ etags `find ${srcdir}/../config -name $(DEPRECATED_TM_FILE) -print` \
546+ `find ${srcdir}/../config -name ${XM_FILE} -print` \
547+ `find ${srcdir}/../config -name ${NAT_FILE} -print` \
548+ `for i in yzzy ${DEPFILES}; do \
549+ if [ x$$i != xyzzy ]; then \
550+ echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \
551+ fi; \
552+ done` \
553+ ${TAGFILES}
554+tags: TAGS
555+
556+clean:
557+ rm -f *.o ${ADD_FILES} *~
558+ rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
559+ rm -f $(IPA_LIB)
560+ rm -f *-generated.c
561+ rm -f stamp-xml
562+ rm -f $(DEPDIR)/*.Po
563+ for i in $(CONFIG_SRC_SUBDIR); do \
564+ rm -f $$i/*.o; \
565+ rm -f $$i/$(DEPDIR)/*; \
566+ done
567+ @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
568+
569+maintainer-clean realclean distclean: clean
570+ @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
571+ rm -rf $(GNULIB_BUILDDIR)
572+ rm -f Makefile config.status config.h stamp-h config.log
573+ rm -f Makefile
574+ for i in $(CONFIG_SRC_SUBDIR); do \
575+ rmdir $$i/$(DEPDIR); \
576+ done
577+
578+subdir_do: force
579+ @for i in $(DODIRS); do \
580+ case $$i in \
581+ $(REQUIRED_SUBDIRS)) \
582+ if [ ! -f ./$$i/Makefile ] ; then \
583+ echo "Missing $$i/Makefile" >&2 ; \
584+ exit 1 ; \
585+ fi ;; \
586+ esac ; \
587+ if [ -f ./$$i/Makefile ] ; then \
588+ if (cd ./$$i; \
589+ $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
590+ else exit 1 ; fi ; \
591+ else true ; fi ; \
592+ done
593+
594+config.h: stamp-h ; @true
595+stamp-h: config.in config.status
596+ $(SHELL) ./config.status config.h
597+
598+Makefile: Makefile.in config.status
599+ $(SHELL) ./config.status $@
600+
601+$(GNULIB_BUILDDIR)/Makefile: $(srcdir)/../../gnulib/Makefile.in config.status
602+ @cd $(GNULIB_BUILDDIR); CONFIG_FILES="Makefile" \
603+ CONFIG_COMMANDS="depfiles" \
604+ CONFIG_HEADERS= \
605+ CONFIG_LINKS= \
606+ $(SHELL) config.status
607+
608+config.status: configure configure.srv $(srcdir)/../../bfd/development.sh
609+ $(SHELL) ./config.status --recheck
610+
611+# automatic rebuilding in automake-generated Makefiles requires
612+# this rule in the toplevel Makefile, which, with GNU make, causes
613+# the desired updates through the implicit regeneration of the Makefile
614+# and all of its prerequisites.
615+am--refresh:
616+ @:
617+
618+force:
619+
620+version-generated.c: Makefile $(srcdir)/../version.in $(srcdir)/../../bfd/version.h $(srcdir)/../gdbsupport/create-version.sh
621+ $(ECHO_GEN) $(SHELL) $(srcdir)/../gdbsupport/create-version.sh $(srcdir)/.. \
622+ $(host_alias) $(target_alias) $@
623+
624+xml-builtin-generated.c: stamp-xml; @true
625+stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES)
626+ $(SILENCE) rm -f xml-builtin.tmp
627+ $(ECHO_GEN_XML_BUILTIN_GENERATED) $(SHELL) $(XML_DIR)/feature_to_c.sh \
628+ xml-builtin.tmp $(XML_FILES)
629+ $(SILENCE) $(SHELL) $(srcdir)/../../move-if-change xml-builtin.tmp xml-builtin-generated.c
630+ $(SILENCE) echo stamp > stamp-xml
631+
632+.PRECIOUS: xml-builtin.c
633+
634+# GNU Make has an annoying habit of putting *all* the Makefile variables
635+# into the environment, unless you include this target as a circumvention.
636+# Rumor is that this will be fixed (and this target can be removed)
637+# in GNU Make 4.0.
638+.NOEXPORT:
639+
640+# GNU Make 3.63 has a different problem: it keeps tacking command line
641+# overrides onto the definition of $(MAKE). This variable setting
642+# will remove them.
643+MAKEOVERRIDES =
644+
645+regdat_sh = $(srcdir)/../regformats/regdat.sh
646+
647+UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
648+
649+# Undo gnulib replacements for the IPA shared library build.
650+# The gnulib headers are still needed, but gnulib is not linked
651+# into the IPA lib so replacement apis don't work.
652+UNDO_GNULIB_CFLAGS = -Drpl_strerror_r=strerror_r
653+
654+# Note, we only build the IPA if -fvisibility=hidden is supported in
655+# the first place.
656+IPAGENT_CFLAGS = $(INTERNAL_CFLAGS) $(UST_CFLAGS) \
657+ $(UNDO_GNULIB_CFLAGS) \
658+ -fPIC -DIN_PROCESS_AGENT \
659+ -fvisibility=hidden
660+
661+IPAGENT_COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(IPAGENT_CFLAGS) $(COMPILE.post)
662+
663+# Rules for special cases.
664+
665+ax-ipa.o: ax.c
666+ $(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
667+ $(POSTCOMPILE)
668+
669+ax.o: ax.c
670+ $(COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
671+ $(POSTCOMPILE)
672+
673+alloc-ipa.o: ../alloc.c
674+ $(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
675+ $(POSTCOMPILE)
676+
677+# Rules for objects that go in the in-process agent.
678+
679+arch/%-ipa.o: ../arch/%.c
680+ $(IPAGENT_COMPILE) $<
681+ $(POSTCOMPILE)
682+
683+gdbsupport/%-ipa.o: ../gdbsupport/%.c
684+ $(IPAGENT_COMPILE) $<
685+ $(POSTCOMPILE)
686+
687+%-ipa.o: %-generated.c
688+ $(IPAGENT_COMPILE) $<
689+ $(POSTCOMPILE)
690+
691+%-ipa.o: %.c
692+ $(IPAGENT_COMPILE) $<
693+ $(POSTCOMPILE)
694+
695+# Note: Between two matching pattern rules, GNU Make 3.81 chooses the first one.
696+# Therefore, this one needs to be before "%.o: %.c" for it to be considered for
697+# files such as linux-amd64-ipa.o generated from linux-amd64-ipa.c.
698+#
699+# Later versions of GNU Make choose the rule with the shortest stem, so it would
700+# work in any order.
701+
702+%-ipa.o: %-ipa.c
703+ $(IPAGENT_COMPILE) $<
704+ $(POSTCOMPILE)
705+
706+# Rules for objects that go in the gdbserver binary.
707+
708+arch/%.o: ../arch/%.c
709+ $(COMPILE) $<
710+ $(POSTCOMPILE)
711+
712+gdbsupport/%.o: ../gdbsupport/%.c
713+ $(COMPILE) $<
714+ $(POSTCOMPILE)
715+
716+%.o: %-generated.c
717+ $(COMPILE) $<
718+ $(POSTCOMPILE)
719+
720+%.o: %.c
721+ $(COMPILE) $<
722+ $(POSTCOMPILE)
723+
724+%.o: ../nat/%.c
725+ $(COMPILE) $<
726+ $(POSTCOMPILE)
727+
728+%.o: ../target/%.c
729+ $(COMPILE) $<
730+ $(POSTCOMPILE)
731+
732+%.o: ../%.c
733+ $(COMPILE) $<
734+ $(POSTCOMPILE)
735+
736+# Rules for register format descriptions. Suffix destination files with
737+# -generated to identify and clean them easily.
738+
739+%-generated.c: ../regformats/%.dat | $(regdat_sh)
740+ $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
741+
742+%-generated.c: ../regformats/arm/%.dat | $(regdat_sh)
743+ $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
744+
745+%-generated.c: ../regformats/i386/%.dat | $(regdat_sh)
746+ $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
747+
748+%-generated.c: ../regformats/rs6000/%.dat | $(regdat_sh)
749+ $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
750+microblaze-linux.c : $(srcdir)/../regformats/reg-microblaze.dat $(regdat_sh)
751+ $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-microblaze.dat microblaze-linux.c
752+
753+#
754+# Dependency tracking.
755+#
756+
757+ifeq ($(DEPMODE),depmode=gcc3)
758+# Note that we put the dependencies into a .Tpo file, then move them
759+# into place if the compile succeeds. We need this because gcc does
760+# not atomically write the dependency output file.
761+override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
762+ -MF $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo
763+override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
764+ $(@D)/$(DEPDIR)/$(basename $(@F)).Po
765+else
766+override COMPILE.pre = source='$<' object='$@' libtool=no \
767+ DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) \
768+ $(CXX) -x c++ $(CXX_DIALECT)
769+# depcomp handles atomicity for us, so we don't need a postcompile
770+# step.
771+override POSTCOMPILE =
772+endif
773+
774+# A list of all the objects we might care about in this build, for
775+# dependency tracking.
776+all_object_files = $(OBS) $(GDBREPLAY_OBS) $(IPA_OBJS)
777+
778+# Ensure that generated files are created early. Use order-only
779+# dependencies if available. They require GNU make 3.80 or newer,
780+# and the .VARIABLES variable was introduced at the same time.
781+ifdef .VARIABLES
782+$(all_object_files): | $(generated_files)
783+else
784+$(all_object_files) : $(generated_files)
785+endif
786+
787+# All the .deps files to include.
788+all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
789+ $(dir $(dep))/$(DEPDIR)/$(notdir $(dep)))
790+
791+# Dependencies.
792+-include $(all_deps_files)
793+
794+# Disable implicit make rules.
795+include $(srcdir)/../disable-implicit-rules.mk
796+
797+# Do not delete intermediate files (e.g. *-generated.c).
798+.SECONDARY:
799+
800+# This is the end of "Makefile.in".
801diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
802new file mode 100644
803index 00000000000..e0d2b2fe04a
804--- /dev/null
805+++ b/gdb/gdbserver/configure.srv
806@@ -0,0 +1,398 @@
807+# Mappings from configuration triplets to gdbserver build options.
808+# This is invoked from the autoconf-generated configure script, to
809+# produce the appropriate Makefile substitutions.
810+
811+# This file sets the following shell variables:
812+# srv_regobj The register protocol appropriate for this target.
813+# srv_tgtobj Any other target-specific modules appropriate
814+# for this target.
815+# srv_hostio_err The object implementing the hostio_last_error
816+# target method.
817+# srv_xmlfiles All XML files which should be available for
818+# gdbserver in this configuration.
819+# ipa_obj Any other target-specific modules appropriate
820+# for this target's in-process agent.
821+#
822+# In addition, on GNU/Linux the following shell variables will be set:
823+# srv_linux_regsets Set to "yes" if ptrace(PTRACE_GETREGS) and friends
824+# may be available on this platform; unset otherwise.
825+# They will only be used if <sys/ptrace.h> defines
826+# PTRACE_GETREGS.
827+# srv_linux_usrregs Set to "yes" if we can get at registers via
828+# PTRACE_PEEKUSR / PTRACE_POKEUSR.
829+
830+# Default hostio_last_error implementation
831+srv_hostio_err_objs="hostio-errno.o"
832+
833+ipa_ppc_linux_regobj="powerpc-32l-ipa.o powerpc-altivec32l-ipa.o powerpc-vsx32l-ipa.o powerpc-isa205-32l-ipa.o powerpc-isa205-altivec32l-ipa.o powerpc-isa205-vsx32l-ipa.o powerpc-isa205-ppr-dscr-vsx32l-ipa.o powerpc-isa207-vsx32l-ipa.o powerpc-isa207-htm-vsx32l-ipa.o powerpc-e500l-ipa.o powerpc-64l-ipa.o powerpc-altivec64l-ipa.o powerpc-vsx64l-ipa.o powerpc-isa205-64l-ipa.o powerpc-isa205-altivec64l-ipa.o powerpc-isa205-vsx64l-ipa.o powerpc-isa205-ppr-dscr-vsx64l-ipa.o powerpc-isa207-vsx64l-ipa.o powerpc-isa207-htm-vsx64l-ipa.o"
834+
835+# Linux object files. This is so we don't have to repeat
836+# these files over and over again.
837+srv_linux_obj="linux-low.o linux-osdata.o linux-procfs.o linux-ptrace.o linux-waitpid.o linux-personality.o linux-namespaces.o fork-child.o fork-inferior.o"
838+
839+# Input is taken from the "${target}" variable.
840+
841+case "${target}" in
842+ aarch64*-*-linux*) srv_tgtobj="linux-aarch64-low.o aarch64-linux-hw-point.o"
843+ srv_tgtobj="$srv_tgtobj linux-aarch32-low.o"
844+ srv_tgtobj="$srv_tgtobj linux-aarch32-tdesc.o"
845+ srv_tgtobj="${srv_tgtobj} arch/aarch32.o"
846+ srv_tgtobj="${srv_tgtobj} arch/arm.o"
847+ srv_tgtobj="$srv_tgtobj aarch64-linux.o"
848+ srv_tgtobj="$srv_tgtobj arch/aarch64-insn.o"
849+ srv_tgtobj="$srv_tgtobj arch/aarch64.o"
850+ srv_tgtobj="$srv_tgtobj linux-aarch64-tdesc.o"
851+ srv_tgtobj="$srv_tgtobj aarch64-sve-linux-ptrace.o"
852+ srv_tgtobj="${srv_tgtobj} $srv_linux_obj"
853+ srv_linux_regsets=yes
854+ srv_linux_thread_db=yes
855+ ipa_obj="linux-aarch64-ipa.o"
856+ ipa_obj="${ipa_obj} linux-aarch64-tdesc-ipa.o"
857+ ipa_obj="${ipa_obj} arch/aarch64-ipa.o"
858+ ;;
859+ arm*-*-linux*) srv_tgtobj="$srv_linux_obj linux-arm-low.o"
860+ srv_tgtobj="$srv_tgtobj linux-arm-tdesc.o"
861+ srv_tgtobj="$srv_tgtobj linux-aarch32-low.o"
862+ srv_tgtobj="$srv_tgtobj linux-aarch32-tdesc.o"
863+ srv_tgtobj="${srv_tgtobj} arch/aarch32.o"
864+ srv_tgtobj="${srv_tgtobj} arch/arm.o"
865+ srv_tgtobj="${srv_tgtobj} arch/arm-linux.o"
866+ srv_tgtobj="${srv_tgtobj} arch/arm-get-next-pcs.o"
867+ srv_linux_usrregs=yes
868+ srv_linux_regsets=yes
869+ srv_linux_thread_db=yes
870+ ;;
871+ arm*-*-mingw32ce*) srv_regobj=reg-arm.o
872+ srv_tgtobj="win32-low.o win32-arm-low.o"
873+ srv_tgtobj="${srv_tgtobj} wincecompat.o"
874+ # hostio_last_error implementation is in win32-low.c
875+ srv_hostio_err_objs=""
876+ srv_mingw=yes
877+ srv_mingwce=yes
878+ ;;
879+ bfin-*-*linux*) srv_regobj=reg-bfin.o
880+ srv_tgtobj="$srv_linux_obj linux-bfin-low.o"
881+ srv_linux_usrregs=yes
882+ srv_linux_thread_db=yes
883+ ;;
884+ crisv32-*-linux*) srv_regobj=reg-crisv32.o
885+ srv_tgtobj="$srv_linux_obj linux-crisv32-low.o"
886+ srv_linux_regsets=yes
887+ srv_linux_thread_db=yes
888+ ;;
889+ cris-*-linux*) srv_regobj=reg-cris.o
890+ srv_tgtobj="$srv_linux_obj linux-cris-low.o"
891+ srv_linux_usrregs=yes
892+ srv_linux_thread_db=yes
893+ ;;
894+ i[34567]86-*-cygwin*) srv_regobj=""
895+ srv_tgtobj="x86-low.o x86-dregs.o win32-low.o win32-i386-low.o"
896+ srv_tgtobj="${srv_tgtobj} arch/i386.o"
897+ ;;
898+ i[34567]86-*-linux*) srv_tgtobj="${srv_tgtobj} arch/i386.o"
899+ srv_tgtobj="${srv_tgtobj} $srv_linux_obj linux-x86-low.o x86-low.o x86-dregs.o i387-fp.o"
900+ srv_tgtobj="${srv_tgtobj} linux-x86-tdesc.o"
901+ srv_tgtobj="${srv_tgtobj} linux-btrace.o x86-linux.o"
902+ srv_tgtobj="${srv_tgtobj} x86-linux-dregs.o"
903+ srv_linux_usrregs=yes
904+ srv_linux_regsets=yes
905+ srv_linux_thread_db=yes
906+ srv_linux_btrace=yes
907+ ipa_obj="linux-i386-ipa.o linux-x86-tdesc-ipa.o"
908+ ipa_obj="${ipa_obj} arch/i386-ipa.o"
909+ ;;
910+ i[34567]86-*-lynxos*) srv_regobj=""
911+ srv_tgtobj="lynx-low.o lynx-i386-low.o fork-child.o fork-inferior.o"
912+ srv_tgtobj="${srv_tgtobj} arch/i386.o"
913+ srv_lynxos=yes
914+ ;;
915+ i[34567]86-*-mingw32ce*)
916+ srv_regobj=""
917+ srv_tgtobj="x86-low.o x86-dregs.o win32-low.o win32-i386-low.o"
918+ srv_tgtobj="${srv_tgtobj} arch/i386.o"
919+ srv_tgtobj="${srv_tgtobj} wincecompat.o"
920+ # hostio_last_error implementation is in win32-low.c
921+ srv_hostio_err_objs=""
922+ srv_mingw=yes
923+ srv_mingwce=yes
924+ ;;
925+ i[34567]86-*-mingw*) srv_regobj=""
926+ srv_tgtobj="x86-low.o x86-dregs.o win32-low.o win32-i386-low.o"
927+ srv_tgtobj="${srv_tgtobj} arch/i386.o"
928+ srv_mingw=yes
929+ ;;
930+ i[34567]86-*-nto*) srv_regobj=""
931+ srv_tgtobj="nto-low.o nto-x86-low.o arch/i386.o"
932+ srv_qnx="yes"
933+ ;;
934+ ia64-*-linux*) srv_regobj=reg-ia64.o
935+ srv_tgtobj="$srv_linux_obj linux-ia64-low.o"
936+ srv_linux_usrregs=yes
937+ ;;
938+ m32r*-*-linux*) srv_regobj=reg-m32r.o
939+ srv_tgtobj="$srv_linux_obj linux-m32r-low.o"
940+ srv_linux_usrregs=yes
941+ srv_linux_thread_db=yes
942+ ;;
943+ m68*-*-linux*) if test "$gdb_cv_m68k_is_coldfire" = yes; then
944+ srv_regobj=reg-cf.o
945+ else
946+ srv_regobj=reg-m68k.o
947+ fi
948+ srv_tgtobj="$srv_linux_obj linux-m68k-low.o"
949+ srv_linux_usrregs=yes
950+ srv_linux_regsets=yes
951+ srv_linux_thread_db=yes
952+ ;;
953+ m68*-*-uclinux*) if test "$gdb_cv_m68k_is_coldfire" = yes; then
954+ srv_regobj=reg-cf.o
955+ else
956+ srv_regobj=reg-m68k.o
957+ fi
958+ srv_tgtobj="$srv_linux_obj linux-m68k-low.o"
959+ srv_linux_usrregs=yes
960+ srv_linux_regsets=yes
961+ srv_linux_thread_db=yes
962+ ;;
963+ mips*-*-linux*) srv_regobj="mips-linux.o"
964+ srv_regobj="${srv_regobj} mips-dsp-linux.o"
965+ srv_regobj="${srv_regobj} mips64-linux.o"
966+ srv_regobj="${srv_regobj} mips64-dsp-linux.o"
967+ srv_tgtobj="$srv_linux_obj linux-mips-low.o"
968+ srv_tgtobj="${srv_tgtobj} mips-linux-watch.o"
969+ srv_xmlfiles="mips-linux.xml"
970+ srv_xmlfiles="${srv_xmlfiles} mips-dsp-linux.xml"
971+ srv_xmlfiles="${srv_xmlfiles} mips-cpu.xml"
972+ srv_xmlfiles="${srv_xmlfiles} mips-cp0.xml"
973+ srv_xmlfiles="${srv_xmlfiles} mips-fpu.xml"
974+ srv_xmlfiles="${srv_xmlfiles} mips-dsp.xml"
975+ srv_xmlfiles="${srv_xmlfiles} mips64-linux.xml"
976+ srv_xmlfiles="${srv_xmlfiles} mips64-dsp-linux.xml"
977+ srv_xmlfiles="${srv_xmlfiles} mips64-cpu.xml"
978+ srv_xmlfiles="${srv_xmlfiles} mips64-cp0.xml"
979+ srv_xmlfiles="${srv_xmlfiles} mips64-fpu.xml"
980+ srv_xmlfiles="${srv_xmlfiles} mips64-dsp.xml"
981+ srv_linux_regsets=yes
982+ srv_linux_usrregs=yes
983+ srv_linux_thread_db=yes
984+ ;;
985+ nios2*-*-linux*) srv_regobj="nios2-linux.o"
986+ srv_tgtobj="$srv_linux_obj linux-nios2-low.o"
987+ srv_xmlfiles="nios2-linux.xml"
988+ srv_xmlfiles="${srv_xmlfiles} nios2-cpu.xml"
989+ srv_linux_regsets=yes
990+ srv_linux_usrregs=yes
991+ srv_linux_thread_db=yes
992+ ;;
993+ microblaze*-*-linux*) srv_regobj="microblaze-linux.o"
994+ srv_tgtobj="linux-low.o linux-osdata.o linux-microblaze-low.o "
995+ srv_tgtobj="${srv_tgtobj} linux-procfs.o linux-ptrace.o"
996+ srv_xmlfiles="microblaze-linux.xml"
997+ srv_linux_regsets=yes
998+ srv_linux_usrregs=yes
999+ srv_linux_thread_db=yes
1000+ ;;
1001+ powerpc*-*-linux*) srv_regobj="powerpc-32l.o"
1002+ srv_regobj="${srv_regobj} powerpc-altivec32l.o"
1003+ srv_regobj="${srv_regobj} powerpc-vsx32l.o"
1004+ srv_regobj="${srv_regobj} powerpc-isa205-32l.o"
1005+ srv_regobj="${srv_regobj} powerpc-isa205-altivec32l.o"
1006+ srv_regobj="${srv_regobj} powerpc-isa205-vsx32l.o"
1007+ srv_regobj="${srv_regobj} powerpc-isa205-ppr-dscr-vsx32l.o"
1008+ srv_regobj="${srv_regobj} powerpc-isa207-vsx32l.o"
1009+ srv_regobj="${srv_regobj} powerpc-isa207-htm-vsx32l.o"
1010+ srv_regobj="${srv_regobj} powerpc-e500l.o"
1011+ srv_regobj="${srv_regobj} powerpc-64l.o"
1012+ srv_regobj="${srv_regobj} powerpc-altivec64l.o"
1013+ srv_regobj="${srv_regobj} powerpc-vsx64l.o"
1014+ srv_regobj="${srv_regobj} powerpc-isa205-64l.o"
1015+ srv_regobj="${srv_regobj} powerpc-isa205-altivec64l.o"
1016+ srv_regobj="${srv_regobj} powerpc-isa205-vsx64l.o"
1017+ srv_regobj="${srv_regobj} powerpc-isa205-ppr-dscr-vsx64l.o"
1018+ srv_regobj="${srv_regobj} powerpc-isa207-vsx64l.o"
1019+ srv_regobj="${srv_regobj} powerpc-isa207-htm-vsx64l.o"
1020+ srv_tgtobj="$srv_linux_obj linux-ppc-low.o ppc-linux.o"
1021+ srv_tgtobj="${srv_tgtobj} arch/ppc-linux-common.o"
1022+ srv_xmlfiles="rs6000/powerpc-32l.xml"
1023+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-altivec32l.xml"
1024+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-vsx32l.xml"
1025+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa205-32l.xml"
1026+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa205-altivec32l.xml"
1027+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa205-vsx32l.xml"
1028+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa205-ppr-dscr-vsx32l.xml"
1029+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa207-vsx32l.xml"
1030+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa207-htm-vsx32l.xml"
1031+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-altivec.xml"
1032+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-vsx.xml"
1033+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-core.xml"
1034+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-linux.xml"
1035+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-fpu.xml"
1036+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-fpu-isa205.xml"
1037+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-dscr.xml"
1038+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-ppr.xml"
1039+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-tar.xml"
1040+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-ebb.xml"
1041+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-linux-pmu.xml"
1042+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-htm-spr.xml"
1043+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-htm-core.xml"
1044+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-htm-fpu.xml"
1045+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-htm-altivec.xml"
1046+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-htm-vsx.xml"
1047+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-htm-ppr.xml"
1048+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-htm-dscr.xml"
1049+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-htm-tar.xml"
1050+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-e500l.xml"
1051+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-spe.xml"
1052+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-64l.xml"
1053+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-altivec64l.xml"
1054+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-vsx64l.xml"
1055+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa205-64l.xml"
1056+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa205-altivec64l.xml"
1057+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa205-vsx64l.xml"
1058+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa205-ppr-dscr-vsx64l.xml"
1059+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa207-vsx64l.xml"
1060+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa207-htm-vsx64l.xml"
1061+ srv_xmlfiles="${srv_xmlfiles} rs6000/power64-core.xml"
1062+ srv_xmlfiles="${srv_xmlfiles} rs6000/power64-linux.xml"
1063+ srv_xmlfiles="${srv_xmlfiles} rs6000/power64-htm-core.xml"
1064+ srv_linux_usrregs=yes
1065+ srv_linux_regsets=yes
1066+ srv_linux_thread_db=yes
1067+ ipa_obj="${ipa_ppc_linux_regobj} linux-ppc-ipa.o"
1068+ ;;
1069+ powerpc-*-lynxos*) srv_regobj="powerpc-32.o"
1070+ srv_tgtobj="lynx-low.o lynx-ppc-low.o"
1071+ srv_xmlfiles="rs6000/powerpc-32.xml"
1072+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-core.xml"
1073+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-fpu.xml"
1074+ srv_lynxos=yes
1075+ ;;
1076+ s390*-*-linux*) srv_regobj="s390-linux32.o"
1077+ srv_regobj="${srv_regobj} s390-linux32v1.o"
1078+ srv_regobj="${srv_regobj} s390-linux32v2.o"
1079+ srv_regobj="${srv_regobj} s390-linux64.o"
1080+ srv_regobj="${srv_regobj} s390-linux64v1.o"
1081+ srv_regobj="${srv_regobj} s390-linux64v2.o"
1082+ srv_regobj="${srv_regobj} s390-te-linux64.o"
1083+ srv_regobj="${srv_regobj} s390-vx-linux64.o"
1084+ srv_regobj="${srv_regobj} s390-tevx-linux64.o"
1085+ srv_regobj="${srv_regobj} s390-gs-linux64.o"
1086+ srv_regobj="${srv_regobj} s390x-linux64.o"
1087+ srv_regobj="${srv_regobj} s390x-linux64v1.o"
1088+ srv_regobj="${srv_regobj} s390x-linux64v2.o"
1089+ srv_regobj="${srv_regobj} s390x-te-linux64.o"
1090+ srv_regobj="${srv_regobj} s390x-vx-linux64.o"
1091+ srv_regobj="${srv_regobj} s390x-tevx-linux64.o"
1092+ srv_regobj="${srv_regobj} s390x-gs-linux64.o"
1093+ srv_tgtobj="$srv_linux_obj linux-s390-low.o"
1094+ srv_xmlfiles="s390-linux32.xml"
1095+ srv_xmlfiles="${srv_xmlfiles} s390-linux32v1.xml"
1096+ srv_xmlfiles="${srv_xmlfiles} s390-linux32v2.xml"
1097+ srv_xmlfiles="${srv_xmlfiles} s390-linux64.xml"
1098+ srv_xmlfiles="${srv_xmlfiles} s390-linux64v1.xml"
1099+ srv_xmlfiles="${srv_xmlfiles} s390-linux64v2.xml"
1100+ srv_xmlfiles="${srv_xmlfiles} s390-te-linux64.xml"
1101+ srv_xmlfiles="${srv_xmlfiles} s390-vx-linux64.xml"
1102+ srv_xmlfiles="${srv_xmlfiles} s390-tevx-linux64.xml"
1103+ srv_xmlfiles="${srv_xmlfiles} s390-gs-linux64.xml"
1104+ srv_xmlfiles="${srv_xmlfiles} s390x-linux64.xml"
1105+ srv_xmlfiles="${srv_xmlfiles} s390x-linux64v1.xml"
1106+ srv_xmlfiles="${srv_xmlfiles} s390x-linux64v2.xml"
1107+ srv_xmlfiles="${srv_xmlfiles} s390x-te-linux64.xml"
1108+ srv_xmlfiles="${srv_xmlfiles} s390x-vx-linux64.xml"
1109+ srv_xmlfiles="${srv_xmlfiles} s390x-tevx-linux64.xml"
1110+ srv_xmlfiles="${srv_xmlfiles} s390x-gs-linux64.xml"
1111+ srv_xmlfiles="${srv_xmlfiles} s390-core32.xml"
1112+ srv_xmlfiles="${srv_xmlfiles} s390-core64.xml"
1113+ srv_xmlfiles="${srv_xmlfiles} s390x-core64.xml"
1114+ srv_xmlfiles="${srv_xmlfiles} s390-acr.xml"
1115+ srv_xmlfiles="${srv_xmlfiles} s390-fpr.xml"
1116+ srv_xmlfiles="${srv_xmlfiles} s390-tdb.xml"
1117+ srv_xmlfiles="${srv_xmlfiles} s390-vx.xml"
1118+ srv_xmlfiles="${srv_xmlfiles} s390-gs.xml"
1119+ srv_xmlfiles="${srv_xmlfiles} s390-gsbc.xml"
1120+ srv_linux_usrregs=yes
1121+ srv_linux_regsets=yes
1122+ srv_linux_thread_db=yes
1123+ ipa_obj="linux-s390-ipa.o"
1124+ ipa_obj="${ipa_obj} s390-linux32-ipa.o"
1125+ ipa_obj="${ipa_obj} s390-linux32v1-ipa.o"
1126+ ipa_obj="${ipa_obj} s390-linux32v2-ipa.o"
1127+ ipa_obj="${ipa_obj} s390-linux64-ipa.o"
1128+ ipa_obj="${ipa_obj} s390-linux64v1-ipa.o"
1129+ ipa_obj="${ipa_obj} s390-linux64v2-ipa.o"
1130+ ipa_obj="${ipa_obj} s390-vx-linux64-ipa.o"
1131+ ipa_obj="${ipa_obj} s390-te-linux64-ipa.o"
1132+ ipa_obj="${ipa_obj} s390-tevx-linux64-ipa.o"
1133+ ipa_obj="${ipa_obj} s390-gs-linux64-ipa.o"
1134+ ipa_obj="${ipa_obj} s390x-linux64-ipa.o"
1135+ ipa_obj="${ipa_obj} s390x-linux64v1-ipa.o"
1136+ ipa_obj="${ipa_obj} s390x-linux64v2-ipa.o"
1137+ ipa_obj="${ipa_obj} s390x-vx-linux64-ipa.o"
1138+ ipa_obj="${ipa_obj} s390x-te-linux64-ipa.o"
1139+ ipa_obj="${ipa_obj} s390x-tevx-linux64-ipa.o"
1140+ ipa_obj="${ipa_obj} s390x-gs-linux64-ipa.o"
1141+ ;;
1142+ sh*-*-linux*) srv_regobj=reg-sh.o
1143+ srv_tgtobj="$srv_linux_obj linux-sh-low.o"
1144+ srv_linux_usrregs=yes
1145+ srv_linux_regsets=yes
1146+ srv_linux_thread_db=yes
1147+ ;;
1148+ sparc*-*-linux*) srv_regobj=reg-sparc64.o
1149+ srv_tgtobj="$srv_linux_obj linux-sparc-low.o"
1150+ srv_linux_regsets=yes
1151+ srv_linux_thread_db=yes
1152+ ;;
1153+ tic6x-*-uclinux) if $development; then
1154+ srv_regobj="tic6x-c64xp-linux.o"
1155+ srv_regobj="${srv_regobj} tic6x-c64x-linux.o"
1156+ srv_regobj="${srv_regobj} tic6x-c62x-linux.o"
1157+ else
1158+ srv_regobj=""
1159+ fi
1160+ srv_tgtobj="$srv_linux_obj linux-tic6x-low.o"
1161+ srv_tgtobj="${srv_tgtobj} arch/tic6x.o"
1162+ srv_linux_regsets=yes
1163+ srv_linux_usrregs=yes
1164+ srv_linux_thread_db=yes
1165+ ;;
1166+ x86_64-*-linux*) srv_tgtobj="$srv_linux_obj linux-x86-low.o x86-low.o"
1167+ srv_tgtobj="${srv_tgtobj} x86-dregs.o i387-fp.o"
1168+ srv_tgtobj="${srv_tgtobj} arch/i386.o arch/amd64.o"
1169+ srv_tgtobj="${srv_tgtobj} linux-x86-tdesc.o"
1170+ srv_tgtobj="${srv_tgtobj} linux-btrace.o x86-linux.o"
1171+ srv_tgtobj="${srv_tgtobj} x86-linux-dregs.o"
1172+ srv_tgtobj="${srv_tgtobj} amd64-linux-siginfo.o"
1173+ srv_linux_usrregs=yes # This is for i386 progs.
1174+ srv_linux_regsets=yes
1175+ srv_linux_thread_db=yes
1176+ srv_linux_btrace=yes
1177+ ipa_obj="linux-amd64-ipa.o linux-x86-tdesc-ipa.o"
1178+ ipa_obj="${ipa_obj} arch/amd64-ipa.o"
1179+ ;;
1180+ x86_64-*-mingw*) srv_regobj=""
1181+ srv_tgtobj="x86-low.o x86-dregs.o i387-fp.o win32-low.o win32-i386-low.o"
1182+ srv_tgtobj="${srv_tgtobj} arch/amd64.o"
1183+ srv_mingw=yes
1184+ ;;
1185+ x86_64-*-cygwin*) srv_regobj=""
1186+ srv_tgtobj="x86-low.o x86-dregs.o i387-fp.o win32-low.o win32-i386-low.o"
1187+ srv_tgtobj="${srv_tgtobj} arch/amd64.o"
1188+ ;;
1189+
1190+ xtensa*-*-linux*) srv_regobj=reg-xtensa.o
1191+ srv_tgtobj="$srv_linux_obj linux-xtensa-low.o"
1192+ srv_linux_regsets=yes
1193+ srv_linux_thread_db=yes
1194+ ;;
1195+ tilegx-*-linux*) srv_regobj=reg-tilegx.o
1196+ srv_regobj="${srv_regobj} reg-tilegx32.o"
1197+ srv_tgtobj="$srv_linux_obj linux-tile-low.o"
1198+ srv_linux_regsets=yes
1199+ srv_linux_thread_db=yes
1200+ ;;
1201+ *) echo "Error: target not supported by gdbserver."
1202+ exit 1
1203+ ;;
1204+esac
1205diff --git a/gdb/gdbserver/linux-microblaze-low.c b/gdb/gdbserver/linux-microblaze-low.c
1206new file mode 100644
1207index 00000000000..cba5d6fc585
1208--- /dev/null
1209+++ b/gdb/gdbserver/linux-microblaze-low.c
1210@@ -0,0 +1,189 @@
1211+/* GNU/Linux/Microblaze specific low level interface, for the remote server for
1212+ GDB.
1213+ Copyright (C) 1995-2013 Free Software Foundation, Inc.
1214+
1215+ This file is part of GDB.
1216+
1217+ This program is free software; you can redistribute it and/or modify
1218+ it under the terms of the GNU General Public License as published by
1219+ the Free Software Foundation; either version 3 of the License, or
1220+ (at your option) any later version.
1221+
1222+ This program is distributed in the hope that it will be useful,
1223+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1224+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1225+ GNU General Public License for more details.
1226+
1227+ You should have received a copy of the GNU General Public License
1228+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
1229+
1230+#include "server.h"
1231+#include "linux-low.h"
1232+
1233+#include <asm/ptrace.h>
1234+#include <sys/procfs.h>
1235+#include <sys/ptrace.h>
1236+
1237+#include "gdb_proc_service.h"
1238+
1239+static int microblaze_regmap[] =
1240+ {PT_GPR(0), PT_GPR(1), PT_GPR(2), PT_GPR(3),
1241+ PT_GPR(4), PT_GPR(5), PT_GPR(6), PT_GPR(7),
1242+ PT_GPR(8), PT_GPR(9), PT_GPR(10), PT_GPR(11),
1243+ PT_GPR(12), PT_GPR(13), PT_GPR(14), PT_GPR(15),
1244+ PT_GPR(16), PT_GPR(17), PT_GPR(18), PT_GPR(19),
1245+ PT_GPR(20), PT_GPR(21), PT_GPR(22), PT_GPR(23),
1246+ PT_GPR(24), PT_GPR(25), PT_GPR(26), PT_GPR(27),
1247+ PT_GPR(28), PT_GPR(29), PT_GPR(30), PT_GPR(31),
1248+ PT_PC, PT_MSR, PT_EAR, PT_ESR,
1249+ PT_FSR
1250+ };
1251+
1252+#define microblaze_num_regs (sizeof microblaze_regmap / sizeof microblaze_regmap[0])
1253+
1254+/* Defined in auto-generated file microblaze-linux.c. */
1255+void init_registers_microblaze (void);
1256+
1257+static int
1258+microblaze_cannot_store_register (int regno)
1259+{
1260+ if (microblaze_regmap[regno] == -1 || regno == 0)
1261+ return 1;
1262+
1263+ return 0;
1264+}
1265+
1266+static int
1267+microblaze_cannot_fetch_register (int regno)
1268+{
1269+ return 0;
1270+}
1271+
1272+static CORE_ADDR
1273+microblaze_get_pc (struct regcache *regcache)
1274+{
1275+ unsigned long pc;
1276+
1277+ collect_register_by_name (regcache, "pc", &pc);
1278+ return (CORE_ADDR) pc;
1279+}
1280+
1281+static void
1282+microblaze_set_pc (struct regcache *regcache, CORE_ADDR pc)
1283+{
1284+ unsigned long newpc = pc;
1285+
1286+ supply_register_by_name (regcache, "pc", &newpc);
1287+}
1288+
1289+/* dbtrap insn */
1290+/* brki r16, 0x18; */
1291+static const unsigned long microblaze_breakpoint = 0xba0c0018;
1292+#define microblaze_breakpoint_len 4
1293+
1294+static int
1295+microblaze_breakpoint_at (CORE_ADDR where)
1296+{
1297+ unsigned long insn;
1298+
1299+ (*the_target->read_memory) (where, (unsigned char *) &insn, 4);
1300+ if (insn == microblaze_breakpoint)
1301+ return 1;
1302+ /* If necessary, recognize more trap instructions here. GDB only uses the
1303+ one. */
1304+ return 0;
1305+}
1306+
1307+static CORE_ADDR
1308+microblaze_reinsert_addr (struct regcache *regcache)
1309+{
1310+ unsigned long pc;
1311+ collect_register_by_name (regcache, "r15", &pc);
1312+ return pc;
1313+}
1314+
1315+#ifdef HAVE_PTRACE_GETREGS
1316+
1317+static void
1318+microblaze_collect_ptrace_register (struct regcache *regcache, int regno, char *buf)
1319+{
1320+ int size = register_size (regno);
1321+
1322+ memset (buf, 0, sizeof (long));
1323+
1324+ if (size < sizeof (long))
1325+ collect_register (regcache, regno, buf + sizeof (long) - size);
1326+ else
1327+ collect_register (regcache, regno, buf);
1328+}
1329+
1330+static void
1331+microblaze_supply_ptrace_register (struct regcache *regcache,
1332+ int regno, const char *buf)
1333+{
1334+ int size = register_size (regno);
1335+
1336+ if (regno == 0) {
1337+ unsigned long regbuf_0 = 0;
1338+ /* clobbering r0 so that it is always 0 as enforced by hardware */
1339+ supply_register (regcache, regno, (const char*)&regbuf_0);
1340+ } else {
1341+ if (size < sizeof (long))
1342+ supply_register (regcache, regno, buf + sizeof (long) - size);
1343+ else
1344+ supply_register (regcache, regno, buf);
1345+ }
1346+}
1347+
1348+/* Provide only a fill function for the general register set. ps_lgetregs
1349+ will use this for NPTL support. */
1350+
1351+static void microblaze_fill_gregset (struct regcache *regcache, void *buf)
1352+{
1353+ int i;
1354+
1355+ for (i = 0; i < 32; i++)
1356+ microblaze_collect_ptrace_register (regcache, i, (char *) buf + microblaze_regmap[i]);
1357+}
1358+
1359+static void
1360+microblaze_store_gregset (struct regcache *regcache, const void *buf)
1361+{
1362+ int i;
1363+
1364+ for (i = 0; i < 32; i++)
1365+ supply_register (regcache, i, (char *) buf + microblaze_regmap[i]);
1366+}
1367+
1368+#endif /* HAVE_PTRACE_GETREGS */
1369+
1370+struct regset_info target_regsets[] = {
1371+#ifdef HAVE_PTRACE_GETREGS
1372+ { PTRACE_GETREGS, PTRACE_SETREGS, 0, sizeof (elf_gregset_t), GENERAL_REGS, microblaze_fill_gregset, microblaze_store_gregset },
1373+ { 0, 0, 0, -1, -1, NULL, NULL },
1374+#endif /* HAVE_PTRACE_GETREGS */
1375+ { 0, 0, 0, -1, -1, NULL, NULL }
1376+};
1377+
1378+struct linux_target_ops the_low_target = {
1379+ init_registers_microblaze,
1380+ microblaze_num_regs,
1381+ microblaze_regmap,
1382+ NULL,
1383+ microblaze_cannot_fetch_register,
1384+ microblaze_cannot_store_register,
1385+ NULL, /* fetch_register */
1386+ microblaze_get_pc,
1387+ microblaze_set_pc,
1388+ (const unsigned char *) &microblaze_breakpoint,
1389+ microblaze_breakpoint_len,
1390+ microblaze_reinsert_addr,
1391+ 0,
1392+ microblaze_breakpoint_at,
1393+ NULL,
1394+ NULL,
1395+ NULL,
1396+ NULL,
1397+ microblaze_collect_ptrace_register,
1398+ microblaze_supply_ptrace_register,
1399+};
1400diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c
1401index daa7ddf7e4d..5748556a556 100644
1402--- a/gdb/microblaze-linux-tdep.c
1403+++ b/gdb/microblaze-linux-tdep.c
1404@@ -37,6 +37,22 @@
1405 #include "tramp-frame.h"
1406 #include "linux-tdep.h"
1407
1408+static int microblaze_debug_flag = 0;
1409+
1410+static void
1411+microblaze_debug (const char *fmt, ...)
1412+{
1413+ if (microblaze_debug_flag)
1414+ {
1415+ va_list args;
1416+
1417+ va_start (args, fmt);
1418+ printf_unfiltered ("MICROBLAZE LINUX: ");
1419+ vprintf_unfiltered (fmt, args);
1420+ va_end (args);
1421+ }
1422+}
1423+
1424 static int
1425 microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
1426 struct bp_target_info *bp_tgt)
1427@@ -50,13 +66,20 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
1428 /* Determine appropriate breakpoint contents and size for this address. */
1429 bp = gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen);
1430
1431+ /* Make sure we see the memory breakpoints. */
1432+ scoped_restore restore_memory
1433+ = make_scoped_restore_show_memory_breakpoints (1);
1434+
1435 val = target_read_memory (addr, old_contents, bplen);
1436
1437 /* If our breakpoint is no longer at the address, this means that the
1438 program modified the code on us, so it is wrong to put back the
1439 old value. */
1440 if (val == 0 && memcmp (bp, old_contents, bplen) == 0)
1441- val = target_write_raw_memory (addr, bp_tgt->shadow_contents, bplen);
1442+ {
1443+ val = target_write_raw_memory (addr, bp_tgt->shadow_contents, bplen);
1444+ microblaze_debug ("microblaze_linux_memory_remove_breakpoint writing back to memory at addr 0x%lx\n", addr);
1445+ }
1446
1447 return val;
1448 }
1449@@ -129,6 +152,10 @@ microblaze_linux_init_abi (struct gdbarch_info info,
1450 /* Trampolines. */
1451 tramp_frame_prepend_unwinder (gdbarch,
1452 &microblaze_linux_sighandler_tramp_frame);
1453+
1454+ /* Enable TLS support. */
1455+ set_gdbarch_fetch_tls_load_module_address (gdbarch,
1456+ svr4_fetch_objfile_link_map);
1457 }
1458
1459 void _initialize_microblaze_linux_tdep ();
1460diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
1461index 3d5dd669341..3e8e8fe35b9 100644
1462--- a/gdb/microblaze-tdep.c
1463+++ b/gdb/microblaze-tdep.c
1464@@ -128,7 +128,38 @@ microblaze_fetch_instruction (CORE_ADDR pc)
1465 constexpr gdb_byte microblaze_break_insn[] = MICROBLAZE_BREAKPOINT;
1466
1467 typedef BP_MANIPULATION (microblaze_break_insn) microblaze_breakpoint;
1468-
1469+static int
1470+microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
1471+ struct bp_target_info *bp_tgt)
1472+{
1473+ CORE_ADDR addr = bp_tgt->placed_address;
1474+ const unsigned char *bp;
1475+ int val;
1476+ int bplen;
1477+ gdb_byte old_contents[BREAKPOINT_MAX];
1478+
1479+ /* Determine appropriate breakpoint contents and size for this address. */
1480+ bp = gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen);
1481+ if (bp == NULL)
1482+ error (_("Software breakpoints not implemented for this target."));
1483+
1484+ /* Make sure we see the memory breakpoints. */
1485+ scoped_restore restore_memory
1486+ = make_scoped_restore_show_memory_breakpoints (1);
1487+
1488+ val = target_read_memory (addr, old_contents, bplen);
1489+
1490+ /* If our breakpoint is no longer at the address, this means that the
1491+ program modified the code on us, so it is wrong to put back the
1492+ old value. */
1493+ if (val == 0 && memcmp (bp, old_contents, bplen) == 0)
1494+ {
1495+ val = target_write_raw_memory (addr, bp_tgt->shadow_contents, bplen);
1496+ microblaze_debug ("microblaze_linux_memory_remove_breakpoint writing back to memory at addr 0x%lx\n", addr);
1497+ }
1498+
1499+ return val;
1500+}
1501
1502 /* Allocate and initialize a frame cache. */
1503
1504@@ -716,6 +747,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
1505 microblaze_breakpoint::kind_from_pc);
1506 set_gdbarch_sw_breakpoint_from_kind (gdbarch,
1507 microblaze_breakpoint::bp_from_kind);
1508+ set_gdbarch_memory_remove_breakpoint (gdbarch, microblaze_linux_memory_remove_breakpoint);
1509
1510 set_gdbarch_frame_args_skip (gdbarch, 8);
1511
1512@@ -756,4 +788,5 @@ When non-zero, microblaze specific debugging is enabled."),
1513 NULL,
1514 &setdebuglist, &showdebuglist);
1515
1516+
1517 }
1518diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h
1519index 4d90e8785dc..53fcb2297e6 100644
1520--- a/gdb/microblaze-tdep.h
1521+++ b/gdb/microblaze-tdep.h
1522@@ -118,6 +118,8 @@ struct microblaze_frame_cache
1523
1524 /* MICROBLAZE_BREAKPOINT defines the breakpoint that should be used.
1525 Only used for native debugging. */
1526-#define MICROBLAZE_BREAKPOINT {0xb9, 0xcc, 0x00, 0x60}
1527+#define MICROBLAZE_BREAKPOINT {0xba, 0x0c, 0x00, 0x18}
1528+#define MICROBLAZE_BREAKPOINT_LE {0x18, 0x00, 0x0c, 0xba}
1529+
1530
1531 #endif /* microblaze-tdep.h */
1532diff --git a/gdb/regformats/reg-microblaze.dat b/gdb/regformats/reg-microblaze.dat
1533new file mode 100644
1534index 00000000000..bd8a4384424
1535--- /dev/null
1536+++ b/gdb/regformats/reg-microblaze.dat
1537@@ -0,0 +1,41 @@
1538+name:microblaze
1539+expedite:r1,pc
1540+32:r0
1541+32:r1
1542+32:r2
1543+32:r3
1544+32:r4
1545+32:r5
1546+32:r6
1547+32:r7
1548+32:r8
1549+32:r9
1550+32:r10
1551+32:r11
1552+32:r12
1553+32:r13
1554+32:r14
1555+32:r15
1556+32:r16
1557+32:r17
1558+32:r18
1559+32:r19
1560+32:r20
1561+32:r21
1562+32:r22
1563+32:r23
1564+32:r24
1565+32:r25
1566+32:r26
1567+32:r27
1568+32:r28
1569+32:r29
1570+32:r30
1571+32:r31
1572+32:pc
1573+32:msr
1574+32:ear
1575+32:esr
1576+32:fsr
1577+32:slr
1578+32:shr
1579--
15802.25.1
1581
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0035-MB-binutils-Upstream-port-issues.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0033-Patch-MB-MB-binutils-Upstream-port-issues.patch
index d152334b..f70ca3f2 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0035-MB-binutils-Upstream-port-issues.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0033-Patch-MB-MB-binutils-Upstream-port-issues.patch
@@ -1,21 +1,23 @@
1From 020b77092a7a86795551a97469134c1e6f72b0cd Mon Sep 17 00:00:00 2001 1From 5b79b9fe7da091664680b86e3b09bc4b926e2e61 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 35/38] MB binutils Upstream port issues. 4Subject: [PATCH 33/34] [Patch,MB]: MB binutils Upstream port issues.
5 5
6Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> 6It's resolving the seg faults with ADDLIK
7Conflicts:
8 bfd/elf64-microblaze.c
7--- 9---
8 bfd/elf64-microblaze.c | 250 +++++++++++++++++++++++++++---------- 10 bfd/elf64-microblaze.c | 248 ++++++++++++++++++++++++++++---------
9 gas/config/tc-microblaze.c | 2 +- 11 gas/config/tc-microblaze.c | 2 +-
10 opcodes/microblaze-dis.c | 12 +- 12 opcodes/microblaze-dis.c | 12 +-
11 opcodes/microblaze-opc.h | 2 +- 13 opcodes/microblaze-opc.h | 2 +-
12 4 files changed, 193 insertions(+), 73 deletions(-) 14 4 files changed, 197 insertions(+), 67 deletions(-)
13 15
14diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c 16diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
15index 387ee0da261..2e42366d8d6 100644 17index 77872cef1ab..119d266f95a 100644
16--- a/bfd/elf64-microblaze.c 18--- a/bfd/elf64-microblaze.c
17+++ b/bfd/elf64-microblaze.c 19+++ b/bfd/elf64-microblaze.c
18@@ -808,12 +808,35 @@ microblaze_elf_is_local_label_name (bfd *abfd, const char *name) 20@@ -807,12 +807,35 @@ microblaze_elf_is_local_label_name (bfd *abfd, const char *name)
19 return _bfd_elf_is_local_label_name (abfd, name); 21 return _bfd_elf_is_local_label_name (abfd, name);
20 } 22 }
21 23
@@ -51,7 +53,7 @@ index 387ee0da261..2e42366d8d6 100644
51 /* TLS Reference Types for the symbol; Updated by check_relocs */ 53 /* TLS Reference Types for the symbol; Updated by check_relocs */
52 #define TLS_GD 1 /* GD reloc. */ 54 #define TLS_GD 1 /* GD reloc. */
53 #define TLS_LD 2 /* LD reloc. */ 55 #define TLS_LD 2 /* LD reloc. */
54@@ -837,6 +860,18 @@ struct elf64_mb_link_hash_table 56@@ -836,6 +859,18 @@ struct elf64_mb_link_hash_table
55 { 57 {
56 struct elf_link_hash_table elf; 58 struct elf_link_hash_table elf;
57 59
@@ -137,51 +139,29 @@ index 387ee0da261..2e42366d8d6 100644
137 break; 139 break;
138 } 140 }
139 } 141 }
140@@ -1759,6 +1795,7 @@ microblaze_elf_relocate_section (bfd *output_bfd, 142@@ -1759,6 +1795,21 @@ microblaze_elf_relocate_section (bfd *output_bfd,
141 143
142 return ret; 144 return ret;
143 } 145 }
144+ 146+
147+/* Merge backend specific data from an object file to the output
148+ object file when linking.
149+
150+ Note: We only use this hook to catch endian mismatches. */
151+static bool
152+microblaze_elf_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
153+{
154+ /* Check if we have the same endianess. */
155+ if (! _bfd_generic_verify_endian_match (ibfd, obfd))
156+ return false;
157+
158+ return true;
159+}
160+
145 161
146 /* Calculate fixup value for reference. */ 162 /* Calculate fixup value for reference. */
147 163
148@@ -2436,8 +2473,11 @@ microblaze_elf_relax_section (bfd *abfd, 164@@ -2512,6 +2563,17 @@ microblaze_elf_gc_mark_hook (asection *sec,
149 symtab_hdr->contents = (bfd_byte *) isymbuf;
150 }
151
152- free (free_relocs);
153- free_relocs = NULL;
154+ if (free_relocs != NULL)
155+ {
156+ free (free_relocs);
157+ free_relocs = NULL;
158+ }
159
160 if (free_contents != NULL)
161 {
162@@ -2460,11 +2500,16 @@ microblaze_elf_relax_section (bfd *abfd,
163 return true;
164
165 error_return:
166- free (free_relocs);
167- free (free_contents);
168- free (sdata->relax);
169- sdata->relax = NULL;
170- sdata->relax_count = 0;
171+ if (free_relocs != NULL)
172+ free (free_relocs);
173+ if (free_contents != NULL)
174+ free (free_contents);
175+ if (sdata->relax != NULL)
176+ {
177+ free (sdata->relax);
178+ sdata->relax = NULL;
179+ sdata->relax_count = 0;
180+ }
181 return false;
182 }
183
184@@ -2489,6 +2534,17 @@ microblaze_elf_gc_mark_hook (asection *sec,
185 return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); 165 return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
186 } 166 }
187 167
@@ -199,7 +179,7 @@ index 387ee0da261..2e42366d8d6 100644
199 /* PIC support. */ 179 /* PIC support. */
200 180
201 #define PLT_ENTRY_SIZE 16 181 #define PLT_ENTRY_SIZE 16
202@@ -2695,14 +2751,14 @@ microblaze_elf_check_relocs (bfd * abfd, 182@@ -2718,14 +2780,14 @@ microblaze_elf_check_relocs (bfd * abfd,
203 && (! info->symbolic 183 && (! info->symbolic
204 || h->root.type == bfd_link_hash_defweak 184 || h->root.type == bfd_link_hash_defweak
205 || !h->def_regular)))) 185 || !h->def_regular))))
@@ -222,7 +202,7 @@ index 387ee0da261..2e42366d8d6 100644
222 202
223 /* When creating a shared object, we must copy these 203 /* When creating a shared object, we must copy these
224 relocs into the output file. We create a reloc 204 relocs into the output file. We create a reloc
225@@ -2746,14 +2802,14 @@ microblaze_elf_check_relocs (bfd * abfd, 205@@ -2769,14 +2831,14 @@ microblaze_elf_check_relocs (bfd * abfd,
226 return false; 206 return false;
227 207
228 vpp = &elf_section_data (s)->local_dynrel; 208 vpp = &elf_section_data (s)->local_dynrel;
@@ -239,7 +219,7 @@ index 387ee0da261..2e42366d8d6 100644
239 bfd_alloc (htab->elf.dynobj, amt)); 219 bfd_alloc (htab->elf.dynobj, amt));
240 if (p == NULL) 220 if (p == NULL)
241 return false; 221 return false;
242@@ -2776,6 +2832,34 @@ microblaze_elf_check_relocs (bfd * abfd, 222@@ -2799,6 +2861,34 @@ microblaze_elf_check_relocs (bfd * abfd,
243 return true; 223 return true;
244 } 224 }
245 225
@@ -274,7 +254,7 @@ index 387ee0da261..2e42366d8d6 100644
274 /* Copy the extra info we tack onto an elf_link_hash_entry. */ 254 /* Copy the extra info we tack onto an elf_link_hash_entry. */
275 255
276 static void 256 static void
277@@ -2788,6 +2872,40 @@ microblaze_elf_copy_indirect_symbol (struct bfd_link_info *info, 257@@ -2811,6 +2901,40 @@ microblaze_elf_copy_indirect_symbol (struct bfd_link_info *info,
278 edir = (struct elf64_mb_link_hash_entry *) dir; 258 edir = (struct elf64_mb_link_hash_entry *) dir;
279 eind = (struct elf64_mb_link_hash_entry *) ind; 259 eind = (struct elf64_mb_link_hash_entry *) ind;
280 260
@@ -315,7 +295,20 @@ index 387ee0da261..2e42366d8d6 100644
315 edir->tls_mask |= eind->tls_mask; 295 edir->tls_mask |= eind->tls_mask;
316 296
317 _bfd_elf_link_hash_copy_indirect (info, dir, ind); 297 _bfd_elf_link_hash_copy_indirect (info, dir, ind);
318@@ -2873,9 +2991,17 @@ microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info, 298@@ -2821,8 +2945,12 @@ microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
299 struct elf_link_hash_entry *h)
300 {
301 struct elf64_mb_link_hash_table *htab;
302+ struct elf64_mb_link_hash_entry * eh;
303+ struct elf64_mb_dyn_relocs *p;
304+ asection *sdynbss;
305 asection *s, *srel;
306 unsigned int power_of_two;
307+ bfd *dynobj;
308
309 htab = elf64_mb_hash_table (info);
310 if (htab == NULL)
311@@ -2892,9 +3020,17 @@ microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
319 return true; 312 return true;
320 } 313 }
321 314
@@ -335,7 +328,7 @@ index 387ee0da261..2e42366d8d6 100644
335 { 328 {
336 h->non_got_ref = 0; 329 h->non_got_ref = 0;
337 return true; 330 return true;
338@@ -2894,19 +3020,11 @@ microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info, 331@@ -2913,19 +3049,11 @@ microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
339 /* We must generate a R_MICROBLAZE_COPY reloc to tell the dynamic linker 332 /* We must generate a R_MICROBLAZE_COPY reloc to tell the dynamic linker
340 to copy the initial value out of the dynamic object and into the 333 to copy the initial value out of the dynamic object and into the
341 runtime process image. */ 334 runtime process image. */
@@ -358,7 +351,7 @@ index 387ee0da261..2e42366d8d6 100644
358 h->needs_copy = 1; 351 h->needs_copy = 1;
359 } 352 }
360 353
361@@ -2916,11 +3034,12 @@ microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info, 354@@ -2935,11 +3063,12 @@ microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
362 if (power_of_two > 3) 355 if (power_of_two > 3)
363 power_of_two = 3; 356 power_of_two = 3;
364 357
@@ -374,7 +367,7 @@ index 387ee0da261..2e42366d8d6 100644
374 return false; 367 return false;
375 } 368 }
376 369
377@@ -2942,7 +3061,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat) 370@@ -2961,7 +3090,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat)
378 struct bfd_link_info *info; 371 struct bfd_link_info *info;
379 struct elf64_mb_link_hash_table *htab; 372 struct elf64_mb_link_hash_table *htab;
380 struct elf64_mb_link_hash_entry *eh; 373 struct elf64_mb_link_hash_entry *eh;
@@ -383,7 +376,7 @@ index 387ee0da261..2e42366d8d6 100644
383 376
384 if (h->root.type == bfd_link_hash_indirect) 377 if (h->root.type == bfd_link_hash_indirect)
385 return true; 378 return true;
386@@ -2994,7 +3113,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat) 379@@ -3013,7 +3142,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat)
387 htab->elf.sgotplt->size += 4; 380 htab->elf.sgotplt->size += 4;
388 381
389 /* We also need to make an entry in the .rel.plt section. */ 382 /* We also need to make an entry in the .rel.plt section. */
@@ -392,7 +385,7 @@ index 387ee0da261..2e42366d8d6 100644
392 } 385 }
393 else 386 else
394 { 387 {
395@@ -3060,7 +3179,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat) 388@@ -3079,7 +3208,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat)
396 else 389 else
397 h->got.offset = (bfd_vma) -1; 390 h->got.offset = (bfd_vma) -1;
398 391
@@ -401,7 +394,7 @@ index 387ee0da261..2e42366d8d6 100644
401 return true; 394 return true;
402 395
403 /* In the shared -Bsymbolic case, discard space allocated for 396 /* In the shared -Bsymbolic case, discard space allocated for
404@@ -3075,9 +3194,9 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat) 397@@ -3094,9 +3223,9 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat)
405 && (h->forced_local 398 && (h->forced_local
406 || info->symbolic)) 399 || info->symbolic))
407 { 400 {
@@ -413,7 +406,7 @@ index 387ee0da261..2e42366d8d6 100644
413 { 406 {
414 p->count -= p->pc_count; 407 p->count -= p->pc_count;
415 p->pc_count = 0; 408 p->pc_count = 0;
416@@ -3169,7 +3288,7 @@ microblaze_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, 409@@ -3188,7 +3317,7 @@ microblaze_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
417 { 410 {
418 struct elf_dyn_relocs *p; 411 struct elf_dyn_relocs *p;
419 412
@@ -422,13 +415,18 @@ index 387ee0da261..2e42366d8d6 100644
422 elf_section_data (s)->local_dynrel); 415 elf_section_data (s)->local_dynrel);
423 p != NULL; 416 p != NULL;
424 p = p->next) 417 p = p->next)
425@@ -3650,9 +3769,10 @@ microblaze_elf_add_symbol_hook (bfd *abfd, 418@@ -3666,13 +3795,14 @@ microblaze_elf_add_symbol_hook (bfd *abfd,
419 #define bfd_elf64_new_section_hook microblaze_elf_new_section_hook
420 #define elf_backend_relocate_section microblaze_elf_relocate_section
421 #define bfd_elf64_bfd_relax_section microblaze_elf_relax_section
422-#define bfd_elf64_bfd_merge_private_bfd_data _bfd_generic_verify_endian_match
423+#define bfd_elf64_bfd_merge_private_bfd_data microblaze_elf_merge_private_bfd_data
426 #define bfd_elf64_bfd_reloc_name_lookup microblaze_elf_reloc_name_lookup 424 #define bfd_elf64_bfd_reloc_name_lookup microblaze_elf_reloc_name_lookup
427 425
428 #define elf_backend_gc_mark_hook microblaze_elf_gc_mark_hook 426 #define elf_backend_gc_mark_hook microblaze_elf_gc_mark_hook
429-#define elf_backend_check_relocs microblaze_elf_check_relocs 427-#define elf_backend_check_relocs microblaze_elf_check_relocs
430-#define elf_backend_copy_indirect_symbol microblaze_elf_copy_indirect_symbol 428-#define elf_backend_copy_indirect_symbol microblaze_elf_copy_indirect_symbol
431-#define bfd_elf32_bfd_link_hash_table_create microblaze_elf_link_hash_table_create 429-#define bfd_elf64_bfd_link_hash_table_create microblaze_elf_link_hash_table_create
432+#define elf_backend_gc_sweep_hook microblaze_elf_gc_sweep_hook 430+#define elf_backend_gc_sweep_hook microblaze_elf_gc_sweep_hook
433+#define elf_backend_check_relocs microblaze_elf_check_relocs 431+#define elf_backend_check_relocs microblaze_elf_check_relocs
434+#define elf_backend_copy_indirect_symbol microblaze_elf_copy_indirect_symbol 432+#define elf_backend_copy_indirect_symbol microblaze_elf_copy_indirect_symbol
@@ -436,7 +434,7 @@ index 387ee0da261..2e42366d8d6 100644
436 #define elf_backend_can_gc_sections 1 434 #define elf_backend_can_gc_sections 1
437 #define elf_backend_can_refcount 1 435 #define elf_backend_can_refcount 1
438 #define elf_backend_want_got_plt 1 436 #define elf_backend_want_got_plt 1
439@@ -3662,11 +3782,11 @@ microblaze_elf_add_symbol_hook (bfd *abfd, 437@@ -3682,11 +3812,11 @@ microblaze_elf_add_symbol_hook (bfd *abfd,
440 #define elf_backend_rela_normal 1 438 #define elf_backend_rela_normal 1
441 #define elf_backend_dtrel_excludes_plt 1 439 #define elf_backend_dtrel_excludes_plt 1
442 440
@@ -454,7 +452,7 @@ index 387ee0da261..2e42366d8d6 100644
454 452
455 #include "elf64-target.h" 453 #include "elf64-target.h"
456diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 454diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
457index 123d5ba6214..41d51007273 100644 455index 6b398ab5605..c4a3817bf19 100644
458--- a/gas/config/tc-microblaze.c 456--- a/gas/config/tc-microblaze.c
459+++ b/gas/config/tc-microblaze.c 457+++ b/gas/config/tc-microblaze.c
460@@ -433,7 +433,7 @@ const pseudo_typeS md_pseudo_table[] = 458@@ -433,7 +433,7 @@ const pseudo_typeS md_pseudo_table[] =
@@ -467,7 +465,7 @@ index 123d5ba6214..41d51007273 100644
467 465
468 opcode_hash_control = str_htab_create (); 466 opcode_hash_control = str_htab_create ();
469diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c 467diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c
470index 0814cab5bdb..95c2147f86e 100644 468index b5a78dcfe09..b76a5935a34 100644
471--- a/opcodes/microblaze-dis.c 469--- a/opcodes/microblaze-dis.c
472+++ b/opcodes/microblaze-dis.c 470+++ b/opcodes/microblaze-dis.c
473@@ -140,7 +140,7 @@ get_field_imm16 (struct string_buf *buf, long instr) 471@@ -140,7 +140,7 @@ get_field_imm16 (struct string_buf *buf, long instr)
@@ -502,7 +500,7 @@ index 0814cab5bdb..95c2147f86e 100644
502 int immval = 0; 500 int immval = 0;
503 bool immfound = false; 501 bool immfound = false;
504 static bfd_vma prev_insn_addr = -1; /* Init the prev insn addr. */ 502 static bfd_vma prev_insn_addr = -1; /* Init the prev insn addr. */
505@@ -496,7 +496,7 @@ get_insn_microblaze (long inst, 503@@ -497,7 +497,7 @@ get_insn_microblaze (long inst,
506 enum microblaze_instr_type *insn_type, 504 enum microblaze_instr_type *insn_type,
507 short *delay_slots) 505 short *delay_slots)
508 { 506 {
@@ -511,7 +509,7 @@ index 0814cab5bdb..95c2147f86e 100644
511 *isunsignedimm = false; 509 *isunsignedimm = false;
512 510
513 /* Just a linear search of the table. */ 511 /* Just a linear search of the table. */
514@@ -538,7 +538,7 @@ microblaze_get_target_address (long inst, bool immfound, int immval, 512@@ -539,7 +539,7 @@ microblaze_get_target_address (long inst, bool immfound, int immval,
515 bool *targetvalid, 513 bool *targetvalid,
516 bool *unconditionalbranch) 514 bool *unconditionalbranch)
517 { 515 {
@@ -534,5 +532,5 @@ index e65f4b58233..4a415495113 100644
534 const char * name; 532 const char * name;
535 short inst_type; /* Registers and immediate values involved. */ 533 short inst_type; /* Registers and immediate values involved. */
536-- 534--
5372.25.1 5352.37.1 (Apple Git-137.1)
538 536
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0034-Initial-port-of-core-reading-support-Added-support-f.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0034-Initial-port-of-core-reading-support-Added-support-f.patch
deleted file mode 100644
index 18a1da90..00000000
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0034-Initial-port-of-core-reading-support-Added-support-f.patch
+++ /dev/null
@@ -1,305 +0,0 @@
1From 98f1df0f21b6c44eb8b5bac070a748c4a16d3f66 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Tue, 24 Jan 2017 14:55:56 +0530
4Subject: [PATCH 34/38] Initial port of core reading support Added support for
5 reading notes in linux core dumps Support for reading of PRSTATUS and PSINFO
6 information for rebuilding ".reg" sections of core dumps at run time.
7
8Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
9Signed-off-by: Nathan Rossi <nathan.rossi@petalogix.com>
10
11Conflicts:
12 gdb/microblaze-linux-tdep.c
13 gdb/microblaze-tdep.c
14Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
15---
16 bfd/elf32-microblaze.c | 84 +++++++++++++++++++++++++++++++++++++
17 gdb/configure.tgt | 2 +-
18 gdb/microblaze-linux-tdep.c | 17 +++++++-
19 gdb/microblaze-tdep.c | 48 +++++++++++++++++++++
20 gdb/microblaze-tdep.h | 27 ++++++++++++
21 5 files changed, 176 insertions(+), 2 deletions(-)
22
23diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
24index f41b503cbb5..9c6d0411420 100644
25--- a/bfd/elf32-microblaze.c
26+++ b/bfd/elf32-microblaze.c
27@@ -806,6 +806,87 @@ microblaze_elf_is_local_label_name (bfd *abfd, const char *name)
28 return _bfd_elf_is_local_label_name (abfd, name);
29 }
30
31+/* Support for core dump NOTE sections. */
32+static bool
33+microblaze_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
34+{
35+ int offset;
36+ unsigned int size;
37+
38+ switch (note->descsz)
39+ {
40+ default:
41+ return false;
42+
43+ case 228: /* Linux/MicroBlaze */
44+ /* pr_cursig */
45+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
46+
47+ /* pr_pid */
48+ elf_tdata (abfd)->core->pid = bfd_get_32 (abfd, note->descdata + 24);
49+
50+ /* pr_reg */
51+ offset = 72;
52+ size = 50 * 4;
53+
54+ break;
55+ }
56+
57+ /* Make a ".reg/999" section. */
58+ return _bfd_elfcore_make_pseudosection (abfd, ".reg",
59+ size, note->descpos + offset);
60+}
61+
62+static bool
63+microblaze_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
64+{
65+ switch (note->descsz)
66+ {
67+ default:
68+ return false;
69+
70+ case 128: /* Linux/MicroBlaze elf_prpsinfo */
71+ elf_tdata (abfd)->core->program
72+ = _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
73+ elf_tdata (abfd)->core->command
74+ = _bfd_elfcore_strndup (abfd, note->descdata + 48, 80);
75+ }
76+
77+ /* Note that for some reason, a spurious space is tacked
78+ onto the end of the args in some (at least one anyway)
79+ implementations, so strip it off if it exists. */
80+
81+ {
82+ char *command = elf_tdata (abfd)->core->command;
83+ int n = strlen (command);
84+
85+ if (0 < n && command[n - 1] == ' ')
86+ command[n - 1] = '\0';
87+ }
88+
89+ return true;
90+}
91+
92+/* The microblaze linker (like many others) needs to keep track of
93+ the number of relocs that it decides to copy as dynamic relocs in
94+ check_relocs for each symbol. This is so that it can later discard
95+ them if they are found to be unnecessary. We store the information
96+ in a field extending the regular ELF linker hash table. */
97+
98+struct elf32_mb_dyn_relocs
99+{
100+ struct elf32_mb_dyn_relocs *next;
101+
102+ /* The input section of the reloc. */
103+ asection *sec;
104+
105+ /* Total number of relocs copied for the input section. */
106+ bfd_size_type count;
107+
108+ /* Number of pc-relative relocs copied for the input section. */
109+ bfd_size_type pc_count;
110+};
111+
112 /* ELF linker hash entry. */
113
114 struct elf32_mb_link_hash_entry
115@@ -3604,4 +3685,7 @@ microblaze_elf_add_symbol_hook (bfd *abfd,
116 #define elf_backend_size_dynamic_sections microblaze_elf_size_dynamic_sections
117 #define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook
118
119+#define elf_backend_grok_prstatus microblaze_elf_grok_prstatus
120+#define elf_backend_grok_psinfo microblaze_elf_grok_psinfo
121+
122 #include "elf32-target.h"
123diff --git a/gdb/configure.tgt b/gdb/configure.tgt
124index 0705ccf32b8..7ea186481f3 100644
125--- a/gdb/configure.tgt
126+++ b/gdb/configure.tgt
127@@ -400,7 +400,7 @@ mep-*-*)
128
129 microblaze*-linux-*|microblaze*-*-linux*)
130 # Target: Xilinx MicroBlaze running Linux
131- gdb_target_obs="microblaze-tdep.o microblaze-linux-tdep.o solib-svr4.o \
132+ gdb_target_obs="microblaze-tdep.o microblaze-linux-tdep.o solib-svr4.o glibc-tdep.o \
133 symfile-mem.o linux-tdep.o"
134 ;;
135 microblaze*-*-*)
136diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c
137index 5748556a556..1e1f03fc154 100644
138--- a/gdb/microblaze-linux-tdep.c
139+++ b/gdb/microblaze-linux-tdep.c
140@@ -36,6 +36,7 @@
141 #include "frame-unwind.h"
142 #include "tramp-frame.h"
143 #include "linux-tdep.h"
144+#include "glibc-tdep.h"
145
146 static int microblaze_debug_flag = 0;
147
148@@ -135,13 +136,16 @@ static struct tramp_frame microblaze_linux_sighandler_tramp_frame =
149 microblaze_linux_sighandler_cache_init
150 };
151
152-
153 static void
154 microblaze_linux_init_abi (struct gdbarch_info info,
155 struct gdbarch *gdbarch)
156 {
157+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
158+
159+ tdep->sizeof_gregset = 200;
160 linux_init_abi (info, gdbarch, 0);
161
162+
163 set_gdbarch_memory_remove_breakpoint (gdbarch,
164 microblaze_linux_memory_remove_breakpoint);
165
166@@ -153,6 +157,17 @@ microblaze_linux_init_abi (struct gdbarch_info info,
167 tramp_frame_prepend_unwinder (gdbarch,
168 &microblaze_linux_sighandler_tramp_frame);
169
170+ /* BFD target for core files. */
171+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
172+ set_gdbarch_gcore_bfd_target (gdbarch, "elf32-microblaze");
173+ else
174+ set_gdbarch_gcore_bfd_target (gdbarch, "elf32-microblazeel");
175+
176+
177+ /* Shared library handling. */
178+ set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
179+ set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
180+
181 /* Enable TLS support. */
182 set_gdbarch_fetch_tls_load_module_address (gdbarch,
183 svr4_fetch_objfile_link_map);
184diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
185index 3e8e8fe35b9..31005332104 100644
186--- a/gdb/microblaze-tdep.c
187+++ b/gdb/microblaze-tdep.c
188@@ -666,6 +666,43 @@ microblaze_register_g_packet_guesses (struct gdbarch *gdbarch)
189 tdesc_microblaze_with_stack_protect);
190 }
191
192+void
193+microblaze_supply_gregset (const struct regset *regset,
194+ struct regcache *regcache,
195+ int regnum, const void *gregs)
196+{
197+ const unsigned int *regs = (const unsigned int *)gregs;
198+ if (regnum >= 0)
199+ regcache->raw_supply (regnum, regs + regnum);
200+
201+ if (regnum == -1) {
202+ int i;
203+
204+ for (i = 0; i < 50; i++) {
205+ regcache->raw_supply (i, regs + i);
206+ }
207+ }
208+}
209+
210+
211+/* Return the appropriate register set for the core section identified
212+ by SECT_NAME and SECT_SIZE. */
213+
214+static void
215+microblaze_iterate_over_regset_sections (struct gdbarch *gdbarch,
216+ iterate_over_regset_sections_cb *cb,
217+ void *cb_data,
218+ const struct regcache *regcache)
219+{
220+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
221+
222+ cb(".reg", tdep->sizeof_gregset, tdep->sizeof_gregset, tdep->gregset, NULL, cb_data);
223+
224+ cb(".reg2", tdep->sizeof_fpregset, tdep->sizeof_fpregset, tdep->fpregset, NULL, cb_data);
225+}
226+
227+
228+
229 static struct gdbarch *
230 microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
231 {
232@@ -718,6 +755,10 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
233 microblaze_gdbarch_tdep *tdep = new microblaze_gdbarch_tdep;
234 gdbarch = gdbarch_alloc (&info, tdep);
235
236+ tdep->gregset = NULL;
237+ tdep->sizeof_gregset = 0;
238+ tdep->fpregset = NULL;
239+ tdep->sizeof_fpregset = 0;
240 set_gdbarch_long_double_bit (gdbarch, 128);
241
242 set_gdbarch_num_regs (gdbarch, MICROBLAZE_NUM_REGS);
243@@ -766,6 +807,13 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
244 frame_base_append_sniffer (gdbarch, dwarf2_frame_base_sniffer);
245 if (tdesc_data != NULL)
246 tdesc_use_registers (gdbarch, tdesc, std::move (tdesc_data));
247+ //frame_base_append_sniffer (gdbarch, microblaze_frame_sniffer);
248+
249+ /* If we have register sets, enable the generic core file support. */
250+ if (tdep->gregset) {
251+ set_gdbarch_iterate_over_regset_sections (gdbarch,
252+ microblaze_iterate_over_regset_sections);
253+ }
254
255 return gdbarch;
256 }
257diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h
258index 53fcb2297e6..6f5bd5903a7 100644
259--- a/gdb/microblaze-tdep.h
260+++ b/gdb/microblaze-tdep.h
261@@ -23,8 +23,22 @@
262 #include "gdbarch.h"
263
264 /* Microblaze architecture-specific information. */
265+struct microblaze_gregset
266+{
267+ unsigned int gregs[32];
268+ unsigned int fpregs[32];
269+ unsigned int pregs[16];
270+};
271+
272 struct microblaze_gdbarch_tdep : gdbarch_tdep
273 {
274+ int dummy; // declare something.
275+
276+ /* Register sets. */
277+ struct regset *gregset;
278+ size_t sizeof_gregset;
279+ struct regset *fpregset;
280+ size_t sizeof_fpregset;
281 };
282
283 /* Register numbers. */
284@@ -121,5 +135,18 @@ struct microblaze_frame_cache
285 #define MICROBLAZE_BREAKPOINT {0xba, 0x0c, 0x00, 0x18}
286 #define MICROBLAZE_BREAKPOINT_LE {0x18, 0x00, 0x0c, 0xba}
287
288+extern void microblaze_supply_gregset (const struct regset *regset,
289+ struct regcache *regcache,
290+ int regnum, const void *gregs);
291+extern void microblaze_collect_gregset (const struct regset *regset,
292+ const struct regcache *regcache,
293+ int regnum, void *gregs);
294+extern void microblaze_supply_fpregset (struct regcache *regcache,
295+ int regnum, const void *fpregs);
296+extern void microblaze_collect_fpregset (const struct regcache *regcache,
297+ int regnum, void *fpregs);
298+
299+extern const struct regset * microblaze_regset_from_core_section (struct gdbarch *gdbarch,
300+ const char *sect_name, size_t sect_size);
301
302 #endif /* microblaze-tdep.h */
303--
3042.25.1
305
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0034-Patch-MicroBlaze-By-default-the-linker-will-generate.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0034-Patch-MicroBlaze-By-default-the-linker-will-generate.patch
new file mode 100644
index 00000000..4428823f
--- /dev/null
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0034-Patch-MicroBlaze-By-default-the-linker-will-generate.patch
@@ -0,0 +1,27 @@
1From 652c69cca5a9da92369378674707cdc59988bcc3 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Fri, 28 Oct 2022 13:57:48 +0530
4Subject: [PATCH 34/34] [Patch,MicroBlaze] : By default the linker will
5 generate warnings if it is creating an executable stack or a segment with
6 all three of read, write and execute permissions. These settings are not
7 appropriate for all targets
8
9---
10 ld/configure.tgt | 1 +
11 1 file changed, 1 insertion(+)
12
13diff --git a/ld/configure.tgt b/ld/configure.tgt
14index 80ffbcf23b3..198cd0f71e4 100644
15--- a/ld/configure.tgt
16+++ b/ld/configure.tgt
17@@ -55,6 +55,7 @@ if test "${ac_default_ld_warn_rwx_segments}" = unset; then
18 cris-*-* | crisv32-*-* | \
19 hppa*-*-* | \
20 mips*-*-* | \
21+ microblaze*-*-* | \
22 sparc*-*-*)
23 ac_default_ld_warn_rwx_segments=0
24 ;;
25--
262.37.1 (Apple Git-137.1)
27
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0037-Fixing-the-imm-imml-generation-for-16-bit-argument-C.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0037-Fixing-the-imm-imml-generation-for-16-bit-argument-C.patch
deleted file mode 100644
index 5c69eed7..00000000
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0037-Fixing-the-imm-imml-generation-for-16-bit-argument-C.patch
+++ /dev/null
@@ -1,48 +0,0 @@
1From 9f2319c6e32c4449604c2ec26042123a88eeb87c Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Mon, 24 Jan 2022 16:21:33 +0530
4Subject: [PATCH 37/38] Fixing the imm/imml generation for 16 bit argument
5 [CR-1115234].
6
7Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
8---
9 bfd/elf32-microblaze.c | 6 +++++-
10 bfd/elf64-microblaze.c | 5 ++++-
11 2 files changed, 9 insertions(+), 2 deletions(-)
12
13diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
14index e284b0e5398..8b947a6ec79 100644
15--- a/bfd/elf32-microblaze.c
16+++ b/bfd/elf32-microblaze.c
17@@ -2016,7 +2016,11 @@ microblaze_elf_relax_section (bfd *abfd,
18 else
19 symval += irel->r_addend;
20
21- if ((symval & 0xffff8000) == 0)
22+ /* Check for imm command argument value to decide if
23+ * we need full 32-bit value for next command */
24+ if ((symval & 0xffff8000) == 0
25+ || (symval & 0xffff8000) == 0xffff8000)
26+
27 {
28 /* We can delete this instruction. */
29 sdata->relax[sdata->relax_count].addr = irel->r_offset;
30diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
31index 3b6e6aa47bd..cecfb5506f8 100644
32--- a/bfd/elf64-microblaze.c
33+++ b/bfd/elf64-microblaze.c
34@@ -2011,7 +2011,10 @@ microblaze_elf_relax_section (bfd *abfd,
35 else
36 symval += irel->r_addend;
37
38- if ((symval & 0xffff8000) == 0)
39+ /* Check for imm command argument value to decide if
40+ * we need full 32-bit value for next command */
41+ if ((symval & 0xffff8000) == 0
42+ || (symval & 0xffff8000) == 0xffff8000)
43 {
44 /* We can delete this instruction. */
45 sdata->relax[sdata->relax_count].addr = irel->r_offset;
46--
472.25.1
48