Commit Graph

87712 Commits

Author SHA1 Message Date
Trevor Saunders 48afb19489 dlx: move prototype of dlx_set_skip_hi16 to elf/dlx.h
bfd/ChangeLog:

2016-06-27  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* elf32-dlx.h: New file.
	* elf32-dlx.c: Adjust.

gas/ChangeLog:

2016-06-27  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-dlx.c: Include bfd/elf32-dlx.h.
	* config/tc-dlx.h: Remove prototype of dlx_set_skip_hi16.
2016-06-27 05:57:32 -04:00
Trevor Saunders e066bf5f74 xtensa: remove a sentinal
gas/ChangeLog:

2016-06-27  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-xtensa.c (xtensa_elf_suffix): Use ARRAY_SIZE instead of a
	sentinal element.
	(map_suffix_reloc_to_operator): Likewise.
	(map_operator_to_reloc): Likewise.
2016-06-27 05:07:30 -04:00
Trevor Saunders 0708347f66 nds32: remove a sentinal
gas/ChangeLog:

2016-06-27  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-nds32.c (md_begin): Use ARRAY_SIZE instead of a sentinal
	element in relax_table.
2016-06-27 05:06:26 -04:00
GDB Administrator cd529d78e5 Automatic date update in version.in 2016-06-27 00:00:10 +00:00
GDB Administrator 081bae6c18 Automatic date update in version.in 2016-06-26 00:00:17 +00:00
Trevor Saunders 8a0b252a9b aarch64: make the type of reg_entry::type aarch64_reg_type
gas/ChangeLog:

2016-06-25  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-aarch64.c: Make the type of reg_entry::type
	aarch_reg_type.
2016-06-25 11:57:37 -04:00
Trevor Saunders 5703197e04 remove a few sentinals
gas/ChangeLog:

2016-06-25  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-bfin.c (bfin_cpus): Remove sentinal.
	(md_parse_option): Adjust.
	* config/tc-aarch64.c (aarch64_parse_abi): Replace use of a sentinal
	with iteration from 0 to ARRAY_SIZE.
	* config/tc-mcore.c (md_begin): Likewise.
	* config/tc-visium.c (visium_parse_arch): Likewise.

opcodes/ChangeLog:

2016-06-25  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* mcore-opc.h: Remove sentinal.
	* mcore-dis.c (print_insn_mcore): Adjust.
2016-06-25 11:54:28 -04:00
Trevor Saunders 4b92e38839 simplify tic54x_set_default_include ()
its only called with an argument of 0, so we might as well remove the code
supporting other values.

gas/ChangeLog:

2016-06-25  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-tic54x.c (tic54x_set_default_include): remove argument
							   and simplify accordingly.
	(tic54x_include): Adjust.
	(tic54x_mlib): Likewise.
2016-06-25 11:52:29 -04:00
Trevor Saunders 7c2c4aa12f xtensa: prototype xtensa_make_property_section in elf/xtensa.h
There's no reason to have multiple prototypes for the same function.

include/ChangeLog:

2016-06-25  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* elf/xtensa.h (xtensa_make_property_section): New prototype.

gas/ChangeLog:

2016-06-25  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-xtensa.c (xtensa_make_property_section): Remove prototype.

bfd/ChangeLog:

2016-06-25  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* elf32-xtensa.c (xtensa_make_property_section): Remove prototype.
2016-06-25 11:50:33 -04:00
Tom Tromey 9e8a8ea8fe Fix formatting in rust-lang.c
This fixes up a few formatting nits in rust-lang.c.
Built and regtested on x86-64 Fedora 23.

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

	* rust-lang.c (rust_get_disr_info, rust_print_type): Fix
	formatting.
2016-06-25 08:41:45 -06:00
Manish Goregaokar fccb08f8cd
Add tests for printing of NonZero-optimized enums in Rust
gdb/testsuite/ChangeLog:
2016-06-25  Manish Goregaokar  <manish@mozilla.com>

    PR gdb/20239
    * gdb.rust/simple.rs: Add more tests for printing NonZero enums.
    * gdb.rust/simple.exp: Add test expectations for new NonZero tests.
2016-06-25 11:26:59 +05:30
Manish Goregaokar b5a4b3c5e7
Make evaluation and type-printing of all NonZero optimized enums work
gdb/ChangeLog:
2016-06-25  Manish Goregaokar  <manish@mozilla.com>

    PR gdb/20239
    * rust-lang.c (rust_get_disr_info): Correctly interpret
    NonZero-optimized enums of arbitrary depth.
    (rust_print_type): Correctly print NonZero-optimized
    enums.
