Commit Graph

98452 Commits

Author SHA1 Message Date
Alan Modra 89ebb345e7 gas "mbind sections" test
Doesn't fail on rx-elf

	* testsuite/gas/elf/section12a.d: Don't skip for rx.
2019-07-23 18:22:01 +09:30
Nick Clifton ac79ff9ed2 Add Changelog entry missing from previous delta.
2019-07-22  Barnaby Wilks  <barnaby.wilks@arm.com>

	* arm-dis.c (is_mve_unpredictable): Stop marking some MVE
	instructions as UNPREDICTABLE.
2019-07-23 09:47:06 +01:00
Omar Majid 1dd1bc4daf Allow objdump to recognise the System.Runtime.dll files that get shipped with .NET Core 2.1.
include	* coff/i386.h (IMAGE_FILE_MACHINE_NATIVE_APPLE_OVERRIDE): Define.
	(IMAGE_FILE_MACHINE_NATIVE_FREEBSD_OVERRIDE): Define.
	(IMAGE_FILE_MACHINE_NATIVE_LINUX_OVERRIDE): Define.
	(IMAGE_FILE_MACHINE_NATIVE_NETBSD_OVERRIDE): Define.
	(I386_APPLE_MAGIC): Define.
	(I386_FREEBSD_MAGIC): Define.
	(I386_LINUX_MAGIC): Define.
	(I386_NETBSD_MAGIC): Define.
	(I386BADMAG): Extend macro to allow new magic numbers.
	* coff/x86_64.h (IMAGE_FILE_MACHINE_NATIVE_APPLE_OVERRIDE): Define.
	(IMAGE_FILE_MACHINE_NATIVE_FREEBSD_OVERRIDE): Define.
	(IMAGE_FILE_MACHINE_NATIVE_LINUX_OVERRIDE): Define.
	(IMAGE_FILE_MACHINE_NATIVE_NETBSD_OVERRIDE): Define.
	(AMD64_APPLE_MAGIC): Define.
	(AMD64_FREEBSD_MAGIC): Define.
	(AMD64_LINUX_MAGIC): Define.
	(AMD64_NETBSD_MAGIC): Define.
	(AMD64BADMAG): Extend macro to allow new magic numbers.

bfd	* coffcode.h (coff_set_arch_mach_hook): Handle I386_APPLE_MAGIC,
	I386_FREEBSD_MAGIC, I386_LINUX_MAGIC, I386_NETBSD_MAGIC,
	AMD64_APPLE_MAGIC, AMD64_FREEBSD_MAGIC, AMD64_LINUX_MAGIC,
	AMD64_NETBSD_MAGIC.
	* peXXigen.c: Add comment about source of .NET magic numbers.

binutils* Makefile.am (AUTOMAKE_OPTIONS): Add subdir-objects
	(GENTESTDLLSPROG): Define.
	(TEST_PROGS): Add GENTESTDLLSPROG.
	* Makefile.in: Regenerate.
	* testsuite/binutils-all/objdump.exp
	(test_objdump_dotnet_assemblies): New proc.
	Run the new proc.
	* testsuite/gentestdlls.c: New source file.
2019-07-23 09:44:57 +01:00
Tom de Vries 5ba2943476 [gdb/testsuite] Fix command result testing in mi-complete.exp
When running gdb.mi/mi-complete.exp in conjunction with:
...
$ stress -c $(($(cat /proc/cpuinfo | grep -c "^processor") + 1))
...
we get less than 50% full passes:
...
$ for n in  $(seq 1 100); do \
    make V=1 -O check \
      'RUNTESTFLAGS=gdb.mi/mi-complete.exp --target_board=unix'; \
  done 2>&1 \
  | grep "expected passes" | sort | uniq -c
     45 # of expected passes            7
      9 # of expected passes            8
     46 # of expected passes            9
...

A diff between a passing and failing gdb.log shows this difference:
...
-&"set max-completions 1\n"
 2-complete br
+&"set max-completions 1\n"
...

The problem is that the test-case issues the "set max-completion <n>" command,
and without waiting for the output issues a next command, and tries to parse
the results of both commands, expecting a specific interleaving of the various
output streams.

Fix the FAIL by waiting for the result of the "set max-completion <n>" command
before issuing another command.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-07-23  Tom de Vries  <tdevries@suse.de>

	PR testsuite/24711
	* gdb.mi/mi-complete.exp: Wait for "set max-completions" result before
	issuing next command.
2019-07-23 10:38:33 +02:00
GDB Administrator 89356123a1 Automatic date update in version.in 2019-07-23 00:00:36 +00:00
Tom Tromey bfa2a36d94 Remove self-assign from make_invisible_and_set_new_height
In https://sourceware.org/ml/gdb-patches/2019-07/msg00509.html, Jan
pointed out that clang points out that
make_invisible_and_set_new_height self-assigns "height".

This patch fixes the bug by renaming the formal parameter.

gdb/ChangeLog
2019-07-22  Tom Tromey  <tom@tromey.com>

	* tui/tui-win.c (tui_win_info::make_invisible_and_set_new_height):
	Don't self-assign.
