]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
7 years agoFix test for availability of emplace_back.
Cary Coutant [Mon, 9 Jul 2018 23:12:27 +0000 (16:12 -0700)] 
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.

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 10 Jul 2018 00:02:08 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agobfd: Use changequote for "i[3-7]86-*-linux-*"
H.J. Lu [Mon, 9 Jul 2018 13:51:17 +0000 (06:51 -0700)] 
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.

(cherry picked from commit 872899f1efeda1e93ed569d322c6b2ee85ce885c)

7 years agox86: Remove x86 ISA properties with empty bits
H.J. Lu [Thu, 5 Jul 2018 16:24:07 +0000 (09:24 -0700)] 
x86: Remove x86 ISA properties with empty bits

There is no need to generate x86 ISA properties with empty bits in
linker output.

bfd/

PR ld/23372
* elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Remove x86
ISA properties with empty bits.

ld/

PR ld/23372
* testsuite/ld-i386/i386.exp: Run pr23372a and pr23372b.
* testsuite/ld-i386/pr23372a.d: New file.
* testsuite/ld-i386/pr23372a.s: Likewise.
* testsuite/ld-i386/pr23372b.d: Likewise.
* testsuite/ld-i386/pr23372b.s: Likewise.
* testsuite/ld-i386/pr23372c.s: Likewise.
* testsuite/ld-x86-64/pr23372a-x32.d: Likewise.
* testsuite/ld-x86-64/pr23372a.d: Likewise.
* testsuite/ld-x86-64/pr23372a.s: Likewise.
* testsuite/ld-x86-64/pr23372b-x32.d: Likewise.
* testsuite/ld-x86-64/pr23372b.d: Likewise.
* testsuite/ld-x86-64/pr23372b.s: Likewise.
* testsuite/ld-x86-64/pr23372c.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pr23372a, pr23372a-x32,
pr23372b and pr23372b-x32.

(cherry picked from commit 56ad703d56ffe5dc55d5e719a6ec41fd6cf9bfbe)

7 years agoFix diagnostic errors
Alan Modra [Fri, 6 Jul 2018 05:37:08 +0000 (15:07 +0930)] 
Fix diagnostic errors

Fixes a number of build errors like the following
.../elf32-arm.c: In function 'elf32_arm_nabi_write_core_note':
.../elf32-arm.c:2177: error: #pragma GCC diagnostic not allowed inside functions
.../elf32-arm.c:2186: error: #pragma GCC diagnostic not allowed inside functions
See the comment in diagnostics.h.

include/
* diagnostics.h: Comment on macro usage.
bfd/
* elf32-arm.c (elf32_arm_nabi_write_core_note): Don't use
DIAGNOTIC_PUSH and DIAGNOSTIC_POP unconditionally.
* elf32-ppc.c (ppc_elf_write_core_note): Likewise.
* elf32-s390.c (elf_s390_write_core_note): Likewise.
* elf64-ppc.c (ppc64_elf_write_core_note): Likewise.
* elf64-s390.c (elf_s390_write_core_note): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewise.

(cherry picked from commit fe75810f8e0cc33384f22d0479506711d4014c60)

7 years ago[GOLD] PowerPC .gnu.attributes support
Alan Modra [Thu, 5 Jul 2018 15:38:16 +0000 (01:08 +0930)] 
[GOLD] PowerPC .gnu.attributes support

elfcpp/
* powerpc.h (Tag_GNU_Power_ABI_FP): Define.
(Tag_GNU_Power_ABI_Vector, Tag_GNU_Power_ABI_Struct_Return): Define.
gold/
* powerpc.cc: Include attributes.h.
(Powerpc_relobj::attributes_section_data_): New variable, with
accessor and associated constructor and destructor support.
(Powerpc_dynobj::attributes_section_data_): Likewise.
(Powerpc_relobj::do_read_symbols): Stash SHT_GNU_ATTRIBUTES section
contents in attributes_section_data_.
(Powerpc_dynobj::do_read_symbols): Likewise.
(Target_powerpc): Add attributes_section_data_, last_fp_, last_ld_,
last_vec_, and last_struct_ vars.
(Target_powerpc::merge_object_attributes): New function.
(Target_powerpc::do_finalize_sections): Iterate over input objects
merging attributes.  Create output attributes section.

(cherry picked from commit 724436fccb68156ff53b7b03cb7f41547a65c30c)

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 9 Jul 2018 00:02:17 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 8 Jul 2018 00:02:57 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 7 Jul 2018 00:01:59 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoRISC-V: Add riscv-*-* configure support, and minor cleanup.
Jim Wilson [Fri, 6 Jul 2018 00:49:11 +0000 (17:49 -0700)] 
RISC-V: Add riscv-*-* configure support, and minor cleanup.

bfd/
* config.bfd (riscv32*-*-*): Renamed from riscv32-*-*.
(riscv64*-*-*): Likewise.
(riscv-*-*): Add as an alias for riscv32*-*-*.

ld/
* configure.tgt (riscv-*-*): Add as an alias for riscv32*-*-*.

(cherry picked from commit bb11866d6a635fadb9285d18e2fb819d2de2c28c)

7 years agoFix SBO bit in disassembly mask for ldrah on AArch64.
Tamar Christina [Fri, 6 Jul 2018 15:18:19 +0000 (16:18 +0100)] 
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.

(cherry picked from commit f311ba7ed84d66ae2cd77bd969747d7ab959d866)
Signed-off-by: Tamar Christina <tamar.christina@arm.com>
7 years agoFix the read/write flag for these registers on AArch64
Tamar Christina [Fri, 6 Jul 2018 15:15:41 +0000 (16:15 +0100)] 
Fix the read/write flag for these registers on AArch64

The previous constraints were based on information already in opcodes and it
seems that a few of them were wrong.  I have now hand verified the ones changed
by the previous patch and corrected where needed.

This prevents a warning to be issued when one shouldn't be.

opcodes/

PR binutils/23369
* aarch64-opc.c (aarch64_sys_regs): Make read/write csselr_el1,
vsesr_el2, osdtrrx_el1, osdtrtx_el1, pmsidr_el1.

gas/testsuite/

PR binutils/23369
* gas/aarch64/msr.d (csselr_el1,
vsesr_el2, osdtrrx_el1, osdtrtx_el1, pmsidr_el1): New.
* gas/aarch64/msr.s: Likewise.

(cherry picked from commit cba05feb51cb97f75f9a7814b081ce45245ac7b2)
Signed-off-by: Tamar Christina <tamar.christina@arm.com>
7 years agoFix bug generating relocations for notes created by the assembler.
Nick Clifton [Fri, 6 Jul 2018 10:48:15 +0000 (11:48 +0100)] 
Fix bug generating relocations for notes created by the assembler.

* write.c (maybe_generate_build_notes): Bias reloc offsets by the
number of notes already generated.

7 years agoUpdate config.sub
Sebastian Huber [Fri, 6 Jul 2018 06:23:40 +0000 (08:23 +0200)] 
Update config.sub

* config.sub: Sync with upstream version 2018-07-03.

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 6 Jul 2018 00:02:26 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoError for mismatched powerpc ABI tags
Alan Modra [Wed, 4 Jul 2018 01:11:31 +0000 (10:41 +0930)] 
Error for mismatched powerpc ABI tags

And report the two input files that are incompatible rather than
reporting that an input file is incompatible with the output.

bfd/
* elf-bfd.h (_bfd_elf_ppc_merge_fp_attributes): Update prototype.
* elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Return error
on mismatch.  Remove "warning: " from messages.  Track last bfd
used to set tags.
(ppc_elf_merge_obj_attributes): Likewise.  Handle status from
_bfd_elf_ppc_merge_fp_attributes.
* elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Handle status
from _bfd_elf_ppc_merge_fp_attributes.
ld/
* testsuite/ld-powerpc/attr-gnu-4-12.d: Update expected output.
* testsuite/ld-powerpc/attr-gnu-4-13.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-21.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-23.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-31.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-32.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-8-23.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-12-21.d: Likewise.

(cherry picked from commit 4a91d0ba307eb24eb87ad27f4ea8fcde823c3e61)

7 years agoCorrect removal of .gnu.attributes
Alan Modra [Tue, 3 Jul 2018 08:27:36 +0000 (17:57 +0930)] 
Correct removal of .gnu.attributes

Setting SEC_EXCLUDE for empty .gnu.attributes is too late in the link
process for the linker to remove the section.  That must be done in
bfd_elf_final_link, as we do for removed group sections.

* elflink.c (bfd_elf_final_link): Remove zero size .gnu.attributes
sections.

(cherry picked from commit b8a6ced79668ec8af3180e50b76f7517ebbab0d9)

7 years agoGNU attribute output on errors
Alan Modra [Tue, 3 Jul 2018 05:20:38 +0000 (14:50 +0930)] 
GNU attribute output on errors

.gnu.attributes entries from linker input files are merged to the
output file, the output having the union of compatible input
attributes.  Incompatible attributes generally cause a linker error
and no output.  However in some cases only a warning is emitted, and
one of the incompatible input attributes is passed on to the output.

PowerPC tends to emit warnings rather than errors, and the output
takes the first input attribute.  For example, if we have two input
files with Tag_GNU_Power_ABI_FP, the first with a value signifying
"double-precision hard float, IBM long double", the second with a
value signifying "double-precision hard float, IEEE long double",
we'll get a warning about incompatible long double types and the
output will say "double-precision hard float, IBM long double".
The output attribute of course isn't correct.  It would be correct to
specify "IBM and IEEE long double", but we don't have a way to
represent that currently.  While it would be possible to extend the
encoding, there isn't much gain in doing so.  A shared library
providing support for both long double types should link against
objects using either long double type without warning or error.  That
is what you'd get if such a shared library had no Tag_GNU_Power_ABI_FP
attribute.

So this patch provides a way for the backend to omit .gnu.attributes
tags from the output.

* elf-bfd.h (ATTR_TYPE_FLAG_ERROR, ATTR_TYPE_HAS_ERROR): Define.
* elf-attrs.c (is_default_attr): Handle ATTR_TYPE_HAS_ERROR.
* elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Use
ATTR_TYPE_FLAG_INT_VAL.  Set ATTR_TYPE_HAS_ERROR on finding
incompatible attribute.
(ppc_elf_merge_obj_attributes): Likewise.  Return
_bfd_elf_merge_object_attributes result.
* elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Return
_bfd_elf_merge_object_attributes result.

(cherry picked from commit 8d2c8c3d17926826864f4b739362f66af547428f)

7 years agoUpdate config.guess and config.sub
Sebastian Huber [Fri, 29 Jun 2018 11:06:40 +0000 (13:06 +0200)] 
Update config.guess and config.sub

* config.guess: Sync with upstream version 2018-06-26.
* config.sub: Sync with upstream version 2018-07-02.

7 years agold: Set non_ir_ref_regular for --undefined SYMBOL
H.J. Lu [Thu, 5 Jul 2018 11:33:11 +0000 (04:33 -0700)] 
ld: Set non_ir_ref_regular for --undefined SYMBOL

Set non_ir_ref_regular to TRUE for symbols forced into the output file
so that they won't be removed by garbage collection with LTO.

PR ld/23309
* ldlang.c (insert_undefined): Set non_ir_ref_regular to TRUE.
* plugin.c (is_visible_from_outside): Don't scan entry_symbol.
* testsuite/ld-plugin/pr23309.c: New file.
* testsuite/ld-plugin/pr23309.d: Likewise.

(cherry picked from commit 94d401b8b88a76b1372ce44e805516756a4f737b)

7 years agoUpdate Russian, Bulgarian and Brazilian Portuguese translations for various component...
Nick Clifton [Thu, 5 Jul 2018 11:22:14 +0000 (12:22 +0100)] 
Update Russian, Bulgarian and Brazilian Portuguese translations for various components of the binutils.