2016-06-25 11:26:53 +05:30
David Taylor 6b8505468e Support structure offsets that are 512K or larger.
GDB computes structure byte offsets using a 32 bit integer.  And,
first it computes the offset in bits and then converts to bytes.  The
result is that any offset that if 512K bytes or larger overflows.
This patch changes GDB to use LONGEST for such calculations.

	PR gdb/17520 Structure offset wrong when 1/4 GB or greater.
	* c-lang.h: Change all parameters, variables, and struct or union
	members used as struct or union fie3ld offsets from int to
	LONGEST.
	* c-valprint.c: Likewise.
	* cp-abi.c: Likewise.
	* cp-abi.h: Likewise.
	* cp-valprint.c: Likewise.
	* d-valprint.c: Likewise.
	* dwarf2loc.c: Likewise.
	* eval.c: Likewise.
	* extension-priv.h: Likewise.
	* extension.c: Likewise.
	* extension.h: Likewise.
	* findvar.c: Likewise.
	* gdbtypes.h: Likewise.
	* gnu-v2-abi.c: Likewise.
	* gnu-v3-abi.c: Likewise.
	* go-valprint.c: Likewise.
	* guile/guile-internal.h: Likewise.
	* guile/scm-pretty-print.c: Likewise.
	* jv-valprint.c Likewise.
	* opencl-lang.c: Likewise.
	* p-lang.h: Likewise.
	* python/py-prettyprint.c: Likewise.
	* python/python-internal.h: Likewise.
	* spu-tdep.c: Likewise.
	* typeprint.c: Likewise.
	* valarith.c: Likewise.
	* valops.c: Likewise.
	* valprint.c: Likewise.
	* valprint.h: Likewise.
	* value.c: Likewise.
	* value.h: Likewise.
	* p-valprint.c: Likewise.
	* c-typeprint.c (c_type_print_base): When printing offset, use
	plongest, not %d.
	* gdbtypes.c (recursive_dump_type): Ditto.
2016-06-24 21:02:36 -04:00
GDB Administrator e0204c4d4c Automatic date update in version.in 2016-06-25 00:00:19 +00:00
Maciej W. Rozycki 88a7ef1689 MIPS16/GAS: Restore unsupported relocation diagnostics
Correct a MIPS16 relocation handling regression in GAS introduced with:

commit 177b4a6ad0
Author: Alexandre Oliva <aoliva@redhat.com>
Date:   Mon Mar 18 18:56:18 2002 +0000

