Commit Graph

97507 Commits

Author SHA1 Message Date
Alan Modra a2699ef206 Revert "ARM STM32L4XX erratum test failure"
This reverts commit 3a1bb98c3c.
2019-05-16 22:37:25 +09:30
GDB Administrator 4d8d49e80a Automatic date update in version.in 2019-05-16 00:00:20 +00:00
Andrew Burgess 14237686d7 gdb/fortran: Add sizeof tests for indexed and sliced arrays
Add tests for calling sizeof on indexed and sliced arrays, and on
pointers to arrays.  These are all things that currently work, but
were previously untested.

gdb/testsuite/ChangeLog:

	* gdb.fortran/vla-sizeof.exp: Add tests of sizeof applied to
	indexed and sliced arrays, and pointers to arrays.
2019-05-15 22:26:33 +01:00
Simon Marchi 9ddc1af18c linux-thread-db.c: use bool where possible in thread_db code
I happened to be looking at this code and noticed we could replace ints
by bools at a few places.

gdb/ChangeLog:

	* linux-thread-db.c (try_thread_db_load_1): Change return type
	to bool.
	(try_thread_db_load): Likewise.
	(try_thread_db_load_from_pdir_1): Likewise.
	(try_thread_db_load_from_pdir): Likewise.
	(try_thread_db_load_from_sdir): Likewise.
	(try_thread_db_load_from_dir): Likewise.
	(thread_db_load_search): Likewise.
	(has_libpthread): Likewise.
	(thread_db_load): Likewise.
2019-05-15 11:20:52 -04:00
John Darrington 95008a8828 S12Z: New option -mreg-prefix
Add a new machine dependent option to set a prefix for register names.

gas/

* config/tc-s12z.c (register_prefix): New variable.  (md_show_usage,
  md_parse_option):  parse the new option.
  (lex_reg_name): Scan the prefix if one is set.
* doc/c-s12z.texi (S12Z-Opts): Document the new option.
* testsuite/gas/s12z/reg-prefix.d: New file.
* testsuite/gas/s12z/reg-prefix.s: New file.
* testsuite/gas/s12z/s12z.exp: Add them.
2019-05-15 16:25:18 +02:00
Sergio Durigan Junior 7bede82892 Don't crash if dwarf_decode_macro_bytes's 'body' is NULL
Hi,

Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1708192
      https://bugzilla.redhat.com/show_bug.cgi?id=1708786

During the Fedora RPM build process, gdb-add-index is invoked to
extract the DWARF index from the binary, and GDB will segfault because
dwarf2read.c:parse_definition_macro's 'body' variable is NULL.

The underlying problem is that Fedora's rpm-build's "debugedit"
program will silently corrupt .debug_macro strings when a binary is
compiled with -g3.  This is being taken care of by Mark Wielaard,
here:

  https://bugzilla.redhat.com/show_bug.cgi?id=1708786

However, I still feel it's important to make GDB more resilient
against invalid DWARF input, so I'm proposing this rather simple patch
to catch the situation when "body == NULL" (i.e., it's probably been
corrupted) and issue a complaint.  This is not a real fix to the
problem, of course, but at least GDB is able to finish without
segfaulting.

OK for master?

gdb/ChangeLog:
2019-05-15  Sergio Durigan Junior  <sergiodj@redhat.com>

	Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1708192
	* dwarf2read.c (dwarf_decode_macro_bytes): Check whether 'body' is
	NULL, and complain if that's the case.
2019-05-15 09:57:45 -04:00
John Darrington 905f5b3f1d GAS (doc): Fix misaligned menu entry.
gas/
	* doc/as.texi (Machine Dependencies): Fix misaligned menu entry.
2019-05-15 14:30:19 +02:00
Alan Modra f6bd0b7677 C-SKY FAIL: jbt - csky
Another failure seen with MALLOC_PERTURB_=1.

	* config/tc-csky.c (md_convert_frag): Initialise trailing
	padding for COND_JUMP_PIC.
2019-05-15 16:41:22 +09:30
Alan Modra 3a1bb98c3c ARM STM32L4XX erratum test failure
Fixes a failure seen with MALLOC_PERTURB_=1.

	* elf32-arm.c (elf32_arm_write_section): Don't leave
	error case of STM32L4XX_ERRATUM_BRANCH_TO_VENEER with
	unitialised section contents.
