aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-microblaze
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2015-09-02 21:13:49 +1000
committerNathan Rossi <nathan@nathanrossi.com>2015-09-02 21:13:49 +1000
commitb7960e3fc669cf2fda93265db9776d867d44683a (patch)
treeca714fadeeb5807260a8888c9e16e1c3b9183be3 /recipes-microblaze
parent08d2ad0f03fecf211355312264f20a15368b67d1 (diff)
downloadmeta-xilinx-b7960e3fc669cf2fda93265db9776d867d44683a.tar.gz
meta-xilinx-b7960e3fc669cf2fda93265db9776d867d44683a.tar.bz2
meta-xilinx-b7960e3fc669cf2fda93265db9776d867d44683a.zip
binutils: Update and drop patches
* Update recipe for minor 2.25 update in core * Drop any patches which are not upstream and are not required for a functional linux system * Use wildcard to make the recipe append to multiple versions of binutils Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Diffstat (limited to 'recipes-microblaze')
-rw-r--r--recipes-microblaze/binutils/binutils%.bbappend7
-rw-r--r--recipes-microblaze/binutils/binutils-cross-canadian_2.25.bbappend1
-rw-r--r--recipes-microblaze/binutils/binutils-cross_2.25.bbappend1
-rw-r--r--recipes-microblaze/binutils/binutils-crosssdk_2.25.bbappend1
-rw-r--r--recipes-microblaze/binutils/binutils-microblaze-2.25.inc11
-rw-r--r--recipes-microblaze/binutils/binutils_2.25.bbappend1
-rw-r--r--recipes-microblaze/binutils/files/Add-mlittle-endian-and-mbig-endian.patch64
-rw-r--r--recipes-microblaze/binutils/files/Add-wdc.ext.clear-and-wdc.ext.flush.patch67
-rw-r--r--recipes-microblaze/binutils/files/Disable-the-warning-message-for-eh_frame_hdr.patch33
-rw-r--r--recipes-microblaze/binutils/files/Fix-relaxation-of-assembler-resolved-reference.patch75
-rw-r--r--recipes-microblaze/binutils/files/Fixup-debug_loc-sections-after-linker-relaxati.patch228
11 files changed, 7 insertions, 482 deletions
diff --git a/recipes-microblaze/binutils/binutils%.bbappend b/recipes-microblaze/binutils/binutils%.bbappend
new file mode 100644
index 0000000..2b0db28
--- /dev/null
+++ b/recipes-microblaze/binutils/binutils%.bbappend
@@ -0,0 +1,7 @@
+
+# Add MicroBlaze Patches
+FILESEXTRAPATHS_append := "${THISDIR}/files:"
+SRC_URI_append_microblaze += " \
+ file://upstream-change-to-garbage-collection-s.patch \
+ "
+
diff --git a/recipes-microblaze/binutils/binutils-cross-canadian_2.25.bbappend b/recipes-microblaze/binutils/binutils-cross-canadian_2.25.bbappend
deleted file mode 100644
index e42e7a6..0000000
--- a/recipes-microblaze/binutils/binutils-cross-canadian_2.25.bbappend
+++ /dev/null
@@ -1 +0,0 @@
-require binutils-microblaze-${PV}.inc
diff --git a/recipes-microblaze/binutils/binutils-cross_2.25.bbappend b/recipes-microblaze/binutils/binutils-cross_2.25.bbappend
deleted file mode 100644
index e42e7a6..0000000
--- a/recipes-microblaze/binutils/binutils-cross_2.25.bbappend
+++ /dev/null
@@ -1 +0,0 @@
-require binutils-microblaze-${PV}.inc
diff --git a/recipes-microblaze/binutils/binutils-crosssdk_2.25.bbappend b/recipes-microblaze/binutils/binutils-crosssdk_2.25.bbappend
deleted file mode 100644
index e42e7a6..0000000
--- a/recipes-microblaze/binutils/binutils-crosssdk_2.25.bbappend
+++ /dev/null
@@ -1 +0,0 @@
-require binutils-microblaze-${PV}.inc
diff --git a/recipes-microblaze/binutils/binutils-microblaze-2.25.inc b/recipes-microblaze/binutils/binutils-microblaze-2.25.inc
deleted file mode 100644
index 96dbb05..0000000
--- a/recipes-microblaze/binutils/binutils-microblaze-2.25.inc
+++ /dev/null
@@ -1,11 +0,0 @@
-
-# Add MicroBlaze Patches
-FILESEXTRAPATHS_append := "${THISDIR}/files:"
-SRC_URI_append_microblaze += " \
- file://Add-wdc.ext.clear-and-wdc.ext.flush.patch \
- file://Add-mlittle-endian-and-mbig-endian.patch \
- file://Disable-the-warning-message-for-eh_frame_hdr.patch \
- file://Fix-relaxation-of-assembler-resolved-reference.patch \
- file://Fixup-debug_loc-sections-after-linker-relaxati.patch \
- file://upstream-change-to-garbage-collection-s.patch \
- "
diff --git a/recipes-microblaze/binutils/binutils_2.25.bbappend b/recipes-microblaze/binutils/binutils_2.25.bbappend
deleted file mode 100644
index e42e7a6..0000000
--- a/recipes-microblaze/binutils/binutils_2.25.bbappend
+++ /dev/null
@@ -1 +0,0 @@
-require binutils-microblaze-${PV}.inc
diff --git a/recipes-microblaze/binutils/files/Add-mlittle-endian-and-mbig-endian.patch b/recipes-microblaze/binutils/files/Add-mlittle-endian-and-mbig-endian.patch
deleted file mode 100644
index 984fda3..0000000
--- a/recipes-microblaze/binutils/files/Add-mlittle-endian-and-mbig-endian.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From: nagaraju <nmekala@xilix.com>
-Date: Tue, 19 Mar 2013 17:18:23 +0530
-Subject: Add mlittle-endian and mbig-endian flags
-
-Added support in gas for mlittle-endian and mbig-endian flags
-as options.
-
-Updated show usage for MicroBlaze specific assembler options
-to include new entries.
-
-Signed-off-by:nagaraju <nmekala@xilix.com>
-Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
-Upstream-Status: Pending
----
- 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 872737b..b241743 100644
---- a/gas/config/tc-microblaze.c
-+++ b/gas/config/tc-microblaze.c
-@@ -37,6 +37,8 @@
-
- #define OPTION_EB (OPTION_MD_BASE + 0)
- #define OPTION_EL (OPTION_MD_BASE + 1)
-+#define OPTION_LITTLE (OPTION_MD_BASE + 2)
-+#define OPTION_BIG (OPTION_MD_BASE + 3)
-
- void microblaze_generate_symbol (char *sym);
- static bfd_boolean check_spl_reg (unsigned *);
-@@ -1824,6 +1826,8 @@ struct option md_longopts[] =
- {
- {"EB", no_argument, NULL, OPTION_EB},
- {"EL", no_argument, NULL, OPTION_EL},
-+ {"mlittle-endian", no_argument, NULL, OPTION_LITTLE},
-+ {"mbig-endian", no_argument, NULL, OPTION_BIG},
- { NULL, no_argument, NULL, 0}
- };
-
-@@ -2457,9 +2461,11 @@ md_parse_option (int c, char * arg ATTRIBUTE_UNUSED)
- switch (c)
- {
- case OPTION_EB:
-+ case OPTION_BIG:
- target_big_endian = 1;
- break;
- case OPTION_EL:
-+ case OPTION_LITTLE:
- target_big_endian = 0;
- break;
- default:
-@@ -2474,6 +2480,9 @@ md_show_usage (FILE * stream ATTRIBUTE_UNUSED)
- /* fprintf(stream, _("\
- MicroBlaze options:\n\
- -noSmall Data in the comm and data sections do not go into the small data section\n")); */
-+ fprintf (stream, _(" MicroBlaze specific assembler options:\n"));
-+ fprintf (stream, " -%-23s%s\n", "mbig-endian", N_("assemble for a big endian cpu"));
-+ fprintf (stream, " -%-23s%s\n", "mlittle-endian", N_("assemble for a little endian cpu"));
- }
-
-
---
-1.7.9.5
-
diff --git a/recipes-microblaze/binutils/files/Add-wdc.ext.clear-and-wdc.ext.flush.patch b/recipes-microblaze/binutils/files/Add-wdc.ext.clear-and-wdc.ext.flush.patch
deleted file mode 100644
index cb58f60..0000000
--- a/recipes-microblaze/binutils/files/Add-wdc.ext.clear-and-wdc.ext.flush.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From: David Holsgrove <david.holsgrove@xilinx.com>
-Date: Wed, 8 May 2013 11:03:36 +1000
-Subject: Add wdc.ext.clear and wdc.ext.flush insns
-
-Added two new instructions, wdc.ext.clear and wdc.ext.flush,
-to enable MicroBlaze to flush an external cache, which is
-used with the new coherency support for multiprocessing.
-
-Signed-off-by:nagaraju <nmekala@xilix.com>
-Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
-Upstream-Status: Pending
----
- opcodes/microblaze-opc.h | 5 ++++-
- opcodes/microblaze-opcm.h | 6 +++---
- 2 files changed, 7 insertions(+), 4 deletions(-)
-
-diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
-index e9da12a..dd56ab5 100644
---- a/opcodes/microblaze-opc.h
-+++ b/opcodes/microblaze-opc.h
-@@ -91,6 +91,7 @@
- #define OPCODE_MASK_H3 0xFC000600 /* High 6 bits and bits 21, 22. */
- #define OPCODE_MASK_H32 0xFC00FC00 /* High 6 bits and bit 16-21. */
- #define OPCODE_MASK_H34B 0xFC0000FF /* High 6 bits and low 8 bits. */
-+#define OPCODE_MASK_H35B 0xFC0004FF /* High 6 bits and low 9 bits. */
- #define OPCODE_MASK_H34C 0xFC0007E0 /* High 6 bits and bits 21-26. */
-
- /* New Mask for msrset, msrclr insns. */
-@@ -101,7 +102,7 @@
- #define DELAY_SLOT 1
- #define NO_DELAY_SLOT 0
-
--#define MAX_OPCODES 289
-+#define MAX_OPCODES 291
-
- struct op_code_struct
- {
-@@ -174,7 +175,9 @@ struct op_code_struct
- {"wic", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000068, OPCODE_MASK_H34B, wic, special_inst },
- {"wdc", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000064, OPCODE_MASK_H34B, wdc, special_inst },
- {"wdc.clear", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000066, OPCODE_MASK_H34B, wdcclear, special_inst },
-+ {"wdc.ext.clear", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000466, OPCODE_MASK_H35B, wdcextclear, special_inst },
- {"wdc.flush", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000074, OPCODE_MASK_H34B, wdcflush, special_inst },
-+ {"wdc.ext.flush", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000476, OPCODE_MASK_H35B, wdcextflush, special_inst },
- {"mts", INST_TYPE_SPECIAL_R1, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_MTS, 0x9400C000, OPCODE_MASK_H13S, mts, special_inst },
- {"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 124cdec..8e531f9 100644
---- a/opcodes/microblaze-opcm.h
-+++ b/opcodes/microblaze-opcm.h
-@@ -31,9 +31,9 @@ enum microblaze_instr
- idiv, idivu, bsll, bsra, bsrl, get, put, nget, nput, cget, cput,
- ncget, ncput, muli, bslli, bsrai, bsrli, mului, or, and, xor,
- andn, pcmpbf, pcmpbc, pcmpeq, pcmpne, sra, src, srl, sext8, sext16,
-- wic, wdc, wdcclear, wdcflush, mts, mfs, mbar, br, brd,
-- brld, bra, brad, brald, microblaze_brk, beq, beqd, bne, bned, blt,
-- bltd, ble, bled, bgt, bgtd, bge, bged, ori, andi, xori, andni,
-+ wic, wdc, wdcclear, wdcextclear, wdcflush, wdcextflush, mts, mfs, mbar,
-+ br, brd, brld, bra, brad, brald, microblaze_brk, beq, beqd, bne, bned,
-+ blt, bltd, ble, bled, bgt, bgtd, bge, bged, ori, andi, xori, andni,
- imm, rtsd, rtid, rtbd, rted, bri, brid, brlid, brai, braid, bralid,
- brki, beqi, beqid, bnei, bneid, blti, bltid, blei, bleid, bgti,
- bgtid, bgei, bgeid, lbu, lbur, lhu, lhur, lw, lwr, lwx, sb, sbr, sh,
---
-1.7.9.5
-
diff --git a/recipes-microblaze/binutils/files/Disable-the-warning-message-for-eh_frame_hdr.patch b/recipes-microblaze/binutils/files/Disable-the-warning-message-for-eh_frame_hdr.patch
deleted file mode 100644
index f6616a1..0000000
--- a/recipes-microblaze/binutils/files/Disable-the-warning-message-for-eh_frame_hdr.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
-Date: Fri, 22 Jun 2012 01:20:20 +0200
-Subject: Disable the warning message for eh_frame_hdr
-
-Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
-Upstream-Status: Pending
----
- bfd/elf-eh-frame.c | 9 ++++++---
- 1 file changed, 6 insertions(+), 3 deletions(-)
-
-diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
-index a75d806..de69cef 100644
---- a/bfd/elf-eh-frame.c
-+++ b/bfd/elf-eh-frame.c
-@@ -913,9 +913,12 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
- goto success;
-
- free_no_table:
-- (*info->callbacks->einfo)
-- (_("%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"),
-- abfd, sec);
-+ /* FIXME: Remove the microblaze specifics when relaxing gets fixed. */
-+ if (bfd_get_arch(abfd) != bfd_arch_microblaze) {
-+ (*info->callbacks->einfo)
-+ (_("%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"),
-+ abfd, sec);
-+ }
- hdr_info->table = FALSE;
- if (sec_info)
- free (sec_info);
---
-1.7.9.5
-
diff --git a/recipes-microblaze/binutils/files/Fix-relaxation-of-assembler-resolved-reference.patch b/recipes-microblaze/binutils/files/Fix-relaxation-of-assembler-resolved-reference.patch
deleted file mode 100644
index fb3ff35..0000000
--- a/recipes-microblaze/binutils/files/Fix-relaxation-of-assembler-resolved-reference.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
-Date: Tue, 14 Feb 2012 01:00:22 +0100
-Subject: Fix relaxation of assembler resolved references
-
-Upstream-Status: Pending
----
- bfd/elf32-microblaze.c | 39 +++++++++++++++++++++++++++++++++++++++
- gas/config/tc-microblaze.c | 1 +
- 2 files changed, 40 insertions(+)
-
-diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
-index 502e3c9..9de2479 100644
---- a/bfd/elf32-microblaze.c
-+++ b/bfd/elf32-microblaze.c
-@@ -1906,6 +1906,45 @@ microblaze_elf_relax_section (bfd *abfd,
- irelscanend = irelocs + o->reloc_count;
- for (irelscan = irelocs; irelscan < irelscanend; irelscan++)
- {
-+ if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_NONE)
-+ {
-+ unsigned int val;
-+
-+ isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
-+
-+ /* This was a PC-relative instruction that was completely resolved. */
-+ if (ocontents == NULL)
-+ {
-+ if (elf_section_data (o)->this_hdr.contents != NULL)
-+ ocontents = elf_section_data (o)->this_hdr.contents;
-+ else
-+ {
-+ /* We always cache the section contents.
-+ Perhaps, if info->keep_memory is FALSE, we
-+ should free them, if we are permitted to. */
-+
-+ if (o->rawsize == 0)
-+ o->rawsize = o->size;
-+ ocontents = (bfd_byte *) bfd_malloc (o->rawsize);
-+ if (ocontents == NULL)
-+ goto error_return;
-+ if (!bfd_get_section_contents (abfd, o, ocontents,
-+ (file_ptr) 0,
-+ o->rawsize))
-+ goto error_return;
-+ elf_section_data (o)->this_hdr.contents = ocontents;
-+ }
-+ }
-+
-+ irelscan->r_addend -= calc_fixup (irelscan->r_addend
-+ + isym->st_value, sec);
-+ val = bfd_get_32 (abfd, ocontents + irelscan->r_offset);
-+ microblaze_bfd_write_imm_value_32 (abfd, ocontents + irelscan->r_offset,
-+ irelscan->r_addend);
-+ }
-+ if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_NONE) {
-+ fprintf(stderr, "Unhandled NONE 64\n");
-+ }
- if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32)
- {
- isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
-diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
-index b241743..7dd5895 100644
---- a/gas/config/tc-microblaze.c
-+++ b/gas/config/tc-microblaze.c
-@@ -2169,6 +2169,7 @@ md_apply_fix (fixS * fixP,
- else
- fixP->fx_r_type = BFD_RELOC_NONE;
- fixP->fx_addsy = section_symbol (absolute_section);
-+ fixP->fx_done = 0;
- }
- return;
- }
---
-1.7.9.5
-
diff --git a/recipes-microblaze/binutils/files/Fixup-debug_loc-sections-after-linker-relaxati.patch b/recipes-microblaze/binutils/files/Fixup-debug_loc-sections-after-linker-relaxati.patch
deleted file mode 100644
index 0623e94..0000000
--- a/recipes-microblaze/binutils/files/Fixup-debug_loc-sections-after-linker-relaxati.patch
+++ /dev/null
@@ -1,228 +0,0 @@
-From: David Holsgrove <david.holsgrove@xilinx.com>
-Date: Mon, 4 Feb 2013 12:15:22 +1000
-Subject: 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.
-
-Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
-Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
-Upstream-Status: Pending
----
- bfd/bfd-in2.h | 5 +++++
- bfd/elf32-microblaze.c | 45 +++++++++++++++++++++++++++++++++++++--------
- bfd/libbfd.h | 1 +
- bfd/reloc.c | 6 ++++++
- binutils/readelf.c | 4 ++++
- gas/config/tc-microblaze.c | 3 +++
- include/elf/microblaze.h | 1 +
- 7 files changed, 57 insertions(+), 8 deletions(-)
-
-diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
-index 8b7f2ee..de38907 100644
---- a/bfd/bfd-in2.h
-+++ b/bfd/bfd-in2.h
-@@ -5449,6 +5449,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,
-
-+/* This is a 32 bit reloc that stores the 32 bit pc relative
-+value in two words (with an imm instruction). No relocation is
-+done here - only used for relaxing */
-+ BFD_RELOC_MICROBLAZE_32_NONE,
-+
- /* This is a 64 bit reloc that stores the 32 bit pc relative
- 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 f90df47..d440084 100644
---- a/bfd/elf32-microblaze.c
-+++ b/bfd/elf32-microblaze.c
-@@ -177,6 +177,20 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
- FALSE), /* PC relative offset? */
-
- /* This reloc does nothing. Used for relaxation. */
-+ HOWTO (R_MICROBLAZE_32_NONE, /* Type. */
-+ 0, /* Rightshift. */
-+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
-+ 32, /* Bitsize. */
-+ TRUE, /* PC_relative. */
-+ 0, /* Bitpos. */
-+ complain_overflow_bitfield, /* Complain on overflow. */
-+ NULL, /* Special Function. */
-+ "R_MICROBLAZE_32_NONE",/* Name. */
-+ FALSE, /* Partial Inplace. */
-+ 0, /* Source Mask. */
-+ 0, /* Dest Mask. */
-+ FALSE), /* PC relative offset? */
-+
- HOWTO (R_MICROBLAZE_64_NONE, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
-@@ -532,7 +546,10 @@ microblaze_elf_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
- case BFD_RELOC_NONE:
- microblaze_reloc = R_MICROBLAZE_NONE;
- break;
-- case BFD_RELOC_MICROBLAZE_64_NONE:
-+ case BFD_RELOC_MICROBLAZE_32_NONE:
-+ microblaze_reloc = R_MICROBLAZE_32_NONE;
-+ break;
-+ case BFD_RELOC_MICROBLAZE_64_NONE:
- microblaze_reloc = R_MICROBLAZE_64_NONE;
- break;
- case BFD_RELOC_32:
-@@ -1913,14 +1930,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;
- 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);
-+
-+ /* 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, (unsigned long)irel->r_addend);
-+ }
- irel->r_addend -= (efix - sfix);
- /* Should use HOWTO. */
- microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset,
-@@ -1968,12 +1993,16 @@ microblaze_elf_relax_section (bfd *abfd,
- irelscanend = irelocs + o->reloc_count;
- for (irelscan = irelocs; irelscan < irelscanend; irelscan++)
- {
-- if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_NONE)
-+ if (1 && ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_NONE)
- {
- unsigned int val;
-
- isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
-
-+ /* hax: We only do the following fixup for debug location lists. */
-+ if (strcmp(".debug_loc", o->name))
-+ continue;
-+
- /* This was a PC-relative instruction that was completely resolved. */
- if (ocontents == NULL)
- {
-@@ -1998,15 +2027,15 @@ microblaze_elf_relax_section (bfd *abfd,
- }
- }
-
-- irelscan->r_addend -= calc_fixup (irelscan->r_addend
-- + isym->st_value, sec);
- val = bfd_get_32 (abfd, ocontents + irelscan->r_offset);
-+ if (val != irelscan->r_addend) {
-+ fprintf(stderr, "%d: CORRUPT relax reloc! %x %lx\n", __LINE__, val, (unsigned long)irelscan->r_addend);
-+ }
-+
-+ irelscan->r_addend -= calc_fixup (irelscan->r_addend, 0, sec);
- microblaze_bfd_write_imm_value_32 (abfd, ocontents + irelscan->r_offset,
- irelscan->r_addend);
- }
-- if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_NONE) {
-- fprintf(stderr, "Unhandled NONE 64\n");
-- }
- if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32)
- {
- isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
-@@ -2066,7 +2095,7 @@ microblaze_elf_relax_section (bfd *abfd,
- elf_section_data (o)->this_hdr.contents = ocontents;
- }
- }
-- irelscan->r_addend -= calc_fixup (irel->r_addend
-+ irelscan->r_addend -= calc_fixup (irelscan->r_addend
- + isym->st_value,
- 0,
- sec);
-diff --git a/bfd/libbfd.h b/bfd/libbfd.h
-index 09f307f..840c662 100644
---- a/bfd/libbfd.h
-+++ b/bfd/libbfd.h
-@@ -2644,6 +2644,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",
-+ "BFD_RELOC_MICROBLAZE_32_NONE",
- "BFD_RELOC_MICROBLAZE_64_NONE",
- "BFD_RELOC_MICROBLAZE_64_GOTPC",
- "BFD_RELOC_MICROBLAZE_64_GOT",
-diff --git a/bfd/reloc.c b/bfd/reloc.c
-index 7f46c58..5bcd52d 100644
---- a/bfd/reloc.c
-+++ b/bfd/reloc.c
-@@ -6396,6 +6396,12 @@ ENUMDOC
- This is a 32 bit reloc for the microblaze to handle
- expressions of the form "Symbol Op Symbol"
- ENUM
-+ BFD_RELOC_MICROBLAZE_32_NONE
-+ENUMDOC
-+ This is a 32 bit reloc that stores the 32 bit pc relative
-+ value in two words (with an imm instruction). No relocation is
-+ done here - only used for relaxing
-+ENUM
- BFD_RELOC_MICROBLAZE_64_NONE
- ENUMDOC
- This is a 64 bit reloc that stores the 32 bit pc relative
-diff --git a/binutils/readelf.c b/binutils/readelf.c
-index af6463e..343eb61 100644
---- a/binutils/readelf.c
-+++ b/binutils/readelf.c
-@@ -10821,6 +10821,10 @@ is_none_reloc (unsigned int reloc_type)
- || reloc_type == 19 /* R_XTENSA_DIFF32. */);
- case EM_METAG:
- return reloc_type == 3; /* R_METAG_NONE. */
-+ case EM_MICROBLAZE:
-+ return reloc_type == 30 /* R_MICROBLAZE_32_NONE. */
-+ || reloc_type == 0 /* R_MICROBLAZE_NONE. */
-+ || reloc_type == 9; /* R_MICROBLAZE_64_NONE. */
- }
- return FALSE;
- }
-diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
-index 12ad616..46d61db 100644
---- a/gas/config/tc-microblaze.c
-+++ b/gas/config/tc-microblaze.c
-@@ -2167,6 +2167,8 @@ md_apply_fix (fixS * fixP,
- moves code around due to relaxing. */
- if (fixP->fx_r_type == BFD_RELOC_64_PCREL)
- fixP->fx_r_type = BFD_RELOC_MICROBLAZE_64_NONE;
-+ else if (fixP->fx_r_type == BFD_RELOC_32)
-+ fixP->fx_r_type = BFD_RELOC_MICROBLAZE_32_NONE;
- else
- fixP->fx_r_type = BFD_RELOC_NONE;
- fixP->fx_addsy = section_symbol (absolute_section);
-@@ -2388,6 +2390,7 @@ tc_gen_reloc (asection * section ATTRIBUTE_UNUSED, fixS * fixp)
- switch (fixp->fx_r_type)
- {
- case BFD_RELOC_NONE:
-+ case BFD_RELOC_MICROBLAZE_32_NONE:
- case BFD_RELOC_MICROBLAZE_64_NONE:
- case BFD_RELOC_32:
- case BFD_RELOC_MICROBLAZE_32_LO:
-diff --git a/include/elf/microblaze.h b/include/elf/microblaze.h
-index effca20..f8420dc 100644
---- a/include/elf/microblaze.h
-+++ b/include/elf/microblaze.h
-@@ -58,6 +58,7 @@ START_RELOC_NUMBERS (elf_microblaze_reloc_type)
- RELOC_NUMBER (R_MICROBLAZE_TLSDTPREL64, 27) /* TLS Offset Within TLS Block */
- RELOC_NUMBER (R_MICROBLAZE_TLSGOTTPREL32, 28) /* TLS Offset From Thread Pointer */
- RELOC_NUMBER (R_MICROBLAZE_TLSTPREL32, 29) /* TLS Offset From Thread Pointer */
-+ RELOC_NUMBER (R_MICROBLAZE_32_NONE, 30)
-
- END_RELOC_NUMBERS (R_MICROBLAZE_max)
-
---
-1.9.0
-