aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gas/ChangeLog26
-rw-r--r--gas/config/tc-mips.c3
-rw-r--r--gas/testsuite/gas/mips/branch-local-5.d3
-rw-r--r--gas/testsuite/gas/mips/branch-local-5.l4
-rw-r--r--gas/testsuite/gas/mips/branch-local-5.s31
-rw-r--r--gas/testsuite/gas/mips/branch-local-6.d3
-rw-r--r--gas/testsuite/gas/mips/branch-local-6.l9
-rw-r--r--gas/testsuite/gas/mips/branch-local-6.s41
-rw-r--r--gas/testsuite/gas/mips/branch-local-7.d20
-rw-r--r--gas/testsuite/gas/mips/branch-local-7.s27
-rw-r--r--gas/testsuite/gas/mips/branch-local-ignore-5.d23
-rw-r--r--gas/testsuite/gas/mips/branch-local-ignore-6.d41
-rw-r--r--gas/testsuite/gas/mips/branch-local-ignore-n32-5.d5
-rw-r--r--gas/testsuite/gas/mips/branch-local-ignore-n32-6.d41
-rw-r--r--gas/testsuite/gas/mips/branch-local-ignore-n64-5.d5
-rw-r--r--gas/testsuite/gas/mips/branch-local-ignore-n64-6.d57
-rw-r--r--gas/testsuite/gas/mips/branch-local-n32-5.d4
-rw-r--r--gas/testsuite/gas/mips/branch-local-n32-6.d4
-rw-r--r--gas/testsuite/gas/mips/branch-local-n32-7.d20
-rw-r--r--gas/testsuite/gas/mips/branch-local-n64-5.d4
-rw-r--r--gas/testsuite/gas/mips/branch-local-n64-6.d4
-rw-r--r--gas/testsuite/gas/mips/branch-local-n64-7.d22
-rw-r--r--gas/testsuite/gas/mips/mips.exp15
23 files changed, 411 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 0ed8e93..f3c745c 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -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-07-25 Tristan Gingold <gingold@adacore.com>
* configure: Regenerate.
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index e24e84d..0632adc 100644
--- 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)
{
if (!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
index 0000000..8033ced
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-5.d
@@ -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
index 0000000..361cf8a
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-5.l
@@ -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
index 0000000..a6b8338
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-5.s
@@ -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
index 0000000..45a0ede
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-6.d
@@ -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
index 0000000..a119ade
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-6.l
@@ -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
index 0000000..1a54673
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-6.s
@@ -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
index 0000000..0cc2a11
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-7.d
@@ -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
index 0000000..82d94f3
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-7.s
@@ -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
index 0000000..94ffe19
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-ignore-5.d
@@ -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
index 0000000..1565688
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-ignore-6.d
@@ -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
index 0000000..3ddd866
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-ignore-n32-5.d
@@ -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
index 0000000..7b12203
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-ignore-n32-6.d
@@ -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
index 0000000..9f08b33
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-ignore-n64-5.d
@@ -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
index 0000000..2852e98
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-ignore-n64-6.d
@@ -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
index 0000000..ac1f73e
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-n32-5.d
@@ -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
index 0000000..de3fc98
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-n32-6.d
@@ -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
index 0000000..5d5b1de
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-n32-7.d
@@ -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
index 0000000..05a396e
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-n64-5.d
@@ -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
index 0000000..3cd8a33
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-n64-6.d
@@ -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
index 0000000..56296bd
--- /dev/null
+++ b/gas/testsuite/gas/mips/branch-local-n64-7.d
@@ -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
+ \.\.\.
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 5a69542..4df731a 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -630,6 +630,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"
@@ -637,12 +642,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 {