discussed at <https://sourceware.org/ml/binutils/2002-03/msg00345.html>,
which removed a preparatory call to `mips16_extended_frag' previously
made from `md_estimate_size_before_relax'.  As a result the function is
never called with its `sec' parameter non-NULL and consequently all the
unsupported relocation checks within are dead and never trigger, causing
any unhandled relocations to silently resolve to 0.  Unfortunately there
was no sufficient test suite coverage back then to catch this.

Remove all dead code then, and all the associated comments.  Update the
remaining call to `mips16_extended_frag' from `mips_relax_frag' to pass
the relocation section as the `sec' parameter and use it to mark frags
which require an external relocation, as extended.  Finally handle any
outstanding MIPS16 relocations in `md_convert_frag' and report an error
since we don't support any except with percent operators.

	gas/
	* config/tc-mips.c (append_insn): Use any `O_symbol' expression
	unchanged with relaxed MIPS16 instructions.
	(mips16_extended_frag): Adjust accordingly.  Return 1 right
	away if a relocation will be required for the symbol requested.
	Remove dead first relaxation pass code.
	(mips_relax_frag): Pass `sec' down to `mips16_extended_frag'.
	(md_convert_frag): Adjust symbol value calculation.  Raise an
	error if a relocation is required for the symbol requested.
	* testsuite/gas/mips/mips16@relax-swap3.d: Remove dump patterns,
	add error output.
	* testsuite/gas/mips/mips16@relax-swap3.l: New error output.
	* testsuite/gas/mips/mips16-pcrel-relax-0.d: New test.
	* testsuite/gas/mips/mips16-pcrel-relax-1.d: New test.
	* testsuite/gas/mips/mips16-pcrel-relax-2.d: New test.
	* testsuite/gas/mips/mips16-pcrel-relax-3.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-0.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-1.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-2.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-3.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-4.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-5.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-6.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-7.d: New test.
	* testsuite/gas/mips/mips16-pcrel-addend-0.d: New test.
	* testsuite/gas/mips/mips16-pcrel-addend-1.d: New test.
	* testsuite/gas/mips/mips16-pcrel-addend-2.d: New test.
	* testsuite/gas/mips/mips16-pcrel-addend-3.d: New test.
	* testsuite/gas/mips/mips16-pcrel-absolute.d: New test.
	* testsuite/gas/mips/mips16-branch-reloc-0.d: New test.
	* testsuite/gas/mips/mips16-branch-reloc-1.d: New test.
	* testsuite/gas/mips/mips16-branch-reloc-2.d: New test.
	* testsuite/gas/mips/mips16-branch-reloc-3.d: New test.
	* testsuite/gas/mips/mips16-branch-addend-0.d: New test.
	* testsuite/gas/mips/mips16-branch-addend-1.d: New test.
	* testsuite/gas/mips/mips16-branch-addend-2.d: New test.
	* testsuite/gas/mips/mips16-branch-addend-3.d: New test.
	* testsuite/gas/mips/mips16-branch-absolute.d: New test.
	* testsuite/gas/mips/mips16-absolute-reloc-0.d: New test.
	* testsuite/gas/mips/mips16-absolute-reloc-1.d: New test.
	* testsuite/gas/mips/mips16-absolute-reloc-2.d: New test.
	* testsuite/gas/mips/mips16-absolute-reloc-3.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-2.l: New error output.
	* testsuite/gas/mips/mips16-pcrel-reloc-3.l: New error output.
	* testsuite/gas/mips/mips16-pcrel-reloc-6.l: New error output.
	* testsuite/gas/mips/mips16-pcrel-reloc-7.l: New error output.
	* testsuite/gas/mips/mips16-pcrel-addend-2.l: New error output.
	* testsuite/gas/mips/mips16-pcrel-addend-3.l: New error output.
	* testsuite/gas/mips/mips16-pcrel-absolute.l: New error output.
	* testsuite/gas/mips/mips16-branch-reloc-2.l: New error output.
	* testsuite/gas/mips/mips16-branch-reloc-3.l: New error output.
	* testsuite/gas/mips/mips16-branch-addend-2.l: New error output.
	* testsuite/gas/mips/mips16-branch-addend-3.l: New error output.
	* testsuite/gas/mips/mips16-branch-absolute.l: New error output.
	* testsuite/gas/mips/mips16-absolute-reloc-2.l: New error output.
	* testsuite/gas/mips/mips16-absolute-reloc-3.l: New error output.
	* testsuite/gas/mips/mips16-pcrel-relax-0.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-relax-2.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-reloc-0.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-reloc-1.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-reloc-2.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-reloc-3.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-reloc-4.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-reloc-5.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-reloc-6.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-reloc-7.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-addend-0.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-addend-1.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-addend-2.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-addend-3.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-absolute.s: New test source.
	* testsuite/gas/mips/mips16-branch-reloc-0.s: New test source.
	* testsuite/gas/mips/mips16-branch-reloc-1.s: New test source.
	* testsuite/gas/mips/mips16-branch-reloc-2.s: New test source.
	* testsuite/gas/mips/mips16-branch-reloc-3.s: New test source.
	* testsuite/gas/mips/mips16-branch-addend-0.s: New test source.
	* testsuite/gas/mips/mips16-branch-addend-1.s: New test source.
	* testsuite/gas/mips/mips16-branch-addend-2.s: New test source.
	* testsuite/gas/mips/mips16-branch-addend-3.s: New test source.
	* testsuite/gas/mips/mips16-branch-absolute.s: New test source.
	* testsuite/gas/mips/mips16-absolute-reloc-0.s: New test source.
	* testsuite/gas/mips/mips16-absolute-reloc-1.s: New test source.
	* testsuite/gas/mips/mips16-absolute-reloc-2.s: New test source.
	* testsuite/gas/mips/mips16-absolute-reloc-3.s: New test source.
	* testsuite/gas/mips/mips.exp: Run the new tests.
2016-06-25 00:54:59 +01:00
David Taylor 2907f41490 Add myself as a Write After Approval maintainer. 2016-06-24 17:05:31 -04:00
John Baldwin e6cdd38e8f Add support for catching system calls to native FreeBSD targets.
All platforms on FreeBSD use a shared system call table, so use a
single XML file to describe the system calls available on each FreeBSD
platform.

Recent versions of FreeBSD include the identifier of the current
system call when reporting a system call entry or exit event in the
ptrace_lwpinfo structure obtained via PT_LWPINFO in fbsd_wait.  As
such, FreeBSD native targets do not use the gdbarch method to fetch
the system call code.  In addition, FreeBSD register sets fetched via
ptrace do not include an equivalent of 'orig_rax' (on amd64 for
example), so the system call code cannot be extracted from the
available registers during a system call exit.  However, GDB assumes
that system call catch points are not supported if the gdbarch method
is not present.  As a workaround, FreeBSD ABIs install a dummy gdbarch
method that throws an internal_error if it is ever invoked.

