Skip to content

Commit

Permalink
binutils: update to current oe-core 2.39 version
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Hatle <[email protected]>
  • Loading branch information
mhatle committed Sep 1, 2022
1 parent dafa66a commit 940e4d9
Show file tree
Hide file tree
Showing 39 changed files with 794 additions and 694 deletions.
40 changes: 20 additions & 20 deletions meta-microblaze/recipes-devtools/binutils/binutils-microblaze.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ SRC_URI:append = " \
file://0001-Add-wdc.ext.clear-and-wdc.ext.flush-insns.patch \
file://0002-Add-mlittle-endian-and-mbig-endian-flags.patch \
file://0003-Disable-the-warning-message-for-eh_frame_hdr.patch \
file://0004-LOCAL-Fix-relaxation-of-assembler-resolved-reference.patch \
file://0004-Fix-relaxation-of-assembler-resolved-references-Fixu.patch \
file://0005-upstream-change-to-garbage-collection-sweep-causes-m.patch \
file://0006-Fix-bug-in-TLSTPREL-Relocation.patch \
file://0007-Added-Address-extension-instructions.patch \
file://0008-fixing-the-MAX_OPCODES-to-correct-value.patch \
file://0009-Add-new-bit-field-instructions.patch \
file://0010-fixing-the-imm-bug.patch \
file://0011-Patch-Microblaze-fixed-bug-in-GCC-so-that-It-will-su.patch \
file://0012-fixing-the-constant-range-check-issue.patch \
file://0013-Patch-Microblaze-Compiler-will-give-error-messages-i.patch \
file://0014-Patch-MicroBlaze-initial-support-for-MicroBlaze-64-b.patch \
file://0015-Patch-Microblaze-negl-instruction-is-overriding-rsub.patch \
file://0010-fixing-the-imm-bug.-with-relax-option-imm-1-is-also-.patch \
file://0011-fixed-bug-in-GCC-so-that-It-will-support-.long-0U-an.patch \
file://0012-fixing-the-constant-range-check-issue-sample-error-n.patch \
file://0013-Compiler-will-give-error-messages-in-more-detail-for.patch \
file://0014-initial-support-for-MicroBlaze-64-bit-m64.patch \
file://0015-negl-instruction-is-overriding-rsubl-fixed-it-by-cha.patch \
file://0016-Added-relocations-for-MB-X.patch \
file://0017-Fixed-MB-x-relocation-issues.patch \
file://0017-Fixed-MB-x-relocation-issues-Added-imml-for-required.patch \
file://0018-Fixing-the-branch-related-issues.patch \
file://0019-Fixed-address-computation-issues-with-64bit-address.patch \
file://0019-Fixed-address-computation-issues-with-64bit-address-.patch \
file://0020-Patch-MicroBlaze-Adding-new-relocation-to-support-64.patch \
file://0021-fixing-the-.bss-relocation-issue.patch \
file://0022-Fixed-the-bug-in-the-R_MICROBLAZE_64_NONE-relocation.patch \
file://0023-Revert-ld-Remove-unused-expression-state.patch \
file://0023-Revert-ld-Remove-unused-expression-state-defsym-symb.patch \
file://0024-fixing-the-long-long-long-mingw-toolchain-issue.patch \
file://0025-Added-support-to-new-arithmetic-single-register-inst.patch \
file://0026-Patch-MicroBlaze-double-imml-generation-for-64-bit-v.patch \
file://0026-double-imml-generation-for-64-bit-values.patch \
file://0027-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch \
file://0028-Patch-MicroBlaze-m64-This-patch-will-remove-imml-0-a.patch \
file://0029-Patch-MicroBlaze-improper-address-mapping-of-PROVIDE.patch \
file://0030-Patch-microblaze-Changing-the-long-to-long-long-as-i.patch \
file://0028-This-patch-will-remove-imml-0-and-imml-1-instruction.patch \
file://0029-improper-address-mapping-of-PROVIDE-directive-symbol.patch \
file://0030-Changing-the-long-to-long-long-as-in-Windows-long-is.patch \
file://0031-gas-revert-moving-of-md_pseudo_table-from-const.patch \
file://0032-ld-emulparams-elf64microblaze-Fix-emulation-generati.patch \
file://0033-Add-initial-port-of-linux-gdbserver.patch \
file://0034-Initial-port-of-core-reading-support.patch \
file://0038-Patch-MB-MB-binutils-Upstream-port-issues.patch \
file://0039-Patch-MicroBlaze-Double-free-with-ld-no-keep-memory.patch \
file://0040-Patch-MicroBlaze-Fixing-the-imm-imml-generation-for-.patch \
file://0041-Patch-MicroBlaze-Invalid-data-offsets-pointer-after-.patch \
file://0033-Add-initial-port-of-linux-gdbserver-add-gdb_proc_ser.patch \
file://0034-Initial-port-of-core-reading-support-Added-support-f.patch \
file://0035-MB-binutils-Upstream-port-issues.patch \
file://0036-Double-free-with-ld-no-keep-memory.-Proposed-patches.patch \
file://0037-Fixing-the-imm-imml-generation-for-16-bit-argument-C.patch \
file://0038-Invalid-data-offsets-pointer-after-relaxation.-Propo.patch \
"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From baa73267935dc5854f4e07c809a46e42aa8cca4b Mon Sep 17 00:00:00 2001
From fd654b0c7b88cd55fa659e0acea91296c7ed8e80 Mon Sep 17 00:00:00 2001
From: David Holsgrove <[email protected]>
Date: Wed, 8 May 2013 11:03:36 +1000
Subject: [PATCH 01/38] Add wdc.ext.clear and wdc.ext.flush insns
Expand All @@ -9,13 +9,14 @@ used with the new coherency support for multiprocessing.

