diff options
Diffstat (limited to 'gas/config/tc-mips.c')
-rw-r--r-- | gas/config/tc-mips.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 1487e73..e24e84d 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -943,6 +943,11 @@ static bfd_boolean mips_fix_cn63xxp1; efficient expansion. */ static int mips_relax_branch; + +/* TRUE if checks are suppressed for invalid branches between ISA modes. + Needed for broken assembly produced by some GCC versions and some + sloppy code out there, where branches to data labels are present. */ +static bfd_boolean mips_ignore_branch_isa; /* The expansion of many macros depends on the type of symbol that they refer to. For example, when generating position-dependent code, @@ -1465,6 +1470,8 @@ enum options OPTION_GP64, OPTION_RELAX_BRANCH, OPTION_NO_RELAX_BRANCH, + OPTION_IGNORE_BRANCH_ISA, + OPTION_NO_IGNORE_BRANCH_ISA, OPTION_INSN32, OPTION_NO_INSN32, OPTION_MSHARED, @@ -1591,6 +1598,8 @@ struct option md_longopts[] = {"mgp64", no_argument, NULL, OPTION_GP64}, {"relax-branch", no_argument, NULL, OPTION_RELAX_BRANCH}, {"no-relax-branch", no_argument, NULL, OPTION_NO_RELAX_BRANCH}, + {"mignore-branch-isa", no_argument, NULL, OPTION_IGNORE_BRANCH_ISA}, + {"mno-ignore-branch-isa", no_argument, NULL, OPTION_NO_IGNORE_BRANCH_ISA}, {"minsn32", no_argument, NULL, OPTION_INSN32}, {"mno-insn32", no_argument, NULL, OPTION_NO_INSN32}, {"mshared", no_argument, NULL, OPTION_MSHARED}, @@ -14499,6 +14508,14 @@ md_parse_option (int c, const char *arg) mips_relax_branch = 0; break; + case OPTION_IGNORE_BRANCH_ISA: + mips_ignore_branch_isa = TRUE; + break; + + case OPTION_NO_IGNORE_BRANCH_ISA: + mips_ignore_branch_isa = FALSE; + break; + case OPTION_INSN32: file_mips_opts.insn32 = TRUE; break; @@ -15133,6 +15150,9 @@ fix_bad_cross_mode_branch_p (fixS *fixP) int other; char *buf; + if (mips_ignore_branch_isa) + return FALSE; + if (!fixP->fx_addsy || S_FORCE_RELOC (fixP->fx_addsy, TRUE)) return FALSE; @@ -19662,6 +19682,8 @@ MIPS options:\n\ -mdouble-float allow 32-bit and 64-bit floating-point operations\n\ --[no-]construct-floats [dis]allow floating point values to be constructed\n\ --[no-]relax-branch [dis]allow out-of-range branches to be relaxed\n\ +-mignore-branch-isa accept invalid branches requiring an ISA mode switch\n\ +-mno-ignore-branch-isa reject invalid branches requiring an ISA mode switch\n\ -mnan=ENCODING select an IEEE 754 NaN encoding convention, either of:\n")); first = 1; |