platform/upstream/binutils.git
8 years agotestsuite: Fix gcc_compiled for gcc 6 & 7
Jan Kratochvil [Thu, 20 Oct 2016 19:58:54 +0000 (21:58 +0200)]
testsuite: Fix gcc_compiled for gcc 6 & 7

gdb/testsuite/ChangeLog
2016-10-20  Jan Kratochvil  <jan.kratochvil@redhat.com>

* lib/gdb.exp (get_compiler_info): Generalize gcc_compile regexp.

8 years agoRegenerate bfd.pot.
Nick Clifton [Thu, 20 Oct 2016 10:44:51 +0000 (11:44 +0100)]
Regenerate bfd.pot.

8 years agoDon't configure gdb for vxworks target
Yao Qi [Thu, 20 Oct 2016 10:33:07 +0000 (11:33 +0100)]
Don't configure gdb for vxworks target

VxWorks support was removed in 2004.

commit e84ecc995d6a5e4e9114d3cea61717b8a573afb6
Author: Andrew Cagney <cagney@redhat.com>
Date:   Sat Nov 13 23:10:02 2004 +0000

    2004-11-13  Andrew Cagney  <cagney@gnu.org>

        * configure.tgt: Delete i[34567]86-*-vxworks*, m68*-netx-*,
        m68*-*-vxworks*, mips*-*-vxworks*, powerpc-*-vxworks*, and
        sparc-*-vxworks*.
        * NEWS: Mention that vxworks was deleted.

This patch adds *-*-vxworks* in a list of targets GDB doesn't
support.

gdb:

2016-10-20  Yao Qi  <yao.qi@linaro.org>

* configure.tgt: Don't configure if target is *-*-vxworks*.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 20 Oct 2016 00:00:22 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agotestsuite: Fix gdb.base/killed-outside.exp using irrelevant stale options
Maciej W. Rozycki [Wed, 19 Oct 2016 17:20:54 +0000 (18:20 +0100)]
testsuite: Fix gdb.base/killed-outside.exp using irrelevant stale options

Fix a commit 4a556533cf02 ("Fix PR11094: JIT breakpoint is not properly
recreated on reruns") regression:

Running .../gdb/testsuite/gdb.base/killed-outside.exp ...
Executing on host: mips-mti-linux-gnu-gcc  -Wl,--no-as-needed  -c -g  -o .../gdb/testsuite/outputs/gdb.base/killed-outside/killed-outside0.o .../gdb/testsuite/gdb.base/killed-outside.c .../gdb/testsuite/outputs/gdb.base/jit-simple/jit-simple-jit.so    (timeout = 300)
spawn mips-mti-linux-gnu-gcc -Wl,--no-as-needed -c -g -o .../gdb/testsuite/outputs/gdb.base/killed-outside/killed-outside0.o .../gdb/testsuite/gdb.base/killed-outside.c .../gdb/testsuite/outputs/gdb.base/jit-simple/jit-simple-jit.so
mips-mti-linux-gnu-gcc: warning: .../gdb/testsuite/outputs/gdb.base/jit-simple/jit-simple-jit.so: linker input file unused because linking not done
output is:
mips-mti-linux-gnu-gcc: warning: .../gdb/testsuite/outputs/gdb.base/jit-simple/jit-simple-jit.so: linker input file unused because linking not done

gdb compile failed, mips-mti-linux-gnu-gcc: warning: .../gdb/testsuite/outputs/gdb.base/jit-simple/jit-simple-jit.so: linker input file unused because linking not done
UNTESTED: gdb.base/killed-outside.exp: failed to prepare

and adjust the call to `prepare_for_testing' by removing a reference to
`options', which is not set in this test case but a stale value is
carried over from `gdb.base/jit-simple.exp' previously executed in a
full test suite run.

gdb/testsuite/
* gdb.base/killed-outside.exp: Remove $options from a call to
`prepare_for_testing'.

8 years agoAdd c-format tags to translatable strings with more than one argument-using formattin...
Nick Clifton [Wed, 19 Oct 2016 13:04:34 +0000 (14:04 +0100)]
Add c-format tags to translatable strings with more than one argument-using formatting token.

* aout-adobe.c: Add missing c-format tags for translatable strings.
* aout-cris.c: Likewise.
* aoutx.h: Likewise.
* bfd.c: Likewise.
* binary.c: Likewise.
* cache.c: Likewise.
* coff-alpha.c: Likewise.
* coff-arm.c: Likewise.
* coff-i860.c: Likewise.
* coff-mcore.c: Likewise.
* coff-ppc.c: Likewise.
* coff-rs6000.c: Likewise.
* coff-sh.c: Likewise.
* coff-tic4x.c: Likewise.
* coff-tic54x.c: Likewise.
* coff-tic80.c: Likewise.
* coff64-rs6000.c: Likewise.
* coffcode.h: Likewise.
* coffgen.c: Likewise.
* cofflink.c: Likewise.
* coffswap.h: Likewise.
* cpu-arm.c: Likewise.
* dwarf2.c: Likewise.
* ecoff.c: Likewise.
* elf-attrs.c: Likewise.
* elf-eh-frame.c: Likewise.
* elf-ifunc.c: Likewise.
* elf-m10300.c: Likewise.
* elf-s390-common.c: Likewise.
* elf.c: Likewise.
* elf32-arc.c: Likewise.
* elf32-arm.c: Likewise.
* elf32-avr.c: Likewise.
* elf32-bfin.c: Likewise.
* elf32-cr16.c: Likewise.
* elf32-cr16c.c: Likewise.
* elf32-cris.c: Likewise.
* elf32-crx.c: Likewise.
* elf32-d10v.c: Likewise.
* elf32-d30v.c: Likewise.
* elf32-epiphany.c: Likewise.
* elf32-fr30.c: Likewise.
* elf32-frv.c: Likewise.
* elf32-gen.c: Likewise.
* elf32-hppa.c: Likewise.
* elf32-i370.c: Likewise.
* elf32-i386.c: Likewise.
* elf32-i960.c: Likewise.
* elf32-ip2k.c: Likewise.
* elf32-iq2000.c: Likewise.
* elf32-lm32.c: Likewise.
* elf32-m32c.c: Likewise.
* elf32-m32r.c: Likewise.
* elf32-m68hc11.c: Likewise.
* elf32-m68hc12.c: Likewise.
* elf32-m68hc1x.c: Likewise.
* elf32-m68k.c: Likewise.
* elf32-mcore.c: Likewise.
* elf32-mep.c: Likewise.
* elf32-metag.c: Likewise.
* elf32-microblaze.c: Likewise.
* elf32-moxie.c: Likewise.
* elf32-msp430.c: Likewise.
* elf32-mt.c: Likewise.
* elf32-nds32.c: Likewise.
* elf32-nios2.c: Likewise.
* elf32-or1k.c: Likewise.
* elf32-pj.c: Likewise.
* elf32-ppc.c: Likewise.
* elf32-rl78.c: Likewise.
* elf32-rx.c: Likewise.
* elf32-s390.c: Likewise.
* elf32-score.c: Likewise.
* elf32-score7.c: Likewise.
* elf32-sh-symbian.c: Likewise.
* elf32-sh.c: Likewise.
* elf32-sh64.c: Likewise.
* elf32-spu.c: Likewise.
* elf32-tic6x.c: Likewise.
* elf32-tilepro.c: Likewise.
* elf32-v850.c: Likewise.
* elf32-vax.c: Likewise.
* elf32-visium.c: Likewise.
* elf32-xgate.c: Likewise.
* elf32-xtensa.c: Likewise.
* elf64-alpha.c: Likewise.
* elf64-gen.c: Likewise.
* elf64-hppa.c: Likewise.
* elf64-ia64-vms.c: Likewise.
* elf64-mmix.c: Likewise.
* elf64-ppc.c: Likewise.
* elf64-s390.c: Likewise.
* elf64-sh64.c: Likewise.
* elf64-sparc.c: Likewise.
* elf64-x86-64.c: Likewise.
* elfcode.h: Likewise.
* elfcore.h: Likewise.
* elflink.c: Likewise.
* elfnn-aarch64.c: Likewise.
* elfnn-ia64.c: Likewise.
* elfxx-mips.c: Likewise.
* elfxx-sparc.c: Likewise.
* elfxx-tilegx.c: Likewise.
* ieee.c: Likewise.
* ihex.c: Likewise.
* libbfd.c: Likewise.
* linker.c: Likewise.
* m68klinux.c: Likewise.
* mach-o.c: Likewise.
* merge.c: Likewise.
* mmo.c: Likewise.
* oasys.c: Likewise.
* pdp11.c: Likewise.
* pe-mips.c: Likewise.
* peXXigen.c: Likewise.
* pei-x86_64.c: Likewise.
* peicode.h: Likewise.
* ppcboot.c: Likewise.
* reloc.c: Likewise.
* sparclinux.c: Likewise.
* srec.c: Likewise.
* stabs.c: Likewise.
* vms-alpha.c: Likewise.
* vms-lib.c: Likewise.
* xcofflink.c: Likewise.

8 years agoRemove spurious whitespace introduced by previous delta.
Nick Clifton [Tue, 18 Oct 2016 11:02:52 +0000 (12:02 +0100)]
Remove spurious whitespace introduced by previous delta.

8 years agoRegen gdb/config.in
Pedro Alves [Wed, 19 Oct 2016 13:35:06 +0000 (14:35 +0100)]
Regen gdb/config.in

gdb/ChangeLog:
2016-10-19  Pedro Alves  <palves@redhat.com>

* config.in: Regenerate.

8 years ago[GAS][ARM]Generate unpredictable warning for pc used in data processing instructions...
Renlin Li [Wed, 19 Oct 2016 10:18:56 +0000 (11:18 +0100)]
[GAS][ARM]Generate unpredictable warning for pc used in data processing instructions with register-shifted register operand.

gas/

2016-10-19  Renlin Li  <renlin.li@arm.com>

* config/tc-arm.c (encode_arm_shift): Generate unpredictable warning
for register-shifted register instructions.
* testsuite/gas/arm/shift-bad-pc.d: New.
* testsuite/gas/arm/shift-bad-pc.l: New.
* testsuite/gas/arm/shift-bad-pc.s: New.

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 19 Oct 2016 00:00:22 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agogdb: no longer define __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS
Pedro Alves [Tue, 18 Oct 2016 19:48:37 +0000 (20:48 +0100)]
gdb: no longer define __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS

My gnulib fix at:
  https://lists.gnu.org/archive/html/bug-gnulib/2015-11/msg00010.html
was merged upstream meanwhile and our gnulib copy now includes it.

As a concidence, Kevin was telling me today that these macros are
causing a build problem on FreeBSD:

common/common-defs.h:47:0: error: "__STDC_CONSTANT_MACROS" redefined [-Werror]
  #define __STDC_CONSTANT_MACROS 1
  /usr/include/sys/cdefs.h:408:0: note: this is the location of the previous definition
  #define __STDC_CONSTANT_MACROS
(and a similar error for __STDC_LIMIT_MACROS)

The problem seems to be that we should be defining these input macros
before including any system header, but, we're not.

So let's just revert e063da67902e ([C++] Define __STDC_CONSTANT_MACROS
/ __STDC_LIMIT_MACROS for stdint.h).  If this causes a problem
somewhere, we can re-define the macros higher up in the file, before
system headers are included.

gdb/ChangeLog:
2016-10-18  Pedro Alves  <palves@redhat.com>

* common/common-defs.h (__STDC_CONSTANT_MACROS)
(__STDC_LIMIT_MACROS): Delete.

8 years agoUpdate gnulib to current upstream master
Pedro Alves [Tue, 18 Oct 2016 16:18:29 +0000 (17:18 +0100)]
Update gnulib to current upstream master

I tried building gdb with G++ 4.7 and CXX="g++ -std=gnu+11", and that
tripped on a build error:

  In file included from build-gnulib/import/stdio.h:53:0,
   from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/common/common-defs.h:31,
   from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/defs.h:28,
   from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/armobsd-tdep.c:20:
  build-gnulib/import/stddef.h:104:3: error: conflicting declaration ‘typedef union max_align_t max_align_t’
  In file included from build-gnulib/import/stddef.h:55:0,
   from build-gnulib/import/stdio.h:53,
   from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/common/common-defs.h:31,
   from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/defs.h:28,
   from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/armobsd-tdep.c:20:
  /opt/gcc-4.7/lib/gcc/x86_64-unknown-linux-gnu/4.7.4/include/stddef.h:426:3: error: ‘max_align_t’ has a previous declaration as ‘typedef struct max_align_t max_align_t’

Updating gnulib to current master fixes it, since it brings in this
fix:

 http://lists.gnu.org/archive/html/bug-gnulib/2016-04/msg00000.html

Our last update was in August 2015.  This doesn't bring in much added
baggage, it's mostly bug fixes.  It pulled in the "limits-h" module as
automatic dependency, and given that looks potentially useful I added
it to the set of modules we require.

Tested on x86_64 Fedora 23, with g++ 4.7 and g++ 5.3, native and gdbserver.

gdb/ChangeLog:
2016-10-18  Pedro Alves  <palves@redhat.com>