Signed-off-by:nagaraju <[email protected]>
Signed-off-by: David Holsgrove <[email protected]>
Signed-off-by: Mark Hatle <[email protected]>
---
opcodes/microblaze-opc.h | 5 ++++-
opcodes/microblaze-opcm.h | 4 ++--
2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
index 080d238bd2b..746566fdb87 100644
index ffb0f08c692..b8a0cf82516 100644
--- a/opcodes/microblaze-opc.h
+++ b/opcodes/microblaze-opc.h
@@ -91,6 +91,7 @@
Expand Down Expand Up @@ -46,7 +47,7 @@ index 080d238bd2b..746566fdb87 100644
{"mfs", INST_TYPE_RD_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_MFS, 0x94008000, OPCODE_MASK_H23S, mfs, special_inst },
{"br", INST_TYPE_R2, INST_PC_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x98000000, OPCODE_MASK_H124, br, branch_inst },
diff --git a/opcodes/microblaze-opcm.h b/opcodes/microblaze-opcm.h
index 6dd3694f4be..10d7e883366 100644
index 8e293465fec..e56c1d2d47c 100644
--- a/opcodes/microblaze-opcm.h
+++ b/opcodes/microblaze-opcm.h
@@ -33,8 +33,8 @@ enum microblaze_instr
Expand All @@ -61,5 +62,5 @@ index 6dd3694f4be..10d7e883366 100644
imm, rtsd, rtid, rtbd, rted, bri, brid, brlid, brai, braid, bralid,
brki, beqi, beqid, bnei, bneid, blti, bltid, blei, bleid, bgti,
--
2.17.1
2.25.1

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 2c240d885b5871571d93af64baf2e67f077f735c Mon Sep 17 00:00:00 2001
From 2daa3e3863ee052020ad07ac59c49b7f82f7a9d1 Mon Sep 17 00:00:00 2001
From: nagaraju <[email protected]>
Date: Tue, 19 Mar 2013 17:18:23 +0530
Subject: [PATCH 02/38] Add mlittle-endian and mbig-endian flags
Expand All @@ -11,12 +11,13 @@ to include new entries.

