Commit Graph

8746 Commits

Author SHA1 Message Date
Nick Clifton 375cd4233d Updated translations for various binutils subdirectories. 2019-01-21 12:59:20 +00:00
Nick Clifton f48dfe417e Change version to 2.32.51 and regenerate configure and pot files. 2019-01-19 16:51:42 +00:00
Nick Clifton f974f26cb1 Add markers for 2.32 branch to NEWS and ChangeLog files. 2019-01-19 15:55:50 +00:00
Tamar Christina dee3ee2224 Arm: Clean up PE GAS testsuite correct THUMB tests.
The PE targets don't support mapping symbols and so the disassembler is unable
to correctly output thumb instructions when the input was thumb.

So for testcases that only have thumb output, I have copied them and skipped the
ones for which auto-detection is supposed to work on PE, and added a new one
that will force thumb output.  This so that the tests still check the mapping
symbols.

For the tests that switch between thumb and arm in one file I just skip them
entirely on PE targets.

This cleans up the PE GAS testsuite.

gas/

	* testsuite/gas/arm/archv6t2-1-pe.d: New test.
	* testsuite/gas/arm/archv6t2-1.d: Skip pe.
	* testsuite/gas/arm/csdb.d: Skip pe.
	* testsuite/gas/arm/sb-thumb1-pe.d: New test.
	* testsuite/gas/arm/sb-thumb1.d: Skip pe.
	* testsuite/gas/arm/sb-thumb2-pe.d: New test.
	* testsuite/gas/arm/sb-thumb2.d: Skip pe.
	* testsuite/gas/arm/udf.d: Skip pe.
2019-01-17 16:06:31 +00:00
Jim Wilson a4bf3d0720 Don't emit vendor attribute section if there is no attribute to emit.
2019-01-16  Kito Cheng  <kito@andestech.com>
	bfd/
	* elf-attrs.c (vendor_obj_attr_size): Return 0 if size is 0 even
	for OBJ_ATTR_PROC.
	gas/
	* testsuite/gas/riscv/attribute-empty.d: New.
