+2016-04-09 Maciej W. Rozycki <macro@imgtec.com>
+
+ * config/tc-mips.c (s_option): Reject `.option picX' if VxWorks
+ PIC.
+ * testsuite/gas/mips/option-pic-vxworks-1.l: New list test.
+ * testsuite/gas/mips/option-pic-vxworks-2.l: New list test.
+ * testsuite/gas/mips/option-pic-vxworks-1.s: New test source.
+ * testsuite/gas/mips/option-pic-vxworks-2.s: New test source.
+ * testsuite/gas/mips/mips.exp: Run the new tests.
+
2016-04-09 Maciej W. Rozycki <macro@imgtec.com>
* config/tc-mips.c (can_swap_branch_p): Correct call formatting.
int i;
i = atoi (opt + 3);
- if (i == 0)
+ if (i != 0 && i != 2)
+ as_bad (_(".option pic%d not supported"), i);
+ else if (mips_pic == VXWORKS_PIC)
+ as_bad (_(".option pic%d not supported in VxWorks PIC mode"), i);
+ else if (i == 0)
mips_pic = NO_PIC;
else if (i == 2)
{
mips_pic = SVR4_PIC;
mips_abicalls = TRUE;
}
- else
- as_bad (_(".option pic%d not supported"), i);
if (mips_pic == SVR4_PIC)
{
run_dump_test "vxworks1-xgot"
run_dump_test "vxworks1-el"
run_dump_test "vxworks1-xgot-el"
+
+ run_list_test "option-pic-vxworks-1" "-mvxworks-pic" \
+ "MIPS invalid PIC option in VxWorks PIC"
+ run_list_test "option-pic-vxworks-2" "-mvxworks-pic" \
+ "MIPS invalid switch to SVR4 PIC from VxWorks PIC"
} elseif { [istarget mips*-*-*] } {
set addr32 [expr [istarget mipstx39*-*-*] || [istarget mips-*-linux*] || [istarget mipsel-*-linux*] \
|| [istarget mipsisa32-*-linux*] || [istarget mipsisa32el-*-linux*]]
run_dump_test "li-d"
+ run_list_test "option-pic-vxworks-1" "-mvxworks-pic" \
+ "MIPS invalid PIC option in VxWorks PIC"
+ run_list_test "option-pic-vxworks-2" "-mvxworks-pic" \
+ "MIPS invalid switch to SVR4 PIC from VxWorks PIC"
+
run_dump_test_arches "r6" [mips_arch_list_matching mips32r6]
if $has_newabi {
run_dump_test_arches "r6-n32" [mips_arch_list_matching mips64r6]
--- /dev/null
+.*: Assembler messages:
+.*:1: Error: \.option pic1 not supported
+.*:2: Error: \.option pic3 not supported
--- /dev/null
+ .option pic1
+ .option pic3
--- /dev/null
+.*: Assembler messages:
+.*:1: Error: \.option pic0 not supported in VxWorks PIC mode
+.*:2: Error: \.option pic2 not supported in VxWorks PIC mode
--- /dev/null
+ .option pic0
+ .option pic2