Commit Graph

94748 Commits

Author SHA1 Message Date
Alan Hayward 12863263d6 Rename tdesc_register_size to tdesc_register_bitsize
tdesc_register_size returns number of bits, not bytes.
Rename to make it clearer.

Also, fixed bug in aarch64_get_tdesc_vq which assumed bytes.

gdb/
	* target-descriptions.c (tdesc_register_bitsize): Rename.
	* target-descriptions.h (tdesc_register_bitsize): Likewise.
	* rs6000-tdep.c (rs6000_gdbarch_init): Use new name.
	* aarch64-tdep.c (aarch64_get_tdesc_vq): Convert size.
2018-07-11 10:00:14 +01:00
Jan Beulich a79eaed6a5 x86: adjust monitor/mwait templates
Architecturally, MONITOR's and MONITORX'es memory operand is a 16- or
32-bit register outside of 64-bit mode, and a 64- or 32-bit register
inside 64-bit mode. The other register operands, including all of them
for MWAIT and MWAITX, are uniformly 32-bit, irrespective of mode. Retain
the original 64-bit MONITOR{,X} templates for compatibility only, and
fold the MWAIT{,X} ones.
2018-07-11 10:30:00 +02:00
Jan Beulich 2fb5be8dac x86: drop {,reg16_}inoutportreg variables
The checking against reg16_inoutportreg can be had with a simple test of
a bit, and the value setting from inoutportreg can be replaced by using
the actual register's reg_type field.

Note that the so far redundant 2nd instance of OPERAND_TYPE_INOUTPORTREG
is left in place, for its use in type_names[].
2018-07-11 10:28:56 +02:00
Jan Beulich bd59a6313d x86: simplify legacy prefix emission
The check_prefix label was bogus from the beginning: The special
checking is supposed to happen for PadLock insns only; no
3-opcode-byte insn should go this path.
2018-07-11 10:28:16 +02:00
Jan Beulich 7f5cad3047 x86/Intel: accept memory operand size specifiers for CET insns 2018-07-11 10:25:40 +02:00
Jan Beulich f0a85b0706 x86: replace off-by-one OTMax
With its name it should equal to the largest prior enumerator, which is
not very helpful as that will change every once in a while. Rename it to
OTNum instead to make name and value match, and correct use sites to no
longer use one too large a value.
2018-07-11 10:24:44 +02:00
Jan Beulich 76d3a78a49 x86: fix "REP RET" with -madd-bnd-prefix
Just like any other branches, RET should gain a BND prefix also when
already prefixed in source by REP.
2018-07-11 10:23:48 +02:00
Alan Modra c7df3df443 Revise "ld testsuite use of notarget"
git commit 624940689a wrongly changed fill.d and fill16.d notarget
entries to xfail, so revert that change and instead replace notarget
with skip.  The two tests are complementary.

This patch also modifies the pr20022 test to use .data, avoiding
xfails on targets that complain about dynamic relocations in .text.
This shows a bug in metag which discards section _foo in pr2022.so.

	* testsuite/ld-elf/hash.d: Comment on mips xfail.
	* testsuite/ld-gc/pr20022b.s: Use .data not .text.
	* testsuite/ld-gc/pr20022.d: Remove xfails.
	* testsuite/ld-scripts/fill.d: Revert most of last patch, but use
	skip rather than notarget.
	* testsuite/ld-scripts/fill16.d: Likewise.
2018-07-11 16:39:04 +09:30
Tom Tromey 1123588c0b Use std::vector for moribund_locations
This changes moribund_locations to use a std::vector rather than VEC.
I also noticed that moribund_locations is only used in breakpoint.c,
so now it is static as well.

It might be possible to make this code a bit simpler by using a
ref_ptr in moribund_locations; however, I have not done this.

Tested by the buildbot.

gdb/ChangeLog
2018-07-10  Tom Tromey  <tom@tromey.com>

	* breakpoint.c (moribund_locations): Now static and a
	std::vector.
	(breakpoint_init_inferior, moribund_breakpoint_here_p)
	(build_bpstat_chain, update_global_location_list)
	(breakpoint_retire_moribund): Update.
	* breakpoint.h (bp_location_p): Remove typedef.  Don't declare
	VEC.
2018-07-10 19:41:05 -06:00
GDB Administrator 71feec8213 Automatic date update in version.in 2018-07-11 00:00:50 +00:00
Maciej W. Rozycki 500c05ddbe MIPS/ld/testsuite: Limit export class call reloc tests to DSO targets
Only run MIPS/LD export class call relocation tests with shared library
targets, avoiding:

.../ld/ld-new: -shared not supported

linker errors and removing:

FAIL: MIPS export class call relocation test (o32)

regressions with `mipsel-ps2-elf' and `mips64el-ps2-elf' targets.

	ld/
	* testsuite/ld-mips-elf/mips-elf.exp: Limit export class call
	relocation tests to shared library targets.
2018-07-11 00:57:36 +01:00
Maciej W. Rozycki 5270eddc6e BFD/ELF: Correct a `remove' global shadowing error for pre-4.8 GCC
Remove `-Wshadow' compilation errors:

cc1: warnings being treated as errors
.../bfd/elflink.c: In function 'bfd_elf_final_link':
.../bfd/elflink.c:11722: error: declaration of 'remove' shadows a global declaration
/usr/include/stdio.h:154: error: shadowed declaration is here

which for versions of GCC before 4.8 prevent support for ELF targets
from being built.  See also GCC PR c/53066.

	bfd/
	* elflink.c (bfd_elf_final_link): Rename `remove' local variable
	to `remove_section'.
2018-07-11 00:42:43 +01:00
Alan Modra be570f0684 xgate testsuite fixes
binutils/
	* testsuite/lib/binutils-common.exp (supports_gnu_unique): Return
	zero for xgate.
ld/
	* testsuite/lib/ld-lib.exp (check_gc_sections_available): Return 0
	for xgate.
	* testsuite/ld-elf/elf.exp: Add xgate to pr21703 xfails.
	* testsuite/ld-elf/shared.exp: Add xgate to pr21703 xfails.
	* testsuite/ld-discard/extern.d: xfail xgate.
	* testsuite/ld-discard/start.d: Likewise.
	* testsuite/ld-discard/static.d: Likewise.
	* testsuite/ld-elf/attributes.d: Likewise.
	* testsuite/ld-elf/compressed1d.d: Likewise.
	* testsuite/ld-elf/group1.d: Likewise.
	* testsuite/ld-elf/group3b.d: Likewise.
	* testsuite/ld-elf/group8a.d: Likewise.
	* testsuite/ld-elf/group8b.d: Likewise.
	* testsuite/ld-elf/group9a.d: Likewise.
	* testsuite/ld-elf/group9b.d: Likewise.
	* testsuite/ld-elf/linkonce2.d: Likewise.
	* testsuite/ld-elf/merge.d: Likewise.
	* testsuite/ld-elf/merge2.d: Likewise.
	* testsuite/ld-elf/merge3.d: Likewise.
	* testsuite/ld-elf/orphan-10.d: Likewise.
	* testsuite/ld-elf/orphan-9.d: Likewise.
	* testsuite/ld-elf/orphan-region.d: Likewise.
	* testsuite/ld-elf/orphan.d: Likewise.
	* testsuite/ld-elf/orphan3.d: Likewise.
	* testsuite/ld-elf/pr12851.d: Likewise.
	* testsuite/ld-elf/pr12975.d: Likewise.
	* testsuite/ld-elf/pr13177.d: Likewise.
	* testsuite/ld-elf/pr13195.d: Likewise.
	* testsuite/ld-elf/pr14156b.d: Likewise.
	* testsuite/ld-elf/pr17550c.d: Likewise.
	* testsuite/ld-elf/pr17550d.d: Likewise.
	* testsuite/ld-elf/pr17615.d: Likewise.
	* testsuite/ld-elf/pr20528a.d: Likewise.
	* testsuite/ld-elf/pr20528b.d: Likewise.
	* testsuite/ld-elf/pr21562a.d: Likewise.
	* testsuite/ld-elf/pr21562b.d: Likewise.
	* testsuite/ld-elf/pr21562c.d: Likewise.
	* testsuite/ld-elf/pr21562d.d: Likewise.
	* testsuite/ld-elf/pr21562i.d: Likewise.
	* testsuite/ld-elf/pr21562j.d: Likewise.
	* testsuite/ld-elf/pr21562k.d: Likewise.
	* testsuite/ld-elf/pr21562l.d: Likewise.
	* testsuite/ld-elf/pr21562m.d: Likewise.
	* testsuite/ld-elf/pr21562n.d: Likewise.
	* testsuite/ld-elf/pr22677.d: Likewise.
	* testsuite/ld-elf/pr22836-1a.d: Likewise.
	* testsuite/ld-elf/pr22836-1b.d: Likewise.
	* testsuite/ld-elf/pr349.d: Likewise.
	* testsuite/ld-elf/warn1.d: Likewise.
	* testsuite/ld-elf/warn2.d: Likewise.
	* testsuite/ld-elf/warn3.d: Likewise.
2018-07-10 23:59:59 +09:30
Alan Modra 1594e052d4 xgate cleanup
elf32-xgate.c contains many functions that are only stubs and
elf32-xgate.h contains unused declarations.  While this might be
reasonable for the initial commit of a port with subsequent work
fleshing out the stubs, xgate has only had two minor target specific
patches since the initial commit over six years ago.  The rest of the
changes have been general maintenance work applied to all ELF targets,
and some of this work could have been avoided if the stubs hadn't been
there.  So this patch removes all the stubs.

I've kept the functionality of the old elf32_xgate_add_symbol_hook,
implemented in elf32_xgate_backend_symbol_processing.  Presumably,
that's to set the symbol st_target_internal flag for use in
elf32-m68hc1x.c:elf32_m68hc11_relocate_section.

The empty elf32_xgate_relocate_section meant that xgate had no linker.
Or at least, no linker relocation processing.  Deleting the
elf_backend_relocate_section define means the target will now use the
generic linker reloc processing.  How good that is will depend on the
accuracy of the reloc howtos..

I haven't updated the ld testsuite to xfail tests expected to fail
for generic elf targets.

