binutils-gdb.git
9 years agoAutomatic date update in version.in
GDB Administrator [Sat, 13 Jun 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in

9 years ago[gold][aarch64] Fix erratum 835769.
Han Shen [Wed, 10 Jun 2015 21:50:26 +0000 (14:50 -0700)]
[gold][aarch64] Fix erratum 835769.

gold/ChangeLog:

* aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
defintion outside class definition.
(AArch64_insn_utilities::AARCH64_ZR): New static constant.
(AArch64_insn_utilities::aarch64_op31): New member.
(AArch64_insn_utilities::aarch64_ra): New member.
(AArch64_insn_utilities::aarch64_mac): New member.
(AArch64_insn_utilities::aarch64_mlxl): New member.
(ST_E_835769): New global enum member.
(Stub_table::relocate_stubs): Add 835769 handler.
(Stub_template_repertoire::Stub_template_repertoire): Install new
stub type.
(AArch64_relobj::scan_errata): This func is renamed from
scan_erratum_843419.
(AArch64_relobj::do_count_local_symbols): Add 835769 handler.
(AArch64_relobj::do_relocate_sections): Add 835769 handler.
(AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
(Target_aarch64::scan_erratum_835769_span): New method.
(Target_aarch64::create_erratum_stub): New method.
(Target_aarch64::is_erratum_835769_sequence): New method.
(Target_aarch64::scan_erratum_843419_sequence): Move part of the
code into create_erratum_stub.
* options.h (fix_cortex_a53_835769): New option.

9 years agotarget: consider addressable unit size when reading/writing memory
Simon Marchi [Fri, 12 Jun 2015 21:02:44 +0000 (17:02 -0400)]
target: consider addressable unit size when reading/writing memory

If we are reading/writing from a memory object, the length represents
the number of "addresses" to read/write, so the addressable unit size
needs to be taken into account when allocating memory on gdb's side.

gdb/ChangeLog:

* target.c (target_read): Consider addressable unit size when
reading from a memory object.
(read_memory_robust): Same.
(read_whatever_is_readable): Same.
(target_write_with_progress): Consider addressable unit size
when writing to a memory object.
* target.h (target_read): Update documentation.
(target_write): Add documentation.

9 years agogdbarch: add addressable_memory_unit_size method
Simon Marchi [Fri, 12 Jun 2015 20:51:51 +0000 (16:51 -0400)]
gdbarch: add addressable_memory_unit_size method

Add a new gdbarch method to get the length of an addressable memory unit
for a given architecture. The default implementation returns 1.

gdb/ChangeLog:

* arch-utils.h (default_addressable_memory_unit_size): New.
* arch-utils.c (default_addressable_memory_unit_size): New.
* gdbarch.sh (addressable_memory_unit_size): New.
* gdbarch.h: Re-generate.
* gdbarch.c: Re-generate.

9 years agoRemove unused MTMSRD_L macro and re-add accidentally deleted comment.
Peter Bergner [Fri, 12 Jun 2015 20:06:07 +0000 (15:06 -0500)]
Remove unused MTMSRD_L macro and re-add accidentally deleted comment.

In the commit that added PowerPC Pair Singles, Ben accidentally removed
a comment and re-added an unused MTMSRD_L macro Alan had recently deleted.
This was probably just an oversite when he was refreshing his patch to
trunk.

opcodes/
* ppc-opc.c: Add comment accidentally removed by old commit.
(MTMSRD_L): Delete.

9 years agoVarious cleanups in target read/write code
Simon Marchi [Fri, 12 Jun 2015 17:08:12 +0000 (13:08 -0400)]
Various cleanups in target read/write code

This contains various cleanups in the target memory read and write code.
They are not directly related to the non-8-bits changes, but they
clarify things a bit down the line.

gdb/ChangeLog:

* target.c (target_read): Rename variables and use
TARGET_XFER_E_IO.
(target_read_with_progress): Same.
(read_memory_robust): Constify parameters and rename
variables.
(read_whatever_is_readable): Constify parameters,
rename variables, adjust formatting.
* target.h (read_memory_robust): Constify parameters.

9 years agosim: bfin: expand CB_SYS_xxx comment
Mike Frysinger [Fri, 12 Jun 2015 16:12:52 +0000 (12:12 -0400)]
sim: bfin: expand CB_SYS_xxx comment

9 years agosim: update configure.in->configure.ac docs
Mike Frysinger [Fri, 12 Jun 2015 16:04:42 +0000 (12:04 -0400)]
sim: update configure.in->configure.ac docs

A few places still refer to the configure.in file; update them.

9 years agoppc64: Handle short vectors as function return types
Ulrich Weigand [Fri, 12 Jun 2015 15:43:48 +0000 (17:43 +0200)]
ppc64: Handle short vectors as function return types

Short synthetic vector types (i.e. those defined using GCC's
attribute ((vector_size)) instead of AltiVec vector types)
are returned in r3.  Fix ppc64_sysv_abi_return_value to
correctly handle this.

gdb/ChangeLog:

* ppc-sysv-tdep.c (ppc64_sysv_abi_return_value_base): Handle short
synthetic (non-AltiVec) vector types.
(ppc64_sysv_abi_return_value): Likewise.

9 years agosim: drop -DTRACE from configure
Mike Frysinger [Fri, 12 Jun 2015 14:32:54 +0000 (10:32 -0400)]
sim: drop -DTRACE from configure

No code uses this anymore and the symbol conflicts with the new TRACE
helper.  Punt it from configure.

9 years agosim: msp430: use new common trace print helpers
Mike Frysinger [Fri, 12 Jun 2015 14:07:55 +0000 (19:52 +0545)]
sim: msp430: use new common trace print helpers

Replace the "if (TRACE_xxx_P) trace_generic" form with "TRACE_xxx".
The output is the same, but the code is nicer to read.

9 years agoFix MI dprintf-insert not printing on a resolved pending location.
Antoine Tremblay [Fri, 12 Jun 2015 11:58:47 +0000 (07:58 -0400)]
Fix MI dprintf-insert not printing on a resolved pending location.

This patch fixes the "Format string required" error when trying to print
a dprintf on a now resolved, pending location when set via the MI interface
even if the format string is entered correctly.

This patch also adds a test case to check that issue called
mi-dprintf-pending.exp.

gdb/ChangeLog:

PR breakpoints/16465
* breakpoint.c (create_breakpoint): Save extra_string for
pending breakpoints.

gdb/testsuite/ChangeLog:

PR breakpoints/16465
* gdb.mi/mi-dprintf-pending.c: New file.
* gdb.mi/mi-dprintf-pending.exp: New test.
* gdb.mi/mi-dprintf-pendshr.c: New file.

9 years agosim: moxie: use new common trace defines
Mike Frysinger [Fri, 12 Jun 2015 09:53:03 +0000 (15:38 +0545)]
sim: moxie: use new common trace defines

Now that there's common helpers for printing trace data, switch to that
to restore the insn tracing support for this target.

9 years agosim: trace: add common macros for logging info
Mike Frysinger [Thu, 11 Jun 2015 10:28:25 +0000 (18:28 +0800)]
sim: trace: add common macros for logging info

The Blackfin port had some TRACE_xxx macros for easily logging trace data.
Use these as a base for common ones that have a simple form and match the
existing sets of helper macros.

9 years agosim: mips: switch to common WITH_TRACE_ANY_P
Mike Frysinger [Fri, 12 Jun 2015 10:06:35 +0000 (15:51 +0545)]
sim: mips: switch to common WITH_TRACE_ANY_P

We want to add new common trace helpers including "TRACE", so change the
mips one to the new WITH_TRACE_ANY_P macro since they do the same thing.

9 years agosim: trace: add WITH_TRACE_ANY_P helper
Mike Frysinger [Fri, 12 Jun 2015 10:07:07 +0000 (15:52 +0545)]
sim: trace: add WITH_TRACE_ANY_P helper

We have STRACE_ANY_P and TRACE_ANY_P, so add WITH_TRACE_ANY_P to fill
out the API.  This lets us wrap the internal configure symbol.

9 years agosim: moxie: rename TRACE to MOXIE_TRACE_INSN
Mike Frysinger [Fri, 12 Jun 2015 09:51:32 +0000 (15:36 +0545)]
sim: moxie: rename TRACE to MOXIE_TRACE_INSN

We want to add new common trace helpers including "TRACE", so rename the
moxie one to MOXIE_TRACE_INSN.  This also matches what the code is doing.

9 years agoAdd new ld option: --print-memory-usage
Tristan Gingold [Fri, 5 Jun 2015 13:09:31 +0000 (15:09 +0200)]
Add new ld option: --print-memory-usage

ld/
* NEWS: Mention new option.
* lexsup.c (parse_args): Handle --print-memory-usage.
(ld_options): Add --print-memory-usage.
* ldmain.c (main): Call lang_print_memory_usage.
* ldlex.h (enum option_values): Add OPTION_PRINT_MEMORY_USAGE.
* ldlang.h: Add prototype of lang_print_memory_usage.
* ldlang.c (lang_print_memory_size, lang_print_memory_usage): New
functions.
* ld.texinfo (Options): Document --print-memory-usage.
* ld.h (args_type): Add print_memory_usage field.

ld/testsuite/
* ld-scripts/print-memory-usage-1.t,
* ld-scripts/print-memory-usage-1.s,
* ld-scripts/print-memory-usage-1.l,
* ld-scripts/print-memory-usage-2.t,
* ld-scripts/print-memory-usage-2.l,
* ld-scripts/print-memory-usage-3.s,
* ld-scripts/print-memory-usage-3.t,
* ld-scripts/print-memory-usage-3.l,
* ld-scripts/print-memory-usage.t: New tests.
* ld-scripts/print-memory-usage.exp: Run them.

9 years agosim: cgen: namespace custom trace functions
Mike Frysinger [Fri, 12 Jun 2015 07:44:02 +0000 (13:29 +0545)]
sim: cgen: namespace custom trace functions

The cgen code declares some macros/funcs using the trace_xxx prefix, but
the code isn't generic and only works with cgen targets.  This is blocking
the creation of new common trace functions.

Let's blindly add cgen_xxx prefixes to all these symbols.  Some already
use this convention to avoid conflicts, so it makes sense to align them.
In the future we might want to move some to the common trace core, but
one thing at a time.

9 years agoFix broken GDB build after adding Bound table support for i386.
Walfred Tedeschi [Fri, 12 Jun 2015 07:42:16 +0000 (09:42 +0200)]
Fix broken GDB build after adding Bound table support for i386.

Types used for some variables could not be used for 32 bits, causing a
compilation failure.
This patch adds a cast to force a quite compilation, but at the same
time it bails out in the case that the cast performed is not safe, i.e.
in the case where the debuggee is 64bit and debugger is 32bit.

Documentation was also affected, once a different version of texinfo the
docs could not be build.

2015-06-10  Walfred Tedeschi  <walfred.tedeschi@intel.com>

* i386-tdep.c (i386_mpx_get_bt_entry): Add a cast for mpx_bd_mask
and bt_mask to CORE_ADDR.

doc:
* gdb.textinfo (i386): Fix "@end table" end and "@table" placement.

9 years agoAutomatic date update in version.in
GDB Administrator [Fri, 12 Jun 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in

9 years agotc-hppa.c: Speed up search for last label
John David Anglin [Thu, 11 Jun 2015 22:50:39 +0000 (18:50 -0400)]
tc-hppa.c: Speed up search for last label

9 years agoFix gold build error at -O0.
Cary Coutant [Thu, 11 Jun 2015 20:19:38 +0000 (13:19 -0700)]
Fix gold build error at -O0.

In aarch64.cc, Erratum_stub::STUB_ADDR_ALIGN and Reloc_stub::STUB_ADDR_ALIGN
are declared as static const int, and initialized in the class body. These
values are referenced from outside the class body, and with no optimization,
the references go unresolved.

gold/
* aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
outside class body.
(Reloc_stub::STUB_ADDR_ALIGN): Likewise.

9 years agoFix bug where SECTIONS clause does not handle compressed debug sections.
Cary Coutant [Thu, 11 Jun 2015 17:17:04 +0000 (10:17 -0700)]
Fix bug where SECTIONS clause does not handle compressed debug sections.

When laying out .debug_* sections, we translate the names of compressed
debug sections that start with ".zdebug", but when processing input
section specs in a linker script, we do not handle the translation there.
This results in an internal error as reported in PR 17731.

gold/
PR gold/17731
* layout.cc (corresponding_uncompressed_section_name): New function.
(Layout::choose_output_section): Call it.
* layout.h (corresponding_uncompressed_section_name): New function.
* script-sections.cc (Input_section_info::set_section_name): Check
for compressed debug section (.zdebug style).

9 years agoFix broken gold/testsuite/script_test_12 in some setup.
Jing Yu [Thu, 11 Jun 2015 19:41:36 +0000 (12:41 -0700)]
Fix broken gold/testsuite/script_test_12 in some setup.

This patch adds -O0 to gold script_test_12 test, hoping that compiler
won't change the order of globel variables that the test assumes.

Changelog:
testsuite/Makefile.am: Add -O0 to compile script_test_12 test.
testsuite/Makefile.in: Regenerate.

9 years agosim: msp430: delete unused trace macros
Mike Frysinger [Thu, 11 Jun 2015 16:08:11 +0000 (21:53 +0545)]
sim: msp430: delete unused trace macros

These macros were copied from the Blackfin port but never used, so delete
them as part of the trace unification work.

9 years agosim: trace: centralize the system tracing
Mike Frysinger [Wed, 10 Jun 2015 10:02:52 +0000 (18:02 +0800)]
sim: trace: centralize the system tracing

First we convert the ETRACE_P to STRACE_EVENTS_P.  This means we move from
using the sim_events.trace storage to the common sim_state_base.trace_data
array.  With that deleted, the common trace init code can be simplified so
the sim state works the same as the sim cpu.

9 years agosim: trace: add STRACE_xxx_P macros
Mike Frysinger [Wed, 10 Jun 2015 10:00:09 +0000 (18:00 +0800)]
sim: trace: add STRACE_xxx_P macros

These are the parallel to the TRACE_xxx_P macros and fill out the full
set to match the existing debug one.

9 years agosim: trace: use existing defines for the useful mask
Mike Frysinger [Wed, 10 Jun 2015 08:01:29 +0000 (16:01 +0800)]
sim: trace: use existing defines for the useful mask

No point in duplicating the shift logic when we have macros already to
keep that all unified.

9 years agosim: trace: create a common WITH_TRACE_P macro
Mike Frysinger [Wed, 10 Jun 2015 07:58:03 +0000 (15:58 +0800)]
sim: trace: create a common WITH_TRACE_P macro

This way we can use the IDX macros everywhere and not worry about the
encoding of the WITH_TRACE define in multiple places.

9 years agosim: frv: drop custom debug mask
Mike Frysinger [Wed, 10 Jun 2015 07:54:16 +0000 (15:54 +0800)]
sim: frv: drop custom debug mask

This is the only sim that sets up its own WITH_TRACE mask and it conflicts
with the user setting their own list at configure time.  Drop it to match
all the other sims.

9 years agosim: m68hc11: delete unused interrupt_names
Mike Frysinger [Tue, 9 Jun 2015 15:44:25 +0000 (23:44 +0800)]
sim: m68hc11: delete unused interrupt_names

The interrupts.c file has a static/fuller definition that is used,
so drop this copy in interp.c.

9 years agosim: m68hc11: switch to common sim_resume
Mike Frysinger [Tue, 9 Jun 2015 15:44:13 +0000 (23:44 +0800)]
sim: m68hc11: switch to common sim_resume

This code already matched the common sim reusme logic, so we can simply
drop it and pull in the common code.

9 years agosim: mn10300: delete unused memory code
Mike Frysinger [Tue, 9 Jun 2015 15:38:15 +0000 (23:38 +0800)]
sim: mn10300: delete unused memory code

Only one place used get_word/put_word, so inline the usage there.
All the rest is dead code so trim it.

9 years agoUse pulongest for printing ssize_t
Gary Benson [Thu, 11 Jun 2015 12:38:15 +0000 (13:38 +0100)]
Use pulongest for printing ssize_t

This commit changes the debug printing code in linux-namespaces.c
to use pulongest instead of "%ld".

gdb/ChangeLog:

* nat/linux-namespaces.c (mnsh_send_message): Use pulongest.
(mnsh_recv_message): Likewise.

9 years agoFix ARI new warnings introduced in i386-tdep.c.
Walfred Tedeschi [Thu, 11 Jun 2015 11:48:26 +0000 (13:48 +0200)]
Fix ARI new warnings introduced in i386-tdep.c.

1. gdb/i386-tdep.c:8720: Do not use 'long long', instead use LONGEST
gdb/i386-tdep.c:8720:  long long int size;

2. gdb/i386-tdep.c:8755: Do not use printf(%ll), instead use printf(%s,phex()) to dump a 'long long' value
gdb/i386-tdep.c:8755: ui_out_field_fmt (uiout, "size", "%lld", size);

2015-06-11  Walfred Tedeschi  <walfred.tedeschi@intel.com>

* i386-tdep.c (i386_mpx_print_bounds): use of LONGEST instead of
long long int and plongest instead of %ll.

Signed-off-by: Walfred Tedeschi <walfred.tedeschi@intel.com>
9 years agosim: mn10300: add missing static markings
Mike Frysinger [Tue, 9 Jun 2015 14:31:51 +0000 (22:31 +0800)]
sim: mn10300: add missing static markings

9 years agosim: mn10300: delete unused exception/exited/debug state
Mike Frysinger [Tue, 9 Jun 2015 14:27:09 +0000 (22:27 +0800)]
sim: mn10300: delete unused exception/exited/debug state

The syscall path was the only code checking the custom exception state
after recent cleanups.  Once we change that to the common engine halt
function, we can delete that state entirely.

This also helps highlight some other dead code that we can cull.

9 years agosim: mn10300: use common size types
Mike Frysinger [Tue, 9 Jun 2015 15:23:41 +0000 (23:23 +0800)]
sim: mn10300: use common size types

No point in open coding this logic here when we have common size types
already that give the right answer.

9 years agosim: m68hc11/mn10300/v850: delete redundant INLINE defines
Mike Frysinger [Tue, 9 Jun 2015 14:26:16 +0000 (22:26 +0800)]
sim: m68hc11/mn10300/v850: delete redundant INLINE defines

The sim-inline.h header already takes care of this for us, so punt
the local definitions.

9 years agosim: microblaze: switch to common sim_resume/sim_stop_reason
Mike Frysinger [Tue, 9 Jun 2015 08:10:49 +0000 (16:10 +0800)]
sim: microblaze: switch to common sim_resume/sim_stop_reason

This allows us to use the common code for all exception handling.

9 years agoFix ARI warning in linux-namespaces.c
Gary Benson [Thu, 11 Jun 2015 09:58:41 +0000 (10:58 +0100)]
Fix ARI warning in linux-namespaces.c

This commit fixes the following ARI warning:

  gdb/nat/linux-namespaces.c:28: regression: Do not include
  wait.h or sys/wait.h, instead include gdb_wait.h

gdb/ChangeLog:

* nat/linux-namespaces.c (gdb_wait.h): New include.
(sys/wait.h): Do not include.

9 years ago[GOLD] Fix handling of __start/__stop symbols
Davide Italiano [Sun, 31 May 2015 20:22:11 +0000 (13:22 -0700)]
[GOLD] Fix handling of __start/__stop symbols

If the section contains 'Q' in the name, is_cident() returns false,
__start and __stop symbols for the section are not generated..

* gold.h (is_cident): Correct typo.

9 years agoAutomatic date update in version.in
GDB Administrator [Thu, 11 Jun 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in

9 years agodwarf2read: call dwarf_finish_line when ending a sequence
Simon Marchi [Wed, 10 Jun 2015 20:34:16 +0000 (16:34 -0400)]
dwarf2read: call dwarf_finish_line when ending a sequence

Commit d9b3de22f33e400f7f409cce3acf6c7dab07dd79 introduced a behaviour
change where dwarf_finish_line was not called anymore when ending a
sequence of machine instructions. This patch restores the original
behaviour.

gdb/ChangeLog:

* dwarf2read.c (dwarf_record_line): Call dwarf_record_line if
 end_sequence is true.

9 years agoCode cleanup: Use explicit NULL comparison
Jan Kratochvil [Wed, 10 Jun 2015 17:37:19 +0000 (19:37 +0200)]
Code cleanup: Use explicit NULL comparison

gdb/ChangeLog
2015-06-10  Jan Kratochvil  <jan.kratochvil@redhat.com>

Code cleanup.
* solib-target.c (library_list_start_list): Use explicit NULL
comparison.

9 years agoPatch for erratum-843419 (2 of 2 - fix erratum occurrences).
Han Shen [Wed, 10 Jun 2015 16:50:22 +0000 (09:50 -0700)]
Patch for erratum-843419 (2 of 2 - fix erratum occurrences).

Now fixing for 843419 is fully functional.

The first part of the erratum fix CL is here -
https://sourceware.org/ml/binutils/2015-04/msg00229.html

gold/ChangeLog
2015-06-10  Han Shen  <shenhan@google.com>

    * aarch64.cc(global enum): New constants representing stub types.
    (Stub_template): New POD struct.
    (Stub_template_repertoire): New class.
    (Stub_base): New class.
    (Erratum_stub): New class.
    (Reloc_stub): Refactored to be a subclass of Stub_base.
    (Reloc_stub::Stub_type): Removed.
    (Reloc_stub::offset): Moved to Stub_base.
    (Reloc_stub::set_offset): Moved to Stub_base.
    (Reloc_stub::destination_address): Moved to Stub_base.
    (Reloc_stub::set_destination_address): Moved to Stub_base.
    (Reloc_stub::reset_destination_address): Moved to Stub_base.
    (Reloc_stub::stub_type): Renamed and moved to Stub_base.
    (Reloc_stub::stub_size): Renamed and moved to Stub_base.
    (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
    (Reloc_stub::write): Moved to Stub_base.
    (Reloc_stub::invalid_offset): Moved to Stub_base.
    (Reloc_stub::invalid_address): Moved to Stub_base.
    (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
    (Reloc_stub::stub_insns_): Moved to Stub_base.
    (Reloc_stub::offset_): Moved to Stub_base.
    (Reloc_stub::destination_address_): Moved to Stub_base.
    (Stub_table::The_aarch64_relobj): New typedef.
    (Stub_table::The_erratum_stub): New typedef.
    (Stub_table::The_erratum_stub_less): New typedef.
    (Stub_table::The_erratum_stub_set): New typedef.
    (Stub_table::The_erratum_stub_set_iter): New typedef.
    (Stub_table::empty): Added emptiness testing for erratum stubs.
    (Stub_table::add_erratum_stub): New method to add an erratum stub.
    (Stub_table::find_erratum_stub): New method.
    (Stub_table::find_erratum_stubs_for_input_section): New method.
    (Stub_table::erratum_stub_address): New method.
    (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
    (Stub_table::do_addralign): Modified to handle erratum stubs.
    (Stub_table::erratum_stubs_): New member.
    (Stub_table::erratum_stub_size_): New member.
    (Stub_table::relocate_stubs): Modified to handle erratum stubs.
    (Stub_table::do_write): Modified to handle erratum stubs.
    (AArch64_relobj::The_erratum_stub): New typedef.
    (AArch64_relobj::Erratum_stub_set_iter): New typedef.
    (AArch64_relobj::fix_errata): New method.
    (Target_aarch64::The_reloc_stub_type): Removed.
    (Target_aarch64::The_erratum_stub): New typede.
    (AArch64_relocate_functions::construct_b): New method.

9 years agoFix gdbserver <library-list> and its #FIXED version="1.0"
Jan Kratochvil [Wed, 10 Jun 2015 16:29:05 +0000 (18:29 +0200)]
Fix gdbserver <library-list> and its #FIXED version="1.0"

While reimplementing <library-list/> I found from expat-2.0.1-11.fc15.x86_64:

warning: while parsing target library list (at line 1): Required attribute "version" of <library-list-svr4> not specified

I believe the same bug has to apply for existing FSF gdbserver but I do not
have any <library-list/> platform to test it (I did not try to build MinGW).

features/library-list.dtd:
<!ATTLIST library-list  version CDATA   #FIXED  "1.0">

http://www.xml.com/pub/a/98/10/guide0.html?page=3 says:

In this case, the attribute is not required, but if it occurs, it must
have the specified value.

Which would suggest gdbserver is right but solib-target.c is wrong.  One could
also make gdbserver explicit for the version (if those 14 bytes are not of
a concern).

gdb/ChangeLog
2015-06-10  Jan Kratochvil  <jan.kratochvil@redhat.com>

* solib-target.c (library_list_start_list): Do not dereference
variable version in its initialization.  Make the VERSION check handle
NULL.
(library_list_attributes): Make "version" GDB_XML_AF_OPTIONAL.

gdb/gdbserver/ChangeLog
2015-06-10  Jan Kratochvil  <jan.kratochvil@redhat.com>

* server.c (handle_qxfer_libraries): Set `version' attribute for
<library-list>.

9 years agoAnnounce new container-awareness features for GNU/Linux systems
Gary Benson [Wed, 10 Jun 2015 13:28:44 +0000 (14:28 +0100)]
Announce new container-awareness features for GNU/Linux systems

This commit announces the newly added ability to directly access
executable and shared library files when attaching to processes
running in containers on GNU/Linux systems.

gdb/ChangeLog:

* NEWS: Announce support for direct access of executable and
shared library files when attaching to inferiors in containers
on GNU/Linux systems.

9 years agoImplement vFile:setfs in gdbserver
Gary Benson [Wed, 10 Jun 2015 13:28:44 +0000 (14:28 +0100)]
Implement vFile:setfs in gdbserver

This commit implements the "vFile:setfs" packet in gdbserver.

gdb/gdbserver/ChangeLog:

* target.h (struct target_ops) <multifs_open>: New field.
<multifs_unlink>: Likewise.
<multifs_readlink>: Likewise.
* linux-low.c (nat/linux-namespaces.h): New include.
(linux_target_ops): Initialize the_target->multifs_open,
the_target->multifs_unlink and the_target->multifs_readlink.
* hostio.h (hostio_handle_new_gdb_connection): New declaration.
* hostio.c (hostio_fs_pid): New static variable.
(hostio_handle_new_gdb_connection): New function.
(handle_setfs): Likewise.
(handle_open): Use the_target->multifs_open as appropriate.
(handle_unlink): Use the_target->multifs_unlink as appropriate.
(handle_readlink): Use the_target->multifs_readlink as
appropriate.
(handle_vFile): Handle vFile:setfs packets.
* server.c (handle_query): Call hostio_handle_new_gdb_connection
after target_handle_new_gdb_connection.

9 years agoImplement multiple-filesystem support for remote targets
Gary Benson [Wed, 10 Jun 2015 13:28:44 +0000 (14:28 +0100)]
Implement multiple-filesystem support for remote targets

This commit allows GDB to access executables and shared libraries
on remote targets where the remote stub does not share a common
filesystem with the inferior(s).  A new packet "vFile:setfs" is
added to the remote protocol and the three remote hostio functions
with filename arguments are modified to send "vFile:setfs" packets
as necessary.

gdb/ChangeLog:

* remote.c (struct remote_state) <fs_pid>: New field.
(new_remote_state): Initialize the above.
(PACKET_vFile_setfs): New enum value.
(remote_hostio_set_filesystem): New function.
(remote_hostio_open): Call the above.
(remote_hostio_unlink): Likewise.
(remote_hostio_readlink): Likewise.
(_initialize_remote): Register new "set/show remote
hostio-setfs-packet" command.
* NEWS: Announce new vFile:setfs packet.

gdb/doc/ChangeLog:

* gdb.texinfo (Remote Configuration): Document the
"set/show remote hostio-setfs-packet" command.
(Host I/O Packets): Document the vFile:setfs packet.

9 years agoImplement mount namespace support for native Linux targets
Gary Benson [Wed, 10 Jun 2015 13:28:43 +0000 (14:28 +0100)]
Implement mount namespace support for native Linux targets

This commit allows GDB to access executables and shared libraries
on native Linux targets where GDB and the inferior have different
mount namespaces.

gdb/ChangeLog:

* linux-nat.c (nat/linux-namespaces.h): New include.
(fileio.h): Likewise.
(linux_nat_filesystem_is_local): New function.
(linux_nat_fileio_pid_of): Likewise.
(linux_nat_fileio_open): Likewise.
(linux_nat_fileio_readlink): Likewise.
(linux_nat_fileio_unlink): Likewise.
(linux_nat_add_target): Initialize to_filesystem_is_local,
to_fileio_open, to_fileio_readlink and to_fileio_unlink.
(_initialize_linux_nat): New "set/show debug linux-namespaces"
commands.
* NEWS: Mention new "set/show debug linux-namespaces" commands.

gdb/doc/ChangeLog:

* gdb.texinfo (Debugging Output): Document the "set/show debug
linux-namespaces" command.

9 years agoAdd "inferior" argument to some target_fileio functions
Gary Benson [Wed, 10 Jun 2015 13:28:43 +0000 (14:28 +0100)]
Add "inferior" argument to some target_fileio functions

This commit adds a new argument to all target_fileio functions with
filename arguments to allow the desired inferior to be specified.
This allows GDB to support systems where processes do not necessarily
share a common filesystem.

gdb/ChangeLog:

* target.h (struct inferior): New forward declaration.
(struct target_ops) <to_filesystem_is_local>: Update comment.
(struct target_ops) <to_fileio_open>: New argument inf.
Update comment.  All implementations updated.
(struct target_ops) <to_fileio_unlink>: Likewise.
(struct target_ops) <to_fileio_readlink>: Likewise.
(target_filesystem_is_local): Update comment.
(target_fileio_open): New argument inf.  Update comment.
(target_fileio_unlink): Likewise.
(target_fileio_readlink): Likewise.
(target_fileio_read_alloc): Likewise.
(target_fileio_read_stralloc): Likewise.
* target.c (target_fileio_open): New argument inf.
Pass inf to implementation.  Update debug printing.
(target_fileio_unlink): Likewise.
(target_fileio_readlink): Likewise.
(target_fileio_read_alloc_1): New argument inf. Pass inf
to target_fileio_open.
(target_fileio_read_alloc): New argument inf. Pass inf to
target_fileio_read_alloc_1.
(target_fileio_read_stralloc): Likewise.
* gdb_bfd.c (inferior.h): New include.
(gdb_bfd_iovec_fileio_open): Replace unused "open_closure"
argument with new argument "inferior".  Pass inferior to
target_fileio_open.
(gdb_bfd_open): Supply inferior argument to
gdb_bfd_iovec_fileio_open.
* linux-tdep.c (linux_info_proc): Supply inf argument to
relevant target_fileio calls.
(linux_find_memory_regions_full): Likewise.
(linux_fill_prpsinfo): Likewise.
* remote.c (remote_filesystem_is_local): Supply inf
argument to remote_hostio_open.
(remote_file_put): Likewise.
(remote_file_get): Likewise.
(remote_file_delete): Supply inf argument to
remote_hostio_unlink.

9 years agoComment and whitespace changes
Gary Benson [Wed, 10 Jun 2015 13:28:43 +0000 (14:28 +0100)]
Comment and whitespace changes

Comments on the various implementations of target fileio functions
duplicate information documented in target.h.  This commit replaces
the duplicated documentation with breadcrumbs, and inserts blank
lines to separate comments from the functions they describe where
necessary.

gdb/ChangeLog:

* inf-child.c (inf_child_fileio_open): Replace comment.
(inf_child_fileio_pwrite): Likewise.
(inf_child_fileio_pread): Likewise.
(inf_child_fileio_fstat): Insert blank line before comment.
(inf_child_fileio_close): Replace comment.
(inf_child_fileio_unlink): Likewise.
(inf_child_fileio_readlink): Likewise.
* remote.c (remote_hostio_open): Likewise.
(remote_hostio_pread): Likewise.
(remote_hostio_pwrite): Likewise.
(remote_hostio_close): Likewise.
(remote_hostio_unlink): Likewise.
(remote_hostio_readlink): Likewise.
(remote_hostio_fstat): Likewise.
(remote_filesystem_is_local): Likewise.
* target.c (target_fileio_open): Likewise.
(target_fileio_pwrite): Likewise.
(target_fileio_pread): Likewise.
(target_fileio_fstat): Insert blank line before comment.
(target_fileio_close): Replace comment.
(target_fileio_unlink): Likewise.
(target_fileio_readlink): Likewise.
(target_fileio_read_alloc): Likewise.
(target_fileio_read_stralloc): Likewise.

9 years agoRemove linux_proc_pid_get_ns
Gary Benson [Wed, 10 Jun 2015 13:28:43 +0000 (14:28 +0100)]
Remove linux_proc_pid_get_ns

This commit removes linux_proc_pid_get_ns, and updates its only
caller to use linux_ns_same instead.

gdb/ChangeLog:

* linux-thread-db.c (nat/linux-namespaces.h): New include.
(check_pid_namespace_match): Use linux_ns_same rather than
linux_proc_pid_get_ns to spot PID namespace mismatches.
* nat/linux-procfs.h (linux_proc_pid_get_ns): Remove.
* nat/linux-procfs.c (linux_proc_pid_get_ns): Likewise.

9 years agoIntroduce nat/linux-namespaces.[ch]
Gary Benson [Wed, 10 Jun 2015 13:28:43 +0000 (14:28 +0100)]
Introduce nat/linux-namespaces.[ch]

This commit introduces new shared files nat/linux-namespaces.[ch]
containing code to support Linux namespaces that will be used by
both GDB and gdbserver.

gdb/ChangeLog:

* configure.ac (AC_CHECK_FUNCS): Add setns.
* config.in: Regenerate.
* configure: Likewise.
* nat/linux-namespaces.h: New file.
* nat/linux-namespaces.c: Likewise.
* Makefile.in (HFILES_NO_SRCDIR): Add nat/linux-namespaces.h.
(linux-namespaces.o): New rule.
* config/aarch64/linux.mh (NATDEPFILES): Add linux-namespaces.o.
* config/alpha/alpha-linux.mh (NATDEPFILES): Likewise.
* config/arm/linux.mh (NATDEPFILES): Likewise.
* config/i386/linux.mh (NATDEPFILES): Likewise.
* config/i386/linux64.mh (NATDEPFILES): Likewise.
* config/ia64/linux.mh (NATDEPFILES): Likewise.
* config/m32r/linux.mh (NATDEPFILES): Likewise.
* config/m68k/linux.mh (NATDEPFILES): Likewise.
* config/mips/linux.mh (NATDEPFILES): Likewise.
* config/pa/linux.mh (NATDEPFILES): Likewise.
* config/powerpc/linux.mh (NATDEPFILES): Likewise.
* config/powerpc/ppc64-linux.mh (NATDEPFILES): Likewise.
* config/powerpc/spu-linux.mh (NATDEPFILES): Likewise.
* config/s390/linux.mh (NATDEPFILES): Likewise.
* config/sparc/linux.mh (NATDEPFILES): Likewise.
* config/sparc/linux64.mh (NATDEPFILES): Likewise.
* config/tilegx/linux.mh (NATDEPFILES): Likewise.
* config/xtensa/linux.mh (NATDEPFILES): Likewise.

gdb/gdbserver/ChangeLog:

* configure.ac (AC_CHECK_FUNCS): Add setns.
* config.in: Regenerate.
* configure: Likewise.
* Makefile.in (SFILES): Add nat/linux-namespaces.c.
(linux-namespaces.o): New rule.
* configure.srv (srv_linux_obj): Add linux-namespaces.o.

9 years agoMove make_cleanup_close to common code
Gary Benson [Wed, 10 Jun 2015 13:28:43 +0000 (14:28 +0100)]
Move make_cleanup_close to common code

This commit moves the function make_cleanup_close from gdb/utils.[ch]
to gdb/common/filestuff.[ch] to make it usable from common code.

gdb/ChangeLog:

* utils.h (make_cleanup_close): Moved to common/filestuff.h.
* utils.c (do_close_cleanup): Moved to common/filestuff.c.
(make_cleanup_close): Likewise.
* common/filestuff.h (make_cleanup_close): Moved from utils.h.
* common/filestuff.c (do_close_cleanup): Moved from utils.c.
(make_cleanup_close): Likewise.

9 years agowindows-nat: Also ignore ERROR_INVALID_HANDLE from SuspendThread()
Jon Turney [Wed, 3 Jun 2015 13:28:29 +0000 (14:28 +0100)]
windows-nat: Also ignore ERROR_INVALID_HANDLE from SuspendThread()

Discussed somewhat in the thread at
https://cygwin.com/ml/gdb-patches/2013-06/msg00680.html

This is pretty straightforward to demonstrate on Cygwin currently:

$ cat main.c

int main()
{
  return 0;
}

$ gcc -g -O0 main.c -o main

$ ./gdb ./main
[...]
(gdb) r
Starting program: /wip/binutils-gdb/build.x86_64/gdb/main
warning: SuspendThread (tid=0x1cf0) failed. (winerr 6)
[Inferior 1 (process 976) exited normally]

with this patch applied:

$ ./gdb ./main
[...]
(gdb) r
Starting program: /wip/binutils-gdb/build.x86_64/gdb/main
[Inferior 1 (process 4852) exited normally]

gdb/ChangeLog:

2015-06-03  Jon Turney  <jon.turney@dronecode.org.uk>

* windows-nat.c (thread_rec): Also ignore ERROR_INVALID_HANDLE
from SuspendThread().

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
9 years agowindows-nat: Trim a trailing '\n' from OutputDebugString before echoing it
Jon Turney [Wed, 3 Jun 2015 13:03:50 +0000 (14:03 +0100)]
windows-nat: Trim a trailing '\n' from OutputDebugString before echoing it

For cosmetic purposes, trim a trailing '\n' from OutputDebugString before
echoing it, as warning() will add a '\n', anyhow.

gdb/ChangeLog:

2015-06-03  Jon Turney  <jon.turney@dronecode.org.uk>

* windows-nat.c (handle_output_debug_string): Trim trailing '\n'
from OutputDebugString.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
9 years agoMissing Changelogs for last commits
Walfred Tedeschi [Wed, 10 Jun 2015 08:52:12 +0000 (10:52 +0200)]
Missing Changelogs for last commits

Signed-off-by: Walfred Tedeschi <walfred.tedeschi@intel.com>
9 years agoAdd support for bound table in the Intel MPX context.
Walfred Tedeschi [Tue, 9 Jun 2015 13:27:02 +0000 (15:27 +0200)]
Add support for bound table in the Intel MPX context.

Intel(R) Memory protection bound information are located in register
to be tested using the MPX new instructions. Since the number of
bound registers are limited a table is used to provide storage for
bounds during run-time.

In order to investigate the contents of the MPX bound table two new
commands are added to GDB.  "show mpx bound" and "set mpx bound" are
used to display and set values on the MPX bound table.

2015-04-20  Walfred Tedeschi  <walfred.tedeschi@intel.com>
            Mircea Gherzan  <mircea.gherzan@intel.com>

* i386-tdep.c (MPX_BASE_MASK, MPX_BD_MASK, MPX_BT_MASK, MPX_BD_MASK_32,
MPX_BT_MASK_32): New macros.
(i386_mpx_set_bounds): New function that implements
the command "set-mpx-bound".
(i386_mpx_enabled) Helper function to test MPX availability.
(i386_mpx_bd_base) Helper function to calculate the base directory
address. (i386_mpx_get_bt_entry) Helper function to access a bound
table entry. (i386_mpx_print_bounds) Effectively display bound
information. (_initialize_i386_tdep): Qdd new commands
to commands "set mpx" and "show mpx". (_initialize_i386_tdep):
Add "bound" to the commands "show mpx" and "set mpx" commands.
(mpx_set_cmdlist and mpx_show_cmdlist):
list for the new prefixed "set mpx" and "show mpx" commands.
* NEWS: List new commands for MPX support.

testsuite:

* gdb.arch/i386-mpx-map.c: New file.
* gdb.arch/i386-mpx-map.exp: New File.

doc:
* gdb.texinfo (i386): Add documentation about "show mpx bound"
and "set mpx bound".

9 years agoObvious indentation fixes on test sample and test file for MPX registers.
Walfred Tedeschi [Mon, 8 Jun 2015 15:42:08 +0000 (17:42 +0200)]
Obvious indentation fixes on test sample and test file for MPX registers.

2015-06-08  Walfred Tedeschi  <walfred.tedeschi@intel.com>

gdb/testsuite:

* gdb.arch/i386-mpx.c (have_mpx): Indentation fixed.
* gdb.arch/i386-mpx.exp: Indentation fixed.

9 years agoImprove test for processor feature om MPX registers test.
Walfred Tedeschi [Mon, 8 Jun 2015 15:37:40 +0000 (17:37 +0200)]
Improve test for processor feature om MPX registers test.

Skips the MPX register test in case target is not Intel.
Improves the test for MPX feature making MPX and AVX512
tests more similar in terms of initialization.
Indentation was improved on sample file and final return added
to have_mpx.  On test file identation was improved and
gdb_send was exchanged by gdb_test_multiple.

2015-06-08  Walfred Tedeschi  <walfred.tedeschi@intel.com>

gdb/testsuite
* gdb.arch/i386-mpx.c: Added final return to the have_mpx
function and improved indentation.
* gdb.arch/i386-mpx.exp: Exchanging gdb_send and gdb_expect for
gdb_test_multiple. Added additional tests to skip the test.

9 years agoFix MPX and AVX512 tests for path changes.
Walfred Tedeschi [Mon, 8 Jun 2015 15:51:04 +0000 (17:51 +0200)]
Fix MPX and AVX512 tests for path changes.

Changes on the path for i386-cpuid.h file lead to failure in compiling
tests for AVX512 and MPX.

2015-06-08  Walfred Tedeschi  <walfred.tedeschi@intel.com>

gdb/testsuite
* gdb.arch/i386-avx512.c: Change path in include file.
* gdb.arch/i386-avx512.exp: Change include dir path
compilation flag.
* gdb.arch/i386-mpx.c: Change path in include file.
* gdb.arch/i386-mpx.exp: Change include dir path compilation
flag.

9 years agoAutomatic date update in version.in
GDB Administrator [Wed, 10 Jun 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in

9 years agoFix latest sim/common/ChangeLog entry.
Joel Brobecker [Tue, 9 Jun 2015 18:29:09 +0000 (14:29 -0400)]
Fix latest sim/common/ChangeLog entry.

9 years agoRemove unnecessary empty line in sim/common/ChangeLog
Joel Brobecker [Tue, 9 Jun 2015 18:27:58 +0000 (14:27 -0400)]
Remove unnecessary empty line in sim/common/ChangeLog

9 years agoFix spelling mistakes in sim/common/sim-events.c error messages.
Mike Stump [Tue, 9 Jun 2015 18:25:28 +0000 (14:25 -0400)]
Fix spelling mistakes in sim/common/sim-events.c error messages.

sim/common/ChangeLog:

        * sim-events.c (sim_events_schedule_after_signal): Fix spelling
        mistake in call to sim_engine_abort.
        (sim_events_schedule_after_signal): Likewise.

9 years agoDon't assume File-I/O mode bits match the host's format
Gary Benson [Tue, 9 Jun 2015 09:00:15 +0000 (10:00 +0100)]
Don't assume File-I/O mode bits match the host's format

inf_child_fileio_open and its gdbserver equivalent both assume that
the mode_t bits defined in gdb/fileio.h are the same as those used
by the open system call, but there is no mechanism to ensure this is
the case.  This commit adds a conversion function to handle systems
where the File-I/O definitions do not align with the host's.

gdb/ChangeLog:

* common/fileio.h (fileio_to_host_mode): New declaration.
* common/fileio.c (fileio_to_host_mode): New Function.
* inf-child.c (inf_child_fileio_open): Process mode argument
with fileio_to_host_mode.

gdb/gdbserver/ChangeLog:

* hostio.c (handle_open): Process mode argument with
fileio_to_host_mode.

9 years agoFix preprocessor conditional
Gary Benson [Tue, 9 Jun 2015 09:02:25 +0000 (10:02 +0100)]
Fix preprocessor conditional

This commit fixes a typo in common/fileio.c where S_IWGRP was
misspelled as S_IWRGRP in a preprocessor conditional, causing
Host-I/O "vFile:fstat:" and File-I/O "Fstat" and "Ffstat"
responses to always indicate files were not group-writable
regardless of their actual status.

9 years agoAutomatic date update in version.in
GDB Administrator [Tue, 9 Jun 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in

9 years agoUpdate French Translations for LD and GOLD.
Nick Clifton [Mon, 8 Jun 2015 14:04:17 +0000 (15:04 +0100)]
Update French Translations for LD and GOLD.

ld * po/fr.po: Updated French Translation.
gold * po/fr.po: New French Translation.

9 years agoFix RX GAS handling of integer bignums.
Nick Clifton [Mon, 8 Jun 2015 10:32:38 +0000 (11:32 +0100)]
Fix RX GAS handling of integer bignums.

* config/tc-rx.c (rx_op): Correct handling of integer bignums.

9 years agoAutomatic date update in version.in
GDB Administrator [Mon, 8 Jun 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in

9 years agoFix incorrect handling of STT_COMMON symbols in shared libraries.
Cary Coutant [Sun, 7 Jun 2015 21:03:09 +0000 (14:03 -0700)]
Fix incorrect handling of STT_COMMON symbols in shared libraries.

The gABI allows STT_COMMON symbols to appear in executables and shared
objects, so that the dynamic loader can resolve commons across modules.
When reading a shared object, however, an STT_COMMON symbol should be
treated as a regular definition at link time.

In a relocatable object, the gABI requires that any STT_COMMON symbols
must also be defined in the special SHN_COMMON section (which we extend
to include target-specific small and large common sections). Thus,
there is no need for gold to treat STT_COMMON symbols as common unless
the st_shndx field is also set to a common section.

gold/
PR gold/18288
* resolve.cc (symbol_to_bits): Remove type parameter; adjust all
callers. Don't use STT_COMMON to check for common symbols.
(Symbol_table::resolve): Warn if relocatable object has STT_COMMON
symbol that's not in a common section.
* symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
common symbols.

9 years agoAutomatic date update in version.in
GDB Administrator [Sun, 7 Jun 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in

9 years agoAutomatic date update in version.in
GDB Administrator [Sat, 6 Jun 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in

9 years agoImproves the detection of partial .debug_line sections.
Nick Clifton [Fri, 5 Jun 2015 15:58:35 +0000 (16:58 +0100)]
Improves the detection of partial .debug_line sections.

* dwarf.c (read_debug_line_header): Use reloc_at to detect
incomplete .debug_line headers

9 years agoFixes a typo in the list of targets that should not run the compressed1d test.
Nick Clifton [Fri, 5 Jun 2015 15:48:01 +0000 (16:48 +0100)]
Fixes a typo in the list of targets that should not run the compressed1d test.

* ld-elf/compressed1d.d: Fix typo: iq200 -> iq2000.

9 years agoFixes computation of MSP430 SYM_DIFF relocs in very small sections.
Nick Clifton [Fri, 5 Jun 2015 15:40:37 +0000 (16:40 +0100)]
Fixes computation of MSP430 SYM_DIFF relocs in very small sections.

* elf32-msp430.c (rl78_sym_diff_handler): New function.
(msp430_howto_table): Use the new function for the SYM_DIFF reloc.
(msp430x_howto_table): Likewise.

9 years agoMove vgdb special case into remote_filesystem_is_local
Gary Benson [Fri, 5 Jun 2015 15:08:05 +0000 (16:08 +0100)]
Move vgdb special case into remote_filesystem_is_local

Valgrind GDB (vgdb) presents itself as a remote target but works on
the local filesystem.  gdb_bfd_open contained a special case to make
vgdb work with "target:" sysroots, but the implementation meant that
GDB would fall back to the local filesystem if *any* to_fileio_open
method failed with ENOSYS for *any* reason.  This commit moves the
vgdb special case to remote_filesystem_is_local to allow the fallback
to be restricted only to the specific case that remote file transfer
is unsupported.  This commit also adds a warning which is displayed
the first time the fallback is used.

gdb/ChangeLog:

* gdb_bfd.c (gdb_bfd_open): Move vgdb special case to...
* remote.c (remote_filesystem_is_local): ...here.

9 years agoppc476 linker workaround shared lib fixes
Alan Modra [Fri, 5 Jun 2015 09:05:40 +0000 (18:35 +0930)]
ppc476 linker workaround shared lib fixes

When building a shared lib from non-PIC objects, we'll get dynamic
text relocations.  These need to move with any insns we move.
Otherwise the dynamic reloc will modify the branch, resulting in
crashes and other unpleasant behaviour.

Also, ld -r --ppc476-workaround used with sufficiently aligned PIC
objects needs a fix for emitted REL16 relocs.

bfd/
* elf64-ppc.c (ppc_elf_relocate_section): Move dynamic text
relocs with insns moved by --ppc476-workaround.  Correct
output of REL16 relocs.
ld/testsuite/
* ld-powerpc/ppc476-shared.s,
* ld-powerpc/ppc476-shared.lnk,
* ld-powerpc/ppc476-shared.d,
* ld-powerpc/ppc476-shared2.d: New tests.
* ld-powerpc/powerpc.exp: Run them.

9 years agoAdd diststuff target to Makefile.
Cary Coutant [Fri, 5 Jun 2015 05:58:39 +0000 (22:58 -0700)]
Add diststuff target to Makefile.

gold/
PR gold/18200
* Makefile.am (diststuff): Add target.
* Makefile.in: Regenerate.

9 years agoChange default to discard temporary local symbols in merge sections.
Cary Coutant [Fri, 5 Jun 2015 03:58:08 +0000 (20:58 -0700)]
Change default to discard temporary local symbols in merge sections.

Add --discard-none to keep all local symbols.

gold/
PR gold/17498
* object.cc (Sized_relobj_file::do_count_local_symbols): Discard
temporary locals in merge sections.
* options.cc (General_options::parse_discard_all): New method.
(General_options::parse_discard_locals): New method.
(General_options::parse_discard_none): New method.
(General_options::General_options): Initialize discard_locals_.
* options.h (--discard-all): Convert to special option.
(--discard-locals): Likewise.
(--discard-none): New option.
(General_options::discard_all): New method.
(General_options::discard_locals): New method.
(General_options::discard_sec_merge): New method.
(General_options::Discard_locals): New enum.
(General_options::discard_locals_): New data member.

9 years agoAdd hwsync extended mnemonic.
Peter Bergner [Fri, 5 Jun 2015 01:27:03 +0000 (20:27 -0500)]
Add hwsync extended mnemonic.

This commit adds a new extended menmonic for "sync 0" (same as "sync").
The ISA documentation doesn't explicitly mention hwsync as an extended
mnemonic (yet), but it does mention "heavyweight sync" and "hwsync" as
the operation that gets performed when the sync's L field is 0.
This is only enabled for POWER4 and later.

opcodes/
* ppc-opc.c: (powerpc_opcodes) <hwsync>: New extended mnemonic.

gas/testsuite/
* gas/ppc/a2.d: Fixup test case due to new extended mnemonic.
* gas/ppc/power4.s <hwsync, lwsync, ptesync, sync>: Add tests.
* gas/ppc/power4.d: Likewise.

9 years agoAutomatic date update in version.in
GDB Administrator [Fri, 5 Jun 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in

9 years agocompile-print.exp: xfail->kfail for '@' GDB array operator
Jan Kratochvil [Thu, 4 Jun 2015 19:35:43 +0000 (21:35 +0200)]
compile-print.exp: xfail->kfail for '@' GDB array operator

Patch implementing '@' GDB array operator in GCC has been rejected:
https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00414.html
and so there is now a GDB tracker to implement it just in GDB:
https://sourceware.org/bugzilla/show_bug.cgi?id=18489

gdb/testsuite/ChangeLog
2015-06-04  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.compile/compile-print.exp (compile print *vararray@3)
(compile print *vararrayp@3): Change xfail to kfail compile/18489.

9 years agoRegenerate gdbarch.c to sync with gdbarch.sh
Yao Qi [Thu, 4 Jun 2015 16:26:29 +0000 (17:26 +0100)]
Regenerate gdbarch.c to sync with gdbarch.sh

When I do something else, I find that gdbarch.c isn't sync'ed with
gdbarch.sh.  This patch just move some statements on
stack_frame_destroyed_p some lines below.

gdb:

2015-06-04  Yao Qi  <yao.qi@linaro.org>

* gdbarch.c: Regenerate it.

9 years agoFixes the check for emulated MSP430 instrucrtions that take no operands.
Nick Clifton [Thu, 4 Jun 2015 15:33:12 +0000 (16:33 +0100)]
Fixes the check for emulated MSP430 instrucrtions that take no operands.

PR 18474
* msp430-dis.c (msp430_nooperands): Fix check for emulated insns.

9 years agoFix compile time warning for tc-h8300.c when using gcc 5+.
Nick Clifton [Thu, 4 Jun 2015 15:20:35 +0000 (16:20 +0100)]
Fix compile time warning for tc-h8300.c when using gcc 5+.

* config/tc-h8300.c (md_section_align): Fix compile time warning
about left shifting a negative value.

9 years ago[AArch64] Add support for ARMv8.1 command line option
Matthew Wahab [Thu, 4 Jun 2015 10:14:07 +0000 (11:14 +0100)]
[AArch64] Add support for ARMv8.1 command line option

9 years ago[ARM] Use frag's thumb_mode information when available
Jiong Wang [Thu, 4 Jun 2015 08:36:35 +0000 (09:36 +0100)]
[ARM] Use frag's thumb_mode information when available

2015-06-04  Renlin Li  <renlin.li@arm.com>

* config/tc-arm.c (arm_init_frag): Use frag's thumb_mode information
when available.

9 years agoFix SIZEOF_HEADERS in gold.
Cary Coutant [Thu, 4 Jun 2015 03:30:11 +0000 (20:30 -0700)]
Fix SIZEOF_HEADERS in gold.

Gold undercounts the number of program headers it's going to add when
initially evaluating the SIZEOF_HEADERS expression. As a result, scripts
that use it end up skipping a page unnecessarily when the starting address
is too low. The undercounting is because it doesn't count the PT_INTERP
segment.

Then, when finalizing symbols, gold overcounts the program headers: all
segments have already been created, but we still count the headers we
expected to add from the script.

This patch fixes both problems.

gold/
* script-sections.cc (Script_sections::Script_sections): Initialize
segments_created_.
(Script_sections::create_note_and_tls_segments): Set flag when
segments are created.
(Script_sections::expected_segment_count): Count PT_INTERP.
(Script_sections::attach_sections_using_phdrs_clause): Set flag when
segments are created.
* script-sections.h (Script_sections::segments_created_): New data
member.

9 years agoFix gold to group sections correctly via linker script.
Cary Coutant [Thu, 4 Jun 2015 02:11:42 +0000 (19:11 -0700)]
Fix gold to group sections correctly via linker script.

In PR 15370, it is noted that gold does not distinguish between
"*(.foo .bar)" and "*(.foo) *(.bar)" in linker scripts. In both
cases, gold groups all .foo sections together, followed by all
.bar sections, whereas in the first case, it should collect all
.foo and .bar sections in the order seen.

If you add sort specs, the Gnu linker has some bizarre corner
cases that I do not try to replicate. In particular,
"*(SORT_BY_NAME(.foo) SORT_BY_NAME(.bar))" does the same thing
as "*(.foo) *(.bar)". But if you apply a sort spec
to just one of several patterns, say, "*(SORT_BY_NAME(.foo) .bar)",
the Gnu linker will collect any .bar section it sees before the
first .foo, then all .foo sections, then all remaining .bar
sections. With this patch, if any of the input patterns have a
sort spec, gold will group them all as it did before; e.g.,
all .foo sections followed by all .bar sections.

2015-06-03  Cary Coutant  <ccoutant@gmail.com>

gold/
PR gold/15370
* script-sections.cc
(Output_section_element_input::set_section_addresses): When there
are several patterns with no sort spec, put all sections in the same
bin.
* testsuite/Makefile.am (script_test_12): New testcase.
(script_test_12i): New testcase.
* testsuite/Makefile.in: Regenerate.
* testsuite/script_test_12.t: New test linker script.
* testsuite/script_test_12i.t: New test linker script.
* testsuite/script_test_12a.c: New test source file.
* testsuite/script_test_12b.c: New test source file.

9 years agoAutomatic date update in version.in
GDB Administrator [Thu, 4 Jun 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in

9 years agocompile: Use also inferior munmap
Jan Kratochvil [Wed, 3 Jun 2015 19:22:56 +0000 (21:22 +0200)]
compile: Use also inferior munmap

Currently inferior memory is allocated by inferior mmap() but it is never
deallocated; despite the injected objfile incl. its symbols is freed.  This was
intentional so that one can do for example:
inferior:
char *str = "foo";
GDB:
(gdb) compile code str = "bar";

I believe later patches will be needed to introduce full control over keeping
vs. discarding the injected module as being discussed in:
compile: objfiles lifetime UI
https://sourceware.org/ml/gdb/2015-04/msg00051.html
Message-ID: <20150429135735.GA16974@host1.jankratochvil.net>
https://sourceware.org/ml/gdb/2015-05/msg00007.html

As decided by Phil it is better not to leak inferior pages as users can
workaround the issue above for example by:
(gdb) compile code str = strdup ("bar");

I have checked that in fact gdb/doc/ (written by Phil) already expects the
injected code will be unmapped so that does not need to be changed:
compile code int ff = 5; p = &ff;
In this example, @code{p} would point to @code{ff} when the
@code{compile} command is executing the source code provided to it.
However, as variables in the (example) program persist with their
assigned values, the variable @code{p} would point to an invalid
location when the command exists.

gdb/ChangeLog
2015-04-28  Jan Kratochvil  <jan.kratochvil@redhat.com>

* arch-utils.c (default_infcall_munmap): New.
* arch-utils.h (default_infcall_munmap): New declaration.
* compile/compile-object-load.c (struct munmap_list, munmap_list_add)
(munmap_list_free, munmap_listp_free_cleanup): New.
(struct setup_sections_data): Add field munmap_list_headp.
(setup_sections): Call munmap_list_add.
(compile_object_load): New variable munmap_list_head, initialize
setup_sections_data.munmap_list_headp, return munmap_list_head.
* compile/compile-object-load.h (struct munmap_list): New declaration.
(struct compile_module): Add field munmap_list_head.
(munmap_list_free): New declaration.
* compile/compile-object-run.c (struct do_module_cleanup): Add field
munmap_list_head.
(do_module_cleanup): Call munmap_list_free.
(compile_object_run): Pass munmap_list_head to do_module_cleanup.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* gdbarch.sh (infcall_munmap): New.
* linux-tdep.c (linux_infcall_munmap): New.
(linux_init_abi): Install it.

gdb/testsuite/ChangeLog
2015-04-28  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.compile/compile.exp (keep jit in memory): Rename to ...
(do not keep jit in memory): ... this.
(expect 5): Change it to ...
(expect no 5): ... this.

9 years ago[ARM] Commit approaved testcases missed in previous commit
Matthew Wahab [Wed, 3 Jun 2015 09:52:34 +0000 (10:52 +0100)]
[ARM] Commit approaved testcases missed in previous commit

2015-06-03  Matthew Wahab  <matthew.wahab@arm.com>

* gas/arm/armv8-a+rdma.d: New.
* gas/arm/armv8-a+rdma.s: New.

9 years ago[AArch64] Revert local changes included in Matthew's commit
Jiong Wang [Wed, 3 Jun 2015 09:06:42 +0000 (10:06 +0100)]
[AArch64] Revert local changes included in Matthew's commit

When commit the following code for Matthew, I wrongly included my local changes. Revert it. Sorry.

commit a5932920ef397c2cbe02efa915686022b78d59a7
Author: Matthew Wahab <matthew.wahab@arm.com>
Date:   Wed Jun 3 10:03:50 2015 +0100

9 years ago[ARM] Support for ARMv8.1 command line option
Matthew Wahab [Wed, 3 Jun 2015 09:03:50 +0000 (10:03 +0100)]
[ARM] Support for ARMv8.1 command line option

2015-06-03  Matthew Wahab  <matthew.wahab@arm.com>

gas/
* config/tc-arm.c (arm_archs): Add "armv8.1-a".
* doc/c-arm.texi (ARM Options, -march): Add "armv8.1-a".
* NEWS: Mention ARMv8.1 support.

include/opcode/
* arm.h (FPU_ARCH_CRYPTO_NEON_VFP_ARMV8_1): New.
(ARM_ARCH_V8_1A): New.
(ARM_ARCH_V8_1A_FP): New.
(ARM_ARCH_V8_1A_SIMD): New.
(ARM_ARCH_V8_1A_CRYPTOV1): New.
(ARM_FEATURE_CORE): New.

9 years agoAutomatic date update in version.in
GDB Administrator [Wed, 3 Jun 2015 00:00:09 +0000 (00:00 +0000)]
Automatic date update in version.in