2019-05-15 16:36:00 +09:30
Alan Modra 8f02ae5bac .file file number checking
This adds another test for file numbers given in .file directives,
checking that the value can be represented as an unsigned int and that
a memory allocation expression doesn't overflow.  I removed a test
added recently since an earlier test (num < 1) already covers the
(num < 0) case.

	* dwarf2dbg.c: Whitespace fixes.
	(get_filenum): Don't strdup "file".  Adjust error message.
	(dwarf2_directive_filename): Use an unsigned type for "num".
	Catch truncation of file number and overflow of get_filenum
	XRESIZEVEC multiplication.  Delete dead code.
2019-05-15 16:28:14 +09:30
Alan Modra ded12894f5 tic54x_start_line_hook
git commit 3076e59490 caused
tic54x-coff  +FAIL: c54x subsym assignment/use

	PR 24538
	* config/tc-tic54x.c (tic54x_start_line_hook): Do skip end of line
	chars in setting endp.
2019-05-15 16:28:14 +09:30
John Darrington c5358db468 GDB (s12z): Improve reliability of the stack unwinder.
Previously, the stack unwinder searched through consecutive bytes for values
which it thought might be the start of a stack mutating operation.
This was error prone, because such bytes could also be the operands of other
instructions.  This change uses the opcodes api to interpret the code in each
frame.

gdb/ChangeLog:
	* s12z-tdep.c (push_pull_get_stack_adjustment): New function.
	(advance, posn, abstract_read_memory): New functions.
	[struct mem_read_abstraction]: New struct.
	(s12z_frame_cache): Use opcodes API to interpret stack frame code.
2019-05-15 06:50:40 +02:00
GDB Administrator e48371ffd5 Automatic date update in version.in 2019-05-15 00:00:15 +00:00
Tom Tromey c408a94f81 Fix assertion failure in coerce_unspec_val_to_type
coerce_unspec_val_to_type does:

      set_value_address (result, value_address (val));

However, this is only valid for lval_memory.  This patch changes this
code to only set the address for lval_memory values.

This seems like an ordinary oversight in coerce_unspec_val_to_type,
and a test case would be difficult to write, so I'm submitting it
without a test case.

Tested on x86-64 Fedora 29; plus using an Ada program that exhibits
the bug (but which cannot be shared).

gdb/ChangeLog
2019-05-14  Tom Tromey  <tromey@adacore.com>

	* ada-lang.c (coerce_unspec_val_to_type): Only set address when
	value is not lval_memory.
2019-05-14 16:07:28 -06:00
Tom de Vries a0a3a1e9d7 [gdb/doc] Mention index cache in concept and command index
The "automatic symbol index cache" entry in the docs is missing entries in the
concept and command indices.  Add them.

gdb/doc/ChangeLog:

2019-05-14  Tom de Vries  <tdevries@suse.de>

	* gdb.texinfo (Automatic symbol index cache): Add concept and command
	index entries.
2019-05-14 17:45:51 +02:00
Nick Clifton c2509a1cc8 Add missing verilogtest.s file. 2019-05-14 16:16:56 +01:00
Tom Tromey e7bd7fba34 Add file name styling to "info sharedlibrary"
This changes "info sharedlibrary" to add styling to the file name.

Tested on x86-64 Fedora 29.

gdb/ChangeLog
2019-05-14  Tom Tromey  <tromey@adacore.com>

	* solib.c (info_sharedlibrary_command): Style the file name.

gdb/testsuite/ChangeLog
2019-05-14  Tom Tromey  <tromey@adacore.com>

	* gdb.base/info-shared.exp (check_info_shared): Add "info shared"
	styling test.
2019-05-14 07:43:38 -06:00
Nick Clifton 35015cd193 Fix illegal memory access triggered when attempting to assemble a bogus i386 source file.
PR 24538
	* config/tc-i386-intel.c (i386_intel_simplify_register): Reject
	illegal register numbers.
2019-05-14 12:42:02 +01:00
Jamey Hicks 37d0d09177 Add new option to objcopy: --verilog-data-width. Use this option to set the size of byte bundles generated in verilog format files.
PR 19921
binutils* objcopy.c: Add new option --verilog-data-width.  Use it to set
	the value of VerilogDataWidth.
	* doc/binutils.texi: Document the new option.
	* testsuite/binutils-all/objcopy.exp: Run tests of new option.
	* testsuite/binutils-all/verilog-1.hex: New file.
	* testsuite/binutils-all/verilog-2.hex: New file.
	* testsuite/binutils-all/verilog-4.hex: New file.
	* testsuite/binutils-all/verilog-8.hex: New file.
	* NEWS: Mention the new feature.

bfd	* verilog.c: (VerilogDataWidth): New variable.
	(verilog_write_record): Emit bytes in VerilogDataWidth bundles.
