MIPS/GAS: Also respect `-mignore-branch-isa' with MIPS16 code
authorMaciej W. Rozycki <macro@imgtec.com>
Wed, 30 Aug 2017 14:54:19 +0000 (15:54 +0100)
committerMaciej W. Rozycki <macro@imgtec.com>
Wed, 30 Aug 2017 15:05:53 +0000 (16:05 +0100)
Fix a bug in commit 8b10b0b3e100 ("MIPS: Add options to control branch
ISA checks") and with the `-mignore-branch-isa' command-line option also
lift a GAS check for invalid MIPS16 branches between ISA modes, which is
made separately from regular MIPS and microMIPS checks.

gas/
* config/tc-mips.c (md_convert_frag): Respect
`mips_ignore_branch_isa'.
* testsuite/gas/mips/branch-local-5.d: New test.
* testsuite/gas/mips/branch-local-n32-5.d: New test.
* testsuite/gas/mips/branch-local-n64-5.d: New test.
* testsuite/gas/mips/branch-local-6.d: New test.
* testsuite/gas/mips/branch-local-n32-6.d: New test.
* testsuite/gas/mips/branch-local-n64-6.d: New test.
* testsuite/gas/mips/branch-local-7.d: New test.
* testsuite/gas/mips/branch-local-n32-7.d: New test.
* testsuite/gas/mips/branch-local-n64-7.d: New test.
* testsuite/gas/mips/branch-local-ignore-5.d: New test.
* testsuite/gas/mips/branch-local-ignore-n32-5.d: New test.
* testsuite/gas/mips/branch-local-ignore-n64-5.d: New test.
* testsuite/gas/mips/branch-local-ignore-6.d: New test.
* testsuite/gas/mips/branch-local-ignore-n32-6.d: New test.
* testsuite/gas/mips/branch-local-ignore-n64-6.d: New test.
* testsuite/gas/mips/branch-local-5.l: New stderr output.
* testsuite/gas/mips/branch-local-6.l: New stderr output.
* testsuite/gas/mips/branch-local-5.s: New test source.
* testsuite/gas/mips/branch-local-6.s: New test source.
* testsuite/gas/mips/branch-local-7.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new tests.

23 files changed:
gas/ChangeLog
gas/config/tc-mips.c
gas/testsuite/gas/mips/branch-local-5.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-5.l [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-5.s [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-6.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-6.l [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-6.s [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-7.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-7.s [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-ignore-5.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-ignore-6.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-ignore-n32-5.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-ignore-n32-6.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-ignore-n64-5.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-ignore-n64-6.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-n32-5.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-n32-6.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-n32-7.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-n64-5.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-n64-6.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-local-n64-7.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips.exp

index 2e60e29a3c6d369d7843f92a71c3277a7664a88b..a71ed28360738bb8eaaa67bd309f5e19b0b2b46d 100644 (file)
@@ -1,3 +1,29 @@
+2017-08-30  Maciej W. Rozycki  <macro@imgtec.com>
+
+       * config/tc-mips.c (md_convert_frag): Respect
+       `mips_ignore_branch_isa'.
+       * testsuite/gas/mips/branch-local-5.d: New test.
+       * testsuite/gas/mips/branch-local-n32-5.d: New test.
+       * testsuite/gas/mips/branch-local-n64-5.d: New test.
+       * testsuite/gas/mips/branch-local-6.d: New test.
+       * testsuite/gas/mips/branch-local-n32-6.d: New test.
+       * testsuite/gas/mips/branch-local-n64-6.d: New test.
+       * testsuite/gas/mips/branch-local-7.d: New test.
+       * testsuite/gas/mips/branch-local-n32-7.d: New test.
+       * testsuite/gas/mips/branch-local-n64-7.d: New test.
+       * testsuite/gas/mips/branch-local-ignore-5.d: New test.
+       * testsuite/gas/mips/branch-local-ignore-n32-5.d: New test.
+       * testsuite/gas/mips/branch-local-ignore-n64-5.d: New test.
+       * testsuite/gas/mips/branch-local-ignore-6.d: New test.
+       * testsuite/gas/mips/branch-local-ignore-n32-6.d: New test.
+       * testsuite/gas/mips/branch-local-ignore-n64-6.d: New test.
+       * testsuite/gas/mips/branch-local-5.l: New stderr output.
+       * testsuite/gas/mips/branch-local-6.l: New stderr output.
+       * testsuite/gas/mips/branch-local-5.s: New test source.
+       * testsuite/gas/mips/branch-local-6.s: New test source.
+       * testsuite/gas/mips/branch-local-7.s: New test source.
+       * testsuite/gas/mips/mips.exp: Run the new tests.
+
 2017-08-30  Maciej W. Rozycki  <macro@imgtec.com>
 
        * testsuite/gas/mips/branch-local-n32-2.d: Use `branch-local-2.l'
index 3804df2958757de0ed492ff3c905dc427b4fd081..43a703307e15cc91b01e259595ac69ef34fe9837 100644 (file)
@@ -18630,7 +18630,8 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp)
 
          if (pcrel_op->include_isa_bit && !need_reloc)
            {
-             if (!ELF_ST_IS_MIPS16 (S_GET_OTHER (fragp->fr_symbol)))
+             if (!mips_ignore_branch_isa
+                 && !ELF_ST_IS_MIPS16 (S_GET_OTHER (fragp->fr_symbol)))
                as_bad_where (fragp->fr_file, fragp->fr_line,
                              _("branch to a symbol in another ISA mode"));
              else if ((fragp->fr_offset & 0x1) != 0)
diff --git a/gas/testsuite/gas/mips/branch-local-5.d b/gas/testsuite/gas/mips/branch-local-5.d
new file mode 100644 (file)
index 0000000..8033ced
--- /dev/null
@@ -0,0 +1,3 @@
+#name: MIPS branch local symbol relocation 5
+#as: -32
+#error-output: branch-local-5.l
diff --git a/gas/testsuite/gas/mips/branch-local-5.l b/gas/testsuite/gas/mips/branch-local-5.l
new file mode 100644 (file)
index 0000000..361cf8a
--- /dev/null
@@ -0,0 +1,4 @@
+.*: Assembler messages:
+.*:19: Error: branch to a symbol in another ISA mode
+.*:21: Error: branch to a symbol in another ISA mode
+.*:23: Error: branch to a symbol in another ISA mode
diff --git a/gas/testsuite/gas/mips/branch-local-5.s b/gas/testsuite/gas/mips/branch-local-5.s
new file mode 100644 (file)
index 0000000..a6b8338
--- /dev/null
@@ -0,0 +1,31 @@
+       .text
+       .set    noreorder
+       .space  0x1000
+
+       .align  4
+       .set    nomips16
+       .ent    foo
+foo:
+       nor     $0, $0
+       jalr    $0, $ra
+        nor    $0, $0
+       .end    foo
+
+       .align  4
+       .set    mips16
+       .ent    bar
+bar:
+       not     $16, $16
+       b       foo
+       not     $16, $16
+       beqz    $2, foo
+       not     $16, $16
+       bteqz   foo
+       not     $16, $16
+       jr      $ra
+        not    $16, $16
+       .end    bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+       .align  4, 0
+       .space  16
diff --git a/gas/testsuite/gas/mips/branch-local-6.d b/gas/testsuite/gas/mips/branch-local-6.d
new file mode 100644 (file)
index 0000000..45a0ede
--- /dev/null
@@ -0,0 +1,3 @@
+#name: MIPS branch local symbol relocation 6
+#as: -32
+#error-output: branch-local-6.l
diff --git a/gas/testsuite/gas/mips/branch-local-6.l b/gas/testsuite/gas/mips/branch-local-6.l
new file mode 100644 (file)
index 0000000..a119ade
--- /dev/null
@@ -0,0 +1,9 @@
+.*: Assembler messages:
+.*:19: Error: branch to a symbol in another ISA mode
+.*:25: Error: branch to a symbol in another ISA mode
+.*:27: Error: branch to a symbol in another ISA mode
+.*:29: Error: branch to a symbol in another ISA mode
+.*:31: Error: branch to a symbol in another ISA mode
+.*:33: Error: branch to a symbol in another ISA mode
+.*:21: Error: branch to a symbol in another ISA mode
+.*:23: Error: branch to a symbol in another ISA mode
diff --git a/gas/testsuite/gas/mips/branch-local-6.s b/gas/testsuite/gas/mips/branch-local-6.s
new file mode 100644 (file)
index 0000000..1a54673
--- /dev/null
@@ -0,0 +1,41 @@
+       .text
+       .set    noreorder
+       .space  0x1000
+
+       .align  4
+       .set    nomicromips
+       .ent    foo
+foo:
+       nor     $0, $0
+       jalr    $0, $ra
+        nor    $0, $0
+       .end    foo
+
+       .align  4
+       .set    micromips
+       .ent    bar
+bar:
+       nor     $0, $0
+       beqzc   $2, foo
+       nor     $0, $0
+       b       foo
+        nor    $0, $0
+       beqz    $2, foo
+        nor    $0, $0
+       bgezal  $2, foo
+        nor    $0, $0
+       bgezals $2, foo
+        not    $16, $16
+       bltzal  $2, foo
+        nor    $0, $0
+       bltzals $2, foo
+        not    $16, $16
+       bals    foo
+        not    $16, $16
+       jalr    $0, $ra
+        nor    $0, $0
+       .end    bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+       .align  4, 0
+       .space  16
diff --git a/gas/testsuite/gas/mips/branch-local-7.d b/gas/testsuite/gas/mips/branch-local-7.d
new file mode 100644 (file)
index 0000000..0cc2a11
--- /dev/null
@@ -0,0 +1,20 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS branch local symbol relocation 7
+#as: -32
+#source: branch-local-7.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+       \.\.\.
+[0-9a-f]+ <[^>]*> 00000027     nor     zero,zero,zero
+[0-9a-f]+ <[^>]*> 03e00009     jalr    zero,ra
+[0-9a-f]+ <[^>]*> 00000027     nor     zero,zero,zero
+[0-9a-f]+ <[^>]*> 00000000     nop
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 4060 fffe    bal     00001014 <bar\+0x4>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        foo
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 001f 0f3c    jr      ra
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+       \.\.\.
diff --git a/gas/testsuite/gas/mips/branch-local-7.s b/gas/testsuite/gas/mips/branch-local-7.s
new file mode 100644 (file)
index 0000000..82d94f3
--- /dev/null
@@ -0,0 +1,27 @@
+       .text
+       .set    noreorder
+       .space  0x1000
+
+       .align  4
+       .set    nomicromips
+       .ent    foo
+foo:
+       nor     $0, $0
+       jalr    $0, $ra
+        nor    $0, $0
+       .end    foo
+
+       .align  4
+       .set    micromips
+       .ent    bar
+bar:
+       nor     $0, $0
+       bal     foo
+        nor    $0, $0
+       jalr    $0, $ra
+        nor    $0, $0
+       .end    bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+       .align  4, 0
+       .space  16
diff --git a/gas/testsuite/gas/mips/branch-local-ignore-5.d b/gas/testsuite/gas/mips/branch-local-ignore-5.d
new file mode 100644 (file)
index 0000000..94ffe19
--- /dev/null
@@ -0,0 +1,23 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS branch local symbol relocation 5 (ignore branch ISA)
+#as: -32 -mignore-branch-isa
+#source: branch-local-5.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+       \.\.\.
+[0-9a-f]+ <[^>]*> 00000027     nor     zero,zero,zero
+[0-9a-f]+ <[^>]*> 03e00009     jalr    zero,ra
+[0-9a-f]+ <[^>]*> 00000027     nor     zero,zero,zero
+[0-9a-f]+ <[^>]*> 00000000     nop
+[0-9a-f]+ <[^>]*> e80f         not     s0
+[0-9a-f]+ <[^>]*> 17f6         b       0+001000 <foo>
+[0-9a-f]+ <[^>]*> e80f         not     s0
+[0-9a-f]+ <[^>]*> 22f4         beqz    v0,0+001000 <foo>
+[0-9a-f]+ <[^>]*> e80f         not     s0
+[0-9a-f]+ <[^>]*> 60f2         bteqz   0+001000 <foo>
+[0-9a-f]+ <[^>]*> e80f         not     s0
+[0-9a-f]+ <[^>]*> e820         jr      ra
+[0-9a-f]+ <[^>]*> e80f         not     s0
+       \.\.\.
diff --git a/gas/testsuite/gas/mips/branch-local-ignore-6.d b/gas/testsuite/gas/mips/branch-local-ignore-6.d
new file mode 100644 (file)
index 0000000..1565688
--- /dev/null
@@ -0,0 +1,41 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS branch local symbol relocation 6 (ignore branch ISA)
+#as: -32 -mignore-branch-isa
+#source: branch-local-6.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+       \.\.\.
+[0-9a-f]+ <[^>]*> 00000027     nor     zero,zero,zero
+[0-9a-f]+ <[^>]*> 03e00009     jalr    zero,ra
+[0-9a-f]+ <[^>]*> 00000027     nor     zero,zero,zero
+[0-9a-f]+ <[^>]*> 00000000     nop
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 40e2 fffe    beqzc   v0,00001014 <bar\+0x4>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        foo
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> cfff         b       0000101c <bar\+0xc>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC10_S1        foo
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 8d7f         beqz    v0,00001022 <bar\+0x12>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC7_S1 foo
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 4062 fffe    bgezal  v0,00001028 <bar\+0x18>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        foo
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 4262 fffe    bgezals v0,00001030 <bar\+0x20>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        foo
+[0-9a-f]+ <[^>]*> 4400         not     s0,s0
+[0-9a-f]+ <[^>]*> 4022 fffe    bltzal  v0,00001036 <bar\+0x26>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        foo
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 4222 fffe    bltzals v0,0000103e <bar\+0x2e>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        foo
+[0-9a-f]+ <[^>]*> 4400         not     s0,s0
+[0-9a-f]+ <[^>]*> 4260 fffe    bals    00001044 <bar\+0x34>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        foo
+[0-9a-f]+ <[^>]*> 4400         not     s0,s0
+[0-9a-f]+ <[^>]*> 001f 0f3c    jr      ra
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+       \.\.\.
diff --git a/gas/testsuite/gas/mips/branch-local-ignore-n32-5.d b/gas/testsuite/gas/mips/branch-local-ignore-n32-5.d
new file mode 100644 (file)
index 0000000..3ddd866
--- /dev/null
@@ -0,0 +1,5 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS branch local symbol relocation 5 (ignore branch ISA, n32)
+#as: -n32 -march=from-abi -mignore-branch-isa
+#source: branch-local-5.s
+#dump: branch-local-ignore-5.d
diff --git a/gas/testsuite/gas/mips/branch-local-ignore-n32-6.d b/gas/testsuite/gas/mips/branch-local-ignore-n32-6.d
new file mode 100644 (file)
index 0000000..7b12203
--- /dev/null
@@ -0,0 +1,41 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS branch local symbol relocation 6 (ignore branch ISA, n32)
+#as: -n32 -march=from-abi -mignore-branch-isa
+#source: branch-local-6.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+       \.\.\.
+[0-9a-f]+ <[^>]*> 00000027     nor     zero,zero,zero
+[0-9a-f]+ <[^>]*> 03e00009     jalr    zero,ra
+[0-9a-f]+ <[^>]*> 00000027     nor     zero,zero,zero
+[0-9a-f]+ <[^>]*> 00000000     nop
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 40e2 0000    beqzc   v0,00001018 <bar\+0x8>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        \.text\+0xffc
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> cc00         b       0000101e <bar\+0xe>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC10_S1        \.text\+0xffe
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 8d00         beqz    v0,00001024 <bar\+0x14>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC7_S1 \.text\+0xffe
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 4062 0000    bgezal  v0,0000102c <bar\+0x1c>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        \.text\+0xffc
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 4262 0000    bgezals v0,00001034 <bar\+0x24>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        \.text\+0xffc
+[0-9a-f]+ <[^>]*> 4400         not     s0,s0
+[0-9a-f]+ <[^>]*> 4022 0000    bltzal  v0,0000103a <bar\+0x2a>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        \.text\+0xffc
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 4222 0000    bltzals v0,00001042 <bar\+0x32>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        \.text\+0xffc
+[0-9a-f]+ <[^>]*> 4400         not     s0,s0
+[0-9a-f]+ <[^>]*> 4260 0000    bals    00001048 <bar\+0x38>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        \.text\+0xffc
+[0-9a-f]+ <[^>]*> 4400         not     s0,s0
+[0-9a-f]+ <[^>]*> 001f 0f3c    jr      ra
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+       \.\.\.
diff --git a/gas/testsuite/gas/mips/branch-local-ignore-n64-5.d b/gas/testsuite/gas/mips/branch-local-ignore-n64-5.d
new file mode 100644 (file)
index 0000000..9f08b33
--- /dev/null
@@ -0,0 +1,5 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS branch local symbol relocation 5 (ignore branch ISA, n64)
+#as: -64 -march=from-abi -mignore-branch-isa
+#source: branch-local-5.s
+#dump: branch-local-ignore-5.d
diff --git a/gas/testsuite/gas/mips/branch-local-ignore-n64-6.d b/gas/testsuite/gas/mips/branch-local-ignore-n64-6.d
new file mode 100644 (file)
index 0000000..2852e98
--- /dev/null
@@ -0,0 +1,57 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS branch local symbol relocation 6 (ignore branch ISA, n64)
+#as: -64 -march=from-abi -mignore-branch-isa
+#source: branch-local-6.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+       \.\.\.
+[0-9a-f]+ <[^>]*> 00000027     nor     zero,zero,zero
+[0-9a-f]+ <[^>]*> 03e00009     jalr    zero,ra
+[0-9a-f]+ <[^>]*> 00000027     nor     zero,zero,zero
+[0-9a-f]+ <[^>]*> 00000000     nop
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 40e2 0000    beqzc   v0,0000000000001018 <bar\+0x8>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        \.text\+0xffc
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffc
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffc
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> cc00         b       000000000000101e <bar\+0xe>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC10_S1        \.text\+0xffe
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffe
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffe
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 8d00         beqz    v0,0000000000001024 <bar\+0x14>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC7_S1 \.text\+0xffe
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffe
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffe
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 4062 0000    bgezal  v0,000000000000102c <bar\+0x1c>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        \.text\+0xffc
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffc
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffc
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 4262 0000    bgezals v0,0000000000001034 <bar\+0x24>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        \.text\+0xffc
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffc
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffc
+[0-9a-f]+ <[^>]*> 4400         not     s0,s0
+[0-9a-f]+ <[^>]*> 4022 0000    bltzal  v0,000000000000103a <bar\+0x2a>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        \.text\+0xffc
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffc
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffc
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 4222 0000    bltzals v0,0000000000001042 <bar\+0x32>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        \.text\+0xffc
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffc
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffc
+[0-9a-f]+ <[^>]*> 4400         not     s0,s0
+[0-9a-f]+ <[^>]*> 4260 0000    bals    0000000000001048 <bar\+0x38>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        \.text\+0xffc
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffc
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffc
+[0-9a-f]+ <[^>]*> 4400         not     s0,s0
+[0-9a-f]+ <[^>]*> 001f 0f3c    jr      ra
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+       \.\.\.
diff --git a/gas/testsuite/gas/mips/branch-local-n32-5.d b/gas/testsuite/gas/mips/branch-local-n32-5.d
new file mode 100644 (file)
index 0000000..ac1f73e
--- /dev/null
@@ -0,0 +1,4 @@
+#name: MIPS branch local symbol relocation 5 (n32)
+#as: -n32 -march=from-abi
+#error-output: branch-local-5.l
+#source: branch-local-5.s
diff --git a/gas/testsuite/gas/mips/branch-local-n32-6.d b/gas/testsuite/gas/mips/branch-local-n32-6.d
new file mode 100644 (file)
index 0000000..de3fc98
--- /dev/null
@@ -0,0 +1,4 @@
+#name: MIPS branch local symbol relocation 6 (n32)
+#as: -n32 -march=from-abi
+#error-output: branch-local-6.l
+#source: branch-local-6.s
diff --git a/gas/testsuite/gas/mips/branch-local-n32-7.d b/gas/testsuite/gas/mips/branch-local-n32-7.d
new file mode 100644 (file)
index 0000000..5d5b1de
--- /dev/null
@@ -0,0 +1,20 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS branch local symbol relocation 7 (n32)
+#as: -n32 -march=from-abi
+#source: branch-local-7.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+       \.\.\.
+[0-9a-f]+ <[^>]*> 00000027     nor     zero,zero,zero
+[0-9a-f]+ <[^>]*> 03e00009     jalr    zero,ra
+[0-9a-f]+ <[^>]*> 00000027     nor     zero,zero,zero
+[0-9a-f]+ <[^>]*> 00000000     nop
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 4060 0000    bal     00001018 <bar\+0x8>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        \.text\+0xffc
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 001f 0f3c    jr      ra
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+       \.\.\.
diff --git a/gas/testsuite/gas/mips/branch-local-n64-5.d b/gas/testsuite/gas/mips/branch-local-n64-5.d
new file mode 100644 (file)
index 0000000..05a396e
--- /dev/null
@@ -0,0 +1,4 @@
+#name: MIPS branch local symbol relocation 5 (n64)
+#as: -64 -march=from-abi
+#error-output: branch-local-5.l
+#source: branch-local-5.s
diff --git a/gas/testsuite/gas/mips/branch-local-n64-6.d b/gas/testsuite/gas/mips/branch-local-n64-6.d
new file mode 100644 (file)
index 0000000..3cd8a33
--- /dev/null
@@ -0,0 +1,4 @@
+#name: MIPS branch local symbol relocation 6 (n64)
+#as: -64 -march=from-abi
+#error-output: branch-local-6.l
+#source: branch-local-6.s
diff --git a/gas/testsuite/gas/mips/branch-local-n64-7.d b/gas/testsuite/gas/mips/branch-local-n64-7.d
new file mode 100644 (file)
index 0000000..56296bd
--- /dev/null
@@ -0,0 +1,22 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS branch local symbol relocation 7 (n64)
+#as: -64 -march=from-abi
+#source: branch-local-7.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+       \.\.\.
+[0-9a-f]+ <[^>]*> 00000027     nor     zero,zero,zero
+[0-9a-f]+ <[^>]*> 03e00009     jalr    zero,ra
+[0-9a-f]+ <[^>]*> 00000027     nor     zero,zero,zero
+[0-9a-f]+ <[^>]*> 00000000     nop
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 4060 0000    bal     0000000000001018 <bar\+0x8>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC16_S1        \.text\+0xffc
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffc
+[      ]*[0-9a-f]+: R_MIPS_NONE        \*ABS\*\+0xffc
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+[0-9a-f]+ <[^>]*> 001f 0f3c    jr      ra
+[0-9a-f]+ <[^>]*> 0000 02d0    not     zero,zero
+       \.\.\.
index 0ea9f61b9694d501cacfa2350f455dac6b7d5d0a..e67473bfb60dcb20d1eb390128166c7f014c6fc4 100644 (file)
@@ -648,6 +648,11 @@ if { [istarget mips*-*-vxworks*] } {
     run_dump_test "branch-local-3"
     run_dump_test "branch-local-ignore-3"
     run_dump_test "branch-local-4"
+    run_dump_test "branch-local-5"
+    run_dump_test "branch-local-ignore-5"
+    run_dump_test "branch-local-6"
+    run_dump_test "branch-local-ignore-6"
+    run_dump_test "branch-local-7"
     if $has_newabi {
        run_dump_test "branch-local-n32-1"
        run_dump_test "branch-local-n32-2"
@@ -655,12 +660,22 @@ if { [istarget mips*-*-vxworks*] } {
        run_dump_test "branch-local-n32-3"
        run_dump_test "branch-local-ignore-n32-3"
        run_dump_test "branch-local-n32-4"
+       run_dump_test "branch-local-n32-5"
+       run_dump_test "branch-local-ignore-n32-5"
+       run_dump_test "branch-local-n32-6"
+       run_dump_test "branch-local-ignore-n32-6"
+       run_dump_test "branch-local-n32-7"
        run_dump_test "branch-local-n64-1"
        run_dump_test "branch-local-n64-2"
        run_dump_test "branch-local-ignore-n64-2"
        run_dump_test "branch-local-n64-3"
        run_dump_test "branch-local-ignore-n64-3"
        run_dump_test "branch-local-n64-4"
+       run_dump_test "branch-local-n64-5"
+       run_dump_test "branch-local-ignore-n64-5"
+       run_dump_test "branch-local-n64-6"
+       run_dump_test "branch-local-ignore-n64-6"
+       run_dump_test "branch-local-n64-7"
     }
     run_dump_test "branch-addend"
     if $has_newabi {