Commit Graph

97008 Commits

Author SHA1 Message Date
GDB Administrator 24e31cf3aa Automatic date update in version.in 2019-03-26 00:00:40 +00:00
Alan Modra e8fba7f6bb Fix relpp may be used uninitialized
* objdump.c (dump_relocs_in_section): Warning fix.
2019-03-26 09:01:53 +10:30
John Baldwin 81a24d04df Note support for TLS variables on FreeBSD.
gdb/ChangeLog:

	* NEWS: Mention TLS support for FreeBSD.
2019-03-25 13:23:42 -07:00
Tom Tromey 79e7ae11c7 Clean up some comments in minsyms.c
Philippe pointed out that some comments in minsyms.c still referred to
obstack allocation.  This patch fixes these up.

In most cases here, my view is that the comments were more misleading
than helpful.  So, I've generally removed text.

gdb/ChangeLog
2019-03-25  Tom Tromey  <tromey@adacore.com>

	* minsyms.c (BUNCH_SIZE): Update comment.
	(~minimal_symbol_reader): Remove old comment.
	(compact_minimal_symbols): Update comment.
	(minimal_symbol_reader::install): Remove old comment.  Update
	other comments.
2019-03-25 13:45:57 -06:00
Alan Hayward d45963c2b2 Fix s390 build
Add missing include.

2019-03-25  Alan Hayward  <alan.hayward@arm.com>

        * s390-linux-nat.c: Add include.
2019-03-25 17:08:14 +00:00
Alan Hayward 0f83012ea0 Add linux_get_hwcap
Tidy up calls to read HWCAP (and HWCAP2) by adding common functions,
removing the PPC and AArch64 specific versions.

The only function difference is in aarch64_linux_core_read_description - if
the hwcap read fails it now return a valid description instead of nullptr.

gdb/ChangeLog:

2019-03-25  Alan Hayward  <alan.hayward@arm.com>

	* aarch64-linux-nat.c (aarch64_linux_nat_target::read_description):
	Call linux_get_hwcap.
	* aarch64-linux-tdep.c (aarch64_linux_core_read_description):
	Likewise.
	(aarch64_linux_get_hwcap): Remove function.
	* aarch64-linux-tdep.h (aarch64_linux_get_hwcap): Remove
	declaration.
	* arm-linux-nat.c (arm_linux_nat_target::read_description):Call
	linux_get_hwcap.
	* arm-linux-tdep.c (arm_linux_core_read_description): Likewise.
	* linux-tdep.c (linux_get_hwcap): Add function.
	(linux_get_hwcap2): Likewise.
	* linux-tdep.h (linux_get_hwcap): Add declaration.
	(linux_get_hwcap2): Likewise.
	* ppc-linux-nat.c (ppc_linux_get_hwcap): Remove function.
	(ppc_linux_get_hwcap2): Likewise.
	(ppc_linux_nat_target::region_ok_for_hw_watchpoint): Call
	linux_get_hwcap.
	(ppc_linux_nat_target::insert_watchpoint): Likewise.
	(ppc_linux_nat_target::watchpoint_addr_within_range): Likewise.
	(ppc_linux_nat_target::read_description): Likewise.
	* ppc-linux-tdep.c (ppc_linux_core_read_description): Likewise.
	* s390-linux-nat.c: Likewise.
	* s390-linux-tdep.c (s390_core_read_description): Likewise.
2019-03-25 16:50:38 +00:00
Tamar Christina 796d6298bb Arm: Fix Arm disassembler mapping symbol search.
Similar to the AArch64 patches the Arm disassembler has the same issues with
out of order sections but also a few short comings.

For one thing there are multiple code blocks to determine mapping symbols, and
they all work slightly different, and neither fully correct.  The first thing
this patch does is centralise the mapping symbols search into one function
mapping_symbol_for_insn.  This function is then updated to perform a search in
a similar way as AArch64.

Their used to be a value has_mapping_symbols which was used to determine the
default disassembly for objects that have no mapping symbols.  The problem with
the approach was that it was determining this value in the same loop that needed
it, which is why this field could take on the states -1, 0, 1 where -1 means
"don't know".  However this means that until you actually find a mapping symbol
or reach the end of the disassembly glob, you don't know if you did the right
action or not, and if you didn't you can't correct it anymore.

This is why the two jump-reloc-veneers-* testcases end up disassembling some
insn as data when they shouldn't.

Out of order here refers to an object file where sections are not listed in a
monotonic increasing VMA order.

The ELF ABI for Arm [1] specifies the following for mapping symbols:

  1) A text section must always have a corresponding mapping symbol at it's
     start.
  2) Data sections do not require any mapping symbols.
  3) The range of a mapping symbol extends from the address it starts on up to
     the next mapping symbol (exclusive) or section end (inclusive).

However there is no defined order between a symbol and it's corresponding
mapping symbol in the symbol table.  This means that while in general we look
up for a corresponding mapping symbol, we have to make at least one check of
the symbol below the address being disassembled.

When disassembling different PCs within the same section, the search for mapping
symbol can be cached somewhat.  We know that the mapping symbol corresponding to
the current PC is either the previous one used, or one at the same address as
the current PC.

However this optimization and mapping symbol search must stop as soon as we
reach the end or start of the section.  Furthermore if we're only disassembling
a part of a section, the search is a allowed to search further than the current
chunk, but is not allowed to search past it (The mapping symbol if there, must
be at the same address, so in practice we usually stop at PC+4).

lastly, since only data sections don't require a mapping symbol the default
mapping type should be DATA and not INSN as previously defined, however if the
binary has had all its symbols stripped than this isn't very useful.  To fix
this we determine the default based on the section flags.  This will allow the
disassembler to be more useful on stripped binaries.  If there is no section
than we assume you to be disassembling INSN.

[1] https://developer.arm.com/docs/ihi0044/latest/elf-for-the-arm-architecture-abi-2018q4-documentation#aaelf32-table4-7

binutils/ChangeLog:

	* testsuite/binutils-all/arm/in-order-all.d: New test.
	* testsuite/binutils-all/arm/in-order.d: New test.
	* testsuite/binutils-all/arm/objdump.exp: Support .d tests.
	* testsuite/binutils-all/arm/out-of-order-all.d: New test.
	* testsuite/binutils-all/arm/out-of-order.T: New test.
	* testsuite/binutils-all/arm/out-of-order.d: New test.
	* testsuite/binutils-all/arm/out-of-order.s: New test.

ld/ChangeLog:

	* testsuite/ld-arm/jump-reloc-veneers-cond-long.d: Update disassembly.
	* testsuite/ld-arm/jump-reloc-veneers-long.d: Update disassembly.

