deliverable/binutils-gdb.git
7 years agoCall print_insn_mep in mep_gdb_print_insn
Yao Qi [Thu, 26 Jan 2017 14:29:19 +0000 (14:29 +0000)] 
Call print_insn_mep in mep_gdb_print_insn

opcodes/mep-dis.c:mep_print_insn has already had the code to
handle the case when info->section is NULL,

  /* Picking the right ISA bitmask for the current context is tricky.  */
  if (info->section)
    {
    }
  else /* sid or gdb */
    {
    }

so that we can still cal print_insn_mep even section can't be found.
On the other hand, user can disassemble an arbitrary address which
doesn't map to any section at all.

gdb:

2017-01-26  Yao Qi  <yao.qi@linaro.org>

* mep-tdep.c (mep_gdb_print_insn): Set info->arch
to bfd_arch_mep.  Don't return 0 if section is not
found.  Call print_insn_mep.

7 years agoRefactor disassembly code
Yao Qi [Thu, 26 Jan 2017 14:29:19 +0000 (14:29 +0000)] 
Refactor disassembly code

This patch addes class gdb_disassembler, and refactor
code to use it.  The gdb_disassembler object is saved
in disassember_info.application_data.  However,
disassember_info.application_data is already used by
gdb for arm, mips spu, and scm-disasm.  In arm and mips,
.application_data is gdbarch, but we can still get gdbarch
from gdb_disassember.

The use of application_data in spu is a little bit
complicated.  It creates its own disassemble_info, and
save spu_dis_asm_data in .application_data.  This will
overwrite the pointer to gdb_disassembler, so we need
to find another place to save spu_dis_asm_data.  I
extend disassemble_info, and put "id" there.

gdb:

2017-01-26  Pedro Alves  <palves@redhat.com>
    Yao Qi  <yao.qi@linaro.org>

* arm-tdep.c: Include "disasm.h".
(gdb_print_insn_arm): Update code to get gdbarch.
* disasm.c (dis_asm_read_memory): Change it to
gdb_disassembler::dis_asm_read_memory.
(dis_asm_memory_error): Likewise.
(dis_asm_print_address): Likewise.
(gdb_pretty_print_insn): Change it to
gdb_disassembler::pretty_print_insn.
(dump_insns): Add one argument gdb_disassemlber.  All
callers updated.
(do_mixed_source_and_assembly_deprecated): Likewise.
(do_mixed_source_and_assembly): Likewise.
(do_assembly_only): Likewise.
(gdb_disassembler::gdb_disassembler): New.
(gdb_disassembler::print_insn): New.
* disasm.h (class gdb_disassembler): New.
(gdb_pretty_print_insn): Remove declaration.
(gdb_disassemble_info): Likewise.
* guile/scm-disasm.c (class gdbscm_disassembler): New.
(gdbscm_disasm_read_memory_worker): Update.
(gdbscm_disasm_read_memory): Update.
(gdbscm_disasm_memory_error): Remove.
(gdbscm_disasm_print_address): Remove.
(gdbscm_disassembler::gdbscm_disassembler): New.
(gdbscm_print_insn_from_port): Update.
* mips-tdep.c: Include disasm.h.
(gdb_print_insn_mips): Update code to get gdbarch.
* record-btrace.c (btrace_insn_history): Update.
* spu-tdep.c: Include disasm.h.
(struct spu_dis_asm_data): Remove.
(struct spu_dis_asm_info): New.
(spu_dis_asm_print_address): Use spu_dis_asm_info to get
SPU id.
(gdb_print_insn_spu): Cast disassemble_info to
spu_dis_asm_info.

7 years agoNew function null_stream
Yao Qi [Thu, 26 Jan 2017 14:29:19 +0000 (14:29 +0000)] 
New function null_stream

This patch adds a new function null_stream, which returns a null
stream.  The null stream can be used in multiple places.  It is
used in gdb_insn_length, and the following patches will use it too.

gdb:

2017-01-26  Yao Qi  <yao.qi@linaro.org>

* disasm.c (do_ui_file_delete): Delete.
(gdb_insn_length): Move code creating stream to ...
* utils.c (null_stream): ... here.  New function.
* utils.h (null_stream): Declare.

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 26 Jan 2017 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoUse dwarf assembler in gdb.dwarf2/implptr-64bit.exp
Yao Qi [Wed, 25 Jan 2017 16:24:44 +0000 (16:24 +0000)] 
Use dwarf assembler in gdb.dwarf2/implptr-64bit.exp