2019-01-16 13:37:35 -08:00
Jim Wilson 2dc8dd17cd RISC-V: Support ELF attribute for gas and readelf.
2019-01-16  Kito Cheng  <kito@andestech.com>
		    Nelson Chu  <nelson@andestech.com>

	bfd/
	* elfnn-riscv.c (riscv_elf_obj_attrs_arg_type): New.
	(elf_backend_obj_attrs_vendor): Define.
	(elf_backend_obj_attrs_section_type): Likewise.
	(elf_backend_obj_attrs_section): Likewise.
	(elf_backend_obj_attrs_arg_type): Define as
	riscv_elf_obj_attrs_arg_type.
	* elfxx-riscv.c (riscv_estimate_digit): New.
	(riscv_estimate_arch_strlen1): Likewise.
	(riscv_estimate_arch_strlen): Likewise.
	(riscv_arch_str1): Likewise.
	(riscv_arch_str): Likewise.
	* elfxx-riscv.h (riscv_arch_str): Declare.
	binutils/
	* readelf.c (get_riscv_section_type_name): New function.
	(get_section_type_name): Add handler for RISC-V.
	(riscv_attr_tag_t): Declare.
	(riscv_attr_tag): New.
	(display_riscv_attribute): New function.
	(process_attributes): Add handler for RISC-V.
	* testsuite/binutils-all/strip-3.d: Remove .riscv.attribute
	section.
	gas/
	* config/tc-riscv.c (DEFAULT_RISCV_ATTR): Define to 0 if not defined.
	(riscv_set_options): Add `arch_attr` field.
	(riscv_opts): Set default value for arch_attr.
	(riscv_write_out_arch_attr): New.
	(riscv_set_public_attributes): Likewise.
	(riscv_md_end): Likewise.
	(riscv_convert_symbolic_attribute): Likewise.
	(s_riscv_attribute): Likewise.
	(explicit_arch_attr): Likewise.
	(riscv_pseudo_table): Add .attribute to the table.
	(options): Add OPTION_ARCH_ATTR and OPTION_NO_ARCH_ATTR
	enumeration constants.
	(md_longopts): Add `march-attr' and `mno-arch-attr' options.
	(md_parse_option): Handle the new options.
	(md_show_usage): Document the `march-attr' option.
	* config/tc-riscv.h (md_end): Define as riscv_md_end
	(riscv_md_end): Declare.
	(CONVERT_SYMBOLIC_ATTRIBUTE): Define as
	riscv_convert_symbolic_attribute.
	(riscv_convert_symbolic_attribute): Declare.
	(start_assemble): Declare.
	* testsuite/gas/elf/elf.exp: Adjust test case for section2.e.
	* testsuite/gas/elf/section2.e-riscv: New.
	* testsuite/gas/riscv/attribute-01.d: New test
	* testsuite/gas/riscv/attribute-02.d: Likewise.
	* testsuite/gas/riscv/attribute-03.d: Likewise.
	* testsuite/gas/riscv/attribute-04.d: Likewise.
	* testsuite/gas/riscv/attribute-04.s: Likewise.
	* testsuite/gas/riscv/attribute-05.d: Likewise.
	* testsuite/gas/riscv/attribute-05.s: Likewise.
	* testsuite/gas/riscv/attribute-06.d: Likewise.
	* testsuite/gas/riscv/attribute-06.s: Likewise.
	* testsuite/gas/riscv/attribute-07.d: Likewise.
	* testsuite/gas/riscv/attribute-07.s: Likewise.
	* testsuite/gas/riscv/attribute-08.d: Likewise.
	* testsuite/gas/riscv/attribute-08.s: Likewise.
	* testsuite/gas/riscv/attribute-unknown.d: Likewise.
	* testsuite/gas/riscv/attribute-unknown.s: Likewise.
	* testsuite/gas/riscv/empty.l: Likewise.
	* doc/c-riscv.texi (.attribute): Add documentation.
	* configure.ac (--enable-default-riscv-attribute): New options.
	* configure: Re-generate.
	* config.in: Re-generate.
	include/
	* elf/riscv.h (SHT_RISCV_ATTRIBUTES): Define.
	(Tag_RISCV_arch): Likewise.
	(Tag_RISCV_priv_spec): Likewise.
	(Tag_RISCV_priv_spec_minor): Likewise.
	(Tag_RISCV_priv_spec_revision): Likewise.
	(Tag_RISCV_unaligned_access): Likewise.
	(Tag_RISCV_stack_align): Likewise.
2019-01-16 13:14:59 -08:00
John Darrington e7b47f2e68 S12Z: gas: Fix bug when a symbol name was the single letter 'c'.
The assembler incorrectly recognised "c" as a register name, and
refused to allow it where it expected a symbol/label.

gas/
	* config/tc-s12z.c (lex_reg_name): Compare the length of the strings
	before the contents.
	* testsuite/gas/s12z/labels.d: New file.
	* testsuite/gas/s12z/labels.s: New file.
	* testsuite/gas/s12z/s12z.exp: Add them.
2019-01-16 19:35:05 +01:00
John Darrington 77fdb0e00b S12Z: gas: Permit "extend" instructions which don't actually extend.
Other assemblers permit "extending" a register into a register of a
smaller size or the same size.  It doesn't make much sense to do this
but would appear to be a valid instruction.  So change the error to a
warning.

gas/
	* config/tc-s12z.c (tfr): Change as_bad to as_warn.
	Also fix message typo and semantics.
2019-01-16 14:40:21 +01:00
John Darrington d5dcaf1b59 S12Z: Emit RELOC_S12Z_OPR instead of RELOC_EXT24 where appropriate.
When assembling instructions which involve OPR references, emit
RELOC_S12Z_OPR instead of RELOC_EXT24.

bfd/
	* bfd-in2.h [BFD_RELOC_S12Z_OPR]: New reloc.
	* libbfd.h: regen.
	* elf32-s12z.c (eld_s12z_howto_table): R_S12Z_OPR takes non zero
	source field.  (md_apply_fix): Apply final fix
	to BFD_RELOC_S12Z_OPR.
	* reloc.c[BFD_RELOC_S12Z_OPR]: New reloc.

gas/
	* config/tc-s12z.c (emit_opr): Emit BFD_RELOC_S12Z_OPR instead of
	BFD_RELOC_24.
	* testsuite/gas/s12z/opr-indirect-expr.d: Expect R_S12Z_OPR instead
	of R_S12Z_EXT24.
2019-01-16 14:39:04 +01:00
Srinath Parvathaneni 55e8aae79a Implement the assembly instructions yield, wfe, wfi and sev for ARMv6T2 in both ARM mode and Thumb mode.
* config/tc-arm.c (arm_ext_v6k_v6t2): Define.
	(insns) [ARM_VARIANT]: Modified.
	(insns) [THUMB_VARIANT]: To implement few ARMv6K instructions
	in ARMv6T2 as well.
	* testsuite/gas/arm/archv6t2-1.d: New test.
	* testsuite/gas/arm/archv6t2-1.s: Likewise.
	* testsuite/gas/arm/archv6t2-2.d: Likewise.
2019-01-14 10:35:50 +00:00
Alan Modra c7af41ec2c More fallout from PR 23963 change
PR 23963
	* testsuite/gas/m68hc11/lbranch-dwarf2.d: Adjust for PR23963 change.
	* testsuite/gas/m68hc11/opers12-dwarf2.d: Likewise.
2019-01-11 22:37:45 +10:30
Nick Clifton 59aa9b0be1 Correct changelog entry. 2019-01-10 15:23:44 +00:00
Nick Clifton 12add40ee4 Stop objdump from displaying control codes embedded in symbol names.
PR 23963
binutils* objdump.c (sanitize_string): New function.  Removes control
	characters from symbol names.
	(dump_section_header): Use new function.
	(objdump_print_symname): Likewise.
	(objdump_print_addr_with_sym): Likewise.
	(show_line): Likewise.
	(disassemble_bytes): Likewise.
	(disassemble_section): Likewise.
	(load_specific_debug_section): Likewise.
	(read_section_stabs): Likewise.
	(print_section_stabs): Likewise.
	(dump_section): Likewise.
	(dump_reloc_set): Likewise.
	(dump_relocs_in_section): Likewise.
	(dump_bfd): Likewise.
	(display_any_bfd): Likewise.

gas	* testsuite/gas/mips/mips16-branch-absolute-1.d: Adjust for the fact that
	control characters are now displayed as escape sequences.
	* testsuite/gas/mips/mips16-e.d: Likewise.
	* testsuite/gas/mips/mips16-pcrel-0.d: Likewise.
	* testsuite/gas/mips/mips16-pcrel-1.d: Likewise.
	* testsuite/gas/mips/mips16-pcrel-delay-0.d: Likewise.
	* testsuite/gas/mips/mips16-pcrel-delay-1.d: Likewise.
	* testsuite/gas/mips/mips16-pcrel-n32-0.d: Likewise.
	* testsuite/gas/mips/mips16-pcrel-n32-1.d: Likewise.
	* testsuite/gas/mips/mips16-pcrel-n64-sym32-0.d: Likewise.
	* testsuite/gas/mips/mips16-pcrel-n64-sym32-1.d: Likewise.
	* testsuite/gas/mips/mips16e2@mips16-pcrel-0.d: Likewise.
	* testsuite/gas/mips/mips16e2@mips16-pcrel-1.d: Likewise.
	* testsuite/gas/mips/mips16e2@mips16-pcrel-delay-0.d: Likewise.
	* testsuite/gas/mips/mips16e2@mips16-pcrel-delay-1.d: Likewise.
	* testsuite/gas/mips/mips16e2@mips16-pcrel-n32-0.d: Likewise.
	* testsuite/gas/mips/mips16e2@mips16-pcrel-n32-1.d: Likewise.
	* testsuite/gas/mips/mips16e2@mips16-pcrel-n64-sym32-0.d:
	Likewise.
	* testsuite/gas/mips/mips16e2@mips16-pcrel-n64-sym32-1.d:
	Likewise.
	* testsuite/gas/mips/mipsel16-e.d: Likewise.
	* testsuite/gas/mips/mipsr6@msa.d: Likewise.
	* testsuite/gas/mips/mipsr6@relax-swap3.d: Likewise.
	* testsuite/gas/mips/r6-64-n32.d: Likewise.
	* testsuite/gas/mips/r6-64-n64.d: Likewise.
	* testsuite/gas/mips/r6-n32.d: Likewise.
	* testsuite/gas/mips/r6-n64.d: Likewise.
	* testsuite/gas/mips/r6.d: Likewise.
	* testsuite/gas/mips/tmips16-e.d: Likewise.
	* testsuite/gas/mips/tmipsel16-e.d: Likewise.
	* testsuite/gas/mn10300/relax.d: Likewise.
2019-01-10 15:23:44 +00:00
John Darrington 39f286cd58 S12Z: Fix disassembly of indexed OPR operands with zero index.
gas/
	* testsuite/gas/s12z/jsr.s: New case.
	* testsuite/gas/s12z/jsr.d: New case.
opcodes/
	* s12z-dis.c (opr_emit_disassembly): Do not omit an index if it is
	zero.
2019-01-09 19:44:27 +01:00
Andrew Paprocki 3107326d3d Adjust bfd/warning.m4 egrep patterns
Adjust the `bfd/warning.m4` `egrep` patterns to handle preprocessors
that do not define `__GNUC__`, leaving the string in the output.

bfd/
	* warning.m4: Adjust egrep pattern for non-GNU compilers.
	* configure: Regenerate.
binutils/
	* configure: Regenerate.
gas/
	* configure: Regenerate.
gold/
	* configure: Regenerate.
gprof/
	* configure: Regenerate.
ld/
	* configure: Regenerate.
opcodes/
	* configure: Regenerate.
2019-01-09 13:51:08 +10:30
Kyrylo Tkachov c8fcc36012 [AArch64][gas] Add -mcpu support for Arm Ares
This adds support for the Arm Ares CPU for AArch64.
It implements the Armv8.2-A architecture with the optional features
of statistical profiling, dot product and FP16 on by default.

Note: Ares is a codename to enable early adopters and in time
we will add the final product name once it's announced.

    * config/tc-aarch64.c (aarch64_cpus): Add ares.
    * doc/c-aarch64.texi (-mcpu): Document ares value.
2019-01-08 15:18:32 +00:00
Alan Modra 171b8e1957 run_dump_test source in build directory
Some existing tests build .s and .d files for run_dump_test, using an
absolute #source: line in the .d file.  This patch changes that scheme
a little to instead use "#source: ./..." in .d files rather than
"#source: $objdir/...", which is more useful in cases where the .d
file is not generated.

This allows RX gas test files to be built in the build directory,
rather than in a source directory (which might be read-only).

binutils/
	* testsuite/lib/binutils-common.exp (run_dump_test): Don't prepend
	$srcdir/$subdir to source file name if it starts with "./".
gas/
	* testsuite/gas/rx/rx.exp: Create generated test source in
	current directory.
	* testsuite/gas/rx/Xtod.d, * testsuite/gas/rx/abs.d,
	* testsuite/gas/rx/adc.d, * testsuite/gas/rx/add.d,
	* testsuite/gas/rx/and.d, * testsuite/gas/rx/bclr.d,
	* testsuite/gas/rx/bcnd.d, * testsuite/gas/rx/bfmov.d,
	* testsuite/gas/rx/bmcnd.d, * testsuite/gas/rx/bnot.d,
	* testsuite/gas/rx/bra.d, * testsuite/gas/rx/brk.d,
	* testsuite/gas/rx/bset.d, * testsuite/gas/rx/bsr.d,
	* testsuite/gas/rx/btst.d, * testsuite/gas/rx/clrpsw.d,
	* testsuite/gas/rx/cmp.d, * testsuite/gas/rx/dabs.d,
	* testsuite/gas/rx/dadd.d, * testsuite/gas/rx/dbt.d,
	* testsuite/gas/rx/dcmp.d, * testsuite/gas/rx/ddiv.d,
	* testsuite/gas/rx/div.d, * testsuite/gas/rx/divu.d,
	* testsuite/gas/rx/dmov.d, * testsuite/gas/rx/dmul.d,
	* testsuite/gas/rx/dneg.d, * testsuite/gas/rx/dpopm.d,
	* testsuite/gas/rx/dpushm.d, * testsuite/gas/rx/dround.d,
	* testsuite/gas/rx/dsqrt.d, * testsuite/gas/rx/dsub.d,
	* testsuite/gas/rx/dtoX.d, * testsuite/gas/rx/emaca.d,
	* testsuite/gas/rx/emsba.d, * testsuite/gas/rx/emul.d,
	* testsuite/gas/rx/emula.d, * testsuite/gas/rx/emulu.d,
	* testsuite/gas/rx/fadd.d, * testsuite/gas/rx/fcmp.d,
	* testsuite/gas/rx/fdiv.d, * testsuite/gas/rx/fmul.d,
	* testsuite/gas/rx/fsqrt.d, * testsuite/gas/rx/fsub.d,
	* testsuite/gas/rx/ftoi.d, * testsuite/gas/rx/ftou.d,
	* testsuite/gas/rx/gprel.d, * testsuite/gas/rx/int.d,
	* testsuite/gas/rx/itof.d, * testsuite/gas/rx/jmp.d,
	* testsuite/gas/rx/jsr.d, * testsuite/gas/rx/machi.d,
	* testsuite/gas/rx/maclh.d, * testsuite/gas/rx/maclo.d,
	* testsuite/gas/rx/max.d, * testsuite/gas/rx/min.d,
	* testsuite/gas/rx/mov.d, * testsuite/gas/rx/movco.d,
	* testsuite/gas/rx/movli.d, * testsuite/gas/rx/movu.d,
	* testsuite/gas/rx/msbhi.d, * testsuite/gas/rx/msblh.d,
	* testsuite/gas/rx/msblo.d, * testsuite/gas/rx/mul.d,
	* testsuite/gas/rx/mulhi.d, * testsuite/gas/rx/mullh.d,
	* testsuite/gas/rx/mullo.d, * testsuite/gas/rx/mvfacgu.d,
	* testsuite/gas/rx/mvfachi.d, * testsuite/gas/rx/mvfaclo.d,
	* testsuite/gas/rx/mvfacmi.d, * testsuite/gas/rx/mvfc.d,
	* testsuite/gas/rx/mvfcp.d, * testsuite/gas/rx/mvfdc.d,
	* testsuite/gas/rx/mvfdr.d, * testsuite/gas/rx/mvtacgu.d,
	* testsuite/gas/rx/mvtachi.d, * testsuite/gas/rx/mvtaclo.d,
	* testsuite/gas/rx/mvtc.d, * testsuite/gas/rx/mvtcp.d,
	* testsuite/gas/rx/mvtdc.d, * testsuite/gas/rx/neg.d,
	* testsuite/gas/rx/nop.d, * testsuite/gas/rx/not.d,
	* testsuite/gas/rx/opecp.d, * testsuite/gas/rx/or.d,
	* testsuite/gas/rx/pop.d, * testsuite/gas/rx/popc.d,
	* testsuite/gas/rx/popm.d, * testsuite/gas/rx/push.d,
	* testsuite/gas/rx/pushc.d, * testsuite/gas/rx/pushm.d,
	* testsuite/gas/rx/r-bcc.d, * testsuite/gas/rx/r-bra.d,
	* testsuite/gas/rx/racl.d, * testsuite/gas/rx/racw.d,
	* testsuite/gas/rx/rdacl.d, * testsuite/gas/rx/rdacw.d,
	* testsuite/gas/rx/revl.d, * testsuite/gas/rx/revw.d,
	* testsuite/gas/rx/rmpa.d, * testsuite/gas/rx/rolc.d,
	* testsuite/gas/rx/rorc.d, * testsuite/gas/rx/rotl.d,
	* testsuite/gas/rx/rotr.d, * testsuite/gas/rx/round.d,
	* testsuite/gas/rx/rstr.d, * testsuite/gas/rx/rte.d,
	* testsuite/gas/rx/rtfi.d, * testsuite/gas/rx/rts.d,
	* testsuite/gas/rx/rtsd.d, * testsuite/gas/rx/sat.d,
	* testsuite/gas/rx/satr.d, * testsuite/gas/rx/save.d,
	* testsuite/gas/rx/sbb.d, * testsuite/gas/rx/sccnd.d,
	* testsuite/gas/rx/scmpu.d, * testsuite/gas/rx/setpsw.d,
	* testsuite/gas/rx/shar.d, * testsuite/gas/rx/shll.d,
	* testsuite/gas/rx/shlr.d, * testsuite/gas/rx/smovb.d,
	* testsuite/gas/rx/smovf.d, * testsuite/gas/rx/smovu.d,
	* testsuite/gas/rx/sstr.d, * testsuite/gas/rx/stnz.d,
	* testsuite/gas/rx/stz.d, * testsuite/gas/rx/sub.d,
	* testsuite/gas/rx/suntil.d, * testsuite/gas/rx/swhile.d,
	* testsuite/gas/rx/tst.d, * testsuite/gas/rx/utof.d,
	* testsuite/gas/rx/wait.d, * testsuite/gas/rx/xchg.d,
	* testsuite/gas/rx/xor.d: Add #source line.
ld/
	* testsuite/ld-elf/sec64k.exp: Use . rather than $objdir in
	generated source file names.
	* testsuite/ld-m68k/m68k-got.exp: Likewise.
2019-01-08 18:50:54 +10:30
Kyrylo Tkachov ef8df4caec [arm][gas] Add -mcpu support for Arm Ares
This adds support for the Arm Ares CPU in the arm port.
It implements the Armv8.2-A architecture with the relevant optional
features
of dot product and FP16 on by default.

Note: Ares is a codename to enable early adopters and in time
we will add the final product name once it's announced.

	* config/tc-arm.c (arm_cpus): Add ares.
	* doc/c-arm.texi (-mcpu): Document ares value.
2019-01-07 09:22:55 +00:00
Yoshinori Sato 6a25bee8d0 RX: gas - Add RXv3 instruction support.
Instruction manual.
https://www.renesas.com/us/en/doc/products/mpumcu/doc/rx_family/r01us0316ej0100-rxv3sm.pdf

	* config/rx-defs.h (rx_cpu_types): Add type RXV3 and RXV3FPU.
	(rx_bfield): Add prototype.
	(rx_post): Likewise.
	* config/rx-parse.y: Add v3 instructions and Double FPU registers.
	(DSIZE): Define.
	(POST): Define.
	(rx_check_v3): New. check v3 type.
	(rx_check_dfpu): New. check have double support.
	(double_condition_table): New. dcmp<cond> contiditon.
	(check_condition): Multiple condition support.
	(rx_lex): RXv3 instructions support.
	Add parse dcmp<cond> instruction and Double FPU registers.
	(immediate): Disable optimize in dmov #imm case.
	(displacement): Add double displacement in dmov instraction.
	* config/tc-rx.c (rx_use_conventional_section_names):
	Invert default value in rx-*-linux target.
	(cpu_type): Add additional ELF flags.
	(cpu_type_list): Add RXv3.
	(md_parse_option): Refer elf_flags from cpu_type_list.
	(md_show_usage): Add rxv3 and rxv3-dfpu.
	(rx_bytesT): Add post byte.
	(rx_bfield): New. generate bfmov / bfmovz "imm" field.
	(rx_post): New. Set instruction post byte.
	(md_assemble): Add post byte.
	doc/c-rx.texi: Add cpu types.
	* testsuite/gas/rx/Xtod.d: New.
	* testsuite/gas/rx/Xtod.sm: New.
	* testsuite/gas/rx/bfmov.d: New.
	* testsuite/gas/rx/bfmov.sm: New.
	* testsuite/gas/rx/dabs.d: New.
	* testsuite/gas/rx/dabs.sm: New.
	* testsuite/gas/rx/dadd.d: New.
	* testsuite/gas/rx/dadd.sm: New.
	* testsuite/gas/rx/dcmp.d: New.
	* testsuite/gas/rx/dcmp.sm: New.
	* testsuite/gas/rx/ddiv.d: New.
	* testsuite/gas/rx/ddiv.sm: New.
	* testsuite/gas/rx/dmov.d: New.
	* testsuite/gas/rx/dmov.sm: New.
	* testsuite/gas/rx/dmul.d: New.
	* testsuite/gas/rx/dmul.sm: New.
	* testsuite/gas/rx/dneg.d: New.
	* testsuite/gas/rx/dneg.sm: New.
	* testsuite/gas/rx/dpopm.d: New.
	* testsuite/gas/rx/dpopm.sm: New.
	* testsuite/gas/rx/dpushm.d: New.
	* testsuite/gas/rx/dpushm.sm: New.
	* testsuite/gas/rx/dround.d: New.
	* testsuite/gas/rx/dround.sm: New.
	* testsuite/gas/rx/dsqrt.d: New.
	* testsuite/gas/rx/dsqrt.sm: New.
	* testsuite/gas/rx/dsub.d: New.
	* testsuite/gas/rx/dsub.sm: New.
	* testsuite/gas/rx/dtoX.d: New.
	* testsuite/gas/rx/dtoX.sm: New.
	* testsuite/gas/rx/macros.inc: Add double FPU registers.
	* testsuite/gas/rx/mvfdc.d: New.
	* testsuite/gas/rx/mvfdc.sm: New.
	* testsuite/gas/rx/mvfdr.d: New.
	* testsuite/gas/rx/mvfdr.sm: New.
	* testsuite/gas/rx/mvtdc.d: New.
	* testsuite/gas/rx/mvtdc.sm: New.
	* testsuite/gas/rx/rstr.d: New.
	* testsuite/gas/rx/rstr.sm: New.
	* testsuite/gas/rx/rx.exp: Use rxv3-dfpu option.
	* testsuite/gas/rx/save.d: New.
	* testsuite/gas/rx/save.sm: New.
	* testsuite/gas/rx/xor.d: New.
	* testsuite/gas/rx/xor.sm: Add pattern.
2019-01-05 22:51:41 +09:00
Wu Heng 1b2ed39c3a Fix potential buffer overrun whilst scanning macro strings.
PR 24010
	* macro.c (get_any_string): Check for end of input whilst scanning
	for separators.
2019-01-04 16:18:59 +00:00
Wu Heng bdfb445597 Fix bug parsing angle bracketed string sequences.
PR 24009
	* read.c (stringer): Fix handling of missing '>' character at end
	of <...> sequence.
2019-01-04 15:58:02 +00:00
Alan Modra 827041555a Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
Alan Modra d5c04e1bf8 ChangeLog rotation 2019-01-01 21:25:40 +10:30
H.J. Lu b9519cfe98 x86: Properly handle PLT expression in directive
For PLT expressions, we should subtract the PLT relocation size only for
jump instructions.  Since PLT relocations are PC relative, we only allow
"symbol@PLT" in PLT expression.

gas/

	PR gas/23997
	* config/tc-i386.c (x86_cons): Check for invalid PLT expression.
	(md_apply_fix): Subtract the PLT relocation size only for jump
	instructions.
	* testsuite/gas/i386/reloc32.s: Add test for invalid PLT
	expression.
	* testsuite/gas/i386/reloc64.s: Likewise.
	* testsuite/gas/i386/ilp32/reloc64.s: Likewise.
	* testsuite/gas/i386/reloc32.l: Updated.
	* testsuite/gas/i386/reloc64.l: Likewise.
	* testsuite/gas/i386/ilp32/reloc64.l: Likewise.

ld/

	PR gas/23997
	* testsuite/ld-i386/i386.exp: Run PR gas/23997 test.
	* testsuite/ld-x86-64/x86-64.exp: Likewise.
	* testsuite/ld-x86-64/pr23997a.s: New file.
	* testsuite/ld-x86-64/pr23997b.c: Likewise.
	* testsuite/ld-x86-64/pr23997c.c: Likewise.
2018-12-19 12:22:12 -08:00
H.J. Lu 0a59decbb8 elf: Add PT_GNU_PROPERTY segment type
Linkers group input note sections with the same name into one output
note section with the same name.  One output note section is placed in
one PT_NOTE segment.  New linkers merge all input .note.gnu.property
sections into one output .note.gnu.property section with a single
NT_GNU_PROPERTY_TYPE_0 note in a single PT_NOTE segment.  Since older
linkers treat input .note.gnu.property section as a generic note section
and just concatenate all input .note.gnu.property sections into one
output .note.gnu.property section without merging them, we may
see one or more NT_GNU_PROPERTY_TYPE_0 notes in PT_NOTE segment, which
are invalid.

GNU_PROPERTY_X86_UINT32_VALID was defined to address this issue such
that linker sets the bit for non-relocatable outputs.  But it isn't
sufficient:

1. It doesn't cover generic properties.
2. When -mx86-used-note=yes is passed to x86 assembler, the
GNU_PROPERTY_X86_UINT32_VALID bit is set in GNU_PROPERTY_X86_ISA_1_USED
property in object file and older linkers generate invalid
NT_GNU_PROPERTY_TYPE_0 notes with the GNU_PROPERTY_X86_UINT32_VALID bit
set.

I am proposing the following changes:

1. Add PT_GNU_PROPERTY segment type:

 # define PT_GNU_PROPERTY (PT_LOOS + 0x474e553)

which covers .note.gnu.property section.
2. Remove GNU_PROPERTY_X86_UINT32_VALID.

bfd/

	PR ld/23900
	* elf.c (get_program_header_size): Add a PT_GNU_PROPERTY
	segment for NOTE_GNU_PROPERTY_SECTION_NAME.
	(_bfd_elf_map_sections_to_segments): Create a PT_GNU_PROPERTY
	segment for NOTE_GNU_PROPERTY_SECTION_NAME.
	* elfxx-x86.c (_bfd_elf_link_setup_gnu_properties): Don't set
	GNU_PROPERTY_X86_UINT32_VALID.

binutils/

	PR ld/23900
	* readelf.c (get_segment_type): Support PT_GNU_PROPERTY.
	(decode_x86_isa): Don't check GNU_PROPERTY_X86_UINT32_VALID.
	(decode_x86_feature_1): Likewise.
	(decode_x86_feature_2): Likewise.
	(print_gnu_property_note): Remove GNU_PROPERTY_X86_UINT32_VALID
	check.
	* testsuite/binutils-all/i386/empty.d: Updated.
	* testsuite/binutils-all/x86-64/empty-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/empty.d: Likewise.
	* testsuite/binutils-all/i386/pr21231b.s: Change
	GNU_PROPERTY_X86_ISA_1_USED bits to 0x7fffffff.
	* testsuite/binutils-all/x86-64/pr21231b.s: Likewise.

gas/

	PR ld/23900
	* config/tc-i386.c (x86_cleanup): Don't set
	GNU_PROPERTY_X86_UINT32_VALID.
	* testsuite/gas/i386/property-1.s: Change
	GNU_PROPERTY_X86_ISA_1_USED bits to 0.

include/

	PR ld/23900
	* elf/common.h (PT_GNU_PROPERTY): New.
	(GNU_PROPERTY_X86_UINT32_VALID): Removed.

ld/

	PR ld/23900
	* testsuite/ld-elf/elf.exp: Run PR ld/23900 test.
	* testsuite/ld-elf/pr23900-1-32.rd: New file.
	* testsuite/ld-elf/pr23900-1-64.rd: Likewise.
	* testsuite/ld-elf/pr23900-1.d: Likewise.
	* testsuite/ld-elf/pr23900-1.s: Likewise.
	* testsuite/ld-elf/pr23900-2.s: Likewise.
	* testsuite/ld-elf/pr23900-2a.d: Likewise.
	* testsuite/ld-elf/pr23900-2b.d: Likewise.
	* testsuite/ld-i386/ibt-plt-1.d: Adjusted.
	* testsuite/ld-i386/ibt-plt-2c.d: Likewise.
	* testsuite/ld-i386/ibt-plt-2d.d: Likewise.
	* testsuite/ld-i386/ibt-plt-3d.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-1-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-1.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2c-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2c.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2d-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2c.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3c-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3c.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3d-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3d.d: Likewise.
	* testsuite/ld-i386/pr23372c.d: Expect <None>
	for GNU_PROPERTY_X86_ISA_1_USED.
	* testsuite/ld-x86-64/pr23372c-x32.d: Likewise.
	* testsuite/ld-x86-64/pr23372c.d: Likewise.
	* testsuite/ld-x86-64/pr23372d-x32.d: Likewise.
	* testsuite/ld-x86-64/pr23372d.d: Likewise.
	* testsuite/ld-x86-64/property-x86-5a.s: Change
	GNU_PROPERTY_X86_ISA_1_USED bits to 0.
	* testsuite/ld-x86-64/property-x86-5b.s: Likewise.
2018-12-14 04:55:34 -08:00
Jeff Law c68033869a Fix typo/thinko in last change.
* dw2gencfi.c (output_cie): Add missing semicolon in last
	change.
2018-12-13 15:45:59 -07:00
Sam Tebbs 0903806253 Move aarch64 CIE code to aarch64 backend
This commit moves all aarch64-specific code to deal with CIE structure
introduced in 3a67e1a6b4 from
target-independent files to the aarch64 backend.

2018-12-13  Sam Tebbs  <sam.tebbs@arm.com>

binutils/
	* dwarf.c (read_cie):  Add check for 'B'.

gas/
	* config/tc-aarch64.h (enum pointer_auth_key,
	tc_fde_entry_extras, tc_cie_entry_extras, tc_fde_entry_init_extra,
	tc_output_cie_extra, tc_cie_fde_equivalent_extra,
	tc_cie_entry_init_extra): Define.
	* dw2gencfi.c (struct cie_entry): Add tc_cie_entry_extras invocation.
	(alloc_fde_entry, select_cie_for_fde): Add tc_fde_entry_init_extra
	invocation.
	(output_cie): Add tc_output_cie_extra invocation.
	(select_cie_for_fde): Add tc_cie_fde_equivalent_extra invocation.
	* dw2gencfi.h (enum pointer_auth_key): Move to config/tc-aarch64.h.
	(struct fde_entry): Add tc_fde_entry_extras invocation
2018-12-13 16:37:40 +00:00
Andre Vieira 13dc50ee16 [GAS][Arm] Skip Local BLX Thumb tests for arm-netbsdelf and arm-nto
gas/ChangeLog
2018-12-12  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* testsuite/gas/arm/blx-local-thumb.d: Skip arm-nto and
	arm-netbsdelf.
2018-12-12 13:31:46 +00:00
Jim Wilson 8970c0224e RISC-V: Don't segfault for two regs in auipc or lui.
gas/
	PR gas/23954
	* config/tc-riscv.c (my_getSmallExpression): Expand comment for
	register support.  Set expr_end if parse a register.
	(riscv_ip) <'u'>: Break if imm_expr is not a symbol or constant.
	* testsuite/gas/riscv/auipc-parsing.d: New.
	* testsuite/gas/riscv/auipc-parsing.l: New.
	* testsuite/gas/riscv/auipc-parsing.s: New.
2018-12-10 16:40:46 -08:00
H.J. Lu e771f7a770 Correct gas/ChangeLog entry for PR gas/23968 2018-12-10 04:08:52 -08:00
H.J. Lu 9f52eab6a7 x86: Put back BFD_RELOC_X86_64_GOTPCREL
Put back BFD_RELOC_X86_64_GOTPCREL in TC_FORCE_RELOCATION_LOCAL, which
was removed by

commit 56ceb5b540
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Oct 22 04:49:20 2015 -0700

    Add R_X86_64_[REX_]GOTPCRELX support to gas and ld

by accident.
2018-12-09 07:22:14 -08:00
Jim Wilson f50fabe4f6 RISC-V: Fix 4-arg add parsing.
PR gas/23956
	gas/
	* config/tc-riscv.c (validate_riscv_insn) <'1'>: New case.
	(percent_op_null): New.
	(riscv_ip) <'j'>: Set imm_reloc before p.
	<'1'>: New case.
	<'0'>: Use percent_op_null and don't set imm_reloc.
	<alu_op>: Handle *args == '1'.
	* testsuite/gas/riscv/tprel-add.d: New.
	* testsuite/gas/riscv/tprel-add.l: New.
	* testsuite/gas/riscv/tprel-add.s: New.
	opcodes/
	* riscv-opc.c (riscv_opcodes) <"add">: Use 1 not 0 for fourth arg.
2018-12-07 12:31:05 -08:00
Alan Modra bb6bf75e7a PowerPC @l, @h and @ha warnings, plus VLE e_li
This patch started off just adding the warnings in tc-ppc.c about
incorrect usage of @l, @h and @ha in instructions that don't have
16-bit D-form fields.  That unfortunately showed up three warnings in
ld/testsuite/ld-powerpc/vle-multiseg.s on instructions like
	e_li r3, IV_table@l+0x00
which was being assembled to
   8:	70 60 00 00 	e_li    r3,0
			a: R_PPC_ADDR16_LO	IV_table
The ADDR16_LO reloc is of course completely bogus on e_li, which has
a split 20-bit signed integer field in bits 0x1f7fff, the low 11 bit
in 0x7ff, the next 5 bits in 0x1f0000, and the high 4 bits in 0x7800.
Applying an ADDR16_LO reloc to the instruction potentially changes
the e_li instruction to e_add2i., e_add2is, e_cmp16i, e_mull2i,
e_cmpl16i, e_cmph16i, e_cmphl16i, e_or2i, e_and2i., e_or2is, e_lis,
e_and2is, or some invalid encodings.

Now there is a relocation that suits e_li, R_PPC_VLE_ADDR20, which was
added 2017-09-05 but I can't see code in gas to generate the
relocation.  In any case, VLE_ADDR20 probably doesn't have the correct
semantics for @l since ideally you'd want an @l to pair with @h or @ha
to generate a 32-bit constant.  Thus @l should only produce a 16-bit
value, I think.  So we need some more relocations to handle e_li it
seems, or as I do in this patch, modify the behaviour of existing
relocations when applied to e_li instructions.

include/
	* opcode/ppc.h (E_OPCODE_MASK, E_LI_MASK, E_LI_INSN): Define.
bfd/
	* elf32-ppc.c (ppc_elf_howto_raw <R_PPC_VLE_ADDR20>): Correct
	mask and shift value.
	(ppc_elf_vle_split16): Use E_OPCODE_MASK.  Handle e_li
	specially.
gas/
	* config/tc-ppc.c (md_assemble): Adjust relocs for VLE before
	TLS tweaks.  Handle e_li.  Warn on unexpected operand field
	for lo16/hi16/ha16 relocs.
2018-12-06 23:01:03 +10:30
Andrew Burgess 884b49e3a9 opcodes/riscv: Hide '.L0 ' fake symbols
The RISC-V assembler generates fake labels with the name '.L0 ' as
part of the debug information (see
gas/config/tc-riscv.h:FAKE_LABEL_NAME).

The problem is that currently, when disassembling an object file, the
output looks like this (this is an example from the GDB testsuite, but
is pretty representative of anything with debug information):

  000000000000001e <main>:
    1e:   7179                    addi    sp,sp,-48
    20:   f406                    sd      ra,40(sp)
    22:   f022                    sd      s0,32(sp)
    24:   1800                    addi    s0,sp,48

  0000000000000026 <.L0 >:
    26:   87aa                    mv      a5,a0
    28:   feb43023                sd      a1,-32(s0)
    2c:   fcc43c23                sd      a2,-40(s0)
    30:   fef42623                sw      a5,-20(s0)

  0000000000000034 <.L0 >:
    34:   fec42783                lw      a5,-20(s0)
    38:   0007871b                sext.w  a4,a5
    3c:   678d                    lui     a5,0x3
    3e:   03978793                addi    a5,a5,57 # 3039 <.LASF30+0x2a9d>
    42:   02f71463                bne     a4,a5,6a <.L0 >

  0000000000000046 <.L0 >:
    46:   000007b7                lui     a5,0x0
    4a:   0007b783                ld      a5,0(a5) # 0 <need_malloc>
    4e:   6f9c                    ld      a5,24(a5)

  0000000000000050 <.L0 >:
    50:   86be                    mv      a3,a5
    52:   466d                    li      a2,27
    54:   4585                    li      a1,1
    56:   000007b7                lui     a5,0x0
    5a:   00078513                mv      a0,a5
    5e:   00000097                auipc   ra,0x0
    62:   000080e7                jalr    ra # 5e <.L0 +0xe>

  0000000000000066 <.L0 >:
    66:   4785                    li      a5,1
    68:   a869                    j       102 <.L0 >

  000000000000006a <.L0 >:
    6a:   000007b7                lui     a5,0x0
    6e:   00078513                mv      a0,a5
    72:   00000097                auipc   ra,0x0
    76:   000080e7                jalr    ra # 72 <.L0 +0x8>

The frequent repeated '.L0 ' labels are pointless, as they are
non-unique there's no way to match a use of '.L0 ' to its appearence
in the output, so we'd be better off just not printing it at all.
That's what this patch does by defining a 'symbol_is_valid' method for
RISC-V.  With this commit, the same disassembly now looks like this:

  000000000000001e <main>:
    1e:   7179                    addi    sp,sp,-48
    20:   f406                    sd      ra,40(sp)
    22:   f022                    sd      s0,32(sp)
    24:   1800                    addi    s0,sp,48
    26:   87aa                    mv      a5,a0
    28:   feb43023                sd      a1,-32(s0)
    2c:   fcc43c23                sd      a2,-40(s0)
    30:   fef42623                sw      a5,-20(s0)
    34:   fec42783                lw      a5,-20(s0)
    38:   0007871b                sext.w  a4,a5
    3c:   678d                    lui     a5,0x3
    3e:   03978793                addi    a5,a5,57 # 3039 <.LASF30+0x2a9d>
    42:   02f71463                bne     a4,a5,6a <.L4>
    46:   000007b7                lui     a5,0x0
    4a:   0007b783                ld      a5,0(a5) # 0 <need_malloc>
    4e:   6f9c                    ld      a5,24(a5)
    50:   86be                    mv      a3,a5
    52:   466d                    li      a2,27
    54:   4585                    li      a1,1
    56:   000007b7                lui     a5,0x0
    5a:   00078513                mv      a0,a5
    5e:   00000097                auipc   ra,0x0
    62:   000080e7                jalr    ra # 5e <main+0x40>
    66:   4785                    li      a5,1
    68:   a869                    j       102 <.L5>

  000000000000006a <.L4>:
    6a:   000007b7                lui     a5,0x0
    6e:   00078513                mv      a0,a5
    72:   00000097                auipc   ra,0x0
    76:   000080e7                jalr    ra # 72 <.L4+0x8>

In order to share the fake label between the assembler and the
libopcodes library, I've added some new defines RISCV_FAKE_LABEL_NAME
and RISCV_FAKE_LABEL_CHAR in include/opcode/riscv.h.  I could have
just moved FAKE_LABEL_NAME to the include file, however, I thnk this
would be confusing, someone working on the assembler would likely not
expect to find FAKE_LABEL_NAME defined outside of the assembler source
tree.  By introducing the RISCV_FAKE_LABEL_* defines I can leave the
assembler standard FAKE_LABEL_ defines in the assembler source, but
still share the RISCV_FAKE_LABEL_* with libopcodes.

gas/ChangeLog:

	* config/tc-riscv.h (FAKE_LABEL_NAME): Define as
	RISCV_FAKE_LABEL_NAME.
	(FAKE_LABEL_CHAR): Define as RISCV_FAKE_LABEL_CHAR.

include/ChangeLog:

	* dis-asm.h (riscv_symbol_is_valid): Declare.
	* opcode/riscv.h (RISCV_FAKE_LABEL_NAME): Define.
	(RISCV_FAKE_LABEL_CHAR): Define.

opcodes/ChangeLog:

        * disassembler.c (disassemble_init_for_target): Add RISC-V
        initialisation.
        * riscv-dis.c (riscv_symbol_is_valid): New function.
2018-12-06 09:40:56 +00:00
Sam Tebbs 3a67e1a6b4 [aarch64] Add support for pointer authentication B key
Armv8.3-A has another key used in pointer authentication called the
B-key (other than the A-key that is already supported). In order for
stack unwinders to work it is necessary to be able to identify frames
that have been signed with the B-key rather than the A-key and it was
felt that keeping this as an augmentation character in the CIE was the
best bet. The DWARF extensions for ARM therefore propose to add a new
augmentation character 'B' to the CIE augmentation string and the
corresponding cfi directive ".cfi_b_key_frame". I've made the relevant
changes to GAS and LD to add support for B-key unwinding, which required
modifying LD to check for 'B' in the augmentation string, adding the
".cfi_b_key_frame" directive to GAS and adding a "pauth_key" field to
GAS's fde_entry and cie_entry structs.

The pointer authentication instructions will behave as NOPs on
architectures that don't support them, and so a check for the
architecture being assembled for is not necessary since there will be no
behavioural difference between augmentation strings with and without the
'B' character on such architectures.

2018-12-05  Sam Tebbs  <sam.tebbs@arm.com>

bfd/
	* elf-eh-frame.c (_bfd_elf_parse_eh_frame): Add check for 'B'.

gas/
	* dw2gencfi.c (struct cie_entry): Add tc_cie_entry_extras invocation.
	(alloc_fde_entry): Add tc_fde_entry_init_extra invocation.
	(output_cie): Add tc_output_cie_extra invocation.
	(select_cie_for_fde): Add tc_cie_fde_equivalent_extra and
	tc_cie_entry_init_extra invocation.
	(frch_cfi_data, cfa_save_data): Move to dwgencfi.h.
	* config/tc-aarch64.c (s_aarch64_cfi_b_key_frame): Declare.
	(md_pseudo_table): Add "cfi_b_key_frame".
	* config/tc-aarch64.h (tc_fde_entry_extras, tc_cie_entry_extras,
	tc_fde_entry_init_extra, tc_output_cie_extra,
	tc_cie_fde_equivalent_extra, tc_cie_entry_init_extra): Define.
	* dw2gencfi.h (struct fde_entry): Add tc_fde_entry_extras invocation.
	(pointer_auth_key): Define.
	(frch_cfi_data, cfa_save_data): Move from dwgencfi.c.
	* doc/c-aarch64.texi (.cfi_b_key_frame): Add documentation.
	* testsuite/gas/aarch64/(pac_ab_key.d, pac_ab_key.s): New file.
2018-12-05 18:30:08 +00:00
wu.heng 314a80c41d PR23939, Check frch_cfi_data before use
PR 23939
	* dw2gencfi.c (dot_cfi_label): Check frch_cfi_data is non-NULL
	before use.
2018-12-04 16:36:30 +10:30
Jim Wilson 1080bf78c0 RISC-V: Accept version, supervisor ext and more than one NSE for -march.
This patch moves all -march parsing logic into bfd, because we will use this
code in ELF attributes.

	bfd/
	* elfxx-riscv.h (RISCV_DONT_CARE_VERSION): New macro.
	(struct riscv_subset_t): New structure.
	(riscv_subset_t): New typedef.
	(riscv_subset_list_t): New structure.
	(riscv_release_subset_list): New prototype.
	(riscv_add_subset): Likewise.
	(riscv_lookup_subset): Likewise.
	(riscv_lookup_subset_version): Likewise.
	(riscv_release_subset_list): Likewise.
	* elfxx-riscv.c: Include safe-ctype.h.
	(riscv_parsing_subset_version): New function.
	(riscv_supported_std_ext): Likewise.
	(riscv_parse_std_ext): Likewise.
	(riscv_parse_sv_or_non_std_ext): Likewise.
	(riscv_parse_subset): Likewise.
	(riscv_add_subset): Likewise.
	(riscv_lookup_subset): Likewise.
	(riscv_lookup_subset_version): Likewise.
	(riscv_release_subset_list): Likewise.
	gas/
	* config/tc-riscv.c: Include elfxx-riscv.h.
	(struct riscv_subset): Removed.
	(riscv_subsets): Change type to riscv_subset_list_t.
	(riscv_subset_supports): Removed argument: xlen_required and move
	logic into libbfd.
	(riscv_multi_subset_supports): Removed argument: xlen_required.
	(riscv_clear_subsets): Removed.
	(riscv_add_subset): Ditto.
	(riscv_set_arch): Extract parsing logic into libbfd.
	(riscv_ip): Update argument for riscv_multi_subset_supports and
	riscv_subset_supports. Update riscv_subsets due to struct definition
	changed.
	(riscv_after_parse_args): Update riscv_subsets due to struct
	definition changed, update and argument for riscv_subset_supports.
	* testsuite/gas/riscv/empty.s: New.
	* testsuite/gas/riscv/march-fail-rv32ef.d: Likewise.
	* testsuite/gas/riscv/march-fail-rv32ef.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32i.d: Likewise.
	* testsuite/gas/riscv/march-fail-rv32i.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32iam.d: Likewise.
	* testsuite/gas/riscv/march-fail-rv32iam.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32ic.d: Likewise.
	* testsuite/gas/riscv/march-fail-rv32ic.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32icx2p.d: Likewise.
	* testsuite/gas/riscv/march-fail-rv32icx2p.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32imc.d: Likewise.
	* testsuite/gas/riscv/march-fail-rv32imc.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv64I.d: Likewise.
	* testsuite/gas/riscv/march-fail-rv64I.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv64e.d: Likewise.
	* testsuite/gas/riscv/march-fail-rv64e.l: Likewise.
	* testsuite/gas/riscv/march-ok-g2.d: Likewise.
	* testsuite/gas/riscv/march-ok-g2p0.d: Likewise.
	* testsuite/gas/riscv/march-ok-i2p0.d: Likewise.
	* testsuite/gas/riscv/march-ok-nse-with-version.: Likewise.d
	* testsuite/gas/riscv/march-ok-s-with-version.d: Likewise.
	* testsuite/gas/riscv/march-ok-s.d: Likewise.
	* testsuite/gas/riscv/march-ok-sx.d: Likewise.
	* testsuite/gas/riscv/march-ok-two-nse.d: Likewise.
	* testsuite/gas/riscv/march-ok-g2_p1.d: Likewise.
	* testsuite/gas/riscv/march-ok-i2p0m2_a2f2.d: Likewise.
	include/
	* opcode/riscv.h (riscv_opcode): Change type of xlen_requirement to
	unsigned.
	opcodes/
	* riscv-opc.c: Change the type of xlen, because type of
	xlen_requirement changed.
2018-12-03 14:05:17 -08:00
Egeyar Bagcioglu 57b64c4103 [aarch64] - Only use MOV for disassembly when shifter op is LSL #0
ARM Architecture Reference Manual for the profile ARMv8-A, Issue C.a,
states that MOV (register) is an alias of the ORR (shifted register)
iff shift == '00' && imm6 == '000000' && Rn == '11111'.  However, mov
is currently preferred for a broader range of orr instructions, which
is incorrect.

2018-12-03  Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>

opcodes:
	PR 23193
        PR 19721
        * aarch64-tbl.h (aarch64_opcode_table): Only disassemble an ORR
	encoding as MOV if the shift operation is a left shift of zero.

gas:
	PR 23193
	PR 19721
	* testsuite/gas/aarch64/pr19721.s: Add new test cases.
	* testsuite/gas/aarch64/pr19721.d: Correct existing test
	cases and add new ones.
2018-12-03 17:34:33 +00:00
Nick Clifton 8acbe8ffa0 Update the assembler to use a version of 3 when generating the header of the .debug_line section.
PR 23941
gas	* dwarf2dbg.c (DWARF2_LINE_VERSION): Change to 3.
	* testsuite/gas/elf/dwarf2-3.d: Update expected output.
	* testsuite/gas/elf/dwarf2-5.d: Likewise.
	* testsuite/gas/i386/debug1.d: Likewise.
	* testsuite/gas/i386/dw2-compress-1.d: Likewise.
	* testsuite/gas/i386/dw2-compress-3a.d: Likewise.
	* testsuite/gas/i386/dw2-compress-3b.d: Likewise.
	* testsuite/gas/i386/dw2-compressed-1.d: Likewise.
	* testsuite/gas/i386/dw2-compressed-3a.d: Likewise.
	* testsuite/gas/i386/dw2-compressed-3b.d: Likewise.
	* testsuite/gas/ia64/pr13167.d: Likewise.
	* testsuite/gas/mips/loc-swap-2.d: Likewise.
	* testsuite/gas/mips/loc-swap.d: Likewise.
	* testsuite/gas/mips/micromips@loc-swap-2.d: Likewise.
	* testsuite/gas/mips/micromips@loc-swap.d: Likewise.
	* testsuite/gas/mips/mips16@loc-swap-2.d: Likewise.
	* testsuite/gas/mips/mips16@loc-swap.d: Likewise.
	* testsuite/gas/mips/mips16e@loc-swap.d: Likewise.

binutils* testsuite/binutils-all/i386/compressed-1a.d: Update expected output.
	* testsuite/binutils-all/x86-64/compressed-1a.d: Likewise.
2018-12-03 17:26:41 +00:00
Alan Modra 0acc7632bb PR23938, should not free memory alloced in obstack by free()
This removes ineffectual and wrong code caching section names in
gas/stabs.c.  Code like

  seg = subseg_new (name, 0);
  ...
  if (seg->name == name)
    seg->name = xstrdup (name);

with the idea of being able to unconditionally free "name" later no
longer works.  "name" is referenced by the section hash table as well
as in the section->name field.  It would be possible to use
"bfd_rename_section (stdoutput, seg, xstrdup (name))", but instead I
opted for a fairly straight-forward approach of adding extra
parameters to two functions to indicate section name strings should be
freed if possible.

	PR 23938
	* read.h (get_stab_string_offset): Update prototype.
	* stabs.c (get_stab_string_offset): Add free_stabstr_secname
	parameter.  Free stabstr_secname if unused as section name.
	Don't xstrdup name when used.
	(s_stab_generic): Remove forward declaration.  Add
	stab_secname_obstack_end param.  Reference notes obstack via
	macros.  Delete cached_secname.  Adjust get_stab_string_offset
	call.  Free stab_secname if unused as section name.
	(s_stab): Adjust s_stab_generic call.
	(s_xstab): Likewise.  Delete saved_secname and saved_strsecname.
	* config/obj-elf.c (obj_elf_init_stab_section): Adjust
	get_stab_string_offset call.
	* config/obj-coff.c (obj_coff_init_stab_section): Likewise.
	* config/obj-som.c (obj_som_init_stab_section): Likewise.
	* testsuite/gas/all/pr23938.s: New test.
	* testsuite/gas/all/gas.exp: Run it.
2018-12-01 15:18:04 +10:30
Fredrik Noring 27c634e0ed GAS/MIPS: Add `-mfix-r5900' option for the R5900 short loop erratum
`-march=r5900' already enables the R5900 short loop workaround.
However, the R5900 ISA and most other MIPS ISAs are mutually
exclusive since R5900-specific instructions are generated as well.

The `-mfix-r5900' option can be used in combination with e.g.
`-mips2' or `-mips3' to generate generic MIPS binaries that also
work with the R5900 target.

