]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
MIPS/GAS/testsuite: Cover microMIPS HI/LO relocation pairing
authorMaciej W. Rozycki <macro@orcam.me.uk>
Sun, 6 Jul 2025 18:22:48 +0000 (19:22 +0100)
committerMaciej W. Rozycki <macro@orcam.me.uk>
Sun, 6 Jul 2025 18:22:48 +0000 (19:22 +0100)
Add a GAS test case for R_MICROMIPS_HI16/R_MICROMIPS_LO16 REL relocation
pairing, analogous to one for R_MIPS16_HI16/R_MIPS16_LO16 relocations.

gas/testsuite/gas/mips/micromips-hilo-match.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips-hilo-match.s [moved from gas/testsuite/gas/mips/mips16-hilo-match.s with 96% similarity]
gas/testsuite/gas/mips/mips.exp
gas/testsuite/gas/mips/mips16-hilo-match.d

diff --git a/gas/testsuite/gas/mips/micromips-hilo-match.d b/gas/testsuite/gas/mips/micromips-hilo-match.d
new file mode 100644 (file)
index 0000000..216d067
--- /dev/null
@@ -0,0 +1,39 @@
+#objdump: -r
+#as: -mabi=32 -march=mips1 -mpdr --defsym micromips=1
+#name: microMIPS micromips-hilo-match
+#source: mips-hilo-match.s
+
+.*: +file format .*mips.*
+
+RELOCATION RECORDS FOR \[\.text\]:
+OFFSET +TYPE +VALUE
+00000010 R_MIPS_HI16       var4
+00000018 R_MIPS_LO16       var4
+00000008 R_MIPS_HI16       __var1
+00000020 R_MIPS_LO16       __var1
+0000001c R_MIPS_HI16       .sbss
+0000002c R_MIPS_LO16       .sbss
+00000030 R_MIPS_26         func4
+00000028 R_MIPS_HI16       __var3
+00000034 R_MIPS_LO16       __var3
+00000038 R_MIPS_LO16       hilo_match
+0000003c R_MIPS_HI16       .bss
+00000044 R_MIPS_LO16       .bss
+00000040 R_MIPS_HI16       .bss
+00000048 R_MIPS_LO16       .bss
+0000004c R_MIPS_26         func3
+00000024 R_MIPS_HI16       hilo_match
+00000050 R_MIPS_LO16       hilo_match
+0000005e R_MICROMIPS_HI16  .data
+00000068 R_MICROMIPS_LO16  .data
+0000006c R_MICROMIPS_26_S1  func1
+00000074 R_MICROMIPS_26_S1  func2
+0000007c R_MICROMIPS_HI16  hilo_match
+00000084 R_MICROMIPS_LO16  hilo_match
+0000008a R_MICROMIPS_LO16  hilo_match
+0000008e R_MICROMIPS_26_S1  func1
+
+RELOCATION RECORDS FOR \[\.pdr\]:
+OFFSET +TYPE +VALUE
+00000000 R_MIPS_32         _pinit
+00000020 R_MIPS_32         pdelt
similarity index 96%
rename from gas/testsuite/gas/mips/mips16-hilo-match.s
rename to gas/testsuite/gas/mips/mips-hilo-match.s
index 7510d5d1ec9fd919642718108ef36f4e6c7c5737..f69264eacbaf78c0f0f42c8a49b527edce42fbad 100644 (file)
@@ -1,6 +1,7 @@
        .align  2
        .globl  _pinit
 .LFB84:
+       .set    nomicromips
        .set    nomips16
        .ent    _pinit
 _pinit:
@@ -43,7 +44,11 @@ _pinit:
        .align  2
        .globl  pdelt
 .LFB120:
+       .ifdef  micromips
+       .set    micromips
+       .else
        .set    mips16
+       .endif
        .ent    pdelt
 pdelt:
        .set    macro
index 1dace1cac7ed17622c4d80feb71248a22bd83375..ea07a8c9068ba3ed5d37a03072b90aa47098d58a 100644 (file)
@@ -1635,6 +1635,7 @@ if { [istarget mips*-*-vxworks*] } {
     }
     run_dump_test "micromips-b16"
     run_list_test "micromips-ill"
+    run_dump_test "micromips-hilo-match"
 
     run_dump_test_arches "mcu"         [mips_arch_list_matching mips32r2 \
                                            !octeon]
index a9151a3ea65adae746e3161c5002554a203be5e8..8b77da599ceb69cd28b9ef58994bc4d40fc828bb 100644 (file)
@@ -1,6 +1,7 @@
 #objdump: -r
 #as: -mabi=32 -march=mips1 -mpdr
 #name: MIPS16 mips16-hilo-match
+#source: mips-hilo-match.s
 
 .*: +file format .*mips.*