* gnulib/update-gnulib.sh (GNULIB_COMMIT_SHA1): Set to
2692e23a48e21f6daa029e8af9f1a143b7532f47.
* gnulib/configure, gnulib/config.in, gnulib/aclocal.m4:
Regenerate.
* gnulib/import/Makefile: Update.
* gnulib/import/alloca: Update.
* gnulib/import/basename-lgpl: Update.
* gnulib/import/canonicalize-lgpl: Update.
* gnulib/import/config: Update.
* gnulib/import/dirent: Update.
* gnulib/import/dirfd: Update.
* gnulib/import/dirname-lgpl: Update.
* gnulib/import/dirname.h: Update.
* gnulib/import/dosname.h: Update.
* gnulib/import/errno: Update.
* gnulib/import/extra/snippet/arg-nonnull.h: Update.
* gnulib/import/extra/snippet/c++defs.h: Update.
* gnulib/import/extra/snippet/warn-on-use.h: Update.
* gnulib/import/extra/update-copyright: Update.
* gnulib/import/flexmember.h: Update.
* gnulib/import/float+.h: Update.
* gnulib/import/float: Update.
* gnulib/import/float: Update.
* gnulib/import/fnmatch: Update.
* gnulib/import/fnmatch: Update.
* gnulib/import/fnmatch_loop: Update.
* gnulib/import/fpucw.h: Update.
* gnulib/import/frexp: Update.
* gnulib/import/frexpl: Update.
* gnulib/import/gettimeofday: Update.
* gnulib/import/hard-locale: Update.
* gnulib/import/hard-locale.h: Update.
* gnulib/import/inttypes: Update.
* gnulib/import/isnan: Update.
* gnulib/import/isnand-nolibm.h: Update.
* gnulib/import/isnand: Update.
* gnulib/import/isnanl-nolibm.h: Update.
* gnulib/import/isnanl: Update.
* gnulib/import/itold: Update.
* gnulib/import/limits: Update.
* gnulib/import/localcharset: Update.
* gnulib/import/localcharset.h: Update.
* gnulib/import/lstat: Update.
* gnulib/import/m4/00gnulib: Update.
* gnulib/import/m4/absolute-header: Update.
* gnulib/import/m4/alloca: Update.
* gnulib/import/m4/canonicalize: Update.
* gnulib/import/m4/codeset: Update.
* gnulib/import/m4/configmake: Update.
* gnulib/import/m4/dirent_h: Update.
* gnulib/import/m4/dirfd: Update.
* gnulib/import/m4/dirname: Update.
* gnulib/import/m4/double-slash-root: Update.
* gnulib/import/m4/eealloc: Update.
* gnulib/import/m4/errno_h: Update.
* gnulib/import/m4/exponentd: Update.
* gnulib/import/m4/exponentl: Update.
* gnulib/import/m4/extensions: Update.
* gnulib/import/m4/extern-inline: Update.
* gnulib/import/m4/fcntl-o: Update.
* gnulib/import/m4/flexmember: Update.
* gnulib/import/m4/float_h: Update.
* gnulib/import/m4/fnmatch: Update.
* gnulib/import/m4/fpieee: Update.
* gnulib/import/m4/frexp: Update.
* gnulib/import/m4/frexpl: Update.
* gnulib/import/m4/gettimeofday: Update.
* gnulib/import/m4/glibc21: Update.
* gnulib/import/m4/gnulib-cache: Update.
* gnulib/import/m4/gnulib-common: Update.
* gnulib/import/m4/gnulib-comp: Update.
* gnulib/import/m4/gnulib-tool: Update.
* gnulib/import/m4/hard-locale: Update.
* gnulib/import/m4/include_next: Update.
* gnulib/import/m4/inttypes-pri: Update.
* gnulib/import/m4/inttypes: Update.
* gnulib/import/m4/isnand: Update.
* gnulib/import/m4/isnanl: Update.
* gnulib/import/m4/largefile: Update.
* gnulib/import/m4/limits-h: Update.
* gnulib/import/m4/localcharset: Update.
* gnulib/import/m4/locale-fr: Update.
* gnulib/import/m4/locale-ja: Update.
* gnulib/import/m4/locale-zh: Update.
* gnulib/import/m4/longlong: Update.
* gnulib/import/m4/lstat: Update.
* gnulib/import/m4/malloc: Update.
* gnulib/import/m4/malloca: Update.
* gnulib/import/m4/math_h: Update.
* gnulib/import/m4/mbrtowc: Update.
* gnulib/import/m4/mbsinit: Update.
* gnulib/import/m4/mbsrtowcs: Update.
* gnulib/import/m4/mbstate_t: Update.
* gnulib/import/m4/memchr: Update.
* gnulib/import/m4/memmem: Update.
* gnulib/import/m4/mmap-anon: Update.
* gnulib/import/m4/multiarch: Update.
* gnulib/import/m4/nocrash: Update.
* gnulib/import/m4/off_t: Update.
* gnulib/import/m4/pathmax: Update.
* gnulib/import/m4/rawmemchr: Update.
* gnulib/import/m4/readlink: Update.
* gnulib/import/m4/rename: Update.
* gnulib/import/m4/rmdir: Update.
* gnulib/import/m4/signal_h: Update.
* gnulib/import/m4/ssize_t: Update.
* gnulib/import/m4/stat: Update.
* gnulib/import/m4/stdbool: Update.
* gnulib/import/m4/stddef_h: Update.
* gnulib/import/m4/stdint: Update.
* gnulib/import/m4/stdio_h: Update.
* gnulib/import/m4/stdlib_h: Update.
* gnulib/import/m4/strchrnul: Update.
* gnulib/import/m4/string_h: Update.
* gnulib/import/m4/strstr: Update.
* gnulib/import/m4/strtok_r: Update.
* gnulib/import/m4/sys_socket_h: Update.
* gnulib/import/m4/sys_stat_h: Update.
* gnulib/import/m4/sys_time_h: Update.
* gnulib/import/m4/sys_types_h: Update.
* gnulib/import/m4/time_h: Update.
* gnulib/import/m4/unistd_h: Update.
* gnulib/import/m4/warn-on-use: Update.
* gnulib/import/m4/wchar_h: Update.
* gnulib/import/m4/wchar_t: Update.
* gnulib/import/m4/wctype_h: Update.
* gnulib/import/m4/wint_t: Update.
* gnulib/import/malloc: Update.
* gnulib/import/malloca: Update.
* gnulib/import/malloca.h: Update.
* gnulib/import/math: Update.
* gnulib/import/math: Update.
* gnulib/import/mbrtowc: Update.
* gnulib/import/mbsinit: Update.
* gnulib/import/mbsrtowcs-impl.h: Update.
* gnulib/import/mbsrtowcs-state: Update.
* gnulib/import/mbsrtowcs: Update.
* gnulib/import/memchr: Update.
* gnulib/import/memmem: Update.
* gnulib/import/pathmax.h: Update.
* gnulib/import/rawmemchr: Update.
* gnulib/import/readlink: Update.
* gnulib/import/ref-add.sin: Update.
* gnulib/import/ref-del.sin: Update.
* gnulib/import/rename: Update.
* gnulib/import/rmdir: Update.
* gnulib/import/same-inode.h: Update.
* gnulib/import/signal: Update.
* gnulib/import/stat: Update.
* gnulib/import/stdbool: Update.
* gnulib/import/stddef: Update.
* gnulib/import/stdint: Update.
* gnulib/import/stdio: Update.
* gnulib/import/stdlib: Update.
* gnulib/import/str-two-way.h: Update.
* gnulib/import/strchrnul: Update.
* gnulib/import/streq.h: Update.
* gnulib/import/string: Update.
* gnulib/import/stripslash: Update.
* gnulib/import/strnlen1: Update.
* gnulib/import/strnlen1.h: Update.
* gnulib/import/strstr: Update.
* gnulib/import/strtok_r: Update.
* gnulib/import/sys_stat: Update.
* gnulib/import/sys_time: Update.
* gnulib/import/sys_types: Update.
* gnulib/import/time: Update.
* gnulib/import/unistd: Update.
* gnulib/import/unistd: Update.
* gnulib/import/verify.h: Update.
* gnulib/import/wchar: Update.
* gnulib/import/wctype: Update.
* gnulib/import/flexmember.h: New file.
* gnulib/import/hard-locale.c: New file.
* gnulib/import/hard-locale.h: New file.
* gnulib/import/limits.in.h: New file.
* gnulib/import/m4/flexmember.m4: New file.
* gnulib/import/m4/hard-locale.m4: New file.
* gnulib/import/m4/limits-h.m4: New file.

8 years agoCheck addr32flag instead of sizeflag for rip/eip
H.J. Lu [Tue, 18 Oct 2016 16:06:27 +0000 (09:06 -0700)]
Check addr32flag instead of sizeflag for rip/eip

Since the address size prefix, 0x67, is ignored for MPX instructions in
64-bit mode, we should check addr32flag instead of sizeflag for rip/eip.

PR binutis/20699
* i386-dis.c (OP_E_memory): Check addr32flag instead of sizeflag
for rip/eip.

8 years agoRemove the remaining SSE5 support
H.J. Lu [Tue, 18 Oct 2016 15:14:10 +0000 (08:14 -0700)]
Remove the remaining SSE5 support

PR binutis/20704
* i386-dis.c (three_byte_table): Remove the remaining SSE5 support.

8 years agoIntroduce gdb::unique_ptr
Pedro Alves [Tue, 18 Oct 2016 10:42:35 +0000 (11:42 +0100)]
Introduce gdb::unique_ptr

Many make_cleanup uses in the code base are best eliminated by using a
"owning" smart pointer to manage ownership of the resource
automatically.

The question is _which_ smart pointer.

GDB currently supports building with a C++03 compiler.  We have
std::auto_ptr in C++03, but, as is collective wisdom by now, that's
too easy to misuse, and has therefore been deprecated in C++11 and
finally removed in C++17.

It'd be nice to be able to use std::unique_ptr instead, which is the
modern, safe std::auto_ptr replacement in C++11.

In addition to extra safety -- moving (i.e., transfer of ownership of
the managed pointer between smart pointers) must be explicit --
std::unique_ptr has (among others) one nice feature that std::auto_ptr
doesn't --- ability to specify a custom deleter as template parameter.
In gdb's context, that allows easily creating a smart pointer for
memory allocated with xmalloc -- the smart pointer then knows to
release with xfree instead of delete.  This is particularly
interesting when managing objects allocated in C libraries, and also,
for C++-fying parts of GDB that interact with other parts that still
return objects allocated with xmalloc.

Since std::unique_ptr's API is quite nice, and eventually we'd like to
move to C++11, this patch adds a C++03-compatible smart pointer that
exposes the subset of the std::unique_ptr API that we're interested
in.  An advantage is that whenever we start requiring C++11, we won't
have to learn a new API.  Meanwhile, this allows continuing to support
building with a C++03 compiler.

Since C++03 doesn't support rvalue references (boost gets close to
emulating them, but it's not fully transparent to user code), the
C++03 std::unique_ptr emulation here doesn't try hard to prevent
accidentally moving, which is where most of complication of a more
thorough emulation would be.  Instead, we rely on the fact that GDB
will be usually compiled with a C++11 compiler, and use the real
std::unique_ptr in that case to catch such accidental moves.  IOW, the
goal here is to allow code that would be correct using std::unique_ptr
to be equally correct in C++03 mode, and, just as efficient.

The C++03 version was originally based on GCC 7.0's std::auto_ptr and
then heavily customized to behave more like C++11's std::unique_ptr:

   - Support for custom (stateless) deleters.  (Support for stateful
     deleters could be added, if necessary.)

   - unique_ptr<T[]> partial specialization (auto_ptr<T> does not know
     to use delete[]).

   - Support for all of 'ptr != NULL', 'ptr == NULL' and 'if (ptr)'
     using the safe bool idiom to emulate C++11's explicit bool
     operator.

   - There's no nullptr in C++03, so this allows initialization and
     assignment from NULL instead (std::auto_ptr allows neither).

   - Variable names un-uglified (ie., no leading __ prefix everywhere).

   - Formatting made to follow GDB's coding conventions, including
     comment style.

   - Converting "move" constructors done differently in order to truly
     support:

      unique_ptr<Derived> func_returning_unique_ptr (.....);
      ...
      unique_ptr<Base> ptr = func_returning_unique_ptr (.....);

At this point, it no longer shares much at all with the original file,
but, that's the history.

See comments in the code to find out more.

I thought of putting the "emulation" / shim in the "std" namespace, so
that when we start requiring C++11 at some point, no actual changes to
users of the smart pointer throughout would be necessary.  Putting
things in the std namespace is technically undefined, however in
practice it doesn't cause any issue with any compiler.  However,
thinking that people might be confused with seeing std::unique_ptr and
thinking that we're actually requiring C++11 already, I put the new
types in the "gdb" namespace instead.

For managing xmalloc pointers, this adds a gdb::unique_xmalloc_ptr<T>
"specialization" with a custom xfree deleter.

No actual use of any smart pointer is introduced in this patch.
That'll be done in following patches.

Tested (along with the rest of the series) on:

 - NetBSD 5.1 (gcc70 on the compile farm), w/ gcc 4.1.3
 - x86-64 Fedora 23, gcc 5.3.1 (gnu++03)
 - x86-64 Fedora 23, and gcc 7.0 (gnu++14)

gdb/ChangeLog:
2016-10-18  Pedro Alves  <palves@redhat.com>

* common/common-defs.h: Include "gdb_unique_ptr.h".
* common/gdb_unique_ptr.h: New.

8 years agoUpdated Danish translation for the BFD library.
Nick Clifton [Tue, 18 Oct 2016 09:56:12 +0000 (10:56 +0100)]
Updated Danish translation for the BFD library.

8 years agosim: avr: move changelog entries to subdir
Mike Frysinger [Mon, 17 Oct 2016 02:34:08 +0000 (22:34 -0400)]
sim: avr: move changelog entries to subdir