Signed-off-by:nagaraju <[email protected]>
Signed-off-by: David Holsgrove <[email protected]>
Signed-off-by: Mark Hatle <[email protected]>
---
gas/config/tc-microblaze.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
index 881172d5274..d6fc400cef9 100644
index 3db17a76ee7..c927331ea0a 100644
--- a/gas/config/tc-microblaze.c
+++ b/gas/config/tc-microblaze.c
@@ -37,6 +37,8 @@
Expand Down Expand Up @@ -60,5 +61,5 @@ index 881172d5274..d6fc400cef9 100644


--
2.17.1
2.25.1

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From fc6844169e72155a008d963c3991ed084e0d0890 Mon Sep 17 00:00:00 2001
From 7982c0bdd92531bca3b829255324a769df9521e1 Mon Sep 17 00:00:00 2001
From: "Edgar E. Iglesias" <[email protected]>
Date: Fri, 22 Jun 2012 01:20:20 +0200
Subject: [PATCH 03/38] Disable the warning message for eh_frame_hdr
Expand All @@ -7,12 +7,13 @@ Signed-off-by: Edgar E. Iglesias <[email protected]>

Conflicts:
bfd/elf-eh-frame.c
Signed-off-by: Mark Hatle <[email protected]>
---
bfd/elf-eh-frame.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index 6ce6d225cff..c6b0c122459 100644
index 2e22d0c9215..db470ed43c3 100644
--- a/bfd/elf-eh-frame.c
+++ b/bfd/elf-eh-frame.c
@@ -1044,10 +1044,13 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
Expand All @@ -30,5 +31,5 @@ index 6ce6d225cff..c6b0c122459 100644
free (sec_info);
success:
--
2.17.1
2.25.1

Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
From 786c2252440ed07d05c1ab37675e5138e7b44bb8 Mon Sep 17 00:00:00 2001
From 1b47ecbc256f807b239f3f275fefd53bba0f0cde Mon Sep 17 00:00:00 2001
From: Mahesh Bodapati <[email protected]>
Date: Tue, 8 Nov 2016 11:54:08 +0530
Subject: [PATCH 04/38] [LOCAL]: Fix relaxation of assembler resolved
references,Fixup debug_loc sections after linker relaxation Adds a new
reloctype R_MICROBLAZE_32_NONE, used for passing reloc info from the
assembler to the linker when the linker manages to fully resolve a local
symbol reference.
Subject: [PATCH 04/38] Fix relaxation of assembler resolved references,Fixup
debug_loc sections after linker relaxation Adds a new reloctype
R_MICROBLAZE_32_NONE, used for passing reloc info from the assembler to the
linker when the linker manages to fully resolve a local symbol reference.

This is a workaround for design flaws in the assembler to
linker interface with regards to linker relaxation.
Expand All @@ -20,21 +19,22 @@ Conflicts:

Conflicts:
binutils/readelf.c
Signed-off-by: Mark Hatle <[email protected]>
---
bfd/bfd-in2.h | 5 ++
bfd/elf32-microblaze.c | 126 ++++++++++++++++++++++++++++---------
bfd/elf32-microblaze.c | 118 +++++++++++++++++++++++++++++--------
bfd/libbfd.h | 1 +
bfd/reloc.c | 6 ++
binutils/readelf.c | 4 ++
gas/config/tc-microblaze.c | 4 ++
include/elf/microblaze.h | 2 +
7 files changed, 119 insertions(+), 29 deletions(-)
7 files changed, 115 insertions(+), 25 deletions(-)

diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 9a698316980..943bc2e914c 100644
index 1f0f18a7e75..26e3bb2b34b 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -5423,6 +5423,11 @@ value relative to the read-write small data area anchor */
@@ -5379,6 +5379,11 @@ value relative to the read-write small data area anchor */
expressions of the form "Symbol Op Symbol" */
BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,

