aboutsummaryrefslogtreecommitdiff
path: root/gas
AgeCommit message (Collapse)AuthorFilesLines
2017-06-27MIPS/GAS/testsuite: Drop the `mips16e-' prefix from SAVE/RESTORE testsMaciej W. Rozycki7-4/+21
In preparation to running these tests against regular MIPS instructions. gas/ * testsuite/gas/mips/mips16e-save.d: Rename to... * testsuite/gas/mips/save.d: ... this. * testsuite/gas/mips/mips16e-save-err.d: Update the `error-output' option and rename to... * testsuite/gas/mips/save-err.d: ... this. * testsuite/gas/mips/mips16e-save-err.l: Rename to... * testsuite/gas/mips/save-err.l: ... this. * testsuite/gas/mips/mips16e-save.s: Rename to... * testsuite/gas/mips/save.s: ... this. * testsuite/gas/mips/mips16e-save-err.s: Rename to... * testsuite/gas/mips/save-err.s: ... this. * testsuite/gas/mips/mips.exp: Rename `mips16e-save' and `mips16e-save-err' invocations to `save' and `save-err' respectively and reorder these tests away from MIPS16 tests.
2017-06-27MIPS/GAS/testsuite: Run SAVE/RESTORE tests across all MIPS16e architecturesMaciej W. Rozycki6-7/+20
gas/ * testsuite/gas/mips/mips16e-save.d: Remove `-mmips:isa32 -mmips:16' from `objdump' flags and `-march=mips32 -mips16' from `as' flags. * testsuite/gas/mips/mips16e-save-err.d: Remove `-march=mips32' from `as' flags. * testsuite/gas/mips/mips16e-save.s: Remove the `.set mips16' pseudo-op. * testsuite/gas/mips/mips16e-save-err.s: Likewise. * testsuite/gas/mips/mips.exp: Run SAVE/RESTORE tests across all MIPS16e architectures.
2017-06-27MIPS/GAS/testsuite: Convert `mips16e-save-err' list test to a dump testMaciej W. Rozycki3-1/+10
gas/ * testsuite/gas/mips/mips16e-save-err.d: New test. * gas/testsuite/gas/mips/mips.exp: Fold `mips16e-save-err' list test into the new test.
2017-06-27MIPS/GAS/testsuite: Capitalize the name of the `mips16e-save' testMaciej W. Rozycki2-1/+6
For consistency with the subsequent changes in this area. gas/ * testsuite/gas/mips/mips16e-save.d: Capitalize the `name' option.
2017-06-26RISC-V: Use pc-relative relocation for FDE initial locationKuan-Lin Chen2-1/+24
The symbol address in .eh_frame may be adjusted in _bfd_elf_discard_section_eh_frame, and the content of .eh_frame will be adjusted in _bfd_elf_write_section_eh_frame. Therefore, we cannot insert a relocation whose addend symbol is in .eh_frame. Othrewise, the value may be adjusted twice. bfd/ChangeLog 2017-06-26 Kuan-Lin Chen <rufus@andestech.com> * elfnn-riscv.c (perform_relocation): Support the new R_RISCV_32_PCREL relocation. (riscv_elf_relocate_section): Likewise. * elfxx-riscv.c (howto_table): Likewise. (riscv_reloc_map): Likewise. * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation. * libbfd.h: Regenerate. gas/ChangeLog 2017-06-26 Kuan-Lin Chen <rufus@andestech.com> * config/tc-riscv.c (md_apply_fix) [BFD_RELOC_32]: Convert to a R_RISCV_32_PCREL relocation. include/ChangeLog 2017-06-26 Kuan-Lin Chen <rufus@andestech.com> * elf/riscv.h (R_RISCV_32_PCREL): New.
2017-06-26Check unsupported .symver with common symbolH.J. Lu6-0/+35
The .symver directive on common symbol creates a new common symbol, which shouldn't be allowed, similar to alias on common symbol: $ cat y.S .comm bar,8,8 .set bar1,bar $ as -o y.o y.S y.S: Assembler messages: y.S:2: Error: `bar1' can't be equated to common symbol 'bar' $ PR gas/21661 * config/obj-elf.c (obj_elf_symver): Don't allow .symver with common symbol. (elf_frob_symbol): Likewise. * testsuite/gas/elf/elf.exp: Run pr21661. * testsuite/gas/elf/pr21661.d: New file. * testsuite/gas/elf/pr21661.s: Likewise.
2017-06-26Fix compile time warning building gas for arm-wince target.Nick Clifton2-0/+6
* config/tc-arm.c (fpu_any): Only define for ELF based targets.
2017-06-26Update check conditions for illegal placed instructions.claziss5-2/+50
ARC cpus do not accept any jump or instructions with long immediate into the delay slots. gas/ 2017-06-07 Claudiu Zissulescu <claziss@synopsys.com> * /config/tc-arc.c (is_br_jmp_insn_p): Update macro with known instructions to be accounted as jumps. (assemble_insn): Check for limms into the delay slots. Emit an error if so. * testsuite/gas/arc/asm-errors-3.d: New file. * testsuite/gas/arc/asm-errors-3.err: Likewise. * testsuite/gas/arc/asm-errors-3.s: Likewise.
2017-06-24[ARM] Add support for ARM Cortex-R52 processorThomas Preud'homme4-1/+12
=== Context === This patch is part of a patch series to add support for ARMv8-R architecture. Its purpose is to add support for ARM Cortex-R52 processor. === Patch description === This patch adds support for Cortex-R52 as an ARMv8-R processor with CRC extensions. 2017-06-26 Thomas Preud'homme <thomas.preudhomme@arm.com> gas/ * NEWS: Mention support of ARM Cortex-R52 processor. * config/tc-arm.c (arm_cpus): Add entry for ARM Cortex-R52 processor. * doc/c-arm.texi: Mention support for -mcpu=cortex-r52.
2017-06-24[ARM] Add support for ARMv8-R in assembler and readelfThomas Preud'homme41-132/+714
=== Context === This patch is part of a patch series to add support for ARMv8-R architecture. Its purpose is to add support for ARMv8-R in GAS: instructions, build attributes and readelf. === Patch description === Although some differences exist for system registers, from GAS point of view ARMv8-R supports the same instructions as ARMv8-A Aarch32 state and a subset of its extensions. This patch therefore introduce a new feature bit to distinguish the availability of the pan, ras and rdma extensions between ARMv8-A and ARMv8-R and allow crypto, fp and simd extensions to be used by ARMv8-R. Most of the changes are then in the testsuite to (i) rename source files and error output to be shared between ARMv8-A and ARMv8-R, (ii) rename files with expected output for ARMv8-A build attributes and (iii) add new files with expected output for ARMv8-R build attributes. 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com> binutils/ * readelf.c (arm_attr_tag_CPU_arch): Fill value for ARMv8-R. gas/ * NEWS: Mention support for ARMv8-R architecture. * config/tc-arm.c (arm_archs): Add entry for ARMv8-R. (arm_extensions): Restrict pan, ras and rdma extension to ARMv8-A and make crypto, fp and simd extensions available to ARMv8-R. (cpu_arch_ver): Add entry for ARMv8-R. (aeabi_set_public_attributes): Update gas_assert for Tag_DIV_use logic. * testsuite/gas/arm/armv8-a+fp.s: Rename into ... * testsuite/gas/arm/armv8-ar+fp.s: This. Remove .arch directive. * testsuite/gas/arm/armv8-a+fp.d: Specify source to assemble and architecture to assemble for. * testsuite/gas/arm/armv8-r+fp.d: New. * testsuite/gas/arm/armv8-a+simd.s: Rename into ... * testsuite/gas/arm/armv8-ar+simd.s: This. Remove .arch directive. * testsuite/gas/arm/armv8-a+simd.d: Specify source to assemble and architecture to assemble for. * testsuite/gas/arm/armv8-r+simd.d: New. * testsuite/gas/arm/armv8-a-bad.s: Rename into ... * testsuite/gas/arm/armv8-ar-bad.s: This. Remove .arch directive. * testsuite/gas/arm/armv8-a-bad.l: Rename into ... * testsuite/gas/arm/armv8-ar-bad.l: This. Decrement line number by 1. * testsuite/gas/arm/armv8-a-bad.d: Specify source to assemble, architecture to assemble for and adjust error output file. * testsuite/gas/arm/armv8-r-bad.d: New. * testsuite/gas/arm/armv8-a-barrier.s: Rename into ... * testsuite/gas/arm/armv8-ar-barrier.s: This. * testsuite/gas/arm/armv8-a-barrier-arm.d: Adjust source. * testsuite/gas/arm/armv8-a-barrier-thumb.d: Likewise. * testsuite/gas/arm/armv8-r-barrier-arm.d: New. * testsuite/gas/arm/armv8-r-barrier-thumb.d: New. * testsuite/gas/arm/armv8-a-it-bad.s: Rename into ... * testsuite/gas/arm/armv8-ar-it-bad.s: This. Remove .arch directive. * testsuite/gas/arm/armv8-a-it-bad.l: Rename into ... * testsuite/gas/arm/armv8-ar-it-bad.l: This. Decrement line number by 1. * testsuite/gas/arm/armv8-a-it-bad.d: Specify source to assemble, architecture to assemble for and adjust error output file. * testsuite/gas/arm/armv8-r-it-bad.d: New. * testsuite/gas/arm/armv8-a.s: Rename into ... * testsuite/gas/arm/armv8-ar.s: This. Remove .arch directive. * testsuite/gas/arm/armv8-a.d: Specify source to assemble and architecture to assemble for. * testsuite/gas/arm/armv8-r.d: New. * testsuite/gas/arm/attr-march-armv8-r+crypto.d: New. * testsuite/gas/arm/attr-march-armv8-r+fp.d: New. * testsuite/gas/arm/attr-march-armv8-r+simd.d: New. * testsuite/gas/arm/attr-march-armv8-r.d: New. * testsuite/gas/arm/crc32.s: Rename into ... * testsuite/gas/arm/crc32-armv8-ar.s: This. * testsuite/gas/arm/crc32.d: Rename into ... * testsuite/gas/arm/crc32-armv8-a.d: This. Specify source to assemble. * testsuite/gas/arm/crc32-armv8-r.d: New. * testsuite/gas/arm/crc32-bad.s: Rename into ... * testsuite/gas/arm/crc32-armv8-ar-bad.s: This. * testsuite/gas/arm/crc32-bad.d: Rename into ... * testsuite/gas/arm/crc32-armv8-a-bad.d: This. Specify source to assemble. * testsuite/gas/arm/crc32-armv8-r-bad.d: New. * testsuite/gas/arm/mask_1.s: Rename into ... * testsuite/gas/arm/mask_1-armv8-ar.s: This. * testsuite/gas/arm/mask_1.d: Rename into ... * testsuite/gas/arm/mask_1-armv8-a.d: This. Specify source to assemble. * testsuite/gas/arm/mask_1-armv8-r.d: new. include/ * elf/arm.h (TAG_CPU_ARCH_V8R): New macro. * opcode/arm.h (ARM_EXT2_V8A): New macro. (ARM_AEXT2_V8A): Rename into ... (ARM_AEXT2_V8AR): This. (ARM_AEXT2_V8A): New macro. (ARM_AEXT_V8R): New macro. (ARM_AEXT2_V8R): New macro. (ARM_ARCH_V8R): New macro.
2017-06-24[ARM] Remove ARMv6S-M special casingThomas Preud'homme2-26/+24
=== Context === This patch is part of a patch series to add support for ARMv8-R architecture. Its purpose is to remove special casing for ARMv6S-M autodetection. === Motivation === Currently, SWI and SVC mnemonics are enabled for ARMv4T and successor architectures with extra checks in the handler function (do_t_swi) to give an error message when ARMv6-M is targeted and some more special casing in aeabi_set_public_attributes. This was made to exclude these mnemonics for ARMv6-M unless the OS extension is in use. However this logic is superfluous: there is already code to check whether an instruction is available based on the feature bit it is part of and whether the targeted architecture has that feature bit. This patch aims at removing that unneeded complexity. === Patch description === The OS extension is already limited to the ARMv6-M architecture so all this patch does is redefined availability of the ARM_EXT_OS feature bit to not be present for ARM_ARCH_V6M. ARM_ARCH_V6SM does not need any change either because it already includes ARM_EXT_OS. The patch also make sure that the error message that was given by do_t_swi when SWI/SVC is unavailable is still the same by detecting the situation in md_assemble. 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com> gas/ * config/tc-arm.c (arm_ext_v6m): Delete. (arm_ext_v7m): Delete. (arm_ext_m): Remove ARM_EXT_OS from the set of feature defined M profile. (arm_arch_v6m_only): Delete. (do_t_swi): Remove special case for ARMv6S-M. (md_assemble): Display error message previously in do_t_swi when SVC is not available. (insns): Guard swi and svc by arm_ext_os for Thumb mode. (aeabi_set_public_attributes): Remove special case for ARMv6S-M. include/ * opcode/arm.h (ARM_AEXT_V4TxM): Add ARM_EXT_OS bit to the set. (ARM_AEXT_V4T): Likewise. (ARM_AEXT_V5TxM): Likewise. (ARM_AEXT_V5T): Likewise. (ARM_AEXT_V6M): Mask off ARM_EXT_OS bit.
2017-06-23RISC-V: Error, don't warn, for shfit amounts/CSRsAndrew Waterman2-8/+13
gas/ChangeLog 2017-05-11 Andrew Waterman <andrew@sifive.com> * config/tc-riscv.c (riscv_ip): Changes as_warn to as_bad for improper shift amounts.
2017-06-22Fix compile time warning about unused static variable.Nick Clifton2-1/+5
* config/tc-arm.c (arm_ext_v7m): Add ATTRIBUTE_UNUSED.
2017-06-21[ARM] Rework Tag_CPU_arch build attribute value selectionThomas Preud'homme8-69/+231
=== Context === This patch is part of a patch series to add support for ARMv8-R architecture. Its purpose is to rework the Tag_CPU_arch build attribute value selection to (i) match architecture or CPU if specified by user without any need for hack and (ii) match an architecture with all the features used if in autodetection mode or return an error. === Motivation === Currently, Tag_CPU_arch build attribute value selection assumes that an architecture is always a superset of architectures released earlier. As such, the logic is to browse architectures in chronological order of release and selecting the Tag_CPU_arch value of the last one to contribute a feature used[1]/requested[2] not contributed by earlier architectures. [1] in case of autodetection mode [2] otherwise, ie. in case of -mcpu/-march or associated directives This logic fails the two objectives mentionned in the Context section. First, due to the assumption it does an architecture can be selected while not having all the features used/requested which fails the second objective. Second, not doing an exact match when an architecture or CPU is selected by the user means the wrong value is chosen when a later architecture provides a subset of the feature bits of an earlier architecture. This is the case for the implementation of ARMv8-R (see later patch). An added benefit of this patch is that it is possible to easily generate more consistent build attribute by setting the feature bits from the architecture matched in aeabi_set_public_attributes in autodetection mode. This is better done as a separate patch because lots of testcase' expected results must then be updated accordingly. === Patch description === The patch changes the main logic for Tag_CPU_arch and Tag_CPU_arch_profile values selection to: - look for an exact match in case an architecture or CPU was specified on the command line or in a directive - select the first released architecture that provides a superset of the feature used in the autodetection case - select the most featureful architecture in case of -march=all The array cpu_arch_ver is updated to include all architectures in order to make the first point work. Note that when looking for an exact match, the architecture with selected extension is tried first and then only the architecture. This is because some architectures are exactly equivalent to an earlier architecture with its extensions selected. ARMv6S-M (= ARMv6-M + OS extension) and ARMv6KZ (ARMv6K + security extension) are two such examples. Other adjustments are also necessary in aeabi_set_public_attributes to make this change work. 1) The logic to set Tag_ARM_ISA_use and Tag_THUMB_ISA_use must check the absence of feature bit used/requested to decide whether to give the default value for empty files (see EABI attribute defaults test). It was previously checking that arch == 0 which would only happen if no feature bit could be matched by any architecture, ie there is no feature bit to match. 2) A fallback to a superset match must exist when no_cpu_selected () returns true. This is because aeabi_set_public_attributes is called again after relaxation and at this point selected_cpu is set from the previous execution of that function. There is therefore no way to check whether the user specified an architecture or CPU. 3) Tag_CPU_arch lines are removed from expected output when the detected architecture should be pre-ARMv4, since 0 is the Tag_CPU_arch value for pre-ARMv4 architectures and default value for an absent entry is 0. 2017-06-21 Thomas Preud'homme <thomas.preudhomme@arm.com> gas/ * config/tc-arm.c (fpu_any): Defined from FPU_ANY. (cpu_arch_ver): Add all architectures and sort by release date. (have_ext_for_needed_feat_p): New. (get_aeabi_cpu_arch_from_fset): New. (aeabi_set_public_attributes): Call above function to determine Tag_CPU_arch and Tag_CPU_arch_profile values. Adapt Tag_ARM_ISA_use and Tag_THUMB_ISA_use selection logic to check absence of feature bit accordingly. * testsuite/gas/arm/attr-march-armv1.d: Fix expected Tag_CPU_arch build attribute value. * testsuite/gas/arm/attr-march-armv2.d: Likewise. * testsuite/gas/arm/attr-march-armv2a.d: Likewise. * testsuite/gas/arm/attr-march-armv2s.d: Likewise. * testsuite/gas/arm/attr-march-armv3.d: Likewise. * testsuite/gas/arm/attr-march-armv3m.d: Likewise. * testsuite/gas/arm/pr12198-2.d: Likewise. include/ * opcode/arm.h (FPU_ANY): New macro.
2017-06-21x86: CET v2.0: Update incssp and setssbsyH.J. Lu7-30/+39
Update x86 assembler and disassembler for CET v2.0: https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf 1. incsspd and incsspq are changed to take a register opeand with a different opcode. 2. setssbsy is changed to take no opeand with a different opcode. gas/ * testsuite/gas/i386/cet-intel.d: Updated. * testsuite/gas/i386/cet.d: Likewise. * testsuite/gas/i386/x86-64-cet-intel.d: Likewise. * testsuite/gas/i386/x86-64-cet.d: Likewise. * testsuite/gas/i386/cet.s: Update incsspd and setssbsy tests. * testsuite/gas/i386/x86-64-cet.s: Likewise. opcodes/ * i386-dis.c (RM_0FAE_REG_5): Removed. (PREFIX_MOD_3_0F01_REG_5_RM_1): Likewise. (PREFIX_MOD_3_0F01_REG_5_RM_0): New. (PREFIX_MOD_3_0FAE_REG_5): Likewise. (prefix_table): Remove PREFIX_MOD_3_0F01_REG_5_RM_1. Add PREFIX_MOD_3_0F01_REG_5_RM_0. (prefix_table): Update PREFIX_MOD_0_0FAE_REG_5. Add PREFIX_MOD_3_0FAE_REG_5. (mod_table): Update MOD_0FAE_REG_5. (rm_table): Update RM_0F01_REG_5. Remove RM_0FAE_REG_5. * i386-opc.tbl: Update incsspd, incsspq and setssbsy. * i386-tbl.h: Regenerated.
2017-06-21x86: CET v2.0: Rename savessp to saveprevsspH.J. Lu7-12/+21
Replace savessp with saveprevssp for CET v2.0: https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf gas/ * testsuite/gas/i386/cet-intel.d: Updated. * testsuite/gas/i386/cet.d: Likewise. * testsuite/gas/i386/x86-64-cet-intel.d: Likewise. * testsuite/gas/i386/x86-64-cet.d: Likewise. * testsuite/gas/i386/cet.s: Replace savessp with saveprevssp. * testsuite/gas/i386/x86-64-cet.s: Likewise. opcodes/ * i386-dis.c (prefix_table): Replace savessp with saveprevssp. * i386-opc.tbl: Likewise. * i386-tbl.h: Regenerated.
2017-06-21x86: CET v2.0: Update NOTRACK prefixH.J. Lu12-81/+221
Update NOTRACK prefix handling to support memory indirect branch for CET v2.0: https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf gas/ * config/tc-i386.c (md_assemble): Update NOTRACK prefix check. * testsuite/gas/i386/notrack-intel.d: Updated. * testsuite/gas/i386/notrack.d: Likewise. * testsuite/gas/i386/notrackbad.l: Likewise. * testsuite/gas/i386/x86-64-notrack-intel.d: Likewise. * testsuite/gas/i386/x86-64-notrack.d: Likewise. * testsuite/gas/i386/x86-64-notrackbad.l: Likewise. * testsuite/gas/i386/notrack.s: Add NOTRACK prefix tests with memory indirect branch. * testsuite/gas/i386/x86-64-notrack.s: Likewise. * testsuite/gas/i386/notrackbad.s: Remove memory indirect branch with NOTRACK prefix. * testsuite/gas/i386/x86-64-notrackbad.s: Likewise. opcodes/ * i386-dis.c (reg_table): Swap indirEv with NOTRACK on "call{&|}" and "jmp{&|}". (NOTRACK_Fixup): Support memory indirect branch with NOTRACK prefix.
2017-06-21[ARM] Allow Thumb division as an extension for ARMv7Thomas Preud'homme4-0/+33
=== Context === This patch is part of a patch series to add support for ARMv8-R architecture. Its purpose is to allow ARMv7 to be selected in automatic architecture selection in presence of Thumb division instructions. === Motivation === any-idiv.d and automatic-sdiv.d testcases in GAS testsuite expect autodetection code to select ARMv7 in presence of Thumb integer division. However, the definition of ARM_AEXT_V7 and thus ARM_ARCH_V7 do not contain these instructions and the idiv extension is only available for ARMv7-A and ARMv7-R. Therefore, under the stricter automatic detection code proposed in the subsequent patch of the series ARMv7 is refused if a Thumb division instruction is present. === Patch description === This patch adds a new "idiv" extension after the existing one that is available to all ARMv7 targets. This new entry is ignored by all current code parsing arm_extensions such that it would be unavailable on the command-line and remain a purely internal hack, easily removed in favor of a better solution later. This is considered though by the subsequent patch reworking automatic detection of build attributes such that ARMv7 is allowed to match in present of Thumb division instructions. For good measure, comments are added in all instances of code browsing arm_extensions to mention the expected behavior in case of duplicate entries as well as a new testcase. 2017-06-20 Thomas Preud'homme <thomas.preudhomme@arm.com> gas/ * config/tc-arm.c (arm_extensions): New duplicate idiv entry to enable Thumb division for ARMv7 architecture. (arm_parse_extension): Document expected behavior for duplicate entries. (s_arm_arch_extension): Likewise. * testsuite/gas/arm/forbid-armv7-idiv-ext.d: New test. * testsuite/gas/arm/forbid-armv7-idiv-ext.l: New expected output for above test.
2017-06-21[ARM] Rework selection of feature bits to base build attributes onThomas Preud'homme2-16/+30
=== Context === This patch is part of a patch series to add support for ARMv8-R architecture. Its purpose is to set the feature bits on which to decide what the build attributes should be according to the mode (autodetection, user specified architecture or CPU, or -march/-mcpu=all). === Motivation === Currently, the flags variable which is used to determine the build attribute is constructed from the instruction used (arm_arch_used and thumb_arch_used) as well as the user specified architecture or CPU (selected_cpu). This means when several .arch are specified the resulting feature bits can be such that no architecture provide them all and can thus result in incorrect Tag_CPU_arch. See for instance what having both .arch armv8-a and .arch armv8-m.base would result in. This is not caught by the testsuite because of further bugs in the Tag_CPU_arch build attribute value selection logic (see next patch in the series). === Patch description === As one would expect, this patch solves the problem by setting flags from feature bits used if in autodetection mode [1] and from selected_cpu otherwise. The logic to set arm_ext_v1, arm_ext_v4t and arm_ext_os feature bits is also moved to only run in autodetection mode since otherwise the architecture or CPU would have a consistent set of feature bits already. [1] No architecture or CPU was specified by the user 2017-06-21 Thomas Preud'homme <thomas.preudhomme@arm.com> gas/ * config/tc-arm.c (aeabi_set_public_attributes): Populate flags from feature bits used or selected_cpu depending on whether a CPU was selected by the user.
2017-06-21[ARM] Simplify Tag_DSP_extension selection logicThomas Preud'homme2-23/+11
=== Context === This patch is part of a patch series to add support for ARMv8-R architecture. Its purpose is to simplify the logic to decide whether to set Tag_DSP_extension. === Motivation === To decide whether to set Tag_DSP_extension, the current code was checking whether the flags had DSP instruction but the architecture selected for Tag_CPU_arch did not have any. This was necessary because extension feature bit were not available separately. This is no longer necessary and can be simplified. === Patch description === The patch change the logic to set Tag_DSP_extension to check whether any DSP feature bit is set in the extension feature bit, as per the definition of that build attribute. The patch also removes all definitions of arm_arch which is now unneeded. 2017-06-21 Thomas Preud'homme <thomas.preudhomme@arm.com> gas/ * config/tc-arm.c (aeabi_set_public_attributes): Test *mcpu_ext_opt to decide whether to set Tag_DSP_extension build attribute value. Remove now useless arm_arch variable.
2017-06-21[ARM] Keep separation between extensions and architecture bits throughout ↵Thomas Preud'homme3-29/+101
execution === Context === This patch is part of a patch series to add support for ARMv8-R architecture. Its purpose is to keep the distinction between architecture feature bits and extension ones after parsing has occured. === Motivation === This distinction is necessary to allow the Tag_CPU_arch build attribute value to be exactly as per the architecture of the selected CPU. With mixed architecture and extension feature bit, it is impossible to find an architecture with an exact match of feature bit and the build attribute value logic must then select the closest match which might not be the right architecture. The previous patch in the patch series makes the distinction possible when parsing -mcpu and .cpu directives but the distinction gets lost after. Similarly feature bits contributed by extensions in -march or .arch_extensions directive are mixed together with architecture extensions. === Patch description === The patch adds new feature bit pointer for extension feature bits. Information from the parsing regarding extensions can then be kept separate in those. This requires adapting arm_parse_extension to deal with two feature bits, allowing the architecture bits to be marked as const. It also requires extra care when setting cpu_variant and selected_cpu because the extension bits are optional since there might not be any extension in use. Note that contrary to cpu feature bits, the extension feature bits are made read/write and are always dynamically allocated. This allows to unconditionally free them in arm_md_post_relax added for this occasion, thereby fixing a longstanding memory leak when arm_parse_extension was invoked (XNEW of ext_fset without corresponding XDELETE). Introduction of arm_md_post_relax is necessary to only free the extension feature bits after aeabi_set_attribute_string has been called for the last time. 2017-06-21 Thomas Preud'homme <thomas.preudhomme@arm.com> gas/ * config/tc-arm.c (dyn_mcpu_ext_opt): New static variable. (dyn_march_ext_opt): Likewise. (md_begin): Copy extension feature bits alongside architecture ones. Merge extensions feature bits in selected_cpu and cpu_variant if there is some. (arm_parse_extension): Pass architecture and extension feature bits in separate parameters, with architecture bits being read only. Update **opt_p directly rather than *ext_set and initialize it if needed. (arm_parse_cpu): Stop merging architecture and extension feature bits and instead use mcpu_cpu_opt and dyn_mcpu_ext_opt to memorize them respectively. Adapt to change in parameters of arm_parse_extension. (arm_parse_arch): Adapt to change in parameters of arm_parse_extension. (aeabi_set_attribute_string): Make function static. (arm_md_post_relax): New function. (s_arm_cpu): Stop merging architecture and extension feature bits and instead use mcpu_cpu_opt and dyn_mcpu_ext_opt to memorize them respectively. Merge extension feature bits in cpu_variant if there is any. (s_arm_arch): Reset extension feature bit. Set selected_cpu from *mcpu_cpu_opt and cpu_variant from selected_cpu and *mfpu_opt for consistency with s_arm_cpu. (s_arm_arch_extension): Update *dyn_mcpu_ext_opt rather than selected_cpu, allocating it before hand if needed. Set selected_cpu from it and then cpu_variant. (s_arm_fpu): Merge *mcpu_ext_opt feature bits if any in cpu_variant. * config/tc-arm.h (md_post_relax_hook): Set to arm_md_post_relax. (aeabi_set_public_attributes): Delete external declaration. (arm_md_post_relax): Declare externally.
2017-06-21[ARM] Separate extensions from architectures in arm_cpusThomas Preud'homme2-162/+381
=== Context === This patch is part of a patch series to add support for ARMv8-R architecture. Its purpose is to distinguish for a CPU the feature bits coming from its architecture from the feature bits coming from extension(s) available in this CPU. === Motivation === This distinction is necessary to allow the Tag_CPU_arch build attribute value to be exactly as per the architecture of the selected CPU. With mixed architecture and extension feature bit, it is impossible to find an architecture with an exact match of feature bit and the build attribute value logic must then select the closest match which might not be the right architecture. === Patch description === The patch creates a new field in the arm_cpus table to hold the feature set for the extensions available in each CPU. The existing architecture feature set is then updated to remove those feature bit. The patch also takes advantage of all the lines being changed to reindent the whole table. Note: This patch *adds* a memory leak due to mcpu_cpu_opt sometimes pointing to dynamically allocated feature bits which is never freeed. The subsequent patch in the series solves this issue as well as a preexisting identical issue in arm_parse_extension. The patches are kept separate for ease of review since they are both big enough already. 2017-06-21 Thomas Preud'homme <thomas.preudhomme@arm.com> gas/ * config/tc-arm.c (struct arm_cpu_option_table): New ext field. (ARM_CPU_OPT): Add parameter to set new ext field and reorder canonical name field just after the name field. (arm_cpus): Move extension feature bit from value field to ext field, reorder parameter according to changes in ARM_CPU_OPT and reindent. (arm_parse_cpu): Point mcpu_cpu_opt to a bitfield merging the value and ext field from the selected arm_cpus entry. (s_arm_cpu): Likewise.
2017-06-21Add support for the Cortex-A55 and Cortex-A75 versions of the AArch64 ↵James Greenhalgh3-0/+13
architecture. * config/tc-aarch64.c (aarch64_cpus): Add cortex-a55 and cortex-a75. * doc/c-aarch64.texi (-mcpu): Document cortex-a55 and cortex-a75.
2017-06-15i386-dis: Add 2 tests with invalid bnd registerH.J. Lu5-0/+41
PR binutils/21594 * testsuite/gas/i386/mpx.s: Add 2 tests with invalid bnd register. * testsuite/gas/i386/x86-64-mpx.s: Likewise. * testsuite/gas/i386/mpx.d: Updated. * testsuite/gas/i386/x86-64-mpx.d: Likewise.
2017-06-14xtensa: don't expect XCHAL_* macros to be constantMax Filippov3-12/+40
Get rid of the assumption that XCHAL_* macros are preprocessor constants: don't use them in preprocessor conditionals or in static variable initializers. 2017-06-14 Max Filippov <jcmvbkbc@gmail.com> bfd/ * elf32-xtensa.c (elf_xtensa_be_plt_entry, elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays, keep both windowed and call0 ABI PLT definitions. (elf_xtensa_create_plt_entry): Use selected ABI to choose upper elf_xtensa_*_plt_entry endex. (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size. gas/ * config/tc-xtensa.c (density_supported, xtensa_fetch_width, absolute_literals_supported): Leave definitions uninitialized. (directive_state): Leave entries for directive_density and directive_absolute_literals initialized to false. (xg_init_global_config, xtensa_init): New functions. * config/tc-xtensa.h (TARGET_BYTES_BIG_ENDIAN): Define as 0. (HOST_SPECIAL_INIT): New definition. (xtensa_init): New declaration.
2017-06-08[ARC] Don't convert _DYNAMIC@ to _GLOBAL_OFFSET_TABLE_Vineet Gupta2-5/+1
Historically the arc abi demanded that a GOT[0] should be referencible as [pc+_DYNAMIC@gotpc]. Hence we convert a _DYNAMIC@gotpc to a GOTPC reference to _GLOBAL_OFFSET_TABLE_. This is no longer the case and uClibc and upcomming GNU libc don't expect this to happen. gas/ChangeLog: Vineet Gupta <vgupta@synopsys.com> Cupertino Miranda <cmiranda@synopsys.com> * config/tc-arc.c (md_undefined_symbol): Changed. * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
2017-06-07Add support for AArch64 system register names IP0, IP1, FP and LR.Michael Collison4-2/+16
* config/tc-aarch64.c (reg_entry_reg_names): Add IP0, IP1, FP, and LR as register aliases of register 16, 17, 29 and 30 respectively. * testsuite/gas/aarch64/diagnostic.l: Remove diagnostic prohibiting register 'lr' which is now an alias. * testsuite/gas/aarch64/diagnostic.s: Remove instruction utilizing register 'lr' which is now an alias.
2017-06-06[Patch, ARM] Relax the restrictions on REG_SP under Thumb mode on ARMv8-AJiong Wang12-18/+328
For Thumb mode, since ARMv8-A, REG_SP is allowed in most of the places in Rd/Rt/Rt2 etc while it was disallowed before ARMv8-A, and was rejected through the "reject_bad_reg" macro and several scattered checks. This patch only rejects REG_SP in "reject_bad_reg" and several related places for legacy architectures before ARMv8-A. I have checked those affected instructions , all of them qualify such relaxations. Testcases adjusted accordingly. * ld-sp-warn.d was written without .arch and without -march options passed. By default it assumes all architectures, so I deleted the REG_SP warning on ldrsb as it's supported on ARMv8-A. There are actually quite a few seperate tests on other architectures, for example ld-sp-warn-v7.l etc., so there the test for ldrsb on legacy architectures are still covered. * sp-pc-validations-bad-t has been extended to armv8-a. * strex-bad-t.d restricted on armv7-a. * Some new tests for REG_SP used as Rd/Rt etc added in sp-usage-thumb2-relax*. gas/ * config/tc-arm.c (reject_bad_reg): Allow REG_SP on ARMv8-A. (parse_operands): Allow REG_SP for OP_oRRnpcsp and OP_RRnpcsp on ARMv8-A. (do_co_reg): Allow REG_SP for Rd on ARMv8-A. (do_t_add_sub): Likewise. (do_t_mov_cmp): Likewise. (do_t_tb): Likewise. * testsuite/gas/arm/ld-sp-warn.l: Delete the warning on REG_SP as Rt for ldrsb. * testsuite/gas/arm/sp-pc-validations-bad-t-v8a.d: New test. * testsuite/gas/arm/sp-pc-validations-bad-t-v8a.l: New test. * testsuite/gas/arm/sp-pc-validations-bad-t.d: Specifies -march=armv7-a. * testsuite/gas/arm/sp-pc-validations-bad-t.s: Remove ".arch armv7-a". * testsuite/gas/arm/sp-usage-thumb2-relax-on-v7.d: New test. * testsuite/gas/arm/sp-usage-thumb2-relax-on-v7.l: New test. * testsuite/gas/arm/sp-usage-thumb2-relax-on-v8.d: New test. * testsuite/gas/arm/sp-usage-thumb2-relax.s: New test. * testsuite/gas/arm/strex-bad-t.d: Specifies -march=armv7-a.
2017-06-05Drop arm support for falkor/qdf24xx targets, not present in released hardware.Jim Wilson3-8/+5
gas/ * config/tc-arm.c (arm_cpus): Delete falkor and qdf24xx entries. * doc/c-arm.texi (-mcpu): Likewise.
2017-06-01S/390: idte/ipte fixesAndreas Krebbel8-27/+17
Later CPU generations added optional operands to the ipte/idte instructions. I've added these with: https://sourceware.org/ml/binutils/2017-05/msg00316.html ... but supported the optional operands only with the specific hardware levels. However, it is more useful to have the optional operands already in the first versions. Of course they need to be zero there. Regression-tested with on s390 and s390x. Committed to mainline. Bye, -Andreas- opcodes/ChangeLog: 2017-06-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * s390-opc.txt: Support the optional parameters with the first versions of ipte/idte. gas/ChangeLog: 2017-06-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * testsuite/gas/s390/esa-g5.d: Add ipte tests. * testsuite/gas/s390/esa-g5.s: Likewise. * testsuite/gas/s390/zarch-z196.d: Remove ipte tests. * testsuite/gas/s390/zarch-z196.s: Likewise. * testsuite/gas/s390/zarch-z990.d: Add idte tests. * testsuite/gas/s390/zarch-z990.s: Likewise. * testsuite/gas/s390/zarch-zEC12.d: Remove ipte/idte tests. * testsuite/gas/s390/zarch-zEC12.s: Likewise.
2017-05-30[ARC] Add arc-cpu.def with processor definitionsAnton Kolesov2-26/+7
This patch extracts ARC CPU definitions from gas/config/tc-arc.c (cpu_types) into a separate file arc-cpu.def. This will allow reuse of CPU type definition in multiple places where it might be needed, for example in disassembler. This will help ensure that gas and disassembker use same option values for CPUs. arc-cpu.def file relies on preprocessor macroses which are defined somewhere else. This for example multiple C files to include arc-cpu.def, but define different macroses, therefore creating different structures. include/ChangeLog: yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com> * elf/arc-cpu.def: New file. gas/ChangeLog: yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com> * config/tc-arc.c (cpu_types): Include arc-cpu.def Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
2017-05-30S/390: Fix indentationAndreas Krebbel1-5/+5
gas/ChangeLog: 2017-05-30 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * config/tc-s390.c (md_gather_operands): Fix indentation.
2017-05-30S/390: Fix instruction types of csdtr and csxtrAndreas Krebbel2-4/+4
opcodes/ChangeLog: 2017-05-30 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * s390-opc.c: Add new instruction types RRF_0URF and RRF_0UREFE. * s390-opc.txt: Fix instruction typs of csdtr and csxtr. gas/ChangeLog: 2017-05-30 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * testsuite/gas/s390/zarch-z9-ec.d: Adjust csdtr and csxtr. * testsuite/gas/s390/zarch-z9-ec.s: Likewise.
2017-05-30S/390: Add missing operand to tb instructionAndreas Krebbel2-2/+2
gas/ChangeLog: 2017-05-30 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * testsuite/gas/s390/esa-g5.d: Add missing operand to tb instruction. * testsuite/gas/s390/esa-g5.s: Likewise. opcodes/ChangeLog: 2017-05-30 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * s390-opc.txt: Add missing operand to tb instruction.
2017-05-30S/390: Add ipte/idte variants with optional operandsAndreas Krebbel4-9/+25
This patch adds missing variants of ipte and idte instructions added with later CPU generations. ipte got an optional operand with z196 and another one with zEC12. idte got an optional operand with zEC12 opcodes/ChangeLog: 2017-05-30 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * s390-opc.c: Add new idte/ipte variants. * s390-opc.txt: Likewise. gas/ChangeLog: 2017-05-30 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * testsuite/gas/s390/zarch-z196.d: Add new idte/ipte variants. * testsuite/gas/s390/zarch-z196.s: Likewise. * testsuite/gas/s390/zarch-zEC12.d: Likewise. * testsuite/gas/s390/zarch-zEC12.s: Likewise.
2017-05-30S/390: Improve error checking for optional operandsAndreas Krebbel1-2/+14
So far we only had an instruction flag which made an arbitrary number of operands optional. This limits error checking capabilities for instructions marked that way. With this patch the optparm flag only allows a single optional parameter and another one is added (optparm2) allowing 2 optional arguments. Hopefully we won't need more than that in the future. So far there will be only a single use of optparm2. gas/ChangeLog: 2017-05-30 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * config/tc-s390.c (md_gather_operands): Support new optparm2 instruction flag. include/ChangeLog: 2017-05-30 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * opcode/s390.h: Add new instruction flags optparm2. opcodes/ChangeLog: 2017-05-30 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * s390-dis.c (s390_print_insn_with_opcode): Support new optparm2 instruction flag. * s390-mkopc.c (main): Recognize the new instruction flag when parsing instruction list.
2017-05-30S/390: Remove optional operand flag.Andreas Krebbel1-19/+0
The per operand optional flag hasn't been used for quite some time. Cleanup some remains. include/ChangeLog: 2017-05-30 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * opcode/s390.h: Remove S390_OPERAND_OPTIONAL. gas/ChangeLog: 2017-05-30 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * config/tc-s390.c (md_gather_operands): Remove code dealing with S390_OPERAND_OPTIONAL.
2017-05-23x86: Update notrackbad tests for non-ELF targetsH.J. Lu3-10/+18
* gas/testsuite/gas/i386/notrackbad.l: Updated for non-ELF targets. * gas/testsuite/gas/i386/x86-64-notrackbad.l: Likewise.
2017-05-23[ARC] Reformat error messages.claziss2-10/+16
gas/ 2017-05-23 Claudiu Zissulescu <claziss@synopsys.com> * config/tc-arc.c (md_apply_fix): Use as_bad_where. (assemble_insn): Use as_bad.
2017-05-22x86: Add NOTRACK prefix supportH.J. Lu13-17/+426
For register indirect branches, NOTRACK prefix (0x3e), which is also the DS segment register prefix, can be used to ignore the CET indirect branch track. gas/ * config/tc-i386.c (REX_PREFIX): Changed to 7. (NOTRACK_PREFIX): New. (MAX_PREFIXES): Changed to 8. (_i386_insn): Add notrack_prefix. (PREFIX_GROUP): Add PREFIX_DS. (add_prefix): Return PREFIX_DS for DS_PREFIX_OPCODE. (md_assemble): Check if NOTRACK prefix is supported. (parse_insn): Set notrack_prefix and issue an error for other prefixes after NOTRACK prefix. * testsuite/gas/i386/i386.exp: Run tests for NOTRACK prefix. * testsuite/gas/i386/notrack-intel.d: New file. * testsuite/gas/i386/notrack.d: Likewise. * testsuite/gas/i386/notrack.s: Likewise. * testsuite/gas/i386/notrackbad.l: Likewise. * testsuite/gas/i386/notrackbad.s: Likewise. * testsuite/gas/i386/x86-64-notrack-intel.d: Likewise. * testsuite/gas/i386/x86-64-notrack.d: Likewise. * testsuite/gas/i386/x86-64-notrack.s: Likewise. * testsuite/gas/i386/x86-64-notrackbad.l: Likewise. * testsuite/gas/i386/x86-64-notrackbad.s: Likewise. include/ * include/opcode/i386.h (NOTRACK_PREFIX_OPCODE): New. opcodes/ * i386-dis.c (NOTRACK_Fixup): New. (NOTRACK): Likewise. (NOTRACK_PREFIX): Likewise. (last_active_prefix): Likewise. (reg_table): Use NOTRACK on indirect call and jmp. (ckprefix): Set last_active_prefix. (prefix_name): Return "notrack" for NOTRACK_PREFIX. * i386-gen.c (opcode_modifiers): Add NoTrackPrefixOk. * i386-opc.h (NoTrackPrefixOk): New. (i386_opcode_modifier): Add notrackprefixok. * i386-opc.tbl: Add NoTrackPrefixOk to indirect call and jmp. Add notrack. * i386-tbl.h: Regenerated.
2017-05-22[AArch64, gas] Support ILP32 triplet aarch64*-linux-gnu_ilp32Jiong Wang6-8/+52
This patch allows AArch64 GAS defaulting to ILP32 if it is configured with aarch64*-linux-gnu_ilp32. "md_after_parse_args" is implemented to update ABI into ILP32 if DEFAULT_ARCH is "aarch64:32". gas/ * configure.tgt: Set "arch" to "aarch64" if ${cpu} equals "aarch64". Recognize the new triplet name aarch64*-linux-gnu_ilp32. * configure.ac: Output DEFAULT_ARCH macro for AArch64. * configure: Regenerate. * config/tc-aarch64.h (aarch64_after_parse_args): New declaration. (md_after_parse_args): New define. * config/tc-aarch64.c (aarch64_abi_type): New enumeration AARCH64_ABI_NONE. (DEFAULT_ARCH): New define. (aarch64_abi): Set default value to AARCH64_ABI_NONE. (aarch64_after_parse_args): New function.
2017-05-19binutils: support for the SPARC M8 processorJose E. Marchesi28-11/+523
This patch adds support for the new SPARC M8 processor (implementing OSA 2017) to binutils. New instructions: - Dictionary Unpack + dictunpack - Partitioned Compare with shifted result + Signed variants: fpcmp{le,gt,eq,ne}{8,16,32}shl + Unsigned variants: fpcmpu{le,gt}{8,16,32}shl - Partitioned Dual-Equal compared, with shifted result + fpcmpde{8,16,32}shl - Partitioned Unsigned Range Compare, with shifted result + fpcmpur{8,16,32}shl - 64-bit shifts on Floating-Point registers + fps{ll,ra,rl}64x - Misaligned loads and stores + ldm{sh,uh,sw,uw,x,ux} + ldm{sh,uh,sw,uw,x,ux}a + ldmf{s,d} + ldmf{s,d}a + stm{h,w,x} + stm{h,w,x}a + stmf{s,d} + stmf{s,d}a - Oracle Numbers + on{add,sub,mul,div} - Reverse Bytes/Bits + revbitsb + revbytes{h,w,x} - Run-Length instructions + rle_burst + rle_length - New crypto instructions + sha3 - Instruction to read the new register %entropy + rd %entropy New Alternate Address Identifiers: - 0x24, #ASI_CORE_COMMIT_COUNT - 0x24, #ASI_CORE_SELECT_COUNT - 0x48, #ASI_ARF_ECC_REG - 0x53, #ASI_ITLB_PROBE - 0x58, #ASI_DSFAR - 0x5a, #ASI_DTLB_PROBE_PRIMARY - 0x5b, #ASI_DTLB_PROBE_REAL - 0x64, #ASI_CORE_SELECT_COMMIT_NHT The new assembler command-line options for selecting the M8 architecture are: -Av9m8 or -Asparc6 for 64-bit binaries. -Av8plusm8 for 32-bit (v8+) binaries. The corresponding disassembler command-line options are: -msparc:v9m8 for 64-bit binaries. -msparc:v8plusm8 for 32-bit (v8+) binaries. Tested for regressions in the following targets: sparc-aout sparc-linux sparc-vxworks sparc64-linux bfd/ChangeLog: 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com> * archures.c (bfd_mach_sparc_v9m8): Define. (bfd_mach_sparc_v8plusm8): Likewise. (bfd_mach_sparc_v9_p): Adjust to M8. (bfd_mach_sparc_64bit_p): Likewise. * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and bfd_mach_sparc_v8plusm8. * bfd-in2.h: Regenerated. * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and sparc:v8plusm8. * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and SHA3. * elf32-sparc.c (elf32_sparc_final_write_processing): Handle bfd_mach_sparc_v8plusm8. binutils/ChangeLog: 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com> * NEWS: Mention the SPARC M8 support. gas/ChangeLog: 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com> * config/tc-sparc.c (sparc_arch_table): Entries for `sparc6', `v9m8' and `v8plusm8'. (sparc_md_end): Handle SPARC_OPCODE_ARCH_M8. (get_hwcap_name): Support the M8 hardware capabilities. (sparc_ip): Handle new operand types. * doc/c-sparc.texi (Sparc-Opts): Document -Av9m8, -Av8plusm8 and -Asparc6, and the corresponding -xarch aliases. * testsuite/gas/sparc/sparc6.s: New file. * testsuite/gas/sparc/sparc6.d: Likewise. * testsuite/gas/sparc/sparc6-diag.s: Likewise. * testsuite/gas/sparc/sparc6-diag.l: Likewise. * testsuite/gas/sparc/fpcmpshl.s: Likewise. * testsuite/gas/sparc/fpcmpshl.d: Likewise. * testsuite/gas/sparc/fpcmpshl-diag.s: Likewise. * testsuite/gas/sparc/fpcmpshl-diag.l: Likewise. * testsuite/gas/sparc/ldm-stm.s: Likewise. * testsuite/gas/sparc/ldm-stm.d: Likewise. * testsuite/gas/sparc/ldm-stm-diag.s: Likewise. * testsuite/gas/sparc/ldm-stm-diag.l: Likewise. * testsuite/gas/sparc/ldmf-stmf.s: Likewise. * testsuite/gas/sparc/ldmf-stmf.d: Likewise. * testsuite/gas/sparc/ldmf-stmf-diag.s: Likewise. * testsuite/gas/sparc/ldmf-stmf-diag.l: Likewise. * testsuite/gas/sparc/on.s: Likewise. * testsuite/gas/sparc/on.d: Likewise. * testsuite/gas/sparc/on-diag.s: Likewise. * testsuite/gas/sparc/on-diag.l: Likewise. * testsuite/gas/sparc/rle.s: Likewise. * testsuite/gas/sparc/rle.d: Likewise. * testsuite/gas/sparc/sparc.exp (gas_64_check): Run new tests. * testsuite/gas/sparc/rdasr.s: Add test for RDENTROPY. * testsuite/gas/sparc/rdasr.d: Likewise. include/ChangeLog: 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com> * elf/sparc.h (ELF_SPARC_HWCAP2_SPARC6): Define. (ELF_SPARC_HWCAP2_ONADDSUB): Likewise. (ELF_SPARC_HWCAP2_ONMUL): Likewise. (ELF_SPARC_HWCAP2_ONDIV): Likewise. (ELF_SPARC_HWCAP2_DICTUNP): Likewise. (ELF_SPARC_HWCAP2_FPCMPSHL): Likewise. (ELF_SPARC_HWCAP2_RLE): Likewise. (ELF_SPARC_HWCAP2_SHA3): Likewise. * opcode/sparc.h (sparc_opcode_arch_val): Add SPARC_OPCODE_ARCH_M8 and adjust SPARC_OPCODE_ARCH_MAX. (HWCAP2_SPARC6): Define. (HWCAP2_ONADDSUB): Likewise. (HWCAP2_ONMUL): Likewise. (HWCAP2_ONDIV): Likewise. (HWCAP2_DICTUNP): Likewise. (HWCAP2_FPCMPSHL): Likewise. (HWCAP2_RLE): Likewise. (HWCAP2_SHA3): Likewise. (OPM): Likewise. (OPMI): Likewise. (ONFCN): Likewise. (REVFCN): Likewise. (SIMM10): Likewise. opcodes/ChangeLog: 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com> * sparc-dis.c (MASK_V9): Include SPARC_OPCODE_ARCH_M8. (X_IMM2): Define. (compute_arch_mask): Handle bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8. (print_insn_sparc): Handle new operand types. * sparc-opc.c (MASK_M8): Define. (v6): Add MASK_M8. (v6notlet): Likewise. (v7): Likewise. (v8): Likewise. (v9): Likewise. (v9a): Likewise. (v9b): Likewise. (v9c): Likewise. (v9d): Likewise. (v9e): Likewise. (v9v): Likewise. (v9m): Likewise. (v9andleon): Likewise. (m8): Define. (HWS_VM8): Define. (HWS2_VM8): Likewise. (sparc_opcode_archs): Add entry for "m8". (sparc_opcodes): Add OSA2017 and M8 instructions dictunpack, fpcmp{ule,ugt,eq,ne,de,ur}{8,16,32}shl, fpx{ll,ra,rl}64x, ldm{sh,uh,sw,uw,x,ux}, ldm{sh,uh,sw,uw,x,ux}a, ldmf{s,d}, ldmf{s,d}a, on{add,sub,mul,div}, rdentropy, revbitsb, revbytes{h,w,x}, rle_burst, rle_length, sha3, stm{h,w,x}, stm{h,w,x}a, stmf{s,d}, stmf{s,d}a. (asi_table): New M8 ASIs ASI_CORE_COMMIT_COUNT, ASI_CORE_SELECT_COUNT, ASI_ARF_ECC_REG, ASI_ITLB_PROBE, ASI_DSFAR, ASI_DTLB_PROBE_PRIMARY, ASI_DTLB_PROBE_REAL, ASI_CORE_SELECT_COMMIT_NHT.
2017-05-19gas: fix tests call-relax and asi-bump-warn in 32-bit SPARC ELF targetsJose E. Marchesi3-2/+8
Tested in targets: sparc-aout sparc-linux sparc-vxworks sparc64-linux 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com> * testsuite/gas/sparc/call-relax.d: Support 32-bit targets. * testsuite/gas/sparc/sparc.exp (gas_64_check): Use -64 to run asi-bump-warn.
2017-05-19Update avrxmega3 linker emulation to support avrxmega2 devices with flash ↵eorg-Johann Lay2-0/+10
memory visible in the SRAM address range. PR ld/21472 ld * emulparams/avrxmega3.sh (RODATA_PM_OFFSET): Set to 0x8000. * scripttempl/avr.sc (__RODATA_PM_OFFSET__) [RODATA_PM_OFFSET]: Use RODATA_PM_OFFSET as default if not already defined. (.data) [!RODATA_PM_OFFSET]: Don't include .rodata and friends. (.rodata) [RODATA_PM_OFFSET]: Put at an offset of __RODATA_PM_OFFSET__. gas * config/tc-avr.c (mcu_types): Add entries for: attiny416, attiny417, attiny816, attiny817.
2017-05-18Don't compare boolean values against TRUE or FALSEAlan Modra5-8/+15
bfd/ * arc-got.h: Don't compare boolean values against TRUE or FALSE. * elf-m10300.c: Likewise. * elf.c: Likewise. * elf32-arc.c: Likewise. * elf32-bfin.c: Likewise. * elf32-m68k.c: Likewise. * elf32-nds32.c: Likewise. * elf32-tilepro.c: Likewise. * elflink.c: Likewise. * elfnn-aarch64.c: Likewise. * elfnn-riscv.c: Likewise. * elfxx-tilegx.c: Likewise. * mach-o.c: Likewise. * peXXigen.c: Likewise. * vms-alpha.c: Likewise. * vms-lib.c: Likewise. opcodes/ * aarch64-asm.c: Don't compare boolean values against TRUE or FALSE. * aarch64-dis.c: Likewise. * aarch64-gen.c: Likewise. * aarch64-opc.c: Likewise. binutils/ * strings.c: Don't compare boolean values against TRUE or FALSE. gas/ * config/tc-aarch64.c: Don't compare booleans against TRUE or FALSE. * config/tc-hppa.c: Likewise. * config/tc-mips.c: Likewise. * config/tc-score7.c: Likewise. ld/ * emultempl/elf32.em: Don't compare boolean values against TRUE or FALSE. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/xtensaelf.em: Likewise.
2017-05-17S/390: Fix arch level of pckmo instruction.Andreas Krebbel4-2/+2
Fix wrong architecture level of PCKMO instruction. Committed to mainline. opcodes/ChangeLog: 2017-05-17 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * s390-opc.txt: PCKMO change arch level to z196. gas/ChangeLog: 2017-05-17 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * testsuite/gas/s390/zarch-z10.d: Remove pckmo. * testsuite/gas/s390/zarch-z10.s: Remove pckmo. * testsuite/gas/s390/zarch-z196.d: Add pckmo. * testsuite/gas/s390/zarch-z196.s: Add pckmo.
2017-05-16Allow target files access to default TC_FORCE_RELOCATION definesAlan Modra23-63/+103
* write.c (GENERIC_FORCE_RELOCATION_LOCAL): Define. (TC_FORCE_RELOCATION_LOCAL): Use it. (GENERIC_FORCE_RELOCATION_SUB_SAME): Define. (TC_FORCE_RELOCATION_SUB_SAME): Use it. * config/tc-arm.h (TC_FORCE_RELOCATION_LOCAL, TC_FORCE_RELOCATION_SUB_SAME): Use GENERIC defines. * config/tc-aarch64.h: Similarly. * config/tc-avr.h: Similarly. * config/tc-cris.h: Similarly. * config/tc-i386.h: Similarly. * config/tc-i960.h: Similarly. * config/tc-ia64.h: Similarly. * config/tc-microblaze.h: Similarly. * config/tc-mips.h: Similarly. * config/tc-msp430.h: Similarly. * config/tc-nds32.h: Similarly. * config/tc-pru.h: Similarly. * config/tc-riscv.h: Similarly. * config/tc-rl78.h: Similarly. * config/tc-s390.h: Similarly. * config/tc-sh.h: Similarly. * config/tc-sh64.h: Similarly. * config/tc-sparc.h: Similarly. * config/tc-xtensa.h: Similarly. * config/tc-mn10300.h: Similarly. (GENERIC_FORCE_RELOCATION_LOCAL): Define. * config/tc-msp430.c (msp430_force_relocation_local): Modify to be addition to rather than replacement of standard TC_FORCE_RELOCATION_LOCAL.
2017-05-15Fix use of ARM ADR and ADRl pseudo-instructions with thumb function symbols.Nick Clifton4-1/+95
PR gas/21458 * config/tc-arm.c (do_adr): If the ADR involves a thumb function symbol, ensure that the T bit will be set. (do_adrl): Likewise. (do_t_adr): Likewise. * testsuite/gas/arm/pr21458.s: New test. * testsuite/gas/arm/pr21458.d: New test driver.
2017-05-15MIPS16e2: Add new MIPS16e2 relaxation GAS and LD testsMaciej W. Rozycki86-114/+1338
Verify MIPS16 PC-relative instruction relaxation using the MIPS16e2 LUI instruction rather than an LI/SLL instruction pair. gas/ * testsuite/gas/mips/mips16-pcrel-1.d: Remove `-mips3' from `as' flags. * testsuite/gas/mips/mips16-pcrel-pic-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-0.d: Likewise. * testsuite/gas/mips/mips16-pcrel-n64-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/mips16-pcrel-reloc-4.d: Likewise. * testsuite/gas/mips/mips16-pcrel-reloc-5.d: Likewise. * testsuite/gas/mips/mips16-pcrel-reloc-6.d: Likewise. * testsuite/gas/mips/mips16-pcrel-reloc-7.d: Likewise. * testsuite/gas/mips/mips16-pcrel-addend-4.d: Likewise. * testsuite/gas/mips/mips16-pcrel-addend-5.d: Likewise. * testsuite/gas/mips/mips16-pcrel-addend-6.d: Likewise. * testsuite/gas/mips/mips16-pcrel-addend-7.d: Likewise. * testsuite/gas/mips/mips16-pcrel-addend-9.d: Likewise. * testsuite/gas/mips/mips16-pcrel-addend-pic-9.d: Likewise. * testsuite/gas/mips/mips16-pcrel-addend-n32-8.d: Likewise. * testsuite/gas/mips/mips16-pcrel-addend-n32-9.d: Likewise. * testsuite/gas/mips/mips16-pcrel-addend-n64-sym32-8.d: Likewise. * testsuite/gas/mips/mips16-pcrel-addend-n64-sym32-9.d: Likewise. * testsuite/gas/mips/mips16-pcrel-addend-n64-8.d: Likewise. * testsuite/gas/mips/mips16-pcrel-addend-n64-9.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-2.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-3.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-6.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-7.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-pic-6.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-n32-4.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-n32-6.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-n64-4.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-n64-6.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-n64-sym32-4.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-n64-sym32-6.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-pic-n32-4.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-pic-n32-6.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-pic-n64-4.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-pic-n64-6.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-pic-n64-sym32-4.d: Likewise. * testsuite/gas/mips/mips16-pcrel-absolute-pic-n64-sym32-6.d: Likewise. * testsuite/gas/mips/mips16e2@mips16-pcrel-0.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-1.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-2.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-n32-0.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-n32-1.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-n64-sym32-0.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-n64-sym32-1.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-delay-0.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-delay-1.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-reloc-2.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-reloc-3.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-reloc-6.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-reloc-7.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-addend-2.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-addend-3.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-addend-6.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-addend-7.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-addend-8.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-addend-9.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-addend-n32-8.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-addend-n32-9.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-addend-n64-sym32-8.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-addend-n64-sym32-9.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-1.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-2.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-3.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-4.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-5.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-6.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-7.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-pic-4.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-pic-6.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-n32-4.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-n32-6.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-n64-sym32-4.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-n64-sym32-6.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-pic-n32-4.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-pic-n32-6.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-pic-n64-sym32-4.d: New test. * testsuite/gas/mips/mips16e2@mips16-pcrel-absolute-pic-n64-sym32-6.d: New test. * testsuite/gas/mips/mips16-pcrel-1.l: Adjust line numbers. * testsuite/gas/mips/mips16-pcrel-1.s: Adjust for alignment preservation between MIPS16 and MIPS16e2 code. * testsuite/gas/mips/mips.exp: Run MIPS16 relaxation tests over all MIPS16 architectures. ld/ * testsuite/ld-mips-elf/mips16e2-pcrel-0.d: New test. * testsuite/ld-mips-elf/mips16e2-pcrel-1.d: New test. * testsuite/ld-mips-elf/mips16e2-pcrel-addend-2.d: New test. * testsuite/ld-mips-elf/mips16e2-pcrel-addend-6.d: New test. * testsuite/ld-mips-elf/mips16e2-pcrel-n32-0.d: New test. * testsuite/ld-mips-elf/mips16e2-pcrel-n32-1.d: New test. * testsuite/ld-mips-elf/mips16e2-pcrel-n64-sym32-0.d: New test. * testsuite/ld-mips-elf/mips16e2-pcrel-n64-sym32-1.d: New test. * testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
2017-05-15MIPS16e2: Add new MIPS16e2 ASE binutils and GAS testsMaciej W. Rozycki31-6/+3425
Verify MIPS16e2 ASE instruction assembly, disassembly and object file flags. binutils/ * testsuite/binutils-all/mips/mips16-undecoded.d: Add `-mips3' to `as' flags. * testsuite/binutils-all/mips/mips16e2-undecoded.d: New test. * testsuite/binutils-all/mips/mips16e2-extend-insn.d: New test. * testsuite/binutils-all/mips/mips16-undecoded.s: Remove `.module mips3'. * testsuite/binutils-all/mips/mips.exp: Run the new tests. gas/ * testsuite/gas/mips/mips16e2.d: New test. * testsuite/gas/mips/mips16e2-mt.d: New test. * testsuite/gas/mips/mips16e2-sub.d: New test. * testsuite/gas/mips/mips16e2@mips16e2-sub.d: New test. * testsuite/gas/mips/mips16e2-mt-sub.d: New test. * testsuite/gas/mips/mips16e2@mips16e2-mt-sub.d: New test. * testsuite/gas/mips/mips16e2-hilo.d: New test. * testsuite/gas/mips/mips16e2-hilo-n32.d: New test. * testsuite/gas/mips/mips16e2-reloc-error.d: New test. * testsuite/gas/mips/mips16e2-imm-error.d: New test. * testsuite/gas/mips/elf_ase_mips16e2.d: New test. * testsuite/gas/mips/elf_ase_mips16e2-2.d: New test. * testsuite/gas/mips/elf-rel9-mips16e2.d: New test. * testsuite/gas/mips/mips16e2-lui.d: New test. * testsuite/gas/mips/mips16e2@mips32r2-sync.d: New test. * testsuite/gas/mips/mips16e2@mips32r2-sync-1.d: New test. * testsuite/gas/mips/mips16e2@lui-2.d: New test. * testsuite/gas/mips/mips16e2-reloc-error.l: New stderr output. * testsuite/gas/mips/mips16e2-imm-error.l: New stderr output. * testsuite/gas/mips/mips16e2@lui-2.l: New stderr output. * testsuite/gas/mips/mips16e2.s: New test source. * testsuite/gas/mips/mips16e2-mt.s: New test source. * testsuite/gas/mips/mips16e2-sub.s: New test source. * testsuite/gas/mips/mips16e2-mt-sub.s: New test source. * testsuite/gas/mips/mips16e2-hilo.s: New test source. * testsuite/gas/mips/mips16e2-reloc-error.s: New test source. * testsuite/gas/mips/mips16e2-imm-error.s: New test source. * testsuite/gas/mips/elf-rel9-mips16e2.s: New test source. * testsuite/gas/mips/mips16e2-lui.s: New test source. * testsuite/gas/mips/mips.exp: Expand `mips32r2-sync', `mips32r2-sync-1', `lui-1' and `lui-2' tests across MIPS16e2 architectures. Run the new tests.