2019-07-22 08:34:25 -06:00
Srinath Parvathaneni 0c628bba5a Fixes the linker testcase "Secure gateway veneers:cmse functions debug information missing" which was failing due to output regular expression mismatch on arm-none-linux-gnueabihf targets.
* ld/testsuite/ld-arm/cmse_main_sec_debug.d: Modify regexps to
	allow for output from a arm-none-linux-gnueabihf target.
2019-07-22 14:46:11 +01:00
Barnaby Wilks 236ab0c60c This patch addresses the change in the June Armv8.1-M Mainline specification, that marks certain MVE instructions as no longer UNPREDICTABLE when a source operand is the same as a destination operand for a 32-bit element size.
The instructions that this change apply to are:

  VQDMLADH, VQRDMLADH, VQDMLSDH, VQRDMLSDH

The updated documentation is here: https://static.docs.arm.com/ddi0553/bh/DDI0553B_h_armv8m_arm.pdf

Fixed this by removing the check for this warning from GAS as well as opcodes.

Added testcases to test that the warning is not generated for the instructions that have a 32-bit element size
and the same source and destination operand. Also fixed tests that would previously check for this warning.

gas	* config/tc-arm.c (do_mve_vqdmladh): Remove check for UNPREDICTABLE.
	* testsuite/gas/arm/mve-vqdmladh-bad.l: Remove tests.
	* testsuite/gas/arm/mve-vqdmladh-bad.s: Remove tests.
	* testsuite/gas/arm/mve-vqdmladh.d: New tests.
	* testsuite/gas/arm/mve-vqdmladh.s: New tests.
	* testsuite/gas/arm/mve-vqdmlsdh-bad.l: Remove tests.
	* testsuite/gas/arm/mve-vqdmlsdh-bad.s: Remove tests.
	* testsuite/gas/arm/mve-vqdmlsdh.d: New tests.
	* testsuite/gas/arm/mve-vqdmlsdh.s: New tests.

opcodes	* arm-dis.c (is_mve_unpredictable): Stop marking some MVE
	instructions as UNPREDICTABLE.
2019-07-22 13:18:27 +01:00
Andrew Burgess a8e9d24718 gdb: Show type summary for anonymous structures from c_print_typedef
Currently each language has a la_print_typedef method, this is only
used for the "info types" command.

The documentation for "info types" says:

   Print a brief description of all types whose names match the regular
   expression @var{regexp} (or all types in your program, if you supply
   no argument).

However, if we consider this C code:

   typedef struct {
     int a;
   } my_type;

Then currently with "info types" this will be printed like this:

   3:      typedef struct {
       int a;
   } my_type;

I see two problems with this, first the indentation is clearly broken,
second, if the struct contained more fields then it feels like the
actual type names could easily get lost in the noise.

Given that "info types" is about discovering type names, I think there
is an argument to be made that we should focus on giving _only_ the
briefest summary for "info types", and if the user wants to know more
they can take the type name and plug it into "ptype".  As such, I
propose that a better output would be:

   3:      typedef struct {...} my_type;

The user understands that there is a type called `my_type`, and that
it's an alias for an anonymous structure type.

The change to achieve this turns out to be pretty simple, but only
effects languages that make use of c_print_typedef, which are C, C++,
asm, minimal, d, go, objc, and opencl.  Other languages will for now
do whatever they used to do.

The patch to change how anonymous structs are displayed also changes
the display of anonymous enums, consider this code sample:

   typedef enum {
     AA, BB, CC
   } anon_enum_t;

This used to be displayed like this:

   3:      typedef enum {AA, BB, CC} anon_enum_t;

Which will quickly become cluttered for enums with a large number of
values.  The modified output looks like this:

   3:      typedef enum {...} anon_enum_t;

Again, the user can always make use of ptype if they want to see the
details of the anon_enum_t type.

It is worth pointing out that this change (to use {...}) only effects
anonymous structs and enums, named types don't change with this patch,
consider this code:

   struct struct_t {
     int i;
   };
   enum enum_t {
    AA, BB, CC
   };

The output from 'info types' remains unchanged, like this:

   4:      enum enum_t;
   1:      struct struct_t;

An additional area of interest is how C++ handles anonymous types used
within a typedef; enums are handled basically inline with how C
handles them, but structs (and classes) are slightly different.  The
behaviour before the patch is different, and is unchanged by this
patch.  Consider this code compiled for C++:

   typedef struct {
     int i;
   } struct_t;

Both before and after this patch, this is show by 'info types' as:

   3:      typedef struct_t struct_t;

Unions are displayed similarly to structs in both C and C++, the
handling of anonymous unions changes for C in the same way that
it changes for anonymous structs.

I did look at ada, as this is the only language to actually have some
tests for "info types", however, as I understand it ada doesn't really
support typedefs, however, by forcing the language we can see what ada
would print.  So, if we 'set language ada', then originally we printed
this:

   3:      record
       a: int;
   end record

Again the indentation is clearly broken, but we also have no mention
of the type name at all, which is odd, but understandable given the
lack of typedefs.  If I make a similar change as I'm proposing for C,
then we now get this output:

   3:      record ... end record

Which is even less informative I think.  However, the original output
_is_ tested for in gdb.ada/info_auto_lang.exp, and its not clear to me
if the change is a good one or not, so for now I have left this out.