2019-05-14 10:42:25 +01:00
Nick Clifton 3076e59490 A series of fixes to addres problems detected by compiling the assembler with address sanitization enabled.
PR 24538
gas	* macro.c (get_any_string): Increase size of buffer used to hold
	decimal value of expression result.
	* dw2gencfi.c (get_debugseg_name): Handle an empty name.
	* dwarf2dbg.c (get_filenum): Catch integer wraparound when
	extending allocate file array.
	(dwarf2_directive_filename): Add extra checks of the computed file
	number.
	* config/tc-arm.c (arm_tc_equal_in_insn): Insert copy of name into
	warning hash table.
	(s_arm_eabi_attribute): Check for obj_elf_vendor_attribute
	returning -1.
	* config/tc-i386.c (i386_output_nops): Catch an attempt to
	generate nops of negative lengths.
	* as.h (MAX_LITTLENUMS): Move definition to here from...
	* config/atof-ieee.c: ...here.
	* config/tc-aarch64.c: ...here.
	* config/tc-arc.c: ...here.
	* config/tc-arm.c: ...here.
	* config/tc-epiphany.c: ...here.
	* config/tc-i386.c: ...here.
	* config/tc-ia64.c: ...here.  (And correct the value).
	* config/tc-m32c.c: ...here.
	* config/tc-m32r.c: ...here.
	* config/tc-metag.c: ...here.
	* config/tc-microblaze.c: ...here.
	* config/tc-nds32.c: ...here.
	* config/tc-or1k.c: ...here.
	* config/tc-score.c: ...here.
	* config/tc-score7.c: ...here.
	* config/tc-tic4x.c: ...here.
	* config/tc-tilegx.c: ...here.
	* config/tc-tilepro.c: ...here.
	* config/tc-visium.c: ...here.
	* config/tc-sh.c (md_assemble): Add check for an instruction with
	no opcodes.
	* config/tc-mips.c (mips_lookup_insn): Add check for very short
	instruction name.
	* config/tc-tic54x.c: Use unsigned chars to access is_end_of_line
	array.
	(tic54x_start_line_hook): Check for an empty line.
	(next_line_shows_parallel): Do not walk off the end of the string.
	(tic54x_macro_start): Check for too much macro nesting.
	(tic54x_start_label): Add label_start parameter.  Use this
	parameter to check the first character of the label.
	* config/tc-tic54x.h (TC_START_LABEL_WITHOUT_COLON): Pass
	line_start variable to tic54x_start_label.

	PR 24538
opcodes	* ia64-opc.c (ia64_find_matching_opcode): Check for reaching the
	end of the table prematurely.
2019-05-14 10:42:25 +01:00
Alan Hayward a6d0f2490c AArch64: Add half float view to V registers
AArch64 can fill the vector registers with half precision floats.
Add a view for this.

Add builtin type ieee half and connect this to the existing
floatformats_ieee_half.

gdb/ChangeLog:

2019-05-14  Alan Hayward  <alan.hayward@arm.com>

	* aarch64-tdep.c (aarch64_vnh_type): Add half view.
	(aarch64_vnv_type): Likewise.
	* target-descriptions.c (make_gdb_type): Add TDESC_TYPE_IEEE_HALF.
	* common/tdesc.c: Likewise.
	* common/tdesc.h (enum tdesc_type_kind): Likewise.
	* features/aarch64-fpu.c (create_feature_aarch64_fpu): Regenerate.
	* features/aarch64-fpu.xml: Add ieee half view.
	* features/aarch64-sve.c (create_feature_aarch64_fpu): Likewise.
	* gdbtypes.c (gdbtypes_post_init): Add builtin_half
	* gdbtypes.h (struct builtin_type): Likewise.
	(struct objfile_type): Likewise.
2019-05-14 10:10:56 +01:00
Tom de Vries 2764128dee [gdb/testsuite] Fix base address selection entry encoding in dw2-skip-prologue.S
A base address selection entry in a location list consist of two (constant or
relocated) address offsets.  The two offsets are the same size as an address
on the target machine.

The test-case gdb.dwarf2/dw2-skip-prologue.S encodes a base address selection
entry using .4byte, which is incorrect for 8-byte pointer size. [ Which
triggers an assert in dwz, see PR dwz/24172. ]

Fix this by using PTRBYTE instead.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-05-14  Tom de Vries  <tdevries@suse.de>

	* gdb.dwarf2/dw2-skip-prologue.S (.debug_loc): Fix base address
	selection entry encoding.