bfd,gas * po/ru.po: Updated Russian translation.

ld * po/bg.po: Updated Bulgarian translation.
* po/pt_BR.po: Updated Brazilian Portuguese translation.

binutils* po/bg.po: Updated Bulgarian translation.

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 5 Jul 2018 00:02:48 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agold: Properly display default for -z separate-code
H.J. Lu [Wed, 4 Jul 2018 13:22:40 +0000 (06:22 -0700)] 
ld: Properly display default for -z separate-code

Check DEFAULT_LD_Z_SEPARATE_CODE to display default for -z separate-code.

PR ld/23358
* lexsup.c (elf_shlib_list_options): Properly display default
for -z separate-code.

(cherry picked from commit b14b7ff14ffe911ec562004304841cf7d2775a19)

7 years agoAlso install diagnostics.h
H.J. Lu [Wed, 4 Jul 2018 13:18:22 +0000 (06:18 -0700)] 
Also install diagnostics.h

Since bfd.h is an installed header, also install diagnostics.h.

* Makefile.am (bfdinclude_HEADERS): Add $(INCDIR)/diagnostics.h.
* Makefile.in: Regenerated.

(cherry picked from commit db40acb0bed088872837f916029d8800c33f9f94)

7 years agox86-64: Clear the R_X86_64_converted_reloc_bit bit
H.J. Lu [Mon, 2 Jul 2018 20:08:09 +0000 (13:08 -0700)] 
x86-64: Clear the R_X86_64_converted_reloc_bit bit

We need to clear the R_X86_64_converted_reloc_bit bit after setting it
to avoid leaking it out by --emit-relocs.

bfd/

PR ld/23324
* elf64-x86-64.c (elf_x86_64_relocate_section): Clear the
R_X86_64_converted_reloc_bit bit.

ld/

PR ld/23324
* testsuite/ld-x86-64/pr23324.s: New file.
* testsuite/ld-x86-64/pr23324a.d: Likewise.
* testsuite/ld-x86-64/pr23324b.d: Likewise.

(cherry picked from commit b638b5d57fafc84a8dc0ff91d7579a3c24aad90c)

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 4 Jul 2018 00:02:46 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 3 Jul 2018 00:02:48 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 2 Jul 2018 00:02:40 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 1 Jul 2018 00:02:47 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 30 Jun 2018 00:02:05 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years ago[Patch AArch64] Warn on unpredictable stlxrb , stlxrh and stlxr cases.
Ramana Radhakrishnan [Fri, 29 Jun 2018 12:06:05 +0000 (13:06 +0100)] 
[Patch AArch64] Warn on unpredictable stlxrb , stlxrh and stlxr cases.

A recent case in golang highlighted that gas wasn't warning on these
unpredictable cases in the architecture. Fixed thusly.

I need to audit gcc to make sure we have early clobbers on the
patterns but that's a separate patch.

Tested aarch64-none-elf and gas

Ok ?

Ramana

2018-06-29 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>

        * config/tc-aarch64.c (warn_unpredictable_ldst): Add
        unpredictable cases for ldxp, stlxrb, stlxrh, stlxr.  *
        testsuite/gas/aarch64/diagnostic.s: New tests.  *
        testsuite/gas/aarch64/diagnostic.l: Adjust.

7 years agoFix AArch64 encodings for by element instructions.
Tamar Christina [Fri, 29 Jun 2018 11:12:27 +0000 (12:12 +0100)] 
Fix AArch64 encodings for by element instructions.

Some instructions in Armv8-a place a limitation on FP16 registers that can be
used as the register from which to select an element from.

e.g. fmla restricts Rm to 4 bits when using an FP16 register.  This restriction
does not apply for all instructions, e.g. fcmla does not have this restriction
as it gets an extra bit from the M field.

Unfortunately, this restriction to S_H was added for all _Em operands before,
meaning for a large number of instructions you couldn't use the full register
file.

This fixes the issue by introducing a new operand _Em16 which applies this
restriction only when paired with S_H and leaves the _Em and the other
qualifiers for _Em16 unbounded (i.e. using the full 5 bit range).

Also the patch updates all instructions that should be affected by this.

opcodes/

PR binutils/23192
* aarch64-asm-2.c: Regenerate.
* aarch64-dis-2.c: Likewise.
* aarch64-opc-2.c: Likewise.
* aarch64-dis.c (aarch64_ext_reglane): Add AARCH64_OPND_Em16 constraint.
* aarch64-opc.c (operand_general_constraint_met_p,
aarch64_print_operand): Likewise.
* aarch64-tbl.h (aarch64_opcode_table): Change Em to Em16 for smlal,
smlal2, fmla, fmls, fmul, fmulx, sqrdmlah, sqrdlsh, fmlal, fmlsl,
fmlal2, fmlsl2.
(AARCH64_OPERANDS): Add Em2.

gas/

PR binutils/23192
* config/tc-aarch64.c (process_omitted_operand, parse_operands): Add
AARCH64_OPND_Em16
* testsuite/gas/aarch64/advsimd-armv8_3.s: Expand tests to cover upper
16 registers.
* testsuite/gas/aarch64/advsimd-armv8_3.d: Likewise.
* testsuite/gas/aarch64/advsimd-compnum.s: Likewise.
* testsuite/gas/aarch64/advsimd-compnum.d: Likewise.
* testsuite/gas/aarch64/sve.d: Likewise.

include/

PR binutils/23192
*opcode/aarch64.h (aarch64_opnd): Add AARCH64_OPND_Em16.

(cherry picked from commit 369c9167d47e69aad2e260cc1db17f8c894c138b)
Signed-off-by: Tamar Christina <tamar.christina@arm.com>
7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 29 Jun 2018 00:02:16 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 28 Jun 2018 00:02:28 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agogas object file locations
Alan Modra [Wed, 27 Jun 2018 03:17:13 +0000 (12:47 +0930)] 
gas object file locations

With the update to newer autotools, some gas object files are now
built in config/, breaking xtensa-elf and ia64-vms.  This patch fixes
the dependencies.

* configure.ac: Specify extra_objects with leading "config/"
for xtensa-relax.o and te-vms.o.  Use case statements to unique
extra_objects.  Formatting.
* configure: Regenerate.

(cherry picked from commit e11078da44268a4813ed81a27853143af86c3e24)

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 27 Jun 2018 00:02:44 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoPR23169 bogus test
Alan Modra [Tue, 26 Jun 2018 05:00:16 +0000 (14:30 +0930)] 
PR23169 bogus test

The testcase isn't valid.  If it happens to run on your target, you're
lucky.

PR 23169
* testsuite/ld-ifunc/ifunc.exp: Don't run pr23169 tests on
powerpc.  Comment.

7 years agoFix parens in ld bootstrap.exp
Alan Modra [Tue, 26 Jun 2018 04:59:28 +0000 (14:29 +0930)] 
Fix parens in ld bootstrap.exp

Seen with tcl 8.5.13:
ERROR: tcl error sourcing .../ld/testsuite/ld-bootstrap/bootstrap.exp.
ERROR: expected boolean value but got " [istarget ia64-*-elf*] || [istarget ia64-*-linux*"
    while executing