This patch adds a DW_OP_implicit_value in dwarf assembler, and uses
dwarf assembler in implptr-64bit.exp.  Using dwarf assembler in
implptr-64bit.exp exposes some limitations in dwarf assembler,

 - some variables are not evaluated in the caller's context, so we
   can not pass variable to assembler, like this

       Dwarf::assemble $asm_file {

cu {
    version $dwarf_version
    addr_size $addr_size
    is_64 $is_64
} {
}

and

{DW_AT_type :$struct_label "DW_FORM_ref$ref_addr_size"}

   this limitation is fixed by adding "uplevel" and "subst".

 - dwarf assembler doesn't emit DW_FORM_ref_addr for label referencing.
   this limitation is fixed by adding a new character "%",

{ type %$int_label }

   this means we want to emit DW_FORM_ref_addr for label referencing.

 - we can't set the form of label referencing offset in dwarf assembler.
   Nowadays, dwarf assembler guesses the form of labels, which is
   DW_FORM_ref4.  However, in implptr-64bit.exp, both DW_FORM_ref4
   and DW_FORM_ref8 is used (see REF_ADDR in implptr-64bit.S).  This
   patch adds the flexibility of setting the form of label reference.
   Both of them below are valid,

{DW_AT_type :$struct_label}
{DW_AT_type :$struct_label DW_FORM_ref8}

   the former form is the default DW_FORM_ref4.

I compared the .debug_info of objects without and with this patch
applied.  There is no changes except abbrev numbers.

gdb/testsuite:

2017-01-25  Andreas Arnez  <arnez@linux.vnet.ibm.com>
    Yao Qi  <yao.qi@linaro.org>

* gdb.dwarf2/implptr-64bit.exp: Use dwarf assembler.
* gdb.dwarf2/implptr-64bit.S: Remove.
* lib/dwarf.exp (Dwarf): Handle character "%".  Evaluate some
variables in caller's context.  Add DW_OP_implicit_value.

7 years agoHandle DW_OP_GNU_implicit_pointer in dwarf assembler
Yao Qi [Wed, 25 Jan 2017 16:24:44 +0000 (16:24 +0000)] 
Handle DW_OP_GNU_implicit_pointer in dwarf assembler

DW_OP_GNU_implicit_pointer refers to a DIE with an offset of different
sizes in different dwarf versions.  In v2, the size is the pointer size,
while in v3 and above, it is the ref_addr size.  This patch fixes
dwarf assembler to emit the correct size of offset.  We've already fixed
this size issue in gdb,
https://sourceware.org/ml/gdb-patches/2011-09/msg00451.html

gdb/testsuite:

2017-01-25  Yao Qi  <yao.qi@linaro.org>

* lib/dwarf.exp (Dwarf::_location): Handle
DW_OP_GNU_implicit_pointer with proper size.

7 years agoClarify that include/opcode/ files are part of GNU opcodes
Dimitar Dimitrov [Wed, 25 Jan 2017 12:19:27 +0000 (12:19 +0000)] 
Clarify that include/opcode/ files are part of GNU opcodes

include/ChangeLog:
2017-01-25  Dimitar Dimitrov  <dimitar@dinux.eu>

        * opcode/hppa.h: Clarify that file is part of GNU opcodes.
        * opcode/i860.h: Ditto.
        * opcode/nios2.h: Ditto.
        * opcode/nios2r1.h: Ditto.
        * opcode/nios2r2.h: Ditto.
        * opcode/pru.h: Ditto.

opcodes/ChangeLog:
2017-01-25  Dimitar Dimitrov  <dimitar@dinux.eu>

        * pru-opc.c: Remove vague reference to a future GDB port.

7 years agoFix include/ChangeLog entry format
Pedro Alves [Wed, 25 Jan 2017 12:24:02 +0000 (12:24 +0000)] 
Fix include/ChangeLog entry format

Add missing <> around name.

7 years agoRemove all RTEMS a.out targets
Sebastian Huber [Wed, 25 Jan 2017 07:26:46 +0000 (17:56 +1030)] 
Remove all RTEMS a.out targets

* config.bfd (*-*-rtemsaout*): Mark as removed.

7 years agoMove RTEMS target configuration to ELF sections
Sebastian Huber [Wed, 25 Jan 2017 07:25:57 +0000 (17:55 +1030)] 
Move RTEMS target configuration to ELF sections

bfd/
* config.bfd (powerpcle-*-rtems*): Do not mark as removed.
(arm-*-rtems*): Move to (arm*-*-eabi*).
(i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
(m68-*-rtems*): Move to (m68*-*-elf*).
ld/
* configure.tgt (arm-*-rtems*): Move to (arm*-*-eabi*).
(bfin-*-rtems*): Move to (bfin*-*-elf*).
(i[3-7]86-*-rtems*): Move to (i[3-7]86*-*-elf*).
(m68*-*-rtems*): Move to (m68*-*-elf*).
(mips*-*-rtems*): Move to (mips*-*-elf*).
(or1k*-*-rtems*): Move to (or1k*-*-elf*).
(powerpc*-*-rtems*): Move to (powerpc*-*-elf*).
(sparc*-*-rtems*): Move to (sparc*-*-elf*).
(sparc64*-*-rtems*): Move to (sparc64*-*-elf*).

7 years agogas: Default to ELF for RTEMS targets
Sebastian Huber [Wed, 25 Jan 2017 07:24:47 +0000 (17:54 +1030)] 
gas: Default to ELF for RTEMS targets

* configure.tgt (aarch64*-*-rtems*): Remove.
(bfin-*-rtems*): Likewise.
(h8300-*-rtems*): Likewise.
(i386-*-rtems*): Likewise.
(m32c-*-rtems*): Likewise.
(m32r-*-rtems*): Likewise.
(m68k-*-rtems*): Likewise.
(mips-*-rtems*): Likewise.
(nios2-*-rtems*): Likewise.
(ppc-*-rtems*): Likewise.
(sh-*-rtems*): Likewise.
(sparc64-*-rtems*): Likewise.
(sparc-*-rtems*): Likewise.
(*-*-rtems*) Use ELF format.

7 years agogas: Use ARM EABI for RTEMS
Sebastian Huber [Wed, 25 Jan 2017 07:23:44 +0000 (17:53 +1030)] 
gas: Use ARM EABI for RTEMS

* configure.tgt (arm-*-rtems*): Move to (arm-*-eabi*).

7 years agoRemove all RTEMS COFF targets
Sebastian Huber [Wed, 25 Jan 2017 07:22:27 +0000 (17:52 +1030)] 
Remove all RTEMS COFF targets

bfd/
* config.bfd (*-*-rtemscoff*): Mark as removed.
gas/
* configure.tgt (sh-*-rtemscoff*): Remove.
ld/
* configure.tgt (h8300-*-rtemscoff*): Remove.
(i960-*-rtems*): Likewise.
(m68*-*-rtemscoff*): Likewise.
(sh-*-rtemscoff*): Likewise.

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 25 Jan 2017 00:00:22 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoFix typo in ExitedEvent doc
Simon Marchi [Tue, 24 Jan 2017 20:29:14 +0000 (15:29 -0500)] 
Fix typo in ExitedEvent doc

The field "inferior" of the ExitedEvent object is not displayed
properly.

gdb/doc/ChangeLog:

* python.texi (Events In Python): Fix typo.

7 years agoRISC-V gas: Remove em=linux from configure.tgt
Sebastian Huber [Thu, 19 Jan 2017 08:10:51 +0000 (09:10 +0100)] 
RISC-V gas: Remove em=linux from configure.tgt

The use of te-linux.h is unnecessary since the TE_LINUX define is unused
and LOCAL_LABELS_FB is defined to 1 in tc-riscv.h as well.

gas/
* configure.tgt (riscv*-*-*): Remove em=linux.

7 years agoPR ld/20828: Reorder the symbol sweep stage of section GC
Maciej W. Rozycki [Mon, 23 Jan 2017 11:38:20 +0000 (11:38 +0000)] 
PR ld/20828: Reorder the symbol sweep stage of section GC

Complement commit 81ff47b3a546 ("PR ld/20828: Fix linker script symbols
wrongly forced local with section GC") and move the symbol sweep stage
of section GC from `elf_gc_sweep' to `bfd_elf_size_dynamic_sections',
avoiding the need to clear the `forced_local' marker, problematic for
targets that have special processing in their `elf_backend_hide_symbol'
handler.  Set `mark' instead in `bfd_elf_record_link_assignment' and,
matching changes from commit 3bd43ebcb602 ("ld --gc-sections fail with
__tls_get_addr_opt"), also in PowerPC `__tls_get_addr_opt' handling
code, removing a:

FAIL: PR ld/20828 dynamic symbols with section GC (version script)

test suite failure with the `score-elf' target.

The rationale is it is enough if symbols are swept at the beginning of
`bfd_elf_size_dynamic_sections' as it is only in this function that the
size of the GOT, the dynamic symbol table and other dynamic sections is
determined, which will depend on the number of symbols making it to the
dynamic symbol table.  It is also appropriate to do the sweep at this
point as it is already after any changes have been made to symbols with
`bfd_elf_record_link_assignment', and not possible any earlier as calls
to that function are only made just beforehand -- barring audit entry
processing -- via `gld${EMULATION_NAME}_find_statement_assignment'
invoked from `gld${EMULATION_NAME}_before_allocation' which is the ELF
handler for `ldemul_before_allocation'.

bfd/
PR ld/20828
* elflink.c (bfd_elf_record_link_assignment): Revert last
change and don't ever clear `forced_local'.  Set `mark'
unconditionally.
(elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
file.
(elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
(bfd_elf_size_dynamic_sections): ... here.
* elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
and set `mark' instead in `__tls_get_addr_opt' processing.
* elf64-ppc.c (ppc64_elf_tls_setup): Likewise.

7 years agoSolaris2/LD: Fix anonymous version script acceptance bug
Maciej W. Rozycki [Mon, 23 Jan 2017 11:37:19 +0000 (11:37 +0000)] 
Solaris2/LD: Fix anonymous version script acceptance bug

Correct a bug in Solaris 2 linker emulation code triggered by a test
introduced with commit 81ff47b3a546 ("PR ld/20828: Fix linker script
symbols wrongly forced local with section GC") and only create implicit
version nodes if versioning is actually introduced with a version script
(or VERSION command) rather than only global vs local symbol visibility
selected, fixing an:

ld: anonymous version tag cannot be combined with other version tags

linker error produced whenever a version script (or VERSION command) is
used that does not assign symbol versions, such as:

{ global: foo; bar; local: *; };

and consequently removing a:

FAIL: PR ld/20828 dynamic symbols with section GC (version script)

test suite failure with the `x86_64-solaris2' target.

ld/
* emultempl/solaris2.em (elf_solaris2_before_allocation): Do not
add implicit version nodes if an anonymous version tag is being
used.

7 years ago[PATCH] Add NT_ARM_SVE
Alan Hayward [Tue, 24 Jan 2017 10:37:13 +0000 (10:37 +0000)] 
[PATCH] Add NT_ARM_SVE

* elf/common.h (NT_ARM_SVE): Define.

7 years ago[ld, testsuite] Always assemble those intermeidate .o files used later
Jiong Wang [Tue, 24 Jan 2017 09:33:00 +0000 (09:33 +0000)] 
[ld, testsuite] Always assemble those intermeidate .o files used later

ld/
* testsuite/ld-plugin/lto.exp (lto_link_elf_tests): Move "Compile 7",
"Compile 8a", "Compile 8b"...
(lto_compile_elf_tests): ...to here.  Always run these tests.
(lto_run_elf_tests): Move "LTO 7"...
(lto_run_elf_shared_tests): ...to here.  Restrict these tests on
environment where share library is supported.

7 years agoPowerPC dynamic relocations
Alan Modra [Mon, 23 Jan 2017 22:13:01 +0000 (08:43 +1030)] 
PowerPC dynamic relocations

This patch fixes a number of issues with powerpc dynamic relocations.

1) Both ppc and ppc64 were emitting more dynamic symbols and
relocations than necessary, due to not supporting static linker
resolution of tls_index entries for __tls_get_addr_opt.  This meant
that any @got@tlsgd or @got@tlsld reloc needed to make their symbols
dynamic and generate dptmod and dtprel relocs for the dynamic linker.
That would have been passable, but what happened was that practically
all @got relocations resulted in their symbols being made dynamic and
dynamic relocations emitted against the GOT entries.  (Mostly visible
on ppc32 executables since ppc64 gcc really only uses @got style
relocs for TLS.)

2) The PowerOpen syntax was not supported with __tls_get_addr_opt.
DTPMOD/DTPREL relocs on tls_index TOC entries did not use the trick of
forcing dynamic symbols and relocations so those entries always
resulted in the full __tls_get_addr processing.  gcc doesn't use the
PowerOpen syntax for TLS, and normally such code would be optimized to
TLS IE or LE so the impact of missing this support was minimal.

3) In an executable, relocations against GNU indirect functions always
used the value of their PLT stub.   While this is correct, it is
better in some cases to use a dynamic relocation.  An extra dynamic
relocation can mean that calls via function pointers need not bounce
through the PLT stub at runtime.

The patch also tidies the PLT handling code in ppc32
allocate_dynrelocs.  Allocating PLT entries after other dynamic relocs
allows the PLT loop to omit special handling for undefined weak
symbols, and that in turn allows the loop to be simplified.

bfd/
* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
where dynamic relocs are preferable.  Allow ifunc too.
(ensure_undefweak_dynamic): New function.
(allocate_dynrelocs): Use it here.  Move plt handling last and
don't make symbols dynamic, simplifying loop.  Only make undef
weak symbols with GOT entries dynamic.  Correct condition
for GOT relocs.  Handle dynamic relocs on ifuncs.  Correct
comments.  Remove goto.
(ppc_elf_relocate_section): Correct test for using dynamic
symbol on GOT relocs.  Rearrange test for emitting GOT relocs
to suit.  Set up explicit tls_index entries and implicit GOT
tls_index entries resolvable at link time for
__tls_get_addr_opt.  Simplify test to clear mem for prelink.
* elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
(ensure_undefweak_dynamic): New function.
(allocate_dynrelocs): Use it here.  Only make undef weak symbols
with GOT entries dynamic.  Remove unnecessary test of
WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
(ppc64_elf_relocate_section): Correct test for using dynamic
symbol on GOT relocs.  Rearrange test for emitting GOT relocs
to suit.  Set up explicit tls_index entries and implicit GOT
tls_index entries resolvable at link time for __tls_get_addr_opt.
Simplify expression to clear mem for prelink.
ld/
* testsuite/ld-powerpc/tlsexe.r: Update for fewer dynamic relocs
and symbols.
* testsuite/ld-powerpc/tlsexe.d: Likewise.
* testsuite/ld-powerpc/tlsexe.g: Likewise.

7 years agoAdd -e to test scripts where necessary.
Rahul Chaudhry [Tue, 24 Jan 2017 01:34:14 +0000 (17:34 -0800)] 
Add -e to test scripts where necessary.

gold/
        * testsuite/icf_safe_so_test.sh: Use "set -e".
        * testsuite/icf_safe_test.sh: Likewise.
        * testsuite/icf_test.sh: Likewise.

7 years agoAdd support for cmtst.
Jim Wilson [Tue, 24 Jan 2017 01:26:53 +0000 (17:26 -0800)] 
Add support for cmtst.

sim/aarch64/
* simulator.c (do_vec_compare): Add case 0x23 for CMTST.

sim/testsuite/sim/aarch64/
* cmtst.s: New.

7 years agoMake the sh_info field of .rel.plt point to .plt (MIPS).
Vladimir Radosavljevic [Tue, 24 Jan 2017 01:18:00 +0000 (17:18 -0800)] 
Make the sh_info field of .rel.plt point to .plt (MIPS).

gold/
* mips.cc (Mips_output_data_plt::rel_plt): Remove const from return
type.
(Target_mips::make_plt_entry): Make the sh_info field of .rel.plt
point to .plt.

7 years agoFix MIPS GOT when global symbols are forced to local visibility.
Vladimir Radosavljevic [Tue, 24 Jan 2017 01:12:10 +0000 (17:12 -0800)] 
Fix MIPS GOT when global symbols are forced to local visibility.

gold/
PR gold/21054
* mips.cc (Mips_got_info::record_global_got_symbol): Don't add symbol
to the dynamic symbol table if it is forced to local visibility.
(Target_mips::do_finalize_sections): Don't add __RLD_MAP symbol to the
dynamic symbol table if it is forced to local visibility.

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 24 Jan 2017 00:00:18 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoMinor simplification of (Python) find_thread_object
Simon Marchi [Mon, 23 Jan 2017 20:31:40 +0000 (15:31 -0500)] 
Minor simplification of (Python) find_thread_object

Since the reference to the Inferior Python object is managed by
gdbpy_ref (RAII), we can return directly from the loop.  It's just a
leftover from the cleanups era.

gdb/ChangeLog:

* python/py-inferior.c (find_thread_object): Return directly
from the loop.  Remove "found" variable.

7 years agoFix AArch64 relocation handling in ILP32 mode.
Yury Norov [Mon, 23 Jan 2017 17:07:13 +0000 (17:07 +0000)] 
Fix AArch64 relocation handling in ILP32 mode.

bfd * elfnn-aarch64.c: Fix relaxations for ILP32 mode.

ld * testsuite/ld-aarch64/aarch64-elf.exp: Run new tests.
* testsuite/ld-aarch64/tls-desc-ie-ilp32.d: New test.
* testsuite/ld-aarch64/tls-relax-all-ilp32.d: New test.
* testsuite/ld-aarch64/tls-relax-gd-le-ilp32.d: New test.
* testsuite/ld-aarch64/tls-relax-gdesc-le-2-ilp32.d: New test.
* testsuite/ld-aarch64/tls-relax-gdesc-le-ilp32.d: New test.
* testsuite/ld-aarch64/tls-relax-ie-le-2-ilp32.d: New test.
* testsuite/ld-aarch64/tls-relax-ie-le-3-ilp32.d: New test.
* testsuite/ld-aarch64/tls-relax-ie-le-ilp32.d: New test.
* testsuite/ld-aarch64/tls-tiny-desc-ie-ilp32.d: New test.
* testsuite/ld-aarch64/tls-tiny-desc-le-ilp32.d: New test.
* testsuite/ld-aarch64/tls-tiny-gd-ie-ilp32.d: New test.
* testsuite/ld-aarch64/tls-tiny-gd-le-ilp32.d: New test.

7 years agoFix typo in MAINTAINERS file
Nick Clifton [Mon, 23 Jan 2017 16:28:46 +0000 (16:28 +0000)] 
Fix typo in MAINTAINERS file

7 years agoRemove Mei Ligang as SCORE maintainer
Nick Clifton [Mon, 23 Jan 2017 16:20:57 +0000 (16:20 +0000)] 
Remove Mei Ligang as SCORE maintainer

7 years agoAdd Bernd Schmidt to Past Maintainers list
Nick Clifton [Mon, 23 Jan 2017 16:16:55 +0000 (16:16 +0000)] 
Add Bernd Schmidt to Past Maintainers list

7 years agoRestore ability to build zlib in a srcdir == builddir configuration.
Nick Clifton [Mon, 23 Jan 2017 15:57:59 +0000 (15:57 +0000)] 
Restore ability to build zlib in a srcdir == builddir configuration.

* configure.ac: Restore old behaviour of only enabling multilibs
when a target subdirectory is defined.  This allows building with
srcdir == builddir.
* configure: Regenerate.

7 years agoFix spelling mistakes and typos in the GAS sources.
Nick Clifton [Mon, 23 Jan 2017 15:23:07 +0000 (15:23 +0000)] 
Fix spelling mistakes and typos in the GAS sources.

PR gas/21072
* asintl.h: Fix spelling mistakes and typos.
* atof-generic.c: Likewise.
* bit_fix.h: Likewise.
* config/atof-ieee.c: Likewise.
* config/bfin-defs.h: Likewise.
* config/bfin-parse.y: Likewise.
* config/obj-coff-seh.h: Likewise.
* config/obj-coff.c: Likewise.
* config/obj-evax.c: Likewise.
* config/obj-macho.c: Likewise.
* config/rx-parse.y: Likewise.
* config/tc-aarch64.c: Likewise.
* config/tc-alpha.c: Likewise.
* config/tc-arc.c: Likewise.
* config/tc-arm.c: Likewise.
* config/tc-avr.c: Likewise.
* config/tc-bfin.c: Likewise.
* config/tc-cr16.c: Likewise.
* config/tc-cris.c: Likewise.
* config/tc-crx.c: Likewise.
* config/tc-d10v.c: Likewise.
* config/tc-d30v.c: Likewise.
* config/tc-dlx.c: Likewise.
* config/tc-epiphany.c: Likewise.
* config/tc-frv.c: Likewise.
* config/tc-hppa.c: Likewise.
* config/tc-i370.c: Likewise.
* config/tc-i386-intel.c: Likewise.
* config/tc-i386.c: Likewise.
* config/tc-i960.c: Likewise.
* config/tc-ia64.c: Likewise.
* config/tc-m32r.c: Likewise.
* config/tc-m68hc11.c: Likewise.
* config/tc-m68k.c: Likewise.
* config/tc-mcore.c: Likewise.
* config/tc-mep.c: Likewise.
* config/tc-mep.h: Likewise.
* config/tc-metag.c: Likewise.
* config/tc-microblaze.c: Likewise.
* config/tc-mips.c: Likewise.
* config/tc-mmix.c: Likewise.
* config/tc-mn10200.c: Likewise.
* config/tc-mn10300.c: Likewise.
* config/tc-msp430.c: Likewise.
* config/tc-msp430.h: Likewise.
* config/tc-nds32.c: Likewise.
* config/tc-nds32.h: Likewise.
* config/tc-nios2.c: Likewise.
* config/tc-nios2.h: Likewise.
* config/tc-ns32k.c: Likewise.
* config/tc-pdp11.c: Likewise.
* config/tc-ppc.c: Likewise.
* config/tc-pru.c: Likewise.
* config/tc-rx.c: Likewise.
* config/tc-s390.c: Likewise.
* config/tc-score.c: Likewise.
* config/tc-score7.c: Likewise.
* config/tc-sh.c: Likewise.
* config/tc-sh64.c: Likewise.
* config/tc-sparc.c: Likewise.
* config/tc-tic4x.c: Likewise.
* config/tc-tic54x.c: Likewise.
* config/tc-v850.c: Likewise.
* config/tc-vax.c: Likewise.
* config/tc-visium.c: Likewise.
* config/tc-xgate.c: Likewise.
* config/tc-xtensa.c: Likewise.
* config/tc-z80.c: Likewise.
* config/tc-z8k.c: Likewise.
* config/te-vms.c: Likewise.
* config/xtensa-relax.c: Likewise.
* doc/as.texinfo: Likewise.
* doc/c-arm.texi: Likewise.
* doc/c-hppa.texi: Likewise.
* doc/c-i370.texi: Likewise.
* doc/c-i386.texi: Likewise.
* doc/c-m32r.texi: Likewise.
* doc/c-m68k.texi: Likewise.
* doc/c-mmix.texi: Likewise.
* doc/c-msp430.texi: Likewise.
* doc/c-nds32.texi: Likewise.
* doc/c-ns32k.texi: Likewise.
* doc/c-riscv.texi: Likewise.
* doc/c-rx.texi: Likewise.
* doc/c-s390.texi: Likewise.
* doc/c-tic6x.texi: Likewise.
* doc/c-tilegx.texi: Likewise.
* doc/c-tilepro.texi: Likewise.
* doc/c-v850.texi: Likewise.
* doc/c-xgate.texi: Likewise.
* doc/c-xtensa.texi: Likewise.
* dwarf2dbg.c: Likewise.
* ecoff.c: Likewise.
* itbl-ops.c: Likewise.
* listing.c: Likewise.
* macro.c: Likewise.
* po/gas.pot: Likewise.
* read.c: Likewise.
* struc-symbol.h: Likewise.
* symbols.h: Likewise.
* testsuite/gas/arc/relocs-errors.err: Likewise.
* write.c: Likewise.

7 years ago * MAINTAINERS (BFIN): Remove myself as Blackfin maintainer.
Bernd Schmidt [Mon, 23 Jan 2017 14:00:23 +0000 (15:00 +0100)] 
   * MAINTAINERS (BFIN): Remove myself as Blackfin maintainer.

7 years agoUpdated Irish translation for ld and Swedish translation for gas.
Nick Clifton [Mon, 23 Jan 2017 13:32:12 +0000 (13:32 +0000)] 
Updated Irish translation for ld and Swedish translation for gas.

7 years agoSync top-level make and configure files with FSF GCC mainline versions.
Nick Clifton [Mon, 23 Jan 2017 11:55:48 +0000 (11:55 +0000)] 
Sync top-level make and configure files with FSF GCC mainline versions.

* configure.ac: Update year in copyright notice.
Sync from FSF GCC mainline, bringing in the following patches.
* Makefile.def: Likewise.
* Makefile.tpl: Likewise.
* configure: Regenerate.
* Makefile.in: Regenerate.

2016-12-21  Jakub Jelinek  <jakub@redhat.com>

* configure.ac: Don't bootstrap libmpx unless --with-build-config
includes bootstrap-mpx.

2016-12-01  Matthias Klose  <doko@ubuntu.com>

* configure.ac: Don't use pkg-config to check for bdw-gc.

2016-11-30  Matthias Klose  <doko@ubuntu.com>

* Makefile.def: Remove reference to boehm-gc target module.
   * configure.ac: Include pkg.m4, check for --with-target-bdw-gc
options and for the bdw-gc pkg-config module.

2016-11-15  Matthias Klose  <doko@ubuntu.com>

* config-ml.in: Remove references to GCJ.
* configure.ac: Likewise.

2016-09-30  Jakub Jelinek  <jakub@redhat.com>

* configure.ac: Add target-libffi to target_libraries.
Readd libgcj target disablings, modified to only target-libffi.
Readd target addition of go to unsupported languages.

2016-09-30  Andrew Haley  <aph@redhat.com>

* Makefile.def: Remove libjava.
* Makefile.tpl: Likewise.
* configure.ac: Likewise.

2016-09-26  Anton Kolesov  <Anton.Kolesov@synopsys.com>

* configure.ac: Disable "sim" directory for arc*-*-*.

2016-09-12  Maciej W. Rozycki  <macro@imgtec.com>

* configure.ac: Check for the minimum in-tree MPFR version
handled.

7 years agoPR ld/20828: Work around RISC-V failures
Maciej W. Rozycki [Mon, 23 Jan 2017 11:21:19 +0000 (11:21 +0000)] 
PR ld/20828: Work around RISC-V failures

Complement commit 81ff47b3a546 ("PR ld/20828: Fix linker script symbols
wrongly forced local with section GC") and add `.plt' to the list of
output sections created, fixing:

FAIL: PR ld/20828 dynamic symbols with section GC (auxiliary shared library)
FAIL: PR ld/20828 dynamic symbols with section GC (plain)
FAIL: PR ld/20828 dynamic symbols with section GC (version script)

failures with `riscv32-elf', `riscv32-linux', `riscv64-elf' and
`riscv64-linux' targets caused by LD crashing in the absence of such a
section.

ld/
PR ld/20828
* testsuite/ld-elf/pr20828.ld: Add `.plt'.

7 years agoPR ld/20828: Remove leading `_' from symbols used in tests
Maciej W. Rozycki [Mon, 23 Jan 2017 11:19:46 +0000 (11:19 +0000)] 
PR ld/20828: Remove leading `_' from symbols used in tests

Complement commit 81ff47b3a546 ("PR ld/20828: Fix linker script symbols
wrongly forced local with section GC") and remove the leading underscore
from `_fdata' and `_edata' symbols used in tests, fixing a:

FAIL: PR ld/20828 dynamic symbols with section GC (version script)

failure with targets such as: `bfin-elf', `bfin-uclinux', `metag-elf',
`metag-linux' `mn10300-elf', `sh-elf', `sh64-elf', and possibly other
ones, that have `_' set (with `elf_symbol_leading_char') as the leading
character for symbols.  As from commit 93252b1cf41a ("bfd/ld: handle ABI
prefixes in version scripts") these targets strip the leading underscore
before applying version script rules, because the (default) syntax for
symbol names is that of the C language rather than their low-level
symbol table encoding.

ld/
PR ld/20828
* testsuite/ld-elf/pr20828.ld: Rename `_fdata' and `_edata' to
`fdata' and `edata' respectively.
* testsuite/ld-elf/pr20828.ver: Adjust accordingly.
* testsuite/ld-elf/pr20828-a.sd: Likewise.
* testsuite/ld-elf/pr20828-b.sd: Likewise.
* testsuite/ld-elf/pr20828-c.sd: Likewise.

7 years agoPR ld/20828: Relax symbol ordering in tests
Maciej W. Rozycki [Mon, 23 Jan 2017 11:18:33 +0000 (11:18 +0000)] 
PR ld/20828: Relax symbol ordering in tests

Complement commit 81ff47b3a546 ("PR ld/20828: Fix linker script symbols
wrongly forced local with section GC") and make tests check for the
presence of global `_fdata' and `_edata' symbols separately, removing
any dependency on symbol table ordering for tests to succeed and
removing:

FAIL: PR ld/20828 dynamic symbols with section GC (auxiliary shared library)
FAIL: PR ld/20828 dynamic symbols with section GC (plain)

failures with the `x86_64-solaris2' target, which has additional
intervening entries:

Symbol table '.dynsym' contains 6 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT    1 _fdata
     2: 0000000000000000     0 OBJECT  GLOBAL DEFAULT    1 _DYNAMIC
     3: 0000000000000000     0 OBJECT  GLOBAL DEFAULT  ABS _PROCEDURE_LINKAGE_TABLE_
     4: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT    1 _edata
     5: 00000000000001b8     0 OBJECT  GLOBAL DEFAULT    4 _GLOBAL_OFFSET_TABLE_

Rename dump pattern files accordingly for consistency.

ld/
PR ld/20828
* testsuite/ld-elf/pr20828-1.sd: Remove test.
* testsuite/ld-elf/pr20828-a.sd: New test.
* testsuite/ld-elf/pr20828-2a.sd: Rename test to...
* testsuite/ld-elf/pr20828-b.sd: ... this.
* testsuite/ld-elf/pr20828-2b.sd: Rename test to...
* testsuite/ld-elf/pr20828-c.sd: ... this.
* testsuite/ld-elf/shared.exp: Adjust accordingly.

7 years ago[ld, testsuite] Honor cflags when GCC used as linker driver
Jiong Wang [Mon, 23 Jan 2017 09:59:10 +0000 (09:59 +0000)] 
[ld, testsuite] Honor cflags when GCC used as linker driver

ld/
* testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Append
board_cflags as gcc is used as linker driver.
* testsuite/ld-unique/unique.exp: Likewise

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 23 Jan 2017 00:00:25 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 22 Jan 2017 00:00:22 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoDocument the GDB 7.12.1 release in gdb/ChangeLog
Joel Brobecker [Sat, 21 Jan 2017 13:59:40 +0000 (17:59 +0400)] 
Document the GDB 7.12.1 release in gdb/ChangeLog

gdb/ChangeLog:

GDB 7.12.1 released.

7 years agoFix Py_DECREF being executed without holding the GIL
Simon Marchi [Sat, 21 Jan 2017 02:02:05 +0000 (21:02 -0500)] 
Fix Py_DECREF being executed without holding the GIL

When the gdbpy_ref objects get destroyed, they call Py_DECREF to
decrement the reference counter of the python object they hold a
reference to.  Any time we call into the Python API, we should be
holding the GIL.  The gdbpy_enter object does that for us in an
RAII-fashion.

However, if gdbpy_enter is declared after a gdbpy_ref object in a
function, gdbpy_enter's destructor will be called (and the GIL will be
released) before gdbpy_ref's destructor is called.  Therefore, we will
end up calling Py_DECREF without holding the GIL.

This became obvious with Python 3.6, where memory management functions
have asserts to make sure that the GIL is held.  This was exposed by
tests py-as-string.exp, py-function.exp and py-xmethods.  For example:

  (gdb) p $_as_string(enum_valid)
  Fatal Python error: Python memory allocator called without holding the GIL

  Current thread 0x00007f7f7b21c780 (most recent call first):
  [1]    18678 abort (core dumped)  ./gdb -nx testsuite/outputs/gdb.python/py-as-string/py-as-string

  #0  0x00007ffff618bc37 in raise () from /lib/x86_64-linux-gnu/libc.so.6
  #1  0x00007ffff618f028 in abort () from /lib/x86_64-linux-gnu/libc.so.6
  #2  0x00007ffff6b104d6 in Py_FatalError (msg=msg@entry=0x7ffff6ba15b8 "Python memory allocator called without holding the GIL") at Python/pylifecycle.c:1457
  #3  0x00007ffff6a37a68 in _PyMem_DebugCheckGIL () at Objects/obmalloc.c:1972
  #4  0x00007ffff6a3804e in _PyMem_DebugFree (ctx=0x7ffff6e65290 <_PyMem_Debug+48>, ptr=0x24f8830) at Objects/obmalloc.c:1994
  #5  0x00007ffff6a38e1d in PyMem_Free (ptr=<optimized out>) at Objects/obmalloc.c:442
  #6  0x00007ffff6b866c6 in _PyFaulthandler_Fini () at ./Modules/faulthandler.c:1369
  #7  0x00007ffff6b104bd in Py_FatalError (msg=msg@entry=0x7ffff6ba15b8 "Python memory allocator called without holding the GIL") at Python/pylifecycle.c:1431
  #8  0x00007ffff6a37a68 in _PyMem_DebugCheckGIL () at Objects/obmalloc.c:1972
  #9  0x00007ffff6a3804e in _PyMem_DebugFree (ctx=0x7ffff6e652c0 <_PyMem_Debug+96>, ptr=0x7ffff46b6040) at Objects/obmalloc.c:1994
  #10 0x00007ffff6a38f55 in PyObject_Free (ptr=<optimized out>) at Objects/obmalloc.c:503
  #11 0x00007ffff6a5f27e in unicode_dealloc (unicode=unicode@entry=0x7ffff46b6040) at Objects/unicodeobject.c:1794
  #12 0x00007ffff6a352a9 in _Py_Dealloc (op=0x7ffff46b6040) at Objects/object.c:1786
  #13 0x000000000063f28b in gdb_Py_DECREF (op=0x7ffff46b6040) at /home/emaisin/src/binutils-gdb/gdb/python/python-internal.h:192
  #14 0x000000000063fa33 in gdbpy_ref_policy::decref (ptr=0x7ffff46b6040) at /home/emaisin/src/binutils-gdb/gdb/python/py-ref.h:35
  #15 0x000000000063fa77 in gdb::ref_ptr<_object, gdbpy_ref_policy>::~ref_ptr (this=0x7fffffffcdf0, __in_chrg=<optimized out>) at /home/emaisin/src/binutils-gdb/gdb/common/gdb_ref_ptr.h:91
  #16 0x000000000064d8b8 in fnpy_call (gdbarch=0x2b50010, language=0x115d2c0 <c_language_defn>, cookie=0x7ffff46b7468, argc=1, argv=0x7fffffffcf48)
    at /home/emaisin/src/binutils-gdb/gdb/python/py-function.c:145

The fix is to place the gdbpy_enter first in the function.  I also
cleaned up the comments a bit and removed the unnecessary initialization
of the value variable.

gdb/ChangeLog:

* python/py-function.c (fnpy_call): Reorder declarations to have
the gdbpy_enter object declared first.
* python/py-xmethods.c (gdbpy_get_xmethod_arg_types): Likewise.

7 years agoAdd missing PR reference in ChangeLog
Simon Marchi [Sat, 21 Jan 2017 01:47:41 +0000 (20:47 -0500)] 
Add missing PR reference in ChangeLog

7 years agoFix python-interactive with Python 3.6
Simon Marchi [Sat, 21 Jan 2017 01:39:08 +0000 (20:39 -0500)] 
Fix python-interactive with Python 3.6

New in v2:

 - Define PyMem_RawMalloc as PyMem_Malloc for Python < 3.4 and use
   PyMem_RawMalloc in the code.

Since Python 3.4, the callback installed in PyOS_ReadlineFunctionPointer
should return a value allocated with PyMem_RawMalloc instead of
PyMem_Malloc.  The reason is that PyMem_Malloc must be called with the
Python Global Interpreter Lock (GIL) held, which is not the case in the
context where this function is called.  PyMem_RawMalloc was introduced
for cases like this.

In Python 3.6, it looks like they added an assert to verify that
PyMem_Malloc was not called without the GIL.  The consequence is that
typing anything in the python-interactive mode of gdb crashes the
process.  The same behavior was observed with the official package on
Arch Linux as well as with a manual Python build on Ubuntu 14.04.

This is what is shown with a debug build of Python 3.6 (the error with a
non-debug build is far less clear):

  (gdb) pi
  >>> print(1)
  Fatal Python error: Python memory allocator called without holding the GIL

  Current thread 0x00007f1459af8780 (most recent call first):
  [1]    21326 abort      ./gdb

and the backtrace:

  #0  0x00007ffff618bc37 in raise () from /lib/x86_64-linux-gnu/libc.so.6
  #1  0x00007ffff618f028 in abort () from /lib/x86_64-linux-gnu/libc.so.6
  #2  0x00007ffff6b104d6 in Py_FatalError (msg=msg@entry=0x7ffff6ba15b8 "Python memory allocator called without holding the GIL") at Python/pylifecycle.c:1457
  #3  0x00007ffff6a37a68 in _PyMem_DebugCheckGIL () at Objects/obmalloc.c:1972
  #4  0x00007ffff6a3804e in _PyMem_DebugFree (ctx=0x7ffff6e65290 <_PyMem_Debug+48>, ptr=0x24f8830) at Objects/obmalloc.c:1994
  #5  0x00007ffff6a38e1d in PyMem_Free (ptr=<optimized out>) at Objects/obmalloc.c:442
  #6  0x00007ffff6b866c6 in _PyFaulthandler_Fini () at ./Modules/faulthandler.c:1369
  #7  0x00007ffff6b104bd in Py_FatalError (msg=msg@entry=0x7ffff6ba15b8 "Python memory allocator called without holding the GIL") at Python/pylifecycle.c:1431
  #8  0x00007ffff6a37a68 in _PyMem_DebugCheckGIL () at Objects/obmalloc.c:1972
  #9  0x00007ffff6a37aa3 in _PyMem_DebugMalloc (ctx=0x7ffff6e65290 <_PyMem_Debug+48>, nbytes=5) at Objects/obmalloc.c:1980
  #10 0x00007ffff6a38d91 in PyMem_Malloc (size=<optimized out>) at Objects/obmalloc.c:418
  #11 0x000000000064dbe2 in gdbpy_readline_wrapper (sys_stdin=0x7ffff6514640 <_IO_2_1_stdin_>, sys_stdout=0x7ffff6514400 <_IO_2_1_stdout_>, prompt=0x7ffff4d4f7d0 ">>> ")
    at /home/emaisin/src/binutils-gdb/gdb/python/py-gdb-readline.c:75

The documentation is very clear about it [1] and it was also mentioned
in the "What's New In Python 3.4" page [2].

[1] https://docs.python.org/3/c-api/veryhigh.html#c.PyOS_ReadlineFunctionPointer
[2] https://docs.python.org/3/whatsnew/3.4.html#changes-in-the-c-api

gdb/ChangeLog:

* python/python-internal.h (PyMem_RawMalloc): Define for
Python < 3.4.
* python/py-gdb-readline.c (gdbpy_readline_wrapper): Use
PyMem_RawMalloc instead of PyMem_Malloc.

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 21 Jan 2017 00:00:21 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoFix uppercase test names in gdb.python/py-xmethods.exp
Luis Machado [Fri, 20 Jan 2017 19:58:40 +0000 (13:58 -0600)] 
Fix uppercase test names in gdb.python/py-xmethods.exp

Some leftover uppercase test names in py-xmethods.exp.  The patch also
replaces two "continue" calls with untested calls to make things a bit more
clear.

gdb/testsuite/ChangeLog:

2017-01-20  Luis Machado  <lgustavo@codesourcery.com>

* gdb.python/py-xmethods.exp: Fix test names starting with lowercase
and add untested calls.

7 years agoMake gdb.python/python.exp more robust
Luis Machado [Fri, 20 Jan 2017 19:15:36 +0000 (13:15 -0600)] 
Make gdb.python/python.exp more robust

I noticed gdb.python/python.exp failing on aarch64-elf like so:

FAIL: gdb.python/python.exp: Test decode_line func1 line number

This particular test expects the line number for func1 to be 19, hardcoded.

In my aarch64-elf tests gdb thinks func1 is at line 20, making the test fail.

The following patch addresses this by reading the line number information from
GDB and comparing it against the python decoded symtab information.

gdb/testsuite/ChangeLog:

2017-01-20  Luis Machado  <lgustavo@codesourcery.com>

* gdb.python/python.exp: Check line number against what GDB thinks
the line number is for func1.

7 years agoAdd command to erase all flash memory regions
Luis Machado [Fri, 20 Jan 2017 14:13:03 +0000 (08:13 -0600)] 
Add command to erase all flash memory regions

Changes in v4:

- Replaced phex call with hex_string.

Changes in v3:

- Addressed comments by Pedro.
- Output of memory region size now in hex format.
- Misc formatting fixups.
- Addressed Simon's comments on formatting.
- Adjusted command text in the manual entry.
- Fixed up ChangeLog.
- Renamed flash_erase_all_command to flash_erase_command.

Changes in v2:

- Added NEWS entry.
- Fixed long lines.
- Address printing with paddress.

Years ago we contributed flash programming patches upstream.  The following
patch is a leftover one that complements that functionality by adding a new
command to erase all reported flash memory blocks.

The command is most useful when we're dealing with flash-enabled targets
(mostly bare-metal) and we need to reset the board for some reason.

The wiping out of flash memory regions should help the target come up with a
known clean state from which the user can load a new image and resume
debugging. It is convenient enough to do this from the debugger, and there is
also an MI command to expose this functionality to the IDE's.

gdb/doc/ChangeLog:

2017-01-20  Mike Wrighton  <mike_wrighton@codesourcery.com>
    Luis Machado  <lgustavo@codesourcery.com>

* gdb.texinfo (-target-flash-erase): New MI command description.
(flash-erase): New CLI command description.

gdb/ChangeLog:

2017-01-20  Mike Wrighton  <mike_wrighton@codesourcery.com>
    Luis Machado  <lgustavo@codesourcery.com>

* NEWS (New commands): Mention flash-erase.
(New MI commands): Mention target-flash-erase.
* mi/mi-cmds.c (mi_cmd_target_flash_erase): Add target-flash-erase MI
command.
* mi/mi-cmds.h (mi_cmd_target_flash_erase): New declaration.
* mi/mi-main.c (mi_cmd_target_flash_erase): New function.
* target.c (flash_erase_command): New function.
(initialize_targets): Add new flash-erase command.
* target.h (flash_erase_command): New declaration.

7 years ago[AArch64] Optimize .gnu.hash table size for executable
Jiong Wang [Fri, 20 Jan 2017 13:30:32 +0000 (13:30 +0000)] 
[AArch64] Optimize .gnu.hash table size for executable

bfd/
* elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
(elf_backend_hash_symbol): Define.

ld/
* testsuite/ld-aarch64/aarch64-elf.exp (aarch64elflinktests): New tests.
* testsuite/ld-aarch64/func-in-so.s: New test source file.
* testsuite/ld-aarch64/func-sym-hash-opt.s: Likewise.
* testsuite/ld-aarch64/func-sym-hash-opt.d: New expected test result.

7 years agoUpdated Irish translation for the opcodes library.
Nick Clifton [Fri, 20 Jan 2017 12:25:07 +0000 (12:25 +0000)] 
Updated Irish translation for the opcodes library.

* po/ga.po: Updated Irish translation.

7 years agoFix potential array overrun in x86 assembler.
Nick Clifton [Fri, 20 Jan 2017 10:32:25 +0000 (10:32 +0000)] 
Fix potential array overrun in x86 assembler.

* config/tc-i386.c (parse_operands): Check for operand overflow
before setting the unspecified bit.

7 years agoFix problem in aarch64 gold sources uncovered by Coverty - using sizeof on a pointer...
Nick Clifton [Fri, 20 Jan 2017 10:21:17 +0000 (10:21 +0000)] 
Fix problem in aarch64 gold sources uncovered by Coverty - using sizeof on a pointer instead of an array.

* aarch64.cc (Stub_template_repertoire): Change ST_E_835769_INSNS
        from a pointer to an array.

7 years agoSync zlib sources with GCC, upgrading to 1.2.10.
Nick Clifton [Fri, 20 Jan 2017 10:17:42 +0000 (10:17 +0000)] 
Sync zlib sources with GCC, upgrading to 1.2.10.

Changes in 1.2.10 (2 Jan 2017)
- Avoid warnings on snprintf() return value
- Fix bug in deflate_stored() for zero-length input
- Fix bug in gzwrite.c that produced corrupt gzip files
- Remove files to be installed before copying them in Makefile.in
- Add warnings when compiling with assembler code

Changes in 1.2.9 (31 Dec 2016)
- Fix contrib/minizip to permit unzipping with desktop API [Zouzou]
- Improve contrib/blast to return unused bytes
- Assure that gzoffset() is correct when appending
- Improve compress() and uncompress() to support large lengths
- Fix bug in test/example.c where error code not saved
- Remedy Coverity warning [Randers-Pehrson]
- Improve speed of gzprintf() in transparent mode
- Fix inflateInit2() bug when windowBits is 16 or 32
- Change DEBUG macro to ZLIB_DEBUG
- Avoid uninitialized access by gzclose_w()
- Allow building zlib outside of the source directory
- Fix bug that accepted invalid zlib header when windowBits is zero
- Fix gzseek() problem on MinGW due to buggy _lseeki64 there
- Loop on write() calls in gzwrite.c in case of non-blocking I/O
- Add --warn (-w) option to ./configure for more compiler warnings
- Reject a window size of 256 bytes if not using the zlib wrapper
- Fix bug when level 0 used with Z_HUFFMAN or Z_RLE
- Add --debug (-d) option to ./configure to define ZLIB_DEBUG
- Fix bugs in creating a very large gzip header
- Add uncompress2() function, which returns the input size used
- Assure that deflateParams() will not switch functions mid-block
- Dramatically speed up deflation for level 0 (storing)
- Add gzfread(), duplicating the interface of fread()
- Add gzfwrite(), duplicating the interface of fwrite()
- Add deflateGetDictionary() function
- Use snprintf() for later versions of Microsoft C
- Fix *Init macros to use z_ prefix when requested
- Replace as400 with os400 for OS/400 support [Monnerat]
- Add crc32_z() and adler32_z() functions with size_t lengths
- Update Visual Studio project files [AraHaan]

7 years agoobjdump: Better objdump section headers in wide mode
Andrew Burgess [Wed, 28 Dec 2016 13:22:44 +0000 (13:22 +0000)] 
objdump: Better objdump section headers in wide mode

When displaying the section headers table using objdump (-h), the column
containing the section header name is currently fixed at 13 characters.
A section name that is longer than 13 characters will overflow the
column causing the table to become miss-aligned.

In this commit I change the behaviour so that _in wide mode_ (-w -h) the
section name column is dynamically resized to fit the longest section
name we plan to display.  In wide mode the column still retains a
minimum width of 13 characters.

In non-wide more the behaviour is completely unchanged.

While I was changing the dump_headers function I have unified the two
printf lines that handled the different address widths into a single
printf, the address width is now passed into printf using the '*' field
width format character.

binutils/ChangeLog:

* objdump.c (dump_section_header): Extract max section name length
from data parameter, use this when formatting output.
(find_longest_section_name): New function.
(dump_headers): Calculate longest section name when in wide mode,
reformat to unify printing of header line.

ld/ChangeLog:

* testsuite/ld-elf/eh-frame-hdr.d: Update expected results.

7 years agofix gdbserver build in nat/linux-ptrace.c on arm-android
Joel Brobecker [Tue, 17 Jan 2017 12:08:02 +0000 (13:08 +0100)] 
fix gdbserver build in nat/linux-ptrace.c on arm-android

The following change replaced an include of gregset.h by
an include of <sys/procfs.h>:

    commit 39b22471578843019026c50fcdbe0483a6045970
    Date:   Thu Aug 11 12:01:22 2016 +0100
    Subject: Fix fallout from gdb/20413's fix
             (x32: linux_ptrace_test_ret_to_nx: Cannot PTRACE_PEEKUSER)

Unfortunately, this broke gdbserver on Android, because that file
does not exist on this platform.  This patch fixes the issue by
conditionalizing its include with HAVE_SYS_PROCFS_H (which we check
both in gdb/configure and gdbserver/configure).

gdb/ChangeLog:

        * nat/linux-ptrace.c: Only include <sys/procfs.h> if
        HAVE_SYS_PROCFS_H is defined.

Tested by rebuilding gdbserver on arm-android and GNU/Linux.

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 20 Jan 2017 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 19 Jan 2017 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoPR ld/20995: MIPS: Set GAS flags correctly for tests
Maciej W. Rozycki [Wed, 18 Jan 2017 18:07:58 +0000 (18:07 +0000)] 
PR ld/20995: MIPS: Set GAS flags correctly for tests

Complement commit 9acc85a62eb7 ("Use dynrelro for symbols in relro
sections too").

ld/
PR ld/20995
* testsuite/ld-elf/elf.exp: Set GAS flags correctly for the
`mips*-*-*' target and `pr20995' and `pr20995-2' tests.

7 years agoPR ld/20828: Fix linker script symbols wrongly forced local with section GC
Maciej W. Rozycki [Mon, 16 Jan 2017 22:10:57 +0000 (22:10 +0000)] 
PR ld/20828: Fix linker script symbols wrongly forced local with section GC

Fix a generic ELF linker regression introduced with a chain of changes
made to unused input section garbage collection:

- commit 1a766c6843ce ("Also hide symbols without PLT nor GOT
  references."),
  <https://sourceware.org/ml/binutils/2011-09/msg00076.html>,

- commit 1d5316ab67e1 ("PR ld/13177: garbage collector retains zombie
  references to external libraries"),
  <https://sourceware.org/ml/binutils/2011-10/msg00161.html>,

- commit 6673f753c019 ("Fix PR 12772, garbage collection of dynamic
  syms"), <https://sourceware.org/ml/binutils/2011-12/msg00077.html>,

causing the garbage collection of unused symbols present in a DSO
involved in a link to make identically named symbols ordinarily defined
(i.e. not hidden or PROVIDEd) by a linker script local, even though the
latter symbols are supposed to be global as if no DSO defined them as
well.

This is because linker script assignments are processed very late as
`lang_process' proceeds, down in the call to `ldemul_before_allocation',
which is made after the call to `lang_gc_sections' to do input section
garbage collecting.  Consequently if unused, then any such DSO-defined
symbol has already been garbage-collected and internally marked local.
It would ordinarily be removed from dynamic symbol table output, however
a linker script assignment correctly replaces its original definition
with the new one and enters it into the dynamic symbol table produced as
it is supposed to be exported.  The original local marking is however
retained making the symbol local in the dynamic symbol table and
therefore not available externally.  This also causes a sorting problem
with the MIPS target, which does not expect non-section local dynamic
symbols to be output and produces an invalid binary.

Fix the problem then, by removing the `forced_local' marking for the
offending case and add suitable test cases.  First to verify that unused
symbols ordinarily defined with linker script assignments remain
exported in the context of input section garbage collection whether or
not a DSO defining identically named symbols is present in the link.
Second that a linker version script still correctly retains or removes
such symbols as requested.

bfd/
PR ld/20828
* elflink.c (bfd_elf_record_link_assignment): Clear any
`forced_local' marking for DSO symbols that are not being
provided.

ld/
PR ld/20828
* testsuite/ld-elf/pr20828-1.sd: New test.
* testsuite/ld-elf/pr20828-2a.sd: New test.
* testsuite/ld-elf/pr20828-2b.sd: New test.
* testsuite/ld-elf/pr20828.ld: New test linker script.
* testsuite/ld-elf/pr20828.ver: New test version script.
* testsuite/ld-elf/pr20828.s: New test source.
* testsuite/ld-elf/shared.exp: Run the new test.

7 years agoPR gas/20649: MIPS: Fix GOT16/LO16 reloc pairing with comdat sections
Maciej W. Rozycki [Wed, 18 Jan 2017 18:18:21 +0000 (18:18 +0000)] 
PR gas/20649: MIPS: Fix GOT16/LO16 reloc pairing with comdat sections

Correct a regression from commit 8614eeee67f9 ("Traditional MIPS
patches"), <https://sourceware.org/ml/binutils/2000-07/msg00018.html>,
which caused symbols in linkonce or what is these days known as comdat
sections to be treated as external for the purpose of PIC relocation
generation even if their binding remains STB_LOCAL.  This in turn
disabled GOT16/LO16 relocation pairing with references to such symbols,
as no complementing LO16 relocation is expected for external GOT16
references in the o32 ABI, which ultimately leads to link errors, e.g.:

ld: comdat-reloc.o: Can't find matching LO16 reloc against `foo' for R_MIPS_GOT16 at 0x24 in section `.text.bar[bar]'

as with the LD test case included with this change.

Revert the special case for symbols in comdat sections then, making code
actually match `adjust_reloc_syms' as indicated in its explanatory
comment, and adjust calling code accordingly.  Also bring back the
corresponding description of what now is `s_is_linkonce', lost with
commit 5f0fe04bc550 ("Improved MIPS16/MIPS32 code intermixing for
gas."), <https://www.sourceware.org/ml/binutils/2006-07/msg00039.html>.

gas/
PR gas/20649
* config/tc-mips.c (pic_need_relax): Don't check for linkonce
symbols, remove the `segtype' parameter.
(mips_frob_file, md_estimate_size_before_relax): Adjust
accordingly.
(s_is_linkonce): Add an explanatory comment.
* testsuite/gas/mips/comdat-reloc.d: New test.
* testsuite/gas/mips/comdat-reloc.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new test.

ld/
PR gas/20649
* testsuite/ld-mips-elf/mips-elf.exp: Add PIC comdat GOT16/LO16
relocation pairing link test.

7 years ago[ARM] Fix the decoding of indexed element VCMLA instruction
Szabolcs Nagy [Wed, 18 Jan 2017 17:08:34 +0000 (17:08 +0000)] 
[ARM] Fix the decoding of indexed element VCMLA instruction

Bit 24 of the indexed element vcmla decode mask was incorrectly
left unset.  This could cause incorrect disassembly of some
currently undefined instructions as vcmla.

Rotatation immediates were not printed correctly in the disassembly
(could print 170 and 280 instead of 180 and 270).

opcodes/
* arm-dis.c (coprocessor_opcodes): Fix vcmla mask and disassembly.

gas/
* testsuite/gas/arm/armv8_3-a-simd.s: Add vcmla tests.
* testsuite/gas/arm/armv8_3-a-simd.d: Update.

7 years agoAllocate data in cached_reg_t
Alan Hayward [Wed, 18 Jan 2017 15:15:50 +0000 (15:15 +0000)] 
Allocate data in cached_reg_t

2017-01-18  Alan Hayward  <alan.hayward@arm.com>

* remote.c (struct cached_reg): Change data into a pointer.
* (stop_reply_dtr): Free data pointers before deleting vector.
(process_stop_reply): Likewise.
(remote_parse_stop_reply): Allocate space for data

7 years agoUse register_size () instead of MAX_REGISTER_SIZE
Alan Hayward [Wed, 18 Jan 2017 11:23:02 +0000 (11:23 +0000)] 
Use register_size () instead of MAX_REGISTER_SIZE

2017-01-18  Alan Hayward  <alan.hayward@arm.com>

* amd64-tdep.c (amd64_pseudo_register_read_value): remove
MAX_REGISTER_SIZE.
(amd64_pseudo_register_read_value): Likewise.
* remote.c (fetch_register_using_p): Remove MAX_REGISTER_SIZE.
(store_register_using_P): Likewise.
* regcache.c (regcache_xfer_part): Likewise.

7 years agoAdd support for processing lex source files with flex v 2.6.3
Bernhard Rosenkranzer [Wed, 18 Jan 2017 13:38:27 +0000 (13:38 +0000)] 
Add support for processing lex source files with flex v 2.6.3

PR 21059
binutils* arlex.l: Support processing with flex 2.6.3.
* deflex.l: Likewise.

gas * config/bfin-lex.l: Support processing with flex 2.6.3.
* itbl-lex.l: Likewise.

7 years agoCatch gas exit-via-signal
Nathan Sidwell [Wed, 18 Jan 2017 13:23:10 +0000 (08:23 -0500)] 
Catch gas exit-via-signal

gas/
* as.h (gas_assert): Use abort.
(as_assert): Remove.
(signal_init): Declare.
* as.c (main): Call signal_init.
* messages.c: #include <signal.h>
(as_assert): Delete.
(as_abort): Allow NULL FILE.
(signal_crash): New.
(signal_init): Register fatal signal handlers.
* configure.ac: Check for strsignal.
* config.in: Rebuilt.
* configure: Rebuilt.

7 years agoSkip linker tests for unique symbols in shared libraries if the target does not suppo...
Dimitar Dimitrov [Wed, 18 Jan 2017 12:23:19 +0000 (12:23 +0000)] 
Skip linker tests for unique symbols in shared libraries if the target does not support building shared libraries.

ld * testsuite/ld-unique/unique.exp: Filter shared lib cases in
uniqeue.exp, as not all targets have such support.

7 years agoStop the (optional) dialong control data from being aligned when parsing/writing...
Dmitry Timoshkov [Wed, 18 Jan 2017 11:40:06 +0000 (11:40 +0000)] 
Stop the (optional) dialong control data from being aligned when parsing/writing windows resource files.

binutils* resbin.c: Optional dialog control data immediately follow
the control description without alignment.
* testsuite/binutils-all/windres/controldata.rc: New test.
source.
* testsuite/binutils-all/windres/controldata.rsd: New test.

7 years agoUpdated Swedish translation for GAS.
Nick Clifton [Wed, 18 Jan 2017 11:35:29 +0000 (11:35 +0000)] 
Updated Swedish translation for GAS.

7 years agoFixes for addv and xtn2 instructions.
Jim Wilson [Wed, 18 Jan 2017 00:01:40 +0000 (16:01 -0800)] 
Fixes for addv and xtn2 instructions.

sim/aarch64/
* simulator.c (do_vec_ADDV): Call aarch64_set_vec_u64 instead of
aarch64_set_reg_u64.  In case 2, call HALT_UNALLOC if not full.  In
case 3, call HALT_UNALLOC unconditionally.
(do_vec_XTN): Delete shifts.  In case 2, change index from i + 4 to
i + 2.  Delete if on bias, change index to i + bias * X.

sim/testsuite/sim/aarch64/
* addv.s: New.
* xtn.s: New.

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 18 Jan 2017 00:00:27 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoRISC-V/bfd: Hook elf_backend_object_p to set the mach type.
Kuan-Lin Chen [Tue, 17 Jan 2017 01:46:28 +0000 (09:46 +0800)] 
RISC-V/bfd: Hook elf_backend_object_p to set the mach type.

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 17 Jan 2017 00:00:21 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agogdb: sparc: split real and pseudo registers.
Ivo Raisr [Mon, 16 Jan 2017 16:45:48 +0000 (08:45 -0800)] 
gdb: sparc: split real and pseudo registers.

gdb/ChangeLog:

2017-01-16  Ivo Raisr  <ivo.raisr@oracle.com>

Split real and pseudo registers.
* sparc-tdep.h (SPARC_CORE_REGISTERS): New macro.
(sparc32_pseudo_regnum): New enum.
* sparc64-tdep.h (sparc64_pseudo_regnum): New enum.
* sparc-tdep.c (SPARC32_FPU_REGISTERS): New macro.
(SPARC32_CP0_REGISTERS): New macro.
(sparc32_pseudo_register_name): New function.
(sparc32_register_name): Use sparc32_pseudo_register_name.
(sparc32_pseudo_register_type): New function.
(sparc32_register_type): Use sparc32_pseudo_register_type.
(sparc32_pseudo_register_read, sparc32_pseudo_register_write): Handle
pseudo register numbers.
* sparc64-tdep.c SPARC64_FPU_REGISTERS): New macro.
(SPARC64_CP0_REGISTERS): New macro.
(sparc64_pseudo_register_name): New function.
(sparc64_register_name): Use sparc64_pseudo_register_name.
(sparc64_pseudo_register_type): New function.
(sparc64_register_type): Use sparc64_pseudo_register_type.
(sparc64_pseudo_register_read, sparc64_pseudo_register_write): Handle
pseudo register numbers.
(sparc64_store_floating_fields, sparc64_extract_floating_fields,
sparc64_store_arguments): Handle pseudo register numbers.

7 years agoUpdated Swedish translations for GAS and LD subdirectories.
Nick Clifton [Mon, 16 Jan 2017 10:59:23 +0000 (10:59 +0000)] 
Updated Swedish translations for GAS and LD subdirectories.

gas * po/sv.po: Updated Swedish translation.
ld * po/sv.po: Updated Swedish translation.

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 16 Jan 2017 00:00:21 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 15 Jan 2017 00:00:21 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 14 Jan 2017 00:00:23 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoGold: Fix build with GCC 4.2
H.J. Lu [Fri, 13 Jan 2017 15:46:14 +0000 (07:46 -0800)] 
Gold: Fix build with GCC 4.2

PR gold/21040
* powerpc.cc (Powerpc_relobj<size, big_endian>::make_toc_relative):
Cast 0x80008000 to uint64_t.

7 years agoDon't print too much if remote_debug is on
Yao Qi [Fri, 13 Jan 2017 15:45:33 +0000 (15:45 +0000)] 
Don't print too much if remote_debug is on

If we turn "remote debug" on and GDB does some vFile operations,
a lot of things will be printed in the screen, which makes
"remote debug" useless.

This patch changes the code that we only print 512 chars in max in
debugging messages, like this,

Sending packet: $qXfer:features:read:target.xml:0,fff#7d...Packet received: l<?xml version="1.0"?>\n<!-- Copyright (C) 2010-2016 Free Software Foundation, Inc.\n\n     Copying and distribution of this file, with or without modification,\n     are permitted in any medium without royalty provided the copyright\n     notice and this notice are preserved.  -->\n\n<!-- AMD64 with AVX - Includes Linux-only special "register".  -->\n\n<!DOCTYPE target SYSTEM "gdb-target.dtd">\n<target>\n  <architecture>i386:x86-64</architecture>\n  <osabi>GNU/Linux</osabi>\n  <xi:include href="64bit-core.xml"/>\n  <xi:[14 bytes omitted]

Sending packet: $qXfer:auxv:read::0,1000#6b...Packet received: l!\000\000\000\000\000\000\000\000d\000\000\000\000\000\000\000\003\000\000\000\000\000\000\000@\000@\000\000\000\000\000\004\000\000\000\000\000\000\0008\000\000\000\000\000\000\000\005\000\000\000\000\000\000\000\t\000\000\000\000\000\000\000\a\000\000\000\000\000\000\000\177\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\000\000\000\000\000\000\000\000\004@\000\000\000\000\000\013\000\000\000\000\000\000\003\000\000\000\000\000\000\f\000\000\000\000\000\000\003\000\000\000\000\000\000\r\000\000\000\000\000\000\003\000\000\000\000\000\000\016\000\000\000\000\000\000\003\000\000\000\000\000\000\027\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\031\000\000\000\000\000\000\177\000\000\037\000\000\000\000\000\000\000\000\017\000\000\000\000\000\000\00\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000[582 bytes omitted]

gdb:

2017-01-13  Yao Qi  <yao.qi@linaro.org>

* remote.c (REMOTE_DEBUG_MAX_CHAR): New macro.
(putpkt_binary): Print only REMOTE_DEBUG_MAX_CHAR chars in debug
output.
(getpkt_or_notif_sane_1): Likewise.

7 years ago'make check-headers' for c++ header
Yao Qi [Fri, 13 Jan 2017 14:40:11 +0000 (14:40 +0000)] 
'make check-headers' for c++ header

If I run 'make check-headers', I get these errors,
....
In file included from ../../binutils-gdb/gdb/common/common-defs.h:78:0,
                 from ../../binutils-gdb/gdb/defs.h:28,
                 from <command-line>:0:
../../binutils-gdb/gdb/common/common-utils.h:23:18: fatal error: string: No such file or directory
 #include <string>
                  ^

because we still parse headers as c file with a c compiler, which is no
longer true after we moved to C++.  This patch changes it to use C++
compiler and parse headers as c++ headers.

gdb:

2017-01-13  Yao Qi  <yao.qi@linaro.org>

* Makefile.in (checker-headers): Use CXX and CXX_DIALET instead
of CC.  Pass "-x c++-header" instead of "-x c".

7 years agoReturn -1 on memory error in print_insn_m68k
Yao Qi [Fri, 13 Jan 2017 12:27:39 +0000 (12:27 +0000)] 
Return -1 on memory error in print_insn_m68k

m68k-dis.c:print_insn_m68k doesn't return -1 on memory error, but GDB
expects it returning -1 on memory error.

opcodes:

2017-01-13  Yao Qi  <yao.qi@linaro.org>

* m68k-dis.c (match_insn_m68k): Extend comments.  Return -1
if FETCH_DATA returns 0.
(m68k_scan_mask): Likewise.
(print_insn_m68k): Update code to handle -1 return value.

7 years agoRemove magic numbers in m68k-dis.c:print_insn_arg
Yao Qi [Fri, 13 Jan 2017 12:21:22 +0000 (12:21 +0000)] 
Remove magic numbers in m68k-dis.c:print_insn_arg

When I inspect the return values of disassmblers, I happen to see
various -1/-2/-3 magic numbers are used in m68k-dis.c.  This patch
is to replace them with enum.

-1 and -2 is "clearly documented" in print_ins_arg's comments, but
-3 isn't.  In fact, -3 is returned when FETCH_DATA returns false,
which means memory error (because fetch_data return 0 on memory
error).  So I name enum PRINT_INSN_ARG_MEMORY_ERROR for -3.

This patch is a refactor patch, doesn't affect any functionality.

opcodes:

2017-01-13  Yao Qi  <yao.qi@linaro.org>

* m68k-dis.c (enum print_insn_arg_error): New.
(NEXTBYTE): Replace -3 with
PRINT_INSN_ARG_MEMORY_ERROR.
(NEXTULONG): Likewise.
(NEXTSINGLE): Likewise.
(NEXTDOUBLE): Likewise.
(NEXTDOUBLE): Likewise.
(NEXTPACKED): Likewise.
(FETCH_ARG): Likewise.
(FETCH_DATA): Update comments.
(print_insn_arg): Update comments. Replace magic numbers with
enum.
(match_insn_m68k): Likewise.

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 13 Jan 2017 00:00:22 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoFix incorrect byte counts.
Cary Coutant [Thu, 12 Jan 2017 19:51:18 +0000 (11:51 -0800)] 
Fix incorrect byte counts.

gold/
* object.cc (Sized_relobj_file): Fix byte counts for calls to memmem.

7 years agox86-64: Also generate unwind info for .plt.bnd
H.J. Lu [Thu, 12 Jan 2017 18:30:56 +0000 (10:30 -0800)] 
x86-64: Also generate unwind info for .plt.bnd

Also generate unwind info for the .plt.bnd section.  Sine it is the same
as unwind info for the .plt.got section, we use unwind info for the
.plt.got section to cover the the .plt.bnd section.

bfd/

PR ld/21038
* elf64-x86-64.c (elf_x86_64_link_hash_table): Add
plt_bnd_eh_frame.
(elf_x86_64_check_relocs): Create .eh_frame section for the
.plt.bnd section.
(elf_x86_64_size_dynamic_sections): Allocate and initialize
.eh_frame section for the .plt.bnd section.
(elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
for the .plt.bnd section.

ld/

PR ld/21038
* testsuite/ld-x86-64/pr21038b.d: Updated.
* testsuite/ld-x86-64/pr21038c.d: New file.
* testsuite/ld-x86-64/pr21038c.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pr21038c.

7 years agoAdd support for locating separate debug info files via the build-id method.
Nick Clifton [Thu, 12 Jan 2017 16:56:54 +0000 (16:56 +0000)] 
Add support for locating separate debug info files via the build-id method.

PR binutils/20876
bfd * opncls.c (find_separate_debug_file): Add include_dirs
parameter.  Only include the directory part of the bfd's filename
in search paths if include_dirs is true.  Add a couple of extra
locations for looking for debug files.
( bfd_follow_gnu_debuglink): Update invocation of
find_separate_debug_file.
(bfd_follow_gnu_debugaltlink): Likewise.
(get_build_id): New function: Finds the build-id of the given bfd.
(get_build_id_name): New function: Computes the name of the
separate debug info file for a bfd, based upon its build-id.
(check_build_id_file): New function: Checks to see if a separate
debug info file exists at the given location, and that its
build-id matches that of the original bfd.
(bfd_follow_build_id_debuglink): New function: Finds a separate
debug info file for a given bfd by using the build-id method.
* dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
method of locating a separate debug info file before using the
debuglink method.
* bfd-in2.h: Regenerate.

binutils * NEWS: Mention the new feature.
* testsuite/binutils-all/objdump.exp (test_build_id_debuglink):
New proc to test the location of separate debug info files using
the build-id method.

7 years agoEnable Intel AVX512_VPOPCNTDQ instructions
Igor Tsimbalist [Thu, 12 Jan 2017 16:42:17 +0000 (08:42 -0800)] 
Enable Intel AVX512_VPOPCNTDQ instructions

gas/

2017-01-12  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>

* config/tc-i386.c (cpu_arch): Add .avx512_vpopcntdq.
(cpu_noarch): Add noavx512_vpopcntdq.
* doc/c-i386.texi: Document avx512_vpopcntdq, noavx512_vpopcntdq.
* testsuite/gas/i386/i386.exp: Run AVX512_VPOPCNTDQ tests.
* testsuite/gas/i386/avx512_vpopcntdqd-intel.d: New file.
* testsuite/gas/i386/avx512_vpopcntdqd.d: Ditto.
* testsuite/gas/i386/avx512_vpopcntdqd.s: Ditto.
* testsuite/gas/i386/x86-64-avx512_vpopcntdqd-intel.d: Ditto.
* testsuite/gas/i386/x86-64-avx512_vpopcntdqd.d: Ditto.
* testsuite/gas/i386/x86-64-avx512_vpopcntdqd.s: Ditto.

opcodes/

2017-01-12  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>

* i386-dis.c (enum): Add PREFIX_EVEX_0F3855, EVEX_W_0F3855_P_2.
* i386-dis-evex.h (evex_table): Updated.
* i386-gen.c (cpu_flag_init): Add CPU_AVX512_VPOPCNTDQ_FLAGS,
CPU_ANY_AVX512_VPOPCNTDQ_FLAGS. Update CPU_ANY_AVX512F_FLAGS.
(cpu_flags): Add CpuAVX512_VPOPCNTDQ.
* i386-opc.h (enum): (AVX512_VPOPCNTDQ): New.
(i386_cpu_flags): Add cpuavx512_vpopcntdq.
* i386-opc.tbl: Add Intel AVX512_VPOPCNTDQ instructions.
* i386-init.h: Regenerate.
* i386-tbl.h: Ditto.

7 years agoUpdate comment in remote_can_async_p
Simon Marchi [Thu, 12 Jan 2017 16:15:01 +0000 (11:15 -0500)] 
Update comment in remote_can_async_p

I find this comment counter intuitive, and it probably predates the
always-target-async change.  AFAIK, remote will always be async, unless
the user explicitly prevents it with "maint set target-async off".

gdb/ChangeLog:

* remote.c (remote_can_async_p): Update comment.

7 years agoUpdate comment in linux_nat_can_async_p
Simon Marchi [Thu, 12 Jan 2017 16:04:53 +0000 (11:04 -0500)] 
Update comment in linux_nat_can_async_p

I think this comment is outdated.  Nowadays, linux-nat is always async,
unless the user has explictly turned it off with
"maint set target-async off".

gdb/ChangeLog:

* linux-nat.c (linux_nat_can_async_p): Update comment.

7 years agoRemove dead serial_interface_lookup calls
Simon Marchi [Thu, 12 Jan 2017 15:39:35 +0000 (10:39 -0500)] 
Remove dead serial_interface_lookup calls

By inspecting the serial_add_interface calls, I found that the serial
interface names that we have today are:

 - hardwire
 - terminal
 - pipe
 - tcp
 - event

 The calls to serial_interface_lookup with any other names are most
 likely leftovers which can be removed since these serial interfaces
 don't exist anymore.  The commits that removed the "pc" and "parallel"
 interfaces are respectively:

  cb2a4ac5dae478fcd9d6e772530c3aba0576fc7a

and

  e386d4d2fb55042f77d0557a0849ed2464aee7b3

gdb/ChangeLog:

* serial.c (serial_open): Forget about "pc" and "lpt" serial interface.

7 years agoPrevent internal assembler errors if a stabs creation function builds an badly format...
Nick Clifton [Thu, 12 Jan 2017 14:56:13 +0000 (14:56 +0000)] 
Prevent internal assembler errors if a stabs creation function builds an badly formatted input string.

* read.c (temp_ilp): New function.  Installs a temporary input
line pointer.
(restore_ilp): New function.  Restores the original input line
pointer.
* read.h (temp_ilp): Prototype.
(restore_ilp): Prototype.
* stabs.c (dot_func_p): Use bfd_boolean type.
(generate_asm_file): Use temp_ilp and restore_ilp.
(stabs_generate_asm_lineno): Likewise.
(stabs_generate_asm_endfunc): Likewise.

7 years agoReturn -1 on memory error in print_insn_msp430
Yao Qi [Thu, 12 Jan 2017 09:40:41 +0000 (09:40 +0000)] 
Return -1 on memory error in print_insn_msp430

Disassemblers in opcodes return -1 on memory error, but msp430 doesn't
follow this convention.  If I change GDB not to throw exception in
disassemble_info.memory_error_func and rely on the return value of
disassembler, I'll get the following output.

(gdb) disassemble 0x0,+8
Dump of assembler code from 0x0 to 0x8:
   0x00000000:  .word   0xffff; ????
   0x00000002:  .word   0xffff; ????
   0x00000004:  .word   0xffff; ????
   0x00000006:  .word   0xffff; ????
End of assembler dump.

This patch teaches print_insn_msp430 and its callees to return -1
on memory error.

opcodes:

2017-01-12  Yao Qi  <yao.qi@linaro.org>

* msp430-dis.c (msp430_singleoperand): Return -1 if
msp430dis_opcode_signed returns false.
(msp430_doubleoperand): Likewise.
(msp430_branchinstr): Return -1 if
msp430dis_opcode_unsigned returns false.
(msp430x_calla_instr): Likewise.
(print_insn_msp430): Likewise.

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 12 Jan 2017 00:00:25 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoFix more compile errors with GCC 4.2.
Cary Coutant [Wed, 11 Jan 2017 21:42:24 +0000 (13:42 -0800)] 
Fix more compile errors with GCC 4.2.

gold/
PR gold/21040
* x86_64.cc (Output_data_plt_x86_64_bnd::do_fill_first_plt_entry):
Remove unnecessary 'typename' keyword.
(Output_data_plt_x86_64_bnd::do_fill_plt_entry): Likewise.
(Output_data_plt_x86_64_bnd::fill_aplt_entry): Likewise.
(Output_data_plt_x86_64_bnd::do_fill_tlsdesc_entry): Likewise.
(Output_data_plt_x86_64_bnd::do_write): Likewise.

7 years agoFix compile errors with GCC 4.2.
Cary Coutant [Wed, 11 Jan 2017 19:47:27 +0000 (11:47 -0800)] 
Fix compile errors with GCC 4.2.

gold/
PR gold/21040
* x86_64.cc (Output_data_plt_x86_64_bnd::do_fill_first_plt_entry):
Remove unnecessary 'typename' keyword.
(Output_data_plt_x86_64_bnd::do_fill_plt_entry): Likewise.
(Output_data_plt_x86_64_bnd::do_fill_tlsdesc_entry): Likewise.
(Output_data_plt_x86_64_bnd::fill_aplt_entry): Likewise.
* testsuite/copy_test_relro_1.cc (p, b, c, q): Add separate extern
declarations.

7 years agoFix test cases to work for i386.
Cary Coutant [Wed, 11 Jan 2017 19:26:26 +0000 (11:26 -0800)] 
Fix test cases to work for i386.

gold/
PR gold/21039
* testsuite/script_test_13.sh: Adjust patterns to work for i386.
* testsuite/script_test_15a.sh: Likewise.
* testsuite/script_test_15b.sh: Likewise.
* testsuite/script_test_15c.sh: Likewise.

7 years agox86-64: Correct unwind info for the BND PLT
H.J. Lu [Wed, 11 Jan 2017 17:16:44 +0000 (09:16 -0800)] 
x86-64: Correct unwind info for the BND PLT

Since the BND PLT has

 230: 68 00 00 00 00        pushq  $0x0
 235: f2 e9 e5 ff ff ff     bnd jmpq 220 <.plt>
 23b: 0f 1f 44 00 00        nopl   0x0(%rax,%rax,1)

instead of

 230: ff 25 e2 0d 20 00     jmpq   *0x200de2(%rip)        # 201018
<func>
 236: 68 00 00 00 00        pushq  $0x0
 23b: e9 e0 ff ff ff        jmpq   220 <.plt>

its unwind info should be

DW_CFA_def_cfa_expression (DW_OP_breg7 (rsp): 8; DW_OP_breg16 (rip): 0;
DW_OP_lit15; DW_OP_and; DW_OP_lit5; DW_OP_ge; DW_OP_lit3; DW_OP_shl;
DW_OP_plus)

bfd/

PR ld/21038
* elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
(elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
elf_x86_64_eh_frame_plt_got.
(elf_x86_64_size_dynamic_sections): Get unwind info from
elf_x86_64_bnd_arch_bed for the BND PLT.

ld/

PR ld/21038
* testsuite/ld-x86-64/pr21038a.d: New file.
* testsuite/ld-x86-64/pr21038a.s: Likewise.
* testsuite/ld-x86-64/pr21038b.d: Likewise.
* testsuite/ld-x86-64/pr21038b.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pr21038a and pr21038b.

7 years agoFix typo in lookup_cmd_1 comment
Simon Marchi [Wed, 11 Jan 2017 16:15:26 +0000 (11:15 -0500)] 
Fix typo in lookup_cmd_1 comment

gdb/ChangeLog:

* cli/cli-decode.c (lookup_cmd_1): Fix typo in comment.

This page took 0.050928 seconds and 4 git commands to generate.