2019-05-14 10:10:08 +02:00
Tom de Vries 3c2fcaf913 [gdb/doc] Fix "maint info selftests" command index entry
Currently, the entry for the command "maint info selftests" in the Command,
Variable, and Function Index is listed at '"', rather than next to the other
"maint info" commands.

Fix this by removing the superfluous quoting in the @kindex entry.

gdb/doc/ChangeLog:

2019-05-14  Tom de Vries  <tdevries@suse.de>

	* gdb.texinfo (Maintenance Commands): Remove superfluous
	quoting on command index entry for "maint info selftests".
2019-05-14 09:58:12 +02:00
GDB Administrator 175cbe22a3 Automatic date update in version.in 2019-05-14 00:00:20 +00:00
GDB Administrator 30d5f9e821 Automatic date update in version.in 2019-05-13 00:00:23 +00:00
Simon Marchi 66b8bb74ca Fix two langauge -> language typos 2019-05-12 11:50:13 -04:00
GDB Administrator 1ace968ad5 Automatic date update in version.in 2019-05-12 00:01:00 +00:00
Joel Brobecker 21c219fd5b Document the GDB 8.3 release in gdb/ChangeLog
gdb/ChangeLog:

	GDB 8.3 released.
2019-05-11 11:29:24 -07:00
Faraz Shahbazker 387e762476 Add macro expansions for ADD, SUB, DADD and DSUB for MIPS r6
Release 6 of the MIPS architecture does not have an ADDI instruction.
ADD/SUB instructions with immediate operands can be expanded to load
and immediate value and then perform the operation.

gas/
	* config/tc-mips.c (macro) <M_ADD_I, M_SUB_I, M_DADD_I, M_DSUB_I>:
	Add expansions for MIPS r6.
	* testsuite/gas/mips/add.s: Enable tests for R6.
	* testsuite/gas/mips/daddi.s: Annotate to test DADD for R6.
	* testsuite/gas/mips/mipsr6@add.d: Likewise.
	* gas/testsuite/gas/mips/mipsr6@dadd.d: New test.
	* gas/testsuite/gas/mips/mips.exp: Run the new test.

opcodes/
        * mips-opc.c (mips_opcodes): Enable ADD, SUB, DADD and DSUB
	macros for R6.
2019-05-10 21:36:32 -07:00
Alan Modra 0067be51e9 PowerPC objdump -Mraw
* ppc-dis.c (print_insn_powerpc) Don't skip optional operands
	when -Mraw is in effect.
2019-05-11 10:07:56 +09:30
GDB Administrator 55cb8bb5a8 Automatic date update in version.in 2019-05-11 00:00:19 +00:00
Joshua Oreman e173ea00c2 Fix problem with ICF where diffs in EH frame info is ignored.
PR gold/21066
	* gc.h (gc_process_relocs): Track relocations in .eh_frame sections
	when ICF is enabled, even though the .eh_frame sections themselves
	are not foldable.
	* icf.cc (get_section_contents): Change arguments to permit operation
	on just part of a section. Include extra identity regions in the
	referring section's contents recursively.
	(match_sections): Lock object here instead of in get_section_contents
	so that get_section_contents can operate recursively.
	(Icf::add_ehframe_links): New method.
	(Icf::find_identical_sections): Pass .eh_frame sections to
	add_ehframe_links(). Increase default iteration count from 2 to 3
	because handling exception info typically requires one extra iteration.
	* icf.h (Icf::extra_identity_list_): New data member with accessor.
	(is_section_foldable_candidate): Include .gcc_except_table sections.
	* options.h: Update documentation for new default ICF iteration count.
	* testsuite/Makefile.am (icf_test_pr21066): New test case.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/icf_test_pr21066.cc: New source file.
	* testsuite/icf_test_pr21066.sh: New test script.
2019-05-11 07:27:10 +08:00
Simon Marchi 1367480341 Fix GDB build when using --disable-gdbmi
Since commit

    b4be1b0648 ("Fix MI output for multi-location breakpoints")

we get this error when building with --disable-gdbmi:

      CXXLD  gdb
    /home/smarchi/src/binutils-gdb/gdb/breakpoint.c:6358: error: undefined reference to 'mi_multi_location_breakpoint_output_fixed(ui_out*)'

This is due to breakpoint.c using a function defined in mi/mi-main.c, even
though mi/mi-main.c isn't included in the build.

To fix it, use the flags feature of ui_out.  mi_ui_out has the new
fix_multi_location_breakpoint_output flag set for versions >= 3.  Also,
move the global variable fix_multi_location_breakpoint_output to
breakpoint.c, so it can be read there even when we build without MI.  I
renamed it to fix_multi_location_breakpoint_output_globally so it
doesn't clash with the new enumerator.