gdb/ChangeLog:

	* c-typeprint.c (c_print_typedef): Pass -1 instead of 0 to
	type_print.

gdb/testsuite/ChangeLog:

	* gdb.ada/info_auto_lang.exp: Update expected results.
	* gdb.base/info-types.c: Add additional types to check.
	* gdb.base/info-types.exp: Update expected results.
2019-07-22 10:43:03 +01:00
Andrew Burgess eb86c5e2e8 gdb: Improve output from "info types" commad
This commit makes two changes to the "info types" command:

First, only use typedef_print for printing typedefs, and use
type_print for printing non-typedef scalar (non-struct) types.  The
result of this is the output for builtin types goes from this:

    typedef double;
    typedef float;
    typedef int;

to this:

    double;
    float;
    int;

which seems to make more sense.

Next GDB no longer matches msymbols as possible type names.  When
looking for function symbols it makes sense to report matching
msymbols from the text sections, and for variables msymbols from the
data/bss sections, but when reporting types GDB would match msymbols
of type absolute.  But I don't see why these are likely to indicate
type names.  As such I've updated the msymbol matching lists in
symtab.c:search_symbols so that when searching in the TYPES_DOMAIN, we
never match any msymbols.

gdb/ChangeLog:

	* symtab.c (search_symbols): Adjust msymbol matching type arrays
	so that GDB doesn't match any msymbols when searching in the
	TYPES_DOMAIN.
	(print_symbol_info): Print using typedef_print or type_print based
	on the type of the symbol.  Add updated FIXME comment moved from...
	(_initialize_symtab): ... move and update FIXME comment to above.

gdb/testsuite/ChangeLog:

	* gdb.base/info-types.c: New file.
	* gdb.base/info-types.exp: New file.
2019-07-22 10:43:02 +01:00
Andrew Burgess a8eab7c6d5 gdb: Switch "info types" over to use the gdb::options framework
Adds a new -q flag to "info types" using the gdb::option framework.
This -q flag is similar to the -q flag already present for "info
variables" and "info functions".

gdb/ChangeLog:

	* NEWS: Mention adding -q option to "info types".
	* symtab.c (struct info_types_options): New struct.
	(info_types_options_defs): New variable.
	(make_info_types_options_def_group): New function.
	(info_types_command): Use gdb::option framework to parse options.
	(info_types_command_completer): New function.
	(_initialize_symtab): Extend the help text on "info types" and
	register command completer.

gdb/doc/ChangeLog:

	* gdb.texinfo (Symbols): Add information about -q flag to "info
	types".