gdb/ChangeLog:

	* configure.ac: Check for support for system call LWP fields on
	FreeBSD.
	* config.in, configure: Rebuild.
	* data-directory/Makefile.in (SYSCALLS_FILES): Add freebsd.xml.
	* fbsd-nat.c (fbsd_wait) [HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE]:
	Report system call events.
	[HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE]
	(fbsd_set_syscall_catchpoint): New function.
	(fbsd_nat_add_target) [HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE]:
	Set "to_set_syscall_catchpoint" to "fbsd_set_syscall_catchpoint".
	* fbsd-tdep.c: Include xml-syscall.h
	(fbsd_get_syscall_number): New function.
	(fbsd_init_abi): Set XML system call file name.
	Add "get_syscall_number" gdbarch method.
	* syscalls/freebsd.xml: New file.
2016-06-24 10:46:03 -07:00
John Baldwin 82372b2f27 Add a gdbarch 'print_auxv_entry' method for FreeBSD ABIs.
Add a 'print_auxv_entry' method for FreeBSD ABIs that parses
FreeBSD-specific auxiliary vector entries and outputs a suitable
description using fprint_auxv_entry.

gdb/ChangeLog:

	* fbsd-tdep.c: Include "auxv.h".
	(fbsd_print_auxv_entry): New function.
	(fbsd_init_abi): Install gdbarch "print_auxv_entry" method.
2016-06-24 10:35:11 -07:00
John Baldwin 2faa34476d Add a new gdbarch method to print a single AUXV entry.
Different platforms have different meanings for auxiliary vector
entries.  The 'print_auxv_entry' gdbarch method allows an architecture
to output a suitable description for platform-specific entries.

A fprint_auxv_entry function is split out of fprint_target_auxv.
This function outputs the description of a single auxiliary vector
entry to the specified file using caller-supplied formatting and
strings to describe the vector type.

The existing switch on auxiliary vector types is moved out of
fprint_target_auxv into a new default_print_auxv_entry function.
default_print_auxv_entry chooses an appropriate format and description
and calls fprint_single_auxv to describe a single vector entry.
This function is used as the default 'print_auxv_entry' gdbarch method.

fprint_target_auxv now invokes the gdbarch 'print_auxv_entry' method
on each vector entry.

gdb/ChangeLog:

	* auxv.c (fprint_auxv_entry): New function.
	(default_print_auxv_entry): New function.
	(fprint_target_auxv): Use gdbarch_print_auxv_entry.
	* auxv.h (enum auxv_format): New enum.
	(fprint_auxv_entry): Declare.
	(default_print_auxv_entry): Declare.
	* gdbarch.sh (print_auxv_entry): New.
	* gdbarch.c, gdbarch.h: Re-generated.
2016-06-24 10:34:29 -07:00
John Baldwin 3350c5f5de Create a pseudo section for the ELF AUXV core dump note on FreeBSD.
The procstat AUXV core dump note in FreeBSD consists of 32-bit integer
followed by an array of auxiliary vector entries.

bfd/ChangeLog:

	* elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PROCSTAT_AUXV
	notes.
2016-06-24 10:33:51 -07:00
John Baldwin 7697fc9ec3 Fetch the ELF auxiliary vector from live processes on FreeBSD.
Use the kern.proc.auxv.<pid> sysctl to fetch the ELF auxiliary vector for
a live process.

gdb/ChangeLog:

	* fbsd-nat.c [KERN_PROC_AUXV] New variable super_xfer_partial.
	(fbsd_xfer_partial): New function.
	(fbsd_nat_add_target) [KERN_PROC_AUXV] Set "to_xfer_partial" to
	"fbsd_xfer_partial".
2016-06-24 10:33:04 -07:00
John Baldwin aa1ed4a93a Add elfcore_grok_freebsd_note to parse FreeBSD ELF core notes.
Move parsing of FreeBSD-specific ELF core notes out of elfcore_grok_note
into a new elfcore_grok_freebsd_note function.  Add core note grok routines
for FreeBSD's psinfo and prstatus notes while here rather than depending
on the native handling in elfcore_grok_note.

bfd/ChangeLog:

	* elf.c (elfcore_grok_note): Remove handling of NT_X86_XSTATE for
	FreeBSD.  Remove case for NT_FREEBSD_THRMISC.
	(elfcore_grok_freebsd_psinfo): New function.
	(elfcore_grok_freebsd_prstatus): New function.
	(elfcore_grok_freebsd_note): New function.
	(elf_parse_notes): Use "elfcore_grok_freebsd_note" for "FreeBSD"
	notes.
2016-06-24 10:32:15 -07:00
John Baldwin b00f86d072 Add constants for FreeBSD-specific auxiliary vector entry types.
include/ChangeLog:

	* elf/common.h (AT_FREEBSD_EXECPATH, AT_FREEBSD_CANARY)
	(AT_FREEBSD_CANARYLEN, AT_FREEBSD_OSRELDATE, AT_FREEBSD_NCPUS)
	(AT_FREEBSD_PAGESIZES, AT_FREEBSD_PAGESIZESLEN)
	(AT_FREEBSD_TIMEKEEP, AT_FREEBSD_STACKPROT): Define.