gdb/ChangeLog:

	* breakpoint.h (fix_multi_location_breakpoint_output_globally):
	New variable declaration.
	* breakpoint.c (fix_multi_location_breakpoint_output_globally):
	New variable.
	(print_one_breakpoint): Use ui_out::test_flags and new global
	variable to compute use_fixed_output.
	* mi/mi-main.h (mi_multi_location_breakpoint_output_fixed):
	Remove.
	* mi/mi-main.c (fix_multi_location_breakpoint_output): Remove.
	(mi_multi_location_breakpoint_output_fixed): Remove.
	(mi_cmd_fix_multi_location_breakpoint_output): Adjust to set the
	new variable.
	* mi/mi-out.c (mi_ui_out::mi_ui_out): Set
	fix_multi_location_breakpoint_output flag if version >= 3.
	* ui-out.h (enum ui_out_flag)
	<fix_multi_location_breakpoint_output>: New enumerator.
2019-05-10 17:22:09 -04:00
Simon Marchi a9eac7f9b4 cc-with-tweaks: show dwz stderr and verify result
When running the gdb.base/index-cache.exp test case with the
cc-with-dwz-m board, I noticed that the final executable didn't actually
contain a .gnu_debugaltlink section with the name of the external dwz
file:

    $ readelf --debug-dump=links testsuite/outputs/gdb.base/index-cache/index-cache
    * empty *

Running dwz by hand, I realized it's because dwz complains that the
output .debug_info section is empty and fails:

    $ gcc ~/src/binutils-gdb/gdb/testsuite/gdb.base/index-cache.c -g3 -O0 -o a && cp a b
    $ dwz -m foo a b
    dwz: foo: .debug_info section not present
    $ echo $?
    1

This is because index-cache.c is trivial (just an empty main) and dwz
doesn't find anything to factor out to the dwz file. [1]

I think that cc-with-tweaks should fail in this scenario: if the user
asks for an external dwz file to be generated (the -m flag), then it
should be an error if cc-with-tweaks doesn't manage to produce an
executable with the proper link to this external dwz file.  Otherwise,
the test runs with a regular non-dwzified executable, which gives a
false sense of security about whether the feature under test works with
dwzified executables.

So this patch adds checks for that after invoking dwz.  It also removes
the 2>&1 to allow the error message to be printed like so:

    Running /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.base/index-cache.exp ...
    gdb compile failed, dwz: /home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/index-cache/index-cache.dwz: .debug_info section not present

- In the -m case (multi-file compression), we check if the expected output file
  exists.
- In the -z case (single-file compression), we check if the file
  contents has changed.  This should catch cases where dwz doesn't modify the
  file because it's not worth it.

It was chosen not to check for dwz's exit code, as it is not very
reliable up to dwz 0.12.

With this patch, fewer tests will pass than before with the
cc-with-dwz and cc-with-dwz-m boards, but those were false positives
anyway, as the test ran with regular executables.

[1] Note that dwz has been patched by Tom de Vries to work correctly in
this case, so we can use dwz master to run the test:

https://sourceware.org/git/?p=dwz.git;a=commit;h=08becc8b33453b6d013a65e7eeae57fc1881e801

gdb/ChangeLog:

	* contrib/cc-with-tweaks.sh: Validate dwz's work.
2019-05-10 16:29:40 -04:00
Tom Tromey a97c8e5636 Document lazy computation for pretty-printer "children" method
I found out recently that some users didn't know that the Python
pretty-printers "children" method should compute its result lazily.
This has been a good idea since the earliest days, but wasn't
mentioned in the docs.  This patch adds some text to this effect.

gdb/doc/ChangeLog
2019-05-10  Tom Tromey  <tromey@adacore.com>

	* python.texi (Pretty Printing API): Mention lazy computation for
	"children".
2019-05-10 12:35:26 -06:00
Tom Tromey 71bed2dba6 Add completion for Ada catch commands
This patch adds a completion function to the "catch exception"
and "catch handlers" commands.

Tested on x86-64 Fedora 29; reviewed off-list by Joel.

gdb/ChangeLog
2019-05-10  Tom Tromey  <tromey@adacore.com>

	* ada-lang.c (catch_ada_completer): New function.
	(_initialize_ada_language): Use it.

gdb/testsuite/ChangeLog
2019-05-10  Tom Tromey  <tromey@adacore.com>

	* gdb.ada/info_exc.exp: Add "complete" test.