opcodes/ChangeLog:

	* arm-dis.c (struct arm_private_data): Remove has_mapping_symbols.
	(mapping_symbol_for_insn): Implement new algorithm.
	(print_insn): Remove duplicate code.
2019-03-25 15:05:53 +00:00
Tamar Christina 60df3720d7 AArch64: Have -D override mapping symbol as documented.
The documentation for -D says that on Arm platforms -D should disassemble
data as instructions.

"If the target is an ARM architecture this switch also has the effect of
forcing the disassembler to decode pieces of data found in code sections
as if they were instructions. "

This makes it do as it says on the tincan so it's more consistent with
aarch32.  The usecase here is for baremetal developers who have created
their instructions using .word directives instead if .insn.

Though for Linux users I do find this behavior somewhat non-optimal.
Perhaps there should be a new flag that just disassembles the values
following the actual mapping symbol?

binutils/ChangeLog:

	* testsuite/binutils-all/aarch64/in-order-all.d: New test.
	* testsuite/binutils-all/aarch64/out-of-order-all.d: New test.
	* testsuite/binutils-all/aarch64/out-of-order.d:

opcodes/ChangeLog:

	* aarch64-dis.c (print_insn_aarch64):
	Implement override.
2019-03-25 15:05:53 +00:00
Tamar Christina 5145776164 AArch64: Fix AArch64 disassembler mapping symbol search
My previous patch for AArch64 was not enough to catch all the cases where
disassembling an out-of-order section could go wrong.  It had missed the case
DATA sections could be incorrectly disassembled as TEXT.

Out of order here refers to an object file where sections are not listed in a
monotonic increasing VMA order.

The ELF ABI for AArch64 [1] specifies the following for mapping symbols:

  1) A text section must always have a corresponding mapping symbol at it's
     start.
  2) Data sections do not require any mapping symbols.
  3) The range of a mapping symbol extends from the address it starts on up to
     the next mapping symbol (exclusive) or section end (inclusive).

However there is no defined order between a symbol and it's corresponding
mapping symbol in the symbol table.  This means that while in general we look
up for a corresponding mapping symbol, we have to make at least one check of
the symbol below the address being disassembled.

When disassembling different PCs within the same section, the search for mapping
symbol can be cached somewhat.  We know that the mapping symbol corresponding to
the current PC is either the previous one used, or one at the same address as
the current PC.

However this optimization and mapping symbol search must stop as soon as we
reach the end or start of the section.  Furthermore if we're only disassembling
a part of a section, the search is a allowed to search further than the current
chunk, but is not allowed to search past it (The mapping symbol if there, must
be at the same address, so in practice we usually stop at PC+4).

lastly, since only data sections don't require a mapping symbol the default
mapping type should be DATA and not INSN as previously defined, however if the
binary has had all its symbols stripped than this isn't very useful.  To fix this
we determine the default based on the section flags.  This will allow the
disassembler to be more useful on stripped binaries.  If there is no section than
we assume you to be disassembling INSN.

[1] https://developer.arm.com/docs/ihi0056/latest/elf-for-the-arm-64-bit-architecture-aarch64-abi-2018q4#aaelf64-section4-5-4

binutils/ChangeLog:

	* testsuite/binutils-all/aarch64/in-order.d: New test.
	* testsuite/binutils-all/aarch64/out-of-order.d: Disassemble data as
	well.

opcodes/ChangeLog:

	* aarch64-dis.c (print_insn_aarch64): Update the mapping symbol search
	order.
2019-03-25 15:05:53 +00:00
Tamar Christina 53b2f36bf6 AArch64: Fix disassembler bug with out-of-order sections
The AArch64 disassembler has an optimization that it uses to reduce the amount
it has to search for mapping symbols during disassembly.  This optimization
assumes that sections are listed in the section header in monotonic increasing
VMAs.  However this is not a requirement for the ELF specification.

Because of this when such "out of order" sections occur the disassembler would
pick the wrong mapping symbol to disassemble the section with.

This fixes it by explicitly passing along the stop offset for the current
disassembly glob and when this changes compared to the previous one we've seen
the optimization won't be performed.  In effect this restarts the search from
a well defined starting point.  Usually the symbol's address.

The existing stop_vma can't be used for this as it is allowed to be unset and
setting this unconditionally would change the semantics of this field.

binutils/ChangeLog:

	* objdump.c (disassemble_bytes): Pass stop_offset.
	* testsuite/binutils-all/aarch64/out-of-order.T: New test.
	* testsuite/binutils-all/aarch64/out-of-order.d: New test.
	* testsuite/binutils-all/aarch64/out-of-order.s: New test.

include/ChangeLog:

	* dis-asm.h (struct disassemble_info): Add stop_offset.

opcodes/ChangeLog:

	* aarch64-dis.c (last_stop_offset): New.
	(print_insn_aarch64): Use stop_offset.
2019-03-25 15:05:53 +00:00
Pedro Alves 9a93502fa8 Fix testsuite hangs when gdb_test_multiple body errors out
This commit fixes a regression in the testsuite itself, triggered by
errors being raised from within gdb_test_multiple, originally reported
by Pedro Franco de Carvalho's at
<https://sourceware.org/ml/gdb-patches/2019-03/msg00160.html>.  Parts
of the commit message are based on his report.

This started happening due to a commit that was introduced recently,
and it can cause the testsuite to hang.

The commit that triggers this is:

 fe1a5cad30
 [gdb/testsuite] Log wait status on process no longer exists error