This change has been tested with `make RUNTESTFLAGS=mips.exp
check-gas' for the targets `mipsr5900el-unknown-linux-gnu',
`mipsr5900el-elf' and `mips3-unknown-linux-gnu'.

	gas/
	* config/tc-mips.c (mips_fix_r5900, mips_fix_r5900_explicit):
	New variables.
	(options): Add OPTION_FIX_R5900 and OPTION_NO_FIX_R5900
	enumeration constants.
	(md_longopts): Add "mfix-r5900" and "mno-fix-r5900" options.
	(can_swap_branch_p, md_parse_option, mips_after_parse_args):
	Handle the new options.
	(md_show_usage): Document the `-mfix-r5900' option.
	* doc/as.texi: Likewise.
	* doc/c-mips.texi: Likewise.
	* testsuite/gas/mips/mips.exp: Run R5900 dump tests.
	* testsuite/gas/mips/r5900-fix.d: Test `-mfix-r5900' option.
	* testsuite/gas/mips/r5900-fix.s: Likewise.
	* testsuite/gas/mips/r5900-no-fix.d: Test `-mno-fix-r5900'.
	* testsuite/gas/mips/r5900-no-fix.s: Likewise.
2018-11-30 18:32:36 +00:00
Jim Wilson 4765cd6119 RISC-V: Add .insn CA support.
gas/
	* config/tc-riscv.c (validate_riscv_insn) <'F'>: Add support for CF6
	and CF2 operands.
	(riscv_ip) <'F'>: Likewise.
	* doc/c-riscv.texi (RISC-V-Formats): Add func6 abbreviation.  Use rs2
	instead of rs1 in CR description.  Add CA docs.
	* gas/testsuite/riscv/insn.s: Add use of .insn ca.
	* gas/testsuite/riscv/insn.d: Update to match.
	include/
	* opcode/riscv.h (OP_MASK_CFUNCT6, OP_SH_CFUNCT6): New.
	(OP_MASK_CFUNCT2, OP_SH_CFUNCT2): New.
	opcodes/
	* riscv-opc.c (ciw): Fix whitespace to align columns.
	(ca): New.
2018-11-27 11:29:23 -08:00
Thomas Preud'homme b5ab31636d [ARM] Update knowledge of bfd architectures
Commit c0c468d562 updated bfd's knowledge
of Arm architectures to Armv5TEJ and later but missed the list of CPUs
recognized by objdump -d -m<cpu>.

.note.gnu.arm.ident related code is intentionally not updated as build
attributes are a better mechanism to express the ISA in a file. However
this patch adds tests for the existing code since no existing testcase
cover those codepaths. Since I've only ever managed for
bfd_arm_get_mach_from_notes () to have an effect by using objcopy on
a file with a note but no Arm build attribute, the tests make use of
both objcopy actions supported by run_dump_test which requires to have a
ld line as well.

Note that the CPU list in bfd/cpu-arm.c was simply copied over from
GAS' CPU list but sorted alphabetically as already done for existing
entries.

2018-11-27  Thomas Preud'homme  <thomas.preudhomme@linaro.org>

bfd/
	* cpu-arm.c (processors): Add processors known to GAS but missing here
	and reindent.
	(bfd_arm_update_notes): Add comment explaining why the list of
	architectures in the switch should not be updated.
	(architectures): Likewise.

gas/
	* testsuite/gas/arm/cpu-arm1020.d: New testcase.
	* testsuite/gas/arm/cpu-arm1020e.d: Likewise.
	* testsuite/gas/arm/cpu-arm1020t.d: Likewise.
	* testsuite/gas/arm/cpu-arm1022e.d: Likewise.
	* testsuite/gas/arm/cpu-arm1026ej-s.d: Likewise.
	* testsuite/gas/arm/cpu-arm1026ejs.d: Likewise.
	* testsuite/gas/arm/cpu-arm10e.d: Likewise.
	* testsuite/gas/arm/cpu-arm10t.d: Likewise.
	* testsuite/gas/arm/cpu-arm10tdmi.d: Likewise.
	* testsuite/gas/arm/cpu-arm1136j-s.d: Likewise.
	* testsuite/gas/arm/cpu-arm1136jf-s.d: Likewise.
	* testsuite/gas/arm/cpu-arm1136jfs.d: Likewise.
	* testsuite/gas/arm/cpu-arm1136js.d: Likewise.
	* testsuite/gas/arm/cpu-arm1156t2-s.d: Likewise.
	* testsuite/gas/arm/cpu-arm1156t2f-s.d: Likewise.
	* testsuite/gas/arm/cpu-arm1176jz-s.d: Likewise.
	* testsuite/gas/arm/cpu-arm1176jzf-s.d: Likewise.
	* testsuite/gas/arm/cpu-arm2.d: Likewise.
	* testsuite/gas/arm/cpu-arm250.d: Likewise.
	* testsuite/gas/arm/cpu-arm3.d: Likewise.
	* testsuite/gas/arm/cpu-arm6.d: Likewise.
	* testsuite/gas/arm/cpu-arm60.d: Likewise.
	* testsuite/gas/arm/cpu-arm600.d: Likewise.
	* testsuite/gas/arm/cpu-arm610.d: Likewise.
	* testsuite/gas/arm/cpu-arm620.d: Likewise.
	* testsuite/gas/arm/cpu-arm7.d: Likewise.
	* testsuite/gas/arm/cpu-arm70.d: Likewise.
	* testsuite/gas/arm/cpu-arm700.d: Likewise.
	* testsuite/gas/arm/cpu-arm700i.d: Likewise.
	* testsuite/gas/arm/cpu-arm710.d: Likewise.
	* testsuite/gas/arm/cpu-arm7100.d: Likewise.
	* testsuite/gas/arm/cpu-arm710c.d: Likewise.
	* testsuite/gas/arm/cpu-arm710t.d: Likewise.
	* testsuite/gas/arm/cpu-arm720.d: Likewise.
	* testsuite/gas/arm/cpu-arm720t.d: Likewise.
	* testsuite/gas/arm/cpu-arm740t.d: Likewise.
	* testsuite/gas/arm/cpu-arm7500.d: Likewise.
	* testsuite/gas/arm/cpu-arm7500fe.d: Likewise.
	* testsuite/gas/arm/cpu-arm7d.d: Likewise.
	* testsuite/gas/arm/cpu-arm7di.d: Likewise.
	* testsuite/gas/arm/cpu-arm7dm.d: Likewise.
	* testsuite/gas/arm/cpu-arm7dmi.d: Likewise.
	* testsuite/gas/arm/cpu-arm7m.d: Likewise.
	* testsuite/gas/arm/cpu-arm7t.d: Likewise.
	* testsuite/gas/arm/cpu-arm7tdmi-s.d: Likewise.
	* testsuite/gas/arm/cpu-arm7tdmi.d: Likewise.
	* testsuite/gas/arm/cpu-arm8.d: Likewise.
	* testsuite/gas/arm/cpu-arm810.d: Likewise.
	* testsuite/gas/arm/cpu-arm9.d: Likewise.
	* testsuite/gas/arm/cpu-arm920.d: Likewise.
	* testsuite/gas/arm/cpu-arm920t.d: Likewise.
	* testsuite/gas/arm/cpu-arm922t.d: Likewise.
	* testsuite/gas/arm/cpu-arm926ej-s.d: Likewise.
	* testsuite/gas/arm/cpu-arm926ej.d: Likewise.
	* testsuite/gas/arm/cpu-arm926ejs.d: Likewise.
	* testsuite/gas/arm/cpu-arm940t.d: Likewise.
	* testsuite/gas/arm/cpu-arm946e-r0.d: Likewise.
	* testsuite/gas/arm/cpu-arm946e-s.d: Likewise.
	* testsuite/gas/arm/cpu-arm946e.d: Likewise.
	* testsuite/gas/arm/cpu-arm966e-r0.d: Likewise.
	* testsuite/gas/arm/cpu-arm966e-s.d: Likewise.
	* testsuite/gas/arm/cpu-arm966e.d: Likewise.
	* testsuite/gas/arm/cpu-arm968e-s.d: Likewise.
	* testsuite/gas/arm/cpu-arm9e-r0.d: Likewise.
	* testsuite/gas/arm/cpu-arm9e.d: Likewise.
	* testsuite/gas/arm/cpu-arm9tdmi.d: Likewise.
	* testsuite/gas/arm/cpu-arm_any.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-a12.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-a15.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-a17.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-a32.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-a35.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-a5.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-a53.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-a55.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-a57.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-a7.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-a72.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-a73.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-a75.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-a76.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-a8.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-a9.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-m0.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-m0plus.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-m1.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-m23.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-m3.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-m33.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-m4.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-m7.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-r4.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-r4f.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-r5.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-r52.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-r7.d: Likewise.
	* testsuite/gas/arm/cpu-cortex-r8.d: Likewise.
	* testsuite/gas/arm/cpu-ep9312.d: Likewise.
	* testsuite/gas/arm/cpu-exynos-m1.d: Likewise.
	* testsuite/gas/arm/cpu-fa526.d: Likewise.
	* testsuite/gas/arm/cpu-fa606te.d: Likewise.
	* testsuite/gas/arm/cpu-fa616te.d: Likewise.
	* testsuite/gas/arm/cpu-fa626.d: Likewise.
	* testsuite/gas/arm/cpu-fa626te.d: Likewise.
	* testsuite/gas/arm/cpu-fa726te.d: Likewise.
	* testsuite/gas/arm/cpu-fmp626.d: Likewise.
	* testsuite/gas/arm/cpu-i80200.d: Likewise.
	* testsuite/gas/arm/cpu-iwmmxt.d: Likewise.
	* testsuite/gas/arm/cpu-iwmmxt2.d: Likewise.
	* testsuite/gas/arm/cpu-marvell-pj4.d: Likewise.
	* testsuite/gas/arm/cpu-marvell-whitney.d: Likewise.
	* testsuite/gas/arm/cpu-mpcore.d: Likewise.
	* testsuite/gas/arm/cpu-mpcorenovfp.d: Likewise.
	* testsuite/gas/arm/cpu-sa1.d: Likewise.
	* testsuite/gas/arm/cpu-strongarm.d: Likewise.
	* testsuite/gas/arm/cpu-strongarm1.d: Likewise.
	* testsuite/gas/arm/cpu-strongarm110.d: Likewise.
	* testsuite/gas/arm/cpu-strongarm1100.d: Likewise.
	* testsuite/gas/arm/cpu-strongarm1110.d: Likewise.
	* testsuite/gas/arm/cpu-xgene1.d: Likewise.
	* testsuite/gas/arm/cpu-xgene2.d: Likewise.
	* testsuite/gas/arm/cpu-xscale.d: Likewise.
	* testsuite/gas/arm/nop-asm.s: Likewise.
	* testsuite/gas/arm/note-march-armv2.d: Likewise.
	* testsuite/gas/arm/note-march-armv2.s: Likewise.
	* testsuite/gas/arm/note-march-armv2a.d: Likewise.
	* testsuite/gas/arm/note-march-armv2a.s: Likewise.
	* testsuite/gas/arm/note-march-armv3.d: Likewise.
	* testsuite/gas/arm/note-march-armv3.s: Likewise.
	* testsuite/gas/arm/note-march-armv3m.d: Likewise.
	* testsuite/gas/arm/note-march-armv3m.s: Likewise.
	* testsuite/gas/arm/note-march-armv4.d: Likewise.
	* testsuite/gas/arm/note-march-armv4.s: Likewise.
	* testsuite/gas/arm/note-march-armv4t.d: Likewise.
	* testsuite/gas/arm/note-march-armv4t.s: Likewise.
	* testsuite/gas/arm/note-march-armv5.d: Likewise.
	* testsuite/gas/arm/note-march-armv5.s: Likewise.
	* testsuite/gas/arm/note-march-armv5t.d: Likewise.
	* testsuite/gas/arm/note-march-armv5t.s: Likewise.
	* testsuite/gas/arm/note-march-armv5te.d: Likewise.
	* testsuite/gas/arm/note-march-armv5te.d: Likewise.
	* testsuite/gas/arm/note-march-ep9312.d: Likewise.
	* testsuite/gas/arm/note-march-ep9312.s: Likewise.
	* testsuite/gas/arm/note-march-iwmmxt.d: Likewise.
	* testsuite/gas/arm/note-march-iwmmxt.s: Likewise.
	* testsuite/gas/arm/note-march-iwmmxt2.d: Likewise.
	* testsuite/gas/arm/note-march-iwmmxt2.s: Likewise.
	* testsuite/gas/arm/note-march-xscale.d: Likewise.
	* testsuite/gas/arm/note-march-xscale.s: Likewise.
2018-11-27 18:28:35 +00:00
Jozef Lawrynowicz 35ba4bc019 Tighten the constraints for warning about NOPs for the MSP 430 ISA, so NOPs are only inserted/warned about when needed. Specifically: 430 and 430x ISA require a NOP after DINT. Only the 430x ISA requires NOP before EINT. Only the 430x ISA requires NOP after every EINT. CPU42 errata.
* config/tc-msp430.c (is_dint): New.
	(is_eint): New.
	(gen_nop): New.
	(warn_eint_nop): New.
	(warn_unsure_interrupt): New.
	(msp430_operands): Determine the effect MOV #N,SR insns have on
	interrupt state.
	Only emit NOP warnings for 430 ISA in certain situations.
	(msp430_md_end): Only warn about an EINT at the end of the file
	if NOP warnings are enabled.
	* testsuite/gas/msp430/bad.l: Adjust expected output for new warnings.
	* testsuite/gas/msp430/msp430.exp: Run new tests.
	* testsuite/gas/msp430/nop-dint-430.d: New.
	* testsuite/gas/msp430/nop-dint-430.l: New.
	* testsuite/gas/msp430/nop-dint-430x-ignore.d: New.
	* testsuite/gas/msp430/nop-dint-430x-silent.d: New.
	* testsuite/gas/msp430/nop-dint-430x.d: New.
	* testsuite/gas/msp430/nop-dint-430x.l: New.
	* testsuite/gas/msp430/nop-dint.s: New.
	* testsuite/gas/msp430/nop-eint-430.d: New.
	* testsuite/gas/msp430/nop-eint-430.l: New.
	* testsuite/gas/msp430/nop-eint-430x-ignore.d: New.
	* testsuite/gas/msp430/nop-eint-430x-silent.d: New.
	* testsuite/gas/msp430/nop-eint-430x.d: New.
	* testsuite/gas/msp430/nop-eint-430x.l: New.
	* testsuite/gas/msp430/nop-eint.s: New.
	* testsuite/gas/msp430/nop-int-430.d: New.
	* testsuite/gas/msp430/nop-int-430.l: New.
	* testsuite/gas/msp430/nop-int-430x-silent.d: New.
	* testsuite/gas/msp430/nop-int-430x.d: New.
	* testsuite/gas/msp430/nop-int-430x.l: New.
	* testsuite/gas/msp430/nop-int.s: New.
2018-11-27 12:25:09 +00:00
Andre Vieira 06a3cd06d4 [GAS][ARM] Fix testism for bl local v4t test
gas/ChangeLog
2018-11-23  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* testsuite/gas/arm/bl-local-v4t.d: Remove
	warning check.
	* testsuite/gas/arm/blx-local-thumb.s: New.
	* testsuite/gas/arm/blx-local-thumb.d: New.
2018-11-23 17:10:53 +00:00
John Darrington 27f42a4ddb S12Z opcodes: Fix bug disassembling certain shift instructions.
Shift and rotate instructions when the number of bit positions
was an immediate value greater than 1 were incorrectly disassembled.
This change fixes that problem and extends the test to check for
it.

gas/ChangeLog:

  testsuite/gas/s12z/shift.s: Add new test case.
  testsuite/gas/s12z/shift.d: Add expected result.

opcodes/ChangeLog:

  s12z-dis.c (print_insn_shift) [SB_REG_REG_N]: Enter special case
  if the postbyte matches the appropriate pattern.
2018-11-21 21:34:47 +01:00
John Darrington 51534d7ab8 S12Z: Add alias instructions BHS and BLO.
These are documented by NXP as alternative mnemonics for BCC and BCS
respectively.

gas/ChangeLog:

        * config/tc-s12z.c (opcodes): bhs, blo: New members.
	* testsuite/gas/s12z/bra.d: Add tests for aliases.
	* testsuite/gas/s12z/bra.s: Add tests for aliases.
2018-11-21 21:31:10 +01:00
Thomas Preud'homme 497d849d28 [ARM] Improve indentation of ARM architecture declarations
This commit cleans up indentation of ARM architecture declaration,
namely entries of arm_archs and definition of macros ARM_EXT_*,
ARM_AEXT_*, ARM_AEXT2_*, FPU_EXT_*, FPU_ARCH_* and ARM_ARCH_*. It also
gets rid of unused ARM_ARCH_V6M-ONLY and merge AEM_AEXT_V6M_ONLY in
ARM_AEXT_V6M now sole user.

gas/
2018-11-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* config/tc-arm.c (arm_archs): Reindent.

include/
2018-11-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* opcode/arm.h (ARM_AEXT_V6M_ONLY): Merge into its use in ARM_AEXT_V6M.
	(ARM_ARCH_V6M_ONLY): Remove.
	(ARM_EXT_V1, ARM_EXT_V2, ARM_EXT_V2S, ARM_EXT_V3, ARM_EXT_V3M,
	ARM_EXT_V4, ARM_EXT_V4T, ARM_EXT_V5, ARM_EXT_V5T, ARM_EXT_V5ExP,
	ARM_EXT_V5E, ARM_EXT_V5J, ARM_EXT_V6, ARM_EXT_V6K, ARM_EXT_V8,
	ARM_EXT_V6T2, ARM_EXT_DIV, ARM_EXT_V5E_NOTM, ARM_EXT_V6_NOTM,
	ARM_EXT_V7, ARM_EXT_V7A, ARM_EXT_V7R, ARM_EXT_V7M, ARM_EXT_V6M,
	ARM_EXT_BARRIER, ARM_EXT_THUMB_MSR, ARM_EXT_V6_DSP, ARM_EXT_MP,
	ARM_EXT_SEC, ARM_EXT_OS, ARM_EXT_ADIV, ARM_EXT_VIRT, ARM_EXT2_PAN,
	ARM_EXT2_V8_2A, ARM_EXT2_V8M, ARM_EXT2_ATOMICS, ARM_EXT2_V6T2_V8M,
	ARM_EXT2_FP16_INST, ARM_EXT2_V8M_MAIN, ARM_EXT2_RAS, ARM_EXT2_V8_3A,
	ARM_EXT2_V8A, ARM_EXT2_V8_4A, ARM_EXT2_FP16_FML, ARM_EXT2_V8_5A,
	ARM_EXT2_SB, ARM_EXT2_PREDRES, ARM_CEXT_XSCALE, ARM_CEXT_MAVERICK,
	ARM_CEXT_IWMMXT, ARM_CEXT_IWMMXT2, FPU_ENDIAN_PURE, FPU_ENDIAN_BIG,
	FPU_FPA_EXT_V1, FPU_FPA_EXT_V2, FPU_MAVERICK, FPU_VFP_EXT_V1xD,
	FPU_VFP_EXT_V1, FPU_VFP_EXT_V2, FPU_VFP_EXT_V3xD, FPU_VFP_EXT_V3,
	FPU_NEON_EXT_V1, FPU_VFP_EXT_D32, FPU_VFP_EXT_FP16, FPU_NEON_EXT_FMA,
	FPU_VFP_EXT_FMA, FPU_VFP_EXT_ARMV8, FPU_NEON_EXT_ARMV8,
	FPU_CRYPTO_EXT_ARMV8, CRC_EXT_ARMV8, FPU_VFP_EXT_ARMV8xD,
	FPU_NEON_EXT_RDMA, FPU_NEON_EXT_DOTPROD, ARM_AEXT_V1, ARM_AEXT_V2,
	ARM_AEXT_V2S, ARM_AEXT_V3, ARM_AEXT_V3M, ARM_AEXT_V4xM, ARM_AEXT_V4,
	ARM_AEXT_V4TxM, ARM_AEXT_V4T, ARM_AEXT_V5xM, ARM_AEXT_V5,
	ARM_AEXT_V5TxM, ARM_AEXT_V5T, ARM_AEXT_V5TExP, ARM_AEXT_V5TE,
	ARM_AEXT_V5TEJ, ARM_AEXT_V6, ARM_AEXT_V6K, ARM_AEXT_V6Z, ARM_AEXT_V6KZ,
	ARM_AEXT_V6T2, ARM_AEXT_V6KT2, ARM_AEXT_V6ZT2, ARM_AEXT_V6KZT2,
	ARM_AEXT_V7_ARM, ARM_AEXT_V7A, ARM_AEXT_V7VE, ARM_AEXT_V7R,
	ARM_AEXT_NOTM, ARM_AEXT_V6M_ONLY, ARM_AEXT_V6M, ARM_AEXT_V6SM,
	ARM_AEXT_V7M, ARM_AEXT_V7, ARM_AEXT_V7EM, ARM_AEXT_V8A, ARM_AEXT2_V8A,
	ARM_AEXT2_V8_1A, ARM_AEXT2_V8_2A, ARM_AEXT2_V8_3A, ARM_AEXT2_V8_4A,
	ARM_AEXT2_V8_5A, ARM_AEXT_V8M_BASE, ARM_AEXT_V8M_MAIN,
	ARM_AEXT_V8M_MAIN_DSP, ARM_AEXT2_V8M, ARM_AEXT2_V8M_BASE,
	ARM_AEXT2_V8M_MAIN, ARM_AEXT2_V8M_MAIN_DSP, ARM_AEXT_V8R,
	ARM_AEXT2_V8R, FPU_VFP_V1xD, FPU_VFP_V1, FPU_VFP_V2, FPU_VFP_V3D16,
	FPU_VFP_V3, FPU_VFP_V3xD, FPU_VFP_V4D16, FPU_VFP_V4, FPU_VFP_V4_SP_D16,
	FPU_VFP_V5D16, FPU_VFP_ARMV8, FPU_NEON_ARMV8, FPU_CRYPTO_ARMV8,
	FPU_VFP_HARD, FPU_FPA, FPU_ARCH_VFP, FPU_ARCH_FPE, FPU_ARCH_FPA,
	FPU_ARCH_VFP_V1xD, FPU_ARCH_VFP_V1, FPU_ARCH_VFP_V2,
	FPU_ARCH_VFP_V3D16_FP16, FPU_ARCH_VFP_V3, FPU_ARCH_VFP_V3_FP16,
	FPU_ARCH_VFP_V3xD_FP16, FPU_ARCH_NEON_V1, FPU_ARCH_VFP_V3_PLUS_NEON_V1,
	FPU_ARCH_NEON_FP16, FPU_ARCH_VFP_HARD, FPU_ARCH_VFP_V4,
	FPU_ARCH_VFP_V4D16, FPU_ARCH_VFP_V4_SP_D16, FPU_ARCH_VFP_V5D16,
	FPU_ARCH_VFP_V5_SP_D16, FPU_ARCH_NEON_VFP_V4, FPU_ARCH_VFP_ARMV8,
	FPU_ARCH_NEON_VFP_ARMV8, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
	FPU_ARCH_CRYPTO_NEON_VFP_ARMV8_DOTPROD, ARCH_CRC_ARMV8,
	FPU_ARCH_NEON_VFP_ARMV8_1, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8_1,
	FPU_ARCH_DOTPROD_NEON_VFP_ARMV8, ARM_ARCH_V1, ARM_ARCH_V2,
	ARM_ARCH_V2S, ARM_ARCH_V3, ARM_ARCH_V3M, ARM_ARCH_V4xM, ARM_ARCH_V4,
	ARM_ARCH_V4TxM, ARM_ARCH_V4T, ARM_ARCH_V5xM, ARM_ARCH_V5,
	ARM_ARCH_V5TxM, ARM_ARCH_V5T, ARM_ARCH_V5TExP, ARM_ARCH_V5TE,
	ARM_ARCH_V5TEJ, ARM_ARCH_V6, ARM_ARCH_V6K, ARM_ARCH_V6Z, ARM_ARCH_V6KZ,
	ARM_ARCH_V6T2, ARM_ARCH_V6KT2, ARM_ARCH_V6ZT2, ARM_ARCH_V6KZT2,
	ARM_ARCH_V6M, ARM_ARCH_V6SM, ARM_ARCH_V7, ARM_ARCH_V7A, ARM_ARCH_V7VE,
	ARM_ARCH_V7R, ARM_ARCH_V7M, ARM_ARCH_V7EM, ARM_ARCH_V8A,
	ARM_ARCH_V8A_CRC, ARM_ARCH_V8_1A, ARM_ARCH_V8_2A, ARM_ARCH_V8_3A,
	ARM_ARCH_V8_4A, ARM_ARCH_V8_5A, ARM_ARCH_V8M_BASE, ARM_ARCH_V8M_MAIN,
	ARM_ARCH_V8M_MAIN_DSP, ARM_ARCH_V8R): Reindent.
2018-11-13 12:19:28 +00:00
Sudakshina Das 3a0f69be55 [BINUTILS, AARCH64, 8/8] Add data cache instructions for Memory Tagging Extension
This patch is part of the patch series to add support for ARMv8.5-A
Memory Tagging Extensions which is an optional extension to
ARMv8.5-A and is enabled using the +memtag command line option.

This patch adds all the data cache instructions that are part of this
extension:
- DC IGVAC, Xt
- DC IGSW, Xt
- DC CGSW, Xt
- DC CIGSW, Xt
- DC CGVAC, Xt
- DC CGVAP, Xt
- DC CGVADP, Xt
- DC CIGVAC, Xt
- DC GVA, Xt
- DC IGDVAC, Xt
- DC IGDSW, Xt
- DC CGDSW, Xt
- DC CIGDSW, Xt
- DC CGDVAC, Xt
- DC CGDVAP, Xt
- DC CGDVADP, Xt
- DC CIGDVAC, Xt
- DC GZVA, Xt

*** opcodes/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* aarch64-opc.c (aarch64_sys_regs_dc): New entries for
	IGVAC, IGSW, CGSW, CIGSW, CGVAC, CGVAP, CGVADP, CIGVAC, GVA,
	IGDVAC, IGDSW, CGDSW, CIGDSW, CGDVAC, CGDVAP, CGDVADP,
	CIGDVAC and GZVA.
	(aarch64_sys_ins_reg_supported_p): New check for above.

*** gas/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* testsuite/gas/aarch64/sysreg-4.s: Test IGVAC, IGSW,
	CGSW, CIGSW, CGVAC, CGVAP, CGVADP, CIGVAC, GVA,
	IGDVAC, IGDSW, CGDSW, CIGDSW, CGDVAC, CGDVAP, CGDVADP,
	CIGDVAC and GZVA with DC.
	* testsuite/gas/aarch64/sysreg-4.d: Likewise.
	* testsuite/gas/aarch64/illegal-sysreg-4.l: Likewise.
2018-11-12 13:29:38 +00:00
Sudakshina Das 70f3d23af7 [BINUTILS, AARCH64, 7/8] Add system registers for Memory Tagging Extension
This patch is part of the patch series to add support for ARMv8.5-A
Memory Tagging Extensions which is an optional extension to
ARMv8.5-A and is enabled using the +memtag command line option.

This patch adds all the system registers that are part of this
extension and are accessible via the MRS/MSR instructions:
- TCO
- TFSRE0_SL1
- TFSR_EL1
- TFSR_EL2
- TFSR_EL3
- TFSR_EL12
- RGSR_EL1
- GCR_EL1
TCO is also accessible with the MSR(immediate) instruction.

*** opcodes/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* aarch64-opc.c (aarch64_sys_regs): New entries for TCO,
	TFSRE0_SL1, TFSR_EL1, TFSR_EL2, TFSR_EL3, TFSR_EL12,
	RGSR_EL1 and GCR_EL1.
	(aarch64_sys_reg_supported_p): New check for above.
	(aarch64_pstatefields): New entry for TCO.
	(aarch64_pstatefield_supported_p): New check for above.

*** gas/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

	* testsuite/gas/aarch64/sysreg-4.s: Test TCO, TFSRE0_SL1,
	TFSR_EL1, TFSR_EL2, TFSR_EL3, TFSR_EL12, RGSR_EL1 and
	GCR_EL1 MSR and MRS.
	* testsuite/gas/aarch64/sysreg-4.d: Likewise.
	* testsuite/gas/aarch64/illegal-sysreg-4.l: Likewise.
2018-11-12 13:26:01 +00:00