2019-05-10 09:57:42 -06:00
Tom Tromey b8e07335d0 Minor "catch" documentation improvements
This patch makes a few minor improvements to the catchpoint
documentation:

* "catch exception" and "catch handlers" now mention the argument in
  the @item.

* "catch exception unhandled" is moved to be closer to "catch
  exception", rather than after "catch handlers".

* "catch load" and "catch unload" now wrap the argument in @var.

gdb/doc/ChangeLog
2019-05-10  Tom Tromey  <tromey@adacore.com>

	* gdb.texinfo (Set Catchpoints): Add text for parameter to "catch
	exception" and "catch handlers".  Move "catch exception unhandled"
	text.  Use @var for "catch load" and "catch unload"
2019-05-10 08:34:01 -06:00
Alan Modra 391bf8918b Re: Sign-extend start and stop address inputs to objdump
git commit 2379f9c475 introduced an rx-elf test failure.  This fixes it.

	* testsuite/binutils-all/objdump.exp (test_objdump_disas_limited),
	(test_objdump_content_limited): Add text arg, use in place of .text.
	(bintest_signed.o): Call get_standard_section_names for name of
	text section.
2019-05-10 23:32:21 +09:30
Tom Tromey 24c54127c5 Two minor constifications
I noticed a couple of spots where a "char *" was used where a
"const char *" made more sense.  This patch fixes both of them.
Tested by rebuilding.

gdb/ChangeLog
2019-05-10  Tom Tromey  <tromey@adacore.com>

	* thread.c (print_thread_info): Make "requested_threads" const.
	* gdbthread.h (print_thread_info): Make "requested_threads"
	const.
	* ada-tasks.c (print_ada_task_info): Make "taskno_str" const.
	* ada-lang.h (print_ada_task_info): Make "taskno_str" const.
2019-05-10 07:17:48 -06:00
GDB Administrator f3e606a3db Automatic date update in version.in 2019-05-10 00:00:37 +00:00
Peter Bergner bda678b9e5 Update printing of optional operands during disassembly.
opcodes/
	* ppc-dis.c (skip_optional_operands): Change return type and returns.
	(print_insn_powerpc) <skip_optional>: Change type.
	Call skip_optional_operands if we have not skipped any operands.
gas/
	* testsuite/gas/ppc/476.d: Update expected output.
	* testsuite/gas/ppc/power6.d: Likewise.
2019-05-09 09:09:47 -05:00
Matthew Malcomson 8de09632ff [gas][testsuite] Don't specify arch in testsuite output
My testcase matched against a file format of elf64-littleaarch64 in the
objdump output.  This was unnecessarily restrictive and causes testcase
failures on aarch64_be.

Here we remove that restriction.
Committed as obvious.

Testing done on aarch64_be-none-elf gas to see the failure goes away.

gas/ChangeLog:

2019-05-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	* testsuite/gas/aarch64/sve2.d: Remove file format restriction.
2019-05-09 14:52:45 +01:00
Tom de Vries 63b667adb4 [gdb/testsuite] Fix gdb.arch/amd64-tailcall-self.S
The test-case gdb.arch/amd64-tailcall-self.exp fails here:
...
if ![runto b] {
    return -1
}
...
like:
...
(gdb) file build/gdb/testsuite/outputs/gdb.arch/amd64-tailcall-self/\
  amd64-tailcall-self
Reading symbols from build/gdb/testsuite/outputs/gdb.arch/\
  amd64-tailcall-self/amd64-tailcall-self...
Dwarf Error: Cannot find DIE at 0x1f5 referenced from DIE at 0x107 [in \
  module build/gdb/testsuite/outputs/gdb.arch/amd64-tailcall-self/\
  amd64-tailcall-self]
...

The problem is that in amd64-tailcall-self.S, CU-relative references are
assigned .debug_info section relative values.  [ This is similar to the
problem fixed by "Fix gdb.arch/amd64-entry-value-paramref.S". ]

Fix this by assigning CU-relative references instead.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-05-09  Tom de Vries  <tdevries@suse.de>

	* gdb.arch/amd64-tailcall-self.S: Make DW_FORM_ref4 references
	CU-relative.
2019-05-09 12:24:38 +02:00
Matthew Malcomson e111c7d1eb [binutils][aarch64] Add SVE2 tests
Add tests that SVE2 instructions are encoded as they should be, and
tests that invalid instructions have their problems reported.

Also check that each sve2 cryptographic extension is required to use the
corresponding cryptographic instructions.

Finally, test to ensure that sve2 instructions using mnemonics that
exist in sve1 still need the sve2 feature to be used.