2016-06-24 10:30:45 -07:00
Joel Brobecker 6e321fa8f8 Add missing ChangeLog entry for "fix undefined reference [...]" commit. 2016-06-24 13:04:56 -04:00
Joel Brobecker 08ce1d723e fix undefined reference to bfd_link_plugin_object_p during link
When configured with the default options, GDB currently fails to link,
due to an undefined reference to bfd_link_plugin_object_p, coming from
elflink.c:

    #ifdef BFD_SUPPORTS_PLUGINS
           || (abfd->plugin_format == bfd_plugin_unknown
              && bfd_link_plugin_object_p (abfd))
    #endif

This is because BFD_SUPPORTS_PLUGINS is always defined. It is its value
that determines whether plugin support is enabled or not.

bfd/ChangeLog:

        * elflink.c: Check the value of BFD_SUPPORTS_PLUGINS rather
        than its existance.
2016-06-24 13:02:39 -04:00
Alan Modra 9cc0123fea MIPS objcopy --rename-section fix
Some MIPS targets use a named section symbol rather than a symbol with
no name as is used with most ELF targets.  When renaming sections, the
named section symbol needs to be renamed too.

Rather than fix this bug, I'd originally intended to just correct the
xfail added recently for update-1.o vs update4.o in update-section.exp,
using the same set of targets for the localize-hidden-1 mips xfail.
I'd extracted that target test into a new function, is_bad_symtab.  It
turns out to be useful in readelf.exp too.

bfd/
	* config.bfd: Delete mips vxworks patterns matched earlier.
	Combine mips*-*-none with mips*-*-elf*.
binutils/
	* objcopy.c (find_section_rename): Forward declare.  Remove
	ibfd and sec_ptr param.  Add old_name param.  Allow for NULL
	returned_flags.  Move read of section name and flags to..
	(setup_section): ..here.  Update find_section_rename call.
	(filter_symbols): Rename section symbols for renamed sections.
	(copy_object): Call filter_symbols when renamed sections.
	* testsuite/lib/binutils-common.exp (is_bad_symtab): New.
	* testsuite/binutils-all/update-section.exp: Revert 96037eb0
	mips xfail.
	* testsuite/binutils-all/objcopy.exp (copy_executable): Use
	is_bad_symtab.
	(localize-hidden-1): xfail if is_bad_symtab.
	* testsuite/binutils-all/readelf.exp: Use is_bad_symtab to select
	between mips/tmips.
2016-06-24 23:26:29 +09:30
Alan Modra 78da3bc1ee aarch64 ld testsuite
Fixes failure on aarch64-rtems.

	* testsuite/ld-aarch64/aarch64-elf.exp (aarch64_choose_ilp32_emul):
	Don't error out, always return an emulation.
2016-06-24 23:05:48 +09:30
Alan Modra 5c0ff16372 alpha-openbsd build failure
This target doesn't build, due to a missing gas/config/te-obsd.h file.
It's been that way since the commit switching to elf, in 2002.
https://lists.gnu.org/archive/html/bug-gnu-utils/2002-07/msg00128.html

	* configure.tgt (alpha-*-openbsd*): Use em=nbsd.
2016-06-24 23:05:48 +09:30
Alan Modra 43339b1d1c Limit objdump -S context lines
Showing context lines is confusing in many cases, an obvious example
being loops.

	* objdump.c (struct print_file_list): Add "max_printed".
	(try_print_file_open): Init new field.
	(show_line): Don't show 5 context lines when redisplaying source.
2016-06-24 23:05:48 +09:30
H.J. Lu da4463c7d7 Check DEFAULT_LD_Z_RELRO for -z relro help message
* lexsup.c (elf_shlib_list_options): Check DEFAULT_LD_Z_RELRO
	for -z relro help message.
2016-06-24 05:21:43 -07:00
Tom Tromey 8b302db80c Move logic out of symbol_find_demangled_name
This patch moves most of the demangling logic out of
symbol_find_demangled_name into the various language_defn objects.

The simplest way to do this seemed to be to add a new method to
language_defn.  This is shame given the existing la_demangle, but
given Ada's unusual needs, and the differing demangling options
between languages, la_demangle didn't seem to fit.