"if { "$flags" == "--static" && { [istarget ia64-*-elf*] || [istarget ia64-*-linux*] }
 || [istarget mips*-*-linux*] } {
# On ia64 and mips, tmpdir/l..."

* testsuite/ld-bootstrap/bootstrap.exp: Use parentheses rather
than curly braces in logical expression.

7 years agoRevert "Use offsets instead of addresses in ELF_SECTION_IN_SEGMENT for non SHT_NOBITS"
Alan Modra [Thu, 21 Jun 2018 13:49:41 +0000 (23:19 +0930)] 
Revert "Use offsets instead of addresses in ELF_SECTION_IN_SEGMENT for non SHT_NOBITS"

This reverts commit 57c0d77c2ce5e583dab322e05f8291bcbad0ccd3.

7 years agoUpdated translations.
Nick Clifton [Tue, 26 Jun 2018 12:55:59 +0000 (13:55 +0100)] 
Updated translations.

opcodes * po/uk.po: Updated Ukranian translation.
* po/de.po: Updated German translation.
* po/pt_BR.po: Updated Brazilian Portuguese translation.

ld * po/uk.po: Updated Ukranian translation.
gold * po/uk.po: Updated Ukranian translation.
gas * po/uk.po: Updated Ukranian translation.
bfd * po/uk.po: Updated Ukranian translation.

binutils* po/sv.po: Updated Swedish translation.
* po/uk.po: Updated Ukranian translation.

7 years agoFix spelling mistakes.
Nick Clifton [Tue, 26 Jun 2018 11:32:32 +0000 (12:32 +0100)] 
Fix spelling mistakes.

opcodes * nfp-dis.c: Fix spelling mistake.

ld * emultempl/aarch64elf.em: Fix spelling mistake.
* emultempl/avrelf.em: Likewise.
* emultempl/elf32.em: Likewise.

binutils* doc/binutils.texi: Fix spelling mistakes.

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 26 Jun 2018 00:02:27 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoFix a compile time warning building the AArch64 BFD backend.
Nick Clifton [Mon, 25 Jun 2018 11:51:10 +0000 (12:51 +0100)] 
Fix a compile time warning building the AArch64 BFD backend.

* elfnn-aarch64.c (_bfd_aarch64_erratum_835769_stub_name): Check
for malloc returning NULL.
(_bfd_aarch64_erratum_843419_fixup): Check for
_bfd_aarch64_erratum_835769_stub_name returning NULL.

7 years agoReset version to 2.30.90. Update configure files. Regenerate pot files.
Nick Clifton [Sun, 24 Jun 2018 18:49:22 +0000 (19:49 +0100)] 
Reset version to 2.30.90.  Update configure files.  Regenerate pot files.

7 years agoAdd 2.30 branch notes to ChangeLogs and NEWS files.
Nick Clifton [Sun, 24 Jun 2018 17:36:15 +0000 (18:36 +0100)] 
Add 2.30 branch notes to ChangeLogs and NEWS files.

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 24 Jun 2018 00:01:17 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoBump version number and summarize new features in 1.16.
Cary Coutant [Sat, 23 Jun 2018 07:46:13 +0000 (00:46 -0700)] 
Bump version number and summarize new features in 1.16.

gold/
* version.cc (version_string): Bump to 1.16.
* NEWS: Add new features in 1.16.

7 years agoFix "may be used uninitialized" warning.
Cary Coutant [Sat, 23 Jun 2018 07:26:07 +0000 (00:26 -0700)] 
Fix "may be used uninitialized" warning.

gold/
PR gold/22914
* x86_64.cc (Target_x86_64::record_gnu_property): Initialize val.

7 years agoAdd x86-64 support for Indirect Branch Tracking (IBT).
Cary Coutant [Sat, 23 Jun 2018 00:28:05 +0000 (17:28 -0700)] 
Add x86-64 support for Indirect Branch Tracking (IBT).

gold/
PR gold/22915
* x86_64.cc (Output_data_plt_x86_64_ibt): New class.
(Target_x86_64::do_make_data_plt): (All instantiations) Check for
IBT feature bit and create IBT PLTs.

7 years agoUpdate support for .note.gnu.property sections.
Cary Coutant [Sat, 23 Jun 2018 06:36:50 +0000 (23:36 -0700)] 
Update support for .note.gnu.property sections.

The original patch did not give the target enough hooks to discover that
an input object file does not have a particular property. For the
GNU_PROPERTY_X86_FEATURE_1_AND property, for example, where a missing
property should be assumed to be all zeroes, and ANDed with other
object modules, this is essential. We now store the target-specific
properties locally in the Target structure as native uint32_t fields,
then AND the per-object feature bits with the program's feature bits
when we're finished processing each input object file. The target-specific
properties are then added back to the output note section during
finalization.

gold/
PR gold/22914
* layout.cc (read_sized_value): Fix spelling of section name.
(Layout::layout_gnu_property): Call Sized_target::record_gnu_property
for target-specific properties;
don't store them with target-independent properties yet.
(Layout::merge_gnu_properties): New method.
(Layout::add_gnu_property): New method.
(Layout::create_gnu_properties_note): Call target to finalize
target-specific properties. Fix spelling of output section name.
* layout.h (Layout::merge_gnu_properties): New method.
(Layout::add_gnu_property): New method.
* object.cc (Sized_relobj_file::do_layout): Call
Layout::merge_gnu_properties.
* target.h (Target::merge_gnu_property): Remove.
(Target::finalize_gnu_properties): New method.
(Target::do_merge_gnu_property): Move to Sized_target and rename.
(Target::do_finalize_gnu_properties): New virtual method.
(Sized_target::record_gnu_property): Moved and renamed from
Target::do_merge_gnu_property.
(Sized_target::merge_gnu_properties): New virtual method.
* x86_64.cc (Target_x86_64::isa_1_used_, isa_1_needed_)
(feature_1_, object_feature_1_, seen_first_object_): New data members.
(Target_x86_64::do_merge_gnu_property): Rename to ...
(Target_x86_64::record_gnu_property): ... this.  Save target-specific
properties in Target class object.
(Target_x86_64::merge_gnu_properties): New method.
(add_property): New static inline function.
(Target_x86_64::do_finalize_gnu_properties): New method.
* testsuite/Makefile.am (gnu_property_test): Remove C source file;
link directly without compiler driver.
* testsuite/Makefile.in: Regenerate.
* testsuite/gnu_property_a.S: Add _start.

7 years agoSilence GCC 9 error about deprecated implicit copy constructor.
Cary Coutant [Sat, 23 Jun 2018 01:19:51 +0000 (18:19 -0700)] 
Silence GCC 9 error about deprecated implicit copy constructor.

Replacing push_back() with emplace_back() eliminates the calls to the
copy constructor, but I still had to provide explicit copy constructors
because of the call to vector::reserve(), which tries to instantiate them
even though they'll never actually be called when reserve() is called
on an empty vector.

gold/
* incremental.cc (Sized_incremental_binary::setup_readers): Use
emplace_back for GCC 5 and later.
* incremental.h (Incremental_binary::Input_reader): Provide copy
constructor.
(Sized_incremental_binary::Sized_input_reader): Likewise.

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 23 Jun 2018 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoFix "info registers" regexes in gdb.base/jit-reader.exp
Simon Marchi [Fri, 22 Jun 2018 17:40:47 +0000 (13:40 -0400)] 
Fix "info registers" regexes in gdb.base/jit-reader.exp

Commit

  e813d34 ("Align natural-format register values to the same column")

changed the output of "info registers" (tabs to spaces), but didn't
update gdb.base/jit-reader.exp.  Update the regexes to expect spaces
instead.

gdb/testsuite/ChangeLog:

* gdb.base/jit-reader.exp (jit_reader_test): Expect spaces in
"info registers" output.

7 years agoAdd support for .note.gnu.property sections.
Cary Coutant [Fri, 22 Jun 2018 16:27:39 +0000 (09:27 -0700)] 
Add support for .note.gnu.property sections.

elfcpp/
PR gold/22914
* elfcpp.h (NT_GNU_PROPERTY_TYPE_0): New note type.
(GNU_PROPERTY_*): New Gnu property types.
* x86_64.h (GNU_PROPERTY_X86_FEATURE_1_IBT)
(GNU_PROPERTY_X86_FEATURE_1_SHSTK): New x86 feature bits.

gold/
PR gold/22914
* layout.cc (Layout::Layout): Initialize gnu_properties_.
(read_sized_value, write_sized_value): New functions.
(Layout::layout_gnu_property): New method.
(Layout::create_notes): Call create_gnu_properties_note.
(Layout::create_gnu_properties_note): New method.
* layout.h (Layout::layout_gnu_property): New method.
(Layout::create_gnu_properties_note): New method.
(Layout::Gnu_property, Layout::Gnu_properties): New types.
(Layout::gnu_properties_): New data member.
* object.cc (Sized_relobj_file::layout_gnu_property_section): New
method.
(Sized_relobj_file::do_layout): Handle .note.gnu.property sections.
* object.h (Sized_relobj_file::layout_gnu_property_section): New
method.
* target.h (Target::merge_gnu_property): New method.
(Target::do_merge_gnu_property): New virtual method.
* x86_64.cc (Target_x86_64::do_merge_gnu_property): New method.
* testsuite/Makefile.am (gnu_property_test): New test case.
* testsuite/Makefile.in: Regenerate.
* testsuite/gnu_property_a.S: New source file.
* testsuite/gnu_property_b.S: New source file.
* testsuite/gnu_property_c.S: New source file.
* testsuite/gnu_property_main.c: New source file.
* testsuite/gnu_property_test.sh: New test script.

7 years agoUse partial register read/writes in transfer_regset
Alan Hayward [Wed, 20 Jun 2018 17:19:05 +0000 (18:19 +0100)] 
Use partial register read/writes in transfer_regset

This avoids assert failures when the register is bigger than the
slot size. This happens on Aarch64 when truncating Z registers
into an fpsimd structure. This can be triggered by running
gdb command "generate-core-file".

Also, when the register is smaller then the slot size, then
zero pad when writing to the slot, and truncate when writing
to the regcache. This happens on Aarch64 with the CPSR register.

Continue to ensure registers are invalidated when both buffers
are null.

gdb/
* regcache.c (readable_regcache::read_part): Fix asserts.
(reg_buffer::raw_collect_part): New function.
(regcache::write_part): Fix asserts.
(reg_buffer::raw_supply_part): New function.
(regcache::transfer_regset_register): New helper function.
(regcache::transfer_regset): Call new functions.
(regcache_supply_regset): Use gdb_byte*.
(regcache::supply_regset): Likewise.
(regcache_collect_regset): Likewise.
(regcache::collect_regset): Likewise.
* regcache.h (reg_buffer::raw_collect_part): New declaration.
(reg_buffer::raw_supply_part): Likewise.
(regcache::transfer_regset_register): Likewise.
(regcache::transfer_regset): Use gdb_byte*.

7 years agoCorrect negs aliasing on AArch64.
Tamar Christina [Fri, 22 Jun 2018 11:27:53 +0000 (12:27 +0100)] 
Correct negs aliasing on AArch64.

This patch fixes a disassembly issue with the aliases to subs with a shifted
register.  The subs instruction with the zero register as destination is
supposed to alias to cmp and when the first input register is the zero register
the subs is supposed to be aliased to negs.

This means that a subs with destination and first input registers the zero
register is supposed to be a cmp.

This is done by raising the priority of the cmp alias.

opcodes/

* aarch64-tbl.h (aarch64_opcode_table): Fix alias flag for negs
* aarch64-asm-2.c: Regenerate.
* aarch64-dis-2.c: Likewise.

gas/

* testsuite/gas/aarch64/addsub.s: Add negs to zero reg test.
* testsuite/gas/aarch64/addsub.d: Likewise.

7 years agoFix up HAS_SVE_STATE macro
Alan Hayward [Fri, 22 Jun 2018 09:26:51 +0000 (10:26 +0100)] 
Fix up HAS_SVE_STATE macro

Prevents build break on aarch64 Suse.

2018-06-22  Alan Hayward  <alan.hayward@arm.com>

gdb/
* nat/aarch64-sve-linux-ptrace.h (HAS_SVE_STATE): Use &.

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 22 Jun 2018 00:00:53 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoMIPS/opcodes: Fix a typo in `-M ginv' option description
Maciej W. Rozycki [Thu, 21 Jun 2018 21:45:47 +0000 (22:45 +0100)] 
MIPS/opcodes: Fix a typo in `-M ginv' option description

opcodes/
* mips-dis.c (print_mips_disassembler_options): Fix a typo in
`-M ginv' option description.

7 years agoFix treatment of symbol versions with unused as-needed libraries.
Cary Coutant [Thu, 21 Jun 2018 20:51:16 +0000 (13:51 -0700)] 
Fix treatment of symbol versions with unused as-needed libraries.

When we have a weak reference to a symbol defined in an
as-needed library, and that library ends up not-needed, gold
simply clears the version information in the symbol table, even
if the symbol could have been resolved by a needed library later
in the link order. This results in a loss of version information,
which can cause the program to bind to the wrong version at run
time.

This patch lets a dynamic definition override an earlier one if
the earlier one is from a not-needed library, so that we can
retain the version information from the binding to the needed
library. In order to do that, the tracking of needed/not-needed
had to be moved up to symbol resolution time, instead of during
Symbol_table::set_dynsym_indexes().

In cases where we still end up discarding version information,
I've added a warning.

For the original problem report and discussion, see:

https://stackoverflow.com/questions/50751421/undefined-behavior-in-shared-lib-using-libpthread-but-not-having-it-in-elf-as-d

gold/
* resolve.cc (Symbol_table::resolve): Rename tobinding to
orig_tobinding.  Call set_is_needed() for objects that resolve
non-weak references.
(Symbol_table::should_override): Allow a dynamic definition to
override an earlier one in a not-needed library.
* symtab.cc (Symbol_table::set_dynsym_indexes): Remove separate
processing for as-needed symbols.  Add warning when discarding
version informatin.
* testsuite/Makefile.am (weak_as_needed): New test case.
* testsuite/Makefile.in: Regenerate.
* testsuite/weak_as_needed.sh: New test script.
* testsuite/weak_as_needed_a.c: New source file.
* testsuite/weak_as_needed_b.c: New source file.
* testsuite/weak_as_needed_b.script: New version script.
* testsuite/weak_as_needed_c.c: New source file.
* testsuite/weak_as_needed_c.script: New version script.

7 years agoMIPS/BFD: Correct formatting of compact EH backend methods
Maciej W. Rozycki [Thu, 21 Jun 2018 20:40:57 +0000 (21:40 +0100)] 
MIPS/BFD: Correct formatting of compact EH backend methods

Correct the formatting of `_bfd_mips_elf_compact_eh_encoding' and
`_bfd_mips_elf_cant_unwind_opcode' definitions which extend beyond 79
columns.

bfd/
* elfxx-mips.c (_bfd_mips_elf_compact_eh_encoding)
(_bfd_mips_elf_cant_unwind_opcode): Correct formatting.

7 years agoMIPS/BFD: Keep EI_ABIVERSION setting together
Maciej W. Rozycki [Thu, 21 Jun 2018 20:40:56 +0000 (21:40 +0100)] 
MIPS/BFD: Keep EI_ABIVERSION setting together

Shuffle code in `_bfd_mips_post_process_headers' so that the setting of
the EI_ABIVERSION ELF file header field is complete before calling
`_bfd_elf_post_process_headers'.  This used to be the case, but was
changed with commit 351cdf24d223 ("[MIPS] Implement O32 FPXX, FP64 and
FP64A ABI extensions") for no reason.

bfd/
* elfxx-mips.c (_bfd_mips_post_process_headers): Keep
EI_ABIVERSION setting together.

7 years agoMIPS/BFD: Use enumeration constants for EI_ABIVERSION
Maciej W. Rozycki [Thu, 21 Jun 2018 20:40:56 +0000 (21:40 +0100)] 
MIPS/BFD: Use enumeration constants for EI_ABIVERSION

Define enumeration constants based on generated `libc-abis.h' from GNU
libc, adding a MIPS_ prefix as these are port-specific.  Use them to
replace magic numbers stored in the EI_ABIVERSION field of the ELF file
header.

bfd/
* elfxx-mips.c (MIPS_LIBC_ABI_DEFAULT, MIPS_LIBC_ABI_MIPS_PLT)
(MIPS_LIBC_ABI_UNIQUE, MIPS_LIBC_ABI_MIPS_O32_FP64)
(MIPS_LIBC_ABI_MAX): New enumeration constants.
(_bfd_mips_post_process_headers): Use them in place of magic
numbers.

7 years agoRISC-V: Fix 3 PIE related ld testsuite failures.
Jim Wilson [Thu, 21 Jun 2018 18:45:43 +0000 (11:45 -0700)] 
RISC-V: Fix 3 PIE related ld testsuite failures.

bfd/
* elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Update comment.
Use SYMBOL_REFERENCES_LOCAL.  Add asserts for h->got.offset.

7 years agoUse thread_info and inferior pointers more throughout
Pedro Alves [Thu, 21 Jun 2018 16:09:31 +0000 (17:09 +0100)] 
Use thread_info and inferior pointers more throughout

This is more preparation bits for multi-target support.

In a multi-target scenario, we need to address the case of different
processes/threads running on different targets that happen to have the
same PID/PTID.  E.g., we can have both process 123 in target 1, and
process 123 in target 2, while they're in reality different processes
running on different machines.  Or maybe we've loaded multiple
instances of the same core file.  Etc.

To address this, in my WIP multi-target branch, threads and processes
are uniquely identified by the (process_stratum target_ops *, ptid_t)
and (process_stratum target_ops *, pid) tuples respectively.  I.e.,
each process_stratum instance has its own thread/process number space.

As you can imagine, that requires passing around target_ops * pointers
in a number of functions where we're currently passing only a ptid_t
or an int.  E.g., when we look up a thread_info object by ptid_t in
find_thread_ptid, the ptid_t alone isn't sufficient.

In many cases though, we already have the thread_info or inferior
pointer handy, but we "lose" it somewhere along the call stack, only
to look it up again by ptid_t/pid.  Since thread_info or inferior
objects know their parent target, if we pass around thread_info or
inferior pointers when possible, we avoid having to add extra
target_ops parameters to many functions, and also, we eliminate a
number of by ptid_t/int lookups.

So that's what this patch does.  In a bit more detail:

- Changes a number of functions and methods to take a thread_info or
  inferior pointer instead of a ptid_t or int parameter.

- Changes a number of structure fields from ptid_t/int to inferior or
  thread_info pointers.

- Uses the inferior_thread() function whenever possible instead of
  inferior_ptid.

- Uses thread_info pointers directly when possible instead of the
  is_running/is_stopped etc. routines that require a lookup.

- A number of functions are eliminated along the way, such as:

  int valid_gdb_inferior_id (int num);
  int pid_to_gdb_inferior_id (int pid);
  int gdb_inferior_id_to_pid (int num);
  int in_inferior_list (int pid);

- A few structures and places hold a thread_info pointer across
  inferior execution, so now they take a strong reference to the
  (refcounted) thread_info object to avoid the thread_info pointer
  getting stale.  This is done in enable_thread_stack_temporaries and
  in the infcall.c code.

- Related, there's a spot in infcall.c where using a RAII object to
  handle the refcount would be handy, so a gdb::ref_ptr specialization
  for thread_info is added (thread_info_ref, in gdbthread.h), along
  with a gdb_ref_ptr policy that works for all refcounted_object types
  (in common/refcounted-object.h).

gdb/ChangeLog:
2018-06-21  Pedro Alves  <palves@redhat.com>

* ada-lang.h (ada_get_task_number): Take a thread_info pointer
instead of a ptid_t.  All callers adjusted.
* ada-tasks.c (ada_get_task_number): Likewise.  All callers
adjusted.
(print_ada_task_info, display_current_task_id, task_command_1):
Adjust.
* breakpoint.c (watchpoint_in_thread_scope): Adjust to use
inferior_thread.
(breakpoint_kind): Adjust.
(remove_breakpoints_pid): Rename to ...
(remove_breakpoints_inf): ... this.  Adjust to take an inferior
pointer.  All callers adjusted.
(bpstat_clear_actions): Use inferior_thread.
(get_bpstat_thread): New.
(bpstat_do_actions): Use it.
(bpstat_check_breakpoint_conditions, bpstat_stop_status): Adjust
to take a thread_info pointer.  All callers adjusted.
(set_longjmp_breakpoint_for_call_dummy, set_momentary_breakpoint)
(breakpoint_re_set_thread): Use inferior_thread.
* breakpoint.h (struct inferior): Forward declare.
(bpstat_stop_status): Update.
(remove_breakpoints_pid): Delete.
(remove_breakpoints_inf): New.
* bsd-uthread.c (bsd_uthread_target::wait)
(bsd_uthread_target::update_thread_list): Use find_thread_ptid.
* btrace.c (btrace_add_pc, btrace_enable, btrace_fetch)
(maint_btrace_packet_history_cmd)
(maint_btrace_clear_packet_history_cmd): Adjust.
(maint_btrace_clear_cmd, maint_info_btrace_cmd): Adjust to use
inferior_thread.
* cli/cli-interp.c: Include "inferior.h".
* common/refcounted-object.h (struct
refcounted_object_ref_policy): New.
* compile/compile-object-load.c: Include gdbthread.h.
(store_regs): Use inferior_thread.
* corelow.c (core_target::close): Use current_inferior.
(core_target_open): Adjust to use first_thread_of_inferior and use
the current inferior.
* ctf.c (ctf_target::close): Adjust to use current_inferior.
* dummy-frame.c (dummy_frame_id) <ptid>: Delete, replaced by ...
<thread>: ... this new field.  All references adjusted.
(dummy_frame_pop, dummy_frame_discard, register_dummy_frame_dtor):
Take a thread_info pointer instead of a ptid_t.
* dummy-frame.h (dummy_frame_push, dummy_frame_pop)
(dummy_frame_discard, register_dummy_frame_dtor): Take a
thread_info pointer instead of a ptid_t.
* elfread.c: Include "inferior.h".
(elf_gnu_ifunc_resolver_stop, elf_gnu_ifunc_resolver_return_stop):
Use inferior_thread.
* eval.c (evaluate_subexp): Likewise.
* frame.c (frame_pop, has_stack_frames, find_frame_sal): Use
inferior_thread.
* gdb_proc_service.h (struct thread_info): Forward declare.
(struct ps_prochandle) <ptid>: Delete, replaced by ...
<thread>: ... this new field.  All references adjusted.
* gdbarch.h, gdbarch.c: Regenerate.
* gdbarch.sh (get_syscall_number): Replace 'ptid' parameter with a
'thread' parameter.  All implementations and callers adjusted.
* gdbthread.h (thread_info) <set_running>: New method.
(delete_thread, delete_thread_silent): Take a thread_info pointer
instead of a ptid.
(global_thread_id_to_ptid, ptid_to_global_thread_id): Delete.
(first_thread_of_process): Delete, replaced by ...
(first_thread_of_inferior): ... this new function.  All callers
adjusted.
(any_live_thread_of_process): Delete, replaced by ...
(any_live_thread_of_inferior): ... this new function.  All callers
adjusted.
(switch_to_thread, switch_to_no_thread): Declare.
(is_executing): Delete.
(enable_thread_stack_temporaries): Update comment.
<enable_thread_stack_temporaries>: Take a thread_info pointer
instead of a ptid_t.  Incref the thread.
<~enable_thread_stack_temporaries>: Decref the thread.
<m_ptid>: Delete
<m_thr>: New.
(thread_stack_temporaries_enabled_p, push_thread_stack_temporary)
(get_last_thread_stack_temporary)
(value_in_thread_stack_temporaries, can_access_registers_thread):
Take a thread_info pointer instead of a ptid_t.  All callers
adjusted.
* infcall.c (get_call_return_value): Use inferior_thread.
(run_inferior_call): Work with thread pointers instead of ptid_t.
(call_function_by_hand_dummy): Work with thread pointers instead
of ptid_t.  Use thread_info_ref.
* infcmd.c (proceed_thread_callback): Access thread's state
directly.
(ensure_valid_thread, ensure_not_running): Use inferior_thread,
access thread's state directly.
(continue_command): Use inferior_thread.
(info_program_command): Use find_thread_ptid and access thread
state directly.
(proceed_after_attach_callback): Use thread state directly.
(notice_new_inferior): Take a thread_info pointer instead of a
ptid_t.  All callers adjusted.
(exit_inferior): Take an inferior pointer instead of a pid.  All
callers adjusted.
(exit_inferior_silent): New.
(detach_inferior): Delete.
(valid_gdb_inferior_id, pid_to_gdb_inferior_id)
(gdb_inferior_id_to_pid, in_inferior_list): Delete.
(detach_inferior_command, kill_inferior_command): Use
find_inferior_id instead of valid_gdb_inferior_id and
gdb_inferior_id_to_pid.
(inferior_command): Use inferior and thread pointers.
* inferior.h (struct thread_info): Forward declare.
(notice_new_inferior): Take a thread_info pointer instead of a
ptid_t.  All callers adjusted.
(detach_inferior): Delete declaration.
(exit_inferior, exit_inferior_silent): Take an inferior pointer
instead of a pid.  All callers adjusted.
(gdb_inferior_id_to_pid, pid_to_gdb_inferior_id, in_inferior_list)
(valid_gdb_inferior_id): Delete.
* infrun.c (follow_fork_inferior, proceed_after_vfork_done)
(handle_vfork_child_exec_or_exit, follow_exec): Adjust.
(struct displaced_step_inferior_state) <pid>: Delete, replaced by
...
<inf>: ... this new field.
<step_ptid>: Delete, replaced by ...
<step_thread>: ... this new field.
(get_displaced_stepping_state): Take an inferior pointer instead
of a pid.  All callers adjusted.
(displaced_step_in_progress_any_inferior): Adjust.
(displaced_step_in_progress_thread): Take a thread pointer instead
of a ptid_t.  All callers adjusted.
(displaced_step_in_progress, add_displaced_stepping_state): Take
an inferior pointer instead of a pid.  All callers adjusted.
(get_displaced_step_closure_by_addr): Adjust.
(remove_displaced_stepping_state): Take an inferior pointer
instead of a pid.  All callers adjusted.
(displaced_step_prepare_throw, displaced_step_prepare)
(displaced_step_fixup): Take a thread pointer instead of a ptid_t.
All callers adjusted.
(start_step_over): Adjust.
(infrun_thread_ptid_changed): Remove bit updating ptids in the
displaced step queue.
(do_target_resume): Adjust.
(fetch_inferior_event): Use inferior_thread.
(context_switch, get_inferior_stop_soon): Take an
execution_control_state pointer instead of a ptid_t.  All callers
adjusted.
(switch_to_thread_cleanup): Delete.
(stop_all_threads): Use scoped_restore_current_thread.
* inline-frame.c: Include "gdbthread.h".
(inline_state) <inline_state>: Take a thread pointer instead of a
ptid_t.  All callers adjusted.
<ptid>: Delete, replaced by ...
<thread>: ... this new field.
(find_inline_frame_state): Take a thread pointer instead of a
ptid_t.  All callers adjusted.
(skip_inline_frames, step_into_inline_frame)
(inline_skipped_frames, inline_skipped_symbol): Take a thread
pointer instead of a ptid_t.  All callers adjusted.
* inline-frame.h (skip_inline_frames, step_into_inline_frame)
(inline_skipped_frames, inline_skipped_symbol): Likewise.
* linux-fork.c (delete_checkpoint_command): Adjust to use thread
pointers directly.
* linux-nat.c (get_detach_signal): Likewise.
* linux-thread-db.c (thread_from_lwp): New 'stopped' parameter.
(thread_db_notice_clone): Adjust.
(thread_db_find_new_threads_silently)
(thread_db_find_new_threads_2, thread_db_find_new_threads_1): Take
a thread pointer instead of a ptid_t.  All callers adjusted.
* mi/mi-cmd-var.c: Include "inferior.h".
(mi_cmd_var_update_iter): Update to use thread pointers.
* mi/mi-interp.c (mi_new_thread): Update to use the thread's
inferior directly.
(mi_output_running_pid, mi_inferior_count): Delete, bits factored
out to ...
(mi_output_running): ... this new function.
(mi_on_resume_1): Adjust to use it.
(mi_user_selected_context_changed): Adjust to use inferior_thread.
* mi/mi-main.c (proceed_thread): Adjust to use thread pointers
directly.
(interrupt_thread_callback): : Adjust to use thread and inferior
pointers.
* proc-service.c: Include "gdbthread.h".
(ps_pglobal_lookup): Adjust to use the thread's inferior directly.
* progspace-and-thread.c: Include "inferior.h".
* progspace.c: Include "inferior.h".
* python/py-exitedevent.c (create_exited_event_object): Adjust to
hold a reference to an inferior_object.
* python/py-finishbreakpoint.c (bpfinishpy_init): Adjust to use
inferior_thread.
* python/py-inferior.c (struct inferior_object): Give the type a
tag name instead of a typedef.
(python_on_normal_stop): No need to check if the current thread is
listed.
(inferior_to_inferior_object): Change return type to
inferior_object.  All callers adjusted.
(find_thread_object): Delete, bits factored out to ...
(thread_to_thread_object): ... this new function.
* python/py-infthread.c (create_thread_object): Use
inferior_to_inferior_object.
(thpy_is_stopped): Use thread pointer directly.
(gdbpy_selected_thread): Use inferior_thread.
* python/py-record-btrace.c (btpy_list_object) <ptid>: Delete
field, replaced with ...
<thread>: ... this new field.  All users adjusted.
(btpy_insn_or_gap_new): Drop const.
(btpy_list_new): Take a thread pointer instead of a ptid_t.  All
callers adjusted.
* python/py-record.c: Include "gdbthread.h".
(recpy_insn_new, recpy_func_new): Take a thread pointer instead of
a ptid_t.  All callers adjusted.
(gdbpy_current_recording): Use inferior_thread.
* python/py-record.h (recpy_record_object) <ptid>: Delete
field, replaced with ...
<thread>: ... this new field.  All users adjusted.
(recpy_element_object) <ptid>: Delete
field, replaced with ...
<thread>: ... this new field.  All users adjusted.
(recpy_insn_new, recpy_func_new): Take a thread pointer instead of
a ptid_t.  All callers adjusted.
* python/py-threadevent.c: Include "gdbthread.h".
(get_event_thread): Use thread_to_thread_object.
* python/python-internal.h (struct inferior_object): Forward
declare.
(find_thread_object, find_inferior_object): Delete declarations.
(thread_to_thread_object, inferior_to_inferior_object): New
declarations.
* record-btrace.c: Include "inferior.h".
(require_btrace_thread): Use inferior_thread.
(record_btrace_frame_sniffer)
(record_btrace_tailcall_frame_sniffer): Use inferior_thread.
(get_thread_current_frame): Use scoped_restore_current_thread and
switch_to_thread.
(get_thread_current_frame): Use thread pointer directly.
(record_btrace_replay_at_breakpoint): Use thread's inferior
pointer directly.
* record-full.c: Include "inferior.h".
* regcache.c: Include "gdbthread.h".
(get_thread_arch_regcache): Use the inferior's address space
directly.
(get_thread_regcache, registers_changed_thread): New.
* regcache.h (get_thread_regcache(thread_info *thread)): New
overload.
(registers_changed_thread): New.
(remote_target) <remote_detach_1>: Swap order of parameters.
(remote_add_thread): <remote_add_thread>: Return the new thread.
(get_remote_thread_info(ptid_t)): New overload.
(remote_target::remote_notice_new_inferior): Use thread pointers
directly.
(remote_target::process_initial_stop_replies): Use
thread_info::set_running.
(remote_target::remote_detach_1, remote_target::detach)
(extended_remote_target::detach): Adjust.
* stack.c (frame_show_address): Use inferior_thread.
* target-debug.h (target_debug_print_thread_info_pp): New.
* target-delegates.c: Regenerate.
* target.c (default_thread_address_space): Delete.
(memory_xfer_partial_1): Use current_inferior.
(target_detach): Use current_inferior.
(target_thread_address_space): Delete.
(generic_mourn_inferior): Use current_inferior.
* target.h (struct target_ops) <thread_address_space>: Delete.
(target_thread_address_space): Delete.
* thread.c (init_thread_list): Use ALL_THREADS_SAFE.  Use thread
pointers directly.
(delete_thread_1, delete_thread, delete_thread_silent): Take a
thread pointer instead of a ptid_t.  Adjust all callers.
(ptid_to_global_thread_id, global_thread_id_to_ptid): Delete.
(first_thread_of_process): Delete, replaced by ...
(first_thread_of_inferior): ... this new function.  All callers
adjusted.
(any_thread_of_process): Rename to ...
(any_thread_of_inferior): ... this, and take an inferior pointer.
(any_live_thread_of_process): Rename to ...
(any_live_thread_of_inferior): ... this, and take an inferior
pointer.
(thread_stack_temporaries_enabled_p, push_thread_stack_temporary)
(value_in_thread_stack_temporaries)
(get_last_thread_stack_temporary): Take a thread pointer instead
of a ptid_t.  Adjust all callers.
(thread_info::set_running): New.
(validate_registers_access): Use inferior_thread.
(can_access_registers_ptid): Rename to ...
(can_access_registers_thread): ... this, and take a thread
pointer.
(print_thread_info_1): Adjust to compare thread pointers instead
of ptids.
(switch_to_no_thread, switch_to_thread): Make extern.
(scoped_restore_current_thread::~scoped_restore_current_thread):
Use m_thread pointer directly.
(scoped_restore_current_thread::scoped_restore_current_thread):
Use inferior_thread.
(thread_command): Use thread pointer directly.
(thread_num_make_value_helper): Use inferior_thread.
* top.c (execute_command): Use inferior_thread.
* tui/tui-interp.c: Include "inferior.h".
* varobj.c (varobj_create): Use inferior_thread.
(value_of_root_1): Use find_thread_global_id instead of
global_thread_id_to_ptid.

7 years agoAvoid memcpys in regcache read_part/write_part for full registers.
Alan Hayward [Wed, 20 Jun 2018 08:31:37 +0000 (09:31 +0100)] 
Avoid memcpys in regcache read_part/write_part for full registers.

Additionally, tidy up the functions: Remove asserts, use gdb_byte,
update comments.

gdb/
* regcache.c (readable_regcache::read_part): Avoid memcpy when
possible.
(regcache::write_part): Likewise.
(readable_regcache::cooked_read_part): Update comment.
(readable_regcache::cooked_write_part): Likewise.
* regcache.h: (readable_regcache::read_part): Likewise.
(regcache::write_part): Likewise.

7 years agoRegen doc/Makefile.in
Alan Modra [Wed, 20 Jun 2018 04:46:52 +0000 (14:16 +0930)] 
Regen doc/Makefile.in

Also make the automake strictness "foreign".  My regeneration of the
three doc/Makefile.in files already had --foreign in the automake
invocation, so this just makes it explicit.

bfd/
* doc/Makefile.am (AUTOMAKE_OPTIONS): Add "foreign".
* doc/Makefile.in: Regenerate.
binutils/
* doc/Makefile.am (AUTOMAKE_OPTIONS): Add "foreign".
* doc/Makefile.in: Regenerate.
gas/
* doc/Makefile.am (AUTOMAKE_OPTIONS): Add "foreign".
* doc/Makefile.in: Regenerate.
zlib/
* Makefile.in: Regenerate.

7 years agoEnable hardware watchpoints on attach for aarch64
Richard Bunt [Thu, 21 Jun 2018 13:09:34 +0000 (14:09 +0100)] 
Enable hardware watchpoints on attach for aarch64

This commit fixes a bug whereby hardware watchpoints are not used on
aarch64 when attaching to a target. The fix adds an aarch64 specialization
of post_attach which records the number of available hardware debug registers
using aarch64_linux_get_debug_reg_capacity. This implementation mirrors that
of aarch64_linux_child_post_startup_inferior which successfully enables the
use of hardware watchpoints when launching the target under the debugger.

gdb/ChangeLog:

* aarch64-linux-nat.c (post_attach): New.
(aarch64_linux_nat_target::post_attach): Override post_attach to
record the number of hardware debug registers.

gdb/testsuite/ChangeLog:

* gdb.base/watchpoint-hw-attach.c: New test.
* gdb.base/watchpoint-hw-attach.exp: New file.

7 years agoUse offsets instead of addresses in ELF_SECTION_IN_SEGMENT for non SHT_NOBITS
Alan Hayward [Thu, 21 Jun 2018 08:37:58 +0000 (09:37 +0100)] 
Use offsets instead of addresses in ELF_SECTION_IN_SEGMENT for non SHT_NOBITS

For sections that are not SHT_NOBITS, use sh_offset and p_offset instead of
sh_addr and p_vaddr when calculating if a section fits in a segment. Both
methods are valid when using the GNU linker.

include/
* elf/internal.h (ELF_SECTION_IN_SEGMENT): Don’t check addresses
for non SHT_NOBITS.

7 years agoFix a memory leak in py-param.c
Tom Tromey [Wed, 20 Jun 2018 21:35:04 +0000 (15:35 -0600)] 
Fix a memory leak in py-param.c

Mark Wielaard pointed out this memory leak to me:

    ==17633== 775 bytes in 1 blocks are definitely lost in loss record 13,346 of 13,967
    ==17633==    at 0x4C2DB6B: malloc (vg_replace_malloc.c:299)
    ==17633==    by 0x6652B7: xmalloc (common-utils.c:45)
    ==17633==    by 0xC4C889: xstrdup (xstrdup.c:34)
    ==17633==    by 0x5A71FD: unicode_to_encoded_string(_object*, char const*) (py-utils.c:81)
    ==17633==    by 0x5A73EB: python_string_to_host_string(_object*) (py-utils.c:158)
    ==17633==    by 0x59CC6C: get_doc_string(_object*, _object*) (py-param.c:334)
    ==17633==    by 0x59D2AA: parmpy_init(_object*, _object*, _object*) (py-param.c:728)

The bug here is that parmpy_init is written as though
add_setshow_generic takes ownership of its doc-string arguments.
However, it does not.  This patch fixes the bug in a straightforward
way and also applies some missing constification to make the problem
more apparent.

Tested on x86-64 Fedora 26.

gdb/ChangeLog
2018-06-20  Tom Tromey  <tom@tromey.com>

* python/py-param.c (add_setshow_generic): Make parameters const.
(parmpy_init): Update.

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 21 Jun 2018 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoRename regcache_cooked_read_ftype and make a function_view
Simon Marchi [Wed, 20 Jun 2018 16:49:03 +0000 (12:49 -0400)] 
Rename regcache_cooked_read_ftype and make a function_view

regcache_cooked_read_ftype can be converted to a function_view, which
allows us to use lambda functions and therefore avoid having to pass an
opaque pointer parameter.

Adjusting the fallouts showed that the "const regcache &" passed to the
readonly_detached_regcache constructor is cast to non-const in
do_cooked_read.  I changed the constructor parameter to be non-const.

Finally, I renamed the typedef from regcache_cooked_read_ftype to
register_read_ftype, since there is nothing that forces us to use it
only for regcaches nor cooked registers.

gdb/ChangeLog:

* regcache.h (regcache_cooked_read_ftype): Rename to...
(register_read_ftype): ...this, change type to function_view.
(class reg_buffer) <save>: Remove src parameter.
(readonly_detached_regcache) <readonly_detached_regcache>: Make
parameter non-const in first overload.  Remove src parameter in
second overload.
* regcache.c (do_cooked_read): Remove.
(readonly_detached_regcache::readonly_detached_regcache): Make
parameter non-const, adjust call to other constructor.
(reg_buffer::save): Remove src parameter.
* frame.c (do_frame_register_read): Remove.
(frame_save_as_regcache): Use lambda function.
* ppc-linux-tdep.c (ppu2spu_unwind_register): Change type of src
parameter to ppu2spu_data *.
(ppu2spu_sniffer): Use lambda function.

7 years agotestsuite: Fix cc-with-tweaks.sh being executed in the wrong shell
Simon Marchi [Wed, 20 Jun 2018 16:46:28 +0000 (12:46 -0400)] 
testsuite: Fix cc-with-tweaks.sh being executed in the wrong shell

The cc-with-tweaks.sh script needs to be executed with bash.  When
trying to run this:

  make check RUNTESTFLAGS="--target_board=dwarf4-gdb-index" TESTS="gdb.base/return.exp"

I get:

  gdb compile failed, /home/emaisin/src/binutils-gdb/gdb/contrib/cc-with-tweaks.sh: 174: /home/emaisin/src/binutils-gdb/gdb/contrib/cc-with-tweaks.sh: Bad substitution

The reason is that the board files execute cc-with-tweaks.sh using
/bin/sh, which points to dash on my machine.  Remove the /bin/sh part
and let the shebang choose the right interpreter.

gdb/testsuite/ChangeLog:

* boards/cc-with-tweaks.exp: Don't call cc-with-tweaks.sh
through /bin/sh.
* boards/dwarf4-gdb-index.exp: Likewise.
* boards/fission-dwp.exp: Likewise.

7 years agoRemove struct keyword in range-based for-loop
Simon Marchi [Wed, 20 Jun 2018 16:40:54 +0000 (12:40 -0400)] 
Remove struct keyword in range-based for-loop

Fix this with gcc 6.3.0, and make the loop variable const while at it:

/home/simark/src/binutils-gdb/gdb/record-full.c: In member function 'virtual int record_full_target::insert_breakpoint(gdbarch*, bp_target_info*)':
/home/simark/src/binutils-gdb/gdb/record-full.c:1789:8: error: types may not be defined in a for-range-declaration [-Werror]
   for (struct record_full_breakpoint &bp : record_full_breakpoints)

gdb/ChangeLog:

* record-full.c (record_full_target::insert_breakpoint): Remove
"struct" keyword, add const.

7 years agoFix potential illegal memroy access when using a build-id note with a negative size.
Nick Clifton [Wed, 20 Jun 2018 15:30:05 +0000 (16:30 +0100)] 
Fix potential illegal memroy access when using a build-id note with a negative size.

PR 23316
* opncls.c (get_build_id): Check for a negative or excessive data
size in the build-id note.

7 years agoImprove gdb.base/float128.exp failure message
Ulrich Weigand [Wed, 20 Jun 2018 14:24:16 +0000 (16:24 +0200)] 
Improve gdb.base/float128.exp failure message

If the "print large128" sub-test fails in a manner that typically
indicates internal overflow due to GDB being built without MPFR
support, explicitly state this in the failure message.

gdb/testsuite/ChangeLog:
2018-06-20  Ulrich Weigand  <uweigand@de.ibm.com>

* gdb.base/float128.exp: Add comment and improved fail message
to the failure case of "print large128" test.

7 years ago[BFD][AARCH64]Properly truncate no overflow checking relocation value for load/store...
Renlin Li [Fri, 27 Apr 2018 09:48:18 +0000 (10:48 +0100)] 
[BFD][AARCH64]Properly truncate no overflow checking relocation value for load/store immediate.

bfd/ChangeLog:

2018-06-20  Renlin Li  <renlin.li@arm.com>

* elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Use PG_OFFSET
to resolve BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.

ld/ChangeLog:

2018-06-20 Renlin Li  <renlin.li@arm.com>

* testsuite/ld-aarch64/emit-relocs-115.d: Update test with new value.
* testsuite/ld-aarch64/emit-relocs-534.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-555.d: Likewise.

7 years agoChange the ARM assembler's ADR and ADRl pseudo-ops so that they will only set the...
Nick Clifton [Wed, 20 Jun 2018 11:38:10 +0000 (12:38 +0100)] 
Change the ARM assembler's ADR and ADRl pseudo-ops so that they will only set the bottom bit of imported thumb function symbols if the -mthumb-interwork option is active.

For more information see the email thread starting here:
https://www.sourceware.org/ml/binutils/2018-05/msg00348.html

PR 21458
* tc-arm.c (do_adr): Only set the bottom bit of an imported thumb
function symbol address if -mthumb-interwork is active.
(do_adrl): Likewise.
* doc/c-arm.texi: Update descriptions of the -mthumb-interwork
option and the ADR and ADRL pseudo-ops.
* NEWS: Mention the new behaviour of the ADR and ADRL pseudo-ops.
* testsuite/gas/arm/pr21458.d: Add -mthumb-interwork option to
assembler command line.
* testsuite/gas/arm/adr.d: Likewise.
* testsuite/gas/arm/adrl.d: Likewise.

7 years agoStop objcopy from corrupting mach-o files.
Nick Clifton [Wed, 20 Jun 2018 09:43:00 +0000 (10:43 +0100)] 
Stop objcopy from corrupting mach-o files.

PR 23299
* mach-o.c (cputype): New function.
(cpusubtype): New function.
(bfd_mach_o_bfd_print_private_data): New function.  Dispalys the
values in the MACH-O file header.
(bfd_mach_o_bfd_copy_private_header_data): Copy the cputype and
cpusubtype fields from the input bfd's mach-o header to the output
bfd.
* mach-o-target.c (bfd_mach_o_bfd_print_private_bfd_data):
Redefine to bfd_mach_o_bfd_print_private_data.
* mach-o.h (bfd_mach_o_bfd_print_private_bfd_data): Prototype.

7 years agoFix problem where gold does not create base version for executables.
Cary Coutant [Wed, 20 Jun 2018 08:24:11 +0000 (01:24 -0700)] 
Fix problem where gold does not create base version for executables.

gold/
PR gold/23268
* dynobj.cc (Versions::Versions): Change init for needs_base_version_.
(Versions::record_version): Add verdefs for both shared objects and
executables.
(Versions::add_def): Likewise for base version.
(Versions::add_need): Don't add base version for executables.
(Versions::version_index): Look up version for both shared objects and
executables.
* testsuite/Makefile.am (ver_test_14): New test case.
* testsuite/Makefile.in: Regenerate.
* testsuite/ver_test_14.script: New version script.
* testsuite/ver_test_14.sh: New test script.

7 years agoRISC-V: Accept constant operands in la and lla
Sebastian Huber [Tue, 19 Jun 2018 05:12:48 +0000 (07:12 +0200)] 
RISC-V: Accept constant operands in la and lla

opcodes/
PR gas/23305
* riscv-opc.c (riscv_opcodes): Use new format specifier 'B' for
la and lla.

gas/
PR gas/23305
* config/tc-riscv.c (riscv_ip): Add format specifier 'B' for
constants and symbols.
* testsuite/gas/riscv/lla32.d: New file.
* testsuite/gas/riscv/lla32.s: Likewise.
* testsuite/gas/riscv/lla64-fail.d: Likewise.
* testsuite/gas/riscv/lla64-fail.l: Likewise.
* testsuite/gas/riscv/lla64-fail.s: Likewise.
* testsuite/gas/riscv/lla64.d: Likewise.
* testsuite/gas/riscv/lla64.s: Likewise.

7 years agoFix typo in most recent entry.
Cary Coutant [Wed, 20 Jun 2018 02:03:25 +0000 (19:03 -0700)] 
Fix typo in most recent entry.

7 years agoReplace thread config with automatic config using ax_pthread.m4.
Cary Coutant [Wed, 20 Jun 2018 01:57:28 +0000 (18:57 -0700)] 
Replace thread config with automatic config using ax_pthread.m4.

The autotools library macro (AX_PTHREAD) is now used to detect if
pthreads is present and multi-threaded linking in gold is automatically
enabled if it is found. This enables multi-threaded gold on platforms
where pthreads is enabled via other methods than just -lpthread
(e.g., MinGW).

2018-06-19  Joshua Watt  <jpewhacker@gmail.com>
    Cary Coutant  <ccoutant@gmail.com>

gold/
* configure.ac: Replace manual thread configuration with AX_PTHREAD.
Add --enable-threads=auto.
* Makefile.am (THREADFLAGS, THREADLIBS): New defines.
(AM_CFLAGS, AM_CXXFLAGS): Add $(THREADFLAGS.
(THREADSLIB): Remove; change all references to THREADLIBS.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* config.in: Regenerate.
* configure: Regenerate.
* testsuite/Makefile.am (THREADSLIB): Replace with...
(THREADFLAGS, THREADLIBS): ... these.
(LDADD): Remove; add as individual defines for...
(object_unittest, binary_unittest, leb128_unittest)
(overflow_unittest): ... these tests.
(tls_test, tls_pic_test, tls_pie_test, tls_pie_pic_test)
(tls_shared_test, tls_shared_ie_test, tls_shared_gd_to_ie_test)
(tls_shared_gnu2_gd_to_ie_test, tls_shared_gnu2_test_LDFLAGS)
(tls_shared_nonpic_test_LDFLAGS): Add $(THREADFLAGS) and ($THREADLIBS).
* testsuite/Makefile.in: Regenerate.

7 years agoRemove *.stderr when "make clean".
Cary Coutant [Tue, 19 Jun 2018 23:52:54 +0000 (16:52 -0700)] 
Remove *.stderr when "make clean".

gold/
* testsuite/Makefile.am (MOSTLYCLEANFILES): Add *.stderr.
* testsuite/Makefile.in: Regenerate.

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 20 Jun 2018 00:00:56 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoPR ld/22966: Fix n64 MIPS `.got.plt' range checks
Maciej W. Rozycki [Tue, 19 Jun 2018 23:37:51 +0000 (00:37 +0100)] 
PR ld/22966: Fix n64 MIPS `.got.plt' range checks

The addressable signed 32-bit range for n64 MIPS `.got.plt' references
is from 0xffffffff7fff8000 to 0x7fff7fff, due to how the composition of
an LUI and an LD instruction works for address calculation in the 64-bit
addressing mode, such as when CP0.Status.UX=1.

We currently have a range check in `mips_finish_exec_plt', however it is
not correct as it verifies that the `.got.plt' start address referred is
between 0xffffffff80000000 and 0x7fffffff.  It is also implemented as an
assertion rather than a proper error message despite that the situation
can be triggered by user input.  Additionally there is no check made for
individual `.got.plt' entries referred even though they can be out of
range while the `.got.plt' start address is not.

Fix all these problems and use the correct range for the check, limiting
it to n64 output files, and then issue a proper error message both in
`mips_finish_exec_plt' and in `_bfd_mips_elf_finish_dynamic_symbol',
suggesting the use of the `-Ttext-segment=...' option that will often
work and with the default linker scripts in particular.  Add suitable
tests covering boundary cases.

bfd/
PR ld/22966
* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Verify the
`.got.plt' entry referred is in range.
(mips_finish_exec_plt): Correct the range check for `.got.plt'
start.  Replace the assertion used for that with a proper error
message.

ld/
PR ld/22966
* testsuite/ld-mips-elf/n64-plt-1.dd: New test.
* testsuite/ld-mips-elf/n64-plt-1.gd: New test.
* testsuite/ld-mips-elf/n64-plt-2.ed: New test.
* testsuite/ld-mips-elf/n64-plt-3.ed: New test.
* testsuite/ld-mips-elf/n64-plt-4.dd: New test.
* testsuite/ld-mips-elf/n64-plt-4.gd: New test.
* testsuite/ld-mips-elf/n64-plt-1.ld: New test linker script.
* testsuite/ld-mips-elf/n64-plt-2.ld: New test linker script.
* testsuite/ld-mips-elf/n64-plt-3.ld: New test linker script.
* testsuite/ld-mips-elf/n64-plt-4.ld: New test linker script.
* testsuite/ld-mips-elf/n64-plt.s: New test source.
* testsuite/ld-mips-elf/n64-plt-lib.s: New test source.
* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.

7 years agoMIPS/BFD: Fix `loc' formatting in `_bfd_mips_elf_finish_dynamic_symbol'
Maciej W. Rozycki [Tue, 19 Jun 2018 23:37:51 +0000 (00:37 +0100)] 
MIPS/BFD: Fix `loc' formatting in `_bfd_mips_elf_finish_dynamic_symbol'

Fix a formatting fallout in `_bfd_mips_elf_finish_dynamic_symbol' from
commit ce558b89b15a ("Delete duplicate target short-cuts to dynamic
sections").

bfd/
* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Fix
formatting.

7 years agoMIPS/LD/testsuite: XFAIL DT_TEXTREL map file warning test
Maciej W. Rozycki [Tue, 19 Jun 2018 23:37:51 +0000 (00:37 +0100)] 
MIPS/LD/testsuite: XFAIL DT_TEXTREL map file warning test

Remove:

FAIL: DT_TEXTREL map file warning

introduced with commit 63c1f59d6655 ("readonly_dynrelocs"), coming from
the lack of a "dynamic relocation against `foo' in read-only section
`.rodata'" warning message produced.

The cause of the failure is that for sections which have dynamic
relocations attached the MIPS backend sets SHF_WRITE, in
`mips_elf_create_dynamic_relocation', yielding:

$ readelf -S textrel.so | grep rodata
  [ 8] .rodata           PROGBITS        00000254 000254 000004 00  WA  0   0  1
$

so the section is read/write and therefore there is nothing to warn
about.

This arrangement came from commit 7403cb6305f5 ("PATCH for N32 ABI"),
<https://sourceware.org/ml/binutils/1999-q2/msg00375.html>, i.e. for all
practical purposes it has been there since forever, and therefore it can
be considered a part of the ABI and the test case irrelevant for MIPS
targets.

We don't have a clean way to request UNSUPPORTED result, which would be
the most appropriate here, so just XFAIL the test instead.

ld/
* testsuite/ld-elf/shared.exp: XFAIL DT_TEXTREL map file warning
test for `mips*-*-*'.

7 years agoBump to autoconf 2.69 and automake 1.15.1
Simon Marchi [Tue, 19 Jun 2018 20:54:48 +0000 (16:54 -0400)] 
Bump to autoconf 2.69 and automake 1.15.1

When trying to run the update-gnulib.sh script in gdb, I get this:

Error: Wrong automake version (Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ([^      =:+{}]+)}/ at /opt/automake/1.11.1/bin/automake line 4113.), we need 1.11.1.
Aborting.

Apparently, it's an issue with a regex in automake that triggers a
warning starting with Perl 5.22.  It has been fixed in automake 1.15.1.
So I think it's a good excuse to bump the versions of autoconf and
automake used in the gnulib import.  And to avoid requiring multiple
builds of autoconf/automake, it was suggested that we bump the required
version of those tools for all binutils-gdb.

For autoconf, the 2.69 version is universally available, so it's an easy
choice.  For automake, different distros and distro versions have
different automake versions.  But 1.15.1 seems to be the most readily
available as a package.  In any case, it's easy to build it from source.

I removed the version checks from AUTOMAKE_OPTIONS and AC_PREREQ,
because I don't think they are useful in our case.  They only specify a
lower bound for the acceptable version of automake/autoconf.  That's
useful if you let the user choose the version of the tool they want to
use, but want to set a minimum version (because you use a feature that
was introduced in that version).  In our case, we force people to use a
specific version anyway.  For the autoconf version, we have the check in
config/override.m4 that enforces the version we want.  It will be one
less thing to update next time we change autotools version.

I hit a few categories of problems that required some changes.  They are
described below along with the chosen solutions.

Problem 1:

  configure.ac:17: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
  configure.ac:17: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation

Solution 1:

  Adjust the code based on the example at that URL.

Problem 2 (in zlib/):

  Makefile.am: error: required file './INSTALL' not found
  Makefile.am:   'automake --add-missing' can install 'INSTALL'
  Makefile.am: error: required file './NEWS' not found
  Makefile.am: error: required file './AUTHORS' not found
  Makefile.am: error: required file './COPYING' not found
  Makefile.am:   'automake --add-missing' can install 'COPYING'

Solution 2:

  Add the foreign option to AUTOMAKE_OPTIONS.

Problem 3:

  doc/Makefile.am:20: error: support for Cygnus-style trees has been removed

Solution 3:

  Remove the cygnus options.

Problem 4:

  Makefile.am:656: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

Solution 4:

  Rename "INCLUDES = " to "AM_CPPFLAGS += " (because AM_CPPFLAGS is
  already defined earlier).

Problem 5:

  doc/Makefile.am:71: warning: suffix '.texinfo' for Texinfo files is discouraged; use '.texi' instead
  doc/Makefile.am: warning: Oops!
  doc/Makefile.am:     It appears this file (or files included by it) are triggering
  doc/Makefile.am:     an undocumented, soon-to-be-removed automake hack.
  doc/Makefile.am:     Future automake versions will no longer place in the builddir
  doc/Makefile.am:     (rather than in the srcdir) the generated '.info' files that
  doc/Makefile.am:     appear to be cleaned, by e.g. being listed in CLEANFILES or
  doc/Makefile.am:     DISTCLEANFILES.
  doc/Makefile.am:     If you want your '.info' files to be placed in the builddir
  doc/Makefile.am:     rather than in the srcdir, you have to use the shiny new
  doc/Makefile.am:     'info-in-builddir' automake option.

Solution 5:

  Rename .texinfo files to .texi.

Problem 6:

  doc/Makefile.am: warning: Oops!
  doc/Makefile.am:     It appears this file (or files included by it) are triggering
  doc/Makefile.am:     an undocumented, soon-to-be-removed automake hack.
  doc/Makefile.am:     Future automake versions will no longer place in the builddir
  doc/Makefile.am:     (rather than in the srcdir) the generated '.info' files that
  doc/Makefile.am:     appear to be cleaned, by e.g. being listed in CLEANFILES or
  doc/Makefile.am:     DISTCLEANFILES.
  doc/Makefile.am:     If you want your '.info' files to be placed in the builddir
  doc/Makefile.am:     rather than in the srcdir, you have to use the shiny new
  doc/Makefile.am:     'info-in-builddir' automake option.

Solution 6:

  Remove the hack at the bottom of doc/Makefile.am and use
  the info-in-builddir automake option.

Problem 7:

  doc/Makefile.am:35: error: required file '../texinfo.tex' not found
  doc/Makefile.am:35:   'automake --add-missing' can install 'texinfo.tex'

Solution 7:

  Use the no-texinfo.tex automake option.  We also have one in
  texinfo/texinfo.tex, not sure if we should point to that, or move it
  (or a newer version of it added with automake --add-missing) to
  top-level.

Problem 8:

  Makefile.am:131: warning: source file 'config/tc-aarch64.c' is in a subdirectory,
  Makefile.am:131: but option 'subdir-objects' is disabled
  automake: warning: possible forward-incompatibility.
  automake: At least a source file is in a subdirectory, but the 'subdir-objects'
  automake: automake option hasn't been enabled.  For now, the corresponding output
  automake: object file(s) will be placed in the top-level directory.  However,
  automake: this behaviour will change in future Automake versions: they will
  automake: unconditionally cause object files to be placed in the same subdirectory
  automake: of the corresponding sources.
  automake: You are advised to start using 'subdir-objects' option throughout your
  automake: project, to avoid future incompatibilities.

Solution 8:

  Use subdir-objects, that means adjusting references to some .o that will now
  be in config/.

Problem 9:

  configure.ac:375: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
  ../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
  ../../lib/autoconf/general.m4:2601: _AC_COMPILE_IFELSE is expanded from...
  ../../lib/autoconf/general.m4:2617: AC_COMPILE_IFELSE is expanded from...
  ../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
  ../../lib/autoconf/general.m4:2042: AC_CACHE_VAL is expanded from...
  ../../lib/autoconf/general.m4:2063: AC_CACHE_CHECK is expanded from...
  configure.ac:375: the top level

Solution 9:

  Use AC_LANG_SOURCE, or use proper quoting.

Problem 10 (in intl/):

  configure.ac:7: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
  /usr/share/aclocal/threadlib.m4:36: gl_THREADLIB_EARLY_BODY is expanded from...
  /usr/share/aclocal/threadlib.m4:29: gl_THREADLIB_EARLY is expanded from...
  /usr/share/aclocal/threadlib.m4:318: gl_THREADLIB is expanded from...
  /usr/share/aclocal/lock.m4:9: gl_LOCK is expanded from...
  /usr/share/aclocal/intl.m4:211: gt_INTL_SUBDIR_CORE is expanded from...
  /usr/share/aclocal/intl.m4:25: AM_INTL_SUBDIR is expanded from...
  /usr/share/aclocal/gettext.m4:57: AM_GNU_GETTEXT is expanded from...
  configure.ac:7: the top level

Solution 10:

  Add AC_USE_SYSTEM_EXTENSIONS in configure.ac.

ChangeLog:

* libtool.m4: Use AC_LANG_SOURCE.
* configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE.
* README-maintainer-mode: Update version requirements.
* ar-lib: New file.
* test-driver: New file.
* configure: Re-generate.

bfd/ChangeLog:

* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11.
(INCLUDES): Rename to ...
(AM_CPPFLAGS): ... this.
* configure.ac: Remove AC_PREREQ.
* doc/Makefile.am (AUTOMAKE_OPTIONS): Remove 1.9, cygnus, add
info-in-builddir no-texinfo.tex.
(info_TEXINFOS): Rename bfd.texinfo to bfd.texi.
* doc/bfd.texinfo: Rename to ...
* doc/bfd.texi: ... this.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* config.in: Re-generate.
* configure: Re-generate.
* doc/Makefile.in: Re-generate.

binutils/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* doc/Makefile.am (AUTOMAKE_OPTIONS): Remove cygnus, add
info-in-builddir no-texinfo.tex.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* config.in: Re-generate.
* configure: Re-generate.
* doc/Makefile.in: Re-generate.

config/ChangeLog:

* override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69.

etc/ChangeLog:

* configure.in: Remove AC_PREREQ.
* configure: Re-generate.

gas/ChangeLog:

* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11, add subdir-objects.
(TARG_CPU_O, OBJ_FORMAT_O, ATOF_TARG_O): Add config/ prefix.
* configure.ac (TARG_CPU_O, OBJ_FORMAT_O, ATOF_TARG_O, emfiles,
extra_objects): Add config/ prefix.
* doc/as.texinfo: Rename to...
* doc/as.texi: ... this.
* doc/Makefile.am: Rename as.texinfo to as.texi throughout.
Remove DISTCLEANFILES hack.
(AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add no-texinfo.tex and
info-in-builddir.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* config.in: Re-generate.
* configure: Re-generate.
* doc/Makefile.in: Re-generate.

gdb/ChangeLog:

* common/common-defs.h (PACKAGE_NAME, PACKAGE_VERSION,
PACKAGE_STRING, PACKAGE_TARNAME): Undefine.
* configure.ac: Remove AC_PREREQ, add missing quoting.
* gnulib/configure.ac: Modernize usage of
AC_INIT/AM_INIT_AUTOMAKE.  Remove AC_PREREQ.
* gnulib/update-gnulib.sh (AUTOCONF_VERSION): Bump to 2.69.
(AUTOMAKE_VERSION): Bump to 1.15.1.
* configure: Re-generate.
* config.in: Re-generate.
* aclocal.m4: Re-generate.
* gnulib/aclocal.m4: Re-generate.
* gnulib/config.in: Re-generate.
* gnulib/configure: Re-generate.
* gnulib/import/Makefile.in: Re-generate.

gdb/gdbserver/ChangeLog:

* configure.ac: Remove AC_PREREQ, add missing quoting.
* configure: Re-generate.
* config.in: Re-generate.
* aclocal.m4: Re-generate.

gdb/testsuite/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* configure: Re-generate.

gold/ChangeLog:

* configure.ac: Remove AC_PREREQ, add missing quoting and usage
of AC_LANG_SOURCE.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* configure: Re-generate.
* testsuite/Makefile.in: Re-generate.

gprof/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* Makefile.am: Remove DISTCLEANFILES hack.
(AUTOMAKE_OPTIONS): Remove 1.11, add info-in-builddir.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* configure: Re-generate.
* gconfig.in: Re-generate.

intl/ChangeLog:

* configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ.
* configure: Re-generate.
* config.h.in: Re-generate.
* aclocal.m4: Re-generate.

ld/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* Makefile.am: Remove DISTCLEANFILES hack, rename ld.texinfo to
ld.texi, ldint.texinfo to ldint.texi throughout.
(AUTOMAKE_OPTIONS): Add info-in-builddir.
* README: Rename ld.texinfo to ld.texi, ldint.texinfo to
ldint.texi throughout.
* gen-doc.texi: Likewise.
* h8-doc.texi: Likewise.
* ld.texinfo: Rename to ...
* ld.texi: ... this.
* ldint.texinfo: Rename to ...
* ldint.texi: ... this.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* config.in: Re-generate.
* configure: Re-generate.

libdecnumber/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* configure: Re-generate.
* aclocal.m4.

libiberty/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* configure: Re-generate.
* config.in: Re-generate.

opcodes/ChangeLog:

* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11.
* configure.ac: Remove AC_PREREQ.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* configure: Re-generate.

readline/ChangeLog.gdb:

* configure: Re-generate.
* examples/rlfe/configure: Re-generate.

sim/ChangeLog:

* All configure.ac: Remove AC_PREREQ.
* All configure: Re-generate.

zlib/ChangeLog.bin-gdb:

* configure.ac: Modernize AC_INIT call, remove AC_PREREQ.
* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add
foreign.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* configure: Re-generate.

7 years agoinclude: Sync with GCC
Simon Marchi [Mon, 18 Jun 2018 15:31:15 +0000 (11:31 -0400)] 
include: Sync with GCC

Bring changes from GCC in shared headers.

include/ChangeLog:

Sync with GCC

2018-05-24  Tom Rix  <trix@juniper.net>

* dwarf2.def (DW_FORM_strx*, DW_FORM_addrx*): New.

2017-11-20  Kito Cheng  <kito.cheng@gmail.com>

* longlong.h [__riscv] (__umulsidi3): Define.
[__riscv] (umul_ppmm): Likewise.
[__riscv] (__muluw3): Likewise.

7 years agoSilence -Wmaybe-uninitialized warning in minsyms.c:lookup_minimal_symbol_by_pc_section
Pedro Alves [Tue, 19 Jun 2018 17:16:40 +0000 (18:16 +0100)] 
Silence -Wmaybe-uninitialized warning in minsyms.c:lookup_minimal_symbol_by_pc_section

Compiling with GCC 8.1 shows this warning:

  gdb/minsyms.c: In function 'bound_minimal_symbol lookup_minimal_symbol_by_pc_section(CORE_ADDR, obj_section*, lookup_msym_prefer)':
  gdb/minsyms.c:825:40: warning: 'want_type' may be used uninitialized in this function [-Wmaybe-uninitialized]
   && MSYMBOL_TYPE (&msymbol[hi]) != want_type

That warning is a false positive, because the switch that converts
enum lookup_msym_prefer values to enum enum minimal_symbol_type values
has a case for every lookup_msym_prefer enumerator:

  switch (prefer)
   {
    case lookup_msym_prefer::TEXT:
      want_type = mst_text;
      break;
    case lookup_msym_prefer::TRAMPOLINE:
      want_type = mst_solib_trampoline;
      break;
    case lookup_msym_prefer::GNU_IFUNC:
      want_type = mst_text_gnu_ifunc;
      break;
    }

The problem is that GCC assumes that enum variables may hold values
other than the named enumerators (like e.g., "lookup_msym_prefer
prefer = (lookup_msym_prefer) 10;").

Rework the code a bit, adding a gdb_assert to make it explicit to the
compiler that want_type is initialized in all normal-return paths.

gdb/ChangeLog:
2018-06-19  Pedro Alves  <palves@redhat.com>

* minsyms.c (msym_prefer_to_msym_type): New, factored out from ...
(lookup_minimal_symbol_by_pc_section): ... here with
gdb_assert_not_reached added.

7 years agoChange inline frame breakpoint skipping logic (fix gdb.gdb/selftest.exp)
Pedro Alves [Tue, 19 Jun 2018 15:30:13 +0000 (16:30 +0100)] 
Change inline frame breakpoint skipping logic (fix gdb.gdb/selftest.exp)

Currently, gdb.gdb/selftest.exp fails if you build GDB with
optimization (-O2, etc.).

The reason is that after setting a breakpoint in captured_main, we
stop at:
 ...
 Breakpoint 1, captured_main_1 (context=<optimized out>) at src/gdb/main.c:492
 ...
while selftest_setup expects a stop at captured_main.

Here, captured_main_1 has been inlined into captured_main, and
captured_main has been inlined into gdb_main:

 ...
 $ nm ./build/gdb/gdb | egrep ' [tT] .*captured_main|gdb_main' | c++filt
 000000000061b950 T gdb_main(captured_main_args*)
 ...

Indeed, the two inlined functions show up in the backtrace:

 ...
 (gdb) bt
 #0  captured_main_1 (context=<optimized out>) at main.c:492
 #1  captured_main (data=<optimized out>) at main.c:1147
 #2  gdb_main (args=args@entry=0x7fffffffdb80) at main.c:1173
 #3  0x000000000040fea5 in main (argc=<optimized out>, argv=<optimized out>)
     at gdb.c:32
 ...

We're now stopping at captured_main_1 because commit ddfe970e6bec
("Don't elide all inlined frames") makes GDB present a stop at the
innermost inlined frame if the program stopped by a user breakpoint.

Now, the selftest.exp testcase explicitly asks to stop at
"captured_main", not "captured_main_1", so I'm thinking that it's
GDB'S behavior that should be improved.  That is what this commit
does, by only showing a stop at an inline frame if the user breakpoint
was set in that frame's block.

Before this commit:

 (top-gdb) b captured_main
 Breakpoint 1 at 0x792f99: file src/gdb/main.c, line 492.
 (top-gdb) r
 Starting program: build/gdb/gdb

 Breakpoint 1, captured_main_1 (context=<optimized out>) at src/gdb/main.c:492
 492       lim_at_start = (char *) sbrk (0);
 (top-gdb)

After this commit, we now instead get:

 (top-gdb) b captured_main
 Breakpoint 1 at 0x791339: file src/gdb/main.c, line 492.
 (top-gdb) r
 Starting program: build/gdb/gdb

 Breakpoint 1, captured_main (data=<optimized out>) at src/gdb/main.c:1147
 1147      captured_main_1 (context);
 (top-gdb)

and:

 (top-gdb) b captured_main_1
 Breakpoint 2 at 0x791339: file src/gdb/main.c, line 492.
 (top-gdb) r
 Starting program: build/gdb/gdb
 Breakpoint 2, captured_main_1 (context=<optimized out>) at src/gdb/main.c:492
 492       lim_at_start = (char *) sbrk (0);
 (top-gdb)

Note that both captured_main and captured_main_1 resolved to the same
address, 0x791339.  That is necessary to trigger the issue in
question.  The gdb.base/inline-break.exp testcase currently does not
exercise that, but the new test added by this commit does.  That new
test fails without the GDB fix and passes with the fix.  No
regressions on x86-64 GNU/Linux.

While at it, the THIS_PC comparison in stopped_by_user_bp_inline_frame
is basically a nop, so just remove it -- if a software or hardware
breakpoint explains the stop, then it must be that it was installed at
the current PC.

gdb/ChangeLog:
2018-06-19  Pedro Alves  <palves@redhat.com>

* inline-frame.c (stopped_by_user_bp_inline_frame): Replace PC
parameter with a block parameter.  Compare location's block symbol
with the frame's block instead of addresses.
(skip_inline_frames): Pass the current block instead of the
frame's address.  Break out as soon as we determine the frame
should not be skipped.

gdb/testsuite/ChangeLog:
2018-06-19  Pedro Alves  <palves@redhat.com>

* gdb.opt/inline-break.c (func_inline_callee, func_inline_caller)
(func_extern_caller): New.
(main): Call func_extern_caller.
* gdb.opt/inline-break.exp: Add tests for inline frame skipping
logic change.

7 years agoFix ChangeLog entry
Andreas Schwab [Tue, 19 Jun 2018 14:39:40 +0000 (16:39 +0200)] 
Fix ChangeLog entry

7 years agoreadelf: Handle more RISC-V relocations
Andreas Schwab [Mon, 18 Jun 2018 08:29:31 +0000 (10:29 +0200)] 
readelf: Handle more RISC-V relocations

* readelf.c (is_16bit_abs_reloc): Handle R_RISCV_SET16.
(is_8bit_abs_reloc): New function.
(is_6bit_abs_reloc): New function.
(is_6bit_inplace_sub_reloc): New function.
(apply_relocations): Use them.  Handle 6-bit relocations.

7 years agoFix ChangeLog merge conflict
Simon Marchi [Tue, 19 Jun 2018 00:44:50 +0000 (20:44 -0400)] 
Fix ChangeLog merge conflict

I noticed that gdb/testsuite/ChangeLog had some conflict markers... this
patch fixes it.

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 19 Jun 2018 00:01:05 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoThis was already applied on the GCC side.
Eric Botcazou [Mon, 18 Jun 2018 22:05:40 +0000 (00:05 +0200)] 
This was already applied on the GCC side.

* Makefile.def (fortran): Add check-target-libgomp-fortran.
* Makefile.tpl (check-target-libgomp-fortran): New phony target.
* Makefile.in: Regenerate.

* configure: Regenerate.

7 years agoFix failure to find member of a typedef base class
Weimin Pan [Mon, 18 Jun 2018 21:15:13 +0000 (21:15 +0000)] 
Fix failure to find member of a typedef base class

The test case below demonstrates the problem, as described in this PR's Comment 5:

typedef struct {
        int x;
} A;

struct C : A {
        int y;
};

int main()
{
        C c;
        return 55;
}

$ gdb a.out
(gdb) ptype C::x
Internal error: non-aggregate type to value_struct_elt_for_reference

In value_struct_elt_for_reference(), need to call check_typedef() on
the aggregate type to handle the case of *curtype being ptr->typedef.

Tested on x86_64-linux. No regressions.

7 years agoRemove current_traceframe declaration
Simon Marchi [Mon, 18 Jun 2018 20:21:30 +0000 (16:21 -0400)] 
Remove current_traceframe declaration

The variable has been removed in c12a508 ("Add client_state struct."),
remove the leftover declaration.

gdb/gdbserver/ChangeLog:

* tracepoint.h (current_traceframe): Remove declaration.

7 years agoUse unique_xmalloc_ptr in solib-aix.c
Tom Tromey [Sun, 27 May 2018 15:33:24 +0000 (09:33 -0600)] 
Use unique_xmalloc_ptr in solib-aix.c

This removes a cleanup from solib-aix.c via unique_xmalloc_ptr.

gdb/ChangeLog
2018-06-18  Tom Tromey  <tom@tromey.com>

* solib-aix.c (solib_aix_get_section_offsets): Return
unique_xmalloc_ptr.
(solib_aix_solib_create_inferior_hook): Update.