binutils-gdb.git
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

9 years agoFix Sniff_file to get an aligned view.
Cary Coutant [Tue, 2 Jun 2015 21:12:56 +0000 (14:12 -0700)]
Fix Sniff_file to get an aligned view.

gold/
* nacl.h (Sniff_file): Switch parameters to get_view to get an
aligned view.

9 years agoFix =thread-exited not showing up when detaching (PR 15564)
Simon Marchi [Tue, 2 Jun 2015 19:32:40 +0000 (15:32 -0400)]
Fix =thread-exited not showing up when detaching (PR 15564)

I sent a patch in 2013 for this (incorrectly named =thread-created):

  https://cygwin.com/ml/gdb-patches/2013-06/msg00129.html

Tom Tromey was ok with the change, but suggested to add a test as well.
Then I forgot about this patch until today. So here it is again, with the
corresponding test.

The problem is that the =thread-exited event does not appear when detaching
from a local process. It does appear with remote though. It's not a really
big deal, but I'd like it to be consistent.

Tested with local and remote Linux on my Ubuntu 14.04.

gdb/ChangeLog:

PR gdb/15564
* inferior.c (detach_inferior): Call exit_inferior_1 with silent = 0.

gdb/testsuite/ChangeLog:

PR gdb/15564
* gdb.mi/mi-detach.exp: New file.

9 years agoPR 17819: Fix --build-id=tree when using --compress-debug-sections.
Cary Coutant [Tue, 2 Jun 2015 16:45:24 +0000 (09:45 -0700)]
PR 17819: Fix --build-id=tree when using --compress-debug-sections.

When --build-id=tree is selected, gold would schedule a set of
tasks to run to compute md5 hashes in parallel on chunks of the
file. The scheduling was done before the
Write_after_input_sections_task ran, so if we are compressing
debug sections, the output file will change size and be remapped
to a new address, sometimes causing the build id computation to
crash, but even when it doesn't crash, it wouldn't include the
debug information in the hash computation.

This patch delays the scheduling of the md5 tasks until after
Write_after_input_sections_task.