In order to make this work, I made enum language order-sensitive.
This helps preserve the current ordering of demangling operations.

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

	* symtab.c (symbol_find_demangled_name): Loop over languages and
	use language_sniff_from_mangled_name.
	* rust-lang.c (rust_sniff_from_mangled_name): New function.
	(rust_language_defn): Update.
	* p-lang.c (pascal_language_defn): Update.
	* opencl-lang.c (opencl_language_defn): Update.
	* objc-lang.c (objc_sniff_from_mangled_name): New function.
	(objc_language_defn): Update.
	* m2-lang.c (m2_language_defn): Update.
	* language.h (struct language_defn) <la_sniff_from_mangled_name>: New
	field.
	(language_sniff_from_mangled_name): Declare.
	* language.c (language_sniff_from_mangled_name): New function.
	(unknown_language_defn, auto_language_defn, local_language_defn):
	Update.
	* jv-lang.c (java_sniff_from_mangled_name): New function.
	(java_language_defn): Use it.
	* go-lang.c (go_sniff_from_mangled_name): New function.
	(go_language_defn): Use it.
	* f-lang.c (f_language_defn): Update.
	* defs.h (enum language): Reorder.
	* d-lang.c (d_sniff_from_mangled_name): New function.
	(d_language_defn): Use it.
	* cp-support.h (gdb_sniff_from_mangled_name): Declare.
	* cp-support.c (gdb_sniff_from_mangled_name): New function.
	* c-lang.c (c_language_defn, cplus_language_defn)
	(asm_language_defn, minimal_language_defn): Update.
	* ada-lang.c (ada_sniff_from_mangled_name): New function.
	(ada_language_defn): Use it.
2016-06-23 21:11:48 -06:00
Tom Tromey 56618e20bc Move filename extensions into language_defn
This moves filename extensions from a function in symfile.c out to
each language_defn.  I think this is an improvement because it means
less digging around when writing a new language port.

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

	* ada-lang.c (ada_extensions): New array.
	(ada_language_defn): Use it.
	* c-lang.c (c_extensions): New array.
	(c_language_defn): Use it.
	(cplus_extensions): New array.
	(cplus_language_defn): Use it.
	(asm_extensions): New array.
	(asm_language_defn): Use it.
	(minimal_language_defn): Update.
	* d-lang.c (d_extensions): New array.
	(d_language_defn): Use it.
	* f-lang.c (f_extensions): New array.
	(f_language_defn): Use it.
	* go-lang.c (go_language_defn): Update.
	* jv-lang.c (java_extensions): New array.
	(java_language_defn): Use it.
	* language.c (add_language): Call add_filename_language.
	(unknown_language_defn, auto_language_defn, local_language_defn):
	Update.
	* language.h (struct language_defn) <la_filename_extensions>: New
	field.
	* m2-lang.c (m2_language_defn): Update.
	* objc-lang.c (objc_extensions): New array.
	(objc_language_defn): Use it.
	* opencl-lang.c (opencl_language_defn): Update.
	* p-lang.c (p_extensions): New array.
	(pascal_language_defn): Use it.
	* rust-lang.c (rust_extensions): New array.
	(rust_language_defn): Use it.
	* symfile.c (add_filename_language): No longer static.  Make "ext"
	const.
	(init_filename_language_table): Remove.
	(_initialize_symfile): Update.
	* symfile.h (add_filename_language): Declare.
2016-06-23 21:11:47 -06:00
Tom Tromey 3fcf0b0d5a Use VEC for filename_language_table
This patch changes filename_language_table to be a VEC.  This seemed
like a reasonable cleanup over the old code.

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

	* symfile.c (filename_language_table): Now a VEC.
	(fl_table_size, fl_table_next): Remove.
	(add_filename_language): Use VEC_safe_push.
	(set_ext_lang_command, info_ext_lang_command)
	(deduce_language_from_filename): Use VEC_iterate.
	(init_filename_language_table): Use VEC_empty.
2016-06-23 21:11:46 -06:00
Tom Tromey 0c72ed4ca2 Make gdbpy_parameter static
While working on the next patch in this series, I noticed that
gdbpy_parameter did not need to be exported.  This makes it "static".

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

	* python/python.c (gdbpy_parameter): Now static.
	* python/python-internal.h (gdbpy_parameter): Don't declare.
2016-06-23 20:44:48 -06:00
GDB Administrator 5153607fc6 Automatic date update in version.in 2016-06-24 00:00:15 +00:00
Cary Coutant 3ca25b560a Fix bug with grouping sections.
The fix for PR 15370 did not correctly check all patterns in a group,
but instead threw all unassigned sections into the group. This patch
fixes that.

2016-06-23  Cary Coutant  <ccoutant@gmail.com>
	    Igor Kudrin  <ikudrin@accesssoftek.com>

gold/
	PR gold/15370
	* script-sections.cc
	(Output_section_element_input::set_section_addresses): Keep bin_count
	separate from input_pattern_count.
	* testsuite/script_test_12.t: Add another section .x4.
	* testsuite/script_test_12i.t: Likewise.
	* testsuite/script_test_12a.c: Likewise.
	* testsuite/script_test_12b.c: Likewise.
