Commit Graph

9895 Commits

Author SHA1 Message Date
Nelson Chu
5a9f5403c7 RISC-V: PR27158, fixed UJ/SB types and added CSS/CL/CS types for .insn.
* Renamed obsolete UJ/SB types and RVC types, also added CSS/CL(CS) types,

[VALID/EXTRACT/ENCODE macros]
BTYPE_IMM:            Renamed from SBTYPE_IMM.
JTYPE_IMM:            Renamed from UJTYPE_IMM.
CITYPE_IMM:           Renamed from RVC_IMM.
CITYPE_LUI_IMM:       Renamed from RVC_LUI_IMM.
CITYPE_ADDI16SP_IMM:  Renamed from RVC_ADDI16SP_IMM.
CITYPE_LWSP_IMM:      Renamed from RVC_LWSP_IMM.
CITYPE_LDSP_IMM:      Renamed from RVC_LDSP_IMM.
CIWTYPE_IMM:          Renamed from RVC_UIMM8.
CIWTYPE_ADDI4SPN_IMM: Renamed from RVC_ADDI4SPN_IMM.
CSSTYPE_IMM:          Added for .insn without special encoding.
CSSTYPE_SWSP_IMM:     Renamed from RVC_SWSP_IMM.
CSSTYPE_SDSP_IMM:     Renamed from RVC_SDSP_IMM.
CLTYPE_IMM:           Added for .insn without special encoding.
CLTYPE_LW_IMM:        Renamed from RVC_LW_IMM.
CLTYPE_LD_IMM:        Renamed from RVC_LD_IMM.
RVC_SIMM3:            Unused and removed.
CBTYPE_IMM:           Renamed from RVC_B_IMM.
CJTYPE_IMM:           Renamed from RVC_J_IMM.

* Added new operands and removed the unused ones,

C5: Unsigned CL(CS) immediate, added for .insn directive.
C6: Unsigned CSS immediate, added for .insn directive.
Ci: Unused and removed.
C<: Unused and removed.

bfd/
    PR 27158
    * elfnn-riscv.c (perform_relocation): Updated encoding macros.
    (_bfd_riscv_relax_call): Likewise.
    (_bfd_riscv_relax_lui): Likewise.
    * elfxx-riscv.c (howto_table): Likewise.
gas/
    PR 27158
    * config/tc-riscv.c (riscv_ip): Updated encoding macros.
    (md_apply_fix): Likewise.
    (md_convert_frag_branch): Likewise.
    (validate_riscv_insn): Likewise.  Also arranged operands, including
    added C5 and C6 operands, and removed unused Ci and C< operands.
    * doc/c-riscv.texi: Updated and added CSS/CL/CS types.
    * testsuite/gas/riscv/insn.d: Added CSS/CL/CS instructions.
    * testsuite/gas/riscv/insn.s: Likewise.
gdb/
    PR 27158
    * riscv-tdep.c (decode_ci_type_insn): Updated encoding macros.
    (decode_j_type_insn): Likewise.
    (decode_cj_type_insn): Likewise.
    (decode_b_type_insn): Likewise.
    (decode): Likewise.
include/
    PR 27158
    * opcode/riscv.h: Updated encoding macros.
opcodes/
    PR 27158
    * riscv-dis.c (print_insn_args): Updated encoding macros.
    * riscv-opc.c (MASK_RVC_IMM): defined to ENCODE_CITYPE_IMM.
    (match_c_addi16sp): Updated encoding macros.
    (match_c_lui): Likewise.
    (match_c_lui_with_hint): Likewise.
    (match_c_addi4spn): Likewise.
    (match_c_slli): Likewise.
    (match_slli_as_c_slli): Likewise.
    (match_c_slli64): Likewise.
    (match_srxi_as_c_srxi): Likewise.
    (riscv_insn_types): Added .insn css/cl/cs.
sim/
    PR 27158
    * riscv/sim-main.c (execute_i): Updated encoding macros.
2021-02-19 11:44:49 +08:00
Nelson Chu
3d73d29e4e RISC-V: Add bfd/cpu-riscv.h to support all spec versions controlling.
Make the opcode/riscv-opc.c and include/opcode/riscv.h tidy, move the
spec versions stuff to bfd/cpu-riscv.h.  Also move the csr stuff and
ext_version_table to gas/config/tc-riscv.c for internal use.  To avoid
too many repeated code, define general RISCV_GET_SPEC_NAME/SPEC_CLASS
macros.  Therefore, assembler/dis-assembler/linker/gdb can get all spec
versions related stuff from cpu-riscv.h and cpu-riscv.c, since the stuff
are defined there uniformly.

bfd/
    * Makefile.am: Added cpu-riscv.h.
    * Makefile.in: Regenerated.
    * po/SRC-POTFILES.in: Regenerated.
    * cpu-riscv.h: Added to support spec versions controlling.
    Also added extern arrays and functions for cpu-riscv.c.
    (enum riscv_spec_class): Define all spec classes here uniformly.
    (struct riscv_spec): Added for all specs.
    (RISCV_GET_SPEC_CLASS): Added to reduce repeated code.
    (RISCV_GET_SPEC_NAME): Likewise.
    (RISCV_GET_ISA_SPEC_CLASS): Added to get ISA spec class.
    (RISCV_GET_PRIV_SPEC_CLASS): Added to get privileged spec class.
    (RISCV_GET_PRIV_SPEC_NAME): Added to get privileged spec name.
    * cpu-riscv.c (struct priv_spec_t): Replaced with struct riscv_spec.
    (riscv_get_priv_spec_class): Replaced with RISCV_GET_PRIV_SPEC_CLASS.
    (riscv_get_priv_spec_name): Replaced with RISCV_GET_PRIV_SPEC_NAME.
    (riscv_priv_specs): Moved below.
    (riscv_get_priv_spec_class_from_numbers): Likewise, updated.
    (riscv_isa_specs): Moved from include/opcode/riscv.h.
    * elfnn-riscv.c: Included cpu-riscv.h.
    (riscv_merge_attributes): Initialize in_priv_spec and out_priv_spec.
    * elfxx-riscv.c: Included cpu-riscv.h and opcode/riscv.h.
    (RISCV_UNKNOWN_VERSION): Moved from include/opcode/riscv.h.
    * elfxx-riscv.h: Removed extern functions to cpu-riscv.h.
gas/
    * config/tc-riscv.c: Included cpu-riscv.h.
    (enum riscv_csr_clas): Moved from include/opcode/riscv.h.
    (struct riscv_csr_extra): Likewise.
    (struct riscv_ext_version): Likewise.
    (ext_version_table): Moved from opcodes/riscv-opc.c.
    (default_isa_spec): Updated type to riscv_spec_class.
    (default_priv_spec): Likewise.
    (riscv_set_default_isa_spec): Updated.
    (init_ext_version_hash): Likewise.
    (riscv_init_csr_hash): Likewise, also fixed indent.
include/
    * opcode/riscv.h: Moved stuff and make the file tidy.
opcodes/
    * riscv-dis.c: Included cpu-riscv.h, and removed elfxx-riscv.h.
    (default_priv_spec): Updated type to riscv_spec_class.
    (parse_riscv_dis_option): Updated.
    * riscv-opc.c: Moved stuff and make the file tidy.
2021-02-18 15:09:16 +08:00
Alan Modra
089485ff86 h8300 complains about new section defined without attributes
* testsuite/gas/elf/section28.d: xfail h8300.
2021-02-17 16:58:40 +10:30
H.J. Lu
ca1289b9f3 gas: Allow SHF_GNU_RETAIN on all sections
Since SHF_GNU_RETAIN is allowed on all sections, strip SHF_GNU_RETAIN
when checking incorrect section attributes.

	PR gas/27412
	* config/obj-elf.c (obj_elf_change_section): Strip SHF_GNU_RETAIN
	when checking incorrect section attributes.
	* testsuite/gas/elf/elf.exp: Run section28 and section29.
	* testsuite/gas/elf/section28.d: New file.
	* testsuite/gas/elf/section28.s: Likewise.
	* testsuite/gas/elf/section29.d: Likewise.
	* testsuite/gas/elf/section29.s: Likewise.
2021-02-16 04:55:53 -08:00
Jan Beulich
394ae71f02 x86: CVTPI2PD has special behavior
CVTPI2PD with a memory operand, unlike CVTPI2PS, doesn't engage MMX
logic. Therefore it
- has a proper AVX equivalent (CVTDQ2PD) and hence can be subject to
  SSE2AVX translation and SSE checking,