8 years agoi386-tdep: Verify architecture before proceeding with `set/show mpx'
Maciej W. Rozycki [Mon, 17 Oct 2016 15:15:33 +0000 (16:15 +0100)]
i386-tdep: Verify architecture before proceeding with `set/show mpx'

Make sure the architecture is `bfd_arch_i386' before handling the `set
mpx' and `show mpx' commands, avoiding the issue with `i386_mpx_enabled'
interpreting `gdbarch->tdep' according to the `struct gdbarch_tdep'
definition in i386-tdep.h while indeed in a multi-target configuration
it may have a different layout and cause GDB to crash or at least
misbehave.

gdb/
* i386-tdep.c (i386_mpx_info_bounds): Make sure the architecture
is `bfd_arch_i386' before proceeding.
(i386_mpx_set_bounds): Likewise.

8 years agotilegx-tdep: Correct aliasing errors in `tilegx_analyze_prologue'
Maciej W. Rozycki [Mon, 17 Oct 2016 15:18:06 +0000 (16:18 +0100)]
tilegx-tdep: Correct aliasing errors in `tilegx_analyze_prologue'

Fix a load of aliasing build errors:

cc1plus: warnings being treated as errors
.../gdb/tilegx-tdep.c: In function 'CORE_ADDR tilegx_analyze_prologue(gdbarch*, CORE_ADDR, CORE_ADDR, tilegx_frame_cache*, frame_info*)':
.../gdb/tilegx-tdep.c:609: error: dereferencing pointer 'operands' does break strict-aliasing rules
.../gdb/tilegx-tdep.c:592: error: dereferencing pointer 'operands' does break strict-aliasing rules
.../gdb/tilegx-tdep.c:571: error: dereferencing pointer 'operands' does break strict-aliasing rules
[...]
.../gdb/tilegx-tdep.c:601: error: dereferencing pointer '<anonymous>' does break strict-aliasing rules
.../gdb/tilegx-tdep.c:601: note: initialized from here
cc1plus: error: dereferencing pointer 'operands' does break strict-aliasing rules
cc1plus: error: dereferencing pointer 'operands' does break strict-aliasing rules
.../gdb/tilegx-tdep.c:452: note: initialized from here
cc1plus: error: dereferencing pointer 'pretmp.896' does break strict-aliasing rules
cc1plus: note: initialized from here
cc1plus: error: dereferencing pointer 'pretmp.896' does break strict-aliasing rules
cc1plus: note: initialized from here
make[1]: *** [tilegx-tdep.o] Error 1

from an attempt to cast a `long long' pointer to an `int64_t' pointer,
which may not necessarily be compatible types.  Use the `long long' type
for the auxiliary variable then as this is the type of the structure
member referred.

gdb/
* tilegx-tdep.c (tilegx_analyze_prologue): Use the `long long'
type for `operands'.

8 years agoAArch64/opcodes: Correct an `index' global shadowing error
Maciej W. Rozycki [Tue, 18 Oct 2016 03:36:01 +0000 (04:36 +0100)]
AArch64/opcodes: Correct an `index' global shadowing error

Fix a commit 4df068de5214 ("Add support for SVE addressing modes") build
regression:

cc1: warnings being treated as errors
.../opcodes/aarch64-dis.c: In function 'aarch64_ext_sve_addr_rr_lsl':
.../opcodes/aarch64-dis.c:1324: error: declaration of 'index' shadows a global declaration
/usr/include/string.h:303: error: shadowed declaration is here
make[3]: *** [aarch64-dis.lo] Error 1

in a way following commit 91d6fa6a035c ("Add -Wshadow to the gcc command
line options used when compiling the binutils.").

opcodes/
* aarch64-dis.c (aarch64_ext_sve_addr_rr_lsl): Rename `index'
local variable to `index_regno'.

8 years agoNDS32/BFD: Correct an aliasing error in `nds32_elf_check_relocs'
Maciej W. Rozycki [Tue, 18 Oct 2016 03:34:36 +0000 (04:34 +0100)]
NDS32/BFD: Correct an aliasing error in `nds32_elf_check_relocs'

Fix an aliasing build error:

cc1: warnings being treated as errors
.../bfd/elf32-nds32.c: In function 'nds32_elf_check_relocs':
.../bfd/elf32-nds32.c:6644: warning: dereferencing type-punned pointer will break strict-aliasing rules
make[3]: *** [elf32-nds32.lo] Error 1

in a way following commit 6edfbbad0864 ("Fix up gcc4.1 aliasing
warnings"), <https://sourceware.org/ml/binutils/2005-10/msg00071.html>.

bfd/
* elf32-nds32.c (nds32_elf_check_relocs): Avoid aliasing warning
from GCC.

8 years agoARM/BFD: Correct an `index' global shadowing error
Maciej W. Rozycki [Tue, 18 Oct 2016 03:28:34 +0000 (04:28 +0100)]
ARM/BFD: Correct an `index' global shadowing error

Fix a commit 5025eb7c0d87 ("Delete relocations associatesd with deleted
exidx entries.") build regression:

cc1: warnings being treated as errors
.../bfd/elf32-arm.c: In function 'elf32_arm_update_relocs':
.../bfd/elf32-arm.c:14951: warning: declaration of 'index' shadows a global declaration
/usr/include/string.h:304: warning: shadowed declaration is here
make[3]: *** [elf32-arm.lo] Error 1

in a way following commit 91d6fa6a035c ("Add -Wshadow to the gcc command
line options used when compiling the binutils.").

bfd/
* elf32-arm.c (elf32_arm_update_relocs): Rename `index' local
variable to `reloc_index'.

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 18 Oct 2016 00:00:21 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoFix duplicate test message in mi-trace-save.exp
Simon Marchi [Mon, 17 Oct 2016 21:05:46 +0000 (17:05 -0400)]
Fix duplicate test message in mi-trace-save.exp

gdb/testsuite/ChangeLog:

* gdb.trace/mi-trace-save.exp (test_trace_save_wrong_num_args):
Change test message.

8 years agoFix comment in mi-trace-save.exp
Simon Marchi [Mon, 17 Oct 2016 20:54:24 +0000 (16:54 -0400)]
Fix comment in mi-trace-save.exp

This fixes a comment I forgot to update in the previous patch.

gdb/testsuite/ChangeLog:

* gdb.trace/mi-trace-save.exp (test_trace_save_wrong_num_args):
Update comment.

8 years agoFix -trace-save crash when argument is missing
Simon Marchi [Mon, 17 Oct 2016 20:47:36 +0000 (16:47 -0400)]
Fix -trace-save crash when argument is missing

-trace-save doesn't check whether an argument is passed, leading to a
segfault if you pass nothing.

I added a small test, which only tests the error conditions of
-trace-save.

gdb/ChangeLog:

* mi/mi-main.c (mi_cmd_trace_save): Check if argument is present
before using it.

gdb/testsuite/ChangeLog:

* gdb.trace/mi-trace-save.exp: New file.

8 years agogdb: Fix phony iconv build
Pedro Alves [Mon, 17 Oct 2016 16:13:26 +0000 (17:13 +0100)]
gdb: Fix phony iconv build

Cross building gdb for mingw32 on Fedora 23 fails with:

  x86_64-w64-mingw32-g++ -g -O2  [...]  ../../src/gdb/charset.c
  In file included from ../../src/gdb/charset.c:21:0:
  ../../src/gdb/charset.h:134:3: error: 'iconv_t' does not name a type
     iconv_t m_desc;
     ^
  ../../src/gdb/charset.c: In constructor 'wchar_iterator::wchar_iterator(const gdb_byte*, size_t, const char*, size_t)':
  ../../src/gdb/charset.c:600:3: error: 'm_desc' was not declared in this scope
     m_desc = iconv_open (INTERMEDIATE_ENCODING, charset);
     ^
  ../../src/gdb/charset.c: In destructor 'wchar_iterator::~wchar_iterator()':
  ../../src/gdb/charset.c:607:7: error: 'm_desc' was not declared in this scope
     if (m_desc != (iconv_t) -1)
 ^
  ../../src/gdb/charset.c: In member function 'int wchar_iterator::iterate(wchar_iterate_result*, gdb_wchar_t**, const gdb_byte**, size_t*)':
  ../../src/gdb/charset.c:633:25: error: 'm_desc' was not declared in this scope
 size_t r = iconv (m_desc, &inptr, &m_bytes, &outptr, &out_avail);
   ^

This is a regression caused by commit cda6c55bd399 (Turn wchar
iterator into a class).  The problem is that iconv_t is now exposed in
gdb/charset.h, while before it was only used in gdb/charset.c.

gdb/charset.c, under #ifdef PHONY_ICONV, does:

 #undef iconv_t
 #define iconv_t int

So it seems the simplest is to use 'int' in the header file too.

gdb/ChangeLog:
2016-10-17  Pedro Alves  <palves@redhat.com>

* charset.h (class wchar_iterator) [PHONY_ICONV] <m_desc>: Use
'int' as type.

8 years agoFixed matching in newly added test.
Cupertino Miranda [Mon, 17 Oct 2016 14:45:57 +0000 (16:45 +0200)]
Fixed matching in newly added test.

gas/ChangeLog:

    2016-10-17  Cupertino Miranda  <cmiranda@synopsys.com>
* testsuite/arc/dis-inv.d: Fixed target match.

8 years agoDisplay unknown notes. Decode NT_GNU_HWCAP notes.
Nick Clifton [Mon, 17 Oct 2016 14:29:43 +0000 (15:29 +0100)]
Display unknown notes.  Decode NT_GNU_HWCAP notes.

* readelf.c (apply_relocations): Fail if the symbol table section
linked to by the reloc section does not have either the SHT_SYMTAB
or SHT_DYNSYM type.
(print_gnu_note): Decode the contents of NT_GNU_HWCAP notes.
Print the contents of unknown note types.
(process_note): Add the file and section to the parameter list.
Use print_symbol to display the note name.
Display the contents of unknown note types.
(process_corefile_note_segment): Rename to process_notes_at.
Add section parameter.  Apply relocations to the notes when
loading from a section.  Display section name when processing
notes in a section.
* testsuite/binutils-all/readelf.n: Update expected output.

8 years agoRemoved pseudo invalid instructions opcodes.
Cupertino Miranda [Wed, 21 Sep 2016 11:07:46 +0000 (12:07 +0100)]
Removed pseudo invalid instructions opcodes.

The disassember was generating invXXX instructions for cases when in reality we
had llockd or scondd instrutions.

opcodes/ChangeLog:

    Cupertino Miranda  <cmiranda@synopsys.com>
arc-tbl.h: Removed any "inv.+" instructions from the table.

gas/ChangeLog:

    Cupertino Miranda  <cmiranda@synopsys.com>
        testsuite/arc/dis-inv.s: Test to validate patch.
        testsuite/arc/dis-inv.d: Likewise.

8 years agoUpdate list of ELF machine numbers.
Nick Clifton [Mon, 17 Oct 2016 10:46:32 +0000 (11:46 +0100)]
Update list of ELF machine numbers.

include * elf/common.h (DT_SYMTAB_SHNDX): Define.
(EM_CLOUDSHIELD, EM_COREA_1ST, EM_COREA_2ND, EM_OPEN8): Define.
(EM_VIDEOCORE5, EM_56800EX, EM_BA1, EM_BA2, EM_XCORE): Define.
(EM_MCHP_PIC, EM_KM32, EM_KMX32, EM_KMX16, EM_KMX8): Define.
(EM_KVARC, EM_CDP, EM_COGE, EM_COOL, EM_NORC): Define.
(EM_CSR_KALIMBA, EM_Z80, EM_AMDGPU, EM_RISCV): Define.
(ELFOSABI_OPENVOS): Define.
(GRP_MASKOS, GRP_MASKPROC): Define.

binutils * readelf.c (get_dynamic_type): Add DT_SYMTAB_SHNDX.
(get_machine_type): Add EM_CLOUDSHIELD, EM_COREA_1ST,
EM_COREA_2ND, EM_OPEN8, EM_VIDEOCORE5, EM_56800EX, EM_BA1, EM_BA2,
EM_XCORE, EM_MCHP_PIC, EM_KM32, EM_KMX32, EM_KMX16, EM_KMX8,
EM_KVARC, EM_CDP, EM_COGE, EM_COOL, EM_NORC, EM_CSR_KALIMBA,
EM_Z80, EM_AMDGPU, EM_RISCV.
(get_osabi_name): Add ELFOSABI_CLOUDABI and ELFOSABI_OPENVS.
(get_group_flags): Update to handle flags in the
GRP_MASKOS and GRP_MASKPROC ranges.

8 years agoSync libiberty sources with gcc mainline.
Nick Clifton [Mon, 17 Oct 2016 09:26:56 +0000 (10:26 +0100)]
Sync libiberty sources with gcc mainline.

2016-09-19  Andrew Stubbs  <ams@codesourcery.com>

* pex-win32.c (argv_to_cmdline): Quote zero-length parameters.
* testsuite/test-pexecute.c (main): Insert check for zero-length parameters.

2016-09-10  Mark Wielaard  <mjw@redhat.com>

* cp-demangle.c (d_substitution): Change struct demangle_component
variable name from c to dc.

2016-08-12  Marek Polacek  <polacek@redhat.com>

PR c/7652
* cp-demangle.c (d_print_mod): Add FALLTHRU.

2016-08-04  Marcel B?hme  <boehme.marcel@gmail.com>

PR c++/71696
* cplus-dem.c: Prevent infinite recursion when there is a cycle
in the referencing of remembered mangled types.
(work_stuff): New stack to keep track of the remembered mangled
types that are currently being processed.
(push_processed_type): New method to push currently processed
remembered type onto the stack.
(pop_processed_type): New method to pop currently processed
remembered type from the stack.
(work_stuff_copy_to_from): Copy values of new variables.
(delete_non_B_K_work_stuff): Free stack memory.
(demangle_args): Push/Pop currently processed remembered type.
(do_type): Do not demangle a cyclic reference and push/pop
referenced remembered type.

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 17 Oct 2016 00:00:21 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 16 Oct 2016 00:00:20 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoRegenerate spu_ovl.o_c
Alan Modra [Sat, 15 Oct 2016 01:54:54 +0000 (12:24 +1030)]
Regenerate spu_ovl.o_c

No real changes here.  This is just so that we match current spu_ovl.o
with .shstrtab moved.

* emultempl/spu_ovl.o_c: Regenerate.

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 15 Oct 2016 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoFINAL/OVERRIDE: Define to empty on g++ < 4.7
Pedro Alves [Fri, 14 Oct 2016 16:03:16 +0000 (17:03 +0100)]
FINAL/OVERRIDE: Define to empty on g++ < 4.7

final/override were only implemented in g++ 4.7.

include/ChangeLog
2016-10-14  Pedro Alves  <palves@redhat.com>

* ansidecl.h [__cplusplus >= 201103 && GCC_VERSION < 4007] (FINAL,
OVERRIDE): Define as empty.
[__cplusplus < 201103 && GCC_VERSION < 4007] (FINAL): Define as
__final.
[__cplusplus < 201103 && GCC_VERSION >= 4007] (OVERRIDE): Define as
empty.

8 years agoMove OVERRIDE/FINAL from gcc/coretypes.h to include/ansidecl.h
Pedro Alves [Fri, 14 Oct 2016 16:03:16 +0000 (17:03 +0100)]
Move OVERRIDE/FINAL from gcc/coretypes.h to include/ansidecl.h

So that GDB and other projects that share the top level can use them.

Bootstrapped with all default languages + jit on x86-64 Fedora 23.

gcc/ChangeLog:
2016-10-14  Pedro Alves  <palves@redhat.com>

* coretypes.h (OVERRIDE, FINAL): Delete, moved to
include/ansidecl.h.

include/ChangeLog:
2016-10-14  Pedro Alves  <palves@redhat.com>

* ansidecl.h (GCC_FINAL): Delete.
(OVERRIDE, FINAL): New, moved from gcc/coretypes.h.

8 years agoFix typos in trace commands doc
Simon Marchi [Fri, 14 Oct 2016 15:39:17 +0000 (11:39 -0400)]
Fix typos in trace commands doc

gdb/doc/ChangeLog:

* gdb.texinfo (Using Trace Files): Fix typo.
(GDB/MI Tracepoint Commands): Likewise.

8 years agoDocument -ctf switch of -trace-save
Simon Marchi [Fri, 14 Oct 2016 15:39:16 +0000 (11:39 -0400)]
Document -ctf switch of -trace-save

The -trace-save MI command supports saving the trace in the CTF format,
as its CLI counterpart, but it's not documented.

gdb/doc/ChangeLog:

* gdb.texinfo (GDB/MI Tracepoint Commands): Document -ctf switch
of -trace-save.

8 years agoFix leftover remote test failures from PR binutils/19020
Luis Machado [Fri, 14 Oct 2016 14:04:46 +0000 (09:04 -0500)]
Fix leftover remote test failures from PR binutils/19020

As pointed out in PR binutils/19020, those tests were still failing when doing
remote testing. This is because the binary files weren't being copied over to
the remote host for testing.

FAIL: binutils-all/pr19020a
FAIL: binutils-all/pr19020b

This small patch fixes this up to make things pass.

binutils/ChangeLog:
2016-10-14  Luis Machado  <lgustavo@codesourcery.com>

* testsuite/lib/utils-lib.exp (run_dump_test): Call remote_download
to copy file to remote host.

8 years agoFix set sysroot command on AIX
Ulrich Weigand [Fri, 14 Oct 2016 13:04:04 +0000 (15:04 +0200)]
Fix set sysroot command on AIX

set sysroot command on AIX has no effect if a program depends on shared
library archives (.a).  Fixed by using solib_find and solib_bfd_fopen
instead of gdb_bfd_open in solib_aix_bfd_open.

gdb/
2016-10-14  Sangamesh Mallayya  <sangamesh.swamy@in.ibm.com>
    Ulrich Weigand  <uweigand@de.ibm.com>

* solib-aix.c (solib_aix_bfd_open): Call solib_find so that sysroot
path is set properly if program has a dependency on .a archive and
sysroot is set via set sysroot command.

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
8 years agoAdd separate debug info file section
Alan Modra [Fri, 14 Oct 2016 10:47:54 +0000 (21:17 +1030)]
Add separate debug info file section

* scripttempl/DWARF.sc: Add .debug_addr.

8 years ago[ARC] Disassembler: fix LIMM detection for short instructions.
Claudiu Zissulescu [Thu, 13 Oct 2016 13:01:19 +0000 (15:01 +0200)]
[ARC] Disassembler: fix LIMM detection for short instructions.

The ARC (short) instructions are using a special register number to
indicate is the instruction uses a long immediate (LIMM).  In the case
of short instruction, this LIMM indicator depends on the ISA version
used. Thus, for ARCv1 processors, the LIMM indicator is 0x3E, the same
value used in "long" instructions.  However, for the ARCv2 processors,
this LIMM indicator is 0x1E.

This patch fixes the LIMM detection for ARCv1 ISA and adds two tests.

gas/
2016-10-13  Claudiu Zissulescu  <claziss@synopsys.com>

* testsuite/gas/arc/shortlimm_a7.d: New file.
* testsuite/gas/arc/shortlimm_a7.s: Likewise.
* testsuite/gas/arc/shortlimm_hs.d: Likewise.
* testsuite/gas/arc/shortlimm_hs.s: Likewise.

include/
2016-10-13  Claudiu Zissulescu  <claziss@synopsys.com>

* opcode/arc.h (ARC_OPCODE_ARCV2): New define.

opcodes/
2016-10-13  Claudiu Zissulescu  <claziss@synopsys.com>

        * arc-dis.c (find_format_from_table): Discriminate LIMM indicator
usage on ISA basis.

8 years agobtrace: remove leftover comment
Markus Metzger [Thu, 13 Oct 2016 14:09:41 +0000 (16:09 +0200)]
btrace: remove leftover comment

Remove a leftover comment on a function that was removed with commit
0568462bbf0f666d5bf9f720e16147da71eec46a.

8 years agoInclude strings.h where available
Eli Zaretskii [Fri, 14 Oct 2016 07:08:25 +0000 (10:08 +0300)]
Include strings.h where available

gdb/ChangeLog

2016-10-14  Eli Zaretskii  <eliz@gnu.org>

* common/common-defs.h [HAVE_STRINGS_H]: Include strings.h if
available, to get prototypes of 'strcasecmp' and 'strncasecmp'.

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 14 Oct 2016 00:00:22 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoARI: Remove true/false checks
Pedro Alves [Thu, 13 Oct 2016 16:59:26 +0000 (17:59 +0100)]
ARI: Remove true/false checks

These don't make sense with C++.

gdb/ChangeLog:
2016-10-13  Pedro Alves  <palves@redhat.com>

* contrib/ari/gdb_ari.sh (boolean): Suggest bool instead.
(false, true): Remove checks.

8 years agoShare proc get_var_address
Yao Qi [Thu, 13 Oct 2016 15:08:17 +0000 (16:08 +0100)]
Share proc get_var_address

This patch moves proc get_var_address into lib/gdb.exp, and remove the
duplicate copy in gdb.base/*.exp files.

gdb/testsuite:

2016-10-13  Yao Qi  <yao.qi@linaro.org>

* gdb.base/code_elim.exp (get_var_address): Remove.
* gdb.base/relocate.exp: Likewise.
* gdb.base/shreloc.exp: Likewise.
* lib/gdb.exp (get_var_address): New.

8 years agoSkip testing structures with floating points
Yao Qi [Thu, 13 Oct 2016 10:10:25 +0000 (11:10 +0100)]
Skip testing structures with floating points

This patch skips some tests related to floating point in structs.exp
if gdb_skip_float_test return false.

gdb/testsuite:

2016-10-13  Yao Qi  <yao.qi@linaro.org>

* gdb.base/structs.exp: Invoke gdb_skip_float_test, and do
floating point tests if $skip_float_test is false.

8 years agoUse std::string in macho_symfile_read_all_oso
Tom Tromey [Sun, 25 Sep 2016 03:28:52 +0000 (21:28 -0600)]
Use std::string in macho_symfile_read_all_oso

This changes macho_symfile_read_all_oso to use std::string.  This
avoids a cleanup.

2016-10-12  Tom Tromey  <tom@tromey.com>

* machoread.c (macho_symfile_read_all_oso): Use std::string.

8 years agoRemove unnecessary null_cleanup
Tom Tromey [Sun, 25 Sep 2016 03:14:14 +0000 (21:14 -0600)]
Remove unnecessary null_cleanup

This patch removes an unnecessary null_cleanup.

2016-10-12  Tom Tromey  <tom@tromey.com>

* tracepoint.c (trace_dump_command): Remove unnecessary
null_cleanup.

8 years agoTurn wchar iterator into a class
Tom Tromey [Fri, 23 Sep 2016 03:16:53 +0000 (21:16 -0600)]
Turn wchar iterator into a class

This changes wchar_iterator from charset.c into a real C++ class, then
updates the users to use the class.  This lets us remove some cleanups
in favor of the class' destructor.

2016-10-12  Tom Tromey  <tom@tromey.com>

* valprint.c (generic_emit_char, count_next_character)
(generic_printstr): Update.
* charset.c (struct wchar_iterator): Move to charset.h.
(wchar_iterator::wchar_iterator): Rename from
make_wchar_iterator, turn into a constructor.
(wchar_iterator::~wchar_iterator): Rename from
do_cleanup_iterator, turn into a destructor.
(make_cleanup_wchar_iterator): Remove.
(wchar_iterator::iterate): Rename from wchar_iterate.  Remove
"iter" argument.  Update.
* charset.h: Include <vector>.
(class wchar_iterator): New class, from old struct
wchar_iterator.
(make_wchar_iterator, make_cleanup_wchar_iterator): Don't
declare.

8 years agoChange selttest.c to use use std::vector
Tom Tromey [Fri, 23 Sep 2016 03:32:03 +0000 (21:32 -0600)]
Change selttest.c to use use std::vector

This patch changes selftest.c to use std::vector rather than VEC.
I think this is a small net plus.

2016-10-12  Tom Tromey  <tom@tromey.com>

* selftest.c: Include <vector>, not "vec.h".
(self_test_function_ptr): Remove.
(tests): Now a std::vector.
(register_self_test, run_self_tests): Update.

8 years agoConvert tid_range_parser and get_number_or_range to classes
Pedro Alves [Thu, 13 Oct 2016 00:54:07 +0000 (01:54 +0100)]
Convert tid_range_parser and get_number_or_range to classes

This converts tid_range_parser and get_number_or_range to be classes.
The various tid_range_parser_* and get_number_or_range_* functions
become methods on the respective classes.  Then it updates the users
to follow.

The rationale for the change is that this provides better
encapsulation.  For example, this forced me to think of a better
interface between tid_range_parser and get_number_or_range, since the
former peeked into the latter's internals a bit too much.  That ended
up resulting mostly in these two not-just-straight-1-1 changes:

  void
 -tid_range_parser_skip (struct tid_range_parser *parser)
 +tid_range_parser::skip_range ()
  {
 ...

 -  tid_range_parser_init (parser, parser->range_parser.end_ptr,
 -  parser->default_inferior);
 +  m_range_parser.skip_range ();
 +  init (m_range_parser.string (), m_default_inferior);
  }

 and:

    /* If we successfully parsed a thread number or finished parsing a
       thread range, switch back to assuming the next TID is
       inferior-qualified.  */
 -  if (parser->range_parser.end_ptr == NULL
 -      || parser->range_parser.string == parser->range_parser.end_ptr)
 +  if (!m_range_parser.in_range ())
      {

For the same reason (encapsulation), this moves the enum
tid_range_state definition to within the tid_parser class's scope,
since that is private implementation detail.

While at it, switch to use "bool" for booleans.

gdb/ChangeLog:
2016-10-13  Pedro Alves  <palves@redhat.com>
    Tom Tromey  <tom@tromey.com>

* tid-parse.h (tid_range_parser): New class.
(enum tid_range_state): Move into tid_range_parser's scope.
Remove TID_RANGE_ prefix from all values.
(tid_range_parser_get_tid, tid_range_parser_get_tid_range)
(tid_range_parser_star_range, tid_range_parser_finished)
(tid_range_parser_skip, tid_range_parser_qualified): Don't
declare.
(tid_is_in_list): Update comment.
* tid-parse.c (tid_range_parser::tid_range_parser): New.
(init, finished, get_string, skip, tid_is_qualified)
(get_tid_or_range, get_tid_range, get_tid, star_range): Rename;
turn into methods.
(tid_is_in_list): Adjust.
* cli/cli-utils.h (number_or_range_parser): New class.
(init_number_or_range, get_number_or_range)
(number_range_setup_range): Don't declare.
* cli/cli-utils.c
(number_or_range_parser::number_or_range_parser): New.
(init_number_or_range, get_number_or_range)
(number_range_setup_range): Rename; turn into methods.
(number_is_in_list): Adjust.
* breakpoint.c (map_breakpoint_numbers): Adjust.  Use bool.
(trace_pass_command, get_tracepoint_by_number): Adjust.
* breakpoint.h (get_tracepoint_by_number): Adjust.
* inferior.c (detach_inferior_command, kill_inferior_command)
(remove_inferior_command): Adjust.
* linespec.c (decode_line_2): Adjust.
* memattr.c (mem_enable_command, mem_disable_command)
(mem_delete_command): Adjust.
* printcmd.c (map_display_numbers): Adjust.
* reverse.c (delete_bookmark_command, bookmarks_info): Adjust.
* thread.c (thread_apply_command): Adjust.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 13 Oct 2016 00:00:20 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoFixup gdb.python/py-value.exp for bare-metal aarch64-elf
Luis Machado [Wed, 12 Oct 2016 15:10:03 +0000 (10:10 -0500)]
Fixup gdb.python/py-value.exp for bare-metal aarch64-elf

I noticed that testing aarch64-elf gdb with a physical board
ran into issues with gdb.python/py-value.exp. Further investigation showed
that we were actually trying to dereference a NULL pointer (argv) when trying
to access argv[0].

Being bare-metal, argv is not guaranteed to be valid. So we need to make sure
argv is sane before accessing argv[0].

The following patch fixes up the test program to check for a NULL argv and also
improves the testcase a bit so it doesn't have to work with a hardcoded argc
value.

Regression-tested on x86-64 Ubuntu 16.04.

gdb/testsuite/ChangeLog:

2016-10-12  Luis Machado  <lgustavo@codesourcery.com>

* gdb.python/py-value.c (main): Check if argv is NULL before using it.
* gdb.python/py-value.exp (test_value_in_inferior): Don't use hardcoded
argc values.
Add 1 to argc so we guarantee distinct initial/modified argc values.

8 years agoarc: Add support for Newlib
Anton Kolesov [Wed, 12 Oct 2016 11:36:44 +0000 (14:36 +0300)]
arc: Add support for Newlib

Add support for Newlib as an OS/ABI.  The only thing that is specific to it
relatively to "generic" baremetal target is location of PC register in jump
buffer for longjump support.

Sniffer uses .ivt section to decide if ELF file is for ARC Newlib or not.

gdb/ChangeLog:

* arc-newlib-tdep.c: New file.
* configure.tgt: Add newlib support for ARC.

8 years agoarc: Add evaluation of long jump targets
Anton Kolesov [Wed, 12 Oct 2016 11:36:44 +0000 (14:36 +0300)]
arc: Add evaluation of long jump targets

Standard get_longjmp_target implementation, similar to what is in arm-tdep.c.
Actual value of jb_pc should be set in init_osabi methods of particular OS/ABI
implementations.

gdb/ChangeLog:

* arc-tdep.h (struct gdbarch_tdep) <jb_pc>: New field.
* arc-tdep.c (arc_get_longjmp_target): New function.
(arc_gdbarch_init): Set get_longjmp_target if jb_pc is non-negative.
(arc_dump_tdep): Print jb_pc.

8 years agoarc: Add a gdbarch_tdep structure
Anton Kolesov [Wed, 12 Oct 2016 11:36:44 +0000 (14:36 +0300)]
arc: Add a gdbarch_tdep structure

Add target-specific structure gdbarch_tdep for ARC.

gdb/ChangeLog:

* arc-tdep.h (struct gdbarch_tdep): New.
* arc-tdep.c (arc_gdbarch_init): Allocate gdbarch_tdep.

8 years ago[AArch64] Track FP registers in prologue analyzer
Yao Qi [Tue, 11 Oct 2016 11:12:46 +0000 (12:12 +0100)]
[AArch64] Track FP registers in prologue analyzer

We don't track FP registers in aarch64 prologue analyzer, so this causes
an internal error when FP registers are saved by "stp" instruction in
prologue (stp d8, d9, [sp,#128]),

 tbreak _Unwind_RaiseException^M
 aarch64-tdep.c:335: internal-error: CORE_ADDR aarch64_analyze_prologue(gdbarch*, CORE_ADDR, CORE_ADDR, aarch64_prologue_cache*): Assertion `inst.operands[0].type == AARCH64_OPND_Rt' failed.^M
 A problem internal to GDB has been detected,