2016-06-23 09:45:25 -07:00
Igor Kudrin 2ec060b71c Fix compilation error in MSYS2 environment.
gold/
	* gold-threads.cc (impl_threads::Lock_impl_threads): Fix typos.
2016-06-23 08:50:18 -07:00
Tom Tromey 17621150cc PR gdb/16483 - simplify "info frame-filters" output
PR gdb/16483 notes that the output of "info frame-filters" is quite
voluminous.  In particular it prints an entry for each objfile, even if
only to say that the objfile does not have any associated frame filters.

I think it's better to only print output when there is a frame filter.
There's nothing worth doing with the no-frame-filter information, and
limiting the output makes it much more readable.

Built and regtested on x86-64 Fedora 23.

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

	PR gdb/16483:
	* python/lib/gdb/command/frame_filters.py
	(InfoFrameFilter.list_frame_filters): Rename to print_list.  Print
	nothing if no filters found.  Return value indicating whether
	filters were printed.
	(InfoFrameFilter.print_list): Remove.
	(InfoFrameFilter.invoke): Print message if no frame filters
	found.

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

	PR gdb/16483:
	* gdb.python/py-framefilter.exp: Add "info frame-filter" test
	before any filters are loaded.
2016-06-23 07:56:35 -06:00
Maciej W. Rozycki 0e9c5a5c99 MIPS/GAS: Keep the original microMIPS symbol reference in branch relocs
Keep original microMIPS symbols in references from branch relocations so
that the ISA bit is retained and can be verified for validity in static
link.  No need to update WRT MIPS16 symbols because we keep them all
anyway for other reasons.

	gas/
	* config/tc-mips.c (b_reloc_p): New function.
	(mips_fix_adjustable): Also keep the original microMIPS symbol
	referred from branch relocations.
	* testsuite/gas/mips/branch-local-1.d: New test.
	* testsuite/gas/mips/branch-local-n32-1.d: New test.
	* testsuite/gas/mips/branch-local-n64-1.d: New test.
	* testsuite/gas/mips/micromips@branch-misc-4-64.d: Update
	relocations.
	* testsuite/gas/mips/branch-local-1.s: New test source.
	* testsuite/gas/mips/mips.exp: Run the new cases.
2016-06-23 12:23:32 +01:00
Graham Markall ce440d638d [ARC] Misc minor edits/fixes
The code supporting -mspfp, -mdpfp, and -mfpuda options are in
sections of code that are commented as being for backward
compatibility only, and having no effect. However, they do have an
effect, enabling the SPX, DPX, and DPA instruction subclasses
respectively. This commit moves the code supporting these options
away from the comments indicating that they are dummy options, and
also fixes a small issue where -mnps400 had the additional effect
of enabling SPX instructions.

A couple of other minor edits (that make no functional change) are
also included.

gas/ChangeLog:

        * config/tc-arc.c (options, md_longopts, md_parse_option):
        Move -mspfp, -mdpfp and -mfpuda out of the sections for
        dummy options. Correct erroneous enabling of SPFP
        instructions when using -mnps400.

include/ChangeLog:

        * opcode/arc.h: Make insn_class_t alphabetical again.

opcodes/ChangeLog:

        * arc-opc.c: Correct description of availability of NPS400
        features.