bfd/
	* elf32-xgate.h: Delete.
	* elf32-xgate.c: Delete unnecessary forward declarations, add two
	that are now needed.
	(xgate_elf_bfd_link_hash_table_create)
	(xgate_elf_bfd_link_hash_table_free)
	(xgate_elf_set_mach_from_flags, struct xgate_scan_param)
	(stub_hash_newfunc, elf32_xgate_add_symbol_hook)
	(elf32_xgate_setup_section_lists, elf32_xgate_size_stubs)
	(elf32_xgate_build_stubs, elf32_xgate_check_relocs)
	(elf32_xgate_relocate_section, _bfd_xgate_elf_set_private_flags)
	(elf32_xgate_post_process_headers): Delete.
	(elf32_xgate_backend_symbol_processing): New function.
	(xgate_elf_ignore_reloc, xgate_elf_special_reloc)
	(_bfd_xgate_elf_print_private_bfd_data): Make static.
	(ELF_TARGET_ID, elf_info_to_howto, elf_backend_check_relocs)
	(elf_backend_relocate_section, elf_backend_object_p)
	(elf_backend_final_write_processing, elf_backend_can_gc_sections)
	(elf_backend_post_process_headers, elf_backend_add_symbol_hook)
	(bfd_elf32_bfd_link_hash_table_create)
	(bfd_elf32_bfd_set_private_flags)
	(xgate_stub_hash_lookup): Don't define.
	(elf_backend_symbol_processing): Define.
	* elf-bfd.h (elf_target_id): Delete XGATE_ELF_DATA.
ld/
	* emulparams/xgateelf.sh (TEMPLATE_NAME) Set to generic.
	(EXTRA_EM_FILE): Set to genelf.
2018-07-10 23:59:07 +09:30
Alan Modra 624940689a ld testsuite use of notarget
Much of the time it is better to use xfail rather than notarget to
hide a testsuite failure no one is planning on fixing.

1) When a target is fixed, an inappropriate xfail results in XPASS
   whereas notarget is silent.  Leaving in an inappropriate notarget
   entry risks the bug reappearing later, silently.
2) Tests might be used as a template for a new test, carrying over
   notarget and/or xfail.  Inappropriate notarget entries are silent.
3) An xfailed test that mysteriously XPASSes might actually indicate a
   bug.

	* testsuite/ld-elf/attributes.d: Use xfail rather than notarget.
	* testsuite/ld-elf/hash.d: Likewise.
	* testsuite/ld-elf/orphan-10.d: Likewise.
	* testsuite/ld-elf/overlay.d: Likewise.
	* testsuite/ld-elf/pr14926.d: Likewise.
	* testsuite/ld-elf/pr17550d.d: Likewise.
	* testsuite/ld-elf/pr19539.d: Likewise.
	* testsuite/ld-elf/pr22319.d: Likewise.
	* testsuite/ld-misc/defsym1.d: Likewise.
	* testsuite/ld-pe/pr19803.d: Likewise.
	* testsuite/ld-scripts/assign-loc.d: Likewise.
	* testsuite/ld-scripts/defined4.d: Likewise.
	* testsuite/ld-scripts/empty-address-1.d: Likewise.
	* testsuite/ld-scripts/empty-address-2a.d: Likewise.
	* testsuite/ld-scripts/empty-address-2b.d: Likewise.
	* testsuite/ld-scripts/fill.d: Likewise.
	* testsuite/ld-scripts/fill16.d: Likewise.
	* testsuite/ld-scripts/pr14962.d: Likewise.
	* testsuite/ld-scripts/pr14962-2.d: Likewise.
	* testsuite/ld-unique/pr21529.d: Likewise.
	* testsuite/ld-elf/compress1a.d: Likewise, and adjust targets.
	* testsuite/ld-elf/compressed1a.d: Likewise.
	* testsuite/ld-elf/compressed1d.d: Likewise.
	* testsuite/ld-elf/compressed1e.d: Likewise.
	* testsuite/ld-elf/eh5.d: Likewise.
	* testsuite/ld-elf/group8a.d: Likewise.
	* testsuite/ld-elf/linkonce2.d: Likewise.
	* testsuite/ld-elf/orphan-9.d: Likewise.
	* testsuite/ld-elf/pr17550a.d: Likewise.
	* testsuite/ld-elf/pr17550b.d: Likewise.
	* testsuite/ld-elf/pr17550c.d: Likewise.
	* testsuite/ld-elf/pr19162.d: Likewise.
	* testsuite/ld-elf/pr21884.d: Likewise.
	* testsuite/ld-gc/pr19167.d: Likewise.
	* testsuite/ld-gc/pr20022.d: Likewise.
	* testsuite/ld-gc/start.d: Likewise.
	* testsuite/ld-elf/orphan-11.d: Delete notarget.
	* testsuite/ld-elf/orphan-12.d: Likewise.
	* testsuite/ld-gc/stop.d: Likewise.
	* testsuite/ld-scripts/empty-address-3a.d: Likewise.
	* testsuite/ld-scripts/empty-address-3b.d: Likewise.
	* testsuite/ld-ifunc/pr17154-x86-64-now.d: Delete duplicate notarget.
	* testsuite/ld-scripts/section-match-1.d: Comment fix.