That commit introduces a new "eof" block in gdb_test_multiple.  That
is not incorrect itself, but dejagnu's remote_expect is picking that
block as the "default" action when an error is raised from within the
commands inside a call to gdb_test_multiple:

  # remote_expect works basically the same as standard expect, but it
  # also takes care of getting the file descriptor from the specified
  # host and also calling the timeout/eof/default section if there is an
  # error on the expect call.
  #
  proc remote_expect { board timeout args } {

I find that "feature" surprising, and I don't really know why it
exists, but this means that the eof section that remote_expect picks
as the error block can be executed even when there was no actual eof
and the GDB process is still running, so the wait introduced in the
commit that tries to get the exit status of GDB hangs forever, while
GDB itself waits for input.

This only happens when there are internal testsuite errors (not
testcase failures).  This can be reproduced easily with a testcase
such as:

  gdb_start
  gdb_test_multiple "show version" "show version" {
    -re ".*" {
       error "forced error"
    }
  }

I think that working around this in GDB is useful so that the
testsuite doesn't hang in these cases.

Adding an empty "default" block at the end of the expect body in
gdb_test_multiple doesn't work, because dejagnu gives preference to
"eof" blocks:

	    if { $x eq "eof" } {
		set save_next 1
	    } elseif { $x eq "default" || $x eq "timeout" } {
		if { $error_sect eq "" } {
		    set save_next 1
		}
	    }

And we do have "eof" blocks.  So we need to make sure that the last
"eof" block is safe to use as the default error block.  It's also
pedantically incorrect to print

 "ERROR: Process no longer exists"

which is what we'd get if the last eof block we have was selected
(more below on this).

So this commit solves this by appending an "eof" with an empty
spawn_id list, so that it won't ever match.

Now, why is the first "eof" block selected today as the error block,
instead of the last one?

The reason is that remote_expect, while parsing the body to select the
default block to execute after an error, is affected by the comments
in the body (since they are also parsed).

If this comment in gdb_test_multiple

 # patterns below apply to any spawn id specified.

is changed to

 # The patterns below apply to any spawn id specified.

then the second eof block is selected and there is no hang.

Any comment at that same place with an even number of tokens also
works.

This is IMO a coincidence caused by how comments work in TCL.
Comments should only appear in places where a command can appear.  And
here, remote_expect is parsing a list of options, not commands, so
it's not unreasonable to not parse comments, similarly to how this:

  set a_list {
     an_element
     # another_element
  }

results in a list with three elements, not one element.

The fact that comments with an even number of tokens work is just a
coincidence of how remote_expect's little state machine is
implemented.

I thought we could solve this by stripping out comment lines in
gdb_expect, but I didn't find an easy way to do that.  Particularly, a
couple naive approaches I tried run into complications.  For example,
we have gdb_test calls with regular expressions that include sequences
like "\r\n#", and by the time we get to gdb_expect, the \r\n have
already been expanded to a real newline, so just splitting the whole
body at newline boundaries, looking for lines that start with #
results in incorrectly stripping out half of the gdb_text regexp.  I
think it's better (at least in this commit), to move the comments out
of the list, because it's much simpler and risk free.

gdb/testsuite/ChangeLog:
2019-03-25  Pedro Alves  <palves@redhat.com>

	* lib/gdb.exp (gdb_test_multiple): Split appends to $code and
	move comments outside list.  Append '-i "" eof' section.
2019-03-25 13:26:23 +00:00
Tom Tromey 6640a367bf Remove null_block_symbol
This removes null_block_symbol.  It seemed simpler to me to change
initializations and returns to use value initialization rather than
null_block_symbol.  This also fixes up a few spots where
initialization was done piecemeal.

gdb/ChangeLog
2019-03-24  Tom Tromey  <tom@tromey.com>

	* ada-lang.c (standard_lookup): Simplify initialization.
	(ada_lookup_symbol_nonlocal): Simplify return.
	* solib-spu.c (spu_lookup_lib_symbol): Simplify return.
	* solib-darwin.c (darwin_lookup_lib_symbol): Simplify return.
	* solib-svr4.c (elf_lookup_lib_symbol): Simplify return.
	* rust-lang.c (rust_lookup_symbol_nonlocal): Simplify
	initialization.
	* solib.c (solib_global_lookup): Simplify.
	* symtab.c (null_block_symbol): Remove.
	(symbol_cache_lookup): Simplify returns.
	(lookup_language_this): Simplify returns.
	(lookup_symbol_aux): Simplify return.
	(lookup_local_symbol): Simplify returns.
	(lookup_global_symbol_from_objfile): Simplify return.
	(lookup_symbol_in_objfile_symtabs)
	(lookup_symbol_in_objfile_from_linkage_name): Simplify return.
	(lookup_symbol_via_quick_fns, lookup_symbol_in_static_block)
	(lookup_static_symbol, lookup_global_symbol): Simplify return.
	* cp-namespace.c (cp_lookup_bare_symbol)
	(cp_search_static_and_baseclasses, cp_lookup_symbol_via_imports)
	(cp_lookup_symbol_via_all_imports, cp_lookup_nested_symbol_1)
	(cp_lookup_nested_symbol): Don't use null_block_symbol.
	(cp_lookup_symbol_via_imports): Simplify initialization.
	(find_symbol_in_baseclass): Likewise.
	* symtab.h (null_block_symbol): Remove.
	* d-namespace.c (d_lookup_symbol): Don't use null_block_symbol.
	(d_lookup_nested_symbol, d_lookup_symbol_imports)
	(d_lookup_symbol_module): Likewise.
	(find_symbol_in_baseclass): Simplify initialization.
2019-03-24 23:32:09 -06:00
Tom Tromey a930ebcdf9 Don't include symtab.h from expression.h
expression.h includes symtab.h, but apparently only for the
declaration of struct block.  This patch changes it to foward-declare
the structure, and remove the include.

gdb/ChangeLog
2019-03-24  Tom Tromey  <tom@tromey.com>

	* expression.h: Don't include symtab.h.
	(struct block): Forward declare.
2019-03-24 23:32:09 -06:00
Tom Tromey 582942f456 More block constification
I noticed that there are still many places referring to non-const
blocks.  This constifies all the remaining ones that I found that
could be constified.

In a few spots, this search found unused variables or fields.  I
removed these.  I've also removed some unnecessary casts to
"struct block *".

gdb/ChangeLog
2019-03-24  Tom Tromey  <tom@tromey.com>

	* c-exp.y (typebase): Remove casts.
	* gdbtypes.c (lookup_unsigned_typename, )
	(lookup_signed_typename): Remove cast.
	* eval.c (parse_to_comma_and_eval): Remove cast.
	* parse.c (write_dollar_variable): Remove cast.
	* block.h (struct block) <superblock>: Now const.
	* symfile-debug.c (debug_qf_map_matching_symbols): Update.
	* psymtab.c (psym_map_matching_symbols): Make "block" const.
	(map_block): Make "block" const.
	* symfile.h (struct quick_symbol_functions)
	<map_matching_symbols>: Constify block argument to "callback".
	* symtab.c (basic_lookup_transparent_type_quick): Make "block"
	const.
	(find_pc_sect_compunit_symtab): Make "b" const.
	(find_symbol_at_address): Likewise.
	(search_symbols): Likewise.
	* dwarf2read.c (dw2_lookup_symbol): Make "block" const.
	(dw2_debug_names_lookup_symbol): Likewise.
	(dw2_map_matching_symbols): Update.
	* p-valprint.c (pascal_val_print): Remove "block".
	* ada-lang.c (ada_add_global_exceptions): Make "b" const.
	(aux_add_nonlocal_symbols): Make "block" const.
	(resolve_subexp): Remove cast.
	* linespec.c (iterate_over_all_matching_symtabs): Make "block"
	const.
	(iterate_over_file_blocks): Likewise.
	* f-exp.y (%union) <bval>: Remove.
	* coffread.c (patch_opaque_types): Make "b" const.
	* spu-tdep.c (spu_catch_start): Make "block" const.
	* c-valprint.c (print_unpacked_pointer): Remove "block".
	* symmisc.c (dump_symtab_1): Make "b" const.
	(block_depth): Make "block" const.
	* d-exp.y (%union) <bval>: Remove.
	* cp-support.h (cp_lookup_rtti_type): Update.
	* cp-support.c (cp_lookup_rtti_type): Make "block" const.
	* psymtab.c (psym_lookup_symbol): Make "block" const.
	(maintenance_check_psymtabs): Make "b" const.
	* python/py-framefilter.c (extract_sym): Make "sym_block" const.
	(enumerate_locals, enumerate_args): Update.
	* python/py-symtab.c (stpy_global_block): Make "block" const.
	(stpy_static_block): Likewise.
	* inline-frame.c (block_starting_point_at): Make "new_block"
	const.
	* block.c (find_block_in_blockvector): Make return type const.
	(blockvector_for_pc_sect): Make "b" const.
	(find_block_in_blockvector): Make "b" const.
2019-03-24 23:32:08 -06:00
GDB Administrator 258876ee34 Automatic date update in version.in 2019-03-25 00:00:31 +00:00
Philippe Waroquiers 5783e150b2 (re-)fix the regcache leaks when detaching from an executable.
Commit 799efbe8e0 was supposed to fix
the below leak.  However, for this fix to work, it is critical to
save the ptid before detach.

This commit (pushed as OBVIOUS, as the change was already reviewed/approved)
saves the ptid before the detach, as in the original reviewed patch
(see https://sourceware.org/ml/gdb-patches/2019-02/msg00263.html).

Re-tested on debian/amd64, natively and under valgrind.

==7426== 1,123 (72 direct, 1,051 indirect) bytes in 1 blocks are definitely lost in loss record 2,872 of 3,020
==7426==    at 0x4C2C4CC: operator new(unsigned long) (vg_replace_malloc.c:344)
==7426==    by 0x5BD1E1: get_thread_arch_aspace_regcache(ptid_t, gdbarch*, address_space*) (regcache.c:330)
==7426==    by 0x5BD39A: get_thread_regcache (regcache.c:366)
==7426==    by 0x5BD39A: get_current_regcache() (regcache.c:372)
==7426==    by 0x4B1EB4: get_current_frame() (frame.c:1588)
...
2019-03-24 13:56:46 +01:00
GDB Administrator 83bfc77ff5 Automatic date update in version.in 2019-03-24 00:01:13 +00:00
Tom Tromey 7ad417dd21 Have parser reset the innermost block tracker
I ran across a comment in symfile.c today:

  /* Clear globals which might have pointed into a removed objfile.
     FIXME: It's not clear which of these are supposed to persist
     between expressions and which ought to be reset each time.  */

It seems to me that this can be clarified: the parser entry points
ought to reset the innermost block tracker (and the expression context
block), and these should not be considered valid for code to use at
arbitrary times -- only immediately after an expression has been
parsed.

This patch implements this idea.  This could be further improved by
removing the parser globals and changing the parser functions to
return this information, but I have not done this.

Tested by the buildbot.

gdb/ChangeLog
2019-03-23  Tom Tromey  <tom@tromey.com>

	* varobj.c (varobj_create): Update.
	* symfile.c (clear_symtab_users): Don't reset innermost_block.
	* printcmd.c (display_command, do_one_display): Don't reset
	innermost_block.
	* parser-defs.h (enum innermost_block_tracker_type): Move to
	expression.h.
	(innermost_block): Update comment.
	* parse.c (parse_exp_1): Add tracker_types parameter.
	(parse_exp_in_context): Rename from parse_exp_in_context_1.  Add
	tracker_types parameter.  Reset innermost_block.
	(parse_exp_in_context): Remove.
	(parse_expression_for_completion): Update.
	* objfiles.c (~objfile): Don't reset expression_context_block or
	innermost_block.
	* expression.h (enum innermost_block_tracker_type): Move from
	parser-defs.h.
	(parse_exp_1): Add tracker_types parameter.
	* breakpoint.c (set_breakpoint_condition, watch_command_1): Don't
	reset innermost_block.
2019-03-23 10:59:10 -06:00
Tom Tromey b366c208ee Include bcache.h from objfiles.h
objfiles.h needs "struct bcache" to be complete, so it should include
bcache.h.  This patch implements this.

Tested by rebuilding.

gdb/ChangeLog
2019-03-23  Tom Tromey  <tom@tromey.com>

	* objfiles.h: Include bcache.h.
2019-03-23 10:50:27 -06:00
Tom Tromey 9bb9b2f9d6 Use scoped_restore_current_language in two places
I found a couple of spots that manually saved and restored the current
language.  This patch changes them to use
scoped_restore_current_language.

Tested by the buildbot.

gdb/ChangeLog
2019-03-23  Tom Tromey  <tom@tromey.com>

	* linespec.c (get_current_search_block): Use
	scoped_restore_current_language.
	* symmisc.c (dump_symtab): Use scoped_restore_current_language.
2019-03-23 10:18:15 -06:00
GDB Administrator c90939d2d0 Automatic date update in version.in 2019-03-23 00:00:38 +00:00
Alan Hayward 59c283728f AArch64: Read pauth section from core files
gdb/ChangeLog:

	* aarch64-linux-tdep.c
	(aarch64_linux_iterate_over_regset_sections): Check for pauth
	section.
	* aarch64-linux-tdep.h (AARCH64_LINUX_SIZEOF_PAUTH): New define.
2019-03-22 10:43:17 +00:00
Alan Hayward 17e116a7d1 AArch64: Prologue scan unwinder support for signed return addresses
Pauth address signing is enabled at binary compile time.  When enabled the
return addresses for functions may be mangled.  This patch adds functionality
to restore the original address for use in the prologue scan unwinder.

In the prologue analyzer, check for PACIASP/PACIBSP (enable address mangling)
and AUTIASP/AUTIBSP (disable address mangling).

When unwinding the PC from the prologue, unmask the register if required.

Add a test case to the prologue tests.

gdb/ChangeLog:

	* aarch64-tdep.c (aarch64_analyze_prologue): Check for pauth
	instructions.
	(aarch64_analyze_prologue_test): Add PACIASP test.
	(aarch64_prologue_prev_register): Unmask PC value.
2019-03-22 10:41:15 +00:00
Alan Hayward 11e1b75f06 AArch64: DWARF unwinder support for signed return addresses
Pauth address signing is enabled at binary compile time.  When enabled the
return addresses for functions may be mangled.  This patch adds functionality
to restore the original address for use in the DWARF unwinder.

DW_CFA_AARCH64_negate_ra_state in a binary indicates the toggling of address
signing between enabled and disabled.  Ensure the state is stored in the DWARF
register ra_state.

Ensure the pauth DWARF registers are initialised.

gdb/ChangeLog:

	* aarch64-tdep.c (aarch64_frame_unmask_address): New function.
	(aarch64_dwarf2_prev_register): Unmask PC value.
	(aarch64_dwarf2_frame_init_reg): Init pauth registers.
	(aarch64_execute_dwarf_cfa_vendor_op): Check for
	DW_CFA_AARCH64_negate_ra_state.
	(aarch64_gdbarch_init): Add aarch64_execute_dwarf_cfa_vendor_op.
2019-03-22 10:39:11 +00:00
Alan Hayward 34dcc7cf95 AArch64: Add pauth DWARF registers
Map the pauth registers to DWARF.

Add a new pseudo register ra_state and also map this to DWARF.  This register
is hidden from the user - prevent it from being read or written to.  It will
be used for the unmangling of addresses.

gdb/ChangeLog:

	* aarch64-tdep.c (aarch64_dwarf_reg_to_regnum): Check for pauth
	registers.
	(aarch64_pseudo_register_name): Likewise.
	(aarch64_pseudo_register_type): Likewise.
	(aarch64_pseudo_register_reggroup_p): Likewise.
	(aarch64_gdbarch_init): Add pauth registers.
	* aarch64-tdep.h (AARCH64_DWARF_PAUTH_RA_STATE): New define.
	(AARCH64_DWARF_PAUTH_DMASK): Likewise.
	(AARCH64_DWARF_PAUTH_CMASK): Likewise.
	(struct gdbarch_tdep): Add regnum for ra_state.
2019-03-22 10:37:46 +00:00
Alan Hayward 1ef53e6b83 AArch64: gdbserver: read pauth registers
Add the pauth registers to the regset lists.

Add a new regset type OPTIONAL_REGS which allows for the regset read to fail.
Once the read fails, it will not be checked again.  This allows targets with
optional features to keep a single static regset_info structure.

gdb/ChangeLog:

	* arch/aarch64.h (AARCH64_PAUTH_REGS_SIZE): New define.

gdb/gdbserver/ChangeLog:

	* linux-aarch64-low.c (aarch64_store_pauthregset): New function.
	* linux-low.c (regsets_store_inferior_registers): Allow optional reads
	to fail.
	* linux-low.h (enum regset_type): Add OPTIONAL_REGS.
2019-03-22 10:34:09 +00:00
Alan Hayward 76bed0fd94 AArch64: Read pauth registers
Initialise the pauth registers when creating a target description, and store
the regnum of the first pauth register.

Use ptrace to read the registers in the pauth feature.

Do not allow the registers to be written.

gdb/ChangeLog:

	* aarch64-linux-nat.c (fetch_pauth_masks_from_thread): New
	function.
	(aarch64_linux_nat_target::fetch_registers): Read pauth registers.
	* aarch64-tdep.c (aarch64_cannot_store_register): New function.
	(aarch64_gdbarch_init): Add puth registers.
	* aarch64-tdep.h (struct gdbarch_tdep): Add pauth features.
	* arch/aarch64.h (AARCH64_PAUTH_DMASK_REGNUM): New define.
	(AARCH64_PAUTH_CMASK_REGNUM): Likewise.
2019-03-22 10:31:02 +00:00
Alan Hayward ee4fbcfa26 AArch64: Use HWCAP to detect pauth feature
Add aarch64_get_hwcap functions for reading the HWCAP.
From this extract the PACA value and use this to enable pauth.

gdb/ChangeLog:

	* aarch64-linux-nat.c
	(aarch64_linux_nat_target::read_description): Read PACA hwcap.
	* aarch64-linux-tdep.c
	(aarch64_linux_core_read_description): Likewise.
	(aarch64_linux_get_hwcap): New function.
	* aarch64-linux-tdep.h (AARCH64_HWCAP_PACA): New define.
	(aarch64_linux_get_hwcap): New declaration.

gdb/gdbserver/ChangeLog:

	* linux-aarch64-low.c (AARCH64_HWCAP_PACA): New define.
	(aarch64_get_hwcap): New function.
	(aarch64_arch_setup): Read APIA hwcap.
2019-03-22 10:10:22 +00:00
Alan Hayward 6dc0ebde59 AArch64: Add pointer authentication feature
Pointer Authentication is a new feature in AArch64 v8.3-a. When enabled in
the compiler, function return addresses will be mangled by the kernel.

Add register description xml and wire up to aarch64_linux_read_description.
This description includes the two pauth user registers.

Nothing yet uses the feature - that is added in later patches.

gdb/ChangeLog:

	* aarch64-linux-nat.c
	(aarch64_linux_nat_target::read_description): Add pauth param.
	* aarch64-linux-tdep.c
	(aarch64_linux_core_read_description): Likewise.
	* aarch64-tdep.c (struct target_desc): Add in pauth.
	(aarch64_read_description): Add pauth param.
	(aarch64_gdbarch_init): Likewise.
	* aarch64-tdep.h (aarch64_read_description): Likewise.
	* arch/aarch64.c (aarch64_create_target_description): Likewise.
	* arch/aarch64.h (aarch64_create_target_description): Likewise.
	* features/Makefile: Add new files.
	* features/aarch64-pauth.c: New file.
	* features/aarch64-pauth.xml: New file.

gdb/doc/ChangeLog:

	* gdb.texinfo: Describe pauth feature.

gdb/gdbserver/ChangeLog:

	* linux-aarch64-ipa.c (get_ipa_tdesc): Add pauth param.
	(initialize_low_tracepoint): Likewise.
	* linux-aarch64-low.c (aarch64_arch_setup): Likewise.
	* linux-aarch64-tdesc-selftest.c (aarch64_tdesc_test): Likewise.
	* linux-aarch64-tdesc.c (struct target_desc): Likewise.
	(aarch64_linux_read_description): Likewise.
	* linux-aarch64-tdesc.h (aarch64_linux_read_description): Likewise.
2019-03-22 09:58:42 +00:00
Alan Hayward 968aa7ae38 Testsuite: Ensure pie is disabled on some tests
Recent versions of Ubuntu and Debian default GCC to enable pie.

In dump.exp, pie will causes addresses to be out of range for IHEX.

In break-interp.exp, pie is explicitly set for some tests and assumed
to be disabled for the remainder.

Ensure pie is disabled for these tests when required.

In addition, add a pie option to gdb_compile to match the nopie option
and simplify use.

gdb/testsuite/ChangeLog:

	* README: Add pie options.
	* gdb.base/break-interp.exp: Ensure pie is disabled.
	* gdb.base/dump.exp: Likewise.
	* lib/gdb.exp (gdb_compile): Add pie option.
2019-03-22 09:43:35 +00:00
GDB Administrator d8a95af9df Automatic date update in version.in 2019-03-22 00:00:37 +00:00
Jim Wilson a9f5a5517f RISC-V: Fix linker crash in section symbol check.
sym is only set for local symbols.  h is only set for global symbols.  Gas
won't let me create a global section symbol, but bfd appears to have some
support for that, and I can't rule out that other assemblers might do this.
So we need to support both, and verify sym and h are non-NULL before using.

	bfd/
	PR 24365
	* elfnn-riscv.c (riscv_elf_relocate_section): For STT_SECTION check,
	verify sym non-NULL before using.  Add identical check using h.
2019-03-21 15:16:19 -07:00
Sudakshina Das 4e5391148d [BFD, AArch64, x86] Improve warning for --force-bti
The AArch64 linker option to turn on BTI (--force-bti) warns in case there are
input objects which have a missing GNU NOTE section for BTI. This patch is trying
to improve the warnings that come out.

In order to do so, I propose adding a new argument to elf_merge_gnu_properties
and the backend function merge_gnu_properties. This new argument makes sure
that we now pass both the objects along with the properties to which they
belong to. The x86 backend function has also been updated to match this
change.

*** bfd/ChangeLog ***

2019-03-21  Sudakshina Das  <sudi.das@arm.com>

	* elf-bfd.h (struct elf_backend_data): Add argument to
	merge_gnu_properties.
	* elf-properties.c (elf_merge_gnu_properties): Add argument to
	itself and while calling bed->merge_gnu_properties.
	(elf_merge_gnu_property_list): Update the calls for
	elf_merge_gnu_properties.
	* elfnn-aarch64.c (elfNN_aarch64_merge_gnu_properties): Update handling
	of --force-bti warning and add argument.
	* elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Add
	warning.
	* elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Add argument.
	* elfxx-x86.h (_bfd_x86_elf_merge_gnu_properties): Likewise in
	declaration.

*** ld/ChangeLog ***

2019-03-21  Sudakshina Das  <sudi.das@arm.com>

	* testsuite/ld-aarch64/aarch64-elf.exp: Add new test.
	* testsuite/ld-aarch64/bti-plt-1.s: Add .ifdef for PAC note section.
	* testsuite/ld-aarch64/bti-plt-6.d: Update warning.
	* testsuite/ld-aarch64/bti-plt-7.d: Likewise.
	* testsuite/ld-aarch64/bti-warn.d: New test.
2019-03-21 16:20:21 +00:00
Alan Modra f84bd4655c Adjust pr14156 test for m68hc1*
The test section alignment is unnecessarily high, overflowing the
m68hc11 page used by .init code.

	* testsuite/ld-elf/fini2.s: Reduce alignment.
	* testsuite/ld-elf/fini3.s: Likewise.
	* testsuite/ld-elf/finin.s: Likewise.
	* testsuite/ld-elf/init2.s: Likewise.
	* testsuite/ld-elf/init3.s: Likewise.
	* testsuite/ld-elf/initn.s: Likewise.
	* testsuite/ld-elf/pr14156a.d: Don't xfail m68hc1*-* or xgate-*.
	* testsuite/ld-elf/pr14156b.d: Don't xfail xgate-*.
2019-03-21 22:19:51 +10:30
Alan Modra 2d3181c7c4 Add SORT_NONE to .init and .fini in scripts
The special case for .init and .fini in update_wild_statements is
ineffective for .init or .fini wildcards inside other output sections.
The special case needs to be on the wildcard, not the output section.
This patch is belt and braces, both fixing update_wild_statements and
the scripts.

	* scripttempl/alpha.sc, * scripttempl/armbpabi.sc,
	* scripttempl/crisaout.sc, * scripttempl/elf32cr16.sc,
	* scripttempl/elf32crx.sc, * scripttempl/elf32xc16x.sc,
	* scripttempl/elf32xc16xl.sc, * scripttempl/elf32xc16xs.sc,
	* scripttempl/elf64hppa.sc, * scripttempl/elf_chaos.sc,
	* scripttempl/elfarc.sc, * scripttempl/elfarcv2.sc,
	* scripttempl/elfd30v.sc, * scripttempl/elfm68hc11.sc,
	* scripttempl/elfm68hc12.sc, * scripttempl/elfm9s12z.sc,
	* scripttempl/elfmicroblaze.sc, * scripttempl/elfxgate.sc,
	* scripttempl/elfxtensa.sc, * scripttempl/epiphany_4x4.sc,
	* scripttempl/ft32.sc, * scripttempl/i386beos.sc,
	* scripttempl/iq2000.sc, * scripttempl/mcorepe.sc,
	* scripttempl/mep.sc, * scripttempl/mips.sc, * scripttempl/moxie.sc,
	* scripttempl/pe.sc, * scripttempl/pep.sc, * scripttempl/ppcpe.sc,
	* scripttempl/tic4xcoff.sc, * scripttempl/tic80coff.sc,
	* scripttempl/v850.sc, * scripttempl/v850_rh850.sc,
	* scripttempl/visium.sc, * scripttempl/xstormy16.sc: Add KEEP and
	SORT_NONE to .init and .fini wildcards.
	* scripttempl/elf32xc16x.sc,
	* scripttempl/elf32xc16xl.sc,
	* scripttempl/elf32xc16xs.sc: Add .fini wildcard.
	* scripttempl/elf_chaos.sc: Add .init output section.
	* scripttempl/elfd30v.sc: Remove duplicate .init.
	* scripttempl/elfm68hc11.sc, * scripttempl/elfm68hc12.sc,
	* scripttempl/elfm9s12z.sc, * scripttempl/elfxgate.sc: Remove
	duplicate .init, and add .fini wildcard.
	* scripttempl/ppcpe.sc (INIT, FINI): Delete.
	* ldlang.c (update_wild_statements): Special case .init and
	.fini in the wildcard, not the output section.
2019-03-21 22:19:20 +10:30
GDB Administrator cc00a5d100 Automatic date update in version.in 2019-03-21 00:00:28 +00:00
Alan Modra 980a2e42f7 lm32-linux ld testsuite fails
A number of the fails are due to ld supporting the creation of shared
libraries but not allowing linking against them without using an
option like -Bdynamic.
FAIL: Symbol export class test (final shared object)
FAIL: PROVIDE_HIDDEN test 4
FAIL: PROVIDE_HIDDEN test 6
FAIL: PROVIDE_HIDDEN test 10
FAIL: PROVIDE_HIDDEN test 12
FAIL: Build pr22471b.so
FAIL: Build pr22649-2b.so
FAIL: Build pr22649-2d.so
FAIL: PR ld/20828 dynamic symbols with section GC (plain)
FAIL: PR ld/20828 dynamic symbols with section GC (version script)
FAIL: PR ld/20828 dynamic symbols with section GC (versioned)
FAIL: PR ld/21233 dynamic symbols with section GC (--undefined)
FAIL: PR ld/21233 dynamic symbols with section GC (--require-defined)
FAIL: PR ld/21233 dynamic symbols with section GC (EXTERN)
FAIL: Build pr22150
FAIL: PR ld/14170
FAIL: Link using broken linker script
FAIL: pr17068 link --as-needed lib in group
FAIL: ld-gc/pr20022

	* emulparams/elf32lm32fd.sh (DYNAMIC_LINK): Undef.
2019-03-21 08:57:30 +10:30
Alan Modra 86b0c8dda0 Remove strip_underscore from struct emulation
This field is unused.  I would have liked to also remove
leading_underscore and fake_label_name but in an i386-elf/coff/aout
multi-obj setup those fields are used to select a different
fake_label_name for aout.

	* emul.h (struct emulation): Delete strip_underscore.
	* emul-target.h (emul_strip_underscore): Don't define.
	(emul_struct_name): Update initialization.
2019-03-21 08:50:24 +10:30
Alan Modra 7553c869a9 Teach a few targets to resolve BFD_RELOC_8
and tidy "forward" test.  I've removed some checks in d30v
md_apply_fix that have no business being there.  Any symbol problems
will be caught later in tc_gen_reloc, and overflow checking is done in
gas/write.c.

	* config/tc-d10v.c (md_apply_fix): Apply BFD_RELOC_8.
	* config/tc-pdp11.c (md_apply_fix): Likewise.
	* config/tc-d30v.c (md_apply_fix): Don't emit errors for BFD_RELOC_8,
	BFD_RELOC_16, and BFD_RELOC_64.
	* testsuite/gas/all/gas.exp: Move target exclusions for forward
	test, but not cr16, to..
	* testsuite/gas/all/forward.d: ..here, with explanation.  Remove
	d10v, d30v, and pdp11 xfails.
2019-03-21 08:46:42 +10:30
Alan Modra 3b6c196682 Fix some dlx fails
Generic linker ELF targets using CREATE_OBJECT_SYMBOLS in their
scripts run into a problem.  The file symbols are created by
_bfd_generic_link_output_symbols in each object file, in the section
corresponding to the CREATE_OBJECT_SYMBOLS section, typically .text.
If it so happens that the output .text section is stripped due to
being empty, then elf.c:assign_section_numbers won't assign an ELF
section number and swap_out_syms will report "unable to find
equivalent output section" for the object symbols.  Fix this by
always keeping an output section with CREATE_OBJECT_SYMBOLS.

	* ldlang.c (lang_size_sections_1): Set SEC_KEEP on
	create_object_symbols_section.
	* testsuite/ld-elf/pr22319.d: Don't xfail dlx.
2019-03-21 08:45:28 +10:30
Sudakshina Das acde6c6b43 [BFD, AArch64] Define elf_backend_fixup_gnu_properties in AArch64
This patch add support for elf_backend_fixup_gnu_properties for GNU
property support for AArch64. The new AArch64 specific definition
_bfd_aarch64_elf_link_fixup_gnu_properties goes through the property
list to find AArch64 type properties and removes the properties that
are marked as "property_remove".

*** bfd/ChangeLog ***

2019-03-20  Sudakshina Das  <sudi.das@arm.com>

	* elfxx-aarch64.c (_bfd_aarch64_elf_link_fixup_gnu_properties): Define.
	* elfxx-aarch64.h (_bfd_aarch64_elf_link_fixup_gnu_properties): Declare.
	(elf_backend_fixup_gnu_properties): Define for AArch64.
2019-03-20 18:00:07 +00:00
Tom Tromey 48869a5f9c Use @defvar to document gdb.pretty_printers
While referencing the manual, I noticed that gdb.pretty_printers
wasn't documented using @defvar.  This made it more difficult to find
in the info pages.  This patch adds the @defvar and also an
introductory paragraph in that node.

gdb/doc/ChangeLog
2019-03-20  Tom Tromey  <tromey@adacore.com>

	* python.texi (Selecting Pretty-Printers): Use @defvar for
	gdb.pretty_printers.
2019-03-20 11:28:44 -06:00
Tom Tromey 595915c1c1 Merge handle_inferior_event and handle_inferior_event_1
I noticed that handle_inferior_event is just a small wrapper that
frees the value chain.  This patch replaces it with a
scoped_value_mark, reducing the number of lines of code here.

Regression tested on x86-64 Fedora 29.

gdb/ChangeLog
2019-03-20  Tom Tromey  <tromey@adacore.com>

	* infrun.c (handle_inferior_event): Rename from
	handle_inferior_event_1.  Create a scoped_value_mark.
	(handle_inferior_event): Remove.
2019-03-20 11:09:10 -06:00
GDB Administrator e946b687ba Automatic date update in version.in 2019-03-20 00:00:30 +00:00
Tom Tromey 4c7d57e72e Don't show "display"s twice in MI
If you run "gdb -i=mi2" and set a "display", then when "next"ing the
displays will be shown twice:

    ~"1: x = 23\n"
    ~"7\t  printf(\"%d\\n\", x);\n"
    ~"1: x = 23\n"
    *stopped,reason="end-stepping-range",frame={addr="0x0000000000400565",func="main",args=[],file="q.c",fullname="/tmp/q.c",line="7"},thread-id="1",stopped-threads="all",core="1"

The immediate cause of this is this code in mi_on_normal_stop_1:

      print_stop_event (mi_uiout);

      console_interp = interp_lookup (current_ui, INTERP_CONSOLE);
      if (should_print_stop_to_console (console_interp, tp))
	print_stop_event (mi->cli_uiout);

... which obviously prints the stop twice.

However, I think the first call to print_stop_event is intended just
to emit the MI *stopped notification, which explains why the source
line does not show up two times.

This patch fixes the bug by changing print_stop_event to only call
do_displays for non-MI-like ui-outs.

Tested on x86-64 Fedora 29.

gdb/ChangeLog
2019-03-19  Tom Tromey  <tromey@adacore.com>

	* mi/mi-interp.c (mi_on_normal_stop_1): Only show displays once.
	* infrun.h (print_stop_event): Add "displays" parameter.
	* infrun.c (print_stop_event): Add "displays" parameter.

gdb/testsuite/ChangeLog
2019-03-19  Tom Tromey  <tromey@adacore.com>

	* gdb.mi/mi2-cli-display.c: New file.
	* gdb.mi/mi2-cli-display.exp: New file.
2019-03-19 12:16:48 -06:00
Pedro Alves cb24623460 Add comments describing tui_ui_out and its fields, cleanup a bit
This commit add comments describing tui_ui_out and its fields, and
cleans up the code a little bit.

Also switch to using in-class initialization so that the initial
values can be seen alongside the comments.

I see no reason for initializing m_line as -1 instead of 0, since all
the checks in the .c file are of the form "> 0".  AFAICS there's no
practical difference between -1 and 0.  So it seems simpler to
initialize it as 0.

There's a bit of redundancy in tui_ui_out::do_field_string, which is
fixed by this commit.

gdb/ChangeLog:
2019-03-19  Pedro Alves  <palves@redhat.com>

	* tui/tui-out.c (tui_ui_out::do_field_string): Simplify.
	(tui_ui_out::do_text): Add comments.  Reset M_LINE to 0 instead of
	to -1.  Fix TABs vs spaces.
	(tui_ui_out::tui_ui_out): Don't initialize fields here.
	* tui/tui-out.h (tui_ui_out) Add intro comments.
	<m_line, m_start_of_line>: In-class initialize, and add describing
	comment.
2019-03-19 18:08:27 +00:00
Nick Clifton 634557801d Prevent an illegal memory access by objdump when parsing a corrupt file on a 32-bit host.
PR 24360
	* objdump.c (load_specific_debug_section): Check that the amount
	of memory to be allocated matches the size of the section.
2019-03-19 13:39:30 +00:00
H.J. Lu 392a59728b x86: Correct EVEX vector load/store optimization
Update EVEX vector load/store optimization:

1. There is no need to check AVX since AVX2 is required for AVX512F.
2. We need to check both operands for ZMM register since AT&T syntax
may not set zmmword on the first operand.
3. Update Opcode_SIMD_IntD check and set.
4. Since the VEX prefix has 2 or 3 bytes, the EVEX prefix has 4 bytes,
EVEX Disp8 has 1 byte and VEX Disp32 has 4 bytes, we choose EVEX Disp8
over VEX Disp32.

	* config/tc-i386.c (optimize_encoding): Don't check AVX for
	EVEX vector load/store optimization.  Check both operands for
	ZMM register.  Update EVEX vector load/store opcode check.
	Choose EVEX Disp8 over VEX Disp32.
	* testsuite/gas/i386/optimize-1.d: Updated.
	* testsuite/gas/i386/optimize-1a.d: Likewise.
	* testsuite/gas/i386/optimize-2.d: Likewise.
	* testsuite/gas/i386/optimize-4.d: Likewise.
	* testsuite/gas/i386/optimize-5.d: Likewise.
	* testsuite/gas/i386/x86-64-optimize-2.d: Likewise.
	* testsuite/gas/i386/x86-64-optimize-2a.d: Likewise.
	* testsuite/gas/i386/x86-64-optimize-2b.d: Likewise.
	* testsuite/gas/i386/x86-64-optimize-3.d: Likewise.
	* testsuite/gas/i386/x86-64-optimize-5.d: Likewise.
	* testsuite/gas/i386/x86-64-optimize-6.d: Likewise.
	* testsuite/gas/i386/optimize-1.s: Add ZMM register load
	test.
	* testsuite/gas/i386/x86-64-optimize-2.s: Likewise.
2019-03-19 21:13:49 +08:00
H.J. Lu 7b1d7ca194 x86: Correct EVEX to 128-bit EVEX optimization
Since not all AVX512F processors support AVX512VL, we can optimize
512-bit EVEX to 128-bit EVEX encoding for upper 16 vector registers
only when AVX512VL is enabled explicitly at command-line or via
".arch .avx512vl" directive.

	PR gas/24352
	* config/tc-i386.c (optimize_encoding): Check only
	cpu_arch_flags.bitfield.cpuavx512vl.
	* testsuite/gas/i386/i386.exp: Run x86-64-optimize-2b.
	* testsuite/gas/i386/x86-64-optimize-2.d: Revert the last
	change.
	* testsuite/gas/i386/x86-64-optimize-2b.d: New file.
	* testsuite/gas/i386/x86-64-optimize-2b.s: Likewise.
2019-03-19 21:11:21 +08:00
H.J. Lu 89199bb5a0 ix86: Disable AVX512F when disabling AVX2
Since AVX2 is required for AVX512F, we should disable AVX512F when AVX2
is disabled.

gas/

	PR gas/24359
	* testsuite/gas/i386/i386.exp: Change optimize-6a, optimize-7,
	x86-64-optimize-7a and x86-64-optimize-8 tests to run_list_test.
	Remove optimize-6c and x86-64-optimize-7c tests.
	* testsuite/gas/i386/noavx-3.l: Updated.
	* testsuite/gas/i386/noavx-4.d: Likewise.
	* testsuite/gas/i386/noavx-5.d: Likewise.
	* testsuite/gas/i386/noavx-3.s: Add AVX512F tests.
	* testsuite/gas/i386/noavx-4.s: Remove AVX512F tests.
	* testsuite/gas/i386/nosse-5.s: Likewise.
	* testsuite/gas/i386/optimize-6a.d: Removed.
	* testsuite/gas/i386/optimize-6c.d: Likewise.
	* testsuite/gas/i386/optimize-7.d: Likewise.
	* testsuite/gas/i386/x86-64-optimize-7a.d: Likewise.
	* testsuite/gas/i386/x86-64-optimize-7c.d: Likewise.
	* testsuite/gas/i386/x86-64-optimize-8.d: Likewise.
	* testsuite/gas/i386/optimize-6a.l: New file.
	* testsuite/gas/i386/optimize-6a.s: Likewise.
	* testsuite/gas/i386/optimize-7.l: Likewise.
	* testsuite/gas/i386/x86-64-optimize-7a.l: Likewise.
	* testsuite/gas/i386/x86-64-optimize-7a.s: Likewise.
	* testsuite/gas/i386/x86-64-optimize-8.l: Likewise.

opcodes/

	PR gas/24359
	* i386-gen.c (cpu_flag_init): Add CPU_ANY_AVX512F_FLAGS to
	CPU_ANY_AVX2_FLAGS.
	* i386-init.h: Regenerated.
2019-03-19 21:08:31 +08:00