This patch teaches GDB to track FP registers (D registers) in prologue
analyzer.

gdb:

2016-10-12  Yao Qi  <yao.qi@linaro.org>

PR tdep/20682
* aarch64-tdep.c: Replace 32 with AARCH64_D_REGISTER_COUNT.
(aarch64_analyze_prologue): Extend array 'regs' for D registers.
Assert that operand 0 and 1 can be X or D registers.  Update
register number for D registers.  Update registers in frame
cache.
* aarch64-tdep.h (AARCH64_D_REGISTER_COUNT): New macro.

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 12 Oct 2016 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agomissing changelog entry
Alan Modra [Tue, 11 Oct 2016 23:22:53 +0000 (09:52 +1030)]
missing changelog entry

8 years agoBFD_FAKE_SECTION macro params
Alan Modra [Tue, 11 Oct 2016 23:11:33 +0000 (09:41 +1030)]
BFD_FAKE_SECTION macro params

Order NAME, IDX, FLAGS as per STD_SECTION macro.

* section.c (BFD_FAKE_SECTION): Reorder parameters.  Formatting.
(STD_SECTION): Adjust to suit.
* elf.c (_bfd_elf_large_com_section): Likewise.
* bfd-in2.h: Regenerate.

8 years agoUpdate more tests for objdump change
Alan Modra [Tue, 11 Oct 2016 23:01:24 +0000 (09:31 +1030)]
Update more tests for objdump change