2018-07-10 23:58:29 +09:30
Andrew Burgess 3541979fff gdb/testsuite: Run test with software and hardware watchpoints
Expand the gdb.base/watchpoint-reuse-slot.exp test to be run twice,
once with hardware watchpoints disabled (this is new) and then with
hardware watchpoints enabled (the old way).

Running with hardware watchpoints enabled is skipped if the board file
says that hardware watchpoints are not supported on this target.

gdb/testsuite/ChangeLog:

	* gdb.base/watchpoint-reuse-slot.exp: Test with hardware
	watchpoints enabled and disabled.
2018-07-10 14:47:38 +01:00
Andrew Burgess 8c49aa89ab gdb/riscv: Fix assertion in inferior call code
An assertion when setting up arguments for an inferior call checks the
size of the argument against xlen.  However, if xlen and flen are
different sizes, and the argument is being placed into a floating
pointer register then we should be comparing against flen not xlen.

This issue shows up as an assertion failure when running on an rv32g
target with a binary compiled using the rv32f abi and making an
inferior call involving large floating point arguments, for example
the test gdb.base/infcall-nested-structs.exp.

gdb/ChangeLog:

	* riscv-tdep.c (riscv_is_fp_regno_p): New function.
	(riscv_register_reggroup_p): Use new function, remove unneeded
	parenthesis.
	(riscv_push_dummy_call): Extend assert to compare against xlen or
	flen based on register type.
2018-07-10 12:46:56 +01:00
Andrew Burgess 42ecac1732 gdb/riscv: Use TYPE_SAFE_NAME
In debug printing, use TYPE_SAFE_NAME instead of replicating the
functionality using TYPE_NAME and a null check.

gdb/ChangeLog:

	* riscv-tdep.c (riscv_print_arg_location): Use TYPE_SAFE_NAME.
2018-07-10 12:46:56 +01:00
Maciej W. Rozycki 7153abac62 MIPS/LD/testsuite: Make Linux dumps for n64 GOT relocation tests the default
The current default dumps for n64 GOT relocation tests only work for
IRIX targets really, while the Linux dumps are suitable for non-Linux
targets as well.  Make the Linux dumps the default then and handle the
IRIX ones as a special case.

Define an `irix' variable as a shorthand for `[istarget *-*-irix*]' and
use it for these n64 GOT relocation tests as well as export class call
relocation tests.

	ld/
	* testsuite/ld-mips-elf/elf-rel-got-n64.d: Rename to...
	* testsuite/ld-mips-elf/elf-rel-got-n64-irix.d: ... this.
	* testsuite/ld-mips-elf/elf-rel-got-n64-linux.d: Rename to...
	* testsuite/ld-mips-elf/elf-rel-got-n64.d: ... this.
	* testsuite/ld-mips-elf/elf-rel-xgot-n64.d: Rename to...
	* testsuite/ld-mips-elf/elf-rel-xgot-n64-irix.d: ... this.
	* testsuite/ld-mips-elf/elf-rel-xgot-n64-linux.dd: Rename to...
	* testsuite/ld-mips-elf/elf-rel-xgot-n64.d: ... this.
	* testsuite/ld-mips-elf/mips-elf.exp: Update accordingly.
	Define `irix' as a shorthand for `[istarget *-*-irix*]' and use
	it throughout.
2018-07-10 01:28:46 +01:00
GDB Administrator aa4bd7e6ae Automatic date update in version.in 2018-07-10 00:00:35 +00:00
Cary Coutant c3c5e48680 Fix test for availability of emplace_back.
Testing for the GCC version 5 or later isn't right, since C++ 11 support
wasn't enabled by default until later.  This patch tests the C++ standard
support directly instead of inferring it from the GCC version.

gold/
	* incremental.cc (Sized_incremental_binary::setup_readers): Use
	emplace_back for C++ 11 or later.
2018-07-09 16:12:27 -07:00
Maciej W. Rozycki 8d4c0995eb MIPS/LD/testsuite: Fix IRIX dumps for n64 GOT relocation tests
Factor in the presence of a `.gnu.attributes' section at the end of the
respective dumps:

Disassembly of section .gnu.attributes:

0000000000000000 <.gnu.attributes>:
   0:	41000000 	bc0f	4 <__dso_displacement+0x4>
   4:	0f676e75 	jal	d9db9d4 <__dso_displacement+0xd9db9d4>
   8:	00010000 	sll	zero,at,0x0
   c:	00070401 	0x70401

and also ignore any trailing output with the IRIX variant of n64 GOT
relocation tests, like already done with the Linux and the embedded
ones, removing:

FAIL: MIPS ELF got reloc n64
FAIL: MIPS ELF xgot reloc n64

LD testsuite regressions with the `mips-sgi-irix6' target.

	ld/
	* testsuite/ld-mips-elf/elf-rel-got-n64.d: Add `#pass' at the
	end.
	* testsuite/ld-mips-elf/elf-rel-xgot-n64.d: Likewise.
2018-07-09 23:43:27 +01:00
Maciej W. Rozycki 4b8377e7db MIPS/BFD: Do not redirect to discarded lazy binding stubs
Correct a MIPS/BFD linker issue with dynamic symbol and corresponding
GOT entry values being redirected to lazy binding stubs where the stubs
section has been discarded by assigning to the `/DISCARD/' output
section in the linker script used.  The issue manifests itself by the
values entered being relative to the absolute section, which is what any
discarded sections are internally assigned in the linker.

