aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-02-17Rename target descriptions to reflect actual content of description.Michael Sturm33-166/+174
To better reflect the actual feature set covered by the IA target descriptions, the existing descriptions are renamed. Each feature of the extended state is added to the name of a description or xstate mask starting from AVX. For example, amd64-mpx-avx512-linux becomes amd64-avx-mpx-avx512-linux, while amd64-avx-linux remains unchanged. Likewise, the corresponding xstate masks are changed, e.g. from X86_XSTATE_MPX_AVX512_MASK to X86_XSTATE_AVX_MPX_AVX512_MASK. gdb/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * amd64-linux-tdep.c (features/i386/amd64-avx512-linux.c): Rename include to... (features/i386/amd64-avx-mpx-avx512-linux.c): ...this. (features/i386/x32-avx512-linux.c): Rename include to... (features/i386/x32-avx-mpx-avx512-linux.c): ...this. (amd64_linux_core_read_description): Rename X86_XSTATE_MPX_AVX512_MASK, X86_XSTATE_AVX512_MASK, desc_x32_avx512_linux, tdesc_amd64_avx512_linux. (_initialize_amd64_linux_tdep): Rename initialize_tdesc_amd64_avx512_linux, initialize_tdesc_x32_avx512_linux. * amd64-linux-tdep.h (tdesc_amd64_avx512_linux): Rename to... (tdesc_amd64_avx_mpx_avx512_linux): ...this. (tdesc_x32_avx512_linux): Rename to... (tdesc_x32_avx_mpx_avx512_linux): ...this. * amd64-tdep.c (features/i386/amd64-avx512.c): Rename include to... (features/i386/amd64-avx-mpx-avx512.c): ...this. (features/i386/x32-avx512.c): Rename include to... (features/i386/x32-avx-mpx-avx512.c): ...this. (amd64_target_description): Rename X86_XSTATE_MPX_AVX512_MASK, X86_XSTATE_AVX512_MASK, tdesc_amd64_avx512. (_initialize_amd64_tdep): Rename initialize_tdesc_amd64_avx512. Rename initialize_tdesc_x32_avx512. * common/x86-xstate.h (X86_XSTATE_AVX512_MASK): Rename to... (X86_XSTATE_AVX_AVX512_MASK): ...this. (86_XSTATE_MPX_AVX512_MASK): Rename to... (X86_XSTATE_AVX_MPX_AVX512_MASK): ...this. (X86_XSTATE_ALL_MASK): Rename X86_XSTATE_MPX_AVX512_MASK to X86_XSTATE_AVX_MPX_AVX512_MASK. * features/Makefile (WHICH): Rename i386/i386-avx512, i386/i386-avx512-linux, i386/amd64-avx512, i386/amd64-avx512-linux, i386/x32-avx512, i386/x32-avx512-linux. (i386/i386-avx512-expedite, i386/i386-avx512-linux-expedite, i386/amd64-avx512-expedite, i386/amd64-avx512-linux-expedite, i386/x32-avx512-expedite, i386/x32-avx512-linux-expedite): Rename expedites. (XMLTOC): Rename i386/amd64-avx512-linux.xml, i386/amd64-avx512.xml, i386/i386-avx512-linux.xml, i386/i386-avx512.xml, i386/x32-avx512-linux.xml, i386/x32-avx512.xml. ($(outdir)/i386/i386-avx512.dat): Rename dat file in rule. ($(outdir)/i386/i386-avx512-linux.dat): Likewise. ($(outdir)/i386/amd64-avx512.dat): Likewise. ($(outdir)/i386/amd64-avx512-linux.dat): Likewise. ($(outdir)/i386/x32-avx512.dat): Likewise. ($(outdir)/i386/x32-avx512-linux.dat): Likewise. * features/i386/amd64-avx512-linux.c: Regenerate from renamed XML file. * features/i386/amd64-avx512-linux.xml: Rename XML file. * features/i386/amd64-avx512.c: Regenerate from renamed XML file. * features/i386/amd64-avx512.xml: Rename XML file. * features/i386/i386-avx512-linux.c: Regenerate from renamed XML file. * features/i386/i386-avx512-linux.xml: Rename XML file. * features/i386/i386-avx512.c: Regenerate from renamed XML file. * features/i386/i386-avx512.xml: Rename XML file. * features/i386/x32-avx512-linux.c: Regenerate from renamed XML file. * features/i386/x32-avx512-linux.xml: Rename XML file. * features/i386/x32-avx512.c: Regenerate from renamed XML file. * features/i386/x32-avx512.xml: Rename XML file. * i386-linux-tdep.c (features/i386/i386-avx512-linux.c): Rename to... (features/i386/i386-avx-mpx-avx512-linux.c): ...this. (i386_linux_core_read_description): Rename X86_XSTATE_MPX_AVX512_MASK, X86_XSTATE_AVX512_MASK, tdesc_i386_avx512_linux. (_initialize_i386_linux_tdep): Rename initialize_tdesc_i386_avx512_linux. * i386-linux-tdep.h (tdesc_i386_avx512_linux): Rename to... (tdesc_i386_avx_mpx_avx512_linux): ...this. * i386-tdep.c (features/i386/i386-avx512.c): Rename to... (features/i386/i386-avx-mpx-avx512.c): ...this. (i386_register_reggroup_p): Rename X86_XSTATE_AVX512_MASK. (i386_validate_tdesc_p): Likewise. (i386_target_description): Rename X86_XSTATE_MPX_AVX512_MASK, tdesc_i386_avx512. (_initialize_i386_tdep): Rename initialize_tdesc_i386_avx512. * regformats/i386/amd64-avx512-linux.dat: Regenerate from renamed XML file. * regformats/i386/amd64-avx512.dat: Likewise. * regformats/i386/i386-avx512-linux.dat: Likewise. * regformats/i386/i386-avx512.dat: Likewise. * regformats/i386/x32-avx512-linux.dat: Likewise. * regformats/i386/x32-avx512.dat: Likewise. * x86-Linux-nat.c (x86_linux_read_description): Rename X86_XSTATE_MPX_AVX512_MASK, X86_XSTATE_AVX512_MASK, tdesc_x32_avx512_linux, tdesc_amd64_avx512_linux, tdesc_i386_avx512_linux. gdbserver/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * Makefile.in (clean): Rename i386-avx512.c, i386-avx512-linux.c, amd64-avx512.c, amd64-avx512-linux.c, x32-avx512.c, x32-avx512-linux.c. (i386-avx512-linux-ipa.o): Rename rule and source files. (amd64-avx512-linux-ipa.o): Likewise. (i386-avx512.c): Rename rule, source fils and dat files. (i386-avx512-linux.c): Likewise. (amd64-avx512.c): Likewise. (amd64-avx512-linux.c): Likewise. (x32-avx512.c): Likewise. (x32-avx512-linux.c): Likewise. * configfure.srv (srv_i386_regobj): Rename i386-avx512.o. (i386_linux_regobj): Rename i386-avx512-linux.o. (srv_amd64_regobj): Rename amd64-avx512.o, x32-avx512.o. (srv_amd64_linux_regobj): Rename amd64-avx512-linux.o, x32-avx512-linux.o. (ipa_i386_linux_regobj): Rename i386-avx512-linux-ipa.o. (ipa_amd64_linux_regobj): Rename amd64-avx512-linux-ipa.o. (srv_i386_xmlfiles): Rename i386/i386-avx512.xml. (srv_amd64_xmlfiles): Rename i386/amd64-avx512.xml, i386/x32-avx512.xml. (srv_i386_linux_xmlfiles): Rename i386/i386-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Rename i386/amd64-avx512-linux.xml, i386/x32-avx512-linux.xml). * linux-amd64-ipa.c (get_ipa_tdesc): Rename X86_TDESC_AVX512 and returned tdesc for that case. (initialize_low_tracepoint): Rename init_registers_amd64_avx512_linux. * linux-i386-ipa.c (get_ipa_tdesc): Rename X86_TDESC_AVX512 and tdesc returned for that case. (initialize_low_tracepoint): Rename init_registers_i386_avx512_linux. * linux-x86-low.c (x86_linux_read_description): Rename X86_XSTATE_AVX512_MASK and tdesc returned for that case. (x86_get_ipa_tdesc_idx): Rename tdesc_amd64_avx512_linux, tdesc_x32_avx512_linux and mask returned for these descriptions. Rename tdesc_i386_avx512_linux and mask returned for that description. (initialize_low_arch): Rename init_registers_amd64_avx512_linux, init_registers_x32_avx512_linux, init_registers_i386_avx512_linux. * linux-x86-tdesc.h (enum x86_linux_tdesc): Rename X86_TDESC_AVX512. (init_registers_amd64_avx512_linux): Rename to... (init_registers_amd64_avx_mpx_avx512_linux): ...this. (tdesc_amd64_avx512_linux): Rename to... (tdesc_amd64_avx_mpx_avx512_linux): ...this. (init_registers_x32_avx512_linux): Rename to... (init_registers_x32_avx_mpx_avx512_linux): ...this. (tdesc_x32_avx512_linux): Rename to... (tdesc_x32_avx_mpx_avx512_linux): ...this. (init_registers_i386_avx512_linux): Rename to... (init_registers_i386_avx_mpx_avx512_linux): ...this. (tdesc_i386_avx512_linux): Rename to... (tdesc_i386_avx_mpx_avx512_linux): ...this. Change-Id: Idb83be3b3b72d5487542d4b568193df2777a3d9d Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2017-02-17Change xstate_bv handling to use 8 bytes of data.Michael Sturm2-16/+25
The size of the state-component bitmap as specified in Intel(R) 64 and IA-32 Architectures Software Developer's Manual, Chapter 13.4.2 is 8 bytes. So far, the data types used for xstate_bv_p (gdb_byte*), clear_bv (unsigned int) and tdep->xcr0 (uint64_t) were inconsistent. But, since the xstate components were still fitting into a single byte, the code still worked as expected. However, with the addition of the PKU feature (bit 9), using one byte for the bitmap will no longer be sufficient. This patch changes related code to use 64 bit data types consistently and changes read/write acces of the XSAVE header in the xsave buffer to use the endianess-aware functions extract_unsigned_integer and store_unsigned_integer. This is required to make sure that eventual differences in endianess between host and target are taken care off. gdb/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * i387-tdep.c (i387_supply_xsave): Change type of clear_bv to ULONGEST. Replace gdb_byte *xstate_bv_p with ULONGEST xstate_bv and use extract_unsigned_integer and store_unsigned_integer to read/write its value from the xsave buffer. (i387_collect_xsave): Replace gdb_byte *xstate_bv_p with ULONGEST initial_xstate_bv and use extract_unsigned_integer/store_unsigned_integer to read/write its value from the xsave buffer. Change type of clear_bv to ULONGEST. gdbserver/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * i387-fp.c (i387_cache_to_xsave): Change type of clear_bv to unsigned long long. (i387_fxsave_to_cache): Likewise. Change-Id: I0de254158960b4f7bcbc9fe2fb857034fa1f7ca5 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2017-02-17Sync up x86-gcc-cpuid.h with cpuid.h from gcc-6 branch.Michael Sturm1-58/+50
Pedro suggested a separate patch synching with GCCs cpuid.h instead of just adding new bits for PKU feature. gdb/Changelog: 2016-11-14 Michael Sturm <michael.sturm@intel.com> * nat/x86-gcc-cpuid.h: Replace with copy of cpuid.h from gcc-6 branch. Change-Id: I16f8f7f2d0aa7c2e815701d15ed831a6c6b33d21 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2017-02-17Relax dwarf2 expected error matchAlan Modra2-0/+6
* testsuite/ld-elf/dwarf2.err: Accept other errors between the multiple definition errors.
2017-02-17Relax dwarf3 expected error matchAlan Modra3-4/+9
* testsuite/ld-elf/dwarf2.err: Add missing newline at end. * testsuite/ld-elf/dwarf3.err: Likewise. Allow match without filename.
2017-02-17bfd: Rename Chunk and S3ForcedPedro Alves3-17/+25
The direct references in objcopy kind of look like a hack to me, so I'm calling these symbols internal too. Certainly they aren't named and documented as a public BFD symbol today anyway. So ... give these bfd-internal symbols with external linkage a _bfd_ prefix to avoid collisions in the global symbol namespace. While at it, give them names that more closely match the corresponding option name that toggles them. Also while at it, fix a few related comment typos. gdb/ChangeLog: 2017-02-17 Pedro Alves <palves@redhat.com> * srec.c (Chunk): Rename to ... (_bfd_srec_len): ... this. (S3Forced): Rename to ... (_bfd_srec_forceS3): ... this. * objcopy.c: Adjust all references.
2017-02-17bfd: Rename bsd_write_armap and coff_write_armapPedro Alves6-22/+35
Give these bfd-internal symbols with external linkage a _bfd_ prefix to avoid collisions in the global symbol namespace. bfd/ChangeLog: 2017-02-17 Pedro Alves <palves@redhat.com> * archive.c (bsd_write_armap): Rename to ... (_bfd_bsd_write_armap): ... this. (coff_write_armap): Rename to ... (_bfd_coff_write_armap): ... this. * libbfd-in.h (bsd_write_armap): Rename to ... (_bfd_bsd_write_armap): ... this. (coff_write_armap): Rename to ... (_bfd_coff_write_armap): ... this. * aout-target.h, aout-tic30.c: Adjust all users. * libbfd.h: Regenerate.
2017-02-17bfd: Rename warn_deprecatedPedro Alves4-14/+23
Give this bfd-internal symbol with external linkage a _bfd_ prefix to avoid collisions in the global symbol namespace. bfd/ChangeLog: 2017-02-17 Pedro Alves <palves@redhat.com> * bfd-in.h (bfd_read, bfd_write): Adjust to rename. (warn_deprecated): Rename to ... (_bfd_warn_deprecated): ... this. * libbfd.c (warn_deprecated): Rename to ... (_bfd_warn_deprecated): ... this. * bfd-in2.h: Regenerate.
2017-02-17bfd: Rename real_{ftell, fseek, fopen}Pedro Alves7-22/+41
Give these bfd-internal symbols with external linkage a _bfd_ prefix to avoid collisions in the global symbol namespace. bfd/ChangeLog: 2017-02-17 Pedro Alves <palves@redhat.com> * bfdio.c (real_ftell): Rename to ... (_bfd_real_ftell): ... this. (real_fseek): Rename to ... (_bfd_real_fseek): ... this. (real_fopen): Rename to ... (_bfd_real_fopen): ... this. * libbfd-in.h (real_ftell): Rename to ... (_bfd_real_ftell): ... this. (real_fseek): Rename to ... (_bfd_real_fseek): ... this. (real_fopen): Rename to ... (_bfd_real_fopen): ... this. * cache.c, dwarf2.c, opncls.c: Adjust all callers. * libbfd.h: Regenerate.
2017-02-17bfd: Rename read_{signed,unsigned}_leb128, safe_read_leb128Pedro Alves7-55/+99
Give these bfd-internal symbols with external linkage a _bfd_ prefix to avoid collisions in the global symbol namespace. bfd/ChangeLog: 2017-02-17 Pedro Alves <palves@redhat.com> * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers. * libbfd.c (read_unsigned_leb128): Rename to ... (_bfd_read_unsigned_leb128): ... this. (read_signed_leb128): Rename to ... (_bfd_read_signed_leb128): ... this. (safe_read_leb128): Rename to ... (_bfd_safe_read_leb128): ... this. * libbfd-in.h (read_unsigned_leb128): Rename to ... (_bfd_read_unsigned_leb128): ... this. (read_signed_leb128): Rename to ... (_bfd_read_signed_leb128): ... this. (safe_read_leb128): Rename to ... (_bfd_safe_read_leb128): ... this. * libbfd.h: Renegerate.
2017-02-17Automatic date update in version.inGDB Administrator1-1/+1
2017-02-16bfd: Improve lookup of file / line information for errorsAndrew Burgess5-6/+49
When looking up file and line information (used from the linker to report error messages) if no symbol is passed in, then use the symbol list to look for a matching symbol. If a matching symbol is found then use this to look up the file / line information. This should improve errors when looking up file / line information for data sections. Hopefully we should find a matching data symbol, which should, in turn (we hope) match a DW_TAG_variable in the DWARF, this should allow us to give accurate file / line errors for data symbols. As the hope is to find a matching DW_TAG_variable in the DWARF then we ignore section symbols, and prefer global symbols to locals. bfd/ChangeLog: * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup before trying to fine matching file and line information. ld/ChangeLog: * testsuite/ld-elf/shared.exp: Update expected results. * testsuite/ld-elf/dwarf2.err: Likewise
2017-02-16bfd/dwarf: Improve use of previously loaded dwarf informationAndrew Burgess9-2/+84
When parsing DWARF data in order to report file/line type error messages we perform section placement to make section addresses unique within relocatable object files. Currently, if we reuse previously loaded (and cached) dwarf data then we neglect to perform section placement, the result is that the section addresses will not be unique, and we might, incorrectly associate an address with the wrong debug information, and so report an incorrect file and line number. Further we neglect to check that that bfd for which we are looking up debug information is actually the bfd for which the previous debug information was loaded, it is possible that we will reuse previously loaded debug information for a different bfd. And finally, due to following of gnu_debuglink links in one bfd to another, the process of checking that the cached debug information is valid requires us to track the original bfd in the cached debug information. The original debug information here is either the bfd that we're interested in, not the bfd we finally load the debug information from. bfd/ChangeLog: * dwarf2.c (struct dwarf2_debug): Add orig_bfd member. (_bfd_dwarf2_slurp_debug_info): If stashed debug information does not match current bfd, then reload debug information. Record bfd we're loading debug info for in the stash. If we have debug informatin in the cache then perform section placement before returning. ld/ChangeLog: * testsuite/ld-elf/dwarf.exp (build_tests): Add new tests. * testsuite/ld-elf/dwarf2.err: New file. * testsuite/ld-elf/dwarf2a.c: New file. * testsuite/ld-elf/dwarf2b.c: New file. * testsuite/ld-elf/dwarf3.c: New file. * testsuite/ld-elf/dwarf3.err: New file.
2017-02-16ld: Add additional checking for warnings/errors in testsuiteAndrew Burgess4-16/+84
This commit adds new actions to the run_cc_link_tests mechanism in the linker testsuite. Previously this procedure could take a parameter containing a regular expression that would be matched against warnings from the linker. After this commit the warnings parameter is removed, instead, the actions list can contain the actions 'warning', 'error', 'warning_output', or 'error_output'. The action names are chosen to match the actions already present in the run_dump_test procedure. These new actions allow for the current warning checking, but also allow for checking of errors using a regular expression. More interestingly, the *_output actions allow for the warning/error patterns to be placed in a separate file. The small number of tests that make use of the warning parameter have been updated to the new mechanism. Later commits will make use of the new features added in this commit. ld/ChangeLog: * testsuite/lib/ld-lib.exp (run_cc_link_tests): Add warning, error, warning_output, and error_output actions. Remove separate warnings parameter. * testsuite/ld-elf/shared.exp (build_tests): Updated to use 'warning' action. * testsuite/ld-plugin/lto.exp (lto_link_tests): Likewise.
2017-02-16ld testsuite function pointer comparisons vs. hppaAlan Modra4-5/+12
ld/testsuite/ld-elf/check-ptr-eq.c fails for hppa, since function pointers may point at plabels. It isn't valid to cast two function pointers to void* and then compare the void pointers. * testsuite/ld-elf/check-ptr-eq.c (check_ptr_eq): Change params from void pointers to function pointers. * testsuite/ld-elf/pr18718.c: Update to suit. * testsuite/ld-elf/pr18720a.c: Update to suit.
2017-02-16hppa -z relro againAlan Modra10-8/+46
I misunderstood the hppa alias problem. File offsets of segments need to be such that no page is mapped twice with different permissions. (Which still seems to me like something the kernel could fix, but anyhow, this is not so difficult to achieve in ld.) PR 21000 bfd/ * elf-bfd.h (struct elf_backend_data): Add no_page_alias. * elfxx-target.h (elf_backend_no_page_alias): Define. (elfNN_bed): Init new field. * elf.c (assign_file_positions_for_load_sections): If no_page_alias ensure PT_LOAD segment starts on a new page. * elf32-hppa.c (elf_backend_no_page_alias): Define. ld/ * testsuite/ld-elf/loadaddr1.d: Adjust for hppa file offsets. * testsuite/ld-elf/loadaddr2.d: Likewise. * testsuite/ld-elf/loadaddr3a.d: Likewise. * testsuite/ld-scripts/rgn-at5.d: Likewise.
2017-02-16PR21132, hppa-linux pie support doesn't workAlan Modra2-0/+8
This fixes a long-standing hppa bug seen when generating PIEs, and I think possible to trigger with forced local symbols in shared libraries. Not allocating enough space for PLT relocs results in ld writing outside of the buffer. PR 21132 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs if pic.
2017-02-16Fix more powerpc testsuite source errorsAlan Modra3-2/+7
* testsuite/ld-powerpc/vxworks1-lib.s: Correct addi to addic. * testsuite/ld-powerpc/vxworks1-lib.dd: Adjust to suit.
2017-02-16[Patch] Add BFD_LINKER_CREATED to BFD_FLAGS_SAVEDJiong Wang3-4/+11
bfd/ * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED. * bfd-in2.h: Regenerated. Bug exposed by https://sourceware.org/ml/binutils/2017-02/msg00128.html
2017-02-15PR gdb/21164: maint print {symbols,msymbols,psymbols} without args crashSergio Durigan Junior5-6/+27
This is a fix for PR gdb/21164. The problem started to happen after: commit 34c41c681f4a0a0dfe0405c7d2aecf458520557a Author: Doug Evans <xdje42@gmail.com> AuthorDate: Mon Dec 19 08:33:46 2016 -0800 New syntax for mt print symbols,msymbols,psymbols. This change introduced new syntax for the mentioned commands, and improved the parsing of arguments by using 'gdb_buildargv'. However, it is necessary to check if the argv being built is not NULL, which can happen if the user doesn't provide any arguments to these commands. gdb/ChangeLog: 2017-02-15 Sergio Durigan Junior <sergiodj@redhat.com> PR gdb/21164 * psymtab.c (maintenance_print_psymbols): Verify if 'argv' is not NULL before using it. * symmisc.c (maintenance_print_symbols): Likewise. (maintenance_print_msymbols): Likewise. gdb/testsuite/ChangeLog: gdb/ChangeLog: 2017-02-15 Sergio Durigan Junior <sergiodj@redhat.com> PR gdb/21164 * gdb.base/maint.exp: Add testcases for when the commands do not have arguments.
2017-02-16Automatic date update in version.inGDB Administrator1-1/+1
2017-02-15i386: Allow "lea foo@GOT, %reg" in PICH.J. Lu6-4/+86
"lea foo@GOT, %reg" is OK in PIC since it only loads the GOT offset into register, which can be used later with a GOT base register to get the value in the GOT entry. bfd/ PR ld/21168 * elf32-i386.c (elf_i386_relocate_section): Allow "lea foo@GOT, %reg" in PIC. ld/ PR ld/21168 * testsuite/ld-i386/i386.exp: Run pr21168. * testsuite/ld-i386/pr21168a.c: New file. * testsuite/ld-i386/pr21168b.S: Likewise.
2017-02-15Add a test for R_386_GOT32/R_386_GOT32X IFUNC reloc errorH.J. Lu8-1/+65
bfd/ PR ld/20244 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC symbol name when reporting R_386_GOT32/R_386_GOT32X relocation error against local IFUNC symbol without a base register for PIC. ld/ PR ld/20244 * testsuite/ld-i386/i386.exp: Run pr20244-4a, pr20244-4b and pr20244-4c. * testsuite/ld-i386/pr20244-4.s: New file. * testsuite/ld-i386/pr20244-4a.d: Likewise. * testsuite/ld-i386/pr20244-4b.d: Likewise. * testsuite/ld-i386/pr20244-4c.d: Likewise.
2017-02-15Add SFENCE.VMA instructionAndrew Waterman4-0/+17
include/ChangeLog: 2017-02-14 Andrew Waterman <andrew@sifive.com> * opcode/riscv-opc.h (MATCH_SFENCE_VMA): New define. (MASK_SFENCE_VMA): Likewise. (sfence_vma): Declare instruction. opcodes/ChangeLog: 2017-02-14 Andrew Waterman <andrew@sifive.com> * riscv-opc.c (riscv_opcodes): Add sfence.vma instruction and pseudoinstructions.
2017-02-15[AArch64] Add SVE system registersRichard Sandiford7-0/+106
This patch adds the SVE-specific system registers. opcodes/ * aarch64-opc.c (aarch64_sys_regs): Add SVE registers. (aarch64_sys_reg_supported_p): Handle them. gas/ * testsuite/gas/aarch64/sve-sysreg.s, testsuite/gas/aarch64/sve-sysreg.d, testsuite/gas/aarch64/sve-sysreg-invalid.d, testsuite/gas/aarch64/sve-sysreg-invalid.l: New tests.
2017-02-15[AArch64] Fix +sve documentationRichard Sandiford2-2/+6
The documentation entry for the SVE feature incorrectly said that it was enabled by default for ARMv8-A or later. This patch fixes that and also mentions that +sve implies +simd. (It also implies +fp, but that follows by transitivity.) gas/ * doc/c-aarch64.texi: Fix sve entry.
2017-02-15LD: vfinfo: Make clever formatters consistent WRT function name reportingMaciej W. Rozycki25-548/+35
Remove an inconsistency in linker error message processing causing that it depends on the ability to infer the name of the originating source file whether or not the name of the offending function is repeated by clever formatters for each issue reported within the function. Taking the `ld/testsuite/ld-powerpc/tocopt7.s' test case source as an example and the `powerpc-linux' target we have: $ as -gdwarf2 -o tocopt.o -a64 tocopt.s $ ld -o tocopt -melf64ppc tocopt.o tocopt.o: In function `_start': tocopt.s:35:(.text+0x14): toc optimization is not supported for 0x3fa00000 instruction. tocopt.s:49:(.text+0x34): toc optimization is not supported for 0x3fa00000 instruction. $ vs: $ as -o tocopt.o -a64 tocopt.s $ ld -o tocopt -melf64ppc tocopt.o tocopt.o: In function `_start': (.text+0x14): toc optimization is not supported for 0x3fa00000 instruction. tocopt.o: In function `_start': (.text+0x34): toc optimization is not supported for 0x3fa00000 instruction. $ Similarly with the `mips-linux' target and this source: $ cat jal-global-multi-overflow.s .text .set noreorder .space 0x2000 .align 4 .globl foo .ent foo foo: jal bar nor $0, $0 jal bar nor $0, $0 .end foo .space 0x1ff0 .align 4 .globl bar .ent bar bar: jal foo nor $0, $0 jal foo nor $0, $0 .end bar $ as -o jal-global-multi-overflow.o jal-global-multi-overflow.s $ ld -Ttext 0x1fffd000 -e foo -o jal-global-multi-overflow jal-global-multi-overflow.o jal-global-multi-overflow.o: In function `foo': (.text+0x2000): relocation truncated to fit: R_MIPS_26 against `bar' jal-global-multi-overflow.o: In function `foo': (.text+0x2008): relocation truncated to fit: R_MIPS_26 against `bar' jal-global-multi-overflow.o: In function `bar': (.text+0x4000): relocation truncated to fit: R_MIPS_26 against `foo' jal-global-multi-overflow.o: In function `bar': (.text+0x4008): relocation truncated to fit: R_MIPS_26 against `foo' $ Not only this is inconsistent, but it causes output clutter as well with redundant information. The cause for this is a check in `vfinfo' the intent of which is to print the function heading whenever (among others) the name of the source file has changed, which however does not take into account a situation where the name couldn't have been established both now and previously. Adjust the check then for this situation, yielding: $ as -o tocopt.o -a64 tocopt.s $ ld -o tocopt -melf64ppc tocopt.o tocopt.o: In function `_start': (.text+0x14): toc optimization is not supported for 0x3fa00000 instruction. (.text+0x34): toc optimization is not supported for 0x3fa00000 instruction. $ and: $ as -o jal-global-multi-overflow.o jal-global-multi-overflow.s $ ld -Ttext 0x1fffd000 -e foo -o jal-global-multi-overflow jal-global-multi-overflow.o jal-global-multi-overflow.o: In function `foo': (.text+0x2000): relocation truncated to fit: R_MIPS_26 against `bar' (.text+0x2008): relocation truncated to fit: R_MIPS_26 against `bar' jal-global-multi-overflow.o: In function `bar': (.text+0x4000): relocation truncated to fit: R_MIPS_26 against `foo' (.text+0x4008): relocation truncated to fit: R_MIPS_26 against `foo' $ respectively instead. Adjust the test suite accordingly. ld/ * ldmisc.c (vfinfo): Don't print the function name again either if no source file name has been found both now and previously. * testsuite/ld-cris/tls-err-20x.d: Adjust accordingly. * testsuite/ld-mips-elf/mode-change-error-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-mips16.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-micromips.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-r6-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-2.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-r6-2.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-ignore-2.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-ignore-mips16.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-ignore-micromips.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-ignore-r6-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-addend-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-addend-3.d: Likewise. * testsuite/ld-mips-elf/unaligned-jump.d: Likewise. * testsuite/ld-mips-elf/unaligned-jump-mips16.d: Likewise. * testsuite/ld-mips-elf/unaligned-jump-micromips.d: Likewise. * testsuite/ld-mips-elf/unaligned-lwpc-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-ldpc-1.d: Likewise. * testsuite/ld-powerpc/tocopt.out: Likewise. * testsuite/ld-powerpc/tocopt7.out: Likewise.
2017-02-15PowerPC/BFD: Convert `%P: %H:' to `%H:' in error messagesMaciej W. Rozycki3-23/+32
Remove an inconsistency in BFD linker error messages across the PowerPC backends, where in the presence of line information the `%P: %H:' format sequence makes the first error message produced for any given function different from subsequent ones. Taking the `ld/testsuite/ld-powerpc/tocopt7.s' test case source as an example and the `powerpc-linux' target we have: $ as -gdwarf2 -o tocopt.o -a64 tocopt.s $ ld -o tocopt -melf64ppc tocopt.o ld: tocopt.o: In function `_start': tocopt.s:35:(.text+0x14): toc optimization is not supported for 0x3fa00000 instruction. ld: tocopt.s:49:(.text+0x34): toc optimization is not supported for 0x3fa00000 instruction. $ where the first error message does not have the source file name prefixed with the linker program executable's name, i.e. `ld:', whereas the second error message does, as would any subsequent. This is because with a multiple-line error message such as `%H' produces `%P' only prints the program executable's name on the first line and not any later ones. Also the PowerPC backend is the only part of BFD which uses `%P' along with one of the clever `%C', `%D', `%G', `%H' format specifiers. And last but not least this breaks a GNU Coding Standard's requirement that error messages from compilers should look like this: source-file-name:lineno: message also quoted in `vfinfo' code handling these specifiers. Convert `%P: %H:' to `%H:' in error messages across the PowerPC backends then, yielding: $ as -gdwarf2 -o tocopt.o -a64 tocopt.s $ ld -o tocopt -melf64ppc tocopt.o tocopt.o: In function `_start': tocopt.s:35:(.text+0x14): toc optimization is not supported for 0x3fa00000 instruction. tocopt.s:49:(.text+0x34): toc optimization is not supported for 0x3fa00000 instruction. $ instead, making it consistent and matching the GNU Coding Standard's requirement. bfd/ * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than `%P: %H:' with `info->callbacks->einfo'. (ppc_elf_relocate_section): Likewise. * elf64-ppc.c (ppc64_elf_check_relocs): Likewise. (ppc64_elf_edit_toc): Likewise. (ppc64_elf_relocate_section): Likewise.
2017-02-15LD: vfinfo: Remove static NULL initializersMaciej W. Rozycki2-2/+6
Remove static NULL initializers, moving the respective variables from data to BSS and saving some storage space. ld/ * ldmisc.c (vfinfo) <'H'>: Remove static NULL initializers.
2017-02-15Fix illegal upper case gdb cmd in chained-calls.expThomas Preud'homme2-1/+5
3d7b173c29900879c9a5958dd6029fd36666e57c made upper case commands now illegal. However gdb.cp/chained-calls.exp still contains one test using P to print an expression. This patch fixes the testcase to use p instead. 2017-02-13 Thomas Preud'homme <thomas.preudhomme@arm.com> gdb/ * gdb.cp/chained-calls.exp: Use p instead of P.
2017-02-15[ARC] Fix assembler relaxation.Claudiu Zissulescu30-43/+430
Fix assembler relaxation step for add, ld, mov, mpy and sub instructions. Add tests to it. gas/ 2017-02-15 Claudiu Zissulescu <claziss@synopsys.com> * config/tc-arc.c (md_convert_frag): Remove @pcl relocation information from input expression. (assemble_insn): Make sure pcrel is correctly set. (arc_pcrel_adjust): Compensate for PCL rounding. * testsuite/gas/arc/relax-add01.d: New file. * testsuite/gas/arc/relax-add01.s: Likewise. * testsuite/gas/arc/relax-add02.d: Likewise. * testsuite/gas/arc/relax-add02.s: Likewise. * testsuite/gas/arc/relax-add03.d: Likewise. * testsuite/gas/arc/relax-add03.s: Likewise. * testsuite/gas/arc/relax-add04.d: Likewise. * testsuite/gas/arc/relax-add04.s: Likewise. * testsuite/gas/arc/relax-ld01.d: Likewise. * testsuite/gas/arc/relax-ld01.s: Likewise. * testsuite/gas/arc/relax-ld02.d: Likewise. * testsuite/gas/arc/relax-ld02.s: Likewise. * testsuite/gas/arc/relax-mov01.d: Likewise. * testsuite/gas/arc/relax-mov01.s: Likewise. * testsuite/gas/arc/relax-mov02.d: Likewise. * testsuite/gas/arc/relax-mov02.s: Likewise. * testsuite/gas/arc/relax-mpy01.d: Likewise. * testsuite/gas/arc/relax-mpy01.s: Likewise. * testsuite/gas/arc/relax-sub01.d: Likewise. * testsuite/gas/arc/relax-sub01.s: Likewise. * testsuite/gas/arc/relax-sub02.d: Likewise. * testsuite/gas/arc/relax-sub02.s: Likewise. * testsuite/gas/arc/relax-sub03.d: Likewise. * testsuite/gas/arc/relax-sub03.s: Likewise. * testsuite/gas/arc/relax-sub04.d: Likewise. * testsuite/gas/arc/relax-sub04.s: Likewise. opcodes/ 2017-02-15 Claudiu Zissulescu <claziss@synopsys.com> * arc-opc.c (UIMM6_20R): Define. (SIMM12_20): Use above. (SIMM12_20R): Define. (SIMM3_5_S): Use above. (UIMM7_A32_11R_S): Define. (UIMM7_9_S): Use above. (UIMM3_13R_S): Define. (SIMM11_A32_7_S): Use above. (SIMM9_8R): Define. (UIMM10_A32_8_S): Use above. (UIMM8_8R_S): Define. (W6): Use above. (arc_relax_opcodes): Use all above defines.
2017-02-15Move Eric Christopher to Past Maintainers list.Nick Clifton2-2/+6
* MAINTAINERS: (MIPS, MN10300): Move Eric Christopher to Past Maintainers section.
2017-02-15Use Windows style directory separators when running sysroot tests under ↵Igor Kudrin2-1/+25
MinGW and Cygwin. * testsuite/ld-scripts/sysroot-prefix.exp (get_base_dir_for_scripts): New function. (run_sysroot_prefix_test): Use get_base_dir_for_scripts.
2017-02-15Don't give an internal error for unsupported relocations.Vladimir Radosavljevic2-11/+15
gold/ * mips.cc (Target_mips::Scan::get_reference_flags): Remove gold_unreachable from default case.
2017-02-15Add support for R_MIPS_HIGHER/HIGHEST, R_MICROMIPS_HIGHER/HIGHEST relocations.Vladimir Radosavljevic2-0/+87
2017-02-15 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com> PR gold/21111 * mips.cc (Mips_relocate_functions::relhigher): New method. (Mips_relocate_functions::relhighest): Likewise. (mips_get_size_for_reloc): Add support for relocs: R_MIPS_HIGHER and R_MIPS_HIGHEST. (Target_mips::Scan::local): Add support for relocs: R_MIPS_HIGHER, R_MIPS_HIGHEST, R_MICROMIPS_HIGHER and R_MICROMIPS_HIGHEST. (Target_mips::Scan::global): Likewise. (Target_mips::Scan::get_reference_flags): Likewise. (Target_mips::Relocate::relocate): Call static methods for resolving HIGHER and HIGHEST relocations.
2017-02-15Distinguish some of the registers different on ARC700 and HS38 cpusVineet Gupta4-13/+46
opcodes * arc-regs.h: Distinguish some of the registers different on ARC700 and HS38 cpus. gas * testsuite/gas/arc/st.d: Update for 0xe having a name now
2017-02-15Improved support for --icf=safe when used with -pie.Rahul Chaudhry6-17/+191
gold/ * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers): Return true even when building pie binaries. (Target_x86_64::possible_function_pointer_reloc): Check opcode for R_X86_64_PC32 relocations. (Target_x86_64::local_reloc_may_be_function_pointer): Pass extra arguments to local_reloc_may_be_function_pointer. (Target_x86_64::global_reloc_may_be_function_pointer): Likewise. * gc.h (gc_process_relocs): Add check for STT_FUNC. * testsuite/Makefile.am (icf_safe_pie_test): New test case. * testsuite/Makefile.in: Regenerate. * testsuite/icf_safe_pie_test.sh: New shell script.
2017-02-15Add missing ChangeLog entries.Tim Wiederhake3-0/+88
This adds the missing ChangeLog entries for the "Python bindings" patch series.
2017-02-15Automatic date update in version.inGDB Administrator1-1/+1
2017-02-14Add self to aarch64 maintainers. Fix mla instruction.Jim Wilson6-49/+128
sim/ * MAINTAINTERS (aarch64): Add myself. sim/aarch64/ * simulator.c (do_vec_MLA): Rewrite switch body. sim/testsuite/sim/aarch64/ * mla.s: New.
2017-02-14Fix bit/bif instructions.Jim Wilson4-10/+107
sim/aarch64/ * simulator.c (do_vec_bit): Change loop limits from 16 and 8 to 4 and 2. Move test_false if inside loop. Fix logic for computing result stored to vd. sim/testsuite/sim/aarch64 * bit.s: New.
2017-02-14Add ldn/stn single support, fix ldnr support.Jim Wilson6-269/+698
sim/aarch64/ * simulator.c: (LDn_STn_SINGLE_LANE_AND_SIZE): New. (do_vec_LDn_single, do_vec_STn_single): New. (do_vec_LDnR): Add and set new nregs var. Replace switch on nregs with loop over nregs using new var n. Add n times size to address in loop. Add n to vd in loop. (do_vec_load_store): Add comment for instruction bit 24. New var single to hold instruction bit 24. Add new code to use single. Move ldnr support inside single if statements. Fix ldnr register counts inside post if statement. Change HALT_NYI calls to HALT_UNALLOC. sim/testsuite/sim/aarch64/ * ldn_single.s: New. * ldnr.s: New. * stn_single.s: New.
2017-02-14PR python/13598 - add before_prompt eventTom Tromey8-0/+57
This adds an event that is emitted just before GDB presents a prompt to the user. This provides Python code a way to react to whatever changes might have been made by the previous command. For example, in my GUI I use this to track changes to the selected frame and reflect them in the UI. Built and regtested on x86-64 Fedora 23. gdb/ChangeLog 2017-02-14 Tom Tromey <tom@tromey.com> PR python/13598: * python/python.c (gdbpy_before_prompt_hook): Emit before_prompt event. * python/py-evts.c (gdbpy_initialize_py_events): Add before_prompt registry. * python/py-events.h (events_object) <before_prompt>: New field. gdb/doc/ChangeLog 2017-02-14 Tom Tromey <tom@tromey.com> PR python/13598: * python.texi (Events In Python): Document events.before_prompt. gdb/testsuite/ChangeLog 2017-02-14 Tom Tromey <tom@tromey.com> PR python/13598: * gdb.python/py-events.exp: Add before_prompt event tests.
2017-02-14Big-endian targets: Fix implptrpiece.expAndreas Arnez2-2/+19
The test case implptrpiece.exp accesses the second byte of the short integer number 1 and expects it to be zero. This is valid for little-endian targets, but fails on big-endian targets. This is fixed by distinguishing the expected value by endianness. gdb/testsuite/ChangeLog: * gdb.dwarf2/implptrpiece.exp: Fix check for big-endian targets.
2017-02-14Fix invalid memory access displayiing contents of sections.Nick Clifton2-1/+16
PR binutils/21159 * readelf.c (dump_section_as_strings): Reset the start address if no decompression is perfromed. (dump_section_as_bytes): Likewise.
2017-02-14Fix an illegal memory access parsing corrupt STABD debug information.Nick Clifton2-0/+9
PR binutils/21158 * rddbg.c (read_symbol_stabs_debugging_info): Check for a null or empty symbol name.
2017-02-14Fix handling of corrupt STABS enum type strings.Nick Clifton2-1/+20
PR binutils/21157 * stabs.c (parse_stab_enum_type): Check for corrupt NAME:VALUE pairs. (parse_number): Exit early if passed an empty string.
2017-02-14Fix illegal memory access problems with readelf processing corrupt RL78 ↵Nick Clifton2-17/+28
binaries. PR binutils/21155 * readelf.c (IN_RANGE): New macro. Tests for an address + offset being within a given range. (target_specific_reloc_handling): Use macro to test for underflow as well as overflow of reloc offset.
2017-02-14PowerPC register expression checksAlan Modra8-559/+663
This stops powerpc gas blithely accepting such nonsense as "addi %f4,%cr3,%r31". PR 21118 gas/ * NEWS: Mention powerpc register checks. * config/tc-ppc.c (struct pd_reg): Make value a short. Add flags. (pre_defined_registers): Delete fpscr and pmr entries. Set register type in flags. (cr_names): Set type in flags. (reg_name_search): Return pointer to struct pd_reg rather than value. (register_name): Adjust to suit. Set X_md from flags. (ppc_parse_name): Likewise. (ppc_optimize_expr): New function. (md_assemble): Verify expresion reg flags match operand. * config/tc-ppc.h (md_optimize_expr): Define. (ppc_optimize_expr): Declare. include/ * opcode/ppc.h (PPC_OPERAND_*): Reassign values, regs first. (PPC_OPERAND_SPR, PPC_OPERAND_GQR): Define. opcodes/ * ppc-opc.c (powerpc_operands): Flag SPR, SPRG and TBR entries with PPC_OPERAND_SPR. Flag PSQ and PSQM with PPC_OPERAND_GQR.
2017-02-14Fix powerpc testsuite source errorsAlan Modra4-22/+28
PR 21118 work exposed these errors in the testsuite. * testsuite/gas/ppc/cell.s: Correct invalid registers. * testsuite/gas/ppc/vle-simple-1.s: Likewise. * testsuite/gas/ppc/vle-simple-2.s: Likewise.