From 37b2d327512baf2f39020e44958fd1f11db46a91 Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Wed, 30 Aug 2017 15:54:19 +0100 Subject: [PATCH] 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. --- gas/ChangeLog | 26 ++++++++++ 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 ++++++ 23 files changed, 411 insertions(+), 1 deletion(-) create mode 100644 gas/testsuite/gas/mips/branch-local-5.d create mode 100644 gas/testsuite/gas/mips/branch-local-5.l create mode 100644 gas/testsuite/gas/mips/branch-local-5.s create mode 100644 gas/testsuite/gas/mips/branch-local-6.d create mode 100644 gas/testsuite/gas/mips/branch-local-6.l create mode 100644 gas/testsuite/gas/mips/branch-local-6.s create mode 100644 gas/testsuite/gas/mips/branch-local-7.d create mode 100644 gas/testsuite/gas/mips/branch-local-7.s create mode 100644 gas/testsuite/gas/mips/branch-local-ignore-5.d create mode 100644 gas/testsuite/gas/mips/branch-local-ignore-6.d create mode 100644 gas/testsuite/gas/mips/branch-local-ignore-n32-5.d create mode 100644 gas/testsuite/gas/mips/branch-local-ignore-n32-6.d create mode 100644 gas/testsuite/gas/mips/branch-local-ignore-n64-5.d create mode 100644 gas/testsuite/gas/mips/branch-local-ignore-n64-6.d create mode 100644 gas/testsuite/gas/mips/branch-local-n32-5.d create mode 100644 gas/testsuite/gas/mips/branch-local-n32-6.d create mode 100644 gas/testsuite/gas/mips/branch-local-n32-7.d create mode 100644 gas/testsuite/gas/mips/branch-local-n64-5.d create mode 100644 gas/testsuite/gas/mips/branch-local-n64-6.d create mode 100644 gas/testsuite/gas/mips/branch-local-n64-7.d diff --git a/gas/ChangeLog b/gas/ChangeLog index 2e60e29..a71ed28 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,31 @@ 2017-08-30 Maciej W. Rozycki + * 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 + * testsuite/gas/mips/branch-local-n32-2.d: Use `branch-local-2.l' for `error-output'. * testsuite/gas/mips/branch-local-n64-2.d: Likewise. diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 3804df2..43a7033 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -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 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 +[ ]*[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 +[0-9a-f]+ <[^>]*> e80f not s0 +[0-9a-f]+ <[^>]*> 22f4 beqz v0,0+001000 +[0-9a-f]+ <[^>]*> e80f not s0 +[0-9a-f]+ <[^>]*> 60f2 bteqz 0+001000 +[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 +[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 foo +[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero +[0-9a-f]+ <[^>]*> cfff b 0000101c +[ ]*[0-9a-f]+: R_MICROMIPS_PC10_S1 foo +[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero +[0-9a-f]+ <[^>]*> 8d7f beqz v0,00001022 +[ ]*[0-9a-f]+: R_MICROMIPS_PC7_S1 foo +[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero +[0-9a-f]+ <[^>]*> 4062 fffe bgezal v0,00001028 +[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 foo +[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero +[0-9a-f]+ <[^>]*> 4262 fffe bgezals v0,00001030 +[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 foo +[0-9a-f]+ <[^>]*> 4400 not s0,s0 +[0-9a-f]+ <[^>]*> 4022 fffe bltzal v0,00001036 +[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 foo +[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero +[0-9a-f]+ <[^>]*> 4222 fffe bltzals v0,0000103e +[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 foo +[0-9a-f]+ <[^>]*> 4400 not s0,s0 +[0-9a-f]+ <[^>]*> 4260 fffe bals 00001044 +[ ]*[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 +[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc +[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero +[0-9a-f]+ <[^>]*> cc00 b 0000101e +[ ]*[0-9a-f]+: R_MICROMIPS_PC10_S1 \.text\+0xffe +[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero +[0-9a-f]+ <[^>]*> 8d00 beqz v0,00001024 +[ ]*[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 +[ ]*[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 +[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc +[0-9a-f]+ <[^>]*> 4400 not s0,s0 +[0-9a-f]+ <[^>]*> 4022 0000 bltzal v0,0000103a +[ ]*[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 +[ ]*[0-9a-f]+: R_MICROMIPS_PC16_S1 \.text\+0xffc +[0-9a-f]+ <[^>]*> 4400 not s0,s0 +[0-9a-f]+ <[^>]*> 4260 0000 bals 00001048 +[ ]*[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 +[ ]*[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 +[ ]*[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 +[ ]*[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 +[ ]*[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 +[ ]*[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 +[ ]*[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 +[ ]*[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 +[ ]*[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 +[ ]*[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 +[ ]*[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 0ea9f61..e67473b 100644 --- a/gas/testsuite/gas/mips/mips.exp +++ b/gas/testsuite/gas/mips/mips.exp @@ -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 { -- 2.7.4