* testsuite/ld-i386/pr19636-1d-nacl.d: Adjust for objdump change.
* testsuite/ld-i386/pr19636-2c-nacl.d: Likewise.
* testsuite/ld-tic6x/shlib-1r.dd: Likewise.
* testsuite/ld-x86-64/plt-nacl.pd: Likewise.
* testsuite/ld-x86-64/pr19636-2d-nacl.d: Likewise.

8 years agotestsuite: Fix gdb.arch/powerpc-prologue.c compilation
Jan Kratochvil [Tue, 11 Oct 2016 17:09:05 +0000 (19:09 +0200)]
testsuite: Fix gdb.arch/powerpc-prologue.c compilation

gcc-6.2.1

gdb compile failed, gdb/testsuite/gdb.arch/powerpc-prologue.c: In function 'main':
gdb/testsuite/gdb.arch/powerpc-prologue.c:32:3: warning: implicit declaration of function 'optimized_1' [-Wimplicit-function-declaration]
   optimized_1 ();
   ^~~~~~~~~~~

gdb/testsuite/ChangeLog
2016-10-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.arch/powerpc-prologue.c (optimized_1): New declaration.

8 years agotestsuite: Use standard_output_file
Jan Kratochvil [Tue, 11 Oct 2016 14:43:58 +0000 (16:43 +0200)]
testsuite: Use standard_output_file

gdb/testsuite/ChangeLog
2016-10-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.arch/powerpc-prologue.exp: Use standard_output_file.
* gdb.arch/ppc64-symtab-cordic.exp: Likewise.
* gdb.arch/vsx-regs.exp: Likewise.

8 years agoEnhance objdump so that it will use .got, .plt and .plt.got section symbols when...
Nick Clifton [Tue, 11 Oct 2016 12:50:10 +0000 (13:50 +0100)]
Enhance objdump so that it will use .got, .plt and .plt.got section symbols when disassembling, and it will use dynamic relocs to interpret entries in the PLT and GOT.

binutils * objdump.c (is_significant_symbol_name): New function.
(remove_useless_symbols): Do not remove significanr symbols.
(find_symbol_for_address): If an exact match for the specified
address has not been found, try scanning the dynamic relocs to see
if one of these matches the address.  If so, use the symbol
associated with the reloc.
(objdump_print_addr_with_symbol): Do not print offsets to symbols
with no value.
(disassemble_section): Only use dynamic relocs if the user
requested this.
(disassemble_data): Always load dynamic relocs if they are
available.

ld * ld-aarch64/emit-relocs-515-be.d: Adjust output to match change
in objdump.
* ld-aarch64/emit-relocs-515.d: Likewise.
* ld-aarch64/emit-relocs-516-be.d: Likewise.
* ld-aarch64/emit-relocs-516.d: Likewise.
* ld-aarch64/farcall-b-plt.d: Likewise.
* ld-aarch64/farcall-bl-plt.d: Likewise.
* ld-aarch64/gc-plt-relocs.d: Likewise.
* ld-aarch64/tls-desc-ie.d: Likewise.
* ld-aarch64/tls-tiny-desc.d: Likewise.
* ld-aarch64/tls-tiny-gd.d: Likewise.
* ld-aarch64/tls-tiny-ie.d: Likewise.
* ld-arm/arm-app-abs32.d: Likewise.
* ld-arm/arm-app.d: Likewise.
* ld-arm/arm-lib-plt32.d: Likewise.
* ld-arm/arm-lib.d: Likewise.
* ld-arm/armthumb-lib.d: Likewise.
* ld-arm/cortex-a8-fix-b-plt.d: Likewise.
* ld-arm/cortex-a8-fix-bcc-plt.d: Likewise.
* ld-arm/cortex-a8-fix-bl-plt.d: Likewise.
* ld-arm/cortex-a8-fix-bl-rel-plt.d: Likewise.
* ld-arm/cortex-a8-fix-blx-plt.d: Likewise.
* ld-arm/farcall-mixed-app-v5.d: Likewise.
* ld-arm/farcall-mixed-app.d: Likewise.
* ld-arm/farcall-mixed-app2.d: Likewise.
* ld-arm/farcall-mixed-lib-v4t.d: Likewise.
* ld-arm/farcall-mixed-lib.d: Likewise.
* ld-arm/ifunc-10.dd: Likewise.
* ld-arm/ifunc-14.dd: Likewise.
* ld-arm/ifunc-15.dd: Likewise.
* ld-arm/ifunc-3.dd: Likewise.
* ld-arm/ifunc-4.dd: Likewise.
* ld-arm/ifunc-9.dd: Likewise.
* ld-arm/long-plt-format.d: Likewise.
* ld-arm/mixed-app-v5.d: Likewise.
* ld-arm/mixed-app.d: Likewise.
* ld-arm/mixed-lib.d: Likewise.
* ld-arm/tls-lib-loc.d: Likewise.
* ld-cris/dso-pltdis1.d: Likewise.
* ld-cris/dso-pltdis2.d: Likewise.
* ld-cris/dso12-pltdis.d: Likewise.
* ld-elf/symbolic-func.r: Likewise.
* ld-frv/fdpic-pie-1.d: Likewise.
* ld-frv/fdpic-pie-2.d: Likewise.
* ld-frv/fdpic-pie-6.d: Likewise.
* ld-frv/fdpic-pie-7.d: Likewise.
* ld-frv/fdpic-pie-8.d: Likewise.
* ld-frv/fdpic-shared-1.d: Likewise.
* ld-frv/fdpic-shared-2.d: Likewise.
* ld-frv/fdpic-shared-3.d: Likewise.
* ld-frv/fdpic-shared-4.d: Likewise.
* ld-frv/fdpic-shared-5.d: Likewise.
* ld-frv/fdpic-shared-6.d: Likewise.
* ld-frv/fdpic-shared-7.d: Likewise.
* ld-frv/fdpic-shared-8.d: Likewise.
* ld-frv/fdpic-shared-local-2.d: Likewise.
* ld-frv/fdpic-shared-local-8.d: Likewise.
* ld-frv/fdpic-static-1.d: Likewise.
* ld-frv/fdpic-static-2.d: Likewise.
* ld-frv/fdpic-static-6.d: Likewise.
* ld-frv/fdpic-static-7.d: Likewise.
* ld-frv/fdpic-static-8.d: Likewise.
* ld-frv/tls-dynamic-2.d: Likewise.
* ld-frv/tls-initial-shared-2.d: Likewise.
* ld-frv/tls-relax-shared-2.d: Likewise.
* ld-frv/tls-shared-2.d: Likewise.
* ld-i386/plt-nacl.pd: Likewise.
* ld-i386/plt-pic-nacl.pd: Likewise.
* ld-i386/plt-pic.pd: Likewise.
* ld-i386/plt.pd: Likewise.
* ld-i386/pr19636-1d-nacl.d: Likewise.
* ld-i386/pr19636-1d.d: Likewise.
* ld-i386/pr19636-2c-nacl.d: Likewise.
* ld-i386/pr19636-2c.d: Likewise.
* ld-ifunc/ifunc-21-x86-64.d: Likewise.
* ld-ifunc/ifunc-22-x86-64.d: Likewise.
* ld-ifunc/pr17154-i386.d: Likewise.
* ld-ifunc/pr17154-x86-64.d: Likewise.
* ld-m68k/plt1-68020.d: Likewise.
* ld-m68k/plt1-cpu32.d: Likewise.
* ld-m68k/plt1-isab.d: Likewise.
* ld-m68k/plt1-isac.d: Likewise.
* ld-metag/shared.d: Likewise.
* ld-metag/stub_pic_app.d: Likewise.
* ld-metag/stub_pic_shared.d: Likewise.
* ld-metag/stub_shared.d: Likewise.
* ld-s390/tlsbin_64.dd: Likewise.
* ld-s390/tlspic_64.dd: Likewise.
* ld-tic6x/shlib-1.dd: Likewise.
* ld-tic6x/shlib-1b.dd: Likewise.
* ld-tic6x/shlib-1rb.dd: Likewise.
* ld-tic6x/shlib-app-1.dd: Likewise.
* ld-tic6x/shlib-app-1b.dd: Likewise.
* ld-tic6x/shlib-app-1r.dd: Likewise.
* ld-tic6x/shlib-app-1rb.dd: Likewise.
* ld-tic6x/shlib-noindex.dd: Likewise.
* ld-vax-elf/export-class-data.dd: Likewise.
* ld-vax-elf/plt-local-lib.dd: Likewise.
* ld-vax-elf/plt-local.dd: Likewise.
* ld-x86-64/bnd-ifunc-2.d: Likewise.
* ld-x86-64/bnd-plt-1.d: Likewise.
* ld-x86-64/gotpcrel1.dd: Likewise.
* ld-x86-64/libno-plt-1b.dd: Likewise.
* ld-x86-64/load1c-nacl.d: Likewise.
* ld-x86-64/load1c.d: Likewise.
* ld-x86-64/load1d-nacl.d: Likewise.
* ld-x86-64/load1d.d: Likewise.
* ld-x86-64/mov1a.d: Likewise.
* ld-x86-64/mov1b.d: Likewise.
* ld-x86-64/mov1c.d: Likewise.
* ld-x86-64/mov1d.d: Likewise.
* ld-x86-64/mov2a.d: Likewise.
* ld-x86-64/mov2b.d: Likewise.
* ld-x86-64/mov2c.d: Likewise.
* ld-x86-64/mov2d.d: Likewise.
* ld-x86-64/mpx3.dd: Likewise.
* ld-x86-64/mpx4.dd: Likewise.
* ld-x86-64/no-plt-1a.dd: Likewise.
* ld-x86-64/no-plt-1b.dd: Likewise.
* ld-x86-64/no-plt-1c.dd: Likewise.
* ld-x86-64/no-plt-1e.dd: Likewise.
* ld-x86-64/no-plt-1f.dd: Likewise.
* ld-x86-64/no-plt-1g.dd: Likewise.
* ld-x86-64/plt-main-bnd.dd: Likewise.
* ld-x86-64/plt-nacl.pd: Likewise.
* ld-x86-64/plt.pd: Likewise.
* ld-x86-64/pr18591.d: Likewise.
* ld-x86-64/pr19609-1c.d: Likewise.
* ld-x86-64/pr19609-1e.d: Likewise.
* ld-x86-64/pr19609-1j.d: Likewise.
* ld-x86-64/pr19609-1l.d: Likewise.
* ld-x86-64/pr19609-1m.d: Likewise.
* ld-x86-64/pr19609-5b.d: Likewise.
* ld-x86-64/pr19609-5c.d: Likewise.
* ld-x86-64/pr19609-5e.d: Likewise.
* ld-x86-64/pr19609-6b.d: Likewise.
* ld-x86-64/pr19609-7b.d: Likewise.
* ld-x86-64/pr19609-7d.d: Likewise.
* ld-x86-64/pr19636-2d.d: Likewise.
* ld-x86-64/pr20093-1.d: Likewise.
* ld-x86-64/pr20093-2.d: Likewise.
* ld-x86-64/pr20253-1b.d: Likewise.
* ld-x86-64/pr20253-1d.d: Likewise.
* ld-x86-64/pr20253-1f.d: Likewise.
* ld-x86-64/pr20253-1h.d: Likewise.
* ld-x86-64/pr20253-1j.d: Likewise.
* ld-x86-64/pr20253-1l.d: Likewise.
* ld-x86-64/protected3.d: Likewise.
* ld-x86-64/tlsbin.dd: Likewise.
* ld-x86-64/tlsbin2.dd: Likewise.
* ld-x86-64/tlsbindesc.dd: Likewise.
* ld-x86-64/tlsdesc-nacl.pd: Likewise.
* ld-x86-64/tlsdesc.dd: Likewise.
* ld-x86-64/tlsdesc.pd: Likewise.
* ld-x86-64/tlsgd10.dd: Likewise.
* ld-x86-64/tlsgd5.dd: Likewise.
* ld-x86-64/tlsgd6.dd: Likewise.
* ld-x86-64/tlsgd8.dd: Likewise.
* ld-x86-64/tlsgdesc.dd: Likewise.
* ld-x86-64/tlspic.dd: Likewise.
* ld-x86-64/tlspic2.dd: Likewise.

