• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂278fcf38584dd22b992e1da179c06883c2b7d108 (tree)
時間2017-08-31 00:21:54
作者Maciej W. Rozycki <macro@imgt...>
CommiterMaciej W. Rozycki

Log Message

MIPS/GAS: Also respect -mignore-branch-isa' with MIPS16 code

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.

(cherry picked from commit 37b2d327512baf2f39020e44958fd1f11db46a91)

Change Summary

差異

--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,29 @@
1+2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
2+
3+ * config/tc-mips.c (md_convert_frag): Respect
4+ `mips_ignore_branch_isa'.
5+ * testsuite/gas/mips/branch-local-5.d: New test.
6+ * testsuite/gas/mips/branch-local-n32-5.d: New test.
7+ * testsuite/gas/mips/branch-local-n64-5.d: New test.
8+ * testsuite/gas/mips/branch-local-6.d: New test.
9+ * testsuite/gas/mips/branch-local-n32-6.d: New test.
10+ * testsuite/gas/mips/branch-local-n64-6.d: New test.
11+ * testsuite/gas/mips/branch-local-7.d: New test.
12+ * testsuite/gas/mips/branch-local-n32-7.d: New test.
13+ * testsuite/gas/mips/branch-local-n64-7.d: New test.
14+ * testsuite/gas/mips/branch-local-ignore-5.d: New test.
15+ * testsuite/gas/mips/branch-local-ignore-n32-5.d: New test.
16+ * testsuite/gas/mips/branch-local-ignore-n64-5.d: New test.
17+ * testsuite/gas/mips/branch-local-ignore-6.d: New test.
18+ * testsuite/gas/mips/branch-local-ignore-n32-6.d: New test.
19+ * testsuite/gas/mips/branch-local-ignore-n64-6.d: New test.
20+ * testsuite/gas/mips/branch-local-5.l: New stderr output.
21+ * testsuite/gas/mips/branch-local-6.l: New stderr output.
22+ * testsuite/gas/mips/branch-local-5.s: New test source.
23+ * testsuite/gas/mips/branch-local-6.s: New test source.
24+ * testsuite/gas/mips/branch-local-7.s: New test source.
25+ * testsuite/gas/mips/mips.exp: Run the new tests.
26+
127 2017-07-25 Tristan Gingold <gingold@adacore.com>
228
329 * configure: Regenerate.
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -18372,7 +18372,8 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp)
1837218372 {
1837318373 if (!need_reloc)
1837418374 {
18375- if (!ELF_ST_IS_MIPS16 (S_GET_OTHER (fragp->fr_symbol)))
18375+ if (!mips_ignore_branch_isa
18376+ && !ELF_ST_IS_MIPS16 (S_GET_OTHER (fragp->fr_symbol)))
1837618377 as_bad_where (fragp->fr_file, fragp->fr_line,
1837718378 _("branch to a symbol in another ISA mode"));
1837818379 else if ((fragp->fr_offset & 0x1) != 0)
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-5.d
@@ -0,0 +1,3 @@
1+#name: MIPS branch local symbol relocation 5
2+#as: -32
3+#error-output: branch-local-5.l
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-5.l
@@ -0,0 +1,4 @@
1+.*: Assembler messages:
2+.*:19: Error: branch to a symbol in another ISA mode
3+.*:21: Error: branch to a symbol in another ISA mode
4+.*:23: Error: branch to a symbol in another ISA mode
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-5.s
@@ -0,0 +1,31 @@
1+ .text
2+ .set noreorder
3+ .space 0x1000
4+
5+ .align 4
6+ .set nomips16
7+ .ent foo
8+foo:
9+ nor $0, $0
10+ jalr $0, $ra
11+ nor $0, $0
12+ .end foo
13+
14+ .align 4
15+ .set mips16
16+ .ent bar
17+bar:
18+ not $16, $16
19+ b foo
20+ not $16, $16
21+ beqz $2, foo
22+ not $16, $16
23+ bteqz foo
24+ not $16, $16
25+ jr $ra
26+ not $16, $16
27+ .end bar
28+
29+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
30+ .align 4, 0
31+ .space 16
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-6.d
@@ -0,0 +1,3 @@
1+#name: MIPS branch local symbol relocation 6
2+#as: -32
3+#error-output: branch-local-6.l
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-6.l
@@ -0,0 +1,9 @@
1+.*: Assembler messages:
2+.*:19: Error: branch to a symbol in another ISA mode
3+.*:25: Error: branch to a symbol in another ISA mode
4+.*:27: Error: branch to a symbol in another ISA mode
5+.*:29: Error: branch to a symbol in another ISA mode
6+.*:31: Error: branch to a symbol in another ISA mode
7+.*:33: Error: branch to a symbol in another ISA mode
8+.*:21: Error: branch to a symbol in another ISA mode
9+.*:23: Error: branch to a symbol in another ISA mode
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-6.s
@@ -0,0 +1,41 @@
1+ .text
2+ .set noreorder
3+ .space 0x1000
4+
5+ .align 4
6+ .set nomicromips
7+ .ent foo
8+foo:
9+ nor $0, $0
10+ jalr $0, $ra
11+ nor $0, $0
12+ .end foo
13+
14+ .align 4
15+ .set micromips
16+ .ent bar
17+bar:
18+ nor $0, $0
19+ beqzc $2, foo
20+ nor $0, $0
21+ b foo
22+ nor $0, $0
23+ beqz $2, foo
24+ nor $0, $0
25+ bgezal $2, foo
26+ nor $0, $0
27+ bgezals $2, foo
28+ not $16, $16
29+ bltzal $2, foo
30+ nor $0, $0
31+ bltzals $2, foo
32+ not $16, $16
33+ bals foo
34+ not $16, $16
35+ jalr $0, $ra
36+ nor $0, $0
37+ .end bar
38+
39+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
40+ .align 4, 0
41+ .space 16
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-7.d
@@ -0,0 +1,20 @@
1+#objdump: -dr --prefix-addresses --show-raw-insn
2+#name: MIPS branch local symbol relocation 7
3+#as: -32
4+#source: branch-local-7.s
5+
6+.*: +file format .*mips.*
7+
8+Disassembly of section \.text:
9+ \.\.\.
10+[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
11+[0-9a-f]+ <[^>]*> 03e00009 jalr zero,ra
12+[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
13+[0-9a-f]+ <[^>]*> 00000000 nop
14+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
15+[0-9a-f]+ <[^>]*> 4060 fffe bal 00001014 <bar\+0x4>
16+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 foo
17+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
18+[0-9a-f]+ <[^>]*> 001f 0f3c jr ra
19+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
20+ \.\.\.
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-7.s
@@ -0,0 +1,27 @@
1+ .text
2+ .set noreorder
3+ .space 0x1000
4+
5+ .align 4
6+ .set nomicromips
7+ .ent foo
8+foo:
9+ nor $0, $0
10+ jalr $0, $ra
11+ nor $0, $0
12+ .end foo
13+
14+ .align 4
15+ .set micromips
16+ .ent bar
17+bar:
18+ nor $0, $0
19+ bal foo
20+ nor $0, $0
21+ jalr $0, $ra
22+ nor $0, $0
23+ .end bar
24+
25+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
26+ .align 4, 0
27+ .space 16
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-ignore-5.d
@@ -0,0 +1,23 @@
1+#objdump: -dr --prefix-addresses --show-raw-insn
2+#name: MIPS branch local symbol relocation 5 (ignore branch ISA)
3+#as: -32 -mignore-branch-isa
4+#source: branch-local-5.s
5+
6+.*: +file format .*mips.*
7+
8+Disassembly of section \.text:
9+ \.\.\.
10+[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
11+[0-9a-f]+ <[^>]*> 03e00009 jalr zero,ra
12+[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
13+[0-9a-f]+ <[^>]*> 00000000 nop
14+[0-9a-f]+ <[^>]*> e80f not s0
15+[0-9a-f]+ <[^>]*> 17f6 b 0+001000 <foo>
16+[0-9a-f]+ <[^>]*> e80f not s0
17+[0-9a-f]+ <[^>]*> 22f4 beqz v0,0+001000 <foo>
18+[0-9a-f]+ <[^>]*> e80f not s0
19+[0-9a-f]+ <[^>]*> 60f2 bteqz 0+001000 <foo>
20+[0-9a-f]+ <[^>]*> e80f not s0
21+[0-9a-f]+ <[^>]*> e820 jr ra
22+[0-9a-f]+ <[^>]*> e80f not s0
23+ \.\.\.
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-ignore-6.d
@@ -0,0 +1,41 @@
1+#objdump: -dr --prefix-addresses --show-raw-insn
2+#name: MIPS branch local symbol relocation 6 (ignore branch ISA)
3+#as: -32 -mignore-branch-isa
4+#source: branch-local-6.s
5+
6+.*: +file format .*mips.*
7+
8+Disassembly of section \.text:
9+ \.\.\.
10+[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
11+[0-9a-f]+ <[^>]*> 03e00009 jalr zero,ra
12+[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
13+[0-9a-f]+ <[^>]*> 00000000 nop
14+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
15+[0-9a-f]+ <[^>]*> 40e2 fffe beqzc v0,00001014 <bar\+0x4>
16+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 foo
17+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
18+[0-9a-f]+ <[^>]*> cfff b 0000101c <bar\+0xc>
19+[ ]*[0-9a-f]+: R_MICROMIPS_PC10_S1 foo
20+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
21+[0-9a-f]+ <[^>]*> 8d7f beqz v0,00001022 <bar\+0x12>
22+[ ]*[0-9a-f]+: R_MICROMIPS_PC7_S1 foo
23+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
24+[0-9a-f]+ <[^>]*> 4062 fffe bgezal v0,00001028 <bar\+0x18>
25+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 foo
26+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
27+[0-9a-f]+ <[^>]*> 4262 fffe bgezals v0,00001030 <bar\+0x20>
28+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 foo
29+[0-9a-f]+ <[^>]*> 4400 not s0,s0
30+[0-9a-f]+ <[^>]*> 4022 fffe bltzal v0,00001036 <bar\+0x26>
31+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 foo
32+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
33+[0-9a-f]+ <[^>]*> 4222 fffe bltzals v0,0000103e <bar\+0x2e>
34+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 foo
35+[0-9a-f]+ <[^>]*> 4400 not s0,s0
36+[0-9a-f]+ <[^>]*> 4260 fffe bals 00001044 <bar\+0x34>
37+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 foo
38+[0-9a-f]+ <[^>]*> 4400 not s0,s0
39+[0-9a-f]+ <[^>]*> 001f 0f3c jr ra
40+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
41+ \.\.\.
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-ignore-n32-5.d
@@ -0,0 +1,5 @@
1+#objdump: -dr --prefix-addresses --show-raw-insn
2+#name: MIPS branch local symbol relocation 5 (ignore branch ISA, n32)
3+#as: -n32 -march=from-abi -mignore-branch-isa
4+#source: branch-local-5.s
5+#dump: branch-local-ignore-5.d
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-ignore-n32-6.d
@@ -0,0 +1,41 @@
1+#objdump: -dr --prefix-addresses --show-raw-insn
2+#name: MIPS branch local symbol relocation 6 (ignore branch ISA, n32)
3+#as: -n32 -march=from-abi -mignore-branch-isa
4+#source: branch-local-6.s
5+
6+.*: +file format .*mips.*
7+
8+Disassembly of section \.text:
9+ \.\.\.
10+[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
11+[0-9a-f]+ <[^>]*> 03e00009 jalr zero,ra
12+[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
13+[0-9a-f]+ <[^>]*> 00000000 nop
14+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
15+[0-9a-f]+ <[^>]*> 40e2 0000 beqzc v0,00001018 <bar\+0x8>
16+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc
17+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
18+[0-9a-f]+ <[^>]*> cc00 b 0000101e <bar\+0xe>
19+[ ]*[0-9a-f]+: R_MICROMIPS_PC10_S1 \.text\+0xffe
20+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
21+[0-9a-f]+ <[^>]*> 8d00 beqz v0,00001024 <bar\+0x14>
22+[ ]*[0-9a-f]+: R_MICROMIPS_PC7_S1 \.text\+0xffe
23+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
24+[0-9a-f]+ <[^>]*> 4062 0000 bgezal v0,0000102c <bar\+0x1c>
25+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc
26+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
27+[0-9a-f]+ <[^>]*> 4262 0000 bgezals v0,00001034 <bar\+0x24>
28+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc
29+[0-9a-f]+ <[^>]*> 4400 not s0,s0
30+[0-9a-f]+ <[^>]*> 4022 0000 bltzal v0,0000103a <bar\+0x2a>
31+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc
32+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
33+[0-9a-f]+ <[^>]*> 4222 0000 bltzals v0,00001042 <bar\+0x32>
34+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc
35+[0-9a-f]+ <[^>]*> 4400 not s0,s0
36+[0-9a-f]+ <[^>]*> 4260 0000 bals 00001048 <bar\+0x38>
37+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc
38+[0-9a-f]+ <[^>]*> 4400 not s0,s0
39+[0-9a-f]+ <[^>]*> 001f 0f3c jr ra
40+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
41+ \.\.\.
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-ignore-n64-5.d
@@ -0,0 +1,5 @@
1+#objdump: -dr --prefix-addresses --show-raw-insn
2+#name: MIPS branch local symbol relocation 5 (ignore branch ISA, n64)
3+#as: -64 -march=from-abi -mignore-branch-isa
4+#source: branch-local-5.s
5+#dump: branch-local-ignore-5.d
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-ignore-n64-6.d
@@ -0,0 +1,57 @@
1+#objdump: -dr --prefix-addresses --show-raw-insn
2+#name: MIPS branch local symbol relocation 6 (ignore branch ISA, n64)
3+#as: -64 -march=from-abi -mignore-branch-isa
4+#source: branch-local-6.s
5+
6+.*: +file format .*mips.*
7+
8+Disassembly of section \.text:
9+ \.\.\.
10+[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
11+[0-9a-f]+ <[^>]*> 03e00009 jalr zero,ra
12+[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
13+[0-9a-f]+ <[^>]*> 00000000 nop
14+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
15+[0-9a-f]+ <[^>]*> 40e2 0000 beqzc v0,0000000000001018 <bar\+0x8>
16+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc
17+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffc
18+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffc
19+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
20+[0-9a-f]+ <[^>]*> cc00 b 000000000000101e <bar\+0xe>
21+[ ]*[0-9a-f]+: R_MICROMIPS_PC10_S1 \.text\+0xffe
22+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffe
23+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffe
24+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
25+[0-9a-f]+ <[^>]*> 8d00 beqz v0,0000000000001024 <bar\+0x14>
26+[ ]*[0-9a-f]+: R_MICROMIPS_PC7_S1 \.text\+0xffe
27+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffe
28+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffe
29+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
30+[0-9a-f]+ <[^>]*> 4062 0000 bgezal v0,000000000000102c <bar\+0x1c>
31+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc
32+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffc
33+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffc
34+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
35+[0-9a-f]+ <[^>]*> 4262 0000 bgezals v0,0000000000001034 <bar\+0x24>
36+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc
37+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffc
38+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffc
39+[0-9a-f]+ <[^>]*> 4400 not s0,s0
40+[0-9a-f]+ <[^>]*> 4022 0000 bltzal v0,000000000000103a <bar\+0x2a>
41+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc
42+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffc
43+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffc
44+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
45+[0-9a-f]+ <[^>]*> 4222 0000 bltzals v0,0000000000001042 <bar\+0x32>
46+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc
47+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffc
48+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffc
49+[0-9a-f]+ <[^>]*> 4400 not s0,s0
50+[0-9a-f]+ <[^>]*> 4260 0000 bals 0000000000001048 <bar\+0x38>
51+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc
52+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffc
53+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffc
54+[0-9a-f]+ <[^>]*> 4400 not s0,s0
55+[0-9a-f]+ <[^>]*> 001f 0f3c jr ra
56+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
57+ \.\.\.
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-n32-5.d
@@ -0,0 +1,4 @@
1+#name: MIPS branch local symbol relocation 5 (n32)
2+#as: -n32 -march=from-abi
3+#error-output: branch-local-5.l
4+#source: branch-local-5.s
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-n32-6.d
@@ -0,0 +1,4 @@
1+#name: MIPS branch local symbol relocation 6 (n32)
2+#as: -n32 -march=from-abi
3+#error-output: branch-local-6.l
4+#source: branch-local-6.s
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-n32-7.d
@@ -0,0 +1,20 @@
1+#objdump: -dr --prefix-addresses --show-raw-insn
2+#name: MIPS branch local symbol relocation 7 (n32)
3+#as: -n32 -march=from-abi
4+#source: branch-local-7.s
5+
6+.*: +file format .*mips.*
7+
8+Disassembly of section \.text:
9+ \.\.\.
10+[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
11+[0-9a-f]+ <[^>]*> 03e00009 jalr zero,ra
12+[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
13+[0-9a-f]+ <[^>]*> 00000000 nop
14+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
15+[0-9a-f]+ <[^>]*> 4060 0000 bal 00001018 <bar\+0x8>
16+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc
17+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
18+[0-9a-f]+ <[^>]*> 001f 0f3c jr ra
19+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
20+ \.\.\.
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-n64-5.d
@@ -0,0 +1,4 @@
1+#name: MIPS branch local symbol relocation 5 (n64)
2+#as: -64 -march=from-abi
3+#error-output: branch-local-5.l
4+#source: branch-local-5.s
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-n64-6.d
@@ -0,0 +1,4 @@
1+#name: MIPS branch local symbol relocation 6 (n64)
2+#as: -64 -march=from-abi
3+#error-output: branch-local-6.l
4+#source: branch-local-6.s
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-n64-7.d
@@ -0,0 +1,22 @@
1+#objdump: -dr --prefix-addresses --show-raw-insn
2+#name: MIPS branch local symbol relocation 7 (n64)
3+#as: -64 -march=from-abi
4+#source: branch-local-7.s
5+
6+.*: +file format .*mips.*
7+
8+Disassembly of section \.text:
9+ \.\.\.
10+[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
11+[0-9a-f]+ <[^>]*> 03e00009 jalr zero,ra
12+[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
13+[0-9a-f]+ <[^>]*> 00000000 nop
14+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
15+[0-9a-f]+ <[^>]*> 4060 0000 bal 0000000000001018 <bar\+0x8>
16+[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc
17+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffc
18+[ ]*[0-9a-f]+: R_MIPS_NONE \*ABS\*\+0xffc
19+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
20+[0-9a-f]+ <[^>]*> 001f 0f3c jr ra
21+[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
22+ \.\.\.
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -630,6 +630,11 @@ if { [istarget mips*-*-vxworks*] } {
630630 run_dump_test "branch-local-3"
631631 run_dump_test "branch-local-ignore-3"
632632 run_dump_test "branch-local-4"
633+ run_dump_test "branch-local-5"
634+ run_dump_test "branch-local-ignore-5"
635+ run_dump_test "branch-local-6"
636+ run_dump_test "branch-local-ignore-6"
637+ run_dump_test "branch-local-7"
633638 if $has_newabi {
634639 run_dump_test "branch-local-n32-1"
635640 run_dump_test "branch-local-n32-2"
@@ -637,12 +642,22 @@ if { [istarget mips*-*-vxworks*] } {
637642 run_dump_test "branch-local-n32-3"
638643 run_dump_test "branch-local-ignore-n32-3"
639644 run_dump_test "branch-local-n32-4"
645+ run_dump_test "branch-local-n32-5"
646+ run_dump_test "branch-local-ignore-n32-5"
647+ run_dump_test "branch-local-n32-6"
648+ run_dump_test "branch-local-ignore-n32-6"
649+ run_dump_test "branch-local-n32-7"
640650 run_dump_test "branch-local-n64-1"
641651 run_dump_test "branch-local-n64-2"
642652 run_dump_test "branch-local-ignore-n64-2"
643653 run_dump_test "branch-local-n64-3"
644654 run_dump_test "branch-local-ignore-n64-3"
645655 run_dump_test "branch-local-n64-4"
656+ run_dump_test "branch-local-n64-5"
657+ run_dump_test "branch-local-ignore-n64-5"
658+ run_dump_test "branch-local-n64-6"
659+ run_dump_test "branch-local-ignore-n64-6"
660+ run_dump_test "branch-local-n64-7"
646661 }
647662 run_dump_test "branch-addend"
648663 if $has_newabi {