2019-07-22 10:43:00 +01:00
Christian Biesinger b4603c3464 Add ChangeLog entry for the last commit
Forgot to commit before pushing :(
2019-07-21 22:27:07 -05:00
Christian Biesinger c32e6a04f4 Use block_enum instead of int for better typesafety
gdb/ChangeLog:

2019-07-21  Christian Biesinger  <cbiesinger@google.com>

	* symtab.c (lookup_symbol_in_objfile_symtabs): Change int to block_enum.
	(lookup_symbol_in_objfile): Change int to block_enum and add a
	gdb_assert to make sure block_index is GLOBAL_BLOCK or STATIC_BLOCK.
2019-07-21 22:23:12 -05:00
Christian Biesinger c8cdc1e083 [FYI] Add myself to gdb/MAINTAINERS
gdb/Changelog:

	* MAINTAINERS (Write After Approval): Add myself.
2019-07-21 22:00:22 -05:00
GDB Administrator 7fec04c365 Automatic date update in version.in 2019-07-22 00:00:29 +00:00
Kevin Buettner 86ceaf9867 Make documentation of "python" command match actual behavior
The example in the documentation for the "python" command shows GDB
outputting instructions for how to terminate a sequence of python
commands entered from the command line.  The documentation shows that
the following two lines are being output, though this does not occur
when actually using the "python" command from GDB:

    Type python script
    End with a line saying just "end".

While display of this text might be helpful, GDB has several other
commands which also use the "end" terminator that offer no such text.
Examples include the "if" and "while" commands.  For example,

(gdb) if 1==1
 >print "a"
 >end
$1 = "a"

This seems similar to doing:

(gdb) python
 >print 23
 >end
23

If we decide that we want the "python" command to print such a message,
we should also adjust the behavior for other GDB commands which also use
"end" to terminate a command list.  I.e, if this decision is made, the
"if" and "while" commands ought to also print similar messages.

So, for the moment anyway, this commit adjusts the documentation of the
python command to match its implementation.

This patch was taken from a larger body of work originating from the
Archer project.  I haven't been able to determine its original author,
though I did find a commit log from Jan Kratochvil (in the Archer
repository) which suggests that the change had originally been made to
gdb.texinfo, but got inadvertently dropped when the python related
documentation was split out to python.texi.

gdb/doc/ChangeLog:

	* python.texi (python command): Revise example to match
	command behavior.
2019-07-20 22:47:15 -07:00
GDB Administrator f720d67c59 Automatic date update in version.in 2019-07-21 00:00:45 +00:00
Alan Modra 9ab3a74416 PR24827, Linker loops forever if unterminated multi-line comment in script
YY_INPUT returns 0 on end of input, not EOF.

	PR 24827
	* ldlex.l (comment): Check for 0 return from input(), not EOF.
2019-07-20 10:55:16 +09:30
GDB Administrator bcbaec5c40 Automatic date update in version.in 2019-07-20 00:00:24 +00:00
Andrew Burgess 01e175fe1b gdb/riscv: Write 4-byte nop to dummy code region before inferior calls
When making inferior function calls GDB sets up a dummy code region on
the stack, and places a breakpoint within that region.  If the random
stack contents appear to be a compressed instruction then GDB  will
place a compressed breakpoint, which can cause problems if the target
doesn't support compressed instructions.

This commit prevents this issue by writing a 4-byte nop instruction to
the dummy region at the time the region is allocated.  With this nop
instruction in place, when we come to insert the breakpoint then an
uncompressed breakpoint will be used.

This is similar to other targets, for example mips.

gdb/ChangeLog:

	* riscv-tdep.c (riscv_push_dummy_code): Write a 4-byte nop
	instruction to the dummy code region.

gdb/testsuite/ChangeLog:

	* gdb.arch/riscv-bp-infcall.c: New file.
	* gdb.arch/riscv-bp-infcall.exp: New file.
2019-07-19 21:00:22 +01:00
H.J. Lu ec38ac465d x86: Pass -O0 to assembler in noextreg.d
* testsuite/gas/i386/noextreg.d: Pass -O0 to assembler.
2019-07-19 11:07:59 -07:00
Tom Tromey 56f79b6307 Change ARI to mention C++11, and remove some rules
I noticed that ARI mentions "ISO C 90", but now gdb uses C++11.  This
patch updates some text to reflect this change.

I also noticed that a few rules can be removed now.  ARGSUSED doesn't
seem to be an issue any more (there's no code mentioning this and I
doubt most of us even remember this convention); PARAMS was specific
to K&R C; and __func__ is available in C++11.

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

	* contrib/ari/gdb_ari.sh: Mention C++11, not ISO C 90.
	(ARGSUSED, PARAMS, __func__): Remove rules.
2019-07-19 09:37:00 -06:00
Alan Hayward 4c5aa8e0b1 Arm: Remove unused feature files and tests
Remove the xml tests. Now that it has been proven the new descriptions
are identical, there is no need to keep testing that.  Also, it would
prevent the old xml files from being removed.

Remove the old xml files from gdbserver and delete them.

gdb/ChangeLog:

	* arm-tdep.c (_initialize_arm_tdep): Remove xml tests.
	* features/arm/arm-with-iwmmxt.c: Remove.
	* features/arm/arm-with-iwmmxt.xml: Remove.
	* features/arm/arm-with-m-fpa-layout.c: Remove.
	* features/arm/arm-with-m-fpa-layout.xml: Remove.
	* features/arm/arm-with-m-vfp-d16.c: Remove.
	* features/arm/arm-with-m-vfp-d16.xml: Remove.
	* features/arm/arm-with-m.c: Remove.
	* features/arm/arm-with-m.xml: Remove.
	* features/arm/arm-with-neon.c: Remove.
	* features/arm/arm-with-neon.xml: Remove.
	* features/arm/arm-with-vfpv2.c: Remove.
	* features/arm/arm-with-vfpv2.xml: Remove.
	* features/arm/arm-with-vfpv3.c: Remove.
	* features/arm/arm-with-vfpv3.xml: Remove.

gdb/gdbserver/ChangeLog:

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

	* configure.srv: Remove Arm xml files.
2019-07-19 15:43:55 +01:00
Alan Hayward 7cc1743302 Arm: Use read_description funcs in gdbserver
Switch gdbserver over to using feature target descriptions.

Add a function for determining the type of a given target description,
and use where required.

gdb/gdbserver/ChangeLog:

	* configure.srv: Add new files. Remove xml generated files.
	* linux-aarch32-low.c (initialize_low_arch_aarch32): Don't init
	registers.
	* linux-aarch32-low.h (tdesc_arm_with_neon): Remove.
	* linux-aarch32-tdesc.c: New file.
	* linux-aarch32-tdesc.h: New file.
	* linux-aarch64-low.c (aarch64_arch_setup): Call aarch32_linux_read_description.
	* linux-arm-low.c (init_registers_arm, tdesc_arm)
	(init_registers_arm_with_iwmmxt, tdesc_arm_with_iwmmxt)
	(init_registers_arm_with_vfpv2, tdesc_arm_with_vfpv2)
	(init_registers_arm_with_vfpv3, tdesc_arm_with_vfpv3): Remove.
	(arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset)
	(arm_store_vfpregset): Call arm_linux_get_tdesc_fp_type.
	(arm_read_description): Call arm_linux_read_description.
	(initialize_low_arch): Don't init registers.
	* linux-arm-tdesc.c: New file.
	* linux-arm-tdesc.h: New file.
2019-07-19 15:43:49 +01:00
Alan Hayward f42b26179a Arm: Add xml unit tests
Use the record_xml_tdesc tests to prove the new target descriptions
are identical to the previous xml file ones.

This is tested as part of gdb.gdb/unittest.exp.

gdb/ChangeLog:

	* arm-tdep.c (_initialize_arm_tdep): Add xml regression tests.
2019-07-19 15:02:41 +01:00
Alan Hayward f29ec96643 Arm: Use feature target descriptions
In arm arm_create_target_description and
aarch32_create_target_description create feature based target descriptions
instead of returning the old style descriptions.

Ensure the descriptions are created in exactly the same way as the old xml
files.

Remove the old initialize calls.

gdb/ChangeLog:

	* arch/aarch32.c (aarch32_create_target_description): Create
	target descriptions using features.
	* arch/arm.c (arm_create_target_description)
	(arm_create_mprofile_target_description): Likewise.
	* arm-tdep.c (_initialize_arm_tdep): Remove tdesc init calls.
2019-07-19 15:01:11 +01:00
Alan Hayward d105cce5dd Arm: Add read_description read funcs and use in GDB
Switch the Arm target to get target descriptions via arm_read_description
and aarch32_read_description, in the same style as other feature targets.
Add an enum to specify the different types - this will also be of use to
gdbserver in a later patch.

Under the hood return the same existing pre-feature target descriptions.

gdb/ChangeLog:

	* Makefile.in: Add new files.
	* aarch32-tdep.c: New file.
	* aarch32-tdep.h: New file.
	* aarch64-linux-nat.c (aarch64_linux_nat_target::read_description):
	Call aarch32_read_description.
	* arch/aarch32.c: New file.
	* arch/aarch32.h: New file.
	* arch/arm.c (arm_create_target_description)
	(arm_create_mprofile_target_description): New function.
	* arch/arm.h (arm_fp_type, arm_m_profile_type): New enum.
	(arm_create_target_description)
	(arm_create_mprofile_target_description): New declaration.
	* arm-fbsd-tdep.c (arm_fbsd_read_description_auxv): Call
	read_description functions.
	* arm-linux-nat.c (arm_linux_nat_target::read_description):
	Likewise.
	* arm-linux-tdep.c (arm_linux_core_read_description): Likewise.
	* arm-tdep.c (tdesc_arm_list): New variable.
	(arm_register_g_packet_guesses): Call create description functions.
	(arm_read_description) (arm_read_mprofile_description): New
	function.
	* arm-tdep.h (arm_read_description)
	(arm_read_mprofile_description): Add declaration.
	* configure.tgt: Add new files.
2019-07-19 14:59:10 +01:00
Jose E. Marchesi 231097b03a cpu,opcodes,gas: use %r0 and %r6 instead of %a and %ctf in eBPF disassembler
This patch changes the eBPF CPU description to prefer the register
names %r0 and %r6 instead of %a and %ctx when disassembling.  This
matches better with the current practice, vs. cBPF.

It also updates the GAS tests in order to reflect this change.
Tested in a x86_64 host.

cpu/ChangeLog:

2019-07-19  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* bpf.cpu (h-gpr): when disassembling, use %r0 and %r6 instead of
	%a and %ctx.

opcodes/ChangeLog:

2019-07-19  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* bpf-desc.c: Regenerated.

gas/ChangeLog:

2019-07-19  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* testsuite/gas/bpf/alu.d: Use %r6 instead of %ctx.
	* testsuite/gas/bpf/lddw-be.d: Likewise.
	* testsuite/gas/bpf/lddw.d: Likewise.
	* testsuite/gas/bpf/alu-be.d: Likewise.
	* testsuite/gas/bpf/alu32.d: Likewise.
2019-07-19 15:35:43 +02:00
Jose E. Marchesi 1802aae844 gas: make .lcomm to accept an optional aligmnet in eBPF targets
Tested in a x86_64 host.

gas/ChangeLog:

2019-07-19  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* config/tc-bpf.c (pe_lcomm_internal): Adapted from tc-i386.c.
	(pe_lcomm): Likewise.
	(md_pseudo_table): Use pe_lcomm to implement .lcomm.
2019-07-19 15:35:02 +02:00
Richard Sandiford ccbdd22fb9 [AArch64] Rename +bitperm to +sve2-bitperm
After some discussion, we've decided to rename the +bitperm feature
flag to +sve2-bitperm, so that it's consistent with the other SVE2
feature flags.  The associated internal macros already used
"SVE2_BITPERM", so only the feature flag itself needs to change.

2019-07-19  Richard Sandiford  <richard.sandiford@arm.com>

gas/
	* doc/c-aarch64.texi: Remame the +bitperm extension to +sve2-bitperm.
	* config/tc-aarch64.c (aarch64_features): Likewise.
	* testsuite/gas/aarch64/illegal-sve2-aes.d: Update accordingly.
	* testsuite/gas/aarch64/illegal-sve2-sha3.d: Likewise.
	* testsuite/gas/aarch64/illegal-sve2-sm4.d: Likewise.
	* testsuite/gas/aarch64/illegal-sve2.d: Likewise.
	* testsuite/gas/aarch64/sve2.d: Likewise.
2019-07-19 12:18:02 +01:00
Alan Modra c213164ad2 [PowerPC64] pc-relative TLS relocations
This patch supports using pcrel instructions in TLS code sequences.  A
number of new relocations are needed, gas operand modifiers to
generate those relocations, and new TLS optimisation.  For
optimisation it turns out that the new pcrel GD and LD sequences can
be distinguished from the non-pcrel GD and LD sequences by there being
different relocations on the new sequence.  The final "add ra,rb,13"
on IE sequences similarly needs a new relocation, or as I chose, a
modification of R_PPC64_TLS.  On pcrel IE code, the R_PPC64_TLS points
one byte into the "add" instruction rather than being on the
instruction boundary.

GD:
 pla 3,z@got@tlsgd@pcrel	  # R_PPC64_GOT_TLSGD34
 bl __tls_get_addr@notoc(z@tlsgd) # R_PPC64_TLSGD and R_PPC64_REL24_NOTOC
  edited to IE
   pld 3,z@got@tprel@pcrel
   add 3,3,13
  edited to LE
   paddi 3,13,z@tprel
   nop

LD:
 pla 3,z@got@tlsld@pcrel	  # R_PPC64_GOT_TLSLD34
 bl __tls_get_addr@notoc(z@tlsld) # R_PPC64_TLSLD and R_PPC64_REL24_NOTOC
 ..
 paddi 9,3,z2@dtprel
 pld 10,z3@got@dtprel@pcrel
 add 10,10,3
  edited to LE
   paddi 3,13,0x1000
   nop

IE:
 pld 9,z@got@tprel@pcrel	  # R_PPC64_GOT_TPREL34
 add 3,9,z@tls@pcrel		  # R_PPC64_TLS at insn+1
 ldx 4,9,z@tls@pcrel
 lwax 5,9,z@tls@pcrel
 stdx 5,9,z@tls@pcrel
  edited to LE
  paddi 9,13,z@tprel
  nop
  ld 4,0(9)
  lwa 5,0(9)
  std 5,0(9)

LE:
 paddi 10,13,z@tprel

include/
	* elf/ppc64.h (R_PPC64_TPREL34, R_PPC64_DTPREL34),
	(R_PPC64_GOT_TLSGD34, R_PPC64_GOT_TLSLD34),
	(R_PPC64_GOT_TPREL34, R_PPC64_GOT_DTPREL34): Define.
	(IS_PPC64_TLS_RELOC): Include new tls relocs.
bfd/
	* reloc.c (BFD_RELOC_PPC64_TPREL34, BFD_RELOC_PPC64_DTPREL34),
	(BFD_RELOC_PPC64_GOT_TLSGD34, BFD_RELOC_PPC64_GOT_TLSLD34),
	(BFD_RELOC_PPC64_GOT_TPREL34, BFD_RELOC_PPC64_GOT_DTPREL34),
	(BFD_RELOC_PPC64_TLS_PCREL): New pcrel tls relocs.
	* elf64-ppc.c (ppc64_elf_howto_raw): Add howtos for pcrel tls relocs.
	(ppc64_elf_reloc_type_lookup): Translate pcrel tls relocs.
	(must_be_dyn_reloc, dec_dynrel_count): Add R_PPC64_TPREL64.
	(ppc64_elf_check_relocs): Support pcrel tls relocs.
	(ppc64_elf_tls_optimize, ppc64_elf_relocate_section): Likewise.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.
gas/
	* config/tc-ppc.c (ppc_elf_suffix): Map "tls@pcrel", "got@tlsgd@pcrel",
	"got@tlsld@pcrel", "got@tprel@pcrel", and "got@dtprel@pcrel".
	(fixup_size, md_assemble): Handle pcrel tls relocs.
	(ppc_force_relocation, ppc_fix_adjustable): Likewise.
	(md_apply_fix, tc_gen_reloc): Likewise.
ld/
	* testsuite/ld-powerpc/tlsgd.d,
	* testsuite/ld-powerpc/tlsgd.s,
	* testsuite/ld-powerpc/tlsie.d,
	* testsuite/ld-powerpc/tlsie.s,
	* testsuite/ld-powerpc/tlsld.d,
	* testsuite/ld-powerpc/tlsld.s: New tests.
	* testsuite/ld-powerpc/powerpc.exp: Run them.
2019-07-19 18:01:25 +09:30
Alan Modra 7a70898417 [PowerPC] Rename testcase
Just making room for a new tlsld test.

	* testsuite/ld-powerpc/tlsldopt.d: Rename from tlsld.d.
	* testsuite/ld-powerpc/tlsldopt.s: Rename from tlsld.s.
	* testsuite/ld-powerpc/tlsldopt32.d: Rename from tlsld32.d.
	* testsuite/ld-powerpc/tlsldopt32.s: Rename from tlsld32.s.
	* testsuite/ld-powerpc/powerpc.exp: Update.
2019-07-19 18:01:25 +09:30
Alan Modra 88468fe096 Re: ld -r: Don't merge with member of output section group
PR 24819
	* testsuite/ld-elf/pr24819.d: xfail for genelf targets.
2019-07-19 18:01:25 +09:30
GDB Administrator 6cbb8e87ee Automatic date update in version.in 2019-07-19 00:00:39 +00:00
Nick Alcock 12a0b67d28 libctf: introduce ctf_func_type_{info,args}, ctf_type_aname_raw
The first two of these allow you to get function type info and args out
of the types section give a type ID: astonishingly, this was missing
from libctf before now: so even though types of kind CTF_K_FUNCTION were
supported, you couldn't find out anything about them.  (The existing
ctf_func_info and ctf_func_args only allow you to get info about
functions in the function section, i.e. given symbol table indexes, not
type IDs.)

