1. 27 Jan, 2018 4 commits
    • Eli Zaretskii's avatar
      Avoid compilation errors in MinGW native builds of GDB · b2a426e2
      Eli Zaretskii authored
      The error is triggered by including python-internal.h, and the
      error message is:
      
           In file included from d:\usr\lib\gcc\mingw32\6.3.0\include\c++\math.h:36:0,
      	      from build-gnulib/import/math.h:27,
      	      from d:/usr/Python26/include/pyport.h:235,
      	      from d:/usr/Python26/include/Python.h:58,
      	      from python/python-internal.h:94,
      	      from python/py-arch.c:24:
           d:\usr\lib\gcc\mingw32\6.3.0\include\c++\cmath:1157:11: error: '::hypot' has not been declared
              using ::hypot;
      	        ^~~~~
      
      This happens because Python headers define 'hypot' to expand to
      '_hypot' in the Windows builds.
      
      gdb/ChangeLog:
      2018-01-27  Eli Zaretskii  <eliz@gnu.org>
      
      	* python/python-internal.h (_hypot) [__MINGW32__]: Define back to
      	'hypoth'.  This avoids a compilation error.
      b2a426e2
    • Eli Zaretskii's avatar
      Avoid compilation warning in libiberty/simple-object-xcoff.c · de54ee81
      Eli Zaretskii authored
      gdb/ChangeLog:
      2018-01-27  Eli Zaretskii  <eliz@gnu.org>
      
      	* simple-object-xcoff.c (simple_object_xcoff_find_sections): Avoid
      	compilation warning in 32-bit builds not supported by
      	AC_SYS_LARGEFILE.
      de54ee81
    • Nick Clifton's avatar
      7d73b4c8
    • GDB Administrator's avatar
      Automatic date update in version.in · a2f6c13e
      GDB Administrator authored
      a2f6c13e
  2. 26 Jan, 2018 10 commits
    • Maciej W. Rozycki's avatar
      MIPS/LD: Correct `mips-*-windiss' target emulation configuration · 2ebd05b8
      Maciej W. Rozycki authored
      Fix an issue with commit 73934d31 ("Disable .gnu.hash on MIPS
      targets"), <https://sourceware.org/ml/binutils/2006-07/msg00341.html>,
      which in turn caused a regression with commit 861fb55a ("Defer
      allocation of R_MIPS_REL32 GOT slots"),
      <https://sourceware.org/ml/binutils/2008-08/msg00096.html>, and use
      `mipself.em' as the extra emulation file for `mips-*-windiss' targets,
      removing a segmentation fault triggered as `_bfd_mips_elf_final_link'
      calls `htab_traverse' to process LA25 stubs with `htab->la25_stubs'
      being NULL.  This is in turn due to `_bfd_mips_elf_init_stubs' not
      having been called, which is only done by `mipself.em'.  No LA25 stubs
      are supposed to be produced for `mips-*-windiss' targets, however the
      internal data structures have to be initialized.
      
      	ld/
      	* emulparams/elf32mipswindiss.sh (EXTRA_EM_FILE): Set to
      	`mipself'.
      2ebd05b8
    • Maciej W. Rozycki's avatar
      MIPS/GAS: Correct `mips-*-windiss' target emulation configuration · 1e3f5548
      Maciej W. Rozycki authored
      Fix a commit 0a44bf69 ("mips-vxworks support"),
      <https://sourceware.org/ml/binutils/2006-03/msg00179.html>, regression
      and override the choice of the `vxworks' target environment introduced
      with commit ea3eed15 ("Add generic vxworks GAS target."),
      <https://sourceware.org/ml/binutils/2005-01/msg00052.html>, for
      `mips-*-windiss' targets as they have not been converted to the VxWorks
      target format introduced with the former commit, removing a GAS target
      format selection failure:
      
      Assembler messages:
      Fatal error: selected target format 'elf32-bigmips-vxworks' unknown
      
      on any assembly attempt with `mips-windiss' and equivalent target
      configurations.
      
      	gas/
      	* configure.tgt: Use generic emulation for `mips-*-windiss',
      	overriding the blanket choice made for `*-*-windiss'.
      1e3f5548
    • Maciej W. Rozycki's avatar
      MIPS/GAS: Correct `mips-*-sysv4*' target emulation configuration · c00f0d7a
      Maciej W. Rozycki authored
      Use `mips-*-sysv4*' rather than `mips-*-sysv4*MP*' to match the system
      type for System V Release 4 MIPS targets, removing a GAS target
      selection failure:
      
      Assembler messages:
      Fatal error: selected target format 'elf32-bigmips' unknown
      
      on any assembly attempt with `mips-sysv4' and equivalent target
      configurations.  These would typically be called `mips-sni-sysv4'
      (Sinix) vs `mips-dde-sysv4.2MP' (Supermax).
      
      This corrects commit 8614eeee ("Traditional MIPS patches"),
      <https://sourceware.org/ml/binutils/2000-07/msg00018.html>, making GAS
      target selection match commit dd745cfa ("Traditional MIPS patches"),
      <https://sourceware.org/ml/binutils/2000-07/msg00018.html>, and commit
      3548145d ("Traditional MIPS patches"),
      <https://sourceware.org/ml/binutils/2000-07/msg00018.html>, which added
      support for these targets to BFD and LD respectively.
      
      	gas/
      	* configure.tgt: Use `mips-*-sysv4*' rather than
      	`mips-*-sysv4*MP*'.
      c00f0d7a
    • Alan Hayward's avatar
      Add myself as a write-after-approval GDB maintainer. · 0bdd8eac
      Alan Hayward authored
      gdb/
          * MAINTAINERS (Write After Approval): Add Alan Hayward.
      0bdd8eac
    • Alan Hayward's avatar
      Add myself as a write-after-approval GDB maintainer. · 56ae9dc3
      Alan Hayward authored
      gdb/
          * MAINTAINERS (Write After Approval): Add Alan Hayward.
      56ae9dc3
    • Nick Clifton's avatar
      Update notes on making a release · 94c2436b
      Nick Clifton authored
      94c2436b
    • Alan Modra's avatar
      PowerPC PLT stub matching · 7433498b
      Alan Modra authored
      
      
      This patch fixes a number of bugs in ppc32 plt stub matching code.
      1) The 4-insn stubs for shared libs and PIEs weren't matched.
      2) The executable stub miscalculated PLT entry address (by oring a
         sign-extended quantity rather than adding).
      3) Comments were not accurate.
      
      In addition, the insn arrays are made const.
      
      	* ppc-linux-tdep.c (powerpc32_plt_stub): Make const.
      	(powerpc32_plt_stub_so_1): Rename from powerpc32_plt_stub_so.
      	Remove nop.  Make const.  Comment.
      	(powerpc32_plt_stub_so_2): New.
      	(POWERPC32_PLT_CHECK_LEN): Rename from POWERPC32_PLT_STUB_LEN.
      	Correct count.  Update uses.
      	(ppc_skip_trampoline_code): Match powerpc32_plt_stub_so_2 too.
      	Move common code reading PLT entry word.  Correct
      	powerpc32_plt_stub PLT address calculation.
      	* ppc64-tdep.c (ppc64_standard_linkage1): Make const.
      	(ppc64_standard_linkage2, ppc64_standard_linkage3): Likewise.
      	(ppc64_standard_linkage4, ppc64_standard_linkage5): Likewise.
      	(ppc64_standard_linkage6, ppc64_standard_linkage7): Likewise.
      	(ppc64_standard_linkage8): Likewise.
      	* rs6000-tdep.c (ppc_insns_match_pattern): Make pattern const.
      	Correct insns description.
      	* ppc-tdep.h (ppc_insns_match_pattern): Update prototype.
      Reviewed-By: default avatarYao Qi <qiyaoltc@gmail.com>
      7433498b
    • Alan Modra's avatar
      Define __start/__stop symbols when there is only a dynamic def · 32253bb7
      Alan Modra authored
      This patch fixes a case where a user had a C-representable named
      section in both the executable and shared libraries, and of course
      wanted the size of the local section in the executable, not the
      dynamic section.  It does mean that __start and __stop symbols don't
      behave exactly like PROVIDEd symbols, but I think that's a reasonable
      difference particularly since this is the way they used to behave.
      
      	* elflink.c (bfd_elf_define_start_stop): Override symbols when
      	they are defined dynamically.
      32253bb7
    • Alan Modra's avatar
      PowerPC64 .branch_lt size change leads to "stubs don't match calculated size" · ba21f564
      Alan Modra authored
      https://bugzilla.redhat.com/show_bug.cgi?id=1523457
      
      I haven't analyzed this myself, I'm relying on Nick's excellent
      analysis.  What I believe is happening is that after some number of
      stub sizing iterations, a long-branch stub needs to be converted to a
      plt-branch, but either due to stub alignment or other stubs shrinking
      in size, the stub group section size doesn't change.
      
      That means we exit from ppc64_elf_size_stubs after sizing with an
      incorrect layout, in fact the additional .branch_lt entry overlays
      .got!  Since .TOC. is normally set to .got + 0x8000 the stub sizing
      code decides that entry is within +/-32k of the TOC pointer and so a
      three insn stub is sufficient.  When we come to build the stubs using
      a correct non-overlaying layout, a four insn plt-branch stub is
      generated and the stub group size doesn't match that calculated
      earlier.
      
      	* elf64-ppc.c (ppc64_elf_size_stubs): Iterate sizing when
      	.branch_lt changes size.
      ba21f564
    • GDB Administrator's avatar
      Automatic date update in version.in · 8a69c6d0
      GDB Administrator authored
      8a69c6d0
  3. 25 Jan, 2018 3 commits
    • Alan Modra's avatar
      PR22746, crash when running 32-bit objdump on corrupted file · 38e64b0e
      Alan Modra authored
      Avoid unsigned int overflow by performing bfd_size_type multiplication.
      
      	PR 22746
      	* elfcode.h (elf_object_p): Avoid integer overflow.
      38e64b0e
    • Eric Botcazou's avatar
      Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC). · bb363086
      Eric Botcazou authored
      There are actually 2 different bugs:
       1. TLS transition is broken in PIE mode.
       2. TLS is broken in PIC/PIE mode when the __tls_get_addr symbol
          is versioned  (as is the case on Linux and Solaris at least).
      
      The 1st bug is fixed by reverting the problematic change for now
      (note that the associated test doesn't pass on SPARC because of another
      issue so there is  no formal regression in the testsuite). The 2nd bug
      is fixed by changing the  call to _bfd_generic_link_add_one_symbol
      on __tls_get_addr into a mere lookup in _bfd_sparc_elf_check_relocs.
      
      bfd/
      	* elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
      	Do a mere lookup of the __tls_get_addr symbol instead of adding it.
      
      	Revert
      	2017-10-19  H.J. Lu  <hongjiu.lu@intel.com>
      
      	PR ld/22263
      	* elfxx-sparc.c (sparc_elf_tls_transition): Replace
      	bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
      	bfd_link_executable for TLS check.
      	(_bfd_sparc_elf_check_relocs): Likewise.
      	(allocate_dynrelocs): Likewise.
      	(_bfd_sparc_elf_relocate_section): Likewise.
      ld/
      	* testsuite/ld-sparc/sparc.exp (32-bit: Helper shared library):
      	Link with a version script.
      	(32-bit: TLS -fpie): New test.
      	(64-bit: Helper shared library): Link with a version script.
      	(64-bit: TLS -fpie): New test.
      	(64-bit: GOTDATA relocations): Pass -Av9 to the assembler.
      	* testsuite/ld-sparc/tlslib.ver: New file.
      	* testsuite/ld-sparc/tlspie32.dd: Likewise.
      	* testsuite/ld-sparc/tlspie32.s: Likewise.
      	* testsuite/ld-sparc/tlspie64.dd: Likewise.
      	* testsuite/ld-sparc/tlspie64.s: Likewise.
      	* testsuite/ld-sparc/tlssunbin32.dd: Adjust for versioned symbol.
      	* testsuite/ld-sparc/tlssunbin32.rd: Likewise.
      	* testsuite/ld-sparc/tlssunbin32.sd: Likewise.
      	* testsuite/ld-sparc/tlssunbin64.dd: Likewise.
      	* testsuite/ld-sparc/tlssunbin64.rd: Likewise.
      	* testsuite/ld-sparc/tlssunbin64.sd: Likewise.
      bb363086
    • GDB Administrator's avatar
      Automatic date update in version.in · 3e53a58e
      GDB Administrator authored
      3e53a58e
  4. 24 Jan, 2018 4 commits
    • Pedro Alves's avatar
      Fix GCC PR83906 - [8 Regression] Random FAIL: libstdc++-prettyprinters/80276.cc whatis p4 · 0f59d5fc
      Pedro Alves authored
      GCC PR83906 [1] is about a GCC/libstdc++ GDB/Python type printer
      testcase failing randomly, as shown by running (in libstdc++'s
      testsuite):
      
       make check RUNTESTFLAGS=prettyprinters.exp=80276.cc
      
      in a loop.  Sometimes you get this:
      
       FAIL: libstdc++-prettyprinters/80276.cc whatis p4
      
      I.e., this:
       type = std::unique_ptr<std::vector<std::unique_ptr<std::list<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >>[]>>[99]>
      
      instead of this:
       type = std::unique_ptr<std::vector<std::unique_ptr<std::list<std::string>[]>>[99]>
      
      Jonathan Wakely tracked it on the printer side to this bit in
      libstdc++'s type printer:
      
                  if self.type_obj == type_obj:
                      return strip_inline_namespaces(self.name)
      
      This assumes the two types resolve to the same gdb.Type but some times
      the comparison unexpectedly fails.
      
      Running the testcase manually under Valgrind finds the problem in GDB:
      
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       ==6118== Conditional jump or move depends on uninitialised value(s)
       ==6118==    at 0x4C35CB0: bcmp (vg_replace_strmem.c:1100)
       ==6118==    by 0x6F773A: check_types_equal(type*, type*, VEC_type_equality_entry_d**) (gdbtypes.c:3515)
       ==6118==    by 0x6F7B00: check_types_worklist(VEC_type_equality_entry_d**, bcache*) (gdbtypes.c:3618)
       ==6118==    by 0x6F7C03: types_deeply_equal(type*, type*) (gdbtypes.c:3655)
       ==6118==    by 0x4D5B06: typy_richcompare(_object*, _object*, int) (py-type.c:1007)
       ==6118==    by 0x63D7E6C: PyObject_RichCompare (object.c:961)
       ==6118==    by 0x646EAEC: PyEval_EvalFrameEx (ceval.c:4960)
       ==6118==    by 0x646DC08: PyEval_EvalFrameEx (ceval.c:4519)
       ==6118==    by 0x646DC08: PyEval_EvalFrameEx (ceval.c:4519)
       ==6118==    by 0x646DC08: PyEval_EvalFrameEx (ceval.c:4519)
       ==6118==    by 0x646DC08: PyEval_EvalFrameEx (ceval.c:4519)
       ==6118==    by 0x646DC08: PyEval_EvalFrameEx (ceval.c:4519)
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      That "bcmp" call is really a memcmp call in check_types_equal.  The
      problem is that gdb is memcmp'ing two objects that are equal in value:
      
       (top-gdb) p *TYPE_RANGE_DATA (type1)
       $1 = {low = {kind = PROP_CONST, data = {const_val = 0, baton = 0x0}}, high = {kind = PROP_CONST, data = {const_val = 15, baton = 0xf}}, flag_upper_bound_is_count = 0,
         flag_bound_evaluated = 0}
       (top-gdb) p *TYPE_RANGE_DATA (type2)
       $2 = {low = {kind = PROP_CONST, data = {const_val = 0, baton = 0x0}}, high = {kind = PROP_CONST, data = {const_val = 15, baton = 0xf}}, flag_upper_bound_is_count = 0,
         flag_bound_evaluated = 0}
      
      but differ in padding.  Notice the 4-byte hole:
      
        (top-gdb) ptype /o range_bounds
        /* offset    |  size */  type = struct range_bounds {
        /*    0      |    16 */    struct dynamic_prop {
        /*    0      |     4 */        dynamic_prop_kind kind;
        /* XXX  4-byte hole  */
        /*    8      |     8 */        union dynamic_prop_data {
        /*                 8 */            LONGEST const_val;
        /*                 8 */            void *baton;
      
      				     /* total size (bytes):    8 */
      				 } data;
      
      which is filled with garbage:
      
        (top-gdb) x /40bx TYPE_RANGE_DATA (type1)
        0x2fa7ea0:      0x01    0x00    0x00    0x00    0x43    0x01    0x00    0x00
      						  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        0x2fa7ea8:      0x00    0x00    0x00    0x00    0x00    0x00    0x00    0x00
        0x2fa7eb0:      0x01    0x00    0x00    0x00    0xfe    0x7f    0x00    0x00
        0x2fa7eb8:      0x0f    0x00    0x00    0x00    0x00    0x00    0x00    0x00
        0x2fa7ec0:      0x00    0x00    0x00    0x00    0x00    0x00    0x00    0x00
        (top-gdb) x /40bx TYPE_RANGE_DATA (type2)
        0x20379b0:      0x01    0x00    0x00    0x00    0xfe    0x7f    0x00    0x00
      						  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        0x20379b8:      0x00    0x00    0x00    0x00    0x00    0x00    0x00    0x00
        0x20379c0:      0x01    0x00    0x00    0x00    0xfe    0x7f    0x00    0x00
        0x20379c8:      0x0f    0x00    0x00    0x00    0x00    0x00    0x00    0x00
        0x20379d0:      0x00    0x00    0x00    0x00    0x00    0x00    0x00    0x00
      
        (top-gdb) p memcmp (TYPE_RANGE_DATA (type1), TYPE_RANGE_DATA (type2), sizeof (*TYPE_RANGE_DATA (type1)))
        $3 = -187
      
      In some cases objects of type range_bounds are memset when allocated,
      but then their dynamic_prop low/high fields are copied over from some
      template dynamic_prop object that wasn't memset.  E.g.,
      create_static_range_type's low/high locals are left with garbage in
      the padding, and then that padding is copied over to the range_bounds
      object's low/high fields.
      
      At first, I considered making sure to always memset range_bounds
      objects, thinking that maybe type objects are being put in some bcache
      instance somewhere.  But then I hacked bcache/bcache_full to poison
      non-pod types, and made dynamic_prop a non-pod, and GDB still
      compiled.
      
      So given that, it seems safest to not assume padding will always be
      memset, and instead treat them as regular value types, implementing
      (in)equality operators and using those instead of memcmp.
      
      This fixes the random FAILs in GCC's testcase.
      
      [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83906
      
      gdb/ChangeLog:
      2018-01-24  Pedro Alves  <palves@redhat.com>
      
      	GCC PR libstdc++/83906
      	* gdbtypes.c (operator==(const dynamic_prop &,
      	const dynamic_prop &)): New.
      	(operator==(const range_bounds &, const range_bounds &)): New.
      	(check_types_equal): Use them instead of memcmp.
      	* gdbtypes.h (operator==(const dynamic_prop &,
      	const dynamic_prop &)): Declare.
      	(operator!=(const dynamic_prop &, const dynamic_prop &)): Declare.
      	(operator==(const range_bounds &, const range_bounds &)): Declare.
      	(operator!=(const range_bounds &, const range_bounds &)): Declare.
      0f59d5fc
    • Renlin Li's avatar
      [LD][AARCH64]Add group relocations to create PC-relative offset. · 1daf502a
      Renlin Li authored
      This is a patch to add linker support for group relocations to create a
      16, 32, 48, or 64 bit PC-relative offset inline.
      
      The following relocations are added along with the test cases:
      BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
      BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
      BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
      BFD_RELOC_AARCH64_MOVW_PREL_G3.
      
      bfd/
      
      2018-01-24  Renlin Li  <renlin.li@arm.com>
      
      	* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Add support for
      	BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
      	BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
      	BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
      	BFD_RELOC_AARCH64_MOVW_PREL_G3.
      	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
      	(_bfd_aarch64_elf_resolve_relocation): Likewise.
      
      ld/
      
      2018-01-24  Renlin Li  <renlin.li@arm.com>
      
      	* testsuite/ld-aarch64/aarch64-elf.exp: Run new testes.
      	* testsuite/ld-aarch64/emit-relocs-287.s: Fix test case.
      	* testsuite/ld-aarch64/emit-relocs-287.d: Fix expected output.
      	* testsuite/ld-aarch64/emit-relocs-287-overflow.s: New.
      	* testsuite/ld-aarch64/emit-relocs-287-overflow.d: New.
      	* testsuite/ld-aarch64/emit-relocs-288.d: New.
      	* testsuite/ld-aarch64/emit-relocs-288.s: New.
      	* testsuite/ld-aarch64/emit-relocs-289.d: New.
      	* testsuite/ld-aarch64/emit-relocs-289.s: New.
      	* testsuite/ld-aarch64/emit-relocs-289-overflow.s: New.
      	* testsuite/ld-aarch64/emit-relocs-289-overflow.d: New.
      	* testsuite/ld-aarch64/emit-relocs-290.d: New.
      	* testsuite/ld-aarch64/emit-relocs-290.s: New.
      	* testsuite/ld-aarch64/emit-relocs-291.d: New.
      	* testsuite/ld-aarch64/emit-relocs-291.s: New.
      	* testsuite/ld-aarch64/emit-relocs-291-overflow.s: New.
      	* testsuite/ld-aarch64/emit-relocs-291-overflow.d: New.
      	* testsuite/ld-aarch64/emit-relocs-292.d: New.
      	* testsuite/ld-aarch64/emit-relocs-292.s: New.
      	* testsuite/ld-aarch64/emit-relocs-293.d: New.
      	* testsuite/ld-aarch64/emit-relocs-293.s: New.
      1daf502a
    • Renlin Li's avatar
      [GAS][AARCH64]Add group relocations to create PC-relative offset. · 32247401
      Renlin Li authored
      This is a patch to add the gas support for group relocations to create a
      16, 32, 48, or 64 bit PC-relative offset inline.
      
      The following relocations are added along with the test cases:
      BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
      BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
      BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
      BFD_RELOC_AARCH64_MOVW_PREL_G3.
      
      bfd/
      
      2018-01-24  Renlin Li  <renlin.li@arm.com>
      
      	* reloc.c: Add BFD_RELOC_AARCH64_MOVW_PREL_G0,
      	BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, BFD_RELOC_AARCH64_MOVW_PREL_G1,
      	BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, BFD_RELOC_AARCH64_MOVW_PREL_G2,
      	BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, BFD_RELOC_AARCH64_MOVW_PREL_G3.
      	* bfd-in2.h: Regenerate.
      	* libbfd.h: Regenerate.
      	* elfnn-aarch64.c (elfNN_aarch64_howto_table): Add entries for
      	BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
      	BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
      	BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
      	BFD_RELOC_AARCH64_MOVW_PREL_G3.
      
      gas/
      
      2018-01-24  Renlin Li  <renlin.li@arm.com>
      
      	* config/tc-aarch64.c (reloc_table): add entries for
      	BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
      	BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
      	BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
      	BFD_RELOC_AARCH64_MOVW_PREL_G3.
      	(process_movw_reloc_info): Supports newly added MOVW_PREL relocations.
      	(md_apply_fix): Likewise
      	* testsuite/gas/aarch64/prel_g0.s: New.
      	* testsuite/gas/aarch64/prel_g0.d: New.
      	* testsuite/gas/aarch64/prel_g0_nc.s: New.
      	* testsuite/gas/aarch64/prel_g0_nc.d: New.
      	* testsuite/gas/aarch64/prel_g1.s: New.
      	* testsuite/gas/aarch64/prel_g1.d: New.
      	* testsuite/gas/aarch64/prel_g1_nc.s: New.
      	* testsuite/gas/aarch64/prel_g1_nc.d: New.
      	* testsuite/gas/aarch64/prel_g2.s: New.
      	* testsuite/gas/aarch64/prel_g2.d: New.
      	* testsuite/gas/aarch64/prel_g2_nc.s: New.
      	* testsuite/gas/aarch64/prel_g2_nc.d: New.
      	* testsuite/gas/aarch64/prel_g3.s: New.
      	* testsuite/gas/aarch64/prel_g3.d: New.
      32247401
    • GDB Administrator's avatar
      Automatic date update in version.in · cc40406d
      GDB Administrator authored
      cc40406d
  5. 23 Jan, 2018 19 commits
    • Maciej W. Rozycki's avatar
      MIPS/GAS: Correct default ABI selection for `mips64*-ps2-elf*' · 0984958b
      Maciej W. Rozycki authored
      Correct an issue with the `mips64*-ps2-elf*' target introduced with
      commit e407c74b ("Support for MIPS R5900 (Sony Playstation 2)"),
      <https://sourceware.org/ml/binutils/2012-12/msg00240.html> and make
      the n32 ABI the default for GAS, consistently with how BFD and LD
      are configured for this target.
      
      	gas/
      	* configure.ac: Also set `mips_default_abi' to N32_ABI for
      	`mips64*-ps2-elf*'.
      	* configure: Regenerate.
      0984958b
    • Maciej W. Rozycki's avatar
      MIPS/GAS: Remove a stale OPTION_COMPAT_ARCH_BASE option marker · 62fd0a98
      Maciej W. Rozycki authored
      Complement commit 23fce1e3 ("MIPS16 intermix test failure"),
      <https://sourceware.org/ml/binutils/2009-01/msg00335.html>, and
      remove a stale option marker entry.
      
      	gas/
      	* config/tc-mips.c (options): Remove OPTION_COMPAT_ARCH_BASE
      	enum value.
      62fd0a98
    • Maciej W. Rozycki's avatar
      MIPS/BFD: Update a stale `mips_elf32_section_processing' reference · 1c5e4ee9
      Maciej W. Rozycki authored
      Update a stale reference to `mips_elf32_section_processing', following a
      merge of the function into `_bfd_mips_elf_section_processing' made with
      commit 103186c6 ("PATCH for MIPS 64-bit ABI suport"),
      <https://sourceware.org/ml/binutils/1999-q3/msg00072.html>.
      
      	bfd/
      	* elfxx-mips.c (_bfd_mips_elf_final_link): Update a stale
      	`mips_elf32_section_processing' comment reference.
      1c5e4ee9
    • Igor Tsimbalist's avatar
      Enable Intel PCONFIG instruction. · be3a8dca
      Igor Tsimbalist authored
      Intel has disclosed a set of new instructions for Icelake processor.
      The spec is
      https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf
      
      This patch enables Intel PCONFIG instruction.
      
      gas/
      	* config/tc-i386.c (cpu_arch): Add .pconfig.
      	* doc/c-i386.texi: Document .pconfig.
      	* testsuite/gas/i386/i386.exp: Add PCONFIG tests.
      	* testsuite/gas/i386/pconfig-intel.d: New test.
      	* testsuite/gas/i386/pconfig.d: Likewise.
      	* testsuite/gas/i386/pconfig.s: Likewise.
      	* testsuite/gas/i386/x86-64-pconfig-intel.d: Likewise.
      	* testsuite/gas/i386/x86-64-pconfig.d: Likewise.
      	* testsuite/gas/i386/x86-64-pconfig.s: Likewise.
      opcodes/
      	* i386-dis.c (enum): Add pconfig.
      	* i386-gen.c (cpu_flag_init): Add CPU_PCONFIG_FLAGS.
      	(cpu_flags): Add CpuPCONFIG.
      	* i386-opc.h (enum): Add CpuPCONFIG.
      	(i386_cpu_flags): Add cpupconfig.
      	* i386-opc.tbl: Add PCONFIG instruction.
      	* i386-init.h: Regenerate.
      	* i386-tbl.h: Likewise.
      be3a8dca
    • Igor Tsimbalist's avatar
      Enable Intel WBNOINVD instruction. · 3233d7d0
      Igor Tsimbalist authored
      Intel has disclosed a set of new instructions for Icelake processor.
      The spec is
      https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf
      
      This patch enables Intel WBNOINVD instruction.
      
      gas/
      	* config/tc-i386.c (cpu_arch): Add .wbnoinvd.
      	* doc/c-i386.texi: Document .wbnoinvd.
      	* testsuite/gas/i386/i386.exp: Add WBNOINVD tests.
      	* testsuite/gas/i386/wbnoinvd-intel.d: New test.
      	* testsuite/gas/i386/wbnoinvd.d: Likewise.
      	* testsuite/gas/i386/wbnoinvd.s: Likewise.
      	* testsuite/gas/i386/x86-64-wbnoinvd-intel.d: Likewise.
      	* testsuite/gas/i386/x86-64-wbnoinvd.d: Likewise.
      	* testsuite/gas/i386/x86-64-wbnoinvd.s: Likewise.
      opcodes/
      	* i386-dis.c (enum): Add PREFIX_0F09.
      	* i386-gen.c (cpu_flag_init): Add CPU_WBNOINVD_FLAGS.
      	(cpu_flags): Add CpuWBNOINVD.
      	* i386-opc.h (enum): Add CpuWBNOINVD.
      	(i386_cpu_flags): Add cpuwbnoinvd.
      	* i386-opc.tbl: Add WBNOINVD instruction.
      	* i386-init.h: Regenerate.
      	* i386-tbl.h: Likewise.
      3233d7d0
    • Maciej W. Rozycki's avatar
      MIPS/GAS: Correct `as --help' always reporting `o32' as the default ABI · b4f6242e
      Maciej W. Rozycki authored
      Remove an issue with `as --help' always reporting `o32' as the default
      ABI regardless of what the default actually is, originally caused by
      commit cac012d6 ("check mips abi x linker emulation compatibility"),
      <https://sourceware.org/ml/binutils/2003-05/msg00187.html> missing an
      update here.
      
      	gas/
      	* config/tc-mips.c (md_show_usage): Correctly indicate the
      	configuration-specific default ABI.
      b4f6242e
    • Maciej W. Rozycki's avatar
      MIPS/GAS: Add missing `-mmips16e2'/`-mno-mips16e2' help text · f866b262
      Maciej W. Rozycki authored
      Correct a commit 25499ac7 ("MIPS16e2: Add MIPS16e2 ASE support") GAS
      bug and add missing help text for the `-mmips16e2' and `-mno-mips16e2'
      options added with said commit.
      
      	gas/
      	* config/tc-mips.c (md_show_usage): Report `-mmips16e2' and
      	`-mno-mips16e2' options.
      f866b262
    • Philipp Rudo's avatar
      s390: Clean up s390-linux-tdep.c · 14c41f47
      Philipp Rudo authored
      After moving big parts of the code to the new s390-tdep.c file
      s390-linux-tdep.c now contains many includes it doesn't need anymore.
      Furthermore, there are some functions lacking a description.
      
      Fix both and order the remaining includes alphabetically.
      
      gdb/ChangeLog
      	* s390-linux-tdep.c: Remove unneeded includes and order them
      	alphabetically.  Add comments to functions without description.
      14c41f47
    • Philipp Rudo's avatar
      s390: Move record-replay to s390-tdep.c · ef8914a4
      Philipp Rudo authored
      Record-replay is independent of the OS.  So it can be moved to the common
      s390 code without problem.
      
      gdb/ChangeLog:
      
      	* s390-linux-tdep.c (s390_record_address_mask)
      	(s390_record_calc_disp_common, s390_record_calc_disp)
      	(s390_record_calc_disp_vsce, s390_record_calc_rl, s390_popcnt)
      	(s390_record_gpr_g, s390_record_gpr_h, s390_record_vr)
      	(s390_process_record): Move to s390-tdep.c.
      	(s390_linux_init_abi_any): Adjust.
      	* s390-tdep.c (s390_record_address_mask)
      	(s390_record_calc_disp_common, s390_record_calc_disp)
      	(s390_record_calc_disp_vsce, s390_record_calc_rl, s390_popcnt)
      	(s390_record_gpr_g, s390_record_gpr_h, s390_record_vr)
      	(s390_process_record): Moved from s390-linux-tdep.c
      	(s390_gdbarch_init): Adjust.
      ef8914a4
    • Philipp Rudo's avatar
      s390: Split up s390-linux-tdep.c into two files · d6e58945
      Philipp Rudo authored
      Currently all target dependent code for s390 is in one file,
      s390-linux-tdep.c.  This includes code general for the architecture as
      well as code specific for uses in GNU/Linux (user space).  Up until now
      this was OK as GNU/Linux was the only supported OS.  In preparation to
      support the new Linux kernel 'OS' split up the existing s390 code into a
      general s390-tdep and a GNU/Linux-specific s390-linux-tdep.
      
      Note: The record-replay feature will be moved in a separate patch.  This
      is simply due to the fact that the combined patch would be too large for
      the mailing list.  This requires setting the process_record hook during
      OSABI init to keep the code bisectable.  The patch moving record-replay
      cleans up this hack.
      
      gdb/ChangeLog:
      
      	* s390-linux-nat.c (s390-tdep.h): New include.
      	* Makefile.in (ALL_TARGET_OBS): Add s390-tdep.o.
      	(HFILES_NO_SRCDIR): Add s390-tdep.h.
      	(ALLDEPFILES): Add s390-tdep.c.
      	* configure.tgt (s390*-*-linux*): Add s390-tdep.o.
      	* s390-linux-tdep.h (HWCAP_S390_*, S390_*_REGNUM): Move to...
      	* s390-tdep.h: ...this.  New file.
      	* s390-linux-tdep.c (s390-tdep.h): New include.
      	(_initialize_s390_tdep): Rename to...
      	(_initialize_s390_linux_tdep): ...this and adjust.
      	(s390_abi_kind, s390_vector_abi_kind, gdbarch_tdep)
      	(enum named opcodes, S390_NUM_GPRS, S390_NUM_FPRS): Move to
      	s390-tdep.h.
      	(s390_break_insn, s390_breakpoint, s390_readinstruction, is_ri)
      	(is_ril, is_rr, is_rre, is_rs, is_rsy, is_rx, is_rxy)
      	(s390_is_partial_instruction, s390_software_single_step)
      	(is_non_branch_ril, s390_displaced_step_copy_insn)
      	(s390_displaced_step_fixup, s390_displaced_step_hw_singlestep)
      	(s390_prologue_data, s390_addr, s390_store, s390_load)
      	(s390_check_for_saved, s390_analyze_prologue, s390_skip_prologue)
      	(s390_register_call_saved, s390_guess_tracepoint_registers)
      	(s390_register_name, s390_dwarf_regmap, s390_dwarf_reg_to_regnum)
      	(regnum_is_gpr_full, regnum_is_vxr_full, s390_value_from_register)
      	(s390_pseudo_register_name, s390_pseudo_register_type)
      	(s390_pseudo_register_read, s390_pseudo_register_write)
      	(s390_pseudo_register_reggroup_p, s390_ax_pseudo_register_collect)
      	(s390_ax_pseudo_register_push_stack, s390_gen_return_address)
      	(s390_addr_bits_remove, s390_address_class_type_flags)
      	(s390_address_class_type_flags_to_name)
      	(s390_address_class_name_to_type_flags, s390_effective_inner_type)
      	(s390_function_arg_float, s390_function_arg_vector)
      	(is_power_of_two, s390_function_arg_integer, s390_arg_state)
      	(s390_handle_arg, s390_push_dummy_call, s390_dummy_id)
      	(s390_frame_align, s390_register_return_value, s390_return_value)
      	(s390_stack_frame_destroyed_p, s390_unwind_pc, s390_unwind_sp)
      	(s390_unwind_pseudo_register, s390_adjust_frame_regnum)
      	(s390_dwarf2_prev_register, s390_dwarf2_frame_init_reg)
      	(s390_trad_frame_prev_register, s390_unwind_cache)
      	(s390_prologue_frame_unwind_cache)
      	(s390_backchain_frame_unwind_cache, s390_frame_unwind_cache)
      	(s390_frame_this_id, s390_frame_prev_register, s390_frame_unwind)
      	(s390_stub_unwind_cache, s390_stub_frame_unwind_cache)
      	(s390_stub_frame_this_id, s390_stub_frame_prev_register)
      	(s390_stub_frame_sniffer, s390_stub_frame_unwind)
      	(s390_frame_base_address, s390_local_base_address)
      	(s390_frame_base, s390_gcc_target_options)
      	(s390_gnu_triplet_regexp, s390_stap_is_single_operand)
      	(s390_validate_reg_range, s390_tdesc_valid)
      	(s390_gdbarch_tdep_alloc, s390_gdbarch_init): Move to...
      	* s390-tdep.c: ...this.  New file.
      d6e58945
    • Philipp Rudo's avatar
      s390: gdbarch_tdep add hook for syscall record · 9c0b896e
      Philipp Rudo authored
      Most parts of s390_process_record are common for the architecture.  Only
      the system call handling differs between the OSes.  In order to be able to
      move s390_process_record to a common code file add a hook to record
      syscalls to gdbarch_tdep.  So every OS can implement their own handling.
      
      gdb/ChangeLog:
      
      	* s390-linux-tdep.c (gdbarch_tdep.s390_syscall_record): New hook.
      	(s390_process_record, s390_gdbarch_tdep_alloc)
      	(s390_linux_init_abi_any): Use/set new hook.
      9c0b896e
    • Philipp Rudo's avatar
      s390: Hook s390 into OSABI mechanism · 7042632b
      Philipp Rudo authored
      Do what the title says and distinguish between 31- and 64-bit systems.
      The goal is to init the OSABI as late as possible in gdbarch_init so the
      OSABI has the chance to overwrite the defaults.
      
      There are two pitfalls to be aware of:
      
      First, the dwarf2 unwinder must be appended before the OSABI is
      initialized.  Otherwise the OS could add a default unwinder which always
      takes control before the dwarf unwinder even gets a chance.
      
      Second, tdesc_use_registers has to be handled with extra care.  It sets
      several gdbarch hooks, especially gdbarch_register_name, which has to be
      overwritten again after the call.  Furthermore it deletes the tdesc_data
      without checking.  Therefore there must not be a call to
      tdesc_data_cleanup afterwards or GDB will crash with a double free.
      
      gdb/ChangeLog:
      
      	* s390-linux-tdep.c (osabi.h): New include.
      	(s390_linux_init_abi_31, s390_linux_init_abi_64)
      	(s390_linux_init_abi_any): New functions.
      	(s390_gdbarch_init, _initialize_s390_tdep): Adjust.
      7042632b
    • Philipp Rudo's avatar
      s390: if -> gdb_assert for tdesc_has_registers check · 650f5e13
      Philipp Rudo authored
      Before doing the tdesc validation there is a check whether the tdesc has
      registers or not.  This check is not only unnecessary but wrong.
      
      First the check is done after a default tdesc is assigned if the original
      tdesc has no registers.  These default tdescs always have registers so the
      check alway returns true.
      
      Second if the default tdesc would not have registers the check only skips
      the tdesc validation instead of returning an error.  This would trigger a
      gdb_assert later on in tdesc_use_registers.
      
      gdb/ChangeLog:
      
      	* s390-linux-tdep.c (s390_gdbarch_init): Use gdb_assert for
      	tdesc_has_registers check
      650f5e13
    • Philipp Rudo's avatar
      s390: Move tdesc validation to separate function · 47c9317e
      Philipp Rudo authored
      Simplify s390_gdbarch_init by moving the target description validation to
      a separate function.
      
      gdb/ChangeLog:
      
      	* s390-linux-tdep.c (s390_tdesc_valid): New function.
      	(s390_validate_reg_range): New macro.
      	(s390_gdbarch_init): Adjust.
      47c9317e
    • Philipp Rudo's avatar
      s390: gdbarch_tdep add field tdesc · 095085d8
      Philipp Rudo authored
      Add a field for the target description to gdbarch_tdep.  This will later be
      needed to pass the 'correct' target description from osabi_init to
      gdbarch_init.  Unfortunately this cannot be done using gdbarch_info as it
      is only passed by copy, not reference.
      
      gdb/ChangeLog:
      
      	* s390-linux-tdep.c (gdbarch_tdep) <tdesc>: New field.
      	(s390_gdbarch_tdep_alloc): Adjust.
      	(s390_gdbarch_init): Adjust.
      095085d8
    • Philipp Rudo's avatar
      s390: gdbarch_tdep.have_* int -> bool · ab9bcc67
      Philipp Rudo authored
      Currently the gdbarch_tdep.have_* flags are a mix of int and bool.  Clean
      this up by making them all bool.
      
      gdb/ChangeLog:
      
      	* s390-linux-tdep.c (gdbarch_tdep) <have_linux_v1, have_linux_v2>
      	<have_tdb>: Change type to bool.
      	(s390_gdbarch_tdep_alloc): Adjust.
      	(s390_gdbarch_init): Adjust.
      ab9bcc67
    • Philipp Rudo's avatar
      s390: Allocate gdbarch & tdep at start of gdbarch_init · 21f6f5ff
      Philipp Rudo authored
      Moving the allocation of gdbarch_tdep to the start of s390_gdbarch_init
      allows us to use its fields for tracking the different features instead of
      using separate variables.  To make the code a little nicer move the actual
      allocation and initialization to a separate function.  Also move the
      allocation of gdbarch to keep the two together.
      
      gdb/ChangeLog:
      
      	* s390-linux-tdep (s390_abi_kind) <ABI_NONE>: New default field.
      	(gdbarch_tdep) <have_upper, have_vx>: New fields.
      	(s390_gdbarch_tdep_alloc): New function.
      	(s390_gdbarch_init): Allocate tdep at start and use its fields
      	instead of separate variables.
      21f6f5ff
    • Philipp Rudo's avatar
      s390: Remove duplicate checks for cached gdbarch at init · 0eb97953
      Philipp Rudo authored
      When initializing the gdbarch there is a check whether an appropriate
      gdbarch already exists in the gdbarch_list.  Failing of some of the checks
      would lead to a different target description.  However
      gdbarch_list_lookup_by_info already checks for
      
      	if (info->target_desc != arches->gdbarch->target_desc)
      	  continue;
      
      Remove these duplicate checks.
      
      gdb/ChangeLog:
      
      	* s390-linux-tdep.c (s390_gdbarch_init): Remove duplicate checks
      	when looking for cached gdbarch and add comment for remaining.
      0eb97953
    • GDB Administrator's avatar
      Automatic date update in version.in · d820e164
      GDB Administrator authored
      d820e164