2016-10-11  Nick Clifton  <nickc@redhat.com>

PR ld/20535
* emultempl/elf32.em (_search_needed): Add support for pseudo
environment variables supported by ld.so.  Namely $ORIGIN, $LIB
and $PLATFORM.
* configure.ac: Add getauxval to list AC_CHECK_FUNCS list.
* config.in: Regenerate.
* configure: Regenerate.

2016-10-11  Alan Modra  <amodra@gmail.com>

* ldlang.c (lang_do_assignments_1): Descend into output section
statements that do not yet have bfd sections.  Set symbol section
temporarily for symbols defined in such statements to the undefined
section.  Don't error on data or reloc statements until final phase.
* ldexp.c (exp_fold_tree_1 <etree_assign>): Handle bfd_und_section
in expld.section.
* testsuite/ld-mmix/bpo-10.d: Adjust.
* testsuite/ld-mmix/bpo-11.d: Adjust.

2016-10-10  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* emulparams/elf64_s390.sh: Move binary start to 16M.
* testsuite/ld-s390/tlsbin_64.dd: Adjust testcases accordingly.
* testsuite/ld-s390/tlsbin_64.rd: Likewise.

2016-10-07  Alan Modra  <amodra@gmail.com>

* ldexp.c (MAX): Define.
(exp_unop, exp_binop, exp_trinop): Alloc at least enough for
etree_type.value.

2016-10-07  Alan Modra  <amodra@gmail.com>

* testsuite/lib/ld-lib.exp (is_generic_elf): New, extracted from..
* testsuite/ld-elf/elf.exp: ..here.

2016-10-06  Ludovic Court?s  <ludo@gnu.org>

* emulparams/elf32bmipn32-defs.sh: Shift quote of
"x$EMULATION_NAME" to the left to work around
<http://ftp.gnu.org/gnu/bash/bash-4.2-patches/bash42-007>.

2016-10-06  Alan Modra  <amodra@gmail.com>

* lexsup.c: Spell fall through comments consistently and add
missing fall through comments.

2016-10-06  Alan Modra  <amodra@gmail.com>

* plugin.c (asymbol_from_plugin_symbol): Avoid compiler warning
by adding return.

2016-10-04  Alan Modra  <amodra@gmail.com>

* ld.texinfo (Expression Section): Update result of arithmetic
expressions.
* ldexp.c (arith_result_section): New function.
(fold_binary): Use it.

2016-10-04  Alan Modra  <amodra@gmail.com>

* ldexp.c (exp_value_fold): New function.
(exp_unop, exp_binop, exp_trinop): Use it.

2016-09-30  Alan Modra  <amodra@gmail.com>

* scripttempl/v850.sc: Don't reference __ctbp, __ep, __gp when
not relocating.
* scripttempl/v850_rh850.sc: Likewise.

2016-09-30  Alan Modra  <amodra@gmail.com>

PR ld/20528
* testsuite/ld-elf/pr20528a.d: xfail generic elf targets.  Allow
multiple .text sections for hppa-linux.
* testsuite/ld-elf/pr20528b.d: Likewise.

2016-09-30  Alan Modra  <amodra@gmail.com>

* ldmain.c (default_bfd_error_handler): New function pointer.
(ld_bfd_error_handler): New function.
(main): Arrange to call it on bfd errors/warnings.
(ld_bfd_assert_handler): Enable tail call.

2016-09-30  Alan Modra  <amodra@gmail.com>

* ldlang.c (ignore_bfd_errors): Update params.

2016-09-29  H.J. Lu  <hongjiu.lu@intel.com>

PR ld/20528
* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
merge 2 sections with different SHF_EXCLUDE.
* testsuite/ld-elf/pr20528a.d: New file.
* testsuite/ld-elf/pr20528a.s: Likewise.
* testsuite/ld-elf/pr20528b.d: Likewise.
* testsuite/ld-elf/pr20528b.s: Likewise.

2016-09-28  Christophe Lyon  <christophe.lyon@linaro.org>

PR ld/20608
* testsuite/ld-arm/arm-elf.exp: Handle new testcase.
* testsuite/ld-arm/farcall-mixed-app2.d: New file.
* testsuite/ld-arm/farcall-mixed-app2.r: Likewise.
* testsuite/ld-arm/farcall-mixed-app2.s: Likewise.
* testsuite/ld-arm/farcall-mixed-app2.sym: Likewise.

2016-09-26  Vlad Zakharov  <vzakhar@synopsys.com>

* Makefile.in: Regenerate.
* configure: Likewise.

2016-09-26  Alan Modra  <amodra@gmail.com>

* testsuite/ld-powerpc/attr-gnu-4-4.s: Delete.
* testsuite/ld-powerpc/attr-gnu-4-14.d: Delete.
* testsuite/ld-powerpc/attr-gnu-4-24.d: Delete.
* testsuite/ld-powerpc/attr-gnu-4-34.d: Delete.
* testsuite/ld-powerpc/attr-gnu-4-41.d: Delete.
* testsuite/ld-powerpc/attr-gnu-4-32.d: Adjust expected warning.
* testsuite/ld-powerpc/attr-gnu-8-23.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-01.d: Adjust expected output.
* testsuite/ld-powerpc/attr-gnu-4-02.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-03.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-10.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-11.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-20.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-22.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-33.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-8-11.d: Likewise.
* testsuite/ld-powerpc/powerpc.exp: Don't run deleted tests.

2016-09-23  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>

PR ld/20595
* testsuite/ld-arm/unwind-4.d: Add -q option to linker command
line and -r option to objdump command line.  Match emitted relocs
to make sure that superflous relocs are not generated.

2016-09-23  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* emulparams/elf64_s390.sh: Change TEXT_START_ADDR to 256MB.
* testsuite/ld-s390/tlsbin_64.dd: Adjust testcase accordingly.
* testsuite/ld-s390/tlsbin_64.rd: Likewise.

2016-09-22  Nick Clifton  <nickc@redhat.com>

* emultempl/elf32.em (_try_needed): In verbose mode, report failed
attempts to find a needed library.

2016-09-21  Richard Sandiford  <richard.sandiford@arm.com>

* testsuite/ld-aarch64/emit-relocs-28.d: Expect spaces after ","
in addresses.
* testsuite/ld-aarch64/emit-relocs-301-be.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-301.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-302-be.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-302.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-310-be.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-310.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-313.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-515-be.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-515.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-516-be.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-516.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-531.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-532.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-533.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-534.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-535.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-536.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-537.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-538.d: Likewise.
* testsuite/ld-aarch64/erratum835769.d: Likewise.
* testsuite/ld-aarch64/erratum843419.d: Likewise.
* testsuite/ld-aarch64/farcall-b-plt.d: Likewise.
* testsuite/ld-aarch64/farcall-bl-plt.d: Likewise.
* testsuite/ld-aarch64/gc-plt-relocs.d: Likewise.
* testsuite/ld-aarch64/ifunc-21.d: Likewise.
* testsuite/ld-aarch64/ifunc-7c.d: Likewise.
* testsuite/ld-aarch64/tls-desc-ie.d: Likewise.
* testsuite/ld-aarch64/tls-large-desc-be.d: Likewise.
* testsuite/ld-aarch64/tls-large-desc.d: Likewise.
* testsuite/ld-aarch64/tls-large-ie-be.d: Likewise.
* testsuite/ld-aarch64/tls-large-ie.d: Likewise.
* testsuite/ld-aarch64/tls-relax-all.d: Likewise.
* testsuite/ld-aarch64/tls-relax-gd-ie.d: Likewise.
* testsuite/ld-aarch64/tls-relax-gdesc-ie-2.d: Likewise.
* testsuite/ld-aarch64/tls-relax-gdesc-ie.d: Likewise.
* testsuite/ld-aarch64/tls-relax-large-desc-ie-be.d: Likewise.
* testsuite/ld-aarch64/tls-relax-large-desc-ie.d: Likewise.
* testsuite/ld-aarch64/tls-tiny-desc.d: Likewise.
* testsuite/ld-aarch64/tls-tiny-gd.d: Likewise.

gas * gas/arm/tls.d: Adjust output to match change in objdump.

8 years agoAdd support to the static linker for the tokens accepted by the dynamic linker when...
Nick Clifton [Tue, 11 Oct 2016 11:04:42 +0000 (12:04 +0100)]
Add support to the static linker for the tokens accepted by the dynamic linker when resolving search paths.

PR ld/20535
* emultempl/elf32.em (_search_needed): Add support for pseudo
environment variables supported by ld.so.  Namely $ORIGIN, $LIB
and $PLATFORM.
* configure.ac: Add getauxval to list AC_CHECK_FUNCS list.
* config.in: Regenerate.
* configure: Regenerate.

8 years ago[AArch64] PR target/20666, fix wrong encoding of new introduced BFC pseudo
Jiong Wang [Tue, 11 Oct 2016 10:24:44 +0000 (11:24 +0100)]
[AArch64] PR target/20666, fix wrong encoding of new introduced BFC pseudo

opcode/
PR target/20666
* aarch64-asm.c (convert_bfc_to_bfm): Fix dest index.

gas/
* testsuite/gas/aarch64/alias-2.d: Update expected results.

8 years agoAlways descend into output section statements in lang_do_assignments
Alan Modra [Tue, 11 Oct 2016 07:43:04 +0000 (18:13 +1030)]
Always descend into output section statements in lang_do_assignments