The second of these allows you to get the raw undecorated name out of
the CTF section (strdupped for safety) without traversing subtypes to
build a full C identifier out of it.  It's useful for things that are
already tracking the type kind etc and just need an unadorned name.

include/
	* ctf-api.h (ECTF_NOTFUNC): Fix description.
	(ctf_func_type_info): New.
	(ctf_func_type_args): Likewise.
libctf/
	* ctf-types.c (ctf_type_aname_raw): New.
	(ctf_func_type_info): Likewise.
	(ctf_func_type_args): Likewise.
	* ctf-error.c (_ctf_errlist): Fix description.
2019-07-18 20:53:57 +01:00
Guillaume LABARTHE afe09f0b63 Fix for using named pipes on Windows
On Windows, passing a named pipe as terminal argument to the new-ui
command does not work.

The problem is that the new_ui_command function in top.c opens the
same tty three times, for stdin, stdout and stderr.  With Windows
named pipes, the second and third calls to open fail.

Opening the file only once and passing the same stream for stdin,
stdout and stderr makes it work.

Pedro says:

 I tried it on GNU/Linux and things still work.
 I ran all the MI tests with forced new-ui, with:

 $ make check TESTS="gdb.mi/*.exp" RUNTESTFLAGS="FORCE_MI_SEPARATE_UI=1"

 and saw no regressions.