gold/
        PR gold/17819
        * gold.cc (queue_final_tasks): When --build-id=tree, queue a
        separate task to schedule the build id computation.
        * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
        add Output_file and offset.
        (Hash_task::run): Get and release the input views.
        (Hash_task::is_runnable): Always return NULL (always runnable).
        (Layout::queue_build_id_tasks): Remove.
        (Layout::write_build_id): Add array_of_hashes and size_of_hashes
        parameters; use them instead of class members.
        (Build_id_task_runner::run): New function.
        (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
        to write_build_id.
        * layout.h (Layout::queue_build_id_tasks): Remove.
        (Layout::write_build_id): Add array_of_hashes and size_of_hashes
        parameters.
        (Layout::array_of_hashes_): Remove.
        (Layout::size_of_array_of_hashes_): Remove.
        (Layout::input_view_): Remove.
        (Build_id_task_runner): New class.
        (Close_task_runner::Close_task_runner): Add array_of_hashes and
        size_of_hashes parameters.
        (Close_task_runner::array_of_hashes_): New data member.
        (Close_task_runner::size_of_hashes_): New data member.
        * testsuite/Makefile.am
        (flagstest_compress_debug_sections_and_build_id_tree): New test.
        * testsuite/Makefile.in: Regenerate.

9 years ago[AArch64] Fix typo in testcase
Jiong Wang [Tue, 2 Jun 2015 12:59:17 +0000 (13:59 +0100)]
[AArch64] Fix typo in testcase

ld/testsuite/
  * ld-aarch64/emit-relocs-313.s: Use gotpage_lo15.

9 years ago[ARM] Support for ARMv8.1 Adv.SIMD extension
Matthew Wahab [Tue, 2 Jun 2015 11:35:21 +0000 (12:35 +0100)]
[ARM] Support for ARMv8.1 Adv.SIMD extension

9 years ago[ARM] Add support for ARMv8.1 PAN extension
Matthew Wahab [Tue, 2 Jun 2015 11:30:38 +0000 (12:30 +0100)]
[ARM] Add support for ARMv8.1 PAN extension

9 years ago[ARM] Rework CPU feature selection in the disassembler
Matthew Wahab [Tue, 2 Jun 2015 11:24:24 +0000 (12:24 +0100)]
[ARM] Rework CPU feature selection in the disassembler

include/opcode/
* arm.h (ARM_FEATURE_ALL): New.

opcodes/
* arm-dis.c (select_arm_features): Rework to avoid used of
redefined macros.

9 years ago[AArch64] Support for ARMv8.1a Adv.SIMD instructions
Matthew Wahab [Tue, 2 Jun 2015 11:20:00 +0000 (12:20 +0100)]
[AArch64] Support for ARMv8.1a Adv.SIMD instructions

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

gas/
  * config/tc-aarch64.c (aarch64_features): Add "rdma".
  * doc/c-aarch64.texi (AArch64 Extensions): Add "rdma".

gas/testsuite/
  * rdma-directive.d: New.
  * rdma.d: New.
  * rdma.s: New.

include/opcode/
  * aarch64.h (AARCH64_FEATURE_RDMA): New.

opcode/
  * aarch64-tbl.h (aarch64_feature_rdma): New.
  (RDMA): New.
  (aarch64_opcode_table): Add "sqrmlah" and "sqrdmlsh" instructions.
  * aarch64-asm-2.c: Regenerate.
  * aarch64-dis-2.c: Regenerate.
  * aarch64-opc-2.c: Regenerate.

9 years ago[AArch64] Support for ARMv8.1a Limited Ordering Regions extension
Matthew Wahab [Tue, 2 Jun 2015 10:29:15 +0000 (11:29 +0100)]
[AArch64] Support for ARMv8.1a Limited Ordering Regions extension

2015-06-02  Matthew Wahab  <matthew.wahab@arm.com>
include/
  * aarch64.h (AARCH64_FEATURE_LOR): New.

opcodes/
  * aarch64-tbl.h (aarch64_feature_lor): New.
  (LOR): New.
  (aarch64_opdocde_table): Add "ldlar", "ldlarb", "ldlarh", "stllr",
  "stllrb", "stllrh".
  * aarch64-asm-2.c: Regenerate.
  * aarch64-dis-2.c: Regenerate.
  * aarch64-opc-2.c: Regenerate.

gas/
  * config/tc-aarch64.c (aarch64_features): Add "lor".
  * doc/c-aarch64.c (Aarch64 Extensions): Add "lor" to list of
  architecture extensions.

gas/testsuite/
  * lor-directive.d: New.
  * lor.d: New.
  * lor.s: New.

9 years agoInclude linux-nat.h in i386-linux-nat.c
Yao Qi [Tue, 2 Jun 2015 09:28:03 +0000 (10:28 +0100)]
Include linux-nat.h in i386-linux-nat.c

This commit fixes a build failure on i386-linux.

gdb:

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

* i386-linux-nat.c: Include linux-nat.h.

9 years agoUse a std::vector instead of a std::map to hold Input_merge_map.
Rafael Ávila de Espíndola [Tue, 2 Jun 2015 02:47:20 +0000 (22:47 -0400)]
Use a std::vector instead of a std::map to hold Input_merge_map.

A std::map is hardly the best data structure for a small map from small
integers.

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

9 years ago[AArch64][GAS] Add support for PAN architecture extension
Matthew Wahab [Mon, 1 Jun 2015 15:05:58 +0000 (16:05 +0100)]
[AArch64][GAS] Add support for PAN architecture extension

2015-06-01  Matthew Wahab  <matthew.wahab@arm.com>
gas/
* config/tc-aarch64.c (parse_sys_reg): New parameter.  Check
target support.  Fix whitespace.
(parse_operands): Update for parse_sys_reg changes.
(aarch64_features): Add "pan".
* doc/c-aarch64.texi (Aarch64 Extensions): Add "pan".

gas/testsuite/
* pan-directive.d: New.
* pan.d: New.
* pan.s: New

9 years ago[AArch64][libopcode] Add support for PAN architecture extension
Matthew Wahab [Mon, 1 Jun 2015 15:00:28 +0000 (16:00 +0100)]
[AArch64][libopcode] Add support for PAN architecture extension

The ARMv8.1 architecture introduced the Privileged Access Never extension. This
adds a processor state field PSTATE.PAN which can be accessed using the MRS/MSR
instructions.

This patch adds support for the PAN architecture feature and processor state
field to libopcode.

include/opcode
2015-06-01  Matthew Wahab  <matthew.wahab@arm.com>

* aarch64.h (AARCH64_FEATURE_PAN): New.
(aarch64_sys_reg_supported_p): Declare.
(aarch64_pstatefield_supported_p): Declare.

opcodes/
2015-06-01  Matthew Wahab  <matthew.wahab@arm.com>
* aarch64-opc.c (F_ARCHEXT): New.
(aarch64_sys_regs): Add "pan".
(aarch64_sys_reg_supported_p): New.
(aarch64_pstatefields): Add "pan".
(aarch64_pstatefield_supported_p): New.

9 years ago[AArch64] BFD support BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14
Jiong Wang [Mon, 1 Jun 2015 14:45:25 +0000 (15:45 +0100)]
[AArch64] BFD support BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14

This patch add BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14 relocation
supoprt in bfd linker.

2015-06-01  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * elfnn-aarch64.c (aarch64_reloc_got_type): Support
  BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
  (elfNN_aarch64_final_link_relocate): Ditto.
  (elfNN_aarch64_gc_swap_hook): Ditto.
  (elfNN_aarch64_check_relocs): Ditto.
  * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.

ld/testsuite/
  * ld-aarch64/emit-relocs-28.s: New test file.
  * ld-aarch64/emit-relocs-28.d: Ditto.
  * ld-aarch64/aarch64-elf.exp: Run new test.

9 years ago[AArch64] GAS support BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14
Jiong Wang [Mon, 1 Jun 2015 14:41:54 +0000 (15:41 +0100)]
[AArch64] GAS support BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14

This patch add BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14 support in Gas.

The relocation modifier
===
  :gotpage_lo14:symbol

2015-06-01 Jiong.Wang <jiong.wang@arm.com>

bfd/
  * reloc.c (BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14): New entry.
  * bfd-in2.h: Regenerate.
  * libbfd.h: Regenerate.
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
  BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.

gas/
  * config/tc-aarch64.c (reloc_table): New relocation modifiers.
  (md_apply_fix): Support BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
  (aarch64_force_relocation): Ditto.

gas/testsuite/
  * gas/aarch64/ilp32-basic.s: New testcase.
  * gas/aarch64/ilp32-basic.d: Ditto.

9 years agoPR symtab/18392
Jan Kratochvil [Mon, 1 Jun 2015 12:02:34 +0000 (14:02 +0200)]
PR symtab/18392

Initially there is some chain (let's say the longest one
but that doe snot matter).  Consequently its elements from the middle are
being removed and there remains only some few unambiguous top and bottom ones.

The original idea why the comparison should be sharp ("<") was that if there
are multiple chains like (0xaddr show jmp instruction address):
        main(0x100) -> a(0x200) -> d(0x400)
        main(0x100) -> a(0x200) -> c(0x300) -> d(0x400)
then - such situation cannot exist - if two jmp instructions in "a" have the
same address they must also jump to the same address (*).

(*) jump to a computed address would be never considered for the DWARF
    tail-call records.

So there could be:
        main(0x100) -> a(0x200) -> d(0x400)
        main(0x100) -> a(0x270) -> c(0x300) -> d(0x400)
But then "a" frame itself is ambiguous and it must not be displayed.

I did not realize that there can be self-tail-call:
        main(0x100) -> a(0x200) -> d(0x400)
        main(0x100) -> a(0x280) -> a(0x200) -> d(0x400)
which intersects to:
        main(0x100) -> <???>? -> a(0x200) -> d(0x400)
And so if the first chain was chosen the
        main(0x100) -> a(0x200) -> d(0x400)
then the final intersection has callers+callees==length.

> for example, if CALLERS is 3 and
> CALLEES is 2, what does the chain look like?

main(0x100) -> x(0x150) -> y(0x200) -> <???>? -> a(0x200) -> d(0x400)

And if LENGTH is 7 then:
        call_site[0] = main(0x100)
        call_site[1] = x(0x150)
        call_site[2] = y(0x200)
        call_site[3] = garbage
        call_site[4] = garbage
        call_site[5] = a(0x200)
        call_site[6] = d(0x400)

gdb/ChangeLog
2015-06-01  Andreas Schwab  <schwab@linux-m68k.org>
    Jan Kratochvil  <jan.kratochvil@redhat.com>

PR symtab/18392
* dwarf2-frame-tailcall.c (pretended_chain_levels): Correct
assertion.
* dwarf2loc.c (chain_candidate): Likewise.

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

PR symtab/18392
* gdb.arch/amd64-tailcall-self.S: New file.
* gdb.arch/amd64-tailcall-self.c: New file.
* gdb.arch/amd64-tailcall-self.exp: New file.

9 years agoFetch and store VFP registers by PTRACE_{G,S}ETREGSET
Yao Qi [Mon, 1 Jun 2015 11:13:02 +0000 (12:13 +0100)]
Fetch and store VFP registers by PTRACE_{G,S}ETREGSET

This patch is to use PTRACE_{G,S}ETREGSET to fetch and store VFP
registers if kernel supports.

gdb:

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

* arm-linux-nat.c (fetch_vfp_regs): Use PTRACE_GETREGSET.
(store_vfp_regs): Use PTRACE_SETREGSET.

9 years agoFetch and store FP registers by PTRACE_{G,S}ETREGSET
Yao Qi [Mon, 1 Jun 2015 11:13:02 +0000 (12:13 +0100)]
Fetch and store FP registers by PTRACE_{G,S}ETREGSET

If kernel supports PTRACE_GETREGSET, GDB uses PTRACE_{G,S}ETREGSET
to fetch and store FP registers.

gdb:

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

* arm-linux-nat.c (fetch_fpregister): Use PTRACE_GETREGSET.
(fetch_fpregs): Likewise.
* arm-linux-nat.c (store_fpregister): Use PTRACE_SETREGSET.
(store_fpregs): Likewise.

9 years agoFetch and store GP registers by PTRACE_{G,S}ETREGSET
Yao Qi [Mon, 1 Jun 2015 11:13:02 +0000 (12:13 +0100)]
Fetch and store GP registers by PTRACE_{G,S}ETREGSET

If kernel supports PTRACE_GETREGSET, GDB uses PTRACE_{G,S}ETREGSET
to fetch and store GP registers.

gdb:

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

* arm-linux-nat.c (fetch_register): Use PTRACE_GETREGSET.
(fetch_regs): Likewise.
(store_regs): Use PTRACE_SETREGSET.
(store_register): Likewise.

9 years agoCheck whether kernel supports PTRACE_GETREGSET
Yao Qi [Mon, 1 Jun 2015 11:13:02 +0000 (12:13 +0100)]
Check whether kernel supports PTRACE_GETREGSET

gdb:

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

* arm-linux-nat.c (arm_linux_read_description): Check whether
kernel supports PTRACE_GETREGSET.

9 years agoMove have_ptrace_getregset to linux-nat.c
Yao Qi [Mon, 1 Jun 2015 11:13:02 +0000 (12:13 +0100)]
Move have_ptrace_getregset to linux-nat.c

I'll let arm-linux-nat.c to use PTRACE_GETREGSET if kernel supports,
so this patch is to move have_ptrace_getregset from x86-linux-nat.c
to linux-nat.c.

gdb:

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

* x86-linux-nat.c (have_ptrace_getregset): Move it to ...
* linux-nat.c: ... here.
* x86-linux-nat.h (have_ptrace_getregset): Move the declaration
to ...
* linux-nat.h: ... here.

9 years agoMove PTRACE_GETREGSET and PTRACE_SETREGSET to nat/linux-ptrace.h
Yao Qi [Mon, 1 Jun 2015 11:13:02 +0000 (12:13 +0100)]
Move PTRACE_GETREGSET and PTRACE_SETREGSET to nat/linux-ptrace.h

Macros PTRACE_GETREGSET and PTRACE_SETREGSET are defined locally in
some places in GDB and GDBserver.  This patch is to move them to
nat/linux-ptrace.h to avoid duplication.

gdb:

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

* amd64-linux-nat.c: Include "nat/linux-ptrace.h".
* i386-linux-nat.c: Likewise.
* nat/linux-ptrace.h (PTRACE_GETREGSET, PTRACE_SETREGSET): Define.
* s390-linux-nat.c: Include "nat/linux-ptrace.h".
(PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
* x86-linux-nat.c: Include "nat/linux-ptrace.h".
* x86-linux-nat.h (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.

gdb/gdbserver:

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

* linux-s390-low.c (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
* linux-x86-low.c: Likewise.

9 years agox86/Intel: fix i386_optab[] for vcvt{,u}si2s{d,s}
Jan Beulich [Mon, 1 Jun 2015 09:40:28 +0000 (11:40 +0200)]
x86/Intel: fix i386_optab[] for vcvt{,u}si2s{d,s}

opcodes/
2015-06-01  Jan Beulich  <jbeulich@suse.com>

* i386-tbl.h: Regenerate.

9 years ago[AArch64] BFD_RELOC_AARCH64_TLSLE_ADD_LO12 should enable overflow check
Jiong Wang [Mon, 1 Jun 2015 09:31:38 +0000 (10:31 +0100)]
[AArch64] BFD_RELOC_AARCH64_TLSLE_ADD_LO12 should enable overflow check

BFD_RELOC_AARCH64_TLSLE_ADD_LO12 is used to generate simplest
one-instruction addressing for TLS LE model when tls size is smaller
4K. Linker need to make sure there is no TLS offset overflow.

2015-06-01  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): Set overflow type to
  complain_overflow_unsigned for BFD_RELOC_AARCH64_TLSLE_ADD_LO12.
  * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Don't use
  PGOFF for BFD_RELOC_AARCH64_TLSLE_ADD_LO12, that will mask off all
  potential high overflowed bits.

ld/testsuite/
  * ld-aarch64/tprel_add_lo12_overflow.s: New testcase.
  * ld-aarch64/tprel_add_lo12_overflow.d: Nex expectation file.
  * ld-aarch64/aarch64-elf.exp: Run new testcase.

9 years ago[AArch64] BFD Support BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15
Jiong Wang [Mon, 1 Jun 2015 09:26:00 +0000 (10:26 +0100)]
[AArch64] BFD Support BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15

2015-06-01  Jiong Wang  <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (aarch64_reloc_got_type): Support
BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.
(elfNN_aarch64_final_link_relocate): Ditto.
(elfNN_aarch64_gc_swap_hook): Ditto.
(elfNN_aarch64_check_relocs): Ditto.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.

ld/testsuite/
* ld-aarch64/emit-relocs-313.s: New test file.
* ld-aarch64/emit-relocs-313.d: Ditto.
* ld-aarch64/aarch64-elf.exp: Run new test.

9 years ago[AArch64] GAS Support BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15
Jiong Wang [Mon, 1 Jun 2015 09:22:15 +0000 (10:22 +0100)]
[AArch64] GAS Support BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15

2015-06-01 Jiong.Wang <jiong.wang@arm.com>

bfd/
  * reloc.c (BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15): New entry.
  * bfd-in2.h: Regenerate.
  * libbfd.h: Regenerate.
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
  BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.

gas/
  * config/tc-aarch64.c (reloc_table): New relocation modifiers.
  (md_apply_fix): Support BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.
  (aarch64_force_relocation): Ditto.

gas/testsuite/
  * gas/aarch64/reloc-insn.s: New testcase.
  * gas/aarch64/reloc-insn.d: Ditto.

9 years agox86/Intel: disassemble vcvt{,u}si2s{d,s} with correct operand order
Jan Beulich [Mon, 1 Jun 2015 07:51:28 +0000 (09:51 +0200)]
x86/Intel: disassemble vcvt{,u}si2s{d,s} with correct operand order

As pointed out before, the documentation mandates the rounding mode to
follow the GPR, so disassembler should produce output accordingly.

gas/testsuite/
2015-06-01  Jan Beulich  <jbeulich@suse.com>

* gas/i386/avx512f.s: Adjust operand order for Intel syntax
vcvt{,u}si2ss.
* gas/i386/x86-64-avx512f.s: Adjust operand order for Intel
syntax vcvt{,u}si2s{d,s}.

opcodes/
2015-06-01  Jan Beulich  <jbeulich@suse.com>

* i386-dis.c (print_insn): Swap rounding mode specifier and
general purpose register in Intel mode.

9 years agox86/Intel: accept mandated operand order for vcvt{,u}si2s{d,s}
Jan Beulich [Mon, 1 Jun 2015 07:50:00 +0000 (09:50 +0200)]
x86/Intel: accept mandated operand order for vcvt{,u}si2s{d,s}

As pointed out before, the documentation mandates the rounding mode to
follow the GPR, so gas should accept such input. As the brojen code got
released already we sadly will need to continue to also accept the
badly ordered operands.

gas/testsuite/
2015-06-01  Jan Beulich  <jbeulich@suse.com>

* gas/i386/avx512f-intel.d: Adjust expectations on operand order.
* gas/i386/evex-lig256-intel.d: Likewise.
* gas/i386/evex-lig512-intel.d: Likewise.
* gas/i386/x86-64-avx512f-intel.d: Likewise.
* gas/i386/x86-64-evex-lig256-intel.d: Likewise.
* gas/i386/x86-64-evex-lig512-intel.d: Likewise.

opcodes/
2015-06-01  Jan Beulich  <jbeulich@suse.com>

* i386-opc.tbl: New IntelSyntax entries for vcvt{,u}si2s{d,s}.
* i386-tbl.h: Regenerate.

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

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

9 years agoUnbreak DJGPP build of GDB.
Eli Zaretskii [Sat, 30 May 2015 10:05:53 +0000 (13:05 +0300)]
Unbreak DJGPP build of GDB.

gdb/
* go32-nat.c (go32_xfer_memory): Fix the return value to be
compatible to what read_child and write_child return.  This
unbreaks that DJGPP build of GDB which was broken since v7.7.

9 years agoAutomatic date update in version.in
GDB Administrator [Sat, 30 May 2015 00:00:12 +0000 (00:00 +0000)]
Automatic date update in version.in

9 years agoAdd myself to the Write After Approval list.
Martin Galvan [Fri, 29 May 2015 23:44:22 +0000 (20:44 -0300)]
Add myself to the Write After Approval list.

9 years agoPR gdb/18464: Do not crash on unrecognized GNU .note.ABI-tag values
Roland McGrath [Fri, 29 May 2015 16:24:36 +0000 (09:24 -0700)]
PR gdb/18464: Do not crash on unrecognized GNU .note.ABI-tag values

Diagnosis of unexpected input (in this case, in an executable file)
should not crash as if it were a bug in GDB.

gdb/
PR gdb/18464
* osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Use warning
rather than internal_error for an unrecognized value.

9 years agoRecognize GNU_ABI_TAG_SYLLABLE and GNU_ABI_TAG_NACL.
Roland McGrath [Fri, 29 May 2015 16:13:53 +0000 (09:13 -0700)]
Recognize GNU_ABI_TAG_SYLLABLE and GNU_ABI_TAG_NACL.

binutils/
* readelf.c (print_gnu_note: NT_GNU_ABI_TAG): Recognize
GNU_ABI_TAG_SYLLABLE and GNU_ABI_TAG_NACL.

include/elf/
* common.h (GNU_ABI_TAG_SYLLABLE): New macro.
(GNU_ABI_TAG_NACL): New macro.

9 years agoFix building PE test executables in environments where $CFLAGS is needed.
Stephen Kitt [Fri, 29 May 2015 10:51:41 +0000 (11:51 +0100)]
Fix building PE test executables in environments where $CFLAGS is needed.

* ld-pe/pe-run2.exp (test_direct2_link_dll): Add $CFLAGS to the
compiler command line.

9 years agoxtensa: fix access to the last pseudo register
Max Filippov [Sun, 17 May 2015 22:39:40 +0000 (01:39 +0300)]
xtensa: fix access to the last pseudo register

Currently access to the last pseudo register is aliased to a1. This is
done by little snippets in the beginning of xtensa_pseudo_register_read
and xtensa_pseudo_register_write that used to do such aliasing for FP
register since bdb4c075a29dd086f0868b394b488b1c94666be6, but then
FP_ALIAS was expanded into gdbarch_num_regs (current_gdbarch) +
gdbarch_num_pseudo_regs (current_gdbarch) (one register past the last
pseudo register) in 304fe2552d6e0821e8fdb7575f8e7ba6607a076d, which
then was changed to the last pseudo register in
94a0e877111421d300d26b858bd3a0a27078d1e8.

Drop these snippets.

2015-05-29  Max Filippov  <jcmvbkbc@gmail.com>
gdb/
* xtensa-tdep.c (xtensa_pseudo_register_read)
(xtensa_pseudo_register_write): Don't alias last pseudo register
to a1.

9 years agoFixes a couple of bugs reported in dlltool.
Stephen Kitt [Fri, 29 May 2015 10:03:03 +0000 (11:03 +0100)]
Fixes a couple of bugs reported in dlltool.

* dlltool.c (make_one_lib_file): Clear .idata$6 before use.
(main): Fail if the output file specified by the -z option cannot
be opened.

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

9 years agoCompact EH Support
Catherine Moore [Thu, 28 May 2015 21:50:36 +0000 (14:50 -0700)]
Compact EH Support

The specification for the Compact EH format is available at:
https://github.com/MentorEmbedded/cxx-abi/blob/master/MIPSCompactEH.pdf

2015-05-28  Catherine Moore  <clm@codesourcery.com>
    Bernd Schmidt <bernds@codesourcery.com>
    Paul Brook <paul@codesourcery.com>

bfd/
* bfd-in2.h: Regenerated.
* elf-bfd.h (DWARF2_EH_HDR, COMPACT_EH_HDR): Define.
(COMPACT_EH_CANT_UNWIND_OPCODE): Define.
(dwarf_eh_frame_hdr_info): Move dwarf-specific fields from
eh_frame_hdr_info.
(compact_eh_frame_hdr_info): Declare.
(eh_frame_hdr_info):  Redeclare with union for dwarf-specific
fields and compact-eh fields.
(elf_backend_data): Add cant_unwind_opcode and compact_eh_encoding.
(bfd_elf_section_data): Add eh_frame_entry_field.
(elf_section_eh_frame_entry): Define.
(bfd_elf_parse_eh_frame_entries): Declare.
(_bfd_elf_parse_eh_frame_entry): Declare.
(_bfd_elf_end_eh_frame_parsing): Declare.
(_bfd_elf_write_section_eh_frame_entry): Declare.
(_bfd_elf_eh_frame_entry_present): Declare.
(_bfd_elf_section_for_symbol): Declare.
* elf-eh-frame.c (bfd_elf_discard_eh_frame_entry): New function.
(bfd_elf_record_eh_frame_entry): New function.
(_bfd_elf_parse_eh_frame_entry): New function.
(_bfd_elf_parse_eh_frame): Update hdr_info field references.
(cmp_eh_frame_hdr): New function.
(add_eh_frame_hdr_terminator): New function.
(_bfd_elf_end_eh_frame_parsing): New function.
(find_merged_cie): Update hdr_info field references.
(_bfd_elf_discard_section_eh_frame): Likewise.
(_bfd_elf_discard_section_eh_frame_hdr): Add Compact EH support.
(_bfd_elf_eh_frame_entry_present): New function.
(_bfd_elf_maybe_strip_eh_frame_hdr): Add Compact EH support.
(_bfd_elf_write_section_eh_frame_entry): New function.
(_bfd_elf_write_section_eh_frame): Update hdr_info field references.
(_bfd_elf_fixup_eh_frame_hdr): New function.
(write_compact_eh_frame_hdr): New function.
(write_dwarf_eh_frame_hdr): New function.
(_bfd_elf_write_section_eh_frame_hdr): Add Compact EH support.
* elflink.c (_bfd_elf_section_for_symbol): New function.
(elf_section_ignore_discarded_relocs): Add Compact EH support.
(elf_link_input_bfd): Likewise.
(bfd_elf_final_link): Likewise.
(_bfd_elf_gc_mark): Likewise.
(bfd_elf_parse_eh_frame_entries): New function.
(bfd_elf_gc_sections): Add Compact EH support.
(bfd_elf_discard_info): Likewise.
* elfxx-mips.c: Include dwarf2.h.
(_bfd_mips_elf_compact_eh_encoding): New function.
(_bfd_mips_elf_cant_unwind_opcode): New function.
* elfxx-mips.h (_bfd_mips_elf_compact_eh_encoding): Declare.
(_bfd_mips_elf_cant_unwind_opcode): Declare.
(elf_backend_compact_eh_encoding): Define.
(elf_backend_cant_unwind_opcode): Define.
* elfxx-target.h (elf_backend_compact_eh_encoding): Provide default.
(elf_backend_cant_unwind_opcode): Provide default.
(elf_backend_data elfNN_bed): Add elf_backend_compact_eh_encoding and
elf_backend_cant_unwind_opcode.
* section.c (SEC_INFO_TYPE_EH_FRAME_ENTRY): Add definition.

gas/
* config/tc-alpha.c (all_cfi_sections): Declare.
(s_alpha_ent): Initialize all_cfi_sections.
(alpha_elf_md_end): Invoke cfi_set_sections.
* config/tc-mips.c (md_apply_fix):  Handle BFD_RELOC_NONE.
(s_ehword): Use BFD_RELOC_32_PCREL.
(mips_fix_adjustable): Handle BFD_RELOC_32_PCREL.
(mips_cfi_reloc_for_encoding): New function.
* tc-mips.h (DWARF2_FDE_RELOC_SIZE): Redefine.
(DWARF2_FDE_RELOC_ENCODING): Define.
(tc_cfi_reloc_for_encoding): Define.
(mips_cfi_reloc_for_encoding): Define.
(tc_compact_eh_opcode_stop): Define.
(tc_compact_eh_opcode_pad): Define.
* doc/as.texinfo: Document Compact EH extensions.
* doc/internals.texi: Likewise.
* dw2gencfi.c (EH_FRAME_LINKONCE): Redefine.
(tc_cfi_reloc_for_encoding): Provide default.
(compact_eh): Declare.
(emit_expr_encoded): New function.
(get_debugseg_name): Add Compact EH support.
(alloc_debugseg_item): Likewise.
(cfi_set_sections): New function.
(dot_cfi_fde_data): New function.
(dot_cfi_personality_id): New function.
(dot_cfi_inline_lsda): New function.
(cfi_pseudo_table): Add cfi_fde_data, cfi_personality_id,
and cfi_inline_lsda.
(dot_cfi_personality): Add Compact EH support.
(dot_cfi_lsda): Likewise.
(dot_cfi_sections): Likewise.
(dot_cfi_startproc): Likewise.
(get_cfi_seg): Likewise.
(output_compact_unwind_data): New function.
(output_cfi_insn): Add Compact EH support.
(output_cie): Likewise.
(output_fde): Likewise.
(cfi_finish): Likewise.
(cfi_emit_eh_header): New function.
(output_eh_header): New function.
* dw2gencfi.h (cfi_set_sections): Declare.
(SUPPORT_COMPACT_EH): Define.
(MULTIPLE_FRAME_SECTIONS): Define.
New enumeration to describe the Compact EH header format.
(fde_entry): Add new fields personality_id, eh_header_type, eh_data_size,
eh_data, eh_loc and sections.
(CFI_EMIT_eh_frame, CFI_EMIT_debug_frame, CFI_EMIT_target,
CFI_EMIT_eh_frame_compact): Define.

2015-05-22  Catherine Moore  <clm@codesourcery.com>
    Bernd Schmidt <bernds@codesourcery.com>

gas/testsuite/
* gas/mips/mips.exp: Run new tests.

* gas/mips/compact-eh-1.s: New file.
* gas/mips/compact-eh-2.s: New file.
* gas/mips/compact-eh-3.s: New file.
* gas/mips/compact-eh-4.s: New file.
* gas/mips/compact-eh-5.s: New file.
* gas/mips/compact-eh-6.s: New file.
* gas/mips/compact-eh-7.s: New file.
* gas/mips/compact-eh-eb-1.d: New file.
* gas/mips/compact-eh-eb-2.d: New file.
* gas/mips/compact-eh-eb-3.d: New file.
* gas/mips/compact-eh-eb-4.d: New file.
* gas/mips/compact-eh-eb-5.d: New file.
* gas/mips/compact-eh-eb-6.d: New file.
* gas/mips/compact-eh-eb-7.d: New file.
* gas/mips/compact-eh-el-1.d: New file.
* gas/mips/compact-eh-el-2.d: New file.
* gas/mips/compact-eh-el-3.d: New file.
* gas/mips/compact-eh-el-4.d: New file.
* gas/mips/compact-eh-el-5.d: New file.
* gas/mips/compact-eh-el-6.d: New file.
* gas/mips/compact-eh-el-7.d: New file.
* gas/mips/compact-eh-err1.l: New file.
* gas/mips/compact-eh-err1.s: New file.
* gas/mips/compact-eh-err2.l: New file.
* gas/mips/compact-eh-err2.s: New file.

2015-05-22  Catherine Moore  <clm@codesourcery.com>

include/
* bfdlink.h: Rename eh_frame_hdr to eh_frame_hdr_type.

2015-05-22  Catherine Moore  <clm@codesourcery.com>
    Paul Brook <paul@codesourcery.com>

ld/
* emultempl/elf32.em (gld${EMULATION_NAME}_after_open):
Add Compact EH support.
* scripttempl/elf.sc: Handle .eh_frame_entry and .gnu_extab
sections.

2015-05-22  Catherine Moore  <clm@codesourcery.com>

ld/testsuite/
* ld-mips-elf/compact-eh.ld: New linker script.
* ld-mips-elf/compact-eh1.d: New.
* ld-mips-elf/compact-eh1.s: New.
* ld-mips-elf/compact-eh1a.s: New.
* ld-mips-elf/compact-eh1b.s: New.
* ld-mips-elf/compact-eh2.d: New.
* ld-mips-elf/compact-eh2.s: New.
* ld-mips-elf/compact-eh3.d: New.
* ld-mips-elf/compact-eh3.s: New.
* ld-mips-elf/compact-eh3a.s: New.
* ld-mips-elf/compact-eh4.d: New.
* ld-mips-elf/compact-eh5.d: New.
* ld-mips-elf/compact-eh6.d: New.
* ld-mips-elf/mips-elf.exp: Run new tests.

9 years agoDisable exec-dependent follow vfork tests for remote
Don Breazeal [Thu, 28 May 2015 20:36:05 +0000 (13:36 -0700)]
Disable exec-dependent follow vfork tests for remote

The native-extended-gdbserver target now supports fork events and
follow fork, but it does not yet support exec events.  Some of the
tests in gdb.base/foll-vfork.exp depend on exec events.  This patch
disables those tests for remote targets.  We can re-enable these
once the exec event support goes in.

gdb/testsuite/

* gdb.base/foll-vfork.exp (main): Disable exec-dependent
tests for remote targets by checking is_target_gdbserver.

9 years agoInitialize last_resume_kind for remote fork child
Don Breazeal [Thu, 28 May 2015 20:12:01 +0000 (13:12 -0700)]
Initialize last_resume_kind for remote fork child

This patch fixes some intermittent test failures in
gdb.base/foll-vfork.exp where a vfork child would be (incorrectly)
resumed when handling the vfork event.  In this case the result
was a subsequent event reported to the client side as a SIGTRAP
delivered to the as-yet-unknown child thread.

The new thread was resumed (incorrectly) in linux-low.c when
resume_stopped_resumed_lwps was called from
linux_wait_for_event_filtered after the vfork event had been
handled in handle_extended_wait.

Gdbserver/linux-low.c's add_thread function creates threads with
last_resume_kind == resume_continue by default.  This field is
used by resume_stopped_resumed_lwps to decide whether to perform
the resume:

static void
resume_stopped_resumed_lwps (struct inferior_list_entry *entry) {
  struct thread_info *thread = (struct thread_info *) entry;
  struct lwp_info *lp = get_thread_lwp (thread);

  if (lp->stopped
      && !lp->status_pending_p
      && thread->last_resume_kind != resume_stop
      && thread->last_status.kind == TARGET_WAITKIND_IGNORE)
    {

So the fix is to make sure to set thread->last_resume_kind to
resume_stop.  Here we do that for new fork children in
gdbserver/linux-low.c:handle_extended_wait.

In addition, it seemed prudent to initialize lwp_info.status_pending_p
for the new fork child.  I also rearranged the initialization code
so that all of the lwp_info initialization was together, rather than
intermixed with thread_info and process_info initialization.

Tested native, native-gdbserver, native-extended-gdbserver on
x86_64 GNU/Linux.

gdb/gdbserver/

* linux-low.c (handle_extended_wait): Initialize
thread_info.last_resume_kind for new fork children.

9 years agoMake remote follow fork 'Detaching' message match native
Don Breazeal [Thu, 28 May 2015 21:26:03 +0000 (14:26 -0700)]
Make remote follow fork 'Detaching' message match native

This patch fixes a couple of failures in gdb.base/foll-vfork.exp for
extended-remote targets.  The failures were the result of the
verbose/debug "Detaching..." messages in infrun.c:follow_fork_inferior
not matching what was expected in the extended-remote case.

The path modifies the ptids used in the messages to ensure that they
print "process nnn" instead of (possibly) "Thread nnn.nnn".  The
detach is a process-wide operation, so we need to use a process-
style ptid regardless of what type of ptid target_pid_to_str returns.

Tested on x86_64 GNU/Linux, native, remote, extended-remote.

gdb/

* infrun.c (follow_fork_inferior): Ensure the use of
process-style ptids (pid,0,0) in verbose/debug "Detaching"
messages.

9 years ago* dwarf2read.c (record_line_ftype): Remove, duplicate.
Doug Evans [Thu, 28 May 2015 16:42:02 +0000 (09:42 -0700)]
* dwarf2read.c (record_line_ftype): Remove, duplicate.

gdb/Changelog:

* dwarf2read.c (record_line_ftype): Remove, duplicate.

9 years agoRemove global variable arm_linux_has_wmmx_registers in arm-linux-nat.c
Yao Qi [Thu, 28 May 2015 09:19:30 +0000 (10:19 +0100)]
Remove global variable arm_linux_has_wmmx_registers in arm-linux-nat.c

This patch is to remove the global variable arm_linux_has_wmmx_registers
in arm-linux-nat.c, and add a new field have_wmmx_registers in
'struct gdbarch_tdep'.

gdb:

2015-05-28  Yao Qi  <yao.qi@linaro.org>

* arm-linux-nat.c (arm_linux_has_wmmx_registers): Remove.
(arm_linux_fetch_inferior_registers): Use
tdep->have_wmmx_registers instead of arm_linux_has_wmmx_registers.
(arm_linux_store_inferior_registers): Likewise.
(arm_linux_read_description): Don't set
arm_linux_has_wmmx_registers.
* arm-tdep.c (arm_gdbarch_init): Set
tdep->have_wmmx_registers according target descriptions.
* arm-tdep.h (struct gdbarch_tdep) <have_wmmx_registers>: New
field.

9 years agoRemove global variable arm_linux_vfp_register_count in arm-linux-nat.c
Yao Qi [Thu, 28 May 2015 09:19:30 +0000 (10:19 +0100)]
Remove global variable arm_linux_vfp_register_count in arm-linux-nat.c

This patch is to remove the global variable arm_linux_vfp_register_count
from arm-linux-nat.c.  This global variable is set when native gdb
looks for the right target description according HWCAP.  However,
'struct gdbarch_tdep' has already had a field have_vfp_registers, which
is a boolean about whether target has vfp registers or not.  This
patch converts this boolean field to a numeric counter to replace
global variable arm_linux_vfp_register_count.

gdb:

2015-05-28  Yao Qi  <yao.qi@linaro.org>

* arm-linux-nat.c (arm_linux_vfp_register_count): Remove.
(fetch_vfp_regs): Use vfp_register_count from gdbarch_tdep
instead of arm_linux_vfp_register_count.
(store_vfp_regs): Likewise.
(arm_linux_fetch_inferior_registers): Likewise.
(arm_linux_store_inferior_registers): Likewise.
(arm_linux_read_description): Don't set
arm_linux_vfp_register_count.
* arm-linux-tdep.c (arm_linux_iterate_over_regset_sections):
Adjust.
* arm-tdep.c (arm_gdbarch_init): Add assert on
vfp_register_count.
* arm-tdep.h (struct gdbarch_tdep) <have_vfp_registers>: Rename
field to vfp_register_count.  All users updated.

9 years agoDo arm_abi detection for ELFOSABI_GNU binaries
Kyle Huey [Thu, 28 May 2015 08:12:12 +0000 (09:12 +0100)]
Do arm_abi detection for ELFOSABI_GNU binaries

On ARM systems, gdb must determine which style of breakpoint to use
(see the comments at the beginning of gdb/arm-linux-tdep.c).  In
arm_gdbarch_init we only attempt to extract the eabi version from the
ELF binary if it is a ELFOSABI_NONE binary.  If the binary is
ELFOSABI_GNU instead, we end up defaulting to the old style OABI
syscall breakpoint instruction.  On a Linux kernel built without
CONFIG_OABI_COMPAT, this triggers a SIGILL in ld when attempting to
execute any ELFOSABI_GNU program.
(e.g. https://github.com/raspberrypi/linux/issues/766)

gdb/

2015-05-28  Kyle Huey  <me@kylehuey.com>  (tiny patch)

* gdb/arm-tdep.c (arm_gdbarch_init): Perform arm_abi detection on
ELFOSABI_GNU binaries.

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

9 years agoAdd struct to record dwarf line number state machine.
Doug Evans [Wed, 27 May 2015 21:44:29 +0000 (14:44 -0700)]
Add struct to record dwarf line number state machine.

gdb/ChangeLog:

* dwarf2read.c (lnp_state_machine): New typedef.
(lnp_reader_state): New typedef.
(dwarf_record_line_1): Renamed from dwarf_record_line.
All callers updated.
(dwarf_record_line): New function.
(init_lnp_state_machine): New function.
(check_line_address): Replace p_record_line parameter with state.
All callers updated.
(dwarf_decode_lines_1): Call dwarf_record_line, init_lnp_state_machine.
Update to record state in lnp_state_machine.

9 years agoConvert PLT reloc only if pointer equality isn't needed
H.J. Lu [Wed, 27 May 2015 21:32:24 +0000 (14:32 -0700)]
Convert PLT reloc only if pointer equality isn't needed

When pointer equality needed, we can't replace PLT relocations with
GOT relocations for -z now.  This patch checks if pointer equality is
needed before converting PLT relocations to GOT relocations.

bfd/

PR binutils/18458
* elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
for now binding only if pointer equality isn't needed.
(elf_i386_allocate_dynrelocs): Use .plt.got section for now
binding only if pointer equality isn't needed.
* elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
section for now binding only if pointer equality isn't needed.
(elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
binding only if pointer equality isn't needed.

ld/testsuite/

PR binutils/18458
* ld-elf/shared.exp (build_tests): Build libpr18458a.so and
libpr18458b.so.
(run_tests): Run pr18458 test.
* ld-elf/pr18458a.c: New file.
* ld-elf/pr18458b.c: Likewise.
* ld-elf/pr18458c.c: Likewise.

9 years agodwarf2read.c code cleanup, split out check_line_address
Doug Evans [Wed, 27 May 2015 20:22:02 +0000 (13:22 -0700)]
dwarf2read.c code cleanup, split out check_line_address

gdb/ChangeLog:

* dwarf2read.c (record_line_ftype): New typedef.
(check_line_address): New function.
(dwarf_decode_lines_1): Call it.

9 years agoAdd set/show debug dwarf-line.
Doug Evans [Wed, 27 May 2015 19:55:19 +0000 (12:55 -0700)]
Add set/show debug dwarf-line.

gdb/ChangeLog:

* NEWS: Mention "set debug dwarf-line".
* dwarf2read.c (dwarf_line_debug): New static global.
(add_include_dir): Add debug dwarf-line support.
(add_file_name, dwarf_record_line, dwarf_finish_line): Ditto.
(_initialize_dwarf2_read): New parameter "debug dwarf-line".

gdb/doc/ChangeLog:

* gdb.texinfo (Debugging Output): Mention set/show debug dwarf-line.

9 years agoDon't ignore domain in nested lookups.
Doug Evans [Wed, 27 May 2015 19:17:37 +0000 (12:17 -0700)]
Don't ignore domain in nested lookups.

gdb/ChangeLog:

* cp-namespace.c (cp_lookup_nested_symbol): New arg "domain".
All callers updated.
(cp_lookup_nested_symbol_1, find_symbol_in_baseclass): Ditto.
* cp-support.h (cp_lookup_nested_symbol): Update.

9 years agoPR symtab/18258
Doug Evans [Wed, 27 May 2015 18:50:38 +0000 (11:50 -0700)]
PR symtab/18258

gdb/ChangeLog:

* block.c (block_find_symbol): New function.
(block_find_non_opaque_type): Ditto.
(block_find_non_opaque_type_preferred): Ditto.
* block.h (block_symbol_matcher_ftype): New typedef.
(block_find_symbol): Declare.
(block_find_non_opaque_type): Ditto.
(block_find_non_opaque_type_preferred): Ditto.
* dwarf2read.c (dw2_lookup_symbol): Call block_find_symbol.
* psymtab.c (psym_lookup_symbol): Ditto.
* symtab.c (basic_lookup_transparent_type_1): New function.
(basic_lookup_transparent_type): Call it.

gdb/testsuite/ChangeLog:

* gdb.dwarf2/opaque-type-lookup-2.c: New file.
* gdb.dwarf2/opaque-type-lookup.c: New file.
* gdb.dwarf2/opaque-type-lookup.exp: New file.