See https://sourceware.org/ml/binutils/2016-07/msg00091.html
This patch stop --gc-sections elf_gc_sweep_symbol localizing symbols
that ought to remain global.

The difficulty with always descending into output section statements
is that symbols defined by the script in such statements don't have
a bfd section when lang_do_assignments runs early in the link process.
There are two approaches to curing this problem.  Either we can
create the bfd section early, or we can use a special section.  This
patch takes the latter approach and uses bfd_und_section.  (Creating
bfd sections early results in changed output section order, and thus
lots of testsuite failures.  You can't create all output sections
early to ensure proper ordering as KEEP then stops empty sections
from being stripped.)

The wrinkle with this approach is that some code that runs at
gc-sections time needs to be made aware of the odd defined symbols
using bfd_und_section.

bfd/
* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Handle symbols
defined temporarily with bfd_und_section.
* elflink.c (_bfd_elf_gc_keep): Don't set SEC_KEEP for bfd_und_section.
* elfxx-mips.c (mips_elf_local_pic_function_p): Exclude defined
symbols with bfd_und_section.
ld/
* ldlang.c (lang_do_assignments_1): Descend into output section
statements that do not yet have bfd sections.  Set symbol section
temporarily for symbols defined in such statements to the undefined
section.  Don't error on data or reloc statements until final phase.
* ldexp.c (exp_fold_tree_1 <etree_assign>): Handle bfd_und_section
in expld.section.
* testsuite/ld-mmix/bpo-10.d: Adjust.
* testsuite/ld-mmix/bpo-11.d: Adjust.

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 11 Oct 2016 00:00:21 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoS/390: Move binary start to 16M.
Andreas Krebbel [Mon, 10 Oct 2016 15:09:03 +0000 (17:09 +0200)]
S/390: Move binary start to 16M.

Turned out that by moving the binary start to 256M I've hit a case with
potentially a lot of aliasing in the branch target buffer between
binaries and shared libs.  So moving on.

Tested on s390x. No regressions.

ld/ChangeLog:

2016-10-10  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* emulparams/elf64_s390.sh: Move binary start to 16M.
* testsuite/ld-s390/tlsbin_64.dd: Adjust testcases accordingly.
* testsuite/ld-s390/tlsbin_64.rd: Likewise.

8 years agobfd/ChangeLog: Add missing PR ld/19908 reference
Maciej W. Rozycki [Mon, 10 Oct 2016 13:49:00 +0000 (14:49 +0100)]
bfd/ChangeLog: Add missing PR ld/19908 reference

8 years agoMIPS64: Adjust cfi* testcases.
Andreas Krebbel [Mon, 10 Oct 2016 12:06:35 +0000 (14:06 +0200)]
MIPS64: Adjust cfi* testcases.

The CFI* testcases fail on MIPS64 because the augmentation string does
not match the regexp. This is because MIPS64 doesn't use the default of
4 for DWARF2_FDE_RELOC_SIZE which ends up as "b" in the augmentation
string. MIPS64 uses the address size which is 8 resulting in "c".

Adding c to the regexp fixes a couple of them. Others also need
adjustments in the FDE header lines due to different
sizes/offsets.

gas/ChangeLog:

2016-10-10  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* testsuite/gas/cfi/cfi-common-1.d: Adjust regexps for mips64.
* testsuite/gas/cfi/cfi-common-2.d: Likewise.
* testsuite/gas/cfi/cfi-common-3.d: Likewise.
* testsuite/gas/cfi/cfi-common-4.d: Likewise.
* testsuite/gas/cfi/cfi-common-5.d: Likewise.
* testsuite/gas/cfi/cfi-common-7.d: Likewise.
* testsuite/gas/cfi/cfi-common-8.d: Likewise.
* testsuite/gas/cfi/cfi-common-9.d: Likewise.
* testsuite/gas/cfi/cfi-mips-1.d: Likewise.

8 years agoShare enum arm_breakpoint_kinds
Yao Qi [Mon, 10 Oct 2016 10:11:25 +0000 (11:11 +0100)]
Share enum arm_breakpoint_kinds

This patch shares "enum arm_breakpoint_kinds", and use ARM_BP_KIND_THUMB2
in GDB.

gdb:

2016-10-10  Yao Qi  <yao.qi@linaro.org>

* arch/arm.h (enum arm_breakpoint_kinds): New.
* arm-tdep.c (arm_remote_breakpoint_from_pc): Use
ARM_BP_KIND_THUMB2.

gdb/gdbserver:

2016-10-10  Yao Qi  <yao.qi@linaro.org>

* linux-aarch32-low.c (enum arm_breakpoint_kinds): Remove.

8 years agoRename 'arch' by 'gdbarch' in m32c_gdbarch_init
Yao Qi [Mon, 10 Oct 2016 09:32:46 +0000 (10:32 +0100)]
Rename 'arch' by 'gdbarch' in m32c_gdbarch_init

This patch renames local 'arch' by 'gdbarch' in m32c_gdbarch_init, so
that I can use macros in the following patch.

gdb:

2016-10-10  Yao Qi  <yao.qi@linaro.org>

* m32c-tdep.c (m32c_gdbarch_init): Rename local 'arch' by
'gdbarch'.

8 years agoRemove v850_dbtrap_breakpoint_from_pc
Yao Qi [Mon, 10 Oct 2016 09:28:30 +0000 (10:28 +0100)]
Remove v850_dbtrap_breakpoint_from_pc

v850 has two functions to install to gdbarch_breakpoint_from_pc,
and it selects one according to info.bfd_arch_info->mach.  However,
we can select the kind/length of breakpoint instruction inside
v850_breakpoint_from_pc by gdbarch_bfd_arch_info (gdbarch)->mach.
This patch is to do that, and remove v850_dbtrap_breakpoint_from_pc.

gdb:

2016-08-30  Yao Qi  <yao.qi@linaro.org>

* v850-tdep.c (v850_breakpoint_from_pc): Use the right
breakpoint instruction.
(v850_dbtrap_breakpoint_from_pc): Remove.
(v850_gdbarch_init): Update.

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 10 Oct 2016 00:00:21 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 9 Oct 2016 00:00:25 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoui-out.c: Remove unused parameter to push_level
Simon Marchi [Sat, 8 Oct 2016 23:47:09 +0000 (19:47 -0400)]
ui-out.c: Remove unused parameter to push_level

The parameter "id" is unused.

gdb/ChangeLog:

* ui-out.c (push_level): Remove "id" parameter.
(ui_out_begin): Update call.

8 years agoAuto-generated dependencies for rx-parse.o and rl78-parse.o
Alan Modra [Sat, 8 Oct 2016 03:19:00 +0000 (13:49 +1030)]
Auto-generated dependencies for rx-parse.o and rl78-parse.o

I noticed a while ago that the rx-elf gas gprel test regressed for no
apparent reason.  It turns out that the problem was rx-parse.y using
BFD_RELOC_RX_* values, which may change when other targets add new
relocs.  If rx-parse.o doesn't depend on bfd.h, it won't be recompiled.

* Makefile.am (EXTRA_as_new_SOURCES): Add config/rl78-parse.y and
config/rx-parse.y.  Move config/bfin-parse.y.
(bfin-parse.@OBJEXT@, rl78-parse.@OBJEXT@, rx-parse.@OBJEXT@): Delete.
($(srcdir)/config/rl78-defs.h): New rule.
* Makefile.in: Regenerate.

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 8 Oct 2016 00:00:23 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoDocument the GDB 7.12 release in gdb/ChangeLog
Joel Brobecker [Fri, 7 Oct 2016 17:18:36 +0000 (10:18 -0700)]
Document the GDB 7.12 release in gdb/ChangeLog

gdb/ChangeLog:

GDB 7.12 released.

8 years agoFold arithmetic integer expressions fallout
Alan Modra [Fri, 7 Oct 2016 12:24:45 +0000 (22:54 +1030)]
Fold arithmetic integer expressions fallout

* ldexp.c (MAX): Define.
(exp_unop, exp_binop, exp_trinop): Alloc at least enough for
etree_type.value.

8 years ago[AArch64] PR target/20667, fix disassembler for the "special" optional SYS_Rt operand...
Jiong Wang [Fri, 7 Oct 2016 09:55:56 +0000 (10:55 +0100)]
[AArch64] PR target/20667, fix disassembler for the "special" optional SYS_Rt operand for "ic"/"tlbi"

gas/
PR target/20667
* testsuite/gas/aarch64/sys-rt-reg.s: Test source for instructions
using SYS_Rt reg.
* testsuite/gas/aarch64/sys-rt-reg.d: New testcase.

opcodes/
PR target/20667
* aarch64-opc.c (aarch64_print_operand): Always print operand if
it's available.

8 years agoSet regdir in tdesc-regs.exp or arm
Yao Qi [Fri, 7 Oct 2016 09:24:12 +0000 (10:24 +0100)]
Set regdir in tdesc-regs.exp or arm

0a69eedb (Clean up the XML files for ARM) moves arm-*.xml files to
arm/ directory, so need update gdb.xml/tdesc-regs.exp accordingly.

gdb/testsuite:

2016-10-07  Yao Qi  <yao.qi@linaro.org>

* gdb.xml/tdesc-regs.exp: Set regdir to "arm/".

8 years agopython: accept address and explicit locations in gdb.decode_line
Markus Metzger [Mon, 20 Jun 2016 09:12:14 +0000 (11:12 +0200)]
python: accept address and explicit locations in gdb.decode_line

The gdb.decode_line python function is documented to support the same location
expressions as the "break" command.  It currently expects a linespec location.

Instead of creating a linespec location directly, create the location via
string_to_event_location_basic.

8 years agoPass link_info to _bfd_merge_private_bfd_data
Alan Modra [Thu, 29 Sep 2016 23:14:50 +0000 (08:44 +0930)]
Pass link_info to _bfd_merge_private_bfd_data

Most BFD linker functions take a bfd_link_info param, which reinforces
the fact that they are linker functions and allow access to linker
callbacks, eg. einfo for printing errors.  I was going to use einfo
for --fatal-warnings support before I decided a better way was the
patch commit 4519d071.