For the `stub-dynsym-2.s' piece of code included as a test case with
this change this issue results in the dynamic symbol table and the GOT
looking like:

Symbol table '.dynsym' contains 3 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 00000010     0 FUNC    GLOBAL DEFAULT  UND bar
     2: 00000000     0 FUNC    GLOBAL DEFAULT  UND foo

Primary GOT:
 Canonical gp value: 00097ff0

 Reserved entries:
   Address     Access  Initial Purpose
  00090000 -32752(gp) 00000000 Lazy resolver
  00090004 -32748(gp) 80000000 Module pointer (GNU extension)

 Global entries:
   Address     Access  Initial Sym.Val. Type    Ndx Name
  00090008 -32744(gp) 00000010 00000010 FUNC    UND bar
  0009000c -32740(gp) 00000000 00000000 FUNC    UND foo

if assembled to regular MIPS code, or:

Symbol table '.dynsym' contains 3 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 0000000d     0 FUNC    GLOBAL DEFAULT  UND bar
     2: 00000001     0 FUNC    GLOBAL DEFAULT  UND foo

Primary GOT:
 Canonical gp value: 00097ff0

 Reserved entries:
   Address     Access  Initial Purpose
  00090000 -32752(gp) 00000000 Lazy resolver
  00090004 -32748(gp) 80000000 Module pointer (GNU extension)

 Global entries:
   Address     Access  Initial Sym.Val. Type    Ndx Name
  00090008 -32744(gp) 0000000d 0000000d FUNC    UND bar
  0009000c -32740(gp) 00000001 00000001 FUNC    UND foo

if assembled to microMIPS code.  Symbol values and GOT entries record
the offset into the inexistent stubs section and the ISA bit rather than
zero, which would be the case if a lazy binding stub was not used for
other reasons, such as the value of the symbol being taken for a purpose
other than making a function call (e.g. an R_MIPS_GOT16 relocation).

Correct the issue by refraining from redirecting symbols to lazy binding
stubs if the stubs section is going to be discarded.

	bfd/
	* elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Don't set
	`->needs_lazy_stub' if the stubs output section is the absolute
	section.

	ld/
	* testsuite/ld-mips-elf/stub-dynsym-2.dd: New test.
	* testsuite/ld-mips-elf/stub-dynsym-2.gd: New test.
	* testsuite/ld-mips-elf/stub-dynsym-2.sd: New test.
	* testsuite/ld-mips-elf/stub-dynsym-discard-2.gd: New test.
	* testsuite/ld-mips-elf/stub-dynsym-discard-2.sd: New test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-2.dd: New test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-2.gd: New test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-2.sd: New test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-2.dd: New
	test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-2.gd: New
	test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-2.sd: New
	test.
	* testsuite/ld-mips-elf/stub-dynsym-2.ld: New test linker
	script.
	* testsuite/ld-mips-elf/stub-dynsym-discard-2.ld: New test
	linker script.
	* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
2018-07-09 21:30:44 +01:00
Andrew Burgess 055303e28f gdb: Use add_setshow_zuinteger_unlimited_cmd in remote.c
Switch to use add_setshow_zuinteger_unlimited_cmd for some of the
control variables in remote.c.  The variables
hardware-watchpoint-limit, hardware-breakpoint-limit, and
hardware-watchpoint-length-limit are all changed.  For example, a user
will now see this:

    (gdb) show remote hardware-breakpoint-limit
    The maximum number of target hardware breakpoints is unlimited.

Instead of this:

    (gdb) show remote hardware-breakpoint-limit
    The maximum number of target hardware breakpoints is -1.

And can do this:

    (gdb) set remote hardware-breakpoint-limit unlimited

However, previously any negative value implied "unlimited", now only
-1, or the text "unlimited" can be used for unlimited.  Any other
negative value will give an error about invalid input.  This is a
small change in the user interface, but, hopefully, this will not
cause too many problems.

I've also added show functions for these three variables to allow for
internationalisation.

gdb/ChangeLog:

	* remote.c (show_hardware_watchpoint_limit): New function.
	(show_hardware_watchpoint_length_limit): New function.
	(show_hardware_breakpoint_limit): New function.
	(_initialize_remote): Use add_setshow_zuinteger_unlimited_cmd
	where appropriate, update help text.

gdb/doc/ChangeLog:

	* gdb.texinfo (Remote Configuration): Update descriptions for
	set/show of hardware-watchpoint-limit, hardware-breakpoint-limit,
	and hardware-watchpoint-length-limit variables.
2018-07-09 18:07:01 +01:00
Jeff Law 2af4d0d938 * testsuite/nds32/ji-jr.d: Fix name tag. 2018-07-09 10:35:12 -06:00
Maciej W. Rozycki 8a8c916960 LD/testsuite: run_dump_test: Report UNSUPPORTED for excluded targets
Bring the LD implementation of `run_dump_test' in line with its binutils
and GAS counterparts and report the UNSUPPORTED status for tests the run
of which has been prevented by means of one or more of `target',
`alltargets' and `notarget' tags.  Define `skip', `anyskip' and `noskip'
tags, which do not report anything for tests that are not run.

