aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-06-24Support structure offsets that are 512K or larger.David Taylor38-194/+328
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-25Automatic date update in version.inGDB Administrator1-1/+1
2016-06-25MIPS16/GAS: Restore unsupported relocation diagnosticsMaciej W. Rozycki77-63/+1227
Correct a MIPS16 relocation handling regression in GAS introduced with: commit 177b4a6ad0047c8995fbc55016bc4f4b68d53b4a 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-24Add myself as a Write After Approval maintainer.David Taylor2-0/+5
2016-06-24Add support for catching system calls to native FreeBSD targets.John Baldwin8-1/+523
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-24Add a gdbarch 'print_auxv_entry' method for FreeBSD ABIs.John Baldwin2-0/+41
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-24Add a new gdbarch method to print a single AUXV entry.John Baldwin6-87/+178
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-24Create a pseudo section for the ELF AUXV core dump note on FreeBSD.John Baldwin2-0/+19
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-24Fetch the ELF auxiliary vector from live processes on FreeBSD.John Baldwin2-0/+83
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-24Add elfcore_grok_freebsd_note to parse FreeBSD ELF core notes.John Baldwin2-9/+139
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-24Add constants for FreeBSD-specific auxiliary vector entry types.John Baldwin2-0/+17
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-24Add missing ChangeLog entry for "fix undefined reference [...]" commit.Joel Brobecker1-0/+5
2016-06-24fix undefined reference to bfd_link_plugin_object_p during linkJoel Brobecker1-2/+2
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-24MIPS objcopy --rename-section fixAlan Modra8-44/+81
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-24aarch64 ld testsuiteAlan Modra2-10/+13
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-24alpha-openbsd build failureAlan Modra2-2/+5
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-24Limit objdump -S context linesAlan Modra2-2/+17
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-24Check DEFAULT_LD_Z_RELRO for -z relro help messageH.J. Lu2-1/+14
* lexsup.c (elf_shlib_list_options): Check DEFAULT_LD_Z_RELRO for -z relro help message.
2016-06-23Move logic out of symbol_find_demangled_nameTom Tromey18-97/+223
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-23Move filename extensions into language_defnTom Tromey16-55/+132
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-23Use VEC for filename_language_tableTom Tromey2-33/+46
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-23Make gdbpy_parameter staticTom Tromey3-2/+6
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-24Automatic date update in version.inGDB Administrator1-1/+1
2016-06-23Fix bug with grouping sections.Cary Coutant6-6/+23
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-23Fix compilation error in MSYS2 environment.Igor Kudrin2-3/+7
gold/ * gold-threads.cc (impl_threads::Lock_impl_threads): Fix typos.
2016-06-23PR gdb/16483 - simplify "info frame-filters" outputTom Tromey4-32/+45
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-23MIPS/GAS: Keep the original microMIPS symbol reference in branch relocsMaciej W. Rozycki8-13/+161
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[ARC] Misc minor edits/fixesGraham Markall6-42/+57
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-23Automatic date update in version.inGDB Administrator1-1/+1
2016-06-23MIPS/LD/testsuite: Use wildcard address matching in `undefweak-overflow'Maciej W. Rozycki2-20/+25
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-23MIPS/LD/testsuite: Uniquely identify `undefweak-overflow' testsMaciej W. Rozycki2-2/+9
ld/ * testsuite/ld-mips-elf/mips-elf.exp: Uniquely identify `undefweak-overflow' tests.
2016-06-23MIPS/GAS: Handle resolved R6 PC-relative relocations (ChangeLog)Maciej W. Rozycki1-0/+19
Add missing ChangeLog entry for commit 41947d9e38c4 ("MIPS/GAS: Handle resolved R6 PC-relative relocations").
2016-06-22Add support for yet some more new ISA 3.0 instructions.Peter Bergner5-5/+113
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-22addmore extern CTrevor Saunders6-0/+42
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-22Fix various binutils testsuite failures.Nick Clifton15-82/+179
* 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-22gold: Add a linker configure option --enable-relroH.J. Lu6-1/+57
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-22ld: Add a linker configure option --enable-relroH.J. Lu9-4/+112
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-22tilegx: move TILEGX_NUM_PIPELINE_ENCODINGS to tilegx_pipeline enumTrevor Saunders2-3/+6
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-22xtensa: include elf/xtensa.h in tc-xtensa.cTrevor Saunders2-4/+5
There's no reason to define these macros twice. gas/ChangeLog: 2016-06-22 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * config/tc-xtensa.c: Include elf/xtensa.h.
2016-06-22Increase size of string buffer used to hold printed versions of timestamps.Nick Clifton2-3/+9
binutils* readelf.c (dynamic_section_mips_val): Increase size of timebuf. (process_mips_specific): Likewise. (process_gnu_liblist): Likewise.
2016-06-22Automatic date update in version.inGDB Administrator1-1/+1
2016-06-21MIPS/GAS: Handle resolved R6 PC-relative relocationsMaciej W. Rozycki10-8/+427
Complement commit 7361da2c952e ("Add support for MIPS R6.") and fix internal errors like: foo.s: Assembler messages: foo.s: Internal error! Assertion failure in md_apply_fix at .../gas/config/tc-mips.c:15028. Please report this bug. triggered by resolved R6 PC-relative relocations in sources containing R6 code fragments wrapped into ISA override blocks embedded within code otherwise assembled for an older ISA. gas/ * config/tc-mips.c (calculate_reloc) <BFD_RELOC_HI16_S_PCREL> <BFD_RELOC_LO16_PCREL>: New switch cases. (md_apply_fix) <BFD_RELOC_HI16_S_PCREL, BFD_RELOC_LO16_PCREL>: Move switch cases along `BFD_RELOC_MIPS_JMP'. <BFD_RELOC_MIPS_21_PCREL_S2, BFD_RELOC_MIPS_26_PCREL_S2> <BFD_RELOC_MIPS_18_PCREL_S3, BFD_RELOC_MIPS_19_PCREL_S2>: Handle the resolved case. * testsuite/gas/mips/pcrel-reloc-4.d: New test. * testsuite/gas/mips/pcrel-reloc-4-r6.d: New test. * testsuite/gas/mips/pcrel-reloc-5.d: New test. * testsuite/gas/mips/pcrel-reloc-5-r6.d: New test. * testsuite/gas/mips/pcrel-reloc-6.d: New test. * testsuite/gas/mips/pcrel-reloc-6.l: New list test. * testsuite/gas/mips/pcrel-reloc-4.s: New test source. * testsuite/gas/mips/pcrel-reloc-6.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests.
2016-06-21MIPS/GAS: Fix null pointer dereferences in R6 PC-relative relocation checksMaciej W. Rozycki2-2/+8
Avoid segmentation faults in alignment checks made in `md_apply_fix' for BFD_RELOC_MIPS_18_PCREL_S3 and BFD_RELOC_MIPS_19_PCREL_S2 relocations caused by dereferencing `fixP->fx_addsy' which will be null if the relocation processed has been fully resolved. gas/ * config/tc-mips.c (md_apply_fix) <BFD_RELOC_MIPS_18_PCREL_S3> <BFD_RELOC_MIPS_19_PCREL_S2>: Avoid null pointer dereferences via `fixP->fx_addsy'.
2016-06-21MIPS/GAS: Correct BFD_RELOC_MIPS_18_PCREL_S3 calculationMaciej W. Rozycki2-1/+21
The PC-relative R_MIPS_PC18_S3 relocation and consequently its BFD internal BFD_RELOC_MIPS_18_PCREL_S3 representation is calculated from the address of the aligned doubleword containing the location being relocated: (sign_extend(A) + S - (P & ~0x7)) >> 3 rather than the address of the location itself. Reflect this in calculations made by GAS so that the relocated field is set correctly if resolved by GAS, such as with local symbols in the same section which do not require relocations to be propagated to the link stage. gas/ * config/tc-mips.c (md_pcrel_from) <BFD_RELOC_MIPS_18_PCREL_S3>: Calculate relocation from the containing aligned doubleword. (tc_gen_reloc) <BFD_RELOC_MIPS_18_PCREL_S3>: Calculate the addend from the containing aligned doubleword.
2016-06-21MIPS/GAS: Use the module level ISA setting for R6 relaxationMaciej W. Rozycki10-2/+112
Use the module level ISA setting rather than the last ISA selected with a `.set' directive in the source file in determination as to whether to keep PC-relative relocations and then with the original symbol referred, for the purpose of R6 linker relaxation. This is so that with e.g. code like this: b foo .set mips32r2 ... it's the command line options or any `.module' directive that decides how to encode any relocation for `foo' rather than the presence of `.set mips32r2'. gas/ * config/tc-mips.c (mips_force_relocation): Use `file_mips_opts' rather than `mips_opts' for the R6 ISA check. (mips_fix_adjustable): Likewise. * testsuite/gas/mips/pcrel-reloc-1.d: New test. * testsuite/gas/mips/pcrel-reloc-1-r6.d: New test. * testsuite/gas/mips/pcrel-reloc-2.d: New test. * testsuite/gas/mips/pcrel-reloc-2-r6.d: New test. * testsuite/gas/mips/pcrel-reloc-3.d: New test. * testsuite/gas/mips/pcrel-reloc-3-r6.d: New test. * testsuite/gas/mips/pcrel-reloc-1.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests.
2016-06-21MIPS/BFD: Don't stop processing on a cross-mode jump conversion errorMaciej W. Rozycki5-8/+27
As with commit ed53407eec9e ("MIPS/BFD: Don't stop processing on `bfd_reloc_outofrange'") don't bail out right away and instead continue processing on a cross-mode jump conversion error, so that any further issues are also reported. Adjust message formatting accordingly, using `%X' to abort processing at conclusion. Remove the full stop from the end of the message, for consistency across error reporting. Adjust the corresponding test case accordingly and make it trigger the error twice. bfd/ * elfxx-mips.c (mips_elf_perform_relocation): Call `info->callbacks->einfo' rather than `*_bfd_error_handler' and use the `%X%H' format for the cross-mode jump conversion error message. Remove the full stop from the end of the message. Continue processing rather than returning failure. ld/ * testsuite/ld-mips-elf/mode-change-error-1a.s: Trigger an error twice rather than once. * testsuite/ld-mips-elf/mode-change-error-1.d: Adjust accordingly. Remove the full stop from the end of the message.
2016-06-21Improve user experience in printing Fortran derived types.Walfred Tedeschi7-13/+145
Output for Fortran derived classes is like: "( 9, 'abc')" with this changes the output is changed to: "( lucky_number = 9, letters = 'abc')" 2016-06-21 Walfred Tedeschi <walfred.tedeschi@intel.com> * f-valprint.c (f_val_print): Add field names for printing derived types fields. gdb/testsuite: * gdb.fortran/derived-type.exp (print q): Add fields to the output. * gdb.fortran/vla-type.exp (print twov): Fix vla tests with structs. * gdb.fortran/derived-type-function.exp: New file. * gdb.fortran/derived-type-function.f90: New file.
2016-06-21Arc assembler: Convert nps400 from a machine type to an extension.Graham Markall33-316/+433
gas * config/tc-arc.c (check_cpu_feature, md_parse_option): Add nps400 option and feature. Add check for nps400 feature. Refactor existing checks to check subclass before feature enablement. (md_show_usage): Document flags for NPS-400 and add some other undocumented flags. (cpu_type): Remove nps400 CPU type entry (check_zol): Remove bfd_mach_arc_nps400 case. (md_show_usage): Add help on -mcpu=nps400. (cpu_types): Add entry for nps400 as arc700 plus nps400 extension set. * doc/c-arc.texi: Document the -mnps400, -mspfp, -mdpfp, and -fpuda flags. Document -mcpu=nps400. * testsuite/gas/arc/nps-400-0.d: Use -mcpu=arc700 -mnps400. Change expected flags to match ARC700 instead of NPS400. * testsuite/gas/arc/nps-400-1.d: Use -mcpu=arc700 -mnps400. * testsuite/gas/arc/nps-400-2.d: Likewise. * testsuite/gas/arc/nps-400-3.d: Likewise. * testsuite/gas/arc/nps-400-4.d: Likewise. * testsuite/gas/arc/nps-400-5.d: Likewise. * testsuite/gas/arc/nps-400-6.d: Likewise. * testsuite/gas/arc/nps-400-7.d: Likewise. * testsuite/gas/arc/textinsn2op01.s: Change opcode of myinsn to avoid clash with cbba instruction. * testsuite/gas/arc/textinsn2op01.d: Likewise. * testsuite/gas/arc/textinsn3op.d: Likewise. * testsuite/gas/arc/textinsn3op.s: Likewise. * testsuite/gas/arc/nps-400-0.d: Test using NPS-400 using -mcpu=nps400 as an alternative to -mcpu=arc700 -mnps400 flags. binutils* readelf.c (decode_ARC_machine_flags): Remove E_ARC_MACH_NPS400 case. ld * testsuite/ld-arc/nps-1a.d: Use -mcpu=arc700 -mnps400. * testsuite/ld-arc/nps-1b.d: Likewise. include * opcode/arc.h: Add nps400 extension and instruction subclass. Remove ARC_OPCODE_NPS400 * elf/arc.h: Remove E_ARC_MACH_NPS400 opcodes * arc-dis.c (arc_insn_length): Add comment on instruction length. Use same method for determining instruction length on ARC700 and NPS-400. (arc_insn_length, print_insn_arc): Remove bfd_mach_arc_nps400. * arc-nps400-tbl.h: Make all nps400 instructions ARC700 instructions with the NPS400 subclass. * arc-opc.c: Likewise. bfd * archures.c: Remove bfd_mach_arc_nps400. * bfd-in2.h: Likewise. * cpu-arc.c (arch_info_struct): Likewise. * elf32-arc.c (arc_elf_object_p, arc_elf_final_write_processing): Likewise.
2016-06-21S390 gdbserver: Mark local funcs/vars as staticAndreas Arnez2-14/+31
Compiling with '-Wmissing-declarations' yields warnings in linux-s390-low.c. To fix this, mark appropriate functions as static. gdb/gdbserver/ChangeLog: * linux-s390-low.c (s390_emit_eq_goto): Mark function static. (s390_emit_ne_goto): Likewise. (s390_emit_lt_goto): Likewise. (s390_emit_le_goto): Likewise. (s390_emit_gt_goto): Likewise. (s390_emit_ge_goto): Likewise. (s390x_emit_eq_goto): Likewise. (s390x_emit_ne_goto): Likewise. (s390x_emit_lt_goto): Likewise. (s390x_emit_le_goto): Likewise. (s390x_emit_gt_goto): Likewise. (s390x_emit_ge_goto): Likewise. (s390_emit_ops_impl): Mark variable static. (s390x_emit_ops): Likewise.
2016-06-21S390: Fix typo "s930" -> "s390"Andreas Arnez2-1/+6
This fixes a typo in the name of the "last-break" regset. gdb/ChangeLog: * s390-linux-tdep.c (s390_iterate_over_regset_sections): Fix typo in name of last-break regset.