bfd/
* targets.c (bfd_target <_bfd_merge_private_bfd_data>): Replace
obfd param with struct bfd_link_info param.  Update all callers.
* linker.c (bfd_merge_private_bfd_data): Likewise.
(_bfd_generic_verify_endian_match): Likewise.
* aoutf1.h (sunos_merge_private_bfd_data): Likewise.
* coff-arm.c (coff_arm_merge_private_bfd_data): Likewise.
* elf-attrs.c (_bfd_elf_merge_object_attributes): Likewise.
* elf-bfd.h (_bfd_elf_ppc_merge_fp_attributes): Likewise.
(_bfd_elf_merge_object_attributes): Likewise.
* elf-m10300.c (_bfd_mn10300_elf_merge_private_bfd_data): Likewise.
* elf-s390-common.c (elf_s390_merge_obj_attributes): Likewise.
* elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
* elf32-arm.c (elf32_arm_merge_eabi_attributes): Likewise.
(elf32_arm_merge_private_bfd_data): Likewise.
* elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Likewise.
* elf32-cr16.c (_bfd_cr16_elf_merge_private_bfd_data): Likewise.
* elf32-cris.c (cris_elf_merge_private_bfd_data): Likewise.
* elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
* elf32-h8300.c (elf32_h8_merge_private_bfd_data): Likewise.
* elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
* elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
* elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
* elf32-m32r.c (m32r_elf_merge_private_bfd_data): Likewise.
* elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
* elf32-m68hc1x.h (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
* elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Likewise.
* elf32-mcore.c (mcore_elf_merge_private_bfd_data): Likewise.
* elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
* elf32-msp430.c (elf32_msp430_merge_mspabi_attributes): Likewise.
(elf32_msp430_merge_private_bfd_data): Likewise.
* elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
* elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
* elf32-nios2.c (nios2_elf32_merge_private_bfd_data): Likewise.
* elf32-or1k.c (elf32_or1k_merge_private_bfd_data): Likewise.
* elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Likewise.
(ppc_elf_merge_obj_attributes): Likewise.
(ppc_elf_merge_private_bfd_data): Likewise.
* elf32-rl78.c (rl78_elf_merge_private_bfd_data): Likewise.
* elf32-rx.c (rx_elf_merge_private_bfd_data): Likewise.
* elf32-s390.c (elf32_s390_merge_private_bfd_data): Likewise.
* elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
(elf32_score_merge_private_bfd_data): Likewise.
* elf32-score.h (s7_elf32_score_merge_private_bfd_data): Likewise.
* elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
* elf32-sh.c (sh_merge_bfd_arch, sh_elf_merge_private_data): Likewise.
* elf32-sh64.c (sh64_elf_merge_private_data): Likewise.
* elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Likewise.
* elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
(elf32_tic6x_merge_private_bfd_data): Likewise.
* elf32-v850.c (v850_elf_merge_private_bfd_data): Likewise.
* elf32-vax.c (elf32_vax_merge_private_bfd_data): Likewise.
* elf32-visium.c (visium_elf_merge_private_bfd_data): Likewise.
* elf32-xtensa.c (elf_xtensa_merge_private_bfd_data): Likewise.
* elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
* elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Likewise.
* elf64-s390.c (elf64_s390_merge_private_bfd_data): Likewise.
* elf64-sh64.c (sh_elf64_merge_private_data): Likewise.
* elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
* elfnn-aarch64.c (elfNN_aarch64_merge_private_bfd_data): Likewise.
* elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
* elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
(mips_elf_merge_obj_attributes): Likewise.
(_bfd_mips_elf_merge_private_bfd_data): Likewise.
* elfxx-mips.h (_bfd_mips_elf_merge_private_bfd_data): Likewise.
* elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): Likewise.
* elfxx-sparc.h (_bfd_sparc_elf_merge_private_bfd_data): Likewise.
* elfxx-target.h (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
* elfxx-tilegx.c (_bfd_tilegx_elf_merge_private_bfd_data): Likewise.
* elfxx-tilegx.h (_bfd_tilegx_elf_merge_private_bfd_data): Likewise.
* libbfd-in.h (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
ld/
* ldlang.c (lang_check): Update bfd_merge_private_bfd_data call.

8 years agobfd_merge_private_bfd_data tidy
Alan Modra [Fri, 7 Oct 2016 00:28:35 +0000 (10:58 +1030)]
bfd_merge_private_bfd_data tidy

bfd_merge_private_bfd_data and _bfd_generic_verify_endian_match are
linker functions, so move them to linker.c.

bfd/
* Makefile.am (LIBBFD_H_FILES): Update.
* doc/Makefile.am (LIBBFD_H_DEP): Likewise.
* cpu-sh.c (sh_merge_bfd_arch): Move to..
* elf32-sh.c: ..here, and make static.
* elf32-arc.c (arc_elf_merge_private_bfd_data): Delete extraneous
error.
* elf32-cris.c (cris_elf_merge_private_bfd_data): Don't call
_bfd_generic_verify_endian_match.
* elf32-microblaze.c (microblaze_elf_merge_private_bfd_data): Delete.
(bfd_elf32_bfd_merge_private_bfd_data): Define as
_bfd_generic_verify_endian_match.
* elf32-mt.c (mt_elf_merge_private_bfd_data): Don't test
boolean == FALSE.
* elf32-xgate.c (_bfd_xgate_elf_merge_private_bfd_data): Delete.
(bfd_elf32_bfd_merge_private_bfd_data): Don't define.
* elf32-xgate.h (_bfd_xgate_elf_merge_private_bfd_data): Delete.
* libbfd-in.h (_bfd_generic_verify_endian_match): Delete.
* libbfd.c (_bfd_generic_verify_endian_match): Move to..
* linker.c: ..here, and make internal.
* bfd.c (bfd_merge_private_bfd_data): Move to..
* linker.c: ..here.
* Makefile.in: Regenerate.
* doc/Makefile.in: Regenerate.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
opcodes/
* sh-opc.h (sh_merge_bfd_arch): Delete prototype.

8 years agoAdd is_generic_elf to ld/ld-lib.exp
Alan Modra [Mon, 25 Jul 2016 02:36:52 +0000 (12:06 +0930)]
Add is_generic_elf to ld/ld-lib.exp

* testsuite/lib/ld-lib.exp (is_generic_elf): New, extracted from..
* testsuite/ld-elf/elf.exp: ..here.

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 7 Oct 2016 00:00:28 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoConsolidate API of target_supports_multi_process
Sergio Durigan Junior [Tue, 27 Sep 2016 20:21:48 +0000 (16:21 -0400)]
Consolidate API of target_supports_multi_process

This simple commit consolidates the API of
target_supports_multi_process.  Since both GDB and gdbserver use the
same function prototype, all that was needed was to move create this
prototype on gdb/target/target.h and turn the macros declared on
gdb/{,gdbserver/}target.h into actual functions.

Regtested (clean pass) on the BuildBot.

gdb/ChangeLog:
2016-10-06  Sergio Durigan Junior  <sergiodj@redhat.com>

* target.c (target_supports_multi_process): New function, moved
from...
* target.h (target_supports_multi_process): ... here.  Remove
macro.
* target/target.h (target_supports_multi_process): New prototype.

gdb/gdbserver/ChangeLog:
2016-10-06  Sergio Durigan Junior  <sergiodj@redhat.com>

* target.c (target_supports_multi_process): New function, moved
from...
* target.h (target_supports_multi_process): ... here.  Remove
macro.

8 years agogdb: Remove some C compiler support leftovers
Pedro Alves [Thu, 6 Oct 2016 18:23:37 +0000 (19:23 +0100)]
gdb: Remove some C compiler support leftovers

Remove some __cplusplus checks, inline EXPORTED_CONST, and update some comments.

gdb/ChangeLog:
2016-10-06  Pedro Alves  <palves@redhat.com>

* cp-valprint.c (vtbl_ptr_name): Write "extern const" instead of
EXPORTED_CONST.
* stub-termcap.c: Remove __cplusplus checks.
* common/common-defs.h [!__cplusplus] (EXTERN_C, EXTERN_C_PUSH,
EXTERN_C_POP): Delete.
* common/common-exceptions.h (GDB_XCPT_SJMP): Update comments.
(GDB_XCPT) [!__cplusplus]: Delete.
(throw_exception, throw_exception_sjlj): Update comments.
* guile/guile-internal.h (as_a_scm_t_subr) [!__cplusplus]: Delete.
* guile/guile.c (extension_language_guile): Write "extern const"
instead of EXPORTED_CONST.
* features/feature_to_c.sh: Don't emit !__cplusplus code.  Write
"extern const" instead of EXPORTED_CONST.

8 years agoFix gdb.Value->python conversion for large unsigned ints.
Doug Evans [Thu, 6 Oct 2016 17:41:27 +0000 (10:41 -0700)]
Fix gdb.Value->python conversion for large unsigned ints.

gdb/ChangeLog:

* python/py-value.c (valpy_long): Handle unsigned values.

gdb/testsuite/ChangeLog:

* gdb.python/py-value.exp (test_value_creation): Add test for large
unsigned 64-bit value.

8 years agoframe.h: Forward-declare struct ui_out
Simon Marchi [Thu, 6 Oct 2016 17:01:37 +0000 (13:01 -0400)]
frame.h: Forward-declare struct ui_out

Fixes this failure when building in C mode.  I think it's relevant for master
as well, since it's a good practice to include (or forward-declare) what you
use.

In file included from ../../binutils-gdb/gdb/gdbarch.h:38:0,
                 from ../../binutils-gdb/gdb/defs.h:653,
                 from ../../binutils-gdb/gdb/dictionary.c:23:
../../binutils-gdb/gdb/frame.h:710:48: warning: ‘struct ui_out’ declared inside parameter list will not be visible outside of this definition or declaration
 extern void print_stack_frame_to_uiout (struct ui_out *uiout,

gdb/ChangeLog:

* frame.h: Forward-declare struct ui_out.

8 years agoRemove Java support
Tom Tromey [Wed, 5 Oct 2016 14:44:34 +0000 (08:44 -0600)]
Remove Java support

This patch removes the Java support from gdb.  gcj has not seen much
development or use for years now, and was recently removed from GCC.
This patch changes gdb to follow; in the unlikely event that there are
still users using gcj, they can continue to use an older gdb to debug.
Or, they can debug in C++ mode.

Built and regtested on x86-64 Fedora 24.

2016-10-06  Tom Tromey  <tom@tromey.com>

* MAINTAINERS: Remove Java test maintainer.
* varobj.h (java_varobj_ops): Don't declare.
* valprint.h (struct value_print_options)
<pascal_static_field_print>: Update comment.
* utils.c (producer_is_gcc): Remove java reference.
* symtab.h (struct general_symbol_info): Remove java references.
(SYMBOL_SEARCH_NAME): Likewise.
* objfiles.c (allocate_objfile): Update comment.
* linespec.c (find_linespec_symbols): Remove java references.
* gnu-v3-abi.c (gnuv3_rtti_type, gnuv3_baseclass_offset): Remove
java references.
* gdbtypes.h (struct cplus_struct_type) <is_java>: Remove.
(TYPE_CPLUS_REALLY_JAVA): Remove.
* c-varobj.c (enum vsections): Update comment.
* symtab.c (symbol_set_language, symbol_set_names)
(symbol_natural_name, symbol_demangled_name)
(demangle_for_lookup, symbol_matches_domain)
(default_make_symbol_completion_list_break_on_1): Remove java
references.
(JAVA_PREFIX, JAVA_PREFIX_LEN): Remove.
* psymtab.c (match_partial_symbol, psymtab_search_name)
(lookup_partial_symbol): Remove java references.
* dwarf2read.c (find_slot_in_mapped_hash): Remove java references.
(add_partial_symbol, dwarf2_compute_name, dwarf2_physname)
(dwarf2_add_member_fn, is_vtable_name, read_structure_type)
(process_structure_scope, read_subroutine_type)
(read_subrange_type, load_partial_dies)
(new_symbol_full, determine_prefix, typename_concat)
(dwarf2_name): Remove java references.
(set_cu_language): Treat Java as C++.
* c-typeprint.c (c_type_print_args): Remove java reference.
* defs.h (enum language) <language_java>: Remove.
* Makefile.in (SFILES, HFILES_NO_SRCDIR, COMMON_OBS, YYFILES)
(YYOBJ, local-maintainer-clean): Don't mention java files.
* jv-exp.y, jv-lang.c, jv-lang.h, jv-typeprint.c, jv-valprint.c,
jv-varobj.c: Remove.

2016-10-06  Tom Tromey  <tom@tromey.com>

* guile.texi (Types In Guile): Remove Java mentions.
* python.texi (Types In Python): Remove Java mentions.
* gdb.texinfo (Address Locations, Supported Languages)
(Index Section Format): Remove Java mentions.

2016-10-06  Tom Tromey  <tom@tromey.com>

* gdb.compile/compile.exp: Change java tests to rust.
* gdb.base/setshow.exp: Change java tests to rust.
* gdb.base/default.exp: Remove java from language list.
* README (Examples): Update language example.
* gdb.python/py-lookup-type.exp (test_lookup_type): Remove java
test.
* lib/gdb.exp (skip_java_tests): Remove.
* lib/java.exp: Remove.
* gdb.java: Remove.

8 years agomips-tdep: Make FCRs always 32-bit
Maciej W. Rozycki [Thu, 6 Oct 2016 15:51:18 +0000 (16:51 +0100)]
mips-tdep: Make FCRs always 32-bit

Fix a regression from commit f8b73d13b7ca ("Target-described register
support for MIPS"),
<https://sourceware.org/ml/gdb-patches/2007-05/msg00340.html>,
<https://sourceware.org/ml/gdb-patches/2007-06/msg00256.html>, which
caused Floating Point Control Registers (FCRs) to be shown as 64-bit
with 64-bit targets.

This came from the legacy register format where all raw registers
matched the width of the architecture regardless of their actual size.
The correct size was then set in `mips_register_type' for cooked
registers presented to the user, which in the case of FCRs meant the
cooked size was always forced to 32 bits, reflecting their actual
hardware size, even though the raw format carried them in 64-bit
quantities on 64-bit targets.  The upper 32 bits carried in the raw FCR
format have always been don't-cares, not actually retrieved from
hardware and never written back.

With the introduction of XML register descriptions the layout of
previously defined raw registers has been preserved, so as to keep
existing register handling code unchanged and make it easier for GDB and
`gdbserver' to interact with each other whether neither, either or both
parties talking over RSP support XML register descriptions.  For the
XML-described case however `mips_register_type' is not used in raw to
cooked register conversion, so any special cases coded there are not
taken into account.

Instead a new function, `mips_pseudo_register_type', has been introduced
to handle size conversion, however lacking the special case for FCRs for
the Linux and the now defunct IRIX target.  The correct size has been
maintained for embedded targets however, due to the bundling of FCRs
with the embedded registers under the `rawnum >= MIPS_EMBED_FP0_REGNUM +
32' condition.

Add the missing case to `mips_pseudo_register_type' then, referring to
the FCR indices explicitly, and observing that between
`MIPS_EMBED_FP0_REGNUM + 32' and `MIPS_FIRST_EMBED_REGNUM' there is an
unused register slot whose contents are ignored so with the removal of
embedded FCRs from under that condition we don't have to care about it
and we can refer to the embedded registers starting from
MIPS_FIRST_EMBED_REGNUM instead.

Add a test case too so that we have means to check automatically that
the correct user-visible size of FCRs is maintained.

gdb/
* mips-tdep.c (mips_pseudo_register_type): Make FCRs always
32-bit.

gdb/testsuite/
* gdb.arch/mips-fcr.exp: New test.
* gdb.arch/mips-fcr.c: Source for the new test.

8 years agomips-tdep: Rearrange comments in `mips_pseudo_register_type'
Maciej W. Rozycki [Thu, 6 Oct 2016 15:19:38 +0000 (16:19 +0100)]
mips-tdep: Rearrange comments in `mips_pseudo_register_type'

Rearrange comments throughout `mips_pseudo_register_type', placing them
ahead the condtionals they apply to consistently.

gdb/
* mips-tdep.c (mips_pseudo_register_type): Rearrange comments
throughout.

8 years ago[ARC] Fix parsing leave_s and enter_s mnemonics.
Claudiu Zissulescu [Wed, 28 Sep 2016 10:27:41 +0000 (12:27 +0200)]
[ARC] Fix parsing leave_s and enter_s mnemonics.

gas/
2016-10-06  Claudiu Zissulescu  <claziss@synopsys.com>

* testsuite/gas/arc/leave_enter.d: New file.
* testsuite/gas/arc/leave_enter.s: Likewise.
* testsuite/gas/arc/regnames.d: Likewise.
* testsuite/gas/arc/regnames.s: Likewise.
* config/tc-arc.c (arc_parse_name): Don't match reg names against
confirmed symbol names.