gas/ChangeLog:

2019-05-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	* testsuite/gas/aarch64/illegal-sve2-aes.d: New test.
	* testsuite/gas/aarch64/illegal-sve2-bitperm.d: New test.
	* testsuite/gas/aarch64/illegal-sve2-sha3.d: Test new instructions.
	* testsuite/gas/aarch64/illegal-sve2-sm4.d: Test new instructions.
	* testsuite/gas/aarch64/illegal-sve2-sve1ext.d: Test new instructions.
	* testsuite/gas/aarch64/illegal-sve2-sve1ext.l: Test new instructions.
	* testsuite/gas/aarch64/illegal-sve2.d: Test new instructions.
	* testsuite/gas/aarch64/illegal-sve2.l: Test new instructions.
	* testsuite/gas/aarch64/illegal-sve2.s: Test new instructions.
	* testsuite/gas/aarch64/sve1-extended-sve2.s: New test.
	* testsuite/gas/aarch64/sve2.d: Test new instructions.
	* testsuite/gas/aarch64/sve2.s: Test new instructions.
2019-05-09 10:29:51 +01:00
Matthew Malcomson 42e6288f9f [binutils][aarch64] Add SVE2 instructions.
This patch adds all the SVE2 instructions and their associated qualifier
sets.
Ok for trunk?

opcodes/ChangeLog:

2019-05-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	* aarch64-dis-2.c: Regenerate.
	* aarch64-tbl.h (OP_SVE_BBU): New variant set.
	(OP_SVE_BBB): New variant set.
	(OP_SVE_DDDD): New variant set.
	(OP_SVE_HHH): New variant set.
	(OP_SVE_HHHU): New variant set.
	(OP_SVE_SSS): New variant set.
	(OP_SVE_SSSU): New variant set.
	(OP_SVE_SHH): New variant set.
	(OP_SVE_SBBU): New variant set.
	(OP_SVE_DSS): New variant set.
	(OP_SVE_DHHU): New variant set.
	(OP_SVE_VMV_HSD_BHS): New variant set.
	(OP_SVE_VVU_HSD_BHS): New variant set.
	(OP_SVE_VVVU_SD_BH): New variant set.
	(OP_SVE_VVVU_BHSD): New variant set.
	(OP_SVE_VVV_QHD_DBS): New variant set.
	(OP_SVE_VVV_HSD_BHS): New variant set.
	(OP_SVE_VVV_HSD_BHS2): New variant set.
	(OP_SVE_VVV_BHS_HSD): New variant set.
	(OP_SVE_VV_BHS_HSD): New variant set.
	(OP_SVE_VVV_SD): New variant set.
	(OP_SVE_VVU_BHS_HSD): New variant set.
	(OP_SVE_VZVV_SD): New variant set.
	(OP_SVE_VZVV_BH): New variant set.
	(OP_SVE_VZV_SD): New variant set.
	(aarch64_opcode_table): Add sve2 instructions.
2019-05-09 10:29:28 +01:00
Matthew Malcomson 28ed815ad2 [binutils][aarch64] New SVE_SHLIMM_UNPRED_22 operand.
New operand describes a shift-left immediate encoded in bits
22:20-19:18-16 where UInt(bits) - esize == shift.
This operand is useful for instructions like sshllb.

gas/ChangeLog:

2019-05-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	* config/tc-aarch64.c (parse_operands): Handle new SVE_SHLIMM_UNPRED_22
	operand.

include/ChangeLog:

2019-05-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	* opcode/aarch64.h (enum aarch64_opnd): New SVE_SHLIMM_UNPRED_22
	operand.

opcodes/ChangeLog:

2019-05-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	* aarch64-asm-2.c: Regenerated.
	* aarch64-dis-2.c: Regenerated.
	* aarch64-opc-2.c: Regenerated.
	* aarch64-opc.c (operand_general_constraint_met_p): Constraint checking
	for SVE_SHLIMM_UNPRED_22.
	(aarch64_print_operand): Add printing for SVE_SHLIMM_UNPRED_22.
	* aarch64-tbl.h (AARCH64_OPERANDS): Use new SVE_SHLIMM_UNPRED_22
	operand.
2019-05-09 10:29:27 +01:00
Matthew Malcomson fd1dc4a0c1 [binutils][aarch64] New sve_size_tsz_bhs iclass.
Add sve_size_tsz_bhs iclass needed for sqxtnb and similar instructions.
This iclass encodes one of three variants by the most significant bit
set in a 3-bit value where only one bit may be set.

include/ChangeLog:

