aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNeal Frager <neal.frager@amd.com>2023-10-17 09:40:06 +0100
committerMichael J. Eager <eager@eagercon.com>2023-10-20 07:12:30 -0700
commitd605374748fef3d3b1dea713e78bbef9c8b0fb65 (patch)
treee7f021bf23820d43871e1cca59c98534b8d49303 /gas
parent938459015cab4c4bc4965c78c62672b4f18d1d1b (diff)
downloadgdb-d605374748fef3d3b1dea713e78bbef9c8b0fb65.zip
gdb-d605374748fef3d3b1dea713e78bbef9c8b0fb65.tar.gz
gdb-d605374748fef3d3b1dea713e78bbef9c8b0fb65.tar.bz2
bfd: microblaze: Add 32_NONE reloc type
This patch adds the R_MICROBLAZE_32_NONE relocation type. This is a 32-bit reloc that stores the 32-bit pc relative value in two words (with an imm instruction). Add test case to gas test suite. Signed-off-by: Neal Frager <neal.frager@amd.com> Signed-off-by: Michael J. Eager <eager@eagercon.com>
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-microblaze.c3
-rw-r--r--gas/testsuite/gas/microblaze/reloc_sym.d5
-rw-r--r--gas/testsuite/gas/microblaze/reloc_weaksym.s5
3 files changed, 12 insertions, 1 deletions
diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
index b510da9..604cc93 100644
--- a/gas/config/tc-microblaze.c
+++ b/gas/config/tc-microblaze.c
@@ -2290,6 +2290,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);
@@ -2513,6 +2515,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/gas/testsuite/gas/microblaze/reloc_sym.d b/gas/testsuite/gas/microblaze/reloc_sym.d
index 571ffe1..cbc5563 100644
--- a/gas/testsuite/gas/microblaze/reloc_sym.d
+++ b/gas/testsuite/gas/microblaze/reloc_sym.d
@@ -30,6 +30,11 @@ Disassembly of section .text:
100000a8: 30210020 addik r1, r1, 32
100000ac: b60f0008 rtsd r15, 8
100000b0: 80000000 or r0, r0, r0
+100000b4: 14422003 cmpu r2, r2, r4
+100000b8: be220004 bneid r2, 4 // 100000bc <reloc_none_test>
+
+100000bc <reloc_none_test>:
+100000bc: a0630001 ori r3, r3, 1
Disassembly of section .testsection:
diff --git a/gas/testsuite/gas/microblaze/reloc_weaksym.s b/gas/testsuite/gas/microblaze/reloc_weaksym.s
index 7dd9b98..4425809 100644
--- a/gas/testsuite/gas/microblaze/reloc_weaksym.s
+++ b/gas/testsuite/gas/microblaze/reloc_weaksym.s
@@ -42,7 +42,8 @@ main:
addik r1,r1,32
rtsd r15,8
nop # Unfilled delay slot
-
+ cmpu r2,r2,r4
+ BNEID r2,reloc_none_test
.end main
$Lfe2:
.size main,$Lfe2-main
@@ -50,3 +51,5 @@ $Lfe2:
test_start = __def_start
.globl test_start_strong
test_start_strong = __def_start
+reloc_none_test:
+ ori r3,r3,1