[RFA/ARM] Stop gas from accepting invalid CPU/Architecture names

Matthew Gretton-Dann matthew.gretton-dann@arm.com
Wed Nov 30 17:30:00 GMT 2011


All,

The attached patch stops gas (when targeted at an ARM target) from 
accepting invalid CPU and architecture names in certain circumstances. 
For example: gas currently accepts -mcpu=cortex as a valid CPU option.

I have tested this for arm-none-eabi.

Can someone please review.

Thanks,

Matt

gas/ChangeLog:
2011-11-30  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>

	* config/tc-arm.c (arm_cpu_option_table): Add name_len field.
	(arm_arch_option_table): Likewise.
	(arm_option_extension_value_table): Likewise.
	(ARM_CPU_OPT): New define.
	(ARM_ARCH_OPT): Likewise.
	(ARM_EXT_OPT): Likewise.
	(arm_cpus): Use ARM_CPU_OPT to initialize.
	(arm_archs): Use ARM_ARCH_OPT to initialize.
	(arm_extensions): Use ARM_EXT_OPT to initialize.
	(arm_parse_extension): Ensure option string matching matches
	the whole string.
	(arm_parse_cpu): Likewise.
	(arm_parse_arch): Likewise.

gas/testsuite/ChangeLog:

2011-11-30  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>

	* gas/arm/cmdline-bad-arch.d: New test case.
	* gas/arm/cmdline-bad-cpu.d: Likewise.


-- 
Matthew Gretton-Dann
Principal Engineer, PD Software - Tools, ARM Ltd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-accepting-incorrect-command-lines.patch
Type: text/x-patch
Size: 26171 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20111130/d7c9ec83/attachment.bin>


More information about the Binutils mailing list