binutils-gdb/gas/config
Andrew Burgess bb65a718b6 gas/arc: Don't rely on bfd list of cpu type for cpu selection
In the ARC assembler, when a cpu type is specified using the .cpu
directive, we rely on the bfd list of arc machine types in order to
validate the cpu name passed in.

This validation is only used in order to check that the cpu type passed
to the .cpu directive matches any machine type selected earlier on the
command line.  Once that initial check has passed a full check is
performed using the assemblers internal list of know cpu types.

The problem is that the assembler knows about more cpu types than bfd,
some cpu types known by the assembler are actually aliases for a base
cpu type plus a specific set of assembler extensions.  One such example
is NPS400, though more could be added later.

This commit removes the need for the assembler to use the bfd list of
machine types for validation.  Instead the error checking, to ensure
that any value passed to a '.cpu' directive matches any earlier command
line selection, is moved into the function arc_select_cpu.

I have taken the opportunity to bundle the 4 separate static globals
that describe the currently selected machine type into a single
structure (called selected_cpu).

gas/ChangeLog:

	* config/tc-arc.c (arc_target): Delete.
	(arc_target_name): Delete.
	(arc_features): Delete.
	(arc_mach_type): Delete.
	(mach_type_specified_p): Delete.
	(enum mach_selection_type): New enum.
	(mach_selection_mode): New static global.
	(selected_cpu): New static global.
	(arc_eflag): Rename to ...
	(arc_initial_eflag): ...this, and make const.
	(arc_select_cpu): Update comment, new parameter, check how
	previous machine type selection was made, and record this
	selection.  Use selected_cpu instead of old globals.
	(arc_option): Remove use of arc_get_mach, instead use
	arc_select_cpu to validate machine type selection.  Use
	selected_cpu over old globals.
	(allocate_tok): Use selected_cpu over old globals.
	(find_opcode_match): Likewise.
	(assemble_tokens): Likewise.
	(arc_cons_fix_new): Likewise.
	(arc_extinsn): Likewise.
	(arc_extcorereg): Likewise.
	(md_begin): Update default machine type selection, use
	selected_cpu over old globals.
	(md_parse_option): Update machine type selection option handling,
	use selected_cpu over old globals.
	* testsuite/gas/arc/nps400-0.s: Add .cpu directive.

bfd/ChangeLog:

	* cpu-arc.c (arc_get_mach): Delete.