gdb/ChangeLog:
2019-07-18  Guillaume LABARTHE  <guillaume.labarthe@gmail.com>

	* top.c (new_ui_command): Open specified terminal just once.
2019-07-18 17:20:04 +01:00
Tom Tromey cd215b2eb7 Constify main_name
This patch constifies the return type of main_name.  There is a
comment indicating that this wasn't possible at some point in the
past, but whatever the barrier was, it is gone now.

Tested by rebuilding.

gdb/ChangeLog
2019-07-18  Tom Tromey  <tromey@adacore.com>

	* symtab.c (main_name): Constify return type.
	* symfile.c (set_initial_language): Update.
	* symtab.h (main_name): Constify return type.
2019-07-18 09:31:12 -06:00
H.J. Lu 54d7dae59a ld -r: Don't merge with member of output section group
When doing a relocatable link, members of input section group are
placed in their own output sections.  We need to make sure that no
input sections are merged with member of output section group.

	PR ld/24819
	* emultempl/elf32.em (elf_orphan_compatible): Return FALSE for
	member of output section group when doing a relocatable link.
	* testsuite/ld-elf/pr24819.d: New file.
	* testsuite/ld-elf/pr24819.s: Likewise.
2019-07-18 08:01:54 -07:00
Alan Modra 71c4e95abe [PowerPC64] Use STN_UNDEF internally for edited relocs
It's not correct to use non-STT_TLS symbols with TLS relocation, not
that it matters much when editing relocs, but this edited reloc can be
output by --emit-relocs.  So don't use a symbol on the reloc.

	* elf64-ppc.c (ppc64_elf_relocate_section): Don't bother selecting
	a TLS section symbol for edited relocs.  Tighten TLS symbol/reloc
	match test.