The rationale behind this is that we want to have unsupported tests
reported to ensure that they have actually been attempted and have not
been accidentally suppressed.  Then tests which have target-specific
variants that cannot be expressed with a single .d file can make use of
the newly added tags to silently suppress the uninteresting variants.

	ld/
	* testsuite/lib/ld-lib.exp (run_dump_test): Call `unsupported'
	if the target being tested has been excluded by means of one or
	more of `target', `alltargets' and `notarget' tags.  Add support
	for `skip', `anyskip' and `noskip' tags.
2018-07-09 15:50:57 +01:00
Maciej W. Rozycki 8f7fc65182 LD/testsuite: run_dump_test: Use the intended test name ASAP
Bring the LD implementation of `run_dump_test' in line with its binutils
and GAS counterparts and use the intended test name, from the `name' tag
if set, for test status reporting as soon as it is available.

	ld/
	* testsuite/lib/ld-lib.exp (run_dump_test): Move the setting of
	`testname' earlier on and use it for test status reporting.
2018-07-09 15:50:57 +01:00
Maciej W. Rozycki 9dcb0ba445 S12Z/opcodes: Correct a `reg' global shadowing error for pre-4.8 GCC
Remove `-Wshadow' compilation errors:

cc1: warnings being treated as errors
.../opcodes/s12z-dis.c: In function 'lea_reg_xys_opr':
.../opcodes/s12z-dis.c:814: error: declaration of 'reg' shadows a global declaration
.../opcodes/s12z-dis.c:783: error: shadowed declaration is here
.../opcodes/s12z-dis.c: In function 'lea_reg_xys':
.../opcodes/s12z-dis.c:843: error: declaration of 'reg' shadows a global declaration
.../opcodes/s12z-dis.c:783: error: shadowed declaration is here
.../opcodes/s12z-dis.c: In function 'print_insn_loop_primitive':
.../opcodes/s12z-dis.c:2206: error: declaration of 'reg' shadows a global declaration
.../opcodes/s12z-dis.c:783: error: shadowed declaration is here

which for versions of GCC before 4.8 prevent support for S12Z targets
from being built.  See also GCC PR c/53066.

	opcodes/
	* s12z-dis.c (lea_reg_xys_opr): Rename `reg' local variable to
	`reg_xys'.
	(lea_reg_xys): Likewise.
	(print_insn_loop_primitive): Rename `reg' local variable to
	`reg_dxy'.
2018-07-09 15:50:57 +01:00
Andrew Burgess c8ad9b9a31 gdb/testsuite: Allow for failure to read some memory addresses
In the gdb.base/examine-backward.exp test script, we check to see if
address zero is readable, and then read memory first forward from
address zero, and then backward from address zero.

The problem is, being able to read address zero does not guarantee
that you'll be able to read from the other end of the address space,
and the test probably shouldn't assume that is the case.

This patch updates the test script so that even if address zero is
known non-readable, we still run the tests, the tests in question are
mostly about, can GDB calculate the correct address to read from, we
can confirm this even if the final read ultimately fails.  We also no
longer assume that if address zero is readable, then the other end of
the address space will be readable.

One further change is that, when we examined the memory at address
zero, the regexp used to match the address expected that the zero
address would have two '0' digits as the least significant digits.  As
GDB strips leading zeros from addresses this was causing the test to
fail.  I've reduced the zero address to a single 0 digit.

gdb/testsuite/ChangeLog:

	* gdb.base/examine-backward.exp: Still run tests around address
	0x0, even if address 0x0 is not readable.  Update the pattern for
	matching address 0x0 in expected output.
2018-07-09 15:08:20 +01:00
Tom Tromey 8fd32c1ce6 Don't mention XM_CDEPS or NAT_CLIBS
Neither XM_CDEPS nor NAT_CLIBS are defined anywhere, so remove the
uses.

gdb/ChangeLog
2018-07-09  Tom Tromey  <tom@tromey.com>

	* Makefile.in (CDEPS): Don't mention XM_CDEPS.
	(CLIBS): Don't mention NAT_CLIBS.
2018-07-09 08:03:49 -06:00
Tom Tromey 31278b5193 Remove ADD_FILES and ADD_DEPS from Makefile.in
Nothing defines XM_ADD_FILES, TM_ADD_FILES, or NAT_ADD_FILES any more,
so consequently ADD_FILES and ADD_DEPS are no longer needed.  So, this
removes them.

gdb/ChangeLog
2018-07-09  Tom Tromey  <tom@tromey.com>

	* Makefile.in (ADD_FILES, ADD_DEPS): Remove.
	(LIBGDB_OBS, clean mostlyclean): Update.
	(gdb$(EXEEXT), insight$(EXEEXT)): Update.
2018-07-09 08:03:49 -06:00
Tom Tromey e5fd1493fd Minimize yacc and lex output
This minimizes the "make" output from the yacc and lex rules,
following the same technique as the rest of the Makefile.

The lex rule had a special case to deal with the situation where flex
is not available.  I don't think this is needed, so I removed it.  If
flex is truly unavailable, the person building gdb can simply "touch"
the output file.