2016-10-27 12:28:20 +01:00
..
aout_gnu.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
atof-ieee.c cleanup FLT_CHARS and EXP_CHARS 2016-04-03 19:50:02 -04:00
atof-vax.c Constify more 2016-04-01 23:10:50 +10:30
bfin-aux.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
bfin-defs.h use XNEW and related macros more 2016-05-13 00:35:51 -04:00
bfin-lex-wrapper.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
bfin-lex.l Copyright update for binutils 2016-01-01 23:00:01 +10:30
bfin-parse.y Don't include libbfd.h outside of bfd, part 1 2016-07-16 13:25:11 +09:30
e-crisaout.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
e-criself.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
e-i386aout.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
e-i386coff.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
e-i386elf.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
e-mipself.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
itbl-mips.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
m68k-parse.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
m68k-parse.y Copyright update for binutils 2016-01-01 23:00:01 +10:30
obj-aout.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
obj-aout.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
obj-coff-seh.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
obj-coff-seh.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
obj-coff.c Fix build breakage 2016-05-13 15:58:07 +09:30
obj-coff.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
obj-ecoff.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
obj-ecoff.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
obj-elf.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
obj-elf.h add more const qualifiers 2016-03-28 20:38:24 -04:00
obj-evax.c use XNEW and related macros more 2016-05-13 00:35:51 -04:00
obj-evax.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
obj-fdpicelf.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
obj-fdpicelf.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
obj-macho.c use XNEW and related macros more 2016-05-13 00:35:51 -04:00
obj-macho.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
obj-multi.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
obj-multi.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
obj-som.c Add more const type qualifiers to GAS sources. 2016-02-22 14:11:27 +00:00
obj-som.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
rl78-defs.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
rl78-parse.y Revert "bison warning fixes" 2016-10-26 11:45:50 +10:30
rx-defs.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
rx-parse.y Revert "bison warning fixes" 2016-10-26 11:45:50 +10:30
tc-aarch64.c [AArch64] Print spaces after commas in addresses 2016-09-21 17:11:52 +01:00
tc-aarch64.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-alpha.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-alpha.h Constify more 2016-04-01 23:10:50 +10:30
tc-arc.c gas/arc: Don't rely on bfd list of cpu type for cpu selection 2016-10-27 12:28:20 +01:00
tc-arc.h gas/arc: Make member of arc_flags const 2016-05-18 22:24:51 +01:00
tc-arm.c [GAS][ARM]Generate unpredictable warning for pc used in data processing instructions with register-shifted register operand. 2016-10-19 11:27:35 +01:00
tc-arm.h Remove support for creating ARM NOREAD sections. 2016-02-04 11:57:57 +00:00
tc-avr.c avr: replace sentinal with iteration from 0 to ARRAY_SIZE 2016-06-01 21:22:31 -04:00
tc-avr.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-bfin.c Don't include libbfd.h outside of bfd, part 1 2016-07-16 13:25:11 +09:30
tc-bfin.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-cr16.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-cr16.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-cris.c use XNEW and related macros more 2016-05-13 00:35:51 -04:00
tc-cris.h cleanup FLT_CHARS and EXP_CHARS 2016-04-03 19:50:02 -04:00
tc-crx.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-crx.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-d10v.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-d10v.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-d30v.c d30v: make var type operatorT 2016-05-24 08:55:45 -04:00
tc-d30v.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-dlx.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-dlx.h dlx: move prototype of dlx_set_skip_hi16 to elf/dlx.h 2016-06-27 05:57:32 -04:00
tc-epiphany.c Don't include libbfd.h outside of bfd, part 2 2016-07-16 13:27:30 +09:30
tc-epiphany.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-fr30.c Constify more 2016-04-01 23:10:50 +10:30
tc-fr30.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-frv.c Don't include libbfd.h outside of bfd, part 2 2016-07-16 13:27:30 +09:30
tc-frv.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-ft32.c Fix simple gas testsuite failures. 2016-06-15 16:25:34 +01:00
tc-ft32.h ft32: fixup TARGET_FORMAT 2016-05-24 08:49:46 -04:00
tc-generic.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-generic.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-h8300.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-h8300.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-hppa.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-hppa.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-i370.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-i370.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-i386-intel.c x86/Intel: fix operand checking for MOVSD 2016-07-01 08:56:13 +02:00
tc-i386.c X86: Remove pcommit instruction 2016-10-21 12:16:32 -07:00
tc-i386.h Constify more 2016-04-01 23:10:50 +10:30
tc-i860.c use XNEW and related macros more 2016-04-03 20:43:23 -04:00
tc-i860.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-i960.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-i960.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-ia64.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-ia64.h Constify more 2016-04-01 23:10:50 +10:30
tc-ip2k.c Don't include libbfd.h outside of bfd, part 2 2016-07-16 13:27:30 +09:30
tc-ip2k.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-iq2000.c Don't include libbfd.h outside of bfd, part 2 2016-07-16 13:27:30 +09:30
tc-iq2000.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-lm32.c Constify more 2016-04-01 23:10:50 +10:30
tc-lm32.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-m32c.c Don't include libbfd.h outside of bfd, part 2 2016-07-16 13:27:30 +09:30
tc-m32c.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-m32r.c m32r: make mach_table static and const 2016-05-16 05:06:48 -04:00
tc-m32r.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-m68hc11.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-m68hc11.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-m68k.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-m68k.h Convert more variables to a constant form. 2016-02-25 16:55:21 +00:00
tc-m68851.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-mcore.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-mcore.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-mep.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-mep.h Constify more 2016-04-01 23:10:50 +10:30
tc-metag.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-metag.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-microblaze.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-microblaze.h Constify more 2016-04-01 23:10:50 +10:30
tc-mips.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-mips.h MIPS/GAS: Don't convert PC-relative REL relocs against absolute symbols 2016-07-14 20:11:03 +01:00
tc-mmix.c mmix: constify handler_charp 2016-05-24 08:52:45 -04:00
tc-mmix.h cleanup FLT_CHARS and EXP_CHARS 2016-04-03 19:50:02 -04:00
tc-mn10200.c Fix simple gas testsuite failures. 2016-06-15 16:25:34 +01:00
tc-mn10200.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-mn10300.c stop defining linkrelax in multiple places 2016-05-16 05:01:52 -04:00
tc-mn10300.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-moxie.c Fix simple gas testsuite failures. 2016-06-15 16:25:34 +01:00
tc-moxie.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-msp430.c stop defining linkrelax in multiple places 2016-05-16 05:01:52 -04:00
tc-msp430.h msp430: Set DWARF2_ADDR_SIZE to 4. 2016-02-03 09:21:51 -07:00
tc-mt.c -Wimplicit-fallthrough error fixes 2016-10-06 09:39:56 +10:30
tc-mt.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-nds32.c -Wimplicit-fallthrough error fixes 2016-10-06 09:39:56 +10:30
tc-nds32.h make md_parse_option () take a const char * 2016-03-29 07:43:25 -04:00
tc-nios2.c Don't include libbfd.h outside of bfd, part 2 2016-07-16 13:27:30 +09:30
tc-nios2.h Constify more 2016-04-01 23:10:50 +10:30
tc-ns32k.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-ns32k.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-or1k.c use XNEW and related macros more 2016-04-03 20:43:23 -04:00
tc-or1k.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-pdp11.c use XNEW and related macros more 2016-04-03 20:43:23 -04:00
tc-pdp11.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-pj.c Fix simple gas testsuite failures. 2016-06-15 16:25:34 +01:00
tc-pj.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-ppc.c Disallow 3-operand cmp[l][i] for ppc64 2016-09-29 15:12:47 +09:30
tc-ppc.h Convert more variables to a constant form. 2016-02-25 16:55:21 +00:00
tc-rl78.c Don't include libbfd.h outside of bfd, part 1 2016-07-16 13:25:11 +09:30
tc-rl78.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-rx.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-rx.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-s390.c -Wimplicit-fallthrough error fixes 2016-10-06 09:39:56 +10:30
tc-s390.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-score7.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-score.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-score.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-sh64.c sh{,64}: make arg type enum 2016-06-05 23:27:41 -04:00
tc-sh64.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-sh.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-sh.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-sparc.c gas: improve architecture mismatch diagnostics in sparc 2016-09-14 07:15:24 -07:00
tc-sparc.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-spu.c spu: make some constants unsigned 2016-05-23 01:20:09 -04:00
tc-spu.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-tic4x.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-tic4x.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-tic6x.c use XNEW and related macros more 2016-05-13 00:35:51 -04:00
tc-tic6x.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-tic30.c use xstrdup, xmemdup0 and concat more 2016-05-13 00:35:51 -04:00
tc-tic30.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-tic54x.c simplify tic54x_set_default_include () 2016-06-25 11:52:29 -04:00
tc-tic54x.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-tilegx.c use XNEW and related macros more 2016-05-13 00:35:51 -04:00
tc-tilegx.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-tilepro.c use XNEW and related macros more 2016-05-13 00:35:51 -04:00
tc-tilepro.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-v850.c Change type of v850_target_arch to enum bfd_architecture 2016-05-18 06:09:44 -04:00
tc-v850.h Change type of v850_target_arch to enum bfd_architecture 2016-05-18 06:09:44 -04:00
tc-vax.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-vax.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-visium.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-visium.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-xc16x.c use XNEW and related macros more 2016-04-03 20:43:23 -04:00
tc-xc16x.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-xgate.c Ensure ARM VPUSH and VPOP instructions do not affect more than 16 registers. 2016-08-05 11:26:13 +01:00
tc-xgate.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-xstormy16.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-xstormy16.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-xtensa.c tc-xtensa.c: fixup xg_reverse_shift_count typo 2016-09-26 12:55:56 -04:00
tc-xtensa.h make xtensa_section_rename () take const char * 2016-03-31 07:30:41 -04:00
tc-z8k.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-z8k.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tc-z80.c -Wimplicit-fallthrough warning fixes 2016-10-06 10:13:15 +10:30
tc-z80.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-386bsd.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-aix5.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-aix.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-armeabi.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-armfbsdeabi.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-armfbsdvfp.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-armlinuxeabi.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-dragonfly.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-dynix.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-epoc-pe.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-freebsd.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-generic.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-gnu.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-go32.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-hppa64.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-hppa.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-hppalinux64.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-hpux.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-i386aix.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-ia64aix.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-interix.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-irix.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-linux.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-lynx.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-mach.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-macos.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-nacl.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-nbsd532.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-nbsd.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-netware.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-pc532mach.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-pe.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-pep.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-psos.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-riscix.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-solaris.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-sparcaout.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-sun3.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-svr4.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-symbian.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-tmips.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-uclinux.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-vms.c Remove use of alloca. 2016-03-21 16:31:46 +00:00
te-vms.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-vxworks.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
te-wince-pe.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
vax-inst.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
xtensa-istack.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
xtensa-relax.c use XNEW and related macros more 2016-05-13 00:35:51 -04:00
xtensa-relax.h xtensa: typedef enums when defining them 2016-06-01 21:19:53 -04:00