- should not record MMX use in the respective ELF note.
2021-02-16 11:34:25 +01:00
Jan Beulich
3d70986f21 x86: honor template rather than actual operands when updating i.xstate
This undoes a change to md_assemble() that 32930e4edb ("x86: Support
GNU_PROPERTY_X86_ISA_1_V[234] marker") did without any explanation. This
broke a CVTPI2PS property test that a subsequent test will add, and the
updates to existing tests also demonstrate what was wrong: For example,
AVX insns update the full YMM, even if a Vex128 variant is in use.
2021-02-16 11:33:04 +01:00
Jan Beulich
014d61ea14 x86: record register use for SIMD insns without respective explicit operands
VZERO{ALL,UPPER} modify YMM registers despite having no operands.

While {,V}{LD,ST}MXCSR don't modify XMM registers, MXCSR and XMMn
collectively form underlying machine state.
2021-02-16 11:32:18 +01:00
Jan Beulich
cbe6869656 x86: make common property tests common
There's no need to run the exact same test twice. Move the tests which
don't differ between 32- and 64-bit to the "Common tests" section.
2021-02-16 11:30:49 +01:00
Jan Beulich
c2f1204d1f x86: make 16-bit ENQCMD test actually test ENQCMD 2021-02-16 11:26:58 +01:00
Alan Modra
9a12b194b0 PR27426, More bugs in dwarf2dbg.c
PR 27426
	* dwarf2dbg.c (allocate_filename_to_slot): Allocate the dirs array
	in another place.
2021-02-16 14:47:41 +10:30
Alan Modra
7043388668 demand_copy_C_string NUL check
* read.c (demand_copy_C_string): Really check for embedded zeros.
2021-02-16 14:40:14 +10:30
Andreas Krebbel
ba2b480f10 IBM Z: Implement instruction set extensions
opcodes/

        * s390-mkopc.c (main): Accept arch14 as cpu string.
        * s390-opc.txt: Add new arch14 instructions.

include/

        * opcode/s390.h (enum s390_opcode_cpu_val): Add
        S390_OPCODE_ARCH14.

gas/

        * config/tc-s390.c (s390_parse_cpu): New entry for arch14.
        * doc/c-s390.texi: Document arch14 march option.
        * testsuite/gas/s390/s390.exp: Run the arch14 related tests.
        * testsuite/gas/s390/zarch-arch14.d: New test.
        * testsuite/gas/s390/zarch-arch14.s: New test.
2021-02-15 14:32:17 +01:00
Nick Clifton
c46b706620 Change the readelf and objdump programs so that they will automatically follow links to separate debug info files.
* configure.ac (follow-debug-links): Add option to enable or
	disable the following of debug links by default.  Set the
	default for the option to be 'follow'.
	* dwarf.c (do_follow_links): Initialise with DEFAULT_FOR_FOLLOW_LINKS.
	(dwarf_select_sections_by_names): Add no-follow-links option.
	(dwarf_select_sections_by_letter): Add 'N' option.
	* objdump.c (usage): Add conditional text describing the
	follow links option.
	(slurp_symtab): Ensure that there is a NULL entry at the end
	of the symbol table.
	(slurp_dynamic_symtab): Likewise.
	(dump_bfd): When extending the symbol table, ensure that there
	is still a NULL entry at the end.
	* readelf.c (usage): Add conditional text describing the
	follow links option.
	* doc/binutils.texi: Update documentation for objcopy and
	readelf.
	* doc/debug.options.texi: Update documentation of the
	follow-links option.
	* config.in: Regenerate.
	* configure: Regenerate.
	* testsuite/binutils-all/compress.exp: Add the -WN option to
	objdump command lines that are not expecting to follow links.
	* testsuite/binutils-all/readelf.exp: Add the
	--debug-dump=no-follow-links option to tests that are not
	expecting to follow debug links.

gas	* testsuite/gas/mach-o/sections-1.d: Stop automatic debug link
        following.
	* testsuite/gas/xgate/insns-dwarf2.d: Likewise.

ld	* testsuite/ld-elf/sec64k.exp: Stop readelf from automatically
	following debug links.
2021-02-12 14:52:22 +00:00
Alan Modra
3c1d41015b gas testsuite: adjust recently added tests for hppa
Some hppa gas targets treat anything starting in the first column as a
label, so directives can't start there.  Also, binutils_assemble and
run_dump_test cleverly edit test source to suit the hppa .comm
directive which has a different syntax to most targets.  The editing
means we can't match source file names in dumps.  Finally, hppa gas
complains if instructions are emitted without a ".text" or similar
directive.

	* testsuite/gas/all/pr27381.err: Don't match source file name.
	* testsuite/gas/all/pr27381.s: Don't start directive in first column.
	* testsuite/gas/all/pr27384.err: Don't match source file name.
	Adjust line number.
	* testsuite/gas/all/pr27384.s: Add ".text" directive.
	* testsuite/gas/elf/pr27355.err: Don't match source file name.
2021-02-12 18:54:19 +10:30
Alan Modra
933feaf37e Re: Remove arm-symbianelf
gas/
	* NEWS: Mention arm-symbianelf removal.
ld/
	* NEWS: Mention arm-symbianelf removal.
2021-02-11 07:22:20 +10:30
Nick Clifton
01e8b831f5 Remove debugging code accidentally included with the fix for PR 27384
* listing.c (buffer_line): Remove debugging code accidentally
	included with the fix for PR 27384.
2021-02-10 09:56:33 +00:00
Nick Clifton
284beb431f Add a sanity check of files include by .incbin.
PR 27381
	* read.c (s_incbin): Check that the file to be included is a
	regular, non-directory file.
	* testsuite/gas/all/pr27381.s: New test source file.
	* testsuite/gas/all/pr27381.d: New test control file.
	* testsuite/gas/all/pr27381.err: Expected error output for the new test.
	* testsuite/gas/all/gas.exp: Run the new test.
2021-02-09 14:22:23 +00:00
Alan Modra
a57d17732e Remove arm-symbianelf
* configure.ac: Delete arm*-*-symbianelf* entry.
	* configure: Regenerate.
bfd/
	* config.bfd (arm*-*-symbianelf*): Move from obsolete to removed.
	* configure.ac: Delete symbian entries.
	* elf-bfd.h (enum elf_target_os): Delete is_symbian.
	* elf32-arm.c: Remove symbian support.  Formatting.
	* targets.c: Delete symbian entries.
	* configure: Regenerate.
binutils/
	* testsuite/lib/binutils-common.exp (supports_gnu_osabi): Remove
	symbianelf.
gas/
	* Makefile.am (TARG_ENV_HFILES): Remove config/te-symbian.h.
	* config/tc-arm.c (elf32_arm_target_format): Remove TE_SYMBIAN
	support.
	* config/te-symbian.h: Delete.
	* configure.tgt: Remove arm-*-symbianelf*.
	* testsuite/gas/arm/arch4t-eabi.d: Don't mention symbianelf in
	target selection.
	* testsuite/gas/arm/arch4t.d: Likewise.
	* testsuite/gas/arm/got_prel.d: Likewise.
	* testsuite/gas/arm/mapdir.d: Likewise.
	* testsuite/gas/arm/mapmisc.d: Likewise.
	* testsuite/gas/arm/mapsecs.d: Likewise.
	* testsuite/gas/arm/mapshort-eabi.d: Likewise.
	* testsuite/gas/arm/thumb-eabi.d: Likewise.
	* testsuite/gas/arm/thumb.d: Likewise.
	* testsuite/gas/arm/thumbrel.d: Likewise.
	* Makefile.in: Regenerate.
	* po/POTFILES.in: Regenerate.
ld/
	* Makefile.am (ALL_EMULATION_SOURCES): Remove earmsymbian.c.
	Don't include symbian dep file.
	* configure.tgt: Remove arm*-*-symbianelf* entry.
	* emulparams/armsymbian.sh: Delete.
	* ld.texi: Don't mention symbian.
	* scripttempl/armbpabi.sc: Delete.
	* testsuite/ld-arm/symbian-seg1.d: Delete.
	* testsuite/ld-arm/symbian-seg1.s: Delete.
	* testsuite/ld-arm/arm-elf.exp: Don't run symbian-seg1.
	* Makefile.in: Regenerate.
	* po/BLD-POTFILES.in: Regenerate.
2021-02-09 23:36:16 +10:30
Nick Clifton
4a68fcd7f7 Prevent a bad .Psize expression from triggering a memory access violation.
PR 27384
	* listing.c (listing_psize): Check the result of the width
	expression before assigning it to paper_width.
	* testsuite/gas/all/pr27384.s: New test source file.
	* testsuite/gas/all/pr27384.d: New test control file.
	* testsuite/gas/all/pr27384.err: Expected errors from new test.
	* testsuite/gas/all/gas.exp: Run the new test.
2021-02-09 12:53:32 +00:00
Nick Clifton
52563b0f1c Add a test for PR 27355 - where corrupt assembler .file directives could trigger a segmentation fault.
PR 27355
	* testsuite/gas/elf/pr27355.s: New test source file.
	* testsuite/gas/elf/pr27355.d: New test control file.
	* testsuite/gas/elf/pr27355.err: Expected errors from new test.
	* testsuite/gas/elf/elf.exp: Run the new test.
2021-02-09 10:51:40 +00:00
Mike Frysinger
bfd428bc12 opcodes: tic54x: namespace exported variables
The tic54x exports some fairly generic variable names that can
conflict with programs that use them, so put proper tic54x_
prefixes on all of them.
2021-02-08 18:26:08 -05:00
Nick Clifton
80b652efa2 Fix an illegal memory access when parsing a corrupt assembler file.
PR 27355
	* dwarf2dbg.c (allocate_filename_to_slot): Allocate the dirs array
	if it has not already been created.
2021-02-08 18:31:21 +00:00
Nelson Chu
24075dcc85 RISC-V: Removed the v0.93 bitmanip ZBA/ZBB/ZBC instructions.
bfd/
    * elfxx-riscv.c (riscv_parse_prefixed_ext): Removed zb*.
gas/
    * config/tc-riscv.c (riscv_multi_subset_supports): Removed
    INSN_CLASS_ZB*.
    * testsuite/gas/riscv/bitmanip-insns-32.d: Removed.
    * testsuite/gas/riscv/bitmanip-insns-64.d: Removed.
    * testsuite/gas/riscv/bitmanip-insns.s: Removed.
include/
    * opcode/riscv-opc.h: Removed macros for zb* extensions.
    * opcode/riscv.h (riscv_insn_class): Removed INSN_CLASS_ZB*.
opcodes/
    * riscv-opc.c (MASK_RVB_IMM): Removed.
    (riscv_opcodes): Removed zb* instructions.
    (riscv_ext_version_table): Removed versions for zb*.
2021-02-04 16:52:13 +08:00
Andreas Krebbel
61ecbbae8e IBM Z: Add missing vector formats to .insn docs
gas/

	* doc/c-s390.texi: Document vector instruction formats.
2021-02-03 12:35:33 +01:00
Emery Hemingway
1f568f9a0d Add Genode target support
* configure.tgt: Add *-*-genode* as a target for AArch64 and x86.
2021-02-01 17:31:47 +00:00
Alan Modra
7bba67ec7c PR27283 gas for alpha fails to build with gcc 11
PR 27283
	* config/tc-alpha.c (insert_operand): Delete dead code.
2021-02-01 18:35:33 +10:30
H.J. Lu
1f583bc2fc nios2: Don't disable relaxation with --gdwarf-N
GCC 11 passes --gdwarf-5 to assembler to enable DWARF5 debug info.  Don't
disable relaxation when --gdwarf-N is specified.  The assembler generated
debug information will treat the sequence of the relaxed instructions as
a single instruction.

	PR gas/27243
	* config/tc-nios2.c (md_begin): Don't disable relaxation with
	--gdwarf-N.
	* testsuite/gas/nios2/relax.d: New file.
	* testsuite/gas/nios2/relax.s: Likewise.
2021-01-26 08:18:52 -08:00
Alan Modra
a45ef9a30b gas testsuite tidy
This replaces skip and notarget in a number of gas tests with xfail,
the idea being that running tests might expose segmentation faults or
other serious errors even when we don't expect a test to pass.  Doing
so showed a number of cases where tests now pass, which is another
reason to avoid profligate use of notarget and skip.

	* testsuite/gas/all/local-label-overflow.d: Use xfail rather than
	notarget all except hppa.  Comment.
	* testsuite/gas/all/sleb128-2.d: Use xfail rather than notarget.
	* testsuite/gas/all/sleb128-4.d: Likewise.  Don't skip msp430.
	* testsuite/gas/all/sleb128-5.d: Use xfail rather than notarget.
	* testsuite/gas/all/sleb128-7.d: Likewise.
	* testsuite/gas/all/sleb128-9.d: Likewise.
	* testsuite/gas/elf/bignums.d: Likewise.
	* testsuite/gas/elf/group0c.d: Likewise.
	* testsuite/gas/elf/group1a.d: Likewise.
	* testsuite/gas/elf/section-symbol-redef.d: Likewise.
	* testsuite/gas/elf/section15.d: Likewise.
	* testsuite/gas/elf/section4.d: Likewise.
	* testsuite/gas/elf/section7.d: Likewise.
	* testsuite/gas/macros/irp.d: Likewise.
	* testsuite/gas/macros/repeat.d: Likewise.
	* testsuite/gas/macros/rept.d: Likewise.
	* testsuite/gas/macros/test2.d: Likewise.
	* testsuite/gas/macros/vararg.d: Likewise.
	* testsuite/gas/all/string.d: Use xfail rather than skip.
	* testsuite/gas/elf/missing-build-notes.d: Likewise.
	* testsuite/gas/elf/section0.d: Likewise.
	* testsuite/gas/elf/section1.d: Likewise.
	* testsuite/gas/elf/section10.d: Likewise.
	* testsuite/gas/elf/section11.d: Likewise.
	* testsuite/gas/elf/section6.d: Likewise.
	* testsuite/gas/elf/symtab.d: Use xfail rather than skip, adjust hppa.
	* testsuite/gas/elf/symtab.s: Don't start directives in first column.
	* testsuite/gas/macros/test3.d: Don't notarget nds32.
2021-01-26 20:54:43 +10:30
Alan Modra
9886ff0319 gas byte test
skip *-*-* is a little silly, delete the test.

	* testsuite/gas/all/byte.d,
	* testsuite/gas/all/byte.l,
	* testsuite/gas/all/byte.s: Delete.
	* testsuite/gas/all/gas.exp: Don't run byte test.
2021-01-26 20:54:43 +10:30
Alan Modra
4287950e54 pr27228 testcase
This failed on ft32, hppa, and mips-irix targets.  In the case of ft32
the problem was iterating over an array in reverse and not using the
proper condition, so BFD_RELOC_NONE was not recognised.

bfd/
	* elf32-ft32.c (ft32_reloc_type_lookup): Don't miss ft32_reloc_map[0].
gas/
	PR 27282
	* testsuite/gas/all/none.d: Replace skip with xfail, don't xfail ft32.
	* testsuite/gas/elf/pr27228.d: xfail hppa and allow OBJECT match.
2021-01-26 20:54:43 +10:30
H.J. Lu
eea133e655 gas: Add a testcase for PR gas/27228
PR gas/27228
	* testsuite/gas/elf/elf.exp: Run pr27228.
	* testsuite/gas/elf/pr27228.d: New file.
	* testsuite/gas/elf/pr27228.s: Likewise.
2021-01-24 04:14:30 -08:00
Alan Modra
68fcee4fa7 PR27228, .reloc wrong symbol emitted for undefined local symbol
Local symbols are of course supposed to be defined by their object
file, but in other cases a local symbol is promoted to global by gas
if undefined and referenced.  This patch stops gas wrongly replacing a
local undefined symbol with the undefined section symbol, resulting in
a .reloc undefined local symbol being emitted as global.

	PR 27228
	* write.c (resolve_reloc_expr_symbols): Don't assume local symbol
	is defined.
2021-01-24 16:16:45 +10:30
Alan Modra
be07043ea8 PR27221, 058430b4a1 warnings while assembling the Linux kernel
PR 27221
	* dwarf2dbg.c (dwarf2_gen_line_info_1): Don't warn about ignored
	line number info when gas is generating it.
	* testsuite/gas/elf/dwarf2-20.d: Adjust to not expect warnings.
	* testsuite/gas/m68hc11/indexed12.d: Likewise.
	* testsuite/gas/elf/elf.exp: Don't run warn-2.
	* gas/testsuite/gas/elf/warn-2.s: Delete.
2021-01-21 19:10:15 +10:30
Alan Modra
498ff0328f PR27218, memory access violation in dwarf2dbg.c
PR 27218
	* dwarf2dbg.c (dwarf2_gen_line_info): Correct setting of dwarf_level.
	(dwarf2_directive_filename, dwarf2_directive_loc): Likewise, and
	error for negative file numbers.
2021-01-21 19:10:15 +10:30
Alan Modra
4bd7c90276 PowerPC: Don't generate unused section symbols
PowerPC version of git commit d1bcae833b.

bfd/
	* elf32-ppc.c: Delete outdated comment.
	(TARGET_KEEP_UNUSED_SECTION_SYMBOLS): Define.
	* elf64-ppc.c (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): Define.
gas/
	* testsuite/gas/ppc/power4.d: Adjust for removal of section sym.
	* testsuite/gas/ppc/test1elf32.d: Likewise.
	* testsuite/gas/ppc/test1elf64.d: Likewise.
ld/
	* testsuite/ld-powerpc/relbrlt.s: Make symbols global.
	* testsuite/ld-powerpc/relbrlt.d: Adjust to suit.
	* testsuite/ld-powerpc/tlsget.d: Adjust for reordered stubs.
	* testsuite/ld-powerpc/tlsget.wf: Likewise.
	* testsuite/ld-powerpc/tlsget2.d: Likewise.
	* testsuite/ld-powerpc/tlsget2.wf: Likewise.
	* testsuite/ld-powerpc/tlsexe.r: Adjust for removed section syms.
	* testsuite/ld-powerpc/tlsexe32.r: Likewise.
	* testsuite/ld-powerpc/tlsexe32no.r: Likewise.
	* testsuite/ld-powerpc/tlsexeno.r: Likewise.
	* testsuite/ld-powerpc/tlsexenors.r: Likewise.
	* testsuite/ld-powerpc/tlsexers.r: Likewise.
	* testsuite/ld-powerpc/tlsexetoc.r: Likewise.
	* testsuite/ld-powerpc/tlsexetocrs.r: Likewise.
	* testsuite/ld-powerpc/tlsso.r: Likewise.
	* testsuite/ld-powerpc/tlsso32.r: Likewise.
	* testsuite/ld-powerpc/tlstocso.r: Likewise.
2021-01-20 16:12:06 +10:30
H.J. Lu
705989f19a as: Automatically enable DWARF5 support
Currently

$ as -o x.o x.s

fails when x.s contains DWARF5 ".file 0" or ".loc 0" directives.  Update
assembler to automatically enable DWARF5 support so that

$ gcc -S -g -c x.c
$ gcc -c x.s

works.

	PR gas/27195
	* dwarf2dbg.c (dwarf2_gen_line_info): Set dwarf_level to 5 if
	needed.
	(dwarf2_directive_filename): Likewise.
	(dwarf2_directive_loc): Likewise.
	* testsuite/gas/elf/dwarf-5-file0.d: Pass --gdwarf-3.
	* testsuite/gas/lns/lns-diag-1.l: Remove the
	"Error: file number less than one" errors.
2021-01-18 06:25:17 -08:00
Alan Modra
44365e88c0 PR27198, segv in S_IS_WEAK
Fix a NULL dereference seen when assembling invalid input.

	PR 27198
	* config/tc-i386.c (need_plt32_p): Return FALSE for NULL symbol.
	* testsuite/gas/i386/pr27198.d,
	* gas/testsuite/gas/i386/pr27198.err,
	* gas/testsuite/gas/i386/pr27198.s: New test.
	* gas/testsuite/gas/i386/i386.exp: Run it.
2021-01-18 15:13:10 +10:30
Nelson Chu
1942a04836 RISC-V: Indent and GNU coding standards tidy, also aligned the code.
bfd/
    * elfnn-riscv.c: Indent, labels and GNU coding standards tidy,
    also aligned the code.
gas/
    * config/tc-riscv.c: Indent and GNU coding standards tidy,
    also aligned the code.
    * config/tc-riscv.h: Likewise.
include/
    * opcode/riscv.h: Indent and GNU coding standards tidy,
    also aligned the code.
opcodes/
    * riscv-opc.c (riscv_gpr_names_abi): Aligned the code.
    (riscv_fpr_names_abi): Likewise.
    (riscv_opcodes): Likewise.
    (riscv_insn_types): Likewise.
2021-01-15 17:41:18 +08:00
Nelson Chu
b800637e76 RISC-V: Error and warning messages tidy.
Error and warning messages usually starting with lower case letter,
and without the period at the end.  Besides, add the prefixed "internel:"
at the beginning of the messages when they are caused internally.
Also fix indents and typos.

bfd/
    * elfnn-riscv.c (riscv_merge_attributes): Fix typos of messages.
gas/
    * config/tc-riscv.c: Error and warning messages tidy.
    * testsuite/gas/riscv/priv-reg-fail-fext.l: Updated.
    * testsuite/gas/riscv/priv-reg-fail-read-only-01.l: Likewise.
    * testsuite/gas/riscv/priv-reg-fail-read-only-02.l: Likewise.
    * testsuite/gas/riscv/priv-reg-fail-rv32-only.l: Likewise.
    * testsuite/gas/riscv/priv-reg-fail-version-1p10.l: Likewise.
    * testsuite/gas/riscv/priv-reg-fail-version-1p11.l: Likewise.
    * testsuite/gas/riscv/priv-reg-fail-version-1p9p1.l: Likewise.
ld/
    * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d: Updated.
    * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d: Likewise.
    * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d: Likewise.
    * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d: Likewise.
    * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d: Likewise.
    * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d: Likewise.
opcodes/
    * riscv-dis.c (parse_riscv_dis_option): Fix typos of message.
2021-01-15 17:33:59 +08:00
Nelson Chu
dcd709e056 RISC-V: Comments tidy and improvement.
The GNU coding standards said the comments should be complete sentences
and end with a period and two spaces.  But sometimes it should be more
cleaner when the comments only include a word or codes.  Therefore, I made
the following changes after referring to other target/generic codes,

* Try to write sentences in comments, must end with a period and two spaces.
* End with two spaces without a period for codes/instructions only.
* End with one space without a period for a single word/variable only.

Besids, also rewrite/remove some comments which are obsolete or too long,
and fix indents for comments.

bfd/
    * elfnn-riscv.c: Comments tidy and improvement.
    * elfxx-riscv.c: Likewise.
    * elfxx-riscv.h: Likewise.
gas/
    * config/tc-riscv.c: Comments tidy and improvement.  Also update
    comment "fallthru" to "Fall through" that end with a period and
    two spaces.
include/
    * elf/riscv.h: Comments tidy and improvement.
    * opcode/riscv-opc.h: Likewise.
    * opcode/riscv.h: Likewise.
opcodes/
    * riscv-dis.c: Comments tidy and improvement.
    * riscv-opc.c: Likewise.
2021-01-15 17:28:07 +08:00
Mike Frysinger
5fda40b28f gas: make [248]byte directives available everywhere
These aren't specific to ELF at all, and seem generally useful.
So pull them out of the ELF backend and into the common core.
2021-01-14 20:43:40 -05:00
Mike Frysinger
abad28152e gas: bfin: build lexer with -Werror
The makefile has comments about old versions of bison/yacc generating
warnings, but that doesn't apply to the lexer which comes from flex.
As far as I can tell, the warnings in the Blackfin lexer can be fixed
with defines that have been supported back through flex in 2002.  So
lets turn on -Werror for it and see if anyone notices.  If they do,
they can report their exact tool versions so we can record that here.
2021-01-14 01:07:13 -05:00
Mike Frysinger
adb0bd8fda gas: bfin: fix build time warnings 2021-01-14 00:53:13 -05:00
H.J. Lu
844bf810cf x86: Don't generate GOT_symbol for PLT relocations
Don't generate the _GLOBAL_OFFSET_TABLE_ symbol for PLT relocations
since it isn't needed.

	PR gas/27178
	* config/tc-i386.c (lex_got::gotrel): Add need_GOT_symbol.
	Don't generate GOT_symbol for PLT relocations.
	* testsuite/gas/i386/i386.exp: Run PR gas/27178 tests.
	* testsuite/gas/i386/no-got.d: New file.
	* testsuite/gas/i386/no-got.s: Likewise.
	* testsuite/gas/i386/x86-64-no-got.d: Likewise.
	* testsuite/gas/i386/x86-64-no-got.s: Likewise.
2021-01-13 05:42:27 -08:00
Alan Modra
5347ed60c5 Regen Makefile.in for jobserver.m4 aclocal.m4 dependency
bfd/
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
binutils/
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
gas/
	* Makefile.in: Regenerate.
	* Makefile.in: Regenerate.
gprof/
	* Makefile.in: Regenerate.
ld/
	* Makefile.in: Regenerate.
libctf/
	* Makefile.in: Regenerate.
opcodes/
	* Makefile.in: Regenerate.
2021-01-13 22:06:02 +10:30
H.J. Lu
d546b61084 Implement a workaround for GNU mak jobserver
Compiling binutils using -flto=jobserver with GCC 11 leads to

libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Wwrite-strings -I../../gas/../zlib -g -O2 -fprofile-generate -flto=jobserver -o as-new app.o as.o atof-generic.o compress-debug.o cond.o depend.o dwarf2dbg.o dw2gencfi.o ecoff.o ehopt.o expr.o flonum-copy.o flonum-konst.o flonum-mult.o frags.o hash.o input-file.o input-scrub.o listing.o literal.o macro.o messages.o output-file.o read.o remap.o sb.o stabs.o subsegs.o symbols.o write.o config/tc-i386.o config/obj-elf.o config/atof-ieee.o  ../opcodes/.libs/libopcodes.a ../bfd/.libs/libbfd.a -L/tmp/binutils-gdb/objdir/zlib -lz ../libiberty/libiberty.a -ldl
lto-wrapper: warning: jobserver is not available: '--jobserver-auth=' is not present in 'MAKEFLAGS'

since the '+' is missing on the recipe line in Makefiles generated by
automake.  Add the '+' to the recipe line by hand.

bfd/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

binutils/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

config/

	PR binutils/26792
	* jobserver.m4: New file.

gas/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

gprof/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

ld/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

libctf/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

opcodes/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.
2021-01-12 05:45:44 -08:00
Nick Clifton
6d104cac0a Updated translations for some subdirectories 2021-01-12 13:18:50 +00:00
H.J. Lu
83b33c6cb9 Binutils: Check if AR works with --plugin and rc
Check if AR works with --plugin and rc before passing --plugin to AR and
RANLIB.

bfd/

	PR ld/27173

binutils/

	PR ld/27173
	* configure: Regenerated.

gas/

	PR ld/27173
	* configure: Regenerated.

gprof/

	PR ld/27173
	* configure: Regenerated.

ld/

	PR ld/27173
	* configure: Regenerated.

libctf/

	PR ld/27173
	* configure: Regenerated.

opcodes/

	PR ld/27173
	* configure: Regenerated.
2021-01-11 16:29:45 -08:00
Kyrylo Tkachov
82c70b08df aarch64: Remove support for CSRE
This patch removes support for the CSRE extension from aarch64
gas/objdump.
CSRE (FEAT_CSRE) is part of the Future Architecture Technologies program
and at this time Arm is withdrawing this particular feature.

The patch removes the system registers and the CSR PDEC instruction.

gas/ChangeLog
	* NEWS: Remove CSRE.
	* config/tc-aarch64.c (parse_csr_operand): Delete.
	(parse_operands): Delete handling of AARCH64_OPND_CSRE_CSR.
	(aarch64_features): Remove csre.
	* doc/c-aarch64.texi: Remove CSRE.
	* testsuite/gas/aarch64/csre.d: Delete.
	* testsuite/gas/aarch64/csre-invalid.s: Likewise.
	* testsuite/gas/aarch64/csre-invalid.d: Likewise.
	* testsuite/gas/aarch64/csre_csr.s: Likewise.
	* testsuite/gas/aarch64/csre_csr.d: Likewise.
	* testsuite/gas/aarch64/csre_csr-invalid.s: Likewise.
	* testsuite/gas/aarch64/csre_csr-invalid.l: Likewise.
	* testsuite/gas/aarch64/csre_csr-invalid.d: Likewise.

include/ChangeLog

	* opcode/aarch64.h (AARCH64_FEATURE_CSRE): Delete.
	(aarch64_opnd): Delete AARCH64_OPND_CSRE_CSR.

opcodes/ChangeLog

	* aarch64-asm-2.c: Regenerate.
	* aarch64-dis-2.c: Likewise.
	* aarch64-opc-2.c: Likewise.
	* aarch64-opc.c (aarch64_print_operand): Delete handling of
	AARCH64_OPND_CSRE_CSR.
	* aarch64-tbl.h (aarch64_feature_csre): Delete.
	(CSRE): Likewise.
	(_CSRE_INSN): Likewise.
	(aarch64_opcode_table): Delete csr.
2021-01-11 15:01:09 +00:00
Nick Clifton
a8aa72b913 Updated translations for multiple subdirectories 2021-01-11 12:55:33 +00:00
H.J. Lu
a4966cd965 Binutils: Pass --plugin to AR and RANLIB
Detect GCC LTO plugin.  Pass --plugin to AR and RANLIB to support LTO
build.

bfd/

	* configure: Regenerated.

binutils/

	* configure: Regenerated.

gas/

	* configure: Regenerated.

gprof/

	* configure: Regenerated.

ld/

	* configure: Regenerated.

libctf/

	* configure: Regenerated.

opcodes/

	* configure: Regenerated.
2021-01-09 06:51:51 -08:00
Nick Clifton
573fe3fbc1 Change version number to 2.36.50 and regenerate files 2021-01-09 11:01:01 +00:00
Nick Clifton
055bc77a80 Add Changelog entries and NEWS entries for 2.36 branch 2021-01-09 10:40:28 +00:00
Peter Bergner
aae7fcb8d7 POWER10: Add Return-Oriented Programming instructions
POWER10 adds some return-oriented programming (ROP) instructions and
this patch adds support for them.  You will notice that they are enabled
for POWER8 and later, not just POWER10 and later.  This is on purpose.
This allows the instructions to be added to POWER8 binaries that can be
run on POWER8, POWER9 and POWER10 cpus.  On POWER8 and POWER9, these
instructions just act as nop's.

opcodes/
	* ppc-opc.c (insert_dw, (extract_dw): New functions.
	(DW, (XRC_MASK): Define.
	(powerpc_opcodes) <hashchk, hashchkp, hashst, haststp>: New mnemonics.
gas/
	* testsuite/gas/ppc/rop-checks.d,
	* testsuite/gas/ppc/rop-checks.l,
	* testsuite/gas/ppc/rop-checks.s,
	* testsuite/gas/ppc/rop.d,
	* testsuite/gas/ppc/rop.s: New tests.
	* testsuite/gas/ppc/ppc.exp: Run them.
2021-01-09 15:16:13 +10:30
Alan Modra
6430704567 configure regen
commit f478212851 did the regen by hand, missed a change in
ld/configure and didn't update line numbers.  Fix that, and an old
regen of ld/Makefile.in with the wrong automake.

bfd/
	* configure: Regenerate.
binutils/
	* configure: Regenerate.
gas/
	* configure: Regenerate.
gprof/
	* configure: Regenerate.
ld/
	* Makefile.in: Regenerate.
	* configure: Regenerate.
libctf/
	* configure: Regenerate.
opcodes/
	* configure: Regenerate.
zlib/
	* configure: Regenerate.
2021-01-09 15:12:44 +10:30
Samuel Thibault
f478212851 libtool.m4: update GNU/Hurd test from upstream. In upstream libtool, 47a889a4ca20 ("Improve GNU/Hurd support.") fixed detection of shlibpath_overrides_runpath, thus avoiding unnecessary relink. This backports it.
.	* libtool.m4: Match gnu* along other GNU systems.

*/ChangeLog:

	* configure: Re-generate.
2021-01-07 16:47:36 +00:00
H.J. Lu
d1bcae833b ELF: Don't generate unused section symbols
For ELF targets, section symbols are required only for relocations.
With -ffunction-sections -fdata-sections, there can be many unused
section symbols.  Sizes of libstdc++.a on Linux/x86-64 in GCC 11 are

With unused section symbols   : 39411698 bytes
Without unused section symbols: 39227002 bytes

The unused section symbols in libstdc++.a occupy more than 180 KB.

Add BSF_SECTION_SYM_USED to indicate if a section symbol should be
included in the symbol table.  The BSF_SECTION_SYM_USED should be set
if the section symbol is used for relocation or the section symbol is
always included in the symbol table.

Add keep_unused_section_symbols to bfd_target to indicate if unused
section symbols should be kept.  If TARGET_KEEP_UNUSED_SECTION_SYMBOLS
is defined as FALSE, unused ection symbols will be removed.

Tested on Linux/x86.  Other ELF backends need to:

1. Define TARGET_KEEP_UNUSED_SECTION_SYMBOLS to FALSE.
2. Mark used section symbols in assembler backend.
3. Remove unused section symbols from expected assembler and linker
outputs.

bfd/

	PR 27109
	* aix386-core.c (core_aix386_vec): Initialize
	keep_unused_section_symbol to TARGET_KEEP_UNUSED_SECTION_SYMBOLS.
	* aout-target.h (MY (vec)): Likewise.
	* binary.c (binary_vec): Likewise.
	* cisco-core.c (core_cisco_be_vec): Likewise.
	(core_cisco_le_vec): Likewise.
	* coff-alpha.c (alpha_ecoff_le_vec): Likewise.
	* coff-i386.c (TARGET_SYM): Likewise.
	(TARGET_SYM_BIG): Likewise.
	* coff-ia64.c (TARGET_SYM): Likewise.
	* coff-mips.c (mips_ecoff_le_vec): Likewise.
	(mips_ecoff_be_vec): Likewise.
	(mips_ecoff_bele_vec): Likewise.
	* coff-rs6000.c (rs6000_xcoff_vec): Likewise.
	(powerpc_xcoff_vec): Likewise.
	* coff-sh.c (sh_coff_small_vec): Likewise.
	(sh_coff_small_le_vec): Likewise.
	* coff-tic30.c (tic30_coff_vec): Likewise.
	* coff-tic54x.c (tic54x_coff0_vec): Likewise.
	(tic54x_coff0_beh_vec): Likewise.
	(tic54x_coff1_vec): Likewise.
	(tic54x_coff1_beh_vec): Likewise.
	(tic54x_coff2_vec): Likewise.
	(tic54x_coff2_beh_vec): Likewise.
	* coff-x86_64.c (TARGET_SYM): Likewise.
	(TARGET_SYM_BIG): Likewise.
	* coff64-rs6000.c (rs6000_xcoff64_vec): Likewise.
	(rs6000_xcoff64_aix_vec): Likewise.
	* coffcode.h (CREATE_BIG_COFF_TARGET_VEC): Likewise.
	(CREATE_BIGHDR_COFF_TARGET_VEC): Likewise.
	(CREATE_LITTLE_COFF_TARGET_VEC): Likewise.
	* elfxx-target.h (TARGET_BIG_SYM): Likewise.
	(TARGET_LITTLE_SYM): Likewise.
	* hppabsd-core.c (core_hppabsd_vec): Likewise.
	* hpux-core.c (core_hpux_vec): Likewise.
	* i386msdos.c (i386_msdos_vec): Likewise.
	* ihex.c (ihex_vec): Likewise.
	* irix-core.c (core_irix_vec): Likewise.
	* mach-o-target.c (TARGET_NAME): Likewise.
	* mmo.c (mmix_mmo_vec): Likewise.
	* netbsd-core.c (core_netbsd_vec): Likewise.
	* osf-core.c (core_osf_vec): Likewise.
	* pdp11.c (MY (vec)): Likewise.
	* pef.c (pef_vec): Likewise.
	(pef_xlib_vec): Likewise.
	* plugin.c (plugin_vec): Likewise.
	* ppcboot.c (powerpc_boot_vec): Likewise.
	* ptrace-core.c (core_ptrace_vec): Likewise.
	* sco5-core.c (core_sco5_vec): Likewise.
	* som.c (hppa_som_vec): Likewise.
	* srec.c (srec_vec): Likewise.
	(symbolsrec_vec): Likewise.
	* tekhex.c (tekhex_vec): Likewise.
	* trad-core.c (core_trad_vec): Likewise.
	* verilog.c (verilog_vec): Likewise.
	* vms-alpha.c (alpha_vms_vec): Likewise.
	* vms-lib.c (alpha_vms_lib_txt_vec): Likewise.
	* wasm-module.c (wasm_vec): Likewise.
	* xsym.c (sym_vec): Likewise.
	* elf.c (ignore_section_sym): Return TRUE if BSF_SECTION_SYM_USED
	isn't set.
	(elf_map_symbols): Don't include ignored section symbols.
	* elfcode.h (elf_slurp_symbol_table): Also set
	BSF_SECTION_SYM_USED on STT_SECTION symbols.
	* elflink.c (bfd_elf_final_link): Generated section symbols only
	when emitting relocations or reqired.
	* elfxx-x86.h (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): New.
	* syms.c (BSF_SECTION_SYM_USED): New.
	* targets.c (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): New.
	(bfd_target): Add keep_unused_section_symbols.
	(bfd_keep_unused_section_symbols): New.
	* bfd-in2.h: Regenerated.

binutils/

	PR 27109
	* objcopy.c (copy_object): Handle section symbols for
	non-relocatable inputs.
	* testsuite/binutils-all/readelf.exp (readelf_test): Check
	is_elf_unused_section_symbols.
	* testsuite/binutils-all/readelf.s-64: Updated.
	* testsuite/binutils-all/readelf.ss: Likewise.
	* testsuite/binutils-all/readelf.ss-64: Likewise.
	* testsuite/binutils-all/readelf.s-64-unused: New file.
	* testsuite/binutils-all/readelf.ss-64-unused: Likewise.
	* testsuite/binutils-all/readelf.ss-unused: Likewise.
	* testsuite/lib/binutils-common.exp
	(is_elf_unused_section_symbols): New proc.

gas/ChangeLog:

	PR 27109
	* read.c (s_reloc): Call symbol_mark_used_in_reloc on the
	section symbol.
	* subsegs.c (subseg_set_rest): Set BSF_SECTION_SYM_USED if needed.
	* write.c (adjust_reloc_syms): Call symbol_mark_used_in_reloc
	on the section symbol.
	(set_symtab): Don't generate unused section symbols.
	(maybe_generate_build_notes): Call symbol_mark_used_in_reloc
	on the section symbol.
	* config/obj-elf.c (elf_adjust_symtab): Call
	symbol_mark_used_in_reloc on the group signature symbol.
	* testsuite/gas/cfi/cfi-label.d: Remove unused section symbols
	from expected output.
	* testsuite/gas/elf/elf.exp (run_elf_list_test): Check
	is_elf_unused_section_symbols.
	* testsuite/gas/elf/section2.e: Updated.
	* testsuite/gas/elf/section2.e-unused: New file.
	* testsuite/gas/elf/symver.d: Remove unused section symbols.
	* testsuite/gas/i386/ilp32/elf/symver.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-size-1.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-size-3.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-size-5.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-unwind.d: Likewise.
	* testsuite/gas/i386/size-1.d: Likewise.
	* testsuite/gas/i386/size-3.d: Likewise.
	* testsuite/gas/i386/svr4.d: Likewise.
	* testsuite/gas/i386/x86-64-size-1.d: Likewise.
	* testsuite/gas/i386/x86-64-size-3.d: Likewise.
	* testsuite/gas/i386/x86-64-size-5.d: Likewise.
	* testsuite/gas/i386/x86-64-unwind.d: Likewise.

ld/

	PR 27109
	* testsuite/ld-elf/export-class.sd: Adjust the expected output.
	* testsuite/ld-elf/loadaddr3b.d: Likewise.
	* testsuite/ld-i386/ibt-plt-1.d: Likewise.
	* testsuite/ld-i386/ibt-plt-2a.d: Likewise.
	* testsuite/ld-i386/ibt-plt-2c.d: Likewise.
	* testsuite/ld-i386/ibt-plt-3a.d: Likewise.
	* testsuite/ld-i386/ibt-plt-3c.d: Likewise.
	* testsuite/ld-i386/pr19636-1d.d: Likewise.
	* testsuite/ld-i386/pr19636-1l.d: Likewise.
	* testsuite/ld-i386/pr19636-2c.d: Likewise.
	* testsuite/ld-ifunc/ifunc-2-i386-now.d: Likewise.
	* testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise.
	* testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d: Likewise.
	* testsuite/ld-ifunc/ifunc-2-x86-64-now.d: Likewise.
	* testsuite/ld-ifunc/ifunc-21-x86-64.d: Likewise.
	* testsuite/ld-ifunc/ifunc-22-x86-64.d: Likewise.
	* testsuite/ld-ifunc/pr17154-i386-now.d: Likewise.
	* testsuite/ld-ifunc/pr17154-i386.d: Likewise.
	* testsuite/ld-ifunc/pr17154-x86-64-now.d: Likewise.
	* testsuite/ld-ifunc/pr17154-x86-64.d: Likewise.
	* testsuite/ld-x86-64/bnd-branch-1-now.d: Likewise.
	* testsuite/ld-x86-64/bnd-ifunc-1-now.d: Likewise.
	* testsuite/ld-x86-64/bnd-ifunc-2-now.d: Likewise.
	* testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise.
	* testsuite/ld-x86-64/bnd-plt-1-now.d: Likewise.
	* testsuite/ld-x86-64/bnd-plt-1.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-2a-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2a.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-3a-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3a.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/pr19609-4e.d: Likewise.
	* testsuite/ld-x86-64/pr19609-6a.d: Likewise.
	* testsuite/ld-x86-64/pr19609-6b.d: Likewise.
	* testsuite/ld-x86-64/pr19609-7b.d: Likewise.
	* testsuite/ld-x86-64/pr19609-7d.d: Likewise.
	* testsuite/ld-x86-64/pr19636-2l.d: Likewise.
	* testsuite/ld-x86-64/pr20253-1d.d: Likewise.
	* testsuite/ld-x86-64/pr20253-1h.d: Likewise.
	* testsuite/ld-x86-64/pr21038b-now.d: Likewise.
	* testsuite/ld-x86-64/pr21038b.d: Likewise.
	* testsuite/ld-x86-64/pr21038c-now.d: Likewise.
	* testsuite/ld-x86-64/pr21038c.d: Likewise.
	* testsuite/ld-x86-64/pr23854.d: Likewise.
	* testsuite/ld-x86-64/pr25416-3.d: Likewise.
	* testsuite/ld-x86-64/pr25416-4.d: Likewise.
	* testsuite/ld-i386/plt-pic.pd: Likewise.
	* testsuite/ld-i386/plt-pic2.dd: Likewise.
	* testsuite/ld-i386/plt.pd: Likewise.
	* testsuite/ld-i386/plt2.dd: Likewise.
	* testsuite/ld-i386/tlsbin.rd: Likewise.
	* testsuite/ld-i386/tlsbin2.rd: Likewise.
	* testsuite/ld-i386/tlsbindesc.rd: Likewise.
	* testsuite/ld-i386/tlsdesc.rd: Likewise.
	* testsuite/ld-i386/tlsgdesc.rd: Likewise.
	* testsuite/ld-i386/tlsnopic.rd: Likewise.
	* testsuite/ld-i386/tlspic.rd: Likewise.
	* testsuite/ld-i386/tlspic2.rd: Likewise.
	* testsuite/ld-x86-64/mpx3.dd: Likewise.
	* testsuite/ld-x86-64/mpx3n.dd: Likewise.
	* testsuite/ld-x86-64/mpx4.dd: Likewise.
	* testsuite/ld-x86-64/mpx4n.dd: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-1.od: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-2.od: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-3.od: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-4.od: Likewise.
	* testsuite/ld-x86-64/plt.pd: Likewise.
	* testsuite/ld-x86-64/plt2.dd: Likewise.
	* testsuite/ld-x86-64/tlsbin.rd: Likewise.
	* testsuite/ld-x86-64/tlsbin2.rd: Likewise.
	* testsuite/ld-x86-64/tlsbindesc.rd: Likewise.
	* testsuite/ld-x86-64/tlsdesc.rd: Likewise.
	* testsuite/ld-x86-64/tlsgdesc.rd: Likewise.
	* testsuite/ld-x86-64/tlspic.rd: Likewise.
	* testsuite/ld-x86-64/tlspic2.rd: Likewise.
	* testsuite/ld-elf/sec64k.exp: Check
	is_elf_unused_section_symbols.
2021-01-07 06:46:55 -08:00
Philipp Tomsich
aa881ecde4 RISC-V: Add pause hint instruction.
Add support for the pause hint instruction, as specified in the
Zihintpause extension.  The pause instruction is encoded as a
special form of a memory fence (which is available as part of the
base instruction set).  The chosen encoding does not mandate any
particular memory ordering and therefore is a true hint.

bfd/
    * elfxx-riscv.c (riscv_std_z_ext_strtab): Added zihintpause.
gas/
    * config/tc-riscv.c (riscv_multi_subset_supports): Added
    INSN_CLASS_ZIHINTPAUSE.
    * testsuite/gas/riscv/pause.d: New testcase.  Adding coverage for
    the pause hint instruction.
    * testsuite/gas/riscv/pause.s: Likewise.
include/
    * opcode/riscv-opc.h: Added MATCH_PAUSE, MASK_PAUSE and DECLARE_INSN
    for pause hint instruction.
    * opcode/riscv.h (enum riscv_insn_class): Added INSN_CLASS_ZIHINTPAUSE.
opcodes/
    * riscv-opc.c (riscv_opcodes): Add pause hint instruction.
2021-01-07 16:45:43 +08:00
Claire Xenia Wolf
2652cfad8d RISC-V: Support riscv bitmanip frozen ZBA/ZBB/ZBC instructions (v0.93).
In fact rev8/orc.b/zext.h are the aliases of grevi/gorci/pack[w], so we
should update them to INSN_ALIAS when we have supported their true instruction
in the future.  Though we still use the [MATCH|MAKS]_[GREVI|GORCI|PACK|PACKW]
to encode them.  Besides, the orc.b has the same encoding both in rv32 and
rv64, so we just keep one of them in the opcode table.

This patch is implemented according to the following link,
https://github.com/riscv/riscv-bitmanip/pull/101

2021-01-07  Claire Xenia Wolf  <claire@symbioticeda.com>
            Jim Wilson  <jimw@sifive.com>
            Andrew Waterman  <andrew@sifive.com>
            Maxim Blinov  <maxim.blinov@embecosm.com>
            Kito Cheng  <kito.cheng@sifive.com>
            Nelson Chu  <nelson.chu@sifive.com>

bfd/
    * elfxx-riscv.c (riscv_std_z_ext_strtab): Added zba, zbb and zbc.
gas/
    * config/tc-riscv.c (riscv_multi_subset_supports): Handle INSN_CLASS_ZB*.
    (riscv_get_default_ext_version): Do not check the default_isa_spec when
    the version defined in the riscv_opcodes table is ISA_SPEC_CLASS_DRAFT.
    * testsuite/gas/riscv/bitmanip-insns-32.d: New testcase.
    * testsuite/gas/riscv/bitmanip-insns-64.d: Likewise.
    * testsuite/gas/riscv/bitmanip-insns.s: Likewise.
include/
    * opcode/riscv-opc.h: Added MASK/MATCH/DECLARE_INSN for ZBA/ZBB/ZBC.
    * opcode/riscv.h (riscv_insn_class): Added INSN_CLASS_ZB*.
    (enum riscv_isa_spec_class): Added ISA_SPEC_CLASS_DRAFT for the
    frozen extensions.
opcodes/
    * riscv-opc.c (riscv_opcodes): Add ZBA/ZBB/ZBC instructions.
    (MASK_RVB_IMM): Used for rev8 and orc.b encoding.
2021-01-07 11:44:54 +08:00
Alan Modra
85f55c2b75 sparc-elf ld test fails
* testsuite/gas/sparc/sparc.exp: Move 64-bit tests inside gas_64_check.
2021-01-06 21:03:55 +10:30
Alan Modra
22206e847d gas APP macro tests
These fail on tic30 due to that target using a different comment char.

	* testsuite/gas/macros/app1.d: xfail tic30.
	* testsuite/gas/macros/app2.d: Likewise.
	* testsuite/gas/macros/app3.d: Likewise.
	* testsuite/gas/macros/app4.d: Likewise.
2021-01-06 21:03:55 +10:30
Marcus Comstedt
286d2f2cd7 RISC-V: Mention -mbig-endian and -mlittle-endian in doc
gas/
    * doc/as.texi: Add -mlittle-endian and -mbig-endian to docs.
    * doc/c-riscv.texi: Likewise.
2021-01-06 18:08:20 +08:00
Marcus Comstedt
f36ce378b4 RISC-V: Fix riscv gas/ld testsuites failures for big endian.
Add riscv_choose_[ilp32|lp64]_emul, and use them to choose the correct
linker script rather than set elf[32|64]lriscv directly.

gas/
    * testsuite/gas/riscv/li32.d: Accept bigriscv in addition
    to littleriscv.
    * testsuite/gas/riscv/li64.d: Likewise.
    * testsuite/gas/riscv/lla32.d: Likewise.
    * testsuite/gas/riscv/lla64.d: Likewise.
    * testsuite/gas/riscv/march-ok-g2.d: Likewise.
    * testsuite/gas/riscv/march-ok-g2_p1.d: Likewise.
    * testsuite/gas/riscv/march-ok-g2p0.d: Likewise.
    * testsuite/gas/riscv/march-ok-i2p0.d: Likewise.
    * testsuite/gas/riscv/march-ok-i2p0m2_a2f2.d: Likewise.
    * testsuite/gas/riscv/march-ok-nse-with-version.d: Likewise.
    * testsuite/gas/riscv/march-ok-two-nse.d: Likewise.

ld/
    * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Added
    riscv_choose_[ilp32|lp64]_emul to choose the correct linker script.
    * testsuite/ld-riscv-elf/attr-merge-arch-01.d: Call
    riscv_choose_[ilp32|lp64]_emul instead of hardcoding elf[32|64]lriscv.
    * testsuite/ld-riscv-elf/attr-merge-arch-02.d: Likewise.
    * testsuite/ld-riscv-elf/attr-merge-arch-03.d: Likewise.
    * testsuite/ld-riscv-elf/attr-merge-arch-failed-01.d: Likewise.
    * testsuite/ld-riscv-elf/attr-merge-arch-failed-02.d: Likewise.
    * testsuite/ld-riscv-elf/c-lui-2.d: Likewise.
    * testsuite/ld-riscv-elf/c-lui.d: Likewise.
    * testsuite/ld-riscv-elf/call-relax.d: Likewise.
    * testsuite/ld-riscv-elf/pcrel-lo-addend-2.d: Likewise.
    * testsuite/ld-riscv-elf/pcrel-lo-addend.d: Likewise.
    * testsuite/ld-riscv-elf/weakref32.d: Accept bigriscv in addition
    to littleriscv.
    * testsuite/ld-riscv-elf/weakref64.d: Likewise.
2021-01-06 18:01:41 +08:00
Marcus Comstedt
fbc09e7af7 RISC-V: Implement support for big endian targets.
RISC-V instruction/code is always little endian, but data might be
big-endian.  Therefore, we can not use the original bfd_get/bfd_put
to get/put the code for big endian targets.  Add new riscv_get_insn
and riscv_put_insn to always get/put code as little endian can resolve
the problem.  Just remember to update them once we have supported
the 48-bit/128-bit instructions in the future patches.

bfd/
    * config.bfd: Added targets riscv64be*-*-*, riscv32be*-*-* and
    riscvbe*-*-*.  Also added riscv_elf[32|64]_be_vec.
    * configure.ac: Handle riscv_elf[32|64]_be_vec.
    * configure: Regenerate.
    * elfnn-riscv.c: Include <limits.h> and define CHAR_BIT for
    riscv_is_insn_reloc.
    (riscv_get_insn): RISC-V instructions are always little endian, but
    bfd_get may be used for big-endian, so add new riscv_get_insn to handle
    the insturctions.
    (riscv_put_insn): Likewsie.
    (riscv_is_insn_reloc): Check if we are relocaing an instruction.
    (perform_relocation): Call riscv_is_insn_reloc to decide if we should
    use riscv_[get|put]_insn or bfd_[get|put].
    (riscv_zero_pcrel_hi_reloc): Use riscv_[get|put]_insn, bfd_[get|put]l32
    or bfd_[get|put]l16 for code.
    (riscv_elf_relocate_section): Likewise.
    (riscv_elf_finish_dynamic_symbol): Likewise.
    (riscv_elf_finish_dynamic_sections): Likewise.
    (_bfd_riscv_relax_call): Likewise.
    (_bfd_riscv_relax_lui): Likewise.
    (_bfd_riscv_relax_align): Likewise.
    (_bfd_riscv_relax_pc): Likewise.
    (riscv_elf_object_p): Handled for big endian.
    (TARGET_BIG_SYM, TARGET_BIG_NAME): Defined.
    * targets.c: Add riscv_elf[32|64]_be_vec.
    (_bfd_target_vector): Likewise.

gas/
    * config/tc-riscv.c (riscv_target_format): Add elf64-bigriscv and
    elf32-bigriscv.
    (install_insn): Always write instructions as little endian.
    (riscv_make_nops): Likewise.
    (md_convert_frag_branch): Likewise.
    (md_number_to_chars): Write data in target endianness.
    (options, md_longopts): Add -mbig-endian and -mlittle-endian options.
    (md_parse_option): Handle the endian options.
    * config/tc-riscv.h: Only define TARGET_BYTES_BIG_ENDIAN if not
    already defined.
    * configure.tgt: Added riscv64be*, riscv32be*, riscvbe*.

ld/
    * configure.tgt: Added riscvbe-*-*, riscv32be*-*-*, riscv64be*-*-*,
    riscv32be*-*-linux*, and riscv64be*-*-linux*.
    * Makefile.am: Added eelf32briscv.c, eelf32briscv_ilp32f.c and
    eelf32briscv_ilp32.c.
    * Makefile.in: Regenerate.
    * emulparams/elf32briscv.sh: Added.
    * emulparams/elf32briscv_ilp32.sh: Likewise.
    * emulparams/elf32briscv_ilp32f.sh: Likewise.
    * emulparams/elf64briscv.sh: Likewise.
    * emulparams/elf64briscv_lp64.sh: Likewise.
    * emulparams/elf64briscv_lp64f.sh: Likewise.
2021-01-06 17:57:52 +08:00
H.J. Lu
cd6d537c48 elf: Allow mixed ordered/unordered inputs for non-relocatable link
For non-relocatable link with SHF_LINK_ORDER inputs, allow mixed indirect
and data inputs with ordered and unordered inputs:

1. Add pattern to bfd_section for the matching section name pattern in
linker script and update BFD_FAKE_SECTION.
2. Sort the consecutive bfd_indirect_link_order sections with the same
pattern to allow linker script to overdide input section order.
3. Place unordered sections before ordered sections.
4. Change the offsets of the indirect input sections only.

bfd/

	PR ld/26256
	* elflink.c (compare_link_order): Place unordered sections before
	ordered sections.
	(elf_fixup_link_order): Add a link info argument.  Allow mixed
	ordered and unordered input sections for non-relocatable link.
	Sort the consecutive bfd_indirect_link_order sections with the
	same pattern.  Change the offsets of the bfd_indirect_link_order
	sections only.
	(bfd_elf_final_link): Pass info to elf_fixup_link_order.
	* section.c (bfd_section): Add pattern.
	(BFD_FAKE_SECTION): Initialize pattern to NULL.
	* bfd-in2.h: Regenerated.

gas/

	PR ld/26256
	* config/obj-elf.c (obj_elf_change_section): Also filter out
	SHF_LINK_ORDER.

ld/

	PR ld/26256
	* ldlang.c (gc_section_callback): Set pattern.
	* testsuite/ld-elf/pr26256-1.s: New file.
	* testsuite/ld-elf/pr26256-1.t: Likewise.
	* testsuite/ld-elf/pr26256-1a.d: Likewise.
	* testsuite/ld-elf/pr26256-1b.d: Likewise.
	* testsuite/ld-elf/pr26256-2.s: Likewise.
	* testsuite/ld-elf/pr26256-2.t: Likewise.
	* testsuite/ld-elf/pr26256-2a.d: Likewise.
	* testsuite/ld-elf/pr26256-2b-alt.d: Likewise.
	* testsuite/ld-elf/pr26256-2b.d: Likewise.
	* testsuite/ld-elf/pr26256-3.s: Likewise.
	* testsuite/ld-elf/pr26256-3a.d: Likewise.
	* testsuite/ld-elf/pr26256-3a.t: Likewise.
	* testsuite/ld-elf/pr26256-3b.d: Likewise.
	* testsuite/ld-elf/pr26256-3b.t: Likewise.
2021-01-04 12:38:05 -08:00
Alan Modra
dd933805d1 PR27102, gas: "section symbols are already global"
PR 27102
	* symbols.c (S_SET_EXTERNAL): Revise section symbol warning
	message and register symbol error message.
2021-01-04 18:58:15 +10:30
Alan Modra
90320e4095 PR27101, as: Reject (byte) .align 0x100000000
This allows alignments up to 2**TC_ALIGN_LIMIT, which might be larger
than an unsigned int can hold.

	PR 27101
	* read.c (s_align): Use a large enough type for "align" to hold
	the result of get_absolute_expression.
2021-01-04 11:08:05 +10:30
Alan Modra
f9a6a8f09d PR27116, Spelling errors found by Debian style checker
PR 27116
bfd/
	* xcofflink.c: Correct spelling in comments.
binutils/
	* coffgrok.c (do_type): Correct spelling of auxiliary in errors.
	* doc/binutils.texi: Correct grammar.
	* readelf.c (process_version_sections): Correct spelling of auxiliary
	in warning.
	* testsuite/binutils-all/vax/objdump.exp: Comment grammar fix.
config/
	* override.m4: Correct comment grammar.
gas/
	* config/tc-i386.c: Correct comment spelling.
	* config/tc-riscv.c: Likewise.
	* config/tc-s390.c: Correct comment grammar.
	* doc/c-i386.texi: Correct spelling.
	* doc/c-s390.texi: Correct grammar.
gold/
	* tilegx.cc: Correct comment spelling.
gprof/
	* README: Correct grammar.
	* gprof.texi: Likewise.
include/
	* coff/internal.h: Correct comment spelling.
	* coff/sym.h: Likewise.
	* opcode/aarch64.h: Likewise.
ld/
	* configure.tgt: Correct comment grammar.
	* emultempl/m68hc1xelf.em: Likewise.
	* ld.texi: Correct grammar.
2021-01-01 14:36:35 +10:30
Alan Modra
250d07de5c Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
Alan Modra
c2795844e6 ChangeLog rotation 2021-01-01 10:31:02 +10:30
Hans-Peter Nilsson
64d05a4334 gas: Change to "swym 0" as canonical nop insn for MMIX
While "set $0, $0" works, that's not the documented instruction to do
nothing for MMIX.  However, I'm not changing it for "nop_type 5" as
seen in gas.exp and org-1.s, because "set $0, $0" seems like it could
be re-used there, for some future ISA.

gas/
	* config/tc-mmix.h (md_single_noop_insn): Change to "swym 0".
2021-01-01 00:47:36 +01:00
H.J. Lu
a12f86b9a6 gas: Update 80387 floating point 's' suffix
Update 80387 floating point 's' suffix to read:

  * Integer constructors are '.word', '.long' or '.int', and '.quad'
     for the 16-, 32-, and 64-bit integer formats.  The corresponding
     instruction mnemonic suffixes are 's' (short), 'l' (long), and 'q'
     (quad).

instead of 's' (single).

	PR gas/27106
	* doc/c-i386.texi: Update 80387 floating point 's' suffix
2020-12-25 05:56:36 -08:00
Alan Modra
7f3a18cfb5 Statically initialise target common sections
This tidies initialisation of target common sections, doing so using a
static initialiser rather than via code and deleting unnecessary
symbol_ptr_ptr variables (the one in asection is used instead).

The patch also initialises ecoff.c:bfd_debug_section using
BFD_FAKE_SECTION.  That does change bfd_debug_section slightly,
output_section was NULL now bfd_debug_section, and symbol_ptr_ptr
was NULL now &bfd_debug_section.symbol, but I believe those changes
are safe.

bfd/
	* ecoff.c (bfd_debug_section): Init using BFD_FAKE_SECTION.
	(ecoff_scom_section, ecoff_scom_symbol): Statically init using
	BFD_FAKE_SECTION and GLOBAL_SYM_INIT.  Delete initialisation code.
	(ecoff_scom_symbol_ptr): Delete.
	* elf32-m32r.c (m32r_elf_scom_section, m32r_elf_scom_symbol),
	(m32r_elf_scom_symbol_ptr),
	* elf32-score.c (score_elf_scom_section, score_elf_scom_symbol),
	(score_elf_scom_symbol_ptr),
	* elf32-score7.c (score_elf_scom_section, score_elf_scom_symbol),
	(score_elf_scom_symbol_ptr),
	* elf32-tic6x.c (tic6x_elf_scom_section, tic6x_elf_scom_symbol),
	(tic6x_elf_scom_symbol_ptr),
	* elf32-v850.c (v850_elf_scom_section, v850_elf_scom_symbol),
	(v850_elf_scom_symbol_ptr),
	(v850_elf_tcom_section, v850_elf_tcom_symbol),
	(v850_elf_tcom_symbol_ptr),
	(v850_elf_zcom_section, v850_elf_zcom_symbol),
	(v850_elf_zcom_symbol_ptr),
	* elf64-mmix.c (mmix_elf_reg_section, mmix_elf_reg_section_symbol),
	(mmix_elf_reg_section_symbol_ptr),
	* elfxx-mips.c (mips_elf_scom_section, mips_elf_scom_symbol),
	(mips_elf_scom_symbol_ptr): Likewise.
gas/
	* ecoff.c (ecoff_frob_symbol): Rename scom_section to
	ecoff_scom_section and statically initialise.
2020-12-18 10:34:16 +10:30
Alan Modra
c410035d37 constify elfNN_bed
elfNN_bed was made writable as an expedient means of communicating
ld -z max-page-size and ld -z common-page-size values to BFD linker
code, and even for objcopy to communicate segment alignment between
copy_private_bfd_data, rewrite_elf_program_header and
assign_file_positions_for_load_sections.  Some time later elfNN_bed
elf_osabi was written by gas.  It turns out none of these
modifications to elfNN_bed was necessary, so make it const again.

include/
	* bfdlink.h (struct bfd_link_info): Add maxpagesize and
	commonpagesize.
bfd/
	* elfxx-target.h (elfNN_bed): Constify.
	* bfd.c (bfd_elf_set_pagesize): Delete.
	(bfd_emul_set_maxpagesize, bfd_emul_set_commonpagesize): Delete.
	* elf.c (get_program_header_size): Get commonpagesize from
	link info.
	(_bfd_elf_map_sections_to_segments): Get maxpagesize from link info.
	(assign_file_positions_for_load_sections): Likewise.
	(assign_file_positions_for_non_load_sections): Likewise.
	(rewrite_elf_program_header): Add maxpagesize param.  Set map_p_align.
	(copy_private_bfd_data): Don't call bfd_elf_set_maxpagesize.
	Instead pass maxpagesize to rewrite_elf_program_header.
	* elf32-nds32.c (relax_range_measurement): Add link_info param.
	Get maxpagesize from link_info.  Adjust caller.
	* bfd-in2.h: Regenerate.
gas/
	* config/obj-elf.c (obj_elf_section): Don't set elf_osabi here.
	(obj_elf_type): Likewise.
ld/
	* ld.h (ld_config_type): Delete maxpagesize and commonpagesize.
	* emultempl/elf.em: Use link_info rather than config
	for maxpagesize and commonpagesize.
	* emultempl/ppc32elf.em: Likewise.
	* ldexp.c (fold_binary, fold_name): Likewise.
	* ldemul.c (after_parse_default): Likewise.
	(set_output_arch_default): Don't call bfd_emul_set_maxpagesize
	or bfd_emul_set_commonpagesize.
2020-12-16 15:17:53 +10:30
Alan Modra
7bed846687 PR27071, gas bugs uncovered by fuzzing
PR 27071
	* config/obj-elf.c (elf_obj_symbol_clone_hook): New function.
	(elf_format_ops): Set symbol_clone_hook.
	* config/obj-elf.h (elf_obj_symbol_clone_hook): Declare.
	(obj_symbol_clone_hook): Define.
	* listing.c (buffer_line): Avoid integer overflow on paper_width
	set to zero.
2020-12-16 01:13:58 +10:30
Alan Modra
f7c54040d7 rx-elf FAIL: SHF_GNU_RETAIN sections 27
rx-elf is an odd target with non-standard names for default text, data
and bss sections.  This patch tweaks a new test to make it pass.

	* testsuite/gas/elf/section27.s: Reorder .text, .data and .bss
	so that output section order does not depend on those sections
	being already created.  Use ".section .text" rather than ".text".
2020-12-14 14:05:05 +10:30
Borislav Petkov
7393df7f3f x86: Do not dump DS/CS segment overrides for branch hints
I've made all labels normal labels so that there's no confusion between
the different targets which is which and I match them in the .d files
with .* as Alan suggested.

Hex offsets I match with [0-9a-fx]+ since some targets prefix them with
0x, some don't, etc.

	* testsuite/gas/i386/align-branch-9.s: Don't use labels that are
	automatically local for ELF targets.
	* testsuite/gas/i386/branch.s: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-9.s: Likewise.
	* testsuite/gas/i386/x86-64-branch.s: Likewise.
	* testsuite/gas/i386/align-branch-9.d: Adjust to match more targets.
	* testsuite/gas/i386/branch.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-branch.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-9.d: Likewise.
	* testsuite/gas/i386/x86-64-branch.d: Likewise.
2020-12-13 14:02:26 +10:30
Nick Clifton
14a772212b Add support for the .bss pseudo-op to the Z80 assembler.
PR 27047
	* config/tc-z80.c (s_bss): New function.
	(md_pseudo_table): Add bss entry.
2020-12-11 16:49:38 +00:00
Nelson Chu
c2137f55ad RISC-V: Add sext.[bh] and zext.[bhw] pseudo instructions.
https://github.com/riscv/riscv-asm-manual/pull/61

We aleady have sext.w, so just add sext.b, sext.h, zext.b, zext.h
and zext.w.  In a certain sense, zext.b is not a pseudo - It is an
alias of andi.  Similarly, sext.b and sext.h are aliases of other
rvb instructions, when we enable b extension; But they are pseudos
when we just enable rvi.  However, this patch does not consider the
rvb cases.  Besides, zext.w is only valid in rv64.

gas/
    * config/tc-riscv.c (riscv_ext): New function.  Use md_assemblef
    to expand the zext and sext pseudos, to give them a chance to be
    expanded into c-ext instructions.
    (macro): Handle M_ZEXTH, M_ZEXTW, M_SEXTB and M_SEXTH.
    * testsuite/gas/riscv/ext.s: New testcase.
    * testsuite/gas/riscv/ext-32.d: Likewise.
    * testsuite/gas/riscv/ext-64.d: Likewise.
include/
    * opcode/riscv.h (M_ZEXTH, M_ZEXTW, M_SEXTB, M_SEXTH.): Added.
opcodes/
    * riscv-opc.c (riscv_opcodes): Add sext.[bh] and zext.[bhw].
2020-12-10 10:50:44 +08:00
Nelson Chu
729a53530e RISC-V: Control fence.i and csr instructions by zifencei and zicsr.
bfd/
    * elfxx-riscv.c (riscv_ext_dont_care_version): New function.  Return
    TRUE if we don't care the versions of the extensions.  These extensions
    are added to the subset list for special purposes, with the explicit
    versions or the RISCV_UNKNOWN_VERSION versions.
    (riscv_parse_add_subset): If we do care the versions of the extension,
    and the versions are unknown, then report errors for the non-implicit
    extensions, and return directly for the implicit one.
    (riscv_arch_str1): Do not output i extension after e, and the extensions
    which versions are unknown.
gas/
    * config/tc-riscv.c (riscv_multi_subset_supports): Handle INSN_CLASS_ZICSR
    and INSN_CLASS_ZIFENCEI.
    * testsuite/gas/riscv/march-imply-i.s: New testcase.
    * testsuite/gas/riscv/march-imply-i2p0-01.d: New testcase.  The version
    of i is less than 2.1, and zi* are supported in the chosen spec, so
    enable the fence.i and csr instructions, also output the implicit zi* to
    the arch string.
    * testsuite/gas/riscv/march-imply-i2p0-02.d: Likewise, but the zi* are
    not supported in the spec 2.2.  Enable the related instructions since
    i's version is less than 2.1, but do not output them.
    * testsuite/gas/riscv/march-imply-i2p1-01.d: New testcase.  The version
    of i is 2.1, so don't add it's implicit zi*, and disable the related
    instructions.
    * testsuite/gas/riscv/march-imply-i2p1-01.l: Likewise.
    * testsuite/gas/riscv/march-imply-i2p1-02.d: Likewise, and set the zi*
    explicitly, so enable the related instructions.
    * testsuite/gas/riscv/march-imply-i2p0.d: Removed.
    * testsuite/gas/riscv/march-imply-i2p1.d: Removed.
include/
    * opcode/riscv.h: Add INSN_CLASS_ZICSR and INSN_CLASS_ZIFENCEI.
opcodes/
    * riscv-opc.c (riscv_opcodes): Control fence.i and csr instructions by
    zifencei and zicsr.
2020-12-10 10:37:43 +08:00
H.J. Lu
037311d1df gas: Generate a new section for SHF_GNU_RETAIN
For
	.globl	foo2
	.section	.data.foo,"aR"
	.align 4
	.type	foo2, @object
	.size	foo2, 4
foo2:
	.long	2
	.globl	foo1
	.section	.data.foo
	.align 4
	.type	foo1, @object
	.size	foo1, 4
foo1:
	.long	1

generate a new section if the SHF_GNU_RETAIN bit doesn't match.

	* config/obj-elf.c (SEC_ASSEMBLER_SHF_MASK): New.
	(get_section_by_match): Also check if SEC_ASSEMBLER_SHF_MASK of
	sh_flags matches.  Rename info to sh_info.
	(obj_elf_change_section): Don't check previous SHF_GNU_RETAIN.
	Rename info to sh_info.
	(obj_elf_section): Rename info to sh_info.  Set sh_flags for
	SHF_GNU_RETAIN.
	* config/obj-elf.h (elf_section_match): Rename info to sh_info.
	Add sh_flags.
	* testsuite/gas/elf/elf.exp: Run section27.
	* testsuite/gas/elf/section24b.d: Updated.
	* testsuite/gas/elf/section27.d: New file.
	* testsuite/gas/elf/section27.s: Likewise.
2020-12-08 16:41:32 -08:00
Andreas Krebbel
c524d11e50 IBM Z: Add risbgz and risbgnz extended mnemonics
These two extended mnemonics are documented in the Principles of
Operations manual but currently not supported by Binutils. They
provide aliases for already supported instructions with the zero flag
being set.  The flag otherwise is mingled into one of the immediate
operands what makes asm code much harder to read.

opcodes/

	* s390-opc.txt: Add risbgz and risbgnz.
	* s390-opc.c (U6_26): New operand type.
	(INSTR_RIE_RRUUU2, MASK_RIE_RRUUU2): New instruction format and
	mask.

gas/

	* testsuite/gas/s390/zarch-z10.s: Add tests for risbgz.
	* testsuite/gas/s390/zarch-z10.d: Add regexp for risbgz.
	* testsuite/gas/s390/zarch-zEC12.s: Add tests for risbgnz.
	* testsuite/gas/s390/zarch-zEC12.d: Add regexp for risbgnz.
2020-12-04 09:14:02 +01:00
Andreas Krebbel
b10b530a45 IBM Z: Add support for HLASM extended mnemonics
Add extended mnemonics used in the HLASM assembler.  All of them are
just aliases for instructions we already support and help when
assembling code which was written for the HLASM assembler.

The HLASM mnemonics are documented here:
https://www.ibm.com/support/knowledgecenter/SSENW6_1.6.0/com.ibm.hlasm.v1r6.asm/asmr1023.pdf

See the 'Branching with extended mnemonic codes' chapter.

objdump will still print the existing mnemonics with the exception of
relative nop branches (i.e. conditional branches with an empty
condition code mask).  Now we have jnop and jgnop which will be used
by objdump when possible.

The same change have been applied to the LLVM assembler:
https://reviews.llvm.org/D92185

opcodes/

	* s390-opc.txt: Add extended mnemonics.

gas/

	* testsuite/gas/s390/esa-g5.s: Test new extended mnemonics.
	* testsuite/gas/s390/esa-g5.d: Likewise.
	* testsuite/gas/s390/esa-z900.s: Likewise.
	* testsuite/gas/s390/esa-z900.d: Likewise.
	* testsuite/gas/s390/zarch-z900.s: Likewise.
	* testsuite/gas/s390/zarch-z900.d: Likewise.

ld/

	* testsuite/ld-s390/tlsbin_64.dd: The newly added jgnop mnemonic
	replaces long relative branches with empty condition code mask.
2020-12-03 16:51:12 +01:00
Nelson Chu
00d4d1b0a3 RISC-V: Support to add implicit extensions for G.
G is a special case, consider the ISA spec github issue as follows,
https://github.com/riscv/riscv-isa-manual/issues/575

My understand is that - i, m, a, f and d extensions are not g's implicit
extensions, they are g's expansions.  The zifencei is the implicit extension
of g, and so is zicsr, since it is implicited by f (or i2p1).  However,
we add the g with the RISCV_UNKNOWN_VERSION to the subset list, and it
will not output to the arch string, it is only used to check what implicit
extensions are need to be added.

	bfd/
	* elfxx-riscv.c (riscv_parse_add_subset): Allow to add g with
	RISCV_UNKNOWN_VERSION versions.
	(riscv_parse_std_ext): Add g to the subset list, we only use it
	to add the implicit extensions, but won't output it to arch string.
	(riscv_parse_add_implicit_subsets): Add implicit zicsr and zifencei
	for g extension.
	(riscv_arch_str1): Do not output g to the arch string.
	* elfxx-riscv.h (RISCV_UNKNOWN_VERSION): Moved to include/opcode/riscv.h.

	gas/
	* testsuite/gas/riscv/attribute-10.d: Updated.
	* testsuite/gas/riscv/march-imply-g.d: New testcase for g.
	* testsuite/gas/riscv/march-imply-unsupported.d: The zicsr and zifencei
	are not supported in the ISA spec v2.2, so don't add and output them.

	include/
	* opcode/riscv.h (RISCV_UNKNOWN_VERSION): added.
2020-12-01 15:23:02 +08:00
Nelson Chu
dfe9249667 RISC-V: Support to add implicit extensions.
We have to parse and add all arch string extensions at first, and then
start to add their implicit extensions.  That means we can always add
arch string extensions at the end of the subset list, but we need to
search the right place to add their implicit extensions.  For now we
follow the following rules to add the implicit extensions,

* Add zicsr and zifencei only when the i's version less than 2.1.
* Add d, f and zicsr when q is found.
* Add f and zicsr when d is found.
* Add zicsr when f is found.

Besides, we do not add the implicit extensions if they are already added
in the subset list, or we cannot find their default versions according to
the chosen ISA spec.

	bfd/
	* elfnn-riscv.c (riscv_merge_std_ext): Updated since
	riscv_lookup_subset is changed.
	* elfxx-riscv.c (riscv_ext_order): New Array used to compare the
	extensions' order quickly.
	(riscv_init_ext_order): New function.  Init the riscv_ext_order
	according to the riscv_supported_std_ext and parse_config[i].class
	automatically.
	(riscv_compare_subsets): New function.  Similar to the strcmp, but
	compare the subsets with the specific order.
	(riscv_lookup_subset): Return TRUE and set `current` to the subset
	if it is found.  Otherwise, return FALSE and set `current` to the
	place where we should insert the subset.
	(riscv_add_implicit_subset): New function.  Search the list first,
	and then find the right place to add the implicit_subset.
	(riscv_parse_add_subset): Since We have to add all arch string
	extensions first, and then start to add their implicit extensions.
	We can add arch string extensions in order by the original
	riscv_add_subset, and then add the implicit subsets by the
	riscv_add_implicit_subset.  Besides, do not add the implicit
	extensions if we failed to find their default versions.
	(riscv_parse_std_ext): Updated.
	(riscv_parse_add_implicit_subsets): New function.  Add all implicit
	extensions according to the arch string extensions.
	(riscv_parse_subset): Call riscv_init_ext_order and
	riscv_parse_add_implicit_subsets, before and after parsing the
	arch string.  Remove parts of the ISA conflict checking since
	the implicit extensions are added.
	* elfxx-riscv.h (riscv_lookup_subset): Updated.

	gas/
	* config/tc-riscv.c (riscv_subset_supports): Updated.
	* testsuite/gas/riscv/march-imply-i2p0.d: New testcase.  Need to
	add the implicit zicsr and zifencei when i's version less than 2.1.
	* testsuite/gas/riscv/march-imply-i2p1.d: New testcase.
	* testsuite/gas/riscv/march-imply-d.d: Likewise.
	* testsuite/gas/riscv/march-imply-f.d: Likewise.
	* testsuite/gas/riscv/march-imply-q.d: Likewise.
	* testsuite/gas/riscv/march-fail-rv32iq.l: Updated.
	* testsuite/gas/riscv/march-fail-rv32id.d: Removed.
	* testsuite/gas/riscv/march-fail-rv32id.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv64iq.d: Likewise.
	* testsuite/gas/riscv/march-fail-rv64iq.l: Likewise.
2020-12-01 15:18:48 +08:00
Nelson Chu
7ef19aa616 RISC-V: Improve the version parsing for arch string.
Keep the riscv_add_subset to do the same thing, and use a new
function, riscv_parse_add_subset, to cover most of the things
when parsing, including find the default versions for extensions,
and check whether the versions are valid.  The version 0p0 should
be an invalid version, that is the mistake I made before.  This
patch clarify the version rules as follows,

* We accept any version of extensions set by users, except 0p0.
* The non-standard x extensions must be set with versions in arch string.
* If user don't set the versions, or set 0p0 for the extensions, then try
  to find the supported versions according to the chosen ISA spec.
  Otherwise, report errors rather than output 0p0 for them.

Besides, we use as_bad rather than as_fatal to report more errors
for assembler.

	bfd/
	* elfxx-riscv.c (riscv_lookup_subset): Moved to front.
	(riscv_add_subset): Likewise.
	(riscv_release_subset_list): Likewise.
	(riscv_parse_add_subset): New function.  Find and check the
	versions before adding them by riscv_add_subset.
	(riscv_parsing_subset_version): Remove use_default_version
	and change the version type from unsigned to int.  Set the
	versions to RISCV_UNKNOWN_VERSION if we can not find them
	in the arch string.
	(riscv_parse_std_ext): Updated.
	(riscv_parse_prefixed_ext): Updated.  Since we use as_bad
	rather than as_fatal to report more errors, return NULL
	string if the parsed end_of_version is NULL, too.
	(riscv_parse_subset): Use a new boolean, no_conflict, to
	report more errors when we have more than one ISA conflicts.

	* elfxx-riscv.h (RISCV_DONT_CARE_VERSION): Changed to
	RISCV_UNKNOWN_VERSION.
	(riscv_lookup_subset_version): Removed.
	(riscv_parse_subset_t): Updated.

	gas/
	* config/tc-riscv.c (riscv_get_default_ext_version):
	Change the version type from unsigned to int.
	(riscv_set_arch): Use as_bad rather than as_fatal to
	report more errors.

	* testsuite/gas/riscv/attribute-02.d: Updated since x must be
	set with versions.
	* testsuite/gas/riscv/attribute-03.d: Likewise.
	* testsuite/gas/riscv/march-ok-two-nse.d: Likewise.
	* testsuite/gas/riscv/attribute-09.d: zicsr wasn't supported
	in the spec 2.2, so choose the newer spec.
	* testsuite/gas/riscv/march-fail-base-01.l: Updated since as_bad.
	* testsuite/gas/riscv/march-fail-base-02.l: Likewise.
	* testsuite/gas/riscv/march-fail-order-std.l: Likewise.
	* testsuite/gas/riscv/march-fail-order-x.l: Likewise.
	* testsuite/gas/riscv/march-fail-order-z.l: Likewise.
	* testsuite/gas/riscv/march-fail-porder.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32ef.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32id.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32iq.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv64iq.l: Likewise.
	* testsuite/gas/riscv/march-fail-single-char.l: Likewise.
	* testsuite/gas/riscv/march-fail-unknown-std.l: Likewise.
	* testsuite/gas/riscv/march-fail-unknown.l: Likewise.
	* testsuite/gas/riscv/march-fail-uppercase.l: Likewise.
	* testsuite/gas/riscv/march-fail-version.l: Likewise.
	* testsuite/gas/riscv/march-fail-isa-spec.d: Likewise.
	* testsuite/gas/riscv/march-fail-isa-spec.l: Likewise.

	include/
	* opcode/riscv.h (riscv_ext_version):
	Change the version type from unsigned to int.
2020-12-01 15:16:25 +08:00
Nelson Chu
5a1b31e1e1 RISC-V: Add zifencei and prefixed h class extensions.
bfd/
	* elfxx-riscv.c (riscv_parse_std_ext): Stop parsing standard
	extensions when parsed h keyword.
	(riscv_get_prefix_class): Support prefixed h class.
	(riscv_std_h_ext_strtab): Likewise.
	(riscv_ext_h_valid_p): Likewise.
	(parse_config): Likewise.
	(riscv_std_z_ext_strtab): Add zifencei.
	* elfxx-riscv.h (riscv_isa_ext_class): Add RV_ISA_CLASS_H.

	gas/
	* testsuite/gas/riscv/march-fail-order-z.d: New testcase, check
	orders of prefixed z extensions.
	* testsuite/gas/riscv/march-fail-order-z.l: Likewise.
	* testsuite/gas/riscv/march-fail-single-char-h.d: New testcase.
	* testsuite/gas/riscv/march-fail-single-char.l: Updated.
	* testsuite/gas/riscv/march-fail-unknown-h.d: New testcase.
	* testsuite/gas/riscv/march-fail-unknown.l: Updated.

	opcodes/
	* riscv-opc.c (riscv_ext_version_table): Add zifencei.
2020-12-01 15:11:30 +08:00
Nelson Chu
e8d4709e6a RISC-V: Don't allow any uppercase letter in the arch string.
Although I cannot find any RISC-V specs said that uppercases are not
allowed in the arhc string, but seems like it is an established fact
both for GNU and LLVM.  Therefore, we shouldn't allow the uppercases
for the non-standard x extensions, too.

	bfd/
	* elfxx-riscv.c (riscv_parse_subset): ISA string cannot contain
	any uppercase letter.

	gas/
	* testsuite/gas/riscv/march-fail-uppercase-base.d: Updated.
	* testsuite/gas/riscv/march-fail-uppercase.l: Updated.
	* testsuite/gas/riscv/march-fail-uppercase-x.d: New testcase.
2020-12-01 15:09:26 +08:00
Nelson Chu
d541518bec RISC-V: Minor cleanup and testcases improvement for arch string parser.
Re-indent the related codes, unify and improve the related error messages
and comments.  Besies, also re-write the testcases to cover more cases.

	bfd/
	* elfxx-riscv.c: Re-indent codes, unify and improve the error
	messages and comments.
	(riscv_parse_prefixed_ext): Stop parsing the prefixed class
	extensions if the class is RV_ISA_CLASS_UNKNOWN, I get internal
	errors before adding this check for march-fail-porder* testcases.
	(riscv_parse_subset): Move the rv32 with q checking in front.
	* elfxx-riscv.h: Likewise.

	gas/
	(These are new testcases that cover more cases)
	* testsuite/gas/riscv/march-fail-base-01.d: The first extension must
	be e, i or g.
	* testsuite/gas/riscv/march-fail-base-01.l: Likewise.
	* testsuite/gas/riscv/march-fail-base-02.d: rv64e is an invalid base ISA.
	* testsuite/gas/riscv/march-fail-base-02.l: Likewise.
	* testsuite/gas/riscv/march-fail-order-std.d: Check orders of standard
	extensions.
	* testsuite/gas/riscv/march-fail-order-std.l: Likewise.
	* testsuite/gas/riscv/march-fail-order-x.d: Check orders of prefixed
	x extensions.
	* testsuite/gas/riscv/march-fail-order-x.l: Likewise.
	* testsuite/gas/riscv/march-fail-porder-x-std.d: Check orders when
	standard and prefixed extensions are set at the same time.
	* testsuite/gas/riscv/march-fail-porder-x-z.d: Likewise.
	* testsuite/gas/riscv/march-fail-porder-z-std.d: Likewise.
	* testsuite/gas/riscv/march-fail-porder.l: Likewise.
	* testsuite/gas/riscv/march-fail-single-char-s.d: Only standard
	extensions can use single char.
	* testsuite/gas/riscv/march-fail-single-char-x.d: Likewise.
	* testsuite/gas/riscv/march-fail-single-char-z.d: Likewise.
	* testsuite/gas/riscv/march-fail-single-char.l: Likewise.
	* testsuite/gas/riscv/march-fail-unknown-s.d: All extensions
	should be known, except the non-standard x extensions.
	* testsuite/gas/riscv/march-fail-unknown-std.d: Likewise.
	* testsuite/gas/riscv/march-fail-unknown-std.l: Likewise.
	* testsuite/gas/riscv/march-fail-unknown-z.d: Likewise.
	* testsuite/gas/riscv/march-fail-unknown.l: Likewise.
	* testsuite/gas/riscv/march-fail-uppercase-base.d: Do not
	allow any uppercase in the arch string.
	* testsuite/gas/riscv/march-fail-uppercase-std.d: Likewise.
	* testsuite/gas/riscv/march-fail-uppercase-z.d: Likewise.
	* testsuite/gas/riscv/march-fail-uppercase.l: Likewise.
	* testsuite/gas/riscv/march-fail-version-x.d: Failed to set versions.
	* testsuite/gas/riscv/march-fail-version-z.d: Likewise.
	* testsuite/gas/riscv/march-fail-version.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32ef.l: Updated.
	* testsuite/gas/riscv/march-fail-rv32id.d: Need f-ext.
	* testsuite/gas/riscv/march-fail-rv32iq.d: Should be rv64.
	* testsuite/gas/riscv/march-fail-rv32iq.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv64iq.d: Need d-ext and f-ext.
	* testsuite/gas/riscv/march-fail-rv64iq.l: Likewise.

	(The following testcases are removed and covered by new testcases)
	* testsuite/gas/riscv/march-fail-rv32i.d: march-fail-uppercase-base.
	* testsuite/gas/riscv/march-fail-rv32i.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32iam.d: march-fail-order-std.
	* testsuite/gas/riscv/march-fail-rv32iam.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32ic.d: march-fail-uppercase-std.
	* testsuite/gas/riscv/march-fail-rv32ic.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32icx2p.d: march-fail-version-x.
	* testsuite/gas/riscv/march-fail-rv32icx2p.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32imc.d: march-fail-order-std.
	* testsuite/gas/riscv/march-fail-rv32imc.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv64I.d: march-fail-uppercase-std.
	* testsuite/gas/riscv/march-fail-rv64I.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv64e.d: march-fail-base-02.
	* testsuite/gas/riscv/march-fail-rv64e.l: Likewise.
	* testsuite/gas/riscv/march-fail-s-with-version.d: march-fail-unknown-s.
	* testsuite/gas/riscv/march-fail-s-with-version.l: Likewise.
	* testsuite/gas/riscv/march-fail-s.d: march-fail-unknown-s.
	* testsuite/gas/riscv/march-fail-s.l: Likewise.
	* testsuite/gas/riscv/march-fail-sx.d: march-fail-unknown-s.
	* testsuite/gas/riscv/march-fail-sx.l: Likewise.
2020-12-01 15:04:03 +08:00
Borislav Petkov
632ee6fd82 x86: Do not dump DS/CS segment overrides for branch hints
The previous change

  "x86: Ignore CS/DS/ES/SS segment-override prefixes in 64-bit mode"

to ignore segment override prefixes in 64-bit mode lead to dumping
branch hints as excessive prefixes:

  ffffffff8109d5a0 <vmx_get_rflags>:
  ...
  ffffffff8109d601:       3e 77 0a                ds ja,pt ffffffff8109d60e <vmx_get_rflags+0x6e>
  						^^^^^

In this particular case, those prefixes are not excessive but are used
to provide branch hints - taken/not-taken - to the CPU.

Assign active_seg_prefix in that particular case to consume them.

gas/

2002-11-29  Borislav Petkov  <bp@suse.de>

        * testsuite/gas/i386/branch.d: Add new branch insns test.
        * testsuite/gas/i386/branch.s: Likewise.
        * testsuite/gas/i386/i386.exp: Insert the new branch test.
        * testsuite/gas/i386/x86-64-branch.d: Test for branch hints insns.
        * testsuite/gas/i386/x86-64-branch.s: Likewise.
        * testsuite/gas/i386/ilp32/x86-64-branch.d: Likewise.

opcodes/

2020-11-28 Borislav Petkov  <bp@suse.de>

        * i386-dis.c (print_insn): Set active_seg_prefix for branch hint insns
        to not dump branch hint prefixes 0x2E and 0x3E as unused prefixes.
2020-11-29 09:08:56 -08:00
Jozef Lawrynowicz
2c6f3e56cb ELF: Support .noinit and .persistent sections
The ".persistent" section is for data that should be initialized during
load, but not during application reset.

The ".noinit" section is for data that should not be initialized during
load or application reset.

Targets utilizing the elf.sc linker script template can define
HAVE_{NOINIT,PERSISTENT}=yes to include the .noinit or .persistent
output sections in the generated linker script.

Targets with existing support for .noinit did not handle unique
.noinit.* and .gnu.linkonce.n.* sections the .noinit output section,
this patch also fixes that.

bfd/ChangeLog:

	* elf.c (special_sections_g): Add .gnu.linkonce.n and .gnu.linkonce.p.
	(special_sections_n): Add .noinit.
	(special_sections_p): Add .persistent.

binutils/ChangeLog:

	* testsuite/lib/binutils-common.exp (supports_noinit_section): New.
	(supports_persistent_section): New.

gas/ChangeLog:

	* testsuite/gas/elf/elf.exp: Run new tests.
	* testsuite/gas/elf/section25.d: New test.
	* testsuite/gas/elf/section25.s: New test.
	* testsuite/gas/elf/section26.d: New test.
	* testsuite/gas/elf/section26.s: New test.

ld/ChangeLog:

	* emulparams/armelf.sh (OTHER_SECTIONS): Remove .noinit section
	definition.
	Define HAVE_{NOINIT,PERSISTENT}=yes.
	* scripttempl/avr.sc (.noinit): Add .noinit.* and .gnu.linkonce.n.*
	input section wildcard patterns.
	* scripttempl/elf.sc: Define .noinit and .persistent sections when
	HAVE_NOINIT or HAVE_PERSISTENT are defined to "yes".
	* scripttempl/elf32msp430.sc (.noinit): Add .noinit.* and
	.gnu.linkonce.n.*. input section wildcard patterns.
	(.persistent): Add .persistent.* and
	.gnu.linkonce.p.*. input section wildcard patterns.
	* scripttempl/elfarcv2.sc (.noinit): Add .noinit.* and
	.gnu.linkonce.n.*. input section wildcard patterns.
	* scripttempl/pru.sc: Likewise.
	* testsuite/ld-elf/noinit-sections-1.d: New test.
	* testsuite/ld-elf/noinit-sections-2.d: New test.
	* testsuite/ld-elf/noinit-sections-2.l: New test.
	* testsuite/ld-elf/noinit-sections.s: New test.
	* testsuite/ld-elf/persistent-sections-1.d: New test.
	* testsuite/ld-elf/persistent-sections-2.d: New test.
	* testsuite/ld-elf/persistent-sections-2.l: New test.
	* testsuite/ld-elf/persistent-sections.s: New test.
2020-11-27 10:45:35 +00:00
Alan Modra
e54ae97fb7 gas output_file_close error message
Seen on arm-elf, where ELFOSABI_ARM is set too late to get a warning
when processing ifunc related directives on their source line.
../gas/as-new ifunc.s -o tmpdir/ifunc.o
../gas/as-new: symbol type STT_GNU_IFUNC is supported only by GNU and FreeBSD targets
ifunc.s: Assembler messages:
ifunc.s: Fatal error: can't close tmpdir/ifunc.o: sorry, cannot handle this file

This patch doesn't fix the real underlying problem, just the late
error message where "can't close" is a misdirection in this case.

	* output-file.c (output_file_close): Remove "can't close" from
	error message.
	* testsuite/gas/mips/reginfo-2.l: Update expected output.
2020-11-25 16:35:31 +10:30
Przemyslaw Wirkus
a3a02fe862 aarch64: Add support for Cortex-A78C
This patch adds support for -mcpu=cortex-a78c command line option.
For more information about this processor, see [0]:

[0] https://developer.arm.com/ip-products/processors/cortex-a/cortex-a78c
2020-11-23 10:06:15 +00:00
Jozef Lawrynowicz
24a16d8b93 gas/testsuite: Fix SHF_GNU_RETAIN tests for FreeBSD OSABIs
gas/ChangeLog:

	* testsuite/gas/elf/section22.d: Allow FreeBSD OSABI in readelf
	output.
	* testsuite/gas/elf/section23a.d: Likewise.
	* testsuite/gas/elf/section24a.d: Likewise.
2020-11-19 19:05:00 +00:00
Alan Modra
058430b4a1 Re: Stop Gas from generating line info or address ranges
* doc/as.texi (.nop): Document optional size arg.
	* dwarf2dbg.c (dwarf2_gen_line_info_1): Only check SEC_ALLOC
	when ELF.  Warn whenever dwarf line number information is ignored.
	* frags.c (frag_offset_ignore_align_p): New function.
	* frags.h (frag_offset_ignore_align_p): Declare.
	* read.c (s_nop): Extend to support optional size arg.
	* testsuite/gas/elf/dwarf2-20.d: Expect warnings, and exact range.
	* testsuite/gas/elf/dwarf2-20.s: Emit 16 bytes worth of nops.
	* testsuite/gas/m68hc11/indexed12.d: Expect warnings.
2020-11-18 23:46:39 +10:30
Jozef Lawrynowicz
99fabbc973 Support SHF_GNU_RETAIN ELF section flag
The SHF_GNU_RETAIN section flag is an extension to the GNU ELF OSABI.
It is defined as follows:

=========================================================
Section Attribute Flags
+-------------------------------------+
| Name           | Value              |
+-------------------------------------+
| SHF_GNU_RETAIN | 0x200000 (1 << 21) |
+-------------------------------------+

SHF_GNU_RETAIN
  The link editor should not garbage collect the section.
=========================================================

The .section directive accepts the "R" flag, which indicates
SHF_GNU_RETAIN should be applied to the section.

There is not a direct mapping of SHF_GNU_RETAIN to the BFD
section flag SEC_KEEP. Keeping these flags distinct allows
SHF_GNU_RETAIN sections to be explicitly removed by placing them in
/DISCARD/.

bfd/ChangeLog:

	* elf-bfd.h (enum elf_gnu_osabi): Add elf_gnu_osabi_retain.
	(struct elf_obj_tdata): Increase has_gnu_osabi to 4 bits.
	* elf.c (_bfd_elf_make_section_from_shdr): Set elf_gnu_osabi_retain
	for SHF_GNU_RETAIN.
	(_bfd_elf_final_write_processing): Report if SHF_GNU_RETAIN is
	not supported by the OSABI.
	Adjust error messages.
	* elflink.c (elf_link_input_bfd): Copy enabled has_gnu_osabi bits from
	input BFD to output BFD.
	(bfd_elf_gc_sections): gc_mark the section if SHF_GNU_RETAIN is set.

binutils/ChangeLog:

	* NEWS: Announce SHF_GNU_RETAIN support.
	* readelf.c (get_elf_section_flags): Handle SHF_GNU_RETAIN.
	Recognize SHF_GNU_RETAIN and SHF_GNU_MBIND only for supported OSABIs.
	* testsuite/binutils-all/readelf.exp: Run new tests.
	Don't run run_dump_test when there isn't an assembler available.
	* testsuite/lib/binutils-common.exp (supports_gnu_osabi): Adjust
	comment.
	* testsuite/binutils-all/readelf-maskos-1a.d: New test.
	* testsuite/binutils-all/readelf-maskos-1b.d: New test.
	* testsuite/binutils-all/readelf-maskos.s: New test.
	* testsuite/binutils-all/retain1.s: New test.
	* testsuite/binutils-all/retain1a.d: New test.
	* testsuite/binutils-all/retain1b.d: New test.

gas/ChangeLog:

	* NEWS: Announce SHF_GNU_RETAIN support.
	* config/obj-elf.c (obj_elf_change_section): Merge SHF_GNU_RETAIN bit
	between section declarations.
	(obj_elf_parse_section_letters): Handle 'R' flag.
	Handle numeric flag values within the SHF_MASKOS range.
	(obj_elf_section): Validate SHF_GNU_RETAIN usage.
	* doc/as.texi: Document 'R' flag to .section directive.
	* testsuite/gas/elf/elf.exp: Run new tests.
	* testsuite/gas/elf/section10.d: Unset SHF_GNU_RETAIN bit.
	* testsuite/gas/elf/section10.s: Likewise.
	* testsuite/gas/elf/section22.d: New test.
	* testsuite/gas/elf/section22.s: New test.
	* testsuite/gas/elf/section23.s: New test.
	* testsuite/gas/elf/section23a.d: New test.
	* testsuite/gas/elf/section23b.d: New test.
	* testsuite/gas/elf/section23b.err: New test.
	* testsuite/gas/elf/section24.l: New test.
	* testsuite/gas/elf/section24.s: New test.
	* testsuite/gas/elf/section24a.d: New test.
	* testsuite/gas/elf/section24b.d: New test.

include/ChangeLog:

	* elf/common.h (SHF_GNU_RETAIN): Define.

ld/ChangeLog:

	* NEWS: Announce support for SHF_GNU_RETAIN.
	* ld.texi (garbage collection): Document SHF_GNU_RETAIN.
	(Output Section Discarding): Likewise.
	* testsuite/ld-elf/elf.exp: Run new tests.
	* testsuite/ld-elf/retain1.s: New test.
	* testsuite/ld-elf/retain1a.d: New test.
	* testsuite/ld-elf/retain1b.d: New test.
	* testsuite/ld-elf/retain2.d: New test.
	* testsuite/ld-elf/retain2.ld: New test.
	* testsuite/ld-elf/retain2.map: New test.
	* testsuite/ld-elf/retain3.d: New test.
	* testsuite/ld-elf/retain3.s: New test.
	* testsuite/ld-elf/retain4.d: New test.
	* testsuite/ld-elf/retain4.s: New test.
	* testsuite/ld-elf/retain5.d: New test.
	* testsuite/ld-elf/retain5.map: New test.
	* testsuite/ld-elf/retain5lib.s: New test.
	* testsuite/ld-elf/retain5main.s: New test.
	* testsuite/ld-elf/retain6a.d: New test.
	* testsuite/ld-elf/retain6b.d: New test.
	* testsuite/ld-elf/retain6lib.s: New test.
	* testsuite/ld-elf/retain6main.s: New test.
2020-11-18 11:51:13 +00:00
Nick Clifton
3d955acb36 When reading string arguments for the assembler's string directives treat space separated strings as a single entity.
* read.c (stringer): Treat space separated, quote enclosed strings
	as a single string.
	* doc/as.texi (asciz): Mention this behaviour in the description
	of the asciz directive.
	* testsuite/gas/all/asciz.s: New test.
	* testsuite/gas/all/asciz.d: New test driver.
	* testsuite/gas/all/gas.exp: Run the new test.
2020-11-17 15:45:01 +00:00
Przemyslaw Wirkus
3f4ff0886f aarch64: Add +pauth flag for Pointer Authentication feature
New -march option +pauth enables PAuth vel PAC (Pointer Authentication)
feature.
2020-11-16 21:22:09 +00:00
Przemyslaw Wirkus
e64441b14c aarch64: Extract Condition flag manipulation feature from Armv8.4-A
Extract FLAGM (Condition flag manipulation) feature from Armv8.4-A.
Please note that FLAGM stays a Armv8.4-A feature but now can be
assigned to other architectures or CPUs.

New -march option +flagm is added to enable independently this
feature.
2020-11-16 21:07:17 +00:00
Przemyslaw Wirkus
1bbda94fe0 arm: Add support for Cortex-A78C
This patch adds support for -mcpu=cortex-a78c command line option.
For more information about this processor, see [0]:

[0] https://developer.arm.com/ip-products/processors/cortex-a/cortex-a78c
2020-11-16 20:28:14 +00:00
Borislav Petkov
0fa0fc8539 x86: Ignore CS/DS/ES/SS segment-override prefixes in 64-bit mode
"In 64-bit mode, the CS, DS, ES, and SS segment-override prefixes have
no effect. These four prefixes are not treated as segment-override
prefixes for the purposes of multiple-prefix rules. Instead, they are
treated as null prefixes." (AMD APM v2).

However, objdump disassembles instructions containing those ignored
prefixes by still generating that segment override:

  66 66 2e 0f 1f 84 00 	data16 nopw %cs:0x0(%rax,%rax,1)
  00 00 00 00

Print those segment override prefixes as excessive ones:

  66 66 2e 0f 1f 84 00    data16 cs nopw 0x0(%rax,%rax,1)
  00 00 00 00

which is what they actually are - they have no effect and the decoding
hardware ignores them.

gas/

2020-11-14  Borislav Petkov  <bp@suse.de>

	* testsuite/gas/i386/x86-64-segovr.d: Adjust regexes.
	* testsuite/gas/i386/x86-64-nops.d: Likewise.
	* testsuite/gas/i386/x86-64-nops-1.d: Likewise.
	* testsuite/gas/i386/x86-64-nops-1-g64.d: Likewise.
	* testsuite/gas/i386/x86-64-nops-1-core2.d: Likewise.
	* testsuite/gas/i386/x86-64-nops-1-k8.d: Likewise.
	* testsuite/gas/i386/x86-64-nops-2.d: Likewise.
	* testsuite/gas/i386/x86-64-nops-3.d: Likewise.
	* testsuite/gas/i386/x86-64-nops-4.d: Likewise.
	* testsuite/gas/i386/x86-64-nops-4-core2.d: Likewise.
	* testsuite/gas/i386/x86-64-nops-4-k8.d: Likewise.
	* testsuite/gas/i386/x86-64-nops-5.d: Likewise.
	* testsuite/gas/i386/x86-64-nops-5-k8.d: Likewise.
	* testsuite/gas/i386/x86-64-nops-7.d: Likewise.
	* testsuite/gas/i386/x86-64-nop-1.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-1a.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-1b.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-1c.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-1d.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-1g.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-2c.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-6.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-7.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-8.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-nops-1-core2.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-nops-1-k8.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-nops-1.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-nops-2.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-nops-3.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-nops-4-core2.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-nops-4-k8.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-nops-4.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-nops-5-k8.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-nops-5.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-nops.d:: Likewise.

ld/

2020-11-14  Borislav Petkov  <bp@suse.de>

	* testsuite/ld-x86-64/pe-x86-64-4.od: Adjust regexes.
	* testsuite/ld-x86-64/tlsld3.dd: Likewise.
	* testsuite/ld-x86-64/tlsld4.dd: Likewise.

opcodes/

2020-11-14  Borislav Petkov  <bp@suse.de>

	* i386-dis.c (ckprefix): Do not assign active_seg_prefix in
	64-bit addressing mode.
	(NOTRACK_Fixup): Test prefixes for PREFIX_DS, instead of
	active_seg_prefix.
2020-11-14 06:20:33 -08:00
Andre Vieira
48f4d8ce96 gas, arm: PR26858 Fix availability of single precision vmul/vmla in arm mode
This patch fixes a mistake when enabling MVE instructions that disabled support
for single precision vmla and vmul for arm mode.

gas/ChangeLog:
2020-11-12  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	PR 26858
	*  config/tc-arm.c (asm_opcode insns): Fix vmul and vmla's ARM_VARIANT.
	* testsuite/gas/arm/pr26858.s: New test.
	* testsuite/gas/arm/pr26858.d: New test.
2020-11-13 08:59:48 +00:00
Jozef Lawrynowicz
1de037a0c5 MSP430: gas: Ignore -md option required for GCC backward compatibility
The redundant -md option was removed in e4ae357fe8, but it is required
for backwards compatibility with GCC 10, which passes it to the
assembler implicitly in certain situations.

It is now silently ignored.

gas/ChangeLog:

	* config/tc-msp430.c (OPTION_MOVE_DATA): Define.
	(md_parse_option): Ignore OPTION_MOVE_DATA.
	(md_longopts): Handle -md option.
	* testsuite/gas/msp430/msp430.exp: Run new test.
	* testsuite/gas/msp430/empty.s: New test.
	* testsuite/gas/msp430/ignore-md.d: New test.
2020-11-12 19:27:04 +00:00
Nick Clifton
a3183ad610 Fix up changelog entry of previous delta 2020-11-12 13:22:26 +00:00
Nick Clifton
bcb78b4761 Stop Gas from generating line info or address ranges for sections that do not contain code or are not loaded.
PR 26850
	* dwarf2dbg.c (dwarf2_gen_line_info_1): Do not record lines in
	sections that are not executable or not loadable.
	(out_debug_line): Move warning message into dwarf2_gen_line_info_1.
	* testsuite/gas/elf/dwarf2-20.s: New test.
	* testsuite/gas/elf/dwarf2-20.d: New test driver.
	* testsuite/gas/elf/elf.exp: Run the new test.
	* testsuite/gas/elf/warn-2.s: Use the .nop directive.
2020-11-12 11:43:20 +00:00
Przemyslaw Wirkus
f27c0b449f aarch64: Allow LS64 feature with Armv8.6
Allow users to use LS64 extension with Armv8.6 architecture.
2020-11-11 15:30:21 +00:00
Nick Clifton
3e50c9d9c9 Revert delta accidentally applied with commit 9372689d72 2020-11-09 16:47:29 +00:00
Denys Zagorui
0541201782 gas: improve reproducibility for stabs debugging data format
* config/obj-elf (obj_elf_init_stab_section): Improve
	reproducibility for stabs debugging data format
2020-11-09 15:39:10 +00:00
Spencer E. Olson
9372689d72 Add support for the LMBD (left-most bit detect) instruction to the PRU assembler.
include	* opcode/pru.h: Add LMBD (left-most bit detect) opcode index
opcodes * pru-opc.c: Add opcode description for LMBD (left-most bit detect)
gas 	* testsuite/gas/pru/misc.s: Add tests for lmbd (left-most bit detect)
 	* testsuite/gas/pru/misc.d: Add tests for lmbd (left-most bit
2020-11-09 12:41:09 +00:00
Przemyslaw Wirkus
4a3e3e2282 aarch64: Update LS64 feature with system register
This patch:
+ Adds new ACCDATA_EL1 (Accelerator Data) system register, see [0].
+ Adds LS64 instruction tests.
+ Update LS64 feature test with new register.
+ Fix comment for AARCH64_OPND_Rt_LS64.

    [0] https://developer.arm.com/docs/ddi0595/i/aarch64-system-registers/accdata_el1

Note: as this is register only extension we do not want to hide these
registers behind -march flag going forward (they should be enabled by
default).
2020-11-09 11:37:32 +00:00
Przemyslaw Wirkus
8edca81ece aarch64: Limit Rt register number for LS64 load/store instructions
Atomic 64-byte load/store instructions limit Rt register number to
values matching below condition (register <Xt> number must be even
and <= 22):

    if Rt<4:3> == '11' || Rt<0> == '1' then UNDEFINED;

This patch adds check if Rt fulfills above requirement.

For more details regarding atomic 64-byte load/store instruction for
Armv8.7 please refer to Arm A64 Instruction set documentation for
Armv8-A architecture profile, see document page 157 for load
instruction, and pages 414-418 for store instructions of [0].

    [0]: https://developer.arm.com/docs/ddi0596/i
2020-11-09 11:19:44 +00:00
Andreas Schwab
a76bf0e55d Fix regexp for development.exp
binutils/:
	* Makefile.am (development.exp): Fix regexp.
	* Makefile.in: Regenerate.
gas/:
	* Makefile.am (development.exp): Fix regexp.
	* Makefile.in: Regenerate.
ld/:
	* Makefile.am (development.exp): Fix regexp.
	* Makefile.in: Regenerate.
2020-11-09 12:05:39 +01:00
Nelson Chu
6e1605e430 RISC-V: Update ABI to the elf_flags after parsing elf attributes.
Originally, if the -mabi option isn't set, then assembler will set the
abi according to the architecture string in the riscv_after_parse_args.
But we should also check and reset the abi later since the architecture
string may be reset by the elf attributes.  Therefore, set the abi to
the elf_flags in the riscv_after_parse_args seems too early.  Besides,
we have to set the abi_xlen before assembling any instruction, so it
should be safe to call riscv_set_abi_by_arch at the place that we set
start_assemble to TRUE.  However, one minor case is that we won't call
the md_assemble when we are assembling an file without any instruction.
It seems that we still need to set the abi in riscv_elf_final_processing,
to make sure that abi can be updated according to the elf arch attributes.

For the rv32i and most elf toolchains, this patch can fix the mis-matched
ABI errors for Run pr26391-5 and Run pr26391-6 testcases.  Besides, it
also correct the elf header flags of the output objects.  Consider the
new testcases, mabi-fail-02 and mabi-noabi-attr-[01|02|03], they are
failed before applying this patch.

But I still get the mis-matched ABI errors for the following toolchains
when runnung the riscv-gnu-toolchain regressions,

newlib-rv32imafc-ilp32f-[medlow|medany]
linux-rv32imac-ilp32-[medlow|medany]
linux-rv32imafdc-ilp32-[medlow|medany}
linux-rv64imac-lp64-[medlow|medany]
linux-rv64imafdc-lp64-[medlow|medany}

For the newlib-rv32imafc-ilp32f, although we try to choose the abi
according to the elf attributes, we will use FLOAT_ABI_SOFT rather
than the FLOAT_ABI_SINGLE for the assmebly file wihtout setting the
-mabi, but compiler will set the abi to FLOAT_ABI_SINGLE for the
C files.

As for the linux toolchains, we also get fails for Run pr26391-5 and
Run pr26391-6 testcases.  Since the linux toolchain won't generate elf
attributes to correct the ISA, and the --with-arch configure option
isn't set, assembler will try to set the default arch to rv[32|64]g,
which means the FLOAT_ABI_DOUBLE will be choosed, and may be conflict
with the abi set by the toolchain.

Therefore, I would suggest that it's is more safe to set the --with-arch
when building binutils, but it may break some testcases.  For example,
ld-scripts/fill and ld-scripts/empty-address-2 may be broken when c-ext
is set.  We might insert R_RISCV_ALIGN to make sure the 4-byte alignment,
but the dump result will be a bit different from what the testcase expected.

However, this patch only fix the problem - the abi, elf_flags and the
instruction, which is generated according to the abi_xlen, are all fixed
once the elf attributes are set for most elf toolchains. Other mis-matched
ABI problems should be fixed when we always build the binutils with the
--with-arch= configure option.

	gas/
	* config/tc-riscv.c (explicit_mabi): New boolean to indicate if
	the -mabi= option is explictly set.
	(md_parse_option): Set explicit_mabi to TRUE if -mabi is set.
	(riscv_set_abi_by_arch): New function.  If the -mabi option isn't
	set, then we set the abi according to the architecture string.
	Otherwise, check if there are conflicts between architecture
	and abi setting.
	(riscv_after_parse_args): Move the abi setting to md_assemble nad
	riscv_elf_final_processing.
	(md_assemble): Call the riscv_set_abi_by_arch when we set the
	start_assemble to TRUE.
	(riscv_elf_final_processing): Likewise, in case the file without
	any instruction.

	* testsuite/gas/riscv/mabi-attr-01.s: New testcase.
	* testsuite/gas/riscv/mabi-attr-02.s: Likewise.
	* testsuite/gas/riscv/mabi-attr-03.s: Likewise.
	* testsuite/gas/riscv/mabi-fail-01.d: Likewise.
	* testsuite/gas/riscv/mabi-fail-01.l: Likewise.
	* testsuite/gas/riscv/mabi-fail-02.d: Likewise.
	* testsuite/gas/riscv/mabi-fail-02.l: Likewise.
	* testsuite/gas/riscv/mabi-noabi-attr-01a.d: Likewise.
	* testsuite/gas/riscv/mabi-noabi-attr-01b.d: Likewise.
	* testsuite/gas/riscv/mabi-noabi-attr-02a.d: Likewise.
	* testsuite/gas/riscv/mabi-noabi-attr-02b.d: Likewise.
	* testsuite/gas/riscv/mabi-noabi-attr-03a.d: Likewise.
	* testsuite/gas/riscv/mabi-noabi-attr-03b.d: Likewise.
	* testsuite/gas/riscv/mabi-noabi-march-01.d: Likewise.
	* testsuite/gas/riscv/mabi-noabi-march-02.d: Likewise.
	* testsuite/gas/riscv/mabi-noabi-march-03.d: Likewise.
2020-11-09 09:48:56 +08:00
Przemyslaw Wirkus
55cc012834 aarch64: Update feature RAS system registers
This patch:
+ updates RAS feature system registers with new RAS 1.1 regs.
+ extends RAS/RAS 1.1 support for all architecture levels of Armv8-A.

Please note that early Armv8-A architectures do not officially support RAS
extension.

Rationale of the patch:
To ease development so that user-friendly RAS system registers operands can be
used. Certain use cases require developers to enable only more generic
architecture (e.g. -march=armv8-a) during system development. Users must use
RAS extension registers bearing in mind that system they use must support it.

The RAS (Reliability, Availability, Serviceability) extension is a
system-level extension that defines a number of system registers.

RAS 1.1 (FEAT_RASv1p1) introduces five new system registers:
ERXPFGCTL_EL1, ERXPFGCDN_EL1, ERXMISC2_EL1, ERXMISC3_EL1 and
ERXPFGF_EL1.

For details see [0].

[0] https://developer.arm.com/docs/ddi0595/i/
2020-11-04 20:54:13 +00:00
Przemyslaw Wirkus
fd65497db4 [PATCH][GAS] aarch64: Add atomic 64-byte load/store instructions for Armv8.7
Armv8.7 architecture introduces the "accelerator extension", aka
load/store of 64 bytes. New atomic load/store instructions are: LD64B,
ST64B, ST64BV and ST64BV0.

This patch adds:
+ New feature +ls64 to -march command line.
+ New atomic load/store instructions associated with above feature.

For more details regarding atomic 64-byte load/store instruction for
Armv8.7 please refer to Arm A64 Instruction set documentation for
Armv8-A architecture profile, see document page 157 for load
instruction, and pages 414-418 for store instructions of [0].

    [0]: https://developer.arm.com/docs/ddi0596/i
2020-11-03 14:29:31 +00:00
Przemyslaw Wirkus
3a959875ea [PATCH] aarch64: Update missing ChangeLog for AArch64 commits
Patch with missing ChangeLog entries for GAS AArch64 files.
2020-11-03 11:55:14 +00:00
Christian Eggers
05862db73f gas: fix symbol value calculation for versioned symbol aliases
Symbol value is in bytes while fragS::fr_address is in octets. Fixes GAS
symver12 and symver13 tests on ELF targets with with OCTETS_PER_BYTE>1.

	* config/obj-elf (elf_frob_symbol): Fix symbol value calculation
	for versioned symbol aliases.

Signed-off-by: Christian Eggers <ceggers@gmx.de>
2020-11-03 18:17:35 +10:30
H.J. Lu
b0ab069373 x86: Support GNU_PROPERTY_X86_ISA_1_BASELINE marker
GCC 11 supports -march=x86-64-v[234] to enable x86 micro-architecture ISA
levels:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97250

X86 ISA markers are updated:

https://gitlab.com/x86-psABIs/x86-64-ABI/-/merge_requests/13

GNU_PROPERTY_X86_ISA_1_BASELINE is added and GNU_PROPERTY_X86_ISA_1_V[234]
are updated:

 #define GNU_PROPERTY_X86_ISA_1_BASELINE (1U << 0)
 #define GNU_PROPERTY_X86_ISA_1_V2       (1U << 1)
 #define GNU_PROPERTY_X86_ISA_1_V3       (1U << 2)
 #define GNU_PROPERTY_X86_ISA_1_V4       (1U << 3)

Add -z x86-64-baseline linker command line option to mark x86-64-baseline
ISA level as needed.

bfd/

	PR gas/26703
	* elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Generate
	GNU_PROPERTY_X86_ISA_1_BASELINE for -z x86-64-baseline.

binutils/

	PR gas/26703
	* readelf.c (decode_x86_isa): Handle
	* GNU_PROPERTY_X86_ISA_1_BASELINE.
	* testsuite/binutils-all/i386/empty.d: Updated.
	* testsuite/binutils-all/i386/ibt.d: Likewise.
	* testsuite/binutils-all/i386/pr21231a.d: Likewise.
	* testsuite/binutils-all/i386/pr21231b.d: Likewise.
	* testsuite/binutils-all/i386/shstk.d: Likewise.
	* testsuite/binutils-all/x86-64/empty-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/empty.d: Likewise.
	* testsuite/binutils-all/x86-64/ibt-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/ibt.d: Likewise.
	* testsuite/binutils-all/x86-64/pr21231a.d: Likewise.
	* testsuite/binutils-all/x86-64/pr21231b.d: Likewise.
	* testsuite/binutils-all/x86-64/pr23494a-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/pr23494a.d: Likewise.
	* testsuite/binutils-all/x86-64/pr23494c-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/pr23494c.d: Likewise.
	* testsuite/binutils-all/x86-64/pr23494d-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/pr23494d.d: Likewise.
	* testsuite/binutils-all/x86-64/pr23494e-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/pr23494e.d: Likewise.
	* testsuite/binutils-all/x86-64/shstk-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/shstk.d: Likewise.

gas/

	PR gas/26703
	* config/tc-i386.c (output_insn): Update for
	GNU_PROPERTY_X86_ISA_1_BASELINE.
	* testsuite/gas/i386/property-1.d: Updated.
	* testsuite/gas/i386/property-2.d: Likewise.
	* testsuite/gas/i386/property-3.d: Likewise.
	* testsuite/gas/i386/property-4.d: Likewise.
	* testsuite/gas/i386/property-5.d: Likewise.
	* testsuite/gas/i386/property-6.d: Likewise.
	* testsuite/gas/i386/property-11.d: Likewise.
	* testsuite/gas/i386/property-12.d: Likewise.
	* testsuite/gas/i386/x86-64-property-1.d: Likewise.
	* testsuite/gas/i386/x86-64-property-2.d: Likewise.
	* testsuite/gas/i386/x86-64-property-3.d: Likewise.
	* testsuite/gas/i386/x86-64-property-4.d: Likewise.
	* testsuite/gas/i386/x86-64-property-5.d: Likewise.
	* testsuite/gas/i386/x86-64-property-6.d: Likewise.
	* testsuite/gas/i386/x86-64-property-11.d: Likewise.
	* testsuite/gas/i386/x86-64-property-12.d: Likewise.

include/

	PR gas/26703
	* elf/common.h (GNU_PROPERTY_X86_ISA_1_BASELINE): New.
	(GNU_PROPERTY_X86_ISA_1_V2): Uppdated.
	(GNU_PROPERTY_X86_ISA_1_V3): Likewise.
	(GNU_PROPERTY_X86_ISA_1_V4): Likewise.

ld/

	PR gas/26703
	* NEWS: Mention -z x86-64-baseline.
	* ld.texi: Document -z x86-64-baseline.
	* emulparams/x86-64-level.sh: Handle -z x86-64-baseline.
	* testsuite/ld-elf/x86-feature-1a.rd: Update.
	* testsuite/ld-elf/x86-feature-1b.rd: Likewise.
	* testsuite/ld-elf/x86-feature-1c.rd: Likewise.
	* testsuite/ld-elf/x86-feature-1d.rd: Likewise.
	* testsuite/ld-elf/x86-feature-1e.rd: Likewise.
	* testsuite/ld-i386/pr23372c.d: Likewise.
	* testsuite/ld-i386/pr23486c.d: Likewise.
	* testsuite/ld-i386/pr23486d.d: Likewise.
	* testsuite/ld-i386/pr24322a.d: Likewise.
	* testsuite/ld-i386/pr24322b.d: Likewise.
	* testsuite/ld-i386/property-1a.r: Likewise.
	* testsuite/ld-i386/property-2a.r: Likewise.
	* testsuite/ld-i386/property-3.r: Likewise.
	* testsuite/ld-i386/property-3a.r: Likewise.
	* testsuite/ld-i386/property-4.r: Likewise.
	* testsuite/ld-i386/property-4a.r: Likewise.
	* testsuite/ld-i386/property-5.r: Likewise.
	* testsuite/ld-i386/property-5a.r: Likewise.
	* testsuite/ld-i386/property-7a.r: Likewise.
	* testsuite/ld-i386/property-x86-3.d: Likewise.
	* testsuite/ld-i386/property-x86-4a.d: Likewise.
	* testsuite/ld-i386/property-x86-5.d: Likewise.
	* testsuite/ld-i386/property-x86-cet1.d: Likewise.
	* testsuite/ld-i386/property-x86-cet2a.d: Likewise.
	* testsuite/ld-i386/property-x86-cet5a.d: Likewise.
	* testsuite/ld-i386/property-x86-cet5b.d: Likewise.
	* testsuite/ld-i386/property-x86-ibt1a.d: Likewise.
	* testsuite/ld-i386/property-x86-ibt1b.d: Likewise.
	* testsuite/ld-i386/property-x86-ibt2.d: Likewise.
	* testsuite/ld-i386/property-x86-ibt3a.d: Likewise.
	* testsuite/ld-i386/property-x86-ibt3b.d: Likewise.
	* testsuite/ld-i386/property-x86-ibt4.d: Likewise.
	* testsuite/ld-i386/property-x86-ibt5.d: Likewise.
	* testsuite/ld-i386/property-x86-isa1.d: Likewise.
	* testsuite/ld-i386/property-x86-isa2.d: Likewise.
	* testsuite/ld-i386/property-x86-isa3.d: Likewise.
	* testsuite/ld-i386/property-x86-shstk1a.d: Likewise.
	* testsuite/ld-i386/property-x86-shstk1b.d: Likewise.
	* testsuite/ld-i386/property-x86-shstk2.d: Likewise.
	* testsuite/ld-i386/property-x86-shstk3a.d: Likewise.
	* testsuite/ld-i386/property-x86-shstk3b.d: Likewise.
	* testsuite/ld-i386/property-x86-shstk4.d: Likewise.
	* testsuite/ld-i386/property-x86-shstk5.d: Likewise.
	* testsuite/ld-x86-64/pr23372c-x32.d: Likewise.
	* testsuite/ld-x86-64/pr23372c.d: Likewise.
	* testsuite/ld-x86-64/pr23486c-x32.d: Likewise.
	* testsuite/ld-x86-64/pr23486c.d: Likewise.
	* testsuite/ld-x86-64/pr23486d-x32.d: Likewise.
	* testsuite/ld-x86-64/pr23486d.d: Likewise.
	* testsuite/ld-x86-64/pr24322a-x32.d: Likewise.
	* testsuite/ld-x86-64/pr24322a.d: Likewise.
	* testsuite/ld-x86-64/pr24322b-x32.d: Likewise.
	* testsuite/ld-x86-64/pr24322b.d: Likewise.
	* testsuite/ld-x86-64/pr24458a-x32.d: Likewise.
	* testsuite/ld-x86-64/pr24458a.d: Likewise.
	* testsuite/ld-x86-64/pr24458b-x32.d: Likewise.
	* testsuite/ld-x86-64/pr24458b.d: Likewise.
	* testsuite/ld-x86-64/pr24458c-x32.d: Likewise.
	* testsuite/ld-x86-64/pr24458c.d: Likewise.
	* testsuite/ld-x86-64/property-1a.r: Likewise.
	* testsuite/ld-x86-64/property-2a.r: Likewise.
	* testsuite/ld-x86-64/property-3.r: Likewise.
	* testsuite/ld-x86-64/property-3a.r: Likewise.
	* testsuite/ld-x86-64/property-4.r: Likewise.
	* testsuite/ld-x86-64/property-4a.r: Likewise.
	* testsuite/ld-x86-64/property-5.r: Likewise.
	* testsuite/ld-x86-64/property-5a.r: Likewise.
	* testsuite/ld-x86-64/property-7a.r: Likewise.
	* testsuite/ld-x86-64/property-x86-3-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-3.d: Likewise.
	* testsuite/ld-x86-64/property-x86-4a-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-4a.d: Likewise.
	* testsuite/ld-x86-64/property-x86-5-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-5.d: Likewise.
	* testsuite/ld-x86-64/property-x86-cet1-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-cet1.d: Likewise.
	* testsuite/ld-x86-64/property-x86-cet2a-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-cet2a.d: Likewise.
	* testsuite/ld-x86-64/property-x86-cet5a-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-cet5a.d: Likewise.
	* testsuite/ld-x86-64/property-x86-cet5b-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-cet5b.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt1a-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt1a.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt1b-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt1b.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt2-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt2.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt3a-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt3a.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt3b-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt3b.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt4-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt4.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt5-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-isa1-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-isa1.d: Likewise.
	* testsuite/ld-x86-64/property-x86-isa2-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-isa2.d: Likewise.
	* testsuite/ld-x86-64/property-x86-isa3-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-isa3.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt5.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk1a-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk1a.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk1b-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk1b.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk2-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk2.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk3a-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk3a.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk3b-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk3b.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk4-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk4.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk5-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk5.d: Likewise.
	* testsuite/ld-i386/i386.exp: Run property-x86-isa4.
	* testsuite/ld-i386/property-x86-isa4.d: New file.
	* testsuite/ld-x86-64/property-x86-isa4-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-isa4.d: Likewise.
	* ld/testsuite/ld-x86-64/x86-64.exp: Run property-x86-isa4
	and property-x86-isa4-x32.
2020-10-30 06:50:10 -07:00
Przemyslaw Wirkus
a984d94aab [PATCH][GAS] aarch64: Add WFIT instruction for Armv8.7-a
This patch adds new to Armv8.7 WFIT instruction which take one operand:

    WFIT <Xt>

Where:
    <Xt> is 64-bit name of the general-purpose source register, encoded in the
         "Rd" field.

For more details regarding WFIT (Wait For Interrupt with Timeout) instruction for
Armv8.7-a please refer to Arm A64 Instruction set documentation for Armv8-A
architecture profile, see document pages 570 of [0].

	[0]: https://developer.arm.com/docs/ddi0596/i

gas/ChangeLog:

2020-10-30  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* NEWS: Update docs.
	* testsuite/gas/aarch64/system-5.d: Update test with WFIT insn.
	* testsuite/gas/aarch64/system-5.s: Update test with WFIT insn.

opcodes/ChangeLog:

2020-10-30  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* aarch64-tbl.h (struct aarch64_opcode): New instruction WFIT.
	* aarch64-asm-2.c: Regenerated.
	* aarch64-dis-2.c: Regenerated.
	* aarch64-opc-2.c: Regenerated.
2020-10-30 10:31:38 +00:00
Przemyslaw Wirkus
59d5613e42 aarch64: Fix DSB instruction 'missing immediate expression' errors
This patch fixes errors with DSB instruction after introduction of DSB nXS
variant. That change would cause GAS to reject valid DSB immediate string
operands.

gas/ChangeLog:

2020-10-28  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* config/tc-aarch64.c (parse_operands): Check for C0-C15 value of DSB
	immediate string operand.
	* testsuite/gas/aarch64/system-4.d: Update test.
	* testsuite/gas/aarch64/system-4.s: Update test.
2020-10-29 16:33:00 +00:00
Przemyslaw Wirkus
dd4a72c859 aarch64: Add CSR PDEC instruction
This patch adds:
+ New feature +csre to -march command line.
+ New instruction CSR PDEC associated with CSRE feature.

Please note that CSRE system registers were already upstreamed. This patch
should finalize CSRE feature implementation.

CSRE feature adds CSR PDEC (Decrements Call stack pointer by the size of
a Call stack record) instruction. Although this instruction has operand
(PDEC) it's instruction's only operand. PDEC forces instruction field Rt
to be set to 0b1111. This results in fixed opcode of the instruction.

gas/ChangeLog:

2020-10-27  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* NEWS: Update docs.
	* config/tc-aarch64.c (parse_csr_operand): New operand parser.
	(parse_operands): Call to CSR operand parser.
	* testsuite/gas/aarch64/csre_csr-invalid.d: New test.
	* testsuite/gas/aarch64/csre_csr-invalid.l: New test.
	* testsuite/gas/aarch64/csre_csr-invalid.s: New test.
	* testsuite/gas/aarch64/csre_csr.d: New test.
	* testsuite/gas/aarch64/csre_csr.s: New test.

include/ChangeLog:

2020-10-27  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* opcode/aarch64.h (AARCH64_FEATURE_CSRE): New -march feature.
	(enum aarch64_opnd): New CSR instruction field AARCH64_OPND_CSRE_CSR.

opcodes/ChangeLog:

2020-10-27  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* aarch64-opc.c (aarch64_print_operand): CSR PDEC operand print-out.
	* aarch64-tbl.h (CSRE): New CSRE feature handler.
	(_CSRE_INSN): New CSRE instruction type.
	(struct aarch64_opcode): New 'csre' entry for a CSRE CLI feature.
	* aarch64-asm-2.c: Regenerated.
	* aarch64-dis-2.c: Regenerated.
	* aarch64-opc-2.c: Regenerated.
2020-10-28 14:19:42 +00:00
Przemyslaw Wirkus
82503ca7ed aarch64: Add WFET instruction for Armv8.7-a
This patch adds new to Armv8.7 WFET instruction which take one operand:

    WFET <Xt>

Where:
    <Xt> is 64-bit name of the general-purpose source register, encoded in the
         "Rd" field.

For more details regarding WFET (Wait For Event with Timeout) instruction for
Armv8.7-a please refer to Arm A64 Instruction set documentation for Armv8-A
architecture profile, see document pages 565 of [0].

	[0]: https://developer.arm.com/docs/ddi0596/i

gas/ChangeLog:

2020-10-27  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* NEWS: Update docs.
	* testsuite/gas/aarch64/system-5.d: New test.
	* testsuite/gas/aarch64/system-5.s: New test.

opcodes/ChangeLog:

2020-10-27  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* aarch64-tbl.h (struct aarch64_opcode): Add new WFET instruction encoding
	and operand description.
	* aarch64-asm-2.c: Regenerated.
	* aarch64-dis-2.c: Regenerated.
	* aarch64-opc-2.c: Regenerated.
2020-10-28 14:12:37 +00:00
Przemyslaw Wirkus
fd195909ce aarch64: Add DSB instruction Armv8.7-a variant
This patch adds new variant (nXS) of DSB memory barrier instruction
available in Armv8.7-a. New nXS variant has different encoding in
comparison with pre Armv8.7-a DSB memory barrier variant thus new
instruction and new operand was added.

DSB memory nXS barrier variant specifies the limitation on the barrier
operation. Allowed values are:

	DSB SYnXS|#28
	DSB ISHnXS|#24
	DSB NSHnXS|#20
	DSB OSHnXS|#16

Please note that till now,  for barriers, barrier operation was encoded in
4-bit unsigned immediate CRm field (in the range 0 to 15).
For DSB memory nXS barrier variant, barrier operation is a 5-bit unsigned
assembly instruction immediate, encoded in instruction in two bits CRm<3:2>:

		CRm<3:2>  #imm
		  00       16
		  01       20
		  10       24
		  11       28

This patch extends current AArch64 barrier instructions with above mapping.

Notable patch changes include:
+ New DSB memory barrier variant encoding for Armv8.7-a.
+ New operand BARRIER_DSB_NXS for above instruction in order to
distinguish between existing and new DSB instruction flavour.
+ New set of DSB nXS barrier options.
+ New instruction inserter and extractor map between instruction
immediate 5-bit value and 2-bit CRm field of the instruction itself (see
FLD_CRm_dsb_nxs).
+ Regeneration of aarch64-[asm|dis|opc]-2.c files.
+ Test cases to cover new instruction assembling and disassembling.

For more details regarding DSB memory barrier instruction and its
Armv8.7-a flavour please refer to Arm A64 Instruction set documentation
for Armv8-A architecture profile, see document pages 132-133 of [0].

	[0]: https://developer.arm.com/docs/ddi0596/i

gas/ChangeLog:

2020-10-23  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* NEWS: Docs update.
	* config/tc-aarch64.c (parse_operands): Add
	AARCH64_OPND_BARRIER_DSB_NXS handler.
	(md_begin): Add content of aarch64_barrier_dsb_nxs_options to
	aarch64_barrier_opt_hsh hash.
	* testsuite/gas/aarch64/system-4-invalid.d: New test.
	* testsuite/gas/aarch64/system-4-invalid.l: New test.
	* testsuite/gas/aarch64/system-4-invalid.s: New test.
	* testsuite/gas/aarch64/system-4.d: New test.
	* testsuite/gas/aarch64/system-4.s: New test.

include/ChangeLog:

2020-10-23  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* opcode/aarch64.h (enum aarch64_opnd): New operand
	AARCH64_OPND_BARRIER_DSB_NXS.
	(aarch64_barrier_dsb_nxs_options): Declare DSB nXS options.

opcodes/ChangeLog:

2020-10-23  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* aarch64-asm.c (aarch64_ins_barrier_dsb_nxs): New inserter.
	* aarch64-asm.h (AARCH64_DECL_OPD_INSERTER): New inserter
	ins_barrier_dsb_nx.
	* aarch64-dis.c (aarch64_ext_barrier_dsb_nxs): New extractor.
	* aarch64-dis.h (AARCH64_DECL_OPD_EXTRACTOR): New extractor
	ext_barrier_dsb_nx.
	* aarch64-opc.c (aarch64_print_operand): New options table
	aarch64_barrier_dsb_nxs_options.
	* aarch64-opc.h (enum aarch64_field_kind): New field name FLD_CRm_dsb_nxs.
	* aarch64-tbl.h (struct aarch64_opcode): Define DSB nXS barrier
	Armv8.7-a instruction.
	* aarch64-asm-2.c: Regenerated.
	* aarch64-dis-2.c: Regenerated.
	* aarch64-opc-2.c: Regenerated.
2020-10-28 14:05:05 +00:00
Przemyslaw Wirkus
8926e54e3a aarch64: Add basic support for armv8.7-a architecture
This patch adds support for AArch64 -march=armv8.7-a command line option
in GAS.

Please note that this change ONLY extends -march= command line interface
with a new "armv8.7-a" option. Architectural changes like new instructions
will be added in following patches.

gas/ChangeLog:

2020-10-16  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* NEWS: Docs update.
	* config/tc-aarch64.c (armv8.7-a): New arch.
	* doc/c-aarch64.texi (-march=armv8.7-a): Update docs.

include/ChangeLog:

2020-10-16  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* opcode/aarch64.h (AARCH64_FEATURE_V8_7): New feature bitmask.
	(AARCH64_ARCH_V8_7): New arch feature set.

opcodes/ChangeLog:

2020-10-16  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* aarch64-tbl.h (ARMV8_7): New macro.
2020-10-28 13:58:17 +00:00
H.J. Lu
ae9d2233e6 gas: Clear all auto-assigned file slots
Since a file slot is auto-assigned for the #APP marker appeared before
the first .file <NUMBER> directive has been seen, clear all auto-assigned
file slots when seeing the first .file <NUMBER> directive.

	PR gas/26778
	* * dwarf2dbg.c (num_of_auto_assigned): New.
	(allocate_filenum): Increment num_of_auto_assigned.
	(dwarf2_directive_filename): Clear the slots auto-assigned
	before the first .file <NUMBER> directive was seen.
	* testsuite/gas/i386/dwarf4-line-1.d: New file.
	* testsuite/gas/i386/dwarf4-line-1.s: Likewise.
	* testsuite/gas/i386/i386.exp: Run dwarf4-line-1.
2020-10-26 06:16:21 -07:00
Lifang Xia
7e300b8612 Update gas/ChangeLog of last commit
gas/
	* ChangeLog: Update ChangLog of 2e58f3923e
2020-10-26 18:03:22 +08:00
Cooper Qu
2e58f3923e C-SKY: Fix the literal dump of big vector constant.
gas/
	* config/tc-csky.c (dump_literals): Fix the literal dump of big
	vector constant.
2020-10-26 17:17:53 +08:00
Cooper Qu
eae61d61e9 CSKY: Change plsl.u16 to plsl.16.
gas/
	* testsuite/gas/csky/enhance_dsp.s : Change plsl.u16 to plsl.16.
	* testsuite/gas/csky/enhance_dsp.d : Change plsl.u16 to plsl.16.

opcodes/
	* csky-opc.h (csky_v2_opcodes): Change plsl.u16 to plsl.16.

Change-Id: Ifb43573192e215527355f6541365b9f6a8ec80a4
2020-10-26 16:26:32 +08:00
Cooper Qu
9d1ccf22fd CSKY: Add version flag in eflag and fix bug in disassembling register.
gas/
	* config/tc-csky.c (md_begin): Add version flag in eflag.

include/
	* opcode/csky.h (CSKY_VERSION_V1): Define, currently used.
	(CSKY_VERSION_V2): Define.
	(CSKY_VERSION_V3): Define.

Change-Id: Iafe3a9ce6fe544880a225b9fae439275a828bb34
2020-10-26 16:20:10 +08:00
Cooper Qu
039dac293d CSKY: Fix and add some instructions for VDSPV1.
gas/
	* config/tc-csky.c (get_operand_value): Add handler for
	OPRND_TYPE_IMM5b_VSH and OPRND_TYPE_VREG_WITH_INDEX.
	* testsuite/gas/csky/csky_vdsp.d : Fix the disassembling
	for vector register.

opcodes/
	* csky-dis.c (csky_output_operand): Add handler for
	OPRND_TYPE_IMM5b_VSH and OPRND_TYPE_VREG_WITH_INDEX.
	* csky-opc.h (OPRND_TYPE_VREG_WITH_INDEX): New enum.
	(OPRND_TYPE_IMM5b_VSH): New enum.
	(csky_v2_opcodes): Fix and add some instructions for VDSPV1.

Change-Id: Ia5675d7b716fe5c331e6121ad8f83061ef6454bb
2020-10-26 16:13:55 +08:00
Cui,Lili
069ef16480 Change avxvnni disassembler output from {vex3} to {vex}
gas/

	* testsuite/gas/i386/avx-vnni.d: Change psuedo prefix from
	{vex3} to {vex}
	* testsuite/gas/i386/x86-64-avx-vnni.d: Likewise.

opcodes/

	* i386-dis.c: Change "XV" to print "{vex}" pseudo prefix.
2020-10-26 10:51:55 +08:00
Przemyslaw Wirkus
6278c6a663 [PATCH][GAS][AArch64] Define BRBE system registers
This patch introduces BRBE (Branch Record Buffer Extension) system
registers.

Note: as this is register only extension we do not want to hide these
registers behind -march flag going forward (they should be enabled by
default).

gas/ChangeLog:

2020-10-08  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* NEWS: Docs update.
	* testsuite/gas/aarch64/brbe-invalid.d: New test.
	* testsuite/gas/aarch64/brbe-invalid.l: New test.
	* testsuite/gas/aarch64/brbe-invalid.s: New test.
	* testsuite/gas/aarch64/brbe.d: New test.
	* testsuite/gas/aarch64/brbe.s: New test.

opcodes/ChangeLog:

2020-10-08  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* aarch64-opc.c: Add BRBE system registers.
2020-10-22 15:17:35 +01:00
Przemyslaw Wirkus
5feaa09bec aarch64: Define CSRE system registers
This patch introduces CSRE (Call Stack Recorder Extension) system
registers.

Note: as this is register only extension we do not want to hide these
registers behind -march flag going forward (they should be enabled by
default).

CSRE feature adds CSR PDEC (Decrements Call stack pointer by the size
of a Call stack record) instruction. This instruction will be added in
a following, separate patch. This change only adds CSRE system
registers.

gas/ChangeLog:

2020-10-08  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* NEWS: Docs update.
	* testsuite/gas/aarch64/csre-invalid.d: New test.
	* testsuite/gas/aarch64/csre-invalid.l: New test.
	* testsuite/gas/aarch64/csre-invalid.s: New test.
	* testsuite/gas/aarch64/csre.d: New test.
	* testsuite/gas/aarch64/csre.s: New test.

opcodes/ChangeLog:

2020-10-08  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* aarch64-opc.c: New CSRE system registers defined.
2020-10-22 15:17:10 +01:00
Srinath Parvathaneni
79248c83b9 arm: Fix the wrong error message string for mve vldr/vstr (PR26763).
For mve vldr/vstr instructions assembler is throwing wrong error message.
Instead of 'Error: syntax error' assembler fails with 'Error: lo register required'.
This patch fixes the issue.

eg:
$ cat x.s
.syntax unified
.thumb

vldrb.s16 q0, r0

Before this patch:
$ arm-none-eabi-as x.s -march=armv8.1-m.main+mve -mfloat-abi=hard
x.s: Assembler messages:
x.s:4: Error: lo register required -- `vldrb.s16 q0,r0'

After this patch:
$ arm-none-eabi-as x.s -march=armv8.1-m.main+mve -mfloat-abi=hard
x.s: Assembler messages:
x.s:4: Error: syntax error -- `vldrb.s16 q0,r0'

gas/ChangeLog:

2020-10-21  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	PR target/26763
	* config/tc-arm.c (parse_address_main): Add new MVE addressing mode
	check.
	* testsuite/gas/arm/mve-vldr-vstr-bad.d: New test.
	* testsuite/gas/arm/mve-vldr-vstr-bad.l: Likewise.
	* testsuite/gas/arm/mve-vldr-vstr-bad.s: Likewise.
2020-10-22 13:30:35 +01:00
Dr. David Alan Gilbert
777cd7ab3f Fix printf formatting errors where "0x" is used as a prefix for a decimal number.
bfd	* po/es.po: Fix printf format

binutils * windmc.c: Fix printf format

gas	* config/tc-arc.c: Fix printf format

opcodes	* po/es.po: Fix printf format

sim	* arm/armos.c: Fix printf format
	* ppc/emul_netbsd.c: Fix printf format
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
2020-10-22 12:00:10 +01:00
Przemyslaw Wirkus
ffd73a8b9e aarch64: Add testcase for HCR_EL2 system register
HCR_EL2 is a 64-bit Hypervisor Configuration Register.

gas/ChangeLog:

2020-10-16  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* testsuite/gas/aarch64/sysreg-6.d: New test.
	* testsuite/gas/aarch64/sysreg-6.s: New test.
2020-10-21 18:28:27 +01:00
Ganesh Gopalasubramanian
646cc3e010 Add AMD znver3 processor support
gas/

	* config/tc-i386.c (cpu_arch): Add CPU_ZNVER3_FLAGS flags.
	(i386_align_code): Add PROCESSOR_ZNVER cases.
	* doc/c-i386.texi: Add znver3, snp, invlpgb and tlbsync.
	* gas/i386/i386.exp: Add new znver3 test cases.
	* gas/i386/arch-14-znver3.d: New.
	* gas/i386/arch-14.d: New.
	* gas/i386/arch-14.s: New.
	* gas/i386/invlpgb.d: New.
	* gas/i386/invlpgb64.d: New.
	* gas/i386/invlpgb.s: New.
	* gas/i386/snp.d: New.
	* gas/i386/snp64.d: New.
	* gas/i386/snp.s: New.
	* gas/i386/tlbsync.d: New.
	* gas/i386/tlbsync.s: New.
	* gas/i386/x86-64-arch-4-znver3.d: New.
	* gas/i386/x86-64-arch-4.d: New.
	* gas/i386/x86-64-arch-4.s: New.

opcodes/

	* i386-dis.c (rm_table): Add tlbsync, snp, invlpgb.
	* i386-gen.c (cpu_flag_init): Add new CPU_INVLPGB_FLAGS,
	CPU_TLBSYNC_FLAGS, and CPU_SNP_FLAGS.
	Add CPU_ZNVER3_FLAGS.
	(cpu_flags): Add CpuINVLPGB, CpuTLBSYNC, CpuSNP.
	* i386-opc.h: Add CpuINVLPGB, CpuTLBSYNC, CpuSNP.
	* i386-opc.tbl: Add invlpgb, tlbsync, psmash, pvalidate,
	rmpupdate, rmpadjust.
	* i386-init.h: Re-generated.
	* i386-tbl.h: Re-generated.
2020-10-20 13:58:04 -07:00
H.J. Lu
9717970a4e gas: Add a -gdwarf-5 debug_line test with .s file
PR gas/25878
	PR gas/26740
	* testsuite/gas/i386/dwarf5-line-4.d: New file.
	* testsuite/gas/i386/dwarf5-line-4.s: Likewise.
	* testsuite/gas/i386/i386.exp: Run dwarf5-line-4.
2020-10-17 05:52:13 -07:00
H.J. Lu
7ffdc9ae6e gas: Replace dwarf5-line-2.S with dwarf5-line-3.S
PR gas/25878
	PR gas/26740
	* testsuite/gas/i386/dwarf5-line-3.s: Replace dwarf5-line-2.S
	with dwarf5-line-3.S.
	* testsuite/gas/i386/dwarf5-line-3.d: Updated.
2020-10-17 05:35:23 -07:00
H.J. Lu
bd0c565edb gas: Always use as_where for preprocessed assembly codes
Always clear the slot 1 if it was assigned to the input file before the
first .file <NUMBER> directive has been seen.  Always use as_where to
generate the correct debug infor for preprocessed assembly codes.

	PR gas/25878
	PR gas/26740
	* dwarf2dbg.c (allocate_filename_to_slot): Don't reuse the slot 1
	here.
	(dwarf2_where): Restore as_where.
	(dwarf2_directive_filename): Clear the slot 1 if it was assigned
	to the input file.
	* testsuite/gas/i386/dwarf5-line-2.d: New file.
	* testsuite/gas/i386/dwarf5-line-2.s: Likewise.
	* testsuite/gas/i386/dwarf5-line-3.d: Likewise.
	* testsuite/gas/i386/dwarf5-line-3.s: Likewise.
	* testsuite/gas/i386/i386.exp: Run dwarf5-line-2 and
	dwarf5-line-3.
2020-10-17 04:24:22 -07:00
H.J. Lu
6915020bb1 gas: Reuse the input file entry in the file table
Some instructions can be emitted (dwarf2_emit_insn is called) before the
first .file <NUMBER> directive has been seen, which allocates the input
file as the first file entry.  Reuse the input file entry in the file
table.

	PR gas/25878
	PR gas/26740
	* dwarf2dbg.c (file_entry): Remove auto_assigned.
	(assign_file_to_slot): Remove the auto_assign argument.
	(allocate_filenum): Updated.
	(allocate_filename_to_slot): Reuse the input file entry in the
	file table.
	(dwarf2_where): Replace as_where with as_where_physical.
	* testsuite/gas/i386/dwarf5-line-1.d: New file.
	* testsuite/gas/i386/dwarf5-line-1.s: Likewise.
	* testsuite/gas/i386/i386.exp: Run dwarf5-line-1.
2020-10-16 04:07:59 -07:00
Cui,Lili
5739259879 Enhancement for avx-vnni patch
1. Rename CpuVEX_PREFIX to PseudoVexPrefix and
   move it from cpu_flags to opcode_modifiers.
2. Delete {vex2} invalid test.
3. Use VexW0 and VexVVVV in the AVX-VNNI instructions.

gas/
	* config/tc-i386.c: Move Pseudo Prefix check to match_template.
	* testsuite/gas/i386/avx-vnni-inval.l: New file.
	* testsuite/gas/i386/avx-vnni-inval.s: Likewise.
	* testsuite/gas/i386/avx-vnni.d: Delete invalid {vex2} test.
	* testsuite/gas/i386/avx-vnni.s: Likewise.
	* testsuite/gas/i386/i386.exp: Add AVX VNNI invalid tests.
	* testsuite/gas/i386/x86-64-avx-vnni-inval.l: New file.
	* testsuite/gas/i386/x86-64-avx-vnni-inval.s: Likewise.
	* testsuite/gas/i386/x86-64-avx-vnni.d: Delete invalid {vex2} test.
	* testsuite/gas/i386/x86-64-avx-vnni.s: Likewise.

opcodes/
	* i386-opc.tbl: Rename CpuVEX_PREFIX to PseudoVexPrefix
	and move it from cpu_flags to opcode_modifiers.
	Use VexW0 and VexVVVV in the AVX-VNNI instructions.
	* i386-gen.c: Likewise.
	* i386-opc.h: Likewise.
	* i386-opc.h: Likewise.
	* i386-init.h: Regenerated.
	* i386-tbl.h: Likewise.
2020-10-16 11:37:09 +08:00
H.J. Lu
58bf9b6a7f x86: Support Intel AVX VNNI
Intel AVX VNNI instructions are marked with CpuVEX_PREFIX.  Without the
pseudo {vex} prefix, mnemonics of Intel VNNI instructions are encoded
with the EVEX prefix.  The pseudo {vex} prefix can be used to encode
mnemonics of Intel VNNI instructions with the VEX prefix.

gas/

	* NEWS: Add Intel AVX VNNI.
	* config/tc-i386.c (cpu_arch): Add .avx_vnni and noavx_vnni.
	(cpu_flags_match): Support CpuVEX_PREFIX.
	* doc/c-i386.texi: Document .avx_vnni, noavx_vnni and how to
	encode Intel VNNI instructions with VEX prefix.
	* testsuite/gas/i386/avx-vnni.d: New file.
	* testsuite/gas/i386/avx-vnni.s: Likewise.
	* testsuite/gas/i386/x86-64-avx-vnni.d: Likewise.
	* testsuite/gas/i386/x86-64-avx-vnni.s: Likewise.
	* testsuite/gas/i386/i386.exp: Run AVX VNNI tests.

opcodes/

	* i386-dis.c (PREFIX_VEX_0F3850): New.
	(PREFIX_VEX_0F3851): Likewise.
	(PREFIX_VEX_0F3852): Likewise.
	(PREFIX_VEX_0F3853): Likewise.
	(VEX_W_0F3850_P_2): Likewise.
	(VEX_W_0F3851_P_2): Likewise.
	(VEX_W_0F3852_P_2): Likewise.
	(VEX_W_0F3853_P_2): Likewise.
	(prefix_table): Add PREFIX_VEX_0F3850, PREFIX_VEX_0F3851,
	PREFIX_VEX_0F3852 and PREFIX_VEX_0F3853.
	(vex_table): Add VEX_W_0F3850_P_2, VEX_W_0F3851_P_2,
	VEX_W_0F3852_P_2 and VEX_W_0F3853_P_2.
	(putop): Add support for "XV" to print "{vex3}" pseudo prefix.
	* i386-gen.c (cpu_flag_init): Clear the CpuAVX_VNNI bit in
	CPU_UNKNOWN_FLAGS.  Add CPU_AVX_VNNI_FLAGS and
	CPU_ANY_AVX_VNNI_FLAGS.
	(cpu_flags): Add CpuAVX_VNNI and CpuVEX_PREFIX.
	* i386-opc.h (CpuAVX_VNNI): New.
	(CpuVEX_PREFIX): Likewise.
	(i386_cpu_flags): Add cpuavx_vnni and cpuvex_prefix.
	* i386-opc.tbl: Add Intel AVX VNNI instructions.
	* i386-init.h: Regenerated.
	* i386-tbl.h: Likewise.
2020-10-14 05:02:31 -07:00
Lili Cui
c1fa250ae1 x86: Add support for Intel HRESET instruction
gas/

	* NEWS: Add Intel HRESET.
	* config/tc-i386.c (cpu_arch): Add .hreset.
	(cpu_noarch): Likewise.
	* doc/c-i386.texi: Document .hreset, nohreset.
	* testsuite/gas/i386/i386.exp: Run HRESET tests.
	* testsuite/gas/i386/hreset.d: New file.
	* testsuite/gas/i386/x86-64-hreset.d: Likewise.
	* testsuite/gas/i386/hreset.s: Likewise.

opcodes/

	* i386-dis.c (PREFIX_0F3A0F): New.
	(MOD_0F3A0F_PREFIX_1): Likewise.
	(REG_0F3A0F_PREFIX_1_MOD_3): Likewise.
	(RM_0F3A0F_P_1_MOD_3_REG_0): Likewise.
	(prefix_table): Add PREFIX_0F3A0F.
	(mod_table): Add MOD_0F3A0F_PREFIX_1.
	(reg_table): Add REG_0F3A0F_PREFIX_1_MOD_3.
	(rm_table): Add RM_0F3A0F_P_1_MOD_3_REG_0.
	* i386-gen.c (cpu_flag_init): Add HRESET_FLAGS,
	CPU_ANY_HRESET_FLAGS.
	(cpu_flags): Add CpuHRESET.
	(output_i386_opcode): Allow 4 byte base_opcode.
	* i386-opc.h (enum): Add CpuHRESET.
	(i386_cpu_flags): Add cpuhreset.
	* i386-opc.tbl: Add Intel HRESET instruction.
	* i386-init.h: Regenerate.
	* i386-tbl.h: Likewise.
2020-10-14 04:53:59 -07:00
Lili Cui
f64c42a9fb x86: Support Intel UINTR
gas/

	* NEWS: Add Intel UINTR.
	* config/tc-i386.c (cpu_arch): Add .uintr.
	(cpu_noarch): Likewise.
	* doc/c-i386.texi: Document .uintr and nouintr.
	* testsuite/gas/i386/i386.exp: Run UINTR tests.
	* testsuite/gas/i386/x86-64-uintr.d: Likewise.
	* testsuite/gas/i386/x86-64-uintr.s: Likewise.

opcodes/

	* i386-dis.c (enum): Add
	PREFIX_MOD_3_0F01_REG_5_RM_4,
	PREFIX_MOD_3_0F01_REG_5_RM_5,
	PREFIX_MOD_3_0F01_REG_5_RM_6,
	PREFIX_MOD_3_0F01_REG_5_RM_7,
	X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1,
	X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1,
	X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1,
	X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1,
	X86_64_0FC7_REG_6_MOD_3_PREFIX_1.
	(prefix_table): New instructions (see prefixes above).
	(rm_table): Likewise
	* i386-gen.c (cpu_flag_init): Add CPU_UINTR_FLAGS,
	CPU_ANY_UINTR_FLAGS.
	(cpu_flags): Add CpuUINTR.
	* i386-opc.h (enum): Add CpuUINTR.
	(i386_cpu_flags): Add cpuuintr.
	* i386-opc.tbl: Add UINTR insns.
	* i386-init.h: Regenerate.
	* i386-tbl.h: Likewise.
2020-10-14 04:31:54 -07:00
H.J. Lu
8b65b8953a x86: Remove the prefix byte from non-VEX/EVEX base_opcode
Replace the prefix byte in non-VEX/EVEX base_opcode with PREFIX_0X66,
PREFIX_0XF2 or PREFIX_0XF3.

gas/

	* config/tc-i386.c (load_insn_p): Check opcodeprefix == 0 for
	base_opcode == 0xfc7.
	(match_template): Likewise.
	(process_suffix): Check opcodeprefix == PREFIX_0XF2 for CRC32.
	(check_byte_reg): Likewise.
	(output_insn): Don't add the 0xf3 prefix twice for PadLock
	instructions.  Don't add prefix from non-VEX/EVEX base_opcode.

opcodes/

	* i386-gen.c (process_i386_opcode_modifier): Return 1 for
	non-VEX/EVEX/prefix encoding.
	(output_i386_opcode): Fail if non-VEX/EVEX/prefix base_opcode
	has a prefix byte.
	* i386-opc.tbl: Replace the prefix byte in non-VEX/EVEX
	base_opcode with PREFIX_0X66, PREFIX_0XF2 or PREFIX_0XF3.
	* i386-tbl.h: Regenerated.
2020-10-14 04:20:55 -07:00
H.J. Lu
7b47a31256 x86: Rename VexOpcode to OpcodePrefix
Rename VexOpcode to OpcodePrefix so that OpcodePrefix can be used for
regular encoding prefix.

gas/

	* config/tc-i386.c (build_vex_prefix): Replace vexopcode with
	opcodeprefix.
	(build_evex_prefix): Likewise.
	(is_any_vex_encoding): Don't check vexopcode.
	(output_insn): Handle opcodeprefix.

opcodes/

	* i386-gen.c (opcode_modifiers): Replace VexOpcode with
	OpcodePrefix.
	* i386-opc.h (VexOpcode): Renamed to ...
	(OpcodePrefix): This.
	(PREFIX_NONE): New.
	(PREFIX_0X66): Likewise.
	(PREFIX_0XF2): Likewise.
	(PREFIX_0XF3): Likewise.
	* i386-opc.tbl (Prefix_0X66): New.
	(Prefix_0XF2): Likewise.
	(Prefix_0XF3): Likewise.
	Replace VexOpcode= with OpcodePrefix=.  Use Prefix_0X66 on xorpd.
	Use Prefix_0XF3 on cvtdq2pd.  Use Prefix_0XF2 on cvtpd2dq.
	* i386-tbl.h: Regenerated.
2020-10-13 19:29:09 -07:00
H.J. Lu
32930e4edb x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker
GCC 11 supports -march=x86-64-v[234] to enable x86 micro-architecture ISA
levels:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97250

Update GNU_PROPERTY_X86_ISA_1_XXX macros:

https://gitlab.com/x86-psABIs/x86-64-ABI/-/merge_requests/13

in x86 ELF binaries to indicate that micro-architecture ISA levels
required to execute the binary:

 #define GNU_PROPERTY_X86_ISA_1_NEEDED (GNU_PROPERTY_X86_UINT32_OR_LO + 2)
 #define GNU_PROPERTY_X86_ISA_1_USED (GNU_PROPERTY_X86_UINT32_OR_AND_LO + 2)
 #define GNU_PROPERTY_X86_ISA_1_V2 (1U << 0)
 #define GNU_PROPERTY_X86_ISA_1_V3 (1U << 1)
 #define GNU_PROPERTY_X86_ISA_1_V4 (1U << 2)

The previous GNU_PROPERTY_X86_ISA_1_XXX  macros are deprecated and renamed
to GNU_PROPERTY_X86_COMPAT_2_ISA_1_XXX.

In addition to EM_X86_64, GNU_PROPERTY_X86_ISA_1_V[234] marker can be used
by ld.so to detect the x86-64-v4 shared library placed in an x86-64-v2
directory by mistake on an x86-64-v2 machine to avoid crashes on x86-64-v4
instructions.

Add -z x86-64-v[234] linker command line option to mark x86-64-v[234]
ISA level as needed.

Also add

 #define GNU_PROPERTY_X86_FEATURE_2_MASK (1U << 11)

for mask registers.

bfd/

	PR gas/26703
	* elf-linker-x86.h (elf_linker_x86_params): Add isa_level.
	* elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Merge
	GNU_PROPERTY_X86_ISA_1_V[234].
	(_bfd_x86_elf_link_setup_gnu_properties): Generate
	GNU_PROPERTY_X86_ISA_1_V[234] for -z x86-64-v[234].

binutils/

	PR gas/26703
	* readelf.c (decode_x86_compat_2_isa): New function.
	(decode_x86_isa): Updated for new X86_ISA_1_XXX bits.
	(decode_x86_feature_1): Handle GNU_PROPERTY_X86_FEATURE_2_MASK.
	(print_gnu_property_note): Handle X86_COMPAT_2_ISA_1_USED,
	and X86_COMPAT_2_ISA_1_NEEDED.
	* testsuite/binutils-all/i386/pr21231b.s: Updated to the current
	GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
	values.
	* testsuite/binutils-all/x86-64/pr21231b.s: Likewise.
	* testsuite/binutils-all/x86-64/pr23494a.s: Likewise.
	* testsuite/binutils-all/x86-64/pr23494b.s: Likewise.
	* testsuite/binutils-all/x86-64/pr23494c.s: Likewise.
	* testsuite/binutils-all/i386/empty.d: Updated.
	* testsuite/binutils-all/i386/ibt.d: Likewise.
	* testsuite/binutils-all/i386/pr21231a.d: Likewise.
	* testsuite/binutils-all/i386/pr21231b.d: Likewise.
	* testsuite/binutils-all/i386/shstk.d: Likewise.
	* testsuite/binutils-all/x86-64/empty-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/empty.d: Likewise.
	* testsuite/binutils-all/x86-64/ibt-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/ibt.d: Likewise.
	* testsuite/binutils-all/x86-64/pr21231a.d: Likewise.
	* testsuite/binutils-all/x86-64/pr21231b.d: Likewise.
	* testsuite/binutils-all/x86-64/pr23494a-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/pr23494a.d: Likewise.
	* testsuite/binutils-all/x86-64/pr23494c-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/pr23494c.d: Likewise.
	* testsuite/binutils-all/x86-64/pr23494d-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/pr23494d.d: Likewise.
	* testsuite/binutils-all/x86-64/pr23494e-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/pr23494e.d: Likewise.
	* testsuite/binutils-all/x86-64/shstk-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/shstk.d: Likewise.

gas/

	PR gas/26703
	* config/tc-i386.c (xstate): Add xstate_mask.
	(md_assemble): Check i.types[j], instead of i.tm.operand_types[j],
	for xstate.  Set xstate_mask, instead of xstate_zmm, for RegMask.
	(output_insn): Update for GNU_PROPERTY_X86_ISA_1_V[234].  Update
	xstate for mask register and VSIB.
	* testsuite/gas/i386/i386.exp: Run more GNU_PROPERTY tests.
	* testsuite/gas/i386/property-1.s: Updated to the current
	GNU_PROPERTY_X86_ISA_1_USED value.
	* testsuite/gas/i386/property-2.s: Only keep cmove.
	* testsuite/gas/i386/property-3.s: Changed to addsubpd.
	* testsuite/gas/i386/property-1.d: Updated.
	* testsuite/gas/i386/property-2.d: Likewise.
	* testsuite/gas/i386/property-3.d: Likewise.
	* testsuite/gas/i386/property-4.d: Likewise.
	* testsuite/gas/i386/property-5.d: Likewise.
	* testsuite/gas/i386/property-6.d: Likewise.
	* testsuite/gas/i386/x86-64-property-1.d: Likewise.
	* testsuite/gas/i386/x86-64-property-2.d: Likewise.
	* testsuite/gas/i386/x86-64-property-3.d: Likewise.
	* testsuite/gas/i386/x86-64-property-4.d: Likewise.
	* testsuite/gas/i386/x86-64-property-5.d: Likewise.
	* testsuite/gas/i386/x86-64-property-6.d: Likewise.
	* testsuite/gas/i386/x86-64-property-7.d: Likewise.
	* testsuite/gas/i386/x86-64-property-8.d: Likewise.
	* testsuite/gas/i386/x86-64-property-9.d: Likewise.
	* testsuite/gas/i386/property-11.d: New file.
	* testsuite/gas/i386/property-11.s: Likewise.
	* testsuite/gas/i386/property-12.d: Likewise.
	* testsuite/gas/i386/property-12.s: Likewise.
	* testsuite/gas/i386/property-13.d: Likewise.
	* testsuite/gas/i386/property-13.s: Likewise.
	* testsuite/gas/i386/x86-64-property-11.d: Likewise.
	* testsuite/gas/i386/x86-64-property-12.d: Likewise.
	* testsuite/gas/i386/x86-64-property-13.d: Likewise.
	* testsuite/gas/i386/x86-64-property-14.d: Likewise.
	* testsuite/gas/i386/x86-64-property-14.s: Likewise.

include/

	PR gas/26703
	* elf/common.h (GNU_PROPERTY_X86_ISA_1_USED): Renamed to ...
	(GNU_PROPERTY_X86_COMPAT_2_ISA_1_USED): This.
	(GNU_PROPERTY_X86_ISA_1_NEEDED): Renamed to ...
	(GNU_PROPERTY_X86_COMPAT_2_ISA_1_NEEDED): This.
	(GNU_PROPERTY_X86_ISA_1_XXX): Renamed to ...
	(GNU_PROPERTY_X86_COMPAT_2_ISA_1_XXX): This.
	(GNU_PROPERTY_X86_ISA_1_NEEDED): New.
	(GNU_PROPERTY_X86_ISA_1_USED): Likewise.
	(GNU_PROPERTY_X86_ISA_1_V2): Likewise.
	(GNU_PROPERTY_X86_ISA_1_V3): Likewise.
	(GNU_PROPERTY_X86_ISA_1_V4): Likewise.
	(GNU_PROPERTY_X86_FEATURE_2_MASK): Likewise.

ld/

	PR gas/26703
	* NEWS: Mention -z x86-64-v[234].
	* ld.texi: Document -z x86-64-v[234].
	* emulparams/elf32_x86_64.sh: Use x86-64-level.sh.
	* emulparams/elf_i386.sh: Likewise.
	* emulparams/elf_x86_64.sh: Likewise.
	* emulparams/x86-64-level.sh: New file.
	* testsuite/ld-elf/x86-feature-1a.rd: Update.
	* testsuite/ld-elf/x86-feature-1b.rd: Likewise.
	* testsuite/ld-elf/x86-feature-1c.rd: Likewise.
	* testsuite/ld-elf/x86-feature-1d.rd: Likewise.
	* testsuite/ld-elf/x86-feature-1e.rd: Likewise.
	* testsuite/ld-i386/pr23372c.d: Likewise.
	* testsuite/ld-i386/pr23486c.d: Likewise.
	* testsuite/ld-i386/pr23486d.d: Likewise.
	* testsuite/ld-i386/pr24322a.d: Likewise.
	* testsuite/ld-i386/pr24322b.d: Likewise.
	* testsuite/ld-i386/property-1a.r: Likewise.
	* testsuite/ld-i386/property-2a.r: Likewise.
	* testsuite/ld-i386/property-3.r: Likewise.
	* testsuite/ld-i386/property-3a.r: Likewise.
	* testsuite/ld-i386/property-4.r: Likewise.
	* testsuite/ld-i386/property-4a.r: Likewise.
	* testsuite/ld-i386/property-5.r: Likewise.
	* testsuite/ld-i386/property-5a.r: Likewise.
	* testsuite/ld-i386/property-7a.r: Likewise.
	* testsuite/ld-i386/property-x86-3.d: Likewise.
	* testsuite/ld-i386/property-x86-4a.d: Likewise.
	* testsuite/ld-i386/property-x86-5.d: Likewise.
	* testsuite/ld-i386/property-x86-cet1.d: Likewise.
	* testsuite/ld-i386/property-x86-cet2a.d: Likewise.
	* testsuite/ld-i386/property-x86-cet5a.d: Likewise.
	* testsuite/ld-i386/property-x86-cet5b.d: Likewise.
	* testsuite/ld-i386/property-x86-ibt1a.d: Likewise.
	* testsuite/ld-i386/property-x86-ibt1b.d: Likewise.
	* testsuite/ld-i386/property-x86-ibt2.d: Likewise.
	* testsuite/ld-i386/property-x86-ibt3a.d: Likewise.
	* testsuite/ld-i386/property-x86-ibt3b.d: Likewise.
	* testsuite/ld-i386/property-x86-ibt4.d: Likewise.
	* testsuite/ld-i386/property-x86-ibt5.d: Likewise.
	* testsuite/ld-i386/property-x86-shstk1a.d: Likewise.
	* testsuite/ld-i386/property-x86-shstk1b.d: Likewise.
	* testsuite/ld-i386/property-x86-shstk2.d: Likewise.
	* testsuite/ld-i386/property-x86-shstk3a.d: Likewise.
	* testsuite/ld-i386/property-x86-shstk3b.d: Likewise.
	* testsuite/ld-i386/property-x86-shstk4.d: Likewise.
	* testsuite/ld-i386/property-x86-shstk5.d: Likewise.
	* testsuite/ld-x86-64/pr23372c-x32.d: Likewise.
	* testsuite/ld-x86-64/pr23372c.d: Likewise.
	* testsuite/ld-x86-64/pr23486c.d: Likewise.
	* testsuite/ld-x86-64/pr23486d-x32.d: Likewise.
	* testsuite/ld-x86-64/pr23486d.d: Likewise.
	* testsuite/ld-x86-64/pr24322a-x32.d: Likewise.
	* testsuite/ld-x86-64/pr24322a.d: Likewise.
	* testsuite/ld-x86-64/pr24322b-x32.d: Likewise.
	* testsuite/ld-x86-64/pr24322b.d: Likewise.
	* testsuite/ld-x86-64/pr24458a-x32.d: Likewise.
	* testsuite/ld-x86-64/pr24458a.d: Likewise.
	* testsuite/ld-x86-64/pr24458b-x32.d: Likewise.
	* testsuite/ld-x86-64/pr24458b.d: Likewise.
	* testsuite/ld-x86-64/pr24458c-x32.d: Likewise.
	* testsuite/ld-x86-64/pr24458c.d: Likewise.
	* testsuite/ld-x86-64/property-1a.r: Likewise.
	* testsuite/ld-x86-64/property-2a.r: Likewise.
	* testsuite/ld-x86-64/property-3.r: Likewise.
	* testsuite/ld-x86-64/property-3a.r: Likewise.
	* testsuite/ld-x86-64/property-4.r: Likewise.
	* testsuite/ld-x86-64/property-4a.r: Likewise.
	* testsuite/ld-x86-64/property-5.r: Likewise.
	* testsuite/ld-x86-64/property-5a.r: Likewise.
	* testsuite/ld-x86-64/property-7a.r: Likewise.
	* testsuite/ld-x86-64/property-x86-3-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-3.d: Likewise.
	* testsuite/ld-x86-64/property-x86-4a-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-4a.d: Likewise.
	* testsuite/ld-x86-64/property-x86-5-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-5.d: Likewise.
	* testsuite/ld-x86-64/property-x86-cet1-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-cet1.d: Likewise.
	* testsuite/ld-x86-64/property-x86-cet2a-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-cet2a.d: Likewise.
	* testsuite/ld-x86-64/property-x86-cet5a-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-cet5a.d: Likewise.
	* testsuite/ld-x86-64/property-x86-cet5b-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-cet5b.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt1a-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt1a.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt1b-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt1b.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt2-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt2.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt3a-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt3a.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt3b-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt3b.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt4-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt4.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt5-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt5.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk1a-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk1a.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk1b-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk1b.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk2-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk2.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk3a-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk3a.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk3b-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk3b.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk4-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk4.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk5-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk5.d: Likewise.
	* testsuite/ld-i386/i386.exp: Run property-x86-6,
	property-x86-isa1, property-x86-isa2 and property-x86-isa3.
	* testsuite/ld-i386/property-x86-1.S: Updated to the current
	GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
	values.
	* testsuite/ld-i386/property-x86-2.S: Likewise.
	* testsuite/ld-i386/property-x86-3.s: Likewise.
	* testsuite/ld-x86-64/pr23372d.s: Likewise.
	* testsuite/ld-x86-64/pr23372e.s: Likewise.
	* testsuite/ld-x86-64/pr23372f.s: Likewise.
	* testsuite/ld-x86-64/pr23486c.s: Likewise.
	* testsuite/ld-x86-64/pr23486d.s: Likewise.
	* testsuite/ld-x86-64/property-x86-1.S: Likewise.
	* testsuite/ld-x86-64/property-x86-2.S: Likewise.
	* testsuite/ld-x86-64/property-x86-3.s: Likewise.
	* testsuite/ld-x86-64/property-x86-5a.s: Likewise.
	* testsuite/ld-x86-64/property-x86-5b.s: Likewise.
	* testsuite/ld-i386/property-x86-6.d: New file.
	* testsuite/ld-i386/property-x86-isa1.d: Likewise.
	* testsuite/ld-i386/property-x86-isa2.d: Likewise.
	* testsuite/ld-i386/property-x86-isa3.d: Likewise.
	* testsuite/ld-x86-64/property-x86-6-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-6.d: Likewise.
	* testsuite/ld-x86-64/property-x86-6.s: Likewise.
	* testsuite/ld-x86-64/property-x86-isa1-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-isa1.d: Likewise.
	* testsuite/ld-x86-64/property-x86-isa1.s: Likewise.
	* testsuite/ld-x86-64/property-x86-isa2-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-isa2.d: Likewise.
	* testsuite/ld-x86-64/property-x86-isa3-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-isa3.d: Likewise.
	* testsuite/ld-x86-64/simple.s: Likewise.
	* ld/testsuite/ld-x86-64/x86-64.exp: Run property-x86-6,
	property-x86-6-x32, property-x86-isa1, property-x86-isa1-x32,
	property-x86-isa2, property-x86-isa2-x32, property-x86-isa3-x32
	and property-x86-isa3.
2020-10-09 05:13:26 -07:00
Alex Coplan
05cfb0d8cc aarch64: Fix bogus type punning in parse_barrier() [PR26699]
This patch fixes a bogus use of type punning in parse_barrier() which
was causing an assembly failure on big endian LP64 hosts when attempting
to assemble "isb sy" for AArch64.

The type of the entries in aarch64_barrier_opt_hsh is
aarch64_name_value_pair. We were incorrectly casting this to the
locally-defined asm_barrier_opt which has a wider type (on LP64) for the
second member. This happened to work on little-endian hosts but fails on
LP64 big endian.

The fix is to use the correct type in parse_barrier(). This makes the
locally-defined asm_barrier_opt redundant, so remove it.

gas/ChangeLog:

	* config/tc-aarch64.c (asm_barrier_opt): Delete.
	(parse_barrier): Fix bogus type punning.
	* testsuite/gas/aarch64/system.d: Update disassembly.
	* testsuite/gas/aarch64/system.s: Add isb sy test.
2020-10-06 15:56:44 +01:00
Sergey Belyashav
0ae9445d52 A small set of code improvements for the Z80 assembler.
PR 26692
	* config/tc-z80.c (md_begin): Ensure that xpressions are empty
	before using them.
	(unify_indexed): Likewise.
	(z80_start_line_hook): Improve hash sign handling when SDCC
	compatibility mode enabled.
	(md_parse_exp_not_indexed): Improve indirect addressing
	detection.
	(md_pseudo_table): Accept hd64 as an alias of z810.
2020-10-06 11:58:57 +01:00