gdb/ChangeLog
2018-07-09  Tom Tromey  <tom@tromey.com>

	* Makefile.in (%.c: %.y): Use ECHO_YACC.
	(%.c: %.l): Use ECHO_LEX.  Just fail if flex not available.
	* silent-rules.mk (ECHO_YACC, ECHO_LEX): New variables.
2018-07-09 08:03:49 -06:00
Tom Tromey 981e0c0c1a Fix exec.c handling in Makefile
exec.c ws handled specially in COMMON_OBS, but there doesn't seem to
be a reason for this.  This changes the Makefile to treat exec.c as an
ordinary source file.

gdb/ChangeLog
2018-07-09  Tom Tromey  <tom@tromey.com>

	* Makefile.in (ALLDEPFILES): Remove exec.c.
	(COMMON_OBS): Remove exec.o.
	(COMMON_SFILES): Add exec.c.
2018-07-09 08:03:49 -06:00
Tom Tromey 14ccceb2e2 Remove lint support
I don't think anyone uses lint any more, so this removes the support
for it from the Makefile.

gdb/ChangeLog
2018-07-09  Tom Tromey  <tom@tromey.com>

	* Makefile.in (LINT, LINTFLAGS, LINTFILES, lint): Remove.
2018-07-09 08:03:49 -06:00
Tom Tromey 5d3c3a68c3 Use a stamp file for version.c
This introduces a stamp file for version.c, preventing unnecessary
version.o rebuilds.

gdb/ChangeLog
2018-07-09  Tom Tromey  <tom@tromey.com>

	* Makefile.in (clean mostlyclean): Remove stamp-version.
	(version.c): Depend on stamp-version.
	(stamp-version): New rule, from version.c rule.
2018-07-09 08:03:49 -06:00
Tom Tromey 1998086d54 Use a stamp file for init.c
This introduces a stamp file for init.c.  This prevents constant
rebuilds of init.o, by arranging for init.c to only be modified when
its contents change.  (FWIW this is a standard idiom in use by
Automake and by gdb itself for many years.)

gdb/ChangeLog
2018-07-09  Tom Tromey  <tom@tromey.com>

	* Makefile.in (init.c): Depend on stamp-init.
	(stamp-init): New rule, from init.c rule.
	(clean mostlyclean): Remove stamp-init.
2018-07-09 08:03:49 -06:00
Tom Tromey 4c7549492b Simplify INIT_FILES
This simplifies the INIT_FILES variable.  COMMON_OBS includes
CONFIG_OBS and SUBDIR_GCC_COMPILE_OBS, so there's no need to reference
CONFIG_OBS or SUBDIR_GCC_COMPILE_SRCS there.  Once this is done, it it
clear that duplicates can't occur, so remove the duplicate-removing
code as well.

gdb/ChangeLog
2018-07-09  Tom Tromey  <tom@tromey.com>

	* Makefile.in (INIT_FILES): Remove CONFIG_SRCS,
	SUBDIR_GCC_COMPILE_SRCS.
2018-07-09 08:03:49 -06:00
Tom Tromey 6497f1dd03 Remove some unused code from init.c build rule
The init.c build rule has a few sed expressions that aren't necessary
any more.  This removes them.

gdb/ChangeLog
2018-07-09  Tom Tromey  <tom@tromey.com>

	* Makefile.in (init.c): Remove some unused sed rules.
2018-07-09 08:03:49 -06:00
Tom Tromey 97a34db942 Remove TSOBS from gdb/Makefile.in
The TSOBS variable doesn't seem to serve a useful purpose in
gdb/Makefile.in, so remove it.

gdb/ChangeLog
2018-07-09  Tom Tromey  <tom@tromey.com>

	* Makefile.in (TSOBS): Remove.
	(INIT_FILES): Update.
	(LIBGDB_OBS): Update.
	(COMMON_SFILES): Add inflow.c.
	(SFILES): Remove inflow.c.
2018-07-09 08:03:48 -06:00
H.J. Lu 872899f1ef bfd: Use changequote for "i[3-7]86-*-linux-*"
Use changequote to match "i[3-7]86-*-linux-*", instead of
"i3-786-*-linux-*".

	PR ld/23388
	* configure.ac: Use changequote for "i[3-7]86-*-linux-*".
	* configure: Regenerated.
2018-07-09 06:51:17 -07:00
Alan Modra 61658d78f0 m68hc1* fixes
With config.sub now properly returning m68hc12-unknown-elf rather than
m68hc12-unknown-none, more ELF tests run.  This patch enables
STB_GNU_UNIQUE processing fixing some testsuite failures that probably
no m68hc12 user cares about, and removes some XPASSes.

bfd/
	* elf32-m68hc1x.c (elf32_m68hc11_post_process_headers): Call
	_bfd_elf_post_process_headers.
ld/
	* testsuite/ld-discard/extern.d: Remove m68hc12 xfail.
	* testsuite/ld-discard/start.d: Likewise.
	* testsuite/ld-discard/static.d: Likewise.