Expand All @@ -47,7 +47,7 @@ index 9a698316980..943bc2e914c 100644
value in two words (with an imm instruction). No relocation is
done here - only used for relaxing */
diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
index d9c0d93a01a..2316e085d1f 100644
index 013c32a1e51..e36cd102bd2 100644
--- a/bfd/elf32-microblaze.c
+++ b/bfd/elf32-microblaze.c
@@ -175,6 +175,20 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
Expand All @@ -70,7 +70,7 @@ index d9c0d93a01a..2316e085d1f 100644
+
HOWTO (R_MICROBLAZE_64_NONE, /* Type. */
0, /* Rightshift. */
3, /* Size (0 = byte, 1 = short, 2 = long). */
0, /* Size. */
@@ -560,7 +574,10 @@ microblaze_elf_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
case BFD_RELOC_NONE:
microblaze_reloc = R_MICROBLAZE_NONE;
Expand All @@ -83,38 +83,30 @@ index d9c0d93a01a..2316e085d1f 100644
microblaze_reloc = R_MICROBLAZE_64_NONE;
break;
case BFD_RELOC_32:
@@ -1910,18 +1927,26 @@ microblaze_elf_relax_section (bfd *abfd,
@@ -1954,14 +1971,22 @@ microblaze_elf_relax_section (bfd *abfd,
}
break;
case R_MICROBLAZE_NONE:
+ case R_MICROBLAZE_32_NONE:
{
/* This was a PC-relative instruction that was
completely resolved. */
int sfix, efix;
+ unsigned int val;
size_t sfix, efix;
+ unsigned int val;
bfd_vma target_address;
target_address = irel->r_addend + irel->r_offset;
sfix = calc_fixup (irel->r_offset, 0, sec);
efix = calc_fixup (target_address, 0, sec);
- irel->r_addend -= (efix - sfix);
- /* Should use HOWTO. */
- microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset,
- irel->r_addend);
+
+ /* Validate the in-band val. */
+ val = bfd_get_32 (abfd, contents + irel->r_offset);
+ if (val != irel->r_addend && ELF32_R_TYPE (irel->r_info) == R_MICROBLAZE_32_NONE) {
+ fprintf(stderr, "%d: CORRUPT relax reloc %x %lx\n", __LINE__, val, irel->r_addend);
+ }
+ irel->r_addend -= (efix - sfix);
+ /* Should use HOWTO. */
+ microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset,
+ irel->r_addend);
}
break;
case R_MICROBLAZE_64_NONE:
@@ -1965,30 +1990,73 @@ microblaze_elf_relax_section (bfd *abfd,
+ /* Validate the in-band val. */
+ val = bfd_get_32 (abfd, contents + irel->r_offset);
+ if (val != irel->r_addend && ELF32_R_TYPE (irel->r_info) == R_MICROBLAZE_32_NONE) {
+ fprintf(stderr, "%d: CORRUPT relax reloc %x %lx\n", __LINE__, val, irel->r_addend);
+ }
irel->r_addend -= (efix - sfix);
/* Should use HOWTO. */
microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset,
@@ -2009,30 +2034,73 @@ microblaze_elf_relax_section (bfd *abfd,
irelscanend = irelocs + o->reloc_count;
for (irelscan = irelocs; irelscan < irelscanend; irelscan++)
{
Expand Down Expand Up @@ -211,7 +203,7 @@ index d9c0d93a01a..2316e085d1f 100644
o->rawsize))
goto error_return;
elf_section_data (o)->this_hdr.contents = ocontents;
@@ -2024,7 +2092,7 @@ microblaze_elf_relax_section (bfd *abfd,
@@ -2068,7 +2136,7 @@ microblaze_elf_relax_section (bfd *abfd,
elf_section_data (o)->this_hdr.contents = ocontents;
}
}
Expand All @@ -221,10 +213,10 @@ index d9c0d93a01a..2316e085d1f 100644
0,
sec);
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index c37ddc03cfd..4153b94564d 100644
index 29e8187f95f..ea2507d1879 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -2988,6 +2988,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
@@ -2989,6 +2989,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_MICROBLAZE_32_ROSDA",
"BFD_RELOC_MICROBLAZE_32_RWSDA",
"BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM",
Expand All @@ -233,10 +225,10 @@ index c37ddc03cfd..4153b94564d 100644
"BFD_RELOC_MICROBLAZE_64_GOTPC",
"BFD_RELOC_MICROBLAZE_64_GOT",
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 6d920e1df06..3a08f7a8a42 100644
index 36999fe9a40..5ac8a8536a7 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -6896,6 +6896,12 @@ ENUM
@@ -6867,6 +6867,12 @@ ENUM
ENUMDOC
This is a 32 bit reloc for the microblaze to handle
expressions of the form "Symbol Op Symbol"
Expand All @@ -250,10 +242,10 @@ index 6d920e1df06..3a08f7a8a42 100644
BFD_RELOC_MICROBLAZE_64_NONE
ENUMDOC
diff --git a/binutils/readelf.c b/binutils/readelf.c
index a6073f7ec80..5b25fb9a52a 100644
index 0f5977bc072..acd12713361 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -14057,6 +14057,10 @@ is_8bit_abs_reloc (Filedata * filedata, unsigned int reloc_type)
@@ -14621,6 +14621,10 @@ is_8bit_abs_reloc (Filedata * filedata, unsigned int reloc_type)
return reloc_type == 1; /* R_Z80_8. */
default:
return false;
Expand All @@ -265,7 +257,7 @@ index a6073f7ec80..5b25fb9a52a 100644
}

diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
index d6fc400cef9..87efc2b7a46 100644
index c927331ea0a..8018d1f5686 100644
--- a/gas/config/tc-microblaze.c
+++ b/gas/config/tc-microblaze.c
@@ -2211,9 +2211,12 @@ md_apply_fix (fixS * fixP,
Expand All @@ -290,7 +282,7 @@ index d6fc400cef9..87efc2b7a46 100644
case BFD_RELOC_32:
case BFD_RELOC_MICROBLAZE_32_LO:
diff --git a/include/elf/microblaze.h b/include/elf/microblaze.h
index 66b4fda8f54..936ef484289 100644
index 43ad3ad3904..a2e1ce4580f 100644
--- a/include/elf/microblaze.h
+++ b/include/elf/microblaze.h
@@ -61,6 +61,8 @@ START_RELOC_NUMBERS (elf_microblaze_reloc_type)
Expand All @@ -303,5 +295,5 @@ index 66b4fda8f54..936ef484289 100644

/* Global base address names. */
--
2.17.1
2.25.1

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 48e989bf1ff9ce0250256afc95d40d75fa098e21 Mon Sep 17 00:00:00 2001
From 318f98ea7f4271b3dd6e364d751415410a4076ac Mon Sep 17 00:00:00 2001
From: David Holsgrove <[email protected]>
Date: Wed, 27 Feb 2013 13:56:11 +1000
Subject: [PATCH 05/38] upstream change to garbage collection sweep causes mb
Expand All @@ -21,15 +21,16 @@ Signed-off-by: David Holsgrove <[email protected]>

Conflicts:
bfd/elflink.c
Signed-off-by: Mark Hatle <[email protected]>
---
bfd/elflink.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/bfd/elflink.c b/bfd/elflink.c
index 9a05208253c..bdfbcecef92 100644
index 2b1450fa4e1..c50919060b3 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -6432,7 +6432,6 @@ elf_gc_sweep_symbol (struct elf_link_hash_entry *h, void *data)
@@ -6576,7 +6576,6 @@ elf_gc_sweep_symbol (struct elf_link_hash_entry *h, void *data)

inf = (struct elf_gc_sweep_symbol_info *) data;
(*inf->hide_symbol) (inf->info, h, true);
Expand All @@ -38,5 +39,5 @@ index 9a05208253c..bdfbcecef92 100644
h->ref_regular_nonweak = 0;
}
--
2.17.1
2.25.1

Loading

0 comments on commit 940e4d9

Please sign in to comment.