This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[committed] MIPS/GAS: Also respect `-mignore-branch-isa' with MIPS16 code
- From: "Maciej W. Rozycki" <macro at imgtec dot com>
- To: <binutils at sourceware dot org>
- Cc: Aurelien Jarno <aurelien at aurel32 dot net>
- Date: Wed, 30 Aug 2017 16:29:59 +0100
- Subject: [committed] MIPS/GAS: Also respect `-mignore-branch-isa' with MIPS16 code
- Authentication-results: sourceware.org; auth=none
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.
---
Sigh, the lack of a MIPS16 test case along with the original commit has
taken revenge. Fixed now in master, and backported to 2.29 and 2.28.
Maciej
---
gas/config/tc-mips.c | 3 -
gas/testsuite/gas/mips/branch-local-5.d | 3 +
gas/testsuite/gas/mips/branch-local-5.l | 4 +
gas/testsuite/gas/mips/branch-local-5.s | 31 +++++++++++
gas/testsuite/gas/mips/branch-local-6.d | 3 +
gas/testsuite/gas/mips/branch-local-6.l | 9 +++
gas/testsuite/gas/mips/branch-local-6.s | 41 +++++++++++++++
gas/testsuite/gas/mips/branch-local-7.d | 20 +++++++
gas/testsuite/gas/mips/branch-local-7.s | 27 +++++++++
gas/testsuite/gas/mips/branch-local-ignore-5.d | 23 ++++++++
gas/testsuite/gas/mips/branch-local-ignore-6.d | 41 +++++++++++++++
gas/testsuite/gas/mips/branch-local-ignore-n32-5.d | 5 +
gas/testsuite/gas/mips/branch-local-ignore-n32-6.d | 41 +++++++++++++++
gas/testsuite/gas/mips/branch-local-ignore-n64-5.d | 5 +
gas/testsuite/gas/mips/branch-local-ignore-n64-6.d | 57 +++++++++++++++++++++
gas/testsuite/gas/mips/branch-local-n32-5.d | 4 +
gas/testsuite/gas/mips/branch-local-n32-6.d | 4 +
gas/testsuite/gas/mips/branch-local-n32-7.d | 20 +++++++
gas/testsuite/gas/mips/branch-local-n64-5.d | 4 +
gas/testsuite/gas/mips/branch-local-n64-6.d | 4 +
gas/testsuite/gas/mips/branch-local-n64-7.d | 22 ++++++++
gas/testsuite/gas/mips/mips.exp | 15 +++++
22 files changed, 385 insertions(+), 1 deletion(-)
binutils-mips16-gas-ignore-branch-isa-fix.diff
Index: binutils/gas/config/tc-mips.c
===================================================================
--- binutils.orig/gas/config/tc-mips.c 2017-08-25 13:19:05.787924527 +0100
+++ binutils/gas/config/tc-mips.c 2017-08-25 13:28:53.462717322 +0100
@@ -18630,7 +18630,8 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNU
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)
Index: binutils/gas/testsuite/gas/mips/branch-local-5.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-5.d 2017-08-25 13:28:58.000000000 +0100
@@ -0,0 +1,3 @@
+#name: MIPS branch local symbol relocation 5
+#as: -32
+#error-output: branch-local-5.l
Index: binutils/gas/testsuite/gas/mips/branch-local-5.l
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-5.l 2017-08-25 13:28:58.000000000 +0100
@@ -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
Index: binutils/gas/testsuite/gas/mips/branch-local-5.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-5.s 2017-08-25 13:28:58.000000000 +0100
@@ -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
Index: binutils/gas/testsuite/gas/mips/branch-local-6.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-6.d 2017-08-25 13:28:58.000000000 +0100
@@ -0,0 +1,3 @@
+#name: MIPS branch local symbol relocation 6
+#as: -32
+#error-output: branch-local-6.l
Index: binutils/gas/testsuite/gas/mips/branch-local-6.l
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-6.l 2017-08-25 13:28:58.000000000 +0100
@@ -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
Index: binutils/gas/testsuite/gas/mips/branch-local-6.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-6.s 2017-08-25 13:28:58.000000000 +0100
@@ -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
Index: binutils/gas/testsuite/gas/mips/branch-local-7.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-7.d 2017-08-25 13:28:58.000000000 +0100
@@ -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
+ \.\.\.
Index: binutils/gas/testsuite/gas/mips/branch-local-7.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-7.s 2017-08-25 13:28:58.000000000 +0100
@@ -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
Index: binutils/gas/testsuite/gas/mips/branch-local-ignore-5.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-ignore-5.d 2017-08-25 13:28:58.000000000 +0100
@@ -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
+ \.\.\.
Index: binutils/gas/testsuite/gas/mips/branch-local-ignore-6.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-ignore-6.d 2017-08-25 13:28:58.000000000 +0100
@@ -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
+ \.\.\.
Index: binutils/gas/testsuite/gas/mips/branch-local-ignore-n32-5.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-ignore-n32-5.d 2017-08-25 13:28:58.000000000 +0100
@@ -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
Index: binutils/gas/testsuite/gas/mips/branch-local-ignore-n32-6.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-ignore-n32-6.d 2017-08-25 13:28:58.000000000 +0100
@@ -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
+ \.\.\.
Index: binutils/gas/testsuite/gas/mips/branch-local-ignore-n64-5.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-ignore-n64-5.d 2017-08-25 13:28:59.000000000 +0100
@@ -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
Index: binutils/gas/testsuite/gas/mips/branch-local-ignore-n64-6.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-ignore-n64-6.d 2017-08-25 13:28:59.000000000 +0100
@@ -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
+ \.\.\.
Index: binutils/gas/testsuite/gas/mips/branch-local-n32-5.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-n32-5.d 2017-08-25 13:28:59.000000000 +0100
@@ -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
Index: binutils/gas/testsuite/gas/mips/branch-local-n32-6.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-n32-6.d 2017-08-25 13:28:59.000000000 +0100
@@ -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
Index: binutils/gas/testsuite/gas/mips/branch-local-n32-7.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-n32-7.d 2017-08-25 13:28:59.000000000 +0100
@@ -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
+ \.\.\.
Index: binutils/gas/testsuite/gas/mips/branch-local-n64-5.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-n64-5.d 2017-08-25 13:28:59.000000000 +0100
@@ -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
Index: binutils/gas/testsuite/gas/mips/branch-local-n64-6.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-n64-6.d 2017-08-25 13:28:59.000000000 +0100
@@ -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
Index: binutils/gas/testsuite/gas/mips/branch-local-n64-7.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/branch-local-n64-7.d 2017-08-25 13:28:59.000000000 +0100
@@ -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: binutils/gas/testsuite/gas/mips/mips.exp
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/mips.exp 2017-08-25 13:28:42.068646200 +0100
+++ binutils/gas/testsuite/gas/mips/mips.exp 2017-08-25 13:28:59.000000000 +0100
@@ -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 {