binutils-gdb/binutils/testsuite/binutils-all
Maciej W. Rozycki 9785fc2a4d MIPS: Fix XPA base and Virtualization ASE instruction handling
Correct a commit 7d64c587c1 ("Add support for the MIPS eXtended
Physical Address (XPA) ASE.") bug, causing XPA base and Virtualization
ASE instructions to be wrongly always enabled with the selection of the
MIPS32r2 or higher ISA.

For example this source assembles successfully as shown below:

$ cat xpa.s
	mfhc0	$2, $1
$ as -32 -mips32 -o xpa.o xpa.s
xpa.s: Assembler messages:
xpa.s:1: Error: opcode not supported on this processor: mips32 (mips32) `mfhc0 $2,$1'
$ as -32 -mips32r2 -o xpa.o xpa.s
$ objdump -d xpa.o

xpa.o:     file format elf32-tradbigmips

Disassembly of section .text:

00000000 <.text>:
   0:	40420800 	mfhc0	v0,c0_random
	...
$

To address this issue remove the I33 (INSN_ISA32R2) marking from all XPA
instructions in the opcode table.  Additionally, for XPA Virtualization
ASE instructions implement an XPAVZ (ASE_XPA_VIRT) combination ASE flag
and use it in place of IVIRT|XPA (ASE_VIRT|ASE_XPA).

Now the same source is correctly rejected unless the `-mxpa' option is
also used:

$ as -32 -mips32r2 -o xpa.o xpa.s
xpa.s: Assembler messages:
xpa.s:1: Error: opcode not supported on this processor: mips32r2 (mips32r2) `mfhc0 $2,$1'
$ as -32 -mips32r2 -mxpa -o xpa.o xpa.s
$

Add test cases for XPA base and XPA Virtualization ASE instructions.

Parts of this change by Andrew Bennett.

	include/
	* opcode/mips.h (ASE_XPA_VIRT): New macro.

	opcodes/
	* mips-dis.c (mips_calculate_combination_ases): Handle the
	ASE_XPA_VIRT flag.
	(parse_mips_ase_option): New function.
	(parse_mips_dis_option): Factor out ASE option handling to the
	new function.  Call `mips_calculate_combination_ases'.
	* mips-opc.c (XPAVZ): New macro.
	(mips_builtin_opcodes): Correct ISA and ASE flags for "mfhc0",
	"mfhgc0", "mthc0" and "mthgc0".

	gas/
	* config/tc-mips.c (mips_set_ase): Handle the ASE_XPA_VIRT flag.
	* testsuite/gas/mips/xpa.d: Remove `xpa' from `-M' in `objdump'
	flags.  Add `-mvirt' to `as' flags.
	* testsuite/gas/mips/xpa-err.d: New test.
	* testsuite/gas/mips/xpa-virt-err.d: New test.
	* testsuite/gas/mips/xpa-err.l: New stderr output.
	* testsuite/gas/mips/xpa-virt-err.l: New stderr output.
	* testsuite/gas/mips/xpa-err.s: New test source.
	* testsuite/gas/mips/xpa-virt-err.s: New test source.
	* testsuite/gas/mips/mips.exp: Run the new tests.

	binutils/
	* testsuite/binutils-all/mips/mips-xpa-virt-1.d: New test.
	* testsuite/binutils-all/mips/mips-xpa-virt-2.d: New test.
	* testsuite/binutils-all/mips/mips-xpa-virt-3.d: New test.
	* testsuite/binutils-all/mips/mips-xpa-virt-4.d: New test.
	* testsuite/binutils-all/mips/mips-xpa-virt.s: New test source.
	* testsuite/binutils-all/mips/mips.exp: Run the new tests.
2017-06-30 07:21:55 +01:00
..
aarch64 Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
arc [ARC] Fix handling of cpu=... disassembler option value 2017-06-29 14:49:39 +03:00
arm Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
bfin Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
hppa Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
i386 x86: Support Intel Shadow Stack with SHSTK property 2017-06-22 05:50:31 -07:00
m68k Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
mips MIPS: Fix XPA base and Virtualization ASE instruction handling 2017-06-30 07:21:55 +01:00
vax Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
wasm32 Fix minor problems with previous wasm32 binutils commit. 2017-03-31 13:07:01 +01:00
windres Stop the (optional) dialong control data from being aligned when parsing/writing windows resource files. 2017-01-18 11:40:06 +00:00
x86-64 x86: Support Intel Shadow Stack with SHSTK property 2017-06-22 05:50:31 -07:00
add-empty-section.d
add-section.d
add-symbol.d Run add-symbol test on mips 2015-10-22 12:49:17 +10:30
alias-2.def
alias.def
ar.exp Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
bintest.s
common-1.s Properly implement STT_COMMON 2016-02-26 05:01:34 -08:00
common-1a.d Properly implement STT_COMMON 2016-02-26 05:01:34 -08:00
common-1b.d Properly implement STT_COMMON 2016-02-26 05:01:34 -08:00
common-1c.d Properly implement STT_COMMON 2016-02-26 05:01:34 -08:00
common-1d.d Properly implement STT_COMMON 2016-02-26 05:01:34 -08:00
common-1e.d Properly implement STT_COMMON 2016-02-26 05:01:34 -08:00
common-1f.d Properly implement STT_COMMON 2016-02-26 05:01:34 -08:00
common-2.s Properly implement STT_COMMON 2016-02-26 05:01:34 -08:00
common-2a.d Properly implement STT_COMMON 2016-02-26 05:01:34 -08:00
common-2b.d Properly implement STT_COMMON 2016-02-26 05:01:34 -08:00
common-2c.d Properly implement STT_COMMON 2016-02-26 05:01:34 -08:00
common-2d.d Properly implement STT_COMMON 2016-02-26 05:01:34 -08:00
common-2e.d Properly implement STT_COMMON 2016-02-26 05:01:34 -08:00
common-2f.d Properly implement STT_COMMON 2016-02-26 05:01:34 -08:00
compress.exp Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
copy-1.d
copy-1.s
copy-2.d
copy-3.d Fix various binutils testsuite failures. 2016-06-22 14:42:26 +01:00
copy-4.d Fix various binutils testsuite failures. 2016-06-22 14:42:26 +01:00
copytest.s
data-sections.s objcopy/strip: Allow section patterns starting with '!'. 2016-07-14 11:32:48 +01:00
debug_str.d Fixes a problem with the BFD library running out of memory because it mistakenly 2014-04-30 17:04:04 +01:00
debug_str.s Fixes a problem with the BFD library running out of memory because it mistakenly 2014-04-30 17:04:04 +01:00
dlltool.exp Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
dumptest.s
dw2-1.S Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
dw2-1.W Don't change compressed input debug section names 2015-04-23 07:59:59 -07:00
dw2-2.S Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
dw2-3.rS Add SHF_COMPRESSED support to gas and objcopy 2015-04-08 07:54:09 -07:00
dw2-3.rt Add SHF_COMPRESSED support to gas and objcopy 2015-04-08 07:54:09 -07:00
dw2-3.S Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
dw2-3.W Updated to accept .debug_* sections 2015-07-10 08:14:59 -07:00
dw2-3gabi.W Don't change compressed input debug section names 2015-04-23 07:59:59 -07:00
dw2-compressed.S Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
dw2-decodedline-1.S Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
dw2-decodedline.S
dw2-empty.S
dw2-ranges.S Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
dw2-ranges.W objdump: Handle 32-bit base address in debug_ranges / debug_loc. 2015-11-30 13:28:26 +00:00
dw5.S Fixes for new dw5 test 2017-02-25 19:13:23 +10:30
dw5.W DWARF-5: testcase 2017-02-23 22:58:45 +01:00
elfedit-1.d Also skip x86_64-*-nacl* 2015-05-12 12:47:27 -07:00
elfedit-2.d
elfedit-3.d
elfedit-4.d
elfedit-5.d Add EM_386/EM_IAMCU support to elfedit.c 2015-05-11 09:57:21 -07:00
elfedit.exp Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
empty Allow zero length archive elements. 2016-03-07 17:29:25 +00:00
empty-file
empty.s
exclude-1.s
exclude-1a.d
exclude-1b.d
fastcall.def
group-2.s
group-3.s
group-4.s
group-5.d
group-5.s
group-6.d
group-6.s
group.s
libdw2-compressed.out Add a dw2-3.S test 2015-04-04 07:34:25 -07:00
libdw2-compressedgabi.out Don't add the zlib header to SHF_COMPRESSED section 2015-05-14 16:02:08 -07:00
libdw2.out Add a dw2-3.S test 2015-04-04 07:34:25 -07:00
link-order.s
localize-hidden-1.d Fix the evaluation of RL78 complex relocs, by making immediate values be computed relative to a new absolute symbol. 2015-07-24 16:44:27 +01:00
localize-hidden-1.s
localize-hidden-2.d
localize-hidden-2.s
mbind1.s Support ELF SHF_GNU_MBIND and PT_GNU_MBIND_XXX 2017-04-04 09:06:04 -07:00
needed-by-reloc.s
nm-1.s
nm-elf-1.s
nm-ver.s Add the ability for nm to display symbol version information. 2016-11-11 11:49:45 +00:00
nm.exp Add support for the WebAssembly file format and the wasm32 ELF conversion to gas and the binutils. 2017-03-30 10:57:21 +01:00
note-1.d
note-2-32.d Try harder to find the correct symbol to associate with OPEN GNU BUILD notes. 2017-03-14 12:57:09 +00:00
note-2-32.s Improve decoding of corrupt/unrecognised gnu build attribute notes. 2017-04-26 14:23:26 +01:00
note-2-64.d Try harder to find the correct symbol to associate with OPEN GNU BUILD notes. 2017-03-14 12:57:09 +00:00
note-2-64.s Improve decoding of corrupt/unrecognised gnu build attribute notes. 2017-04-26 14:23:26 +01:00
objcopy.exp Support ELF SHF_GNU_MBIND and PT_GNU_MBIND_XXX 2017-04-04 09:06:04 -07:00
objdump.exp Add bfd_get_file_size to get archive element size 2017-05-30 06:34:40 -07:00
objdump.s
objdump.W Don't change compressed input debug section names 2015-04-23 07:59:59 -07:00
objdump.WL
only-section-01.d objcopy/strip: Allow section patterns starting with '!'. 2016-07-14 11:32:48 +01:00
pr18374.s Fix PR18374 by making readelf and objdump ignore end-of-list markers in the .debug_loc section if there are relocations against them. 2015-05-15 11:24:33 +01:00
pr19020.in Don't use the output section size to copy input section 2015-09-29 13:31:57 -07:00
pr19020a.d Don't use the output section size to copy input section 2015-09-29 13:31:57 -07:00
pr19020b.d Don't use the output section size to copy input section 2015-09-29 13:31:57 -07:00
pr19547.c Clear HAS_RELOC if there are no relocations 2016-02-02 03:30:48 -08:00
readelf.exp Fixes for new dw5 test 2017-02-25 19:13:23 +10:30
readelf.h
readelf.n Display unknown notes. Decode NT_GNU_HWCAP notes. 2016-10-17 15:29:43 +01:00
readelf.pr18374 Fix PR18374 by making readelf and objdump ignore end-of-list markers in the .debug_loc section if there are relocations against them. 2015-05-15 11:24:33 +01:00
readelf.r Fix various binutils testsuite failures. 2016-06-22 14:42:26 +01:00
readelf.r-64
readelf.s Place .shstrtab section after .symtab and .strtab, thus restoring monotonically increasing section offsets. 2016-08-19 09:16:30 +01:00
readelf.s-64 Place .shstrtab section after .symtab and .strtab, thus restoring monotonically increasing section offsets. 2016-08-19 09:16:30 +01:00
readelf.ss readelf -s test: Skip extra symbols produced by MSP430 assembler. 2014-03-17 11:00:32 +00:00
readelf.ss-64 Fix the binutils readelf.ss test for the AArch64 target. 2015-04-02 15:28:02 +01:00
readelf.ss-mips MIPS testsuite cleanup - part 1 2014-09-06 17:58:37 +01:00
readelf.ss-tmips [MIPS] Implement O32 FPXX, FP64 and FP64A ABI extensions 2014-07-29 11:27:59 +01:00
readelf.wa
readelf.z Add --decompress option to readelf to decompress sections before they are dumped. 2015-05-15 17:16:31 +01:00
remove-relocs-01.d objcopy/strip: Add option --remove-relocations=SECTIONPATTERN 2016-07-14 11:34:10 +01:00
remove-relocs-01.s Use address sized relocs in remove-relocs-01.s 2016-07-15 17:02:20 +09:30
remove-relocs-02.d objcopy/strip: Add option --remove-relocations=SECTIONPATTERN 2016-07-14 11:34:10 +01:00
remove-relocs-03.d objcopy/strip: Add option --remove-relocations=SECTIONPATTERN 2016-07-14 11:34:10 +01:00
remove-relocs-04.d objcopy/strip: Add option --remove-relocations=SECTIONPATTERN 2016-07-14 11:34:10 +01:00
remove-relocs-05.d objcopy/strip: Add option --remove-relocations=SECTIONPATTERN 2016-07-14 11:34:10 +01:00
remove-relocs-06.d objcopy/strip: Add option --remove-relocations=SECTIONPATTERN 2016-07-14 11:34:10 +01:00
remove-section-01.d objcopy/strip: Allow section patterns starting with '!'. 2016-07-14 11:32:48 +01:00
size.exp Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
strip-1.d
strip-2.d
strip-3.d [ARC] Object attributes. 2017-05-10 14:42:22 +02:00
strip-4.d
strip-5.d
strip-6.d
strip-7.d
strip-8.d
strip-9.d
strip-10.d
strip-11.d Fix the evaluation of RL78 complex relocs, by making immediate values be computed relative to a new absolute symbol. 2015-07-24 16:44:27 +01:00
strip-12.d Tweak binutils testsuite 2015-08-11 23:29:36 +09:30
strip-12.s Tweak binutils testsuite 2015-08-11 23:29:36 +09:30
symbols-1.d Tweak binutils testsuite 2015-08-11 23:29:36 +09:30
symbols-2.d Tweak binutils testsuite 2015-08-11 23:29:36 +09:30
symbols-3.d Tweak binutils testsuite 2015-08-11 23:29:36 +09:30
symbols-4.d Tweak binutils testsuite 2015-08-11 23:29:36 +09:30
symbols.s objcopy: Improve wildcard matching for symbols with '!' prefix. 2015-08-07 11:41:40 +02:00
testprog.c Fix copying Solaris binaries with objcopy. 2016-04-14 12:04:09 +01:00
testranges-ia64.d
testranges-ia64.s
testranges.d
testranges.s
unique.s
unknown.s
update-1.s objcopy: Add --update-section option. 2015-02-28 21:25:51 +00:00
update-2.s objcopy: Add --update-section option. 2015-02-28 21:25:51 +00:00
update-3.s objcopy: Add --update-section option. 2015-02-28 21:25:51 +00:00
update-4.s objcopy: Add --update-section option. 2015-02-28 21:25:51 +00:00
update-section.exp Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
version.def
version.s
z.s Add --decompress option to readelf to decompress sections before they are dumped. 2015-05-15 17:16:31 +01:00