2019-05-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	* opcode/aarch64.h (enum aarch64_insn_class): Add sve_size_tsz_bhs
	iclass.

opcodes/ChangeLog:

2019-05-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	* aarch64-asm.c (aarch64_encode_variant_using_iclass): Handle
	sve_size_tsz_bhs iclass encode.
	* aarch64-dis.c (aarch64_decode_variant_using_iclass): Handle
	sve_size_tsz_bhs iclass decode.
2019-05-09 10:29:26 +01:00
Matthew Malcomson 31e36ab341 [binutils][aarch64] New SVE_Zm4_11_INDEX operand.
This includes defining a new single bit field SVE_i2h at position 20.
SVE_Zm4_11_INDEX handles indexed Zn registers where the index is encoded
in bits 20:11 and the register is chosed from range z0-z15 in bits 19-16.

gas/ChangeLog:

2019-05-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	* config/tc-aarch64.c (parse_operands): Handle new SVE_Zm4_11_INDEX
	operand.

include/ChangeLog:

2019-05-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	* opcode/aarch64.h (enum aarch64_opnd): New SVE_Zm4_11_INDEX operand.

opcodes/ChangeLog:

2019-05-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	* aarch64-asm-2.c: Regenerated.
	* aarch64-dis-2.c: Regenerated.
	* aarch64-opc-2.c: Regenerated.
	* aarch64-opc.c (operand_general_constraint_met_p): Constraint checking
	for SVE_Zm4_11_INDEX.
	(aarch64_print_operand): Add printing for SVE_Zm4_11_INDEX.
	(fields): Handle SVE_i2h field.
	* aarch64-opc.h (enum aarch64_field_kind): New SVE_i2h field.
	* aarch64-tbl.h (AARCH64_OPERANDS): Use new SVE_Zm4_11_INDEX operand.
2019-05-09 10:29:24 +01:00
Matthew Malcomson 1be5f94f9c [binutils][aarch64] New sve_shift_tsz_bhsd iclass.
This new iclass encodes the variant by which is the most significant bit
used of bits 23-22:20-19, where those bits are usually part of a
given constant operand.

include/ChangeLog:

2019-05-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	* opcode/aarch64.h (enum aarch64_insn_class): Add sve_shift_tsz_bhsd
	iclass.

opcodes/ChangeLog:

2019-05-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	* aarch64-asm.c (aarch64_encode_variant_using_iclass): Handle
	sve_shift_tsz_bhsd iclass encode.
	* aarch64-dis.c (aarch64_decode_variant_using_iclass): Handle
	sve_shift_tsz_bhsd iclass decode.
2019-05-09 10:29:23 +01:00
Matthew Malcomson 3c17238bc9 [binutils][aarch64] New SVE_SHRIMM_UNPRED_22 operand.
Include a new iclass to extract the variant from the most significant 3
bits of this operand.

Instructions such as rshrnb include a constant shift amount as an
operand, where the most significant three bits of this operand determine
what size elements the instruction is operating on.

The new SVE_SHRIMM_UNPRED_22 operand denotes this constant encoded in
bits 22:20-19:18-16 while the new sve_shift_tsz_hsd iclass denotes that
the SVE qualifier is encoded in bits 22:20-19.

gas/ChangeLog:

2019-05-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	* config/tc-aarch64.c (parse_operands): Handle new SVE_SHRIMM_UNPRED_22
	operand.

include/ChangeLog:

2019-05-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	* opcode/aarch64.h (enum aarch64_opnd): New SVE_SHRIMM_UNPRED_22
	operand.
	(enum aarch64_insn_class): Add sve_shift_tsz_hsd iclass.

opcodes/ChangeLog:

2019-05-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	* aarch64-asm-2.c: Regenerated.
	* aarch64-dis-2.c: Regenerated.
	* aarch64-opc-2.c: Regenerated.
	* aarch64-asm.c (aarch64_ins_sve_shrimm):
	(aarch64_encode_variant_using_iclass): Handle
	sve_shift_tsz_hsd iclass encode.
	* aarch64-dis.c (aarch64_decode_variant_using_iclass): Handle
	sve_shift_tsz_hsd iclass decode.
	* aarch64-opc.c (operand_general_constraint_met_p): Constraint checking
	for SVE_SHRIMM_UNPRED_22.
	(aarch64_print_operand): Add printing for SVE_SHRIMM_UNPRED_22.
	* aarch64-tbl.h (AARCH64_OPERANDS): Use new SVE_SHRIMM_UNPRED_22
	operand.
2019-05-09 10:29:22 +01:00