2016-06-23 09:57:42 +01:00
GDB Administrator f215c83b5f Automatic date update in version.in 2016-06-23 00:00:23 +00:00
Maciej W. Rozycki 4041bc9b02 MIPS/LD/testsuite: Use wildcard address matching in `undefweak-overflow'
So that test case updates result in legible dump pattern changes.

	ld/
	* testsuite/ld-mips-elf/undefweak-overflow.d: Use wildcard
	address matching.
2016-06-23 00:46:16 +01:00
Maciej W. Rozycki 4861b80420 MIPS/LD/testsuite: Uniquely identify `undefweak-overflow' tests
ld/
	* testsuite/ld-mips-elf/mips-elf.exp: Uniquely identify
	`undefweak-overflow' tests.
2016-06-23 00:43:14 +01:00
Maciej W. Rozycki 8cec2cfe27 MIPS/GAS: Handle resolved R6 PC-relative relocations (ChangeLog)
Add missing ChangeLog entry for commit 41947d9e38 ("MIPS/GAS: Handle
resolved R6 PC-relative relocations").
2016-06-23 00:33:07 +01:00
Peter Bergner 6fd3a02da5 Add support for yet some more new ISA 3.0 instructions.
opcodes/
	* ppc-opc.c (RM, DRM, VXASH, VXASH_MASK, XMMF, XMMF_MASK): New defines.
	(powerpc_opcodes) <brd, brh, brw, mffsce, mffscdrn, mffscdrni,
	mffscrn, mffscrni, mffsl, nandxor, rldixor, setbool,
	xor3>: New mnemonics.
	<setb>: Change to a VX form instruction.
	(insert_sh6): Add support for rldixor.
	(extract_sh6): Likewise.

gas/
	* testsuite/gas/ppc/power9.d <brd, brh, brw, mffs, mffs., mffsce,
	mffscdrn, mffscdrni, mffscrn, mffscrni, mffsl, nandxor, rldixor,
	setbool, xor3>: New tests.
	* testsuite/gas/ppc/power9.s: Likewise.
2016-06-22 17:55:17 -05:00
Trevor Saunders 6b4778968b addmore extern C
opcodes/ChangeLog:

2016-06-22  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* arc-ext.h: Wrap in extern C.

include/ChangeLog:

2016-06-22  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* elf/dlx.h: Wrap in extern C.
	* elf/xtensa.h: Likewise.
	* opcode/arc.h: Likewise.
2016-06-22 12:59:58 -04:00
Nick Clifton 96037eb0b8 Fix various binutils testsuite failures.
* testsuite/binutils-all/ar.exp: Skip tests for Alpha target.
	Skip bfdtest1 tests for tic30 target.
	* testsuite/binutils-all/arm/objdump.exp: Skip for aout arm
	target.
	* testsuite/binutils-all/compress.exp: Expect some tests to fail
	on the nds32.
	* testsuite/binutils-all/copy-3.d: Skip for go32 targets.
	* testsuite/binutils-all/copy-4.d: Skip for AIX and linuxecoff
	targets.
	* testsuite/binutils-all/nm.exp: Treat beos based targets as ELF
	targets.
	* testsuite/binutils-all/objcopy.exp: Only run reverse bytes tests
	if the bintest.o file was created.  Use the
	get_standard_section_names proc to get the name of the data
	section.
	* testsuite/binutils-all/objdump.exp: Update regexps to allow for
	RX section names.
	* testsuite/binutils-all/readelf.exp: Use
	get_standard_section_names proc to get the name of the data
	section.
	* testsuite/binutils-all/readelf.r: Allow for non standard text
	section names.
	* testsuite/binutils-all/readelf.s: Update regexps for tilepro.
	* testsuite/binutils-all/size.exp: Allow for non standard section
	names.
	* testsuite/binutils-all/update-section.exp: Expect comapre 1vs4
	to fail on mips targets.
	* testsuite/lib/utils-lib.exp (default_binutils_run): Use
	get_standard_section_names proc.
	(run_dump_test): Likewise.
	(proc get_standard_section_names): New proc.
2016-06-22 14:42:26 +01:00
H.J. Lu 6b1edb94fe gold: Add a linker configure option --enable-relro
Add a configure option --enable-relro to decide whether -z relro should
be enabled by default.  Default to yes.

	PR ld/20283
	* NEWS: Mention --enable-relro.
	* configure.ac: Add --enable-relro.
	(DEFAULT_LD_Z_RELRO): New.  Set by --enable-relro and default
	to 1.
	* config.in: Regenerated.
	* configure: Likewise.
	* options.h (General_options::relro): Default to
	DEFAULT_LD_Z_RELRO.
2016-06-22 05:39:39 -07:00
H.J. Lu 647e4d4649 ld: Add a linker configure option --enable-relro
Add a configure option --enable-relro to decide whether -z relro should
be enabled in ELF linker by default.  Default to yes for all Linux
targets, except FRV, HPPA, IA64 and MIPS, since many relro tests fail
on these targets.

	PR ld/20283
	* NEWS: Mention --enable-relro.
	* configure.ac: Add --enable-relro.
	(DEFAULT_LD_Z_RELRO): New.  Set by --enable-relro.
	* configure.tgt (ac_default_ld_z_relro): Default it to 1 for
	some Linux targets.
	* config.in: Regenerated.
	* configure: Likewise.
	* emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Set
	link_info.relro to DEFAULT_LD_Z_RELRO.
	* testsuite/config/default.exp (ld_elf_shared_opt): New.
	* testsuite/lib/ld-lib.exp (run_dump_test): Pass
	$ld_elf_shared_opt to ld for ELF targets with shared object
	support.
	(run_ld_link_tests): Likewise.
2016-06-22 05:37:38 -07:00
Trevor Saunders 6edaf4d75b tilegx: move TILEGX_NUM_PIPELINE_ENCODINGS to tilegx_pipeline enum
Its closely related to what the encodings are, more than a set of random
constants, so it seems to make sense to put it here.

include/ChangeLog:

2016-06-22  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* opcode/tilegx.h: Move TILEGX_NUM_PIPELINE_ENCODINGS into
	tilegx_pipeline.
2016-06-22 05:14:08 -04:00