2019-07-18 22:17:30 +09:30
Alan Modra 46e9995a20 [PowerPC64] Don't store TLS_EXPLICIT in tls_mask
This saves a bit in tls_mask, and fixes a bug that could be triggered
in the unlikely case that both @got (usual ELF style) and @toc
(PowerOpen style) code was used to set up args for __tls_get_addr.

	* elf64-ppc.c (TLS_EXPLICIT): Define as 256.
	(ppc64_elf_check_relocs): Don't store TLS_EXPLICIT even if char
	is more than 8 bits.
	(ppc64_elf_tls_optimize): Likewise.  Make tls_set, tls_clear, and
	tls_type vars unsigned int.
	(ppc64_elf_relocate_section): Use r_type rather than TLS_EXPLICIT
	to select r_type edit.
2019-07-18 22:17:30 +09:30
Alan Modra b00a0a86c4 [PowerPC] Rename TLS_TPRELGD to TLS_GDIE
Choose a better name, that reflects why the flag is set (GD to IE
optimisation) rather than what the flag produces (TPREL64 reloc on
a single GOT entry replacing a tls_index pair).

	* elf32-ppc.c (TLS_GDIE): Rename from TLS_TPRELGD throughout file.
	Correct comment.
	* elf64-ppc.c (TLS_GDIE): Likewise.
2019-07-18 22:17:30 +09:30
Alan Modra 0b1474281c [PowerPC64] correct tprel offset limit
I don't expect anyone will have hit this bug.  You'd need a TLS
segment of 2G before you'd notice.

	* elf64-ppc.c (ppc64_elf_tls_optimize): Correct test for allowed
	range of tp-relative offsets.
2019-07-18 22:17:29 +09:30
Jose E. Marchesi d0044bac9e gas: .lcomm gets an alignment argument in eBPF
gas/ChangeLog:

2019-07-17  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* config/tc-bpf.c: Make .lcomm to get a third argument with the
	alignment.
2019-07-18 13:12:33 +02:00
GDB Administrator f264fab3cd Automatic date update in version.in 2019-07-18 00:00:14 +00:00
Jose E. Marchesi e0b989a6d7 gas: support .half, .word and .dword directives in eBPF
This little patch adds support to the eBPF port of GAS for a few data
directives.  The names for the directives have been chosen to be
coherent with the suffixes used in eBPF instructions: b, h, w and dw
for 8, 16, 32 and 64-bit values respectively.

Documentation and tests included.
Tested in a x86_64 host.

gas/ChangeLog:

2019-07-17  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* config/tc-bpf.c (md_pseudo_table): .half, .word and .dword.
	* testsuite/gas/bpf/data.s: New file.
	* testsuite/gas/bpf/data.d: Likewise.
	* testsuite/gas/bpf/data-be.d: Likewise.
	* testsuite/gas/bpf/bpf.exp: Run data and data-be.
	* doc/c-bpf.texi (BPF Directives): New section.
2019-07-17 22:57:23 +02:00
Tom Tromey d8f68fcb93 Remove unnecessary "return"s
The TUI has some "return;" statements at the end of void-returning
functions.  There's no need for these, so this patch removes them.

gdb/ChangeLog
2019-07-17  Tom Tromey  <tom@tromey.com>

	* tui/tui-winsource.c (tui_update_source_window)
	(tui_update_source_window_as_is)
	(tui_update_source_windows_with_line): Remove return.
	* tui/tui-disasm.c (tui_show_disassem)
	(tui_show_disassem_and_update_source): Remove return.
	* tui/tui.c (tui_reset): Remove return.
	* tui/tui-wingeneral.c
	(tui_check_and_display_highlight_if_needed): Remove return.
2019-07-17 12:19:26 -06:00
Tom Tromey ca5af91ed2 Fix an error in parse_scrolling_args
parse_scrolling_args combines two errors into one message, which also
happens to end with a newline.  This separates the errors and fixes
the message.

gdb/ChangeLog
2019-07-17  Tom Tromey  <tom@tromey.com>

	* tui/tui-win.c (parse_scrolling_args): Throw separate errors.
2019-07-17 12:19:25 -06:00
Tom Tromey 5104fe361d Move source window common to code to tui-winsource.[ch]
Like the previous rearranging patches, this moves the source and
disassembly window base class code to tui-winsource.[ch].  The
execution info window is also moved, because it is associated with
this base class.

gdb/ChangeLog
2019-07-17  Tom Tromey  <tom@tromey.com>

	* tui/tui-winsource.h (struct tui_exec_info_window)
	(struct tui_source_window_base): Move from tui-data.h.
	* tui/tui-winsource.c: Move many method definitions from
	elsewhere.  Remove "structuring" comments.
	* tui/tui-wingeneral.c (tui_source_window_base::make_visible)
	(tui_source_window_base::refresh_window): Move to
	tui-winsource.c.
	* tui/tui-win.c (tui_source_window_base::refresh_all)
	(tui_source_window_base::update_tab_width)
	(tui_source_window_base::set_new_height)
	(tui_source_window_base::do_make_visible_with_new_height): Move to
	tui-winsource.c.
	* tui/tui-source.h: Update.
	* tui/tui-source.c (tui_source_window_base::reset): Move to
	tui-winsource.c.
	* tui/tui-disasm.h: Update.
	* tui/tui-data.h (struct tui_exec_info_window): Move to
	tui-winsource.h.
	(struct tui_source_window_base): Likewise.
	* tui/tui-data.c (tui_source_window_base::clear_detail)
	(tui_source_window_base, ~tui_source_window_base): Move to
	tui-winsource.c.
2019-07-17 12:19:25 -06:00
Tom Tromey daa15dde72 Change make_invisible_and_set_new_height to be a method
This changes make_invisible_and_set_new_height to be a method on
tui_win_info.  I felt that this was cleaner.

gdb/ChangeLog
2019-07-17  Tom Tromey  <tom@tromey.com>

	* tui/tui-win.c (tui_resize_all)
	(tui_source_window_base::update_tab_width)
	(tui_adjust_win_heights): Update.
	(tui_win_info::make_invisible_and_set_new_height): Rename from
	make_invisible_and_set_new_height.
	* tui/tui-data.h (struct tui_win_info)
	<make_invisible_and_set_new_height>: New method.
2019-07-17 12:19:24 -06:00
Tom Tromey bfad453707 Move tui_source_window to tui-source.h
This moves tui_source_window to tui-source.h.  In this case there were
no method definitions to be moved.

gdb/ChangeLog
2019-07-17  Tom Tromey  <tom@tromey.com>

	* tui/tui.c: Update.
	* tui/tui-source.h (struct tui_source_window): Move from
	tui-data.h.
	* tui/tui-layout.c: Update.
	* tui/tui-disasm.c: Update.
	* tui/tui-data.h (struct tui_source_window): Move to
	tui-source.h.
2019-07-17 12:19:24 -06:00