2018-07-09 17:27:35 +09:30
Christophe Lyon f5a1cdde80 [ARM] Fix warning cannot find thumb start symbol
In case params.thumb_entry_symbol has its default NULL value, using it
to print a warning in gld${EMULATION_NAME}_finish results in a crash.

Use h->root.string instead which either points to
params.thumb_entry_symbol name or to entry_symbol name.

2018-07-09  Christophe Lyon  <christophe.lyon@linaro.org>

	* emultempl/armelf.em (gld${EMULATION_NAME}_finish): Use the right
	symbol name in case of warning.

Change-Id: Iec61a833c0ad538b1440bf326ba67834c314dd63
2018-07-09 07:47:24 +00:00
GDB Administrator dc7fc9ab5d Automatic date update in version.in 2018-07-09 00:00:48 +00:00
GDB Administrator a47a3dc8fb Automatic date update in version.in 2018-07-08 00:01:00 +00:00
Jan Kratochvil 25289ac167 contrib/gdb-add-index.sh -dwarf-5
------------------------------------------------------------------------------
(gdb) help save gdb-index
Save a gdb-index file.
Usage: save gdb-index [-dwarf-5] DIRECTORY

No options create one file with .gdb-index extension for pre-DWARF-5
compatible .gdb_index section.  With -dwarf-5 creates two files with
extension .debug_names and .debug_str for DWARF-5 .debug_names section.
------------------------------------------------------------------------------

But gdb-add-index command provided no way how to pass the -dwarf-5 option.

gdb/ChangeLog
2018-07-07  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* contrib/gdb-add-index.sh ($dwarf5): New, use it.
2018-07-07 23:02:36 +02:00
Simon Marchi e83f4d9750 ia64-tdep.c: Fix -Wwrite-strings errors
Simply add const where necessary to get rid of errors like:

/home/simark/src/binutils-gdb/gdb/ia64-libunwind-tdep.c:114:1: error: ISO C++ forbids converting a string constant to ‘char*’ [-Werror=write-strings]
 static char *get_reg_name = STRINGIFY(UNW_OBJ(get_reg));
 ^~~~~~~~~~~~~~
/home/simark/src/binutils-gdb/gdb/common/preprocessor.h:28:25: note: in definition of macro ‘STRINGIFY_1’
 #define STRINGIFY_1(x) #x
                         ^
/home/simark/src/binutils-gdb/gdb/ia64-libunwind-tdep.c:114:29: note: in expansion of macro ‘STRINGIFY’
 static char *get_reg_name = STRINGIFY(UNW_OBJ(get_reg));
                             ^~~~~~~~~

gdb/ChangeLog:

	* ia64-tdep.c (get_reg_name, get_fpreg_name, get_saveloc_name,
	is_signal_frame_name, step_name, init_remote_name,
	create_addr_space_name, destroy_addr_space_name,
	search_unwind_table_name, find_dyn_list_name): Constify.
2018-07-07 11:14:57 -04:00
GDB Administrator 674e55f7b1 Automatic date update in version.in 2018-07-07 00:00:46 +00:00
Max Filippov c451bb34ae xtensa: don't emit dynamic relocation for weak undefined symbol
Resolved reference to a weak undefined symbol in PIE must not have
a dynamic relative relocation against itself, otherwise the value of a
reference will be changed from 0 to the base of executable, breaking
code like the following:

  void weak_function (void);
  if (weak_function)
    weak_function ();

This fixes tests for PR ld/22269 and a number of PIE tests in xtensa gcc
testsuite.

bfd/
2018-07-06  Max Filippov  <jcmvbkbc@gmail.com>

	* elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Don't allocate
	space for dynamic relocation for undefined weak symbol.
	(elf_xtensa_relocate_section): Don't emit R_XTENSA_RELATIVE
	relocation for undefined weak symbols.
	(shrink_dynamic_reloc_sections): Don't shrink dynamic relocation
	section for relocations against undefined weak symbols.
2018-07-06 16:05:49 -07:00
Alan Hayward ad1cc4e492 Add checks for the NT_ARM_SVE section in a core file.
The NT_ARM_SVE section is documented here:
  https://github.com/torvalds/linux/blob/master/Documentation/arm64/sve.txt
  * A NT_ARM_SVE note will be added to each coredump for each thread of the
   dumped process.  The contents will be equivalent to the data that would have
   been read if a PTRACE_GETREGSET of NT_ARM_SVE were executed for each thread
   when the coredump was generated.

	* elf.c (elfcore_grok_aarch_sve): New function.
	(elfcore_grok_note): Check for Aarch64 SVE.
	(elfcore_write_aarch_sve): New function.
	(elfcore_write_register_note): Check for Aarch64 SVE.
	* elf-bfd.h(elfcore_grok_aarch_sve): New declaration.
2018-07-06 16:25:21 +01:00
Tamar Christina f311ba7ed8 Fix SBO bit in disassembly mask for ldrah on AArch64.
The disassembly mask for ldarh incorrectly didn't mask out bit 20 which
is part of the SBO part of the instruction and shouldn't be considered input.

This fixes the wrong bit fixing the disassembly of instructions to
ldarh and makes the behavior consistent.

opcodes/

	PR binutils/23242
	* aarch64-tbl.h (ldarh): Fix disassembly mask.
2018-07-06 16:18:47 +01:00