1. Jan 12, 2021
    • GDB Administrator's avatar
      Automatic date update in version.in · eabdd87b
      GDB Administrator authored
      eabdd87b
    • Mike Frysinger's avatar
      sim: tests: get common tests working again · 254c3783
      Mike Frysinger authored
      These were written with 32-bit host assumptions baked into it.
      Simplify the printf formats to use ll length modifier as it's
      in C11 rather than trying to manually break it up into two,
      and cleanup some of the casts to stop assuming sizeof(long) is
      the same as sizeof(int).
      
      We also have to add a few more includes for the various funcs
      used in here.
      
      The tests aren't compiled automatically still.  We can figure
      that out later with more work.
      254c3783
    • Simon Marchi's avatar
      gdb: convert aarch64 to new-style debug macros · c6185dce
      Simon Marchi authored
      I haven't tried this on an actual aarch64 machine, but I am able to
      exercise it like this:
      
          (gdb) set debug aarch64
          (gdb) maintenance selftest aa
          Running selftest aarch64-analyze-prologue.
          [aarch64] aarch64_analyze_prologue: prologue analysis gave up addr=0x14 opcode=0xf94013e0
          Running selftest aarch64-process-record.
          Ran 2 unit tests, 0 failed
      
      gdb/ChangeLog:
      
      	* arch/aarch64-insn.h (aarch64_debug_printf): New.
      	* arch/aarch64-insn.c: Use aarch64_debug_printf.
      	* aarch64-tdep.c: Use aarch64_debug_printf.
      
      Change-Id: Ifdb40e2816ab8e55a9aabb066d1833d9b5a46094
      c6185dce
    • Simon Marchi's avatar
      gdb: convert solib-aix to new-style debug macros · eef401dc
      Simon Marchi authored
      This is only compile-tested.
      
      gdb/ChangeLog:
      
      	* solib-aix.c (solib_aix_debug_printf): New, use throughout
      	file.
      
      Change-Id: I7ec4baa15ab5b8ad786212b8b9de61c2c447bac1
      eef401dc
    • Simon Marchi's avatar
      gdb: change jit_debug to a bool · 062eaacb
      Simon Marchi authored
      gdb/ChangeLog:
      
      	* jit.c (jit_debug): Change type to bool.
      	(_initialize_jit): Adjust.
      
      Change-Id: Ic2b1eec28eafe8ccb2899f38ddc91ba9703cb38e
      062eaacb
    • Tom de Vries's avatar
      [gdb/testsuite] Fix gdb.arch/amd64-stap-three-arg-disp.S · 10dadadc
      Tom de Vries authored
      On SLE-11 I ran into:
      ...
      (gdb) print $_probe_arg0^M
      Cannot access memory at address 0x8000003fe05c^M
      (gdb) FAIL: gdb.arch/amd64-stap-special-operands.exp: probe: three_arg: \
        print $_probe_arg0
      ...
      
      The memory cannot be accessed because the address used to evaluate
      $_probe_arg0 at the probe point is incorrect.
      
      The address is calculated using this expression:
      ...
      .asciz "-4@-4(%rbp,%ebx,0)"
      ...
      which uses $ebx, but $ebx is uninitialized at the probe point.
      
      The test-case does contain a "movl $0, %ebx" insn to set $ebx to 0, but that
      insn is placed after the probe point.  We could fix this by moving the insn
      to before the probe point.  But, $ebx is also a callee-save register, so
      normally, if we modify it, we also need to save and restore it, which is
      currently not done.  This is currently not harmful, because we don't run the
      test-case further than the probe point, but it's bound to cause confusion.
      
      So, fix this instead by using $eax instead in the expression, and moving the
      insn setting $eax to 0 to before the probe point.
      
      gdb/testsuite/ChangeLog:
      
      2021-01-11  Tom de Vries  <tdevries@suse.de>
      
      	PR testsuite/26968
      	* gdb.arch/amd64-stap-three-arg-disp.S: Remove insn modifying $ebx.
      	Move insn setting $eax to before probe point.
      10dadadc
  2. Jan 11, 2021
    • Kyrylo Tkachov's avatar
      aarch64: Remove support for CSRE · 82c70b08
      Kyrylo Tkachov authored
      This patch removes support for the CSRE extension from aarch64
      gas/objdump.
      CSRE (FEAT_CSRE) is part of the Future Architecture Technologies program
      and at this time Arm is withdrawing this particular feature.
      
      The patch removes the system registers and the CSR PDEC instruction.
      
      gas/ChangeLog
      	* NEWS: Remove CSRE.
      	* config/tc-aarch64.c (parse_csr_operand): Delete.
      	(parse_operands): Delete handling of AARCH64_OPND_CSRE_CSR.
      	(aarch64_features): Remove csre.
      	* doc/c-aarch64.texi: Remove CSRE.
      	* testsuite/gas/aarch64/csre.d: Delete.
      	* testsuite/gas/aarch64/csre-invalid.s: Likewise.
      	* testsuite/gas/aarch64/csre-invalid.d: Likewise.
      	* testsuite/gas/aarch64/csre_csr.s: Likewise.
      	* testsuite/gas/aarch64/csre_csr.d: Likewise.
      	* testsuite/gas/aarch64/csre_csr-invalid.s: Likewise.
      	* testsuite/gas/aarch64/csre_csr-invalid.l: Likewise.
      	* testsuite/gas/aarch64/csre_csr-invalid.d: Likewise.
      
      include/ChangeLog
      
      	* opcode/aarch64.h (AARCH64_FEATURE_CSRE): Delete.
      	(aarch64_opnd): Delete AARCH64_OPND_CSRE_CSR.
      
      opcodes/ChangeLog
      
      	* aarch64-asm-2.c: Regenerate.
      	* aarch64-dis-2.c: Likewise.
      	* aarch64-opc-2.c: Likewise.
      	* aarch64-opc.c (aarch64_print_operand): Delete handling of
      	AARCH64_OPND_CSRE_CSR.
      	* aarch64-tbl.h (aarch64_feature_csre): Delete.
      	(CSRE): Likewise.
      	(_CSRE_INSN): Likewise.
      	(aarch64_opcode_table): Delete csr.
      82c70b08
    • Matt Jenkins's avatar
      Add support for more MIPS variants to the linker command line. · c0f6e439
      Matt Jenkins authored
      	PR ld/27167
      	* ldmain.c (get_emulation): Add mipsmips32r3, mips32r5, mips64r3
      	and mips64r5 to list of known mips targets.
      c0f6e439
    • Mike Frysinger's avatar
      sim: always call SIM_AC_OPTION_WARNINGS · 9c70334d
      Mike Frysinger authored
      Now that all ports have opted in to this, we can require it in the
      core.  It guarantees that new ports have them turned on, and defaults
      to -Werror in the hopes that new ports keep their code clean from the
      start.  We do this as a sep commit to make it clear that there are no
      changes to existing ports as they've all explicitly called it already.
      9c70334d
    • Mike Frysinger's avatar
      sim: call SIM_AC_OPTION_WARNINGS(no) in remaining ports · 5c1008a4
      Mike Frysinger authored
      We want all ports to opt into extra warnings as the default compiler
      settings lets a lot slide.  Opt all the ports that haven't already in
      to the warning system.  None of them build with -Werror, so disable
      that by default.  Hopefully someone finds these important enough to
      start fixing at some point.
      5c1008a4
    • Mike Frysinger's avatar
      sim: or1k: fix include ordering with sim-main.h · a0c38f0d
      Mike Frysinger authored
      Make sure config.h is included before C library headers otherwise the
      later libiberty.h include gets confused about asprintf state leading
      to warnings like:
      common/sim-utils.c:330:9:
      	warning: implicit declaration of function 'vasprintf';
      	did you mean 'xvasprintf'? [-Wimplicit-function-declaration]
      a0c38f0d
    • Mike Frysinger's avatar
      sim: common: fix printf formats · 90e123dd
      Mike Frysinger authored
      For 32-bit targets, %x happens to work for unsigned_word.  But for
      64-bit targets, it's too small, and gcc throws an error.  Use the
      right printf format define for them.
      90e123dd
    • Mike Frysinger's avatar
      sim: rl78: move storage out of header · 93330670
      Mike Frysinger authored
      This port declares its pc variable in a header and then includes
      it multiple times.  This causes linker errors with newer gcc due
      to the change in -fno-common behavior.  Move the storage to a C
      file so we only have one instance of it in the final program.
      93330670
    • Mike Frysinger's avatar
      sim: clean up C11 header includes · 68ed2854
      Mike Frysinger authored
      Since we require C11 now, we can assume many headers exist, and
      clean up all of the conditional includes.  It's not like any of
      this code actually accounted for the headers not existing, just
      whether we could include them.
      
      The strings.h cleanup is a little nuanced: it isn't in C11, but
      every use of it in the codebase will include strings.h only if
      string.h doesn't exist.  Since we now assume the C11 string.h
      exists, we'll never include strings.h, so we can delete it.
      68ed2854
    • Nick Clifton's avatar
      a8aa72b9
    • GDB Administrator's avatar
      Automatic date update in version.in · 46b1518d
      GDB Administrator authored
      46b1518d
  3. Jan 10, 2021
    • GDB Administrator's avatar
      Automatic date update in version.in · 5834526f
      GDB Administrator authored
      5834526f
    • Tom Tromey's avatar
      Avoid crash in compile_to_object · 54585eee
      Tom Tromey authored
      PR 23672 points out a crash in compile_to_object.  This crash came in
      during a C++-ization.  This patch avoids the crash.
      
      The PR also points out another weird behavior in this code, but that
      one requires some setup that I don't have here, and it seems to date
      back to the introduction of the compile feature.  So, it isn't
      addressed here.  I will leave the PR open so this bug isn't forgotten.
      
      gdb/ChangeLog
      2021-01-09  Tom Tromey  <tom@tromey.com>
      
      	PR compile/23672
      	* compile/compile.c (compile_to_object): Avoid crash when
      	osabi_triplet_regexp returns NULL.
      54585eee
    • Tom Tromey's avatar
      Remove a use of print_expression · bc167b6b
      Tom Tromey authored
      The tracepoint code uses print_expression to reconstruct an expression
      string.  However, the original expression is already available -- it
      was just parsed a bit earlier in the same function.  This patch
      changes this code to simply save the already-parsed expression, rather
      than attempt to reconstruct it.
      
      gdb/ChangeLog
      2021-01-09  Tom Tromey  <tom@tromey.com>
      
      	* tracepoint.h (class collection_list) <append_exp>: Take a
      	std::string.
      	* tracepoint.c (collection_list::append_exp): Take a std::string.
      	(encode_actions_1): Update.
      bc167b6b
    • Tom Tromey's avatar
      Fix erroneous agent expression test · 66beed02
      Tom Tromey authored
      Testing of the expression rewrite revealed a buglet in ax.exp.  One
      test does:
      
          gdb_test "maint agent (unsigned char)1L" ".*ext 8.*"
      
      However, zero extension is not actually needed in this case -- a
      simple "const8 1" is also correct here.
      
      This patch changes the test to look for a push of any width of the
      constant 1.
      
      gdb/testsuite/ChangeLog
      2021-01-09  Tom Tromey  <tom@tromey.com>
      
      	* gdb.trace/ax.exp: Do not require an "ext".
      66beed02
  4. Jan 09, 2021
    • H.J. Lu's avatar
      Support the PGO build for binutils+gdb · af019bfd
      H.J. Lu authored
      Add the --enable-pgo-build[=lto] configure option.  When binutils+gdb
      is not built together with GCC, --enable-pgo-build enables the PGO build:
      
      1. First build with -fprofile-generate.
      2. Use "make maybe-check-*" to generate profiling data and pass -i to make
      to ignore errors when generating profiling data.
      3. Use "make clean" to remove the previous build.
      4. Rebuild with -fprofile-use.
      
      With --enable-pgo-build=lto, -flto=jobserver -ffat-lto-objects are used
      together with -fprofile-generate and -fprofile-use.  Add '+' to the command
      line for recursive make to support -flto=jobserver -ffat-lto-objects.
      
      NB: --enable-pgo-build=lto enables the PGO build with LTO while
      --enable-lto enables LTO support in toolchain.
      
      	PR binutils/26766
      	* Makefile.tpl (BUILD_CFLAGS): New.
      	(CFLAGS): Append $(BUILD_CFLAGS).
      	(CXXFLAGS): Likewise.
      	(PGO_BUILD_GEN_FLAGS_TO_PASS): New.
      	(PGO_BUILD_TRAINING_CFLAGS): Likewise.
      	(PGO_BUILD_TRAINING_CXXFLAGS): Likewise.
      	(PGO_BUILD_TRAINING_FLAGS_TO_PASS): Likewise.
      	(PGO_BUILD_TRAINING_MFLAGS): Likewise.
      	(PGO_BUILD_USE_FLAGS_TO_PASS): Likewise.
      	(PGO-TRAINING-TARGETS): Likewise.
      	(PGO_BUILD_TRAINING): Likewise.
      	(all): Add '+' to the command line for recursive make.  Support
      	the PGO build.
      	* configure.ac: Add --enable-pgo-build[=lto].
      	AC_SUBST PGO_BUILD_GEN_CFLAGS, PGO_BUILD_USE_CFLAGS and
      	PGO_BUILD_LTO_CFLAGS.  Enable the PGO build in Makefile.
      	* Makefile.in: Regenerated.
      	* configure: Likewise.
      af019bfd
    • H.J. Lu's avatar
      Binutils: Pass --plugin to AR and RANLIB · a4966cd9
      H.J. Lu authored
      Detect GCC LTO plugin.  Pass --plugin to AR and RANLIB to support LTO
      build.
      
      bfd/
      
      	* configure: Regenerated.
      
      binutils/
      
      	* configure: Regenerated.
      
      gas/
      
      	* configure: Regenerated.
      
      gprof/
      
      	* configure: Regenerated.
      
      ld/
      
      	* configure: Regenerated.
      
      libctf/
      
      	* configure: Regenerated.
      
      opcodes/
      
      	* configure: Regenerated.
      a4966cd9
    • H.J. Lu's avatar
      GCC: Pass --plugin to AR and RANLIB · 50ad1254
      H.J. Lu authored
      Detect GCC LTO plugin.  Pass --plugin to AR and RANLIB to support LTO
      build.
      
      	* Makefile.tpl (AR): Add @AR_PLUGIN_OPTION@
      	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
      	* configure.ac: Include config/gcc-plugin.m4.
      	AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION.
      	* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Pass --plugin to AR and
      	RANLIB if possible.
      	* Makefile.in: Regenerated.
      	* configure: Likewise.
      
      config/
      
      	* gcc-plugin.m4 (GCC_PLUGIN_OPTION): New.
      
      libiberty/
      
      	* Makefile.in (AR): Add @AR_PLUGIN_OPTION@
      	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
      	(configure_deps): Depend on ../config/gcc-plugin.m4.
      	* aclocal.m4: Include ../config/gcc-plugin.m4.
      	* configure.ac: AC_SUBST AR_PLUGIN_OPTION and
      	RANLIB_PLUGIN_OPTION.
      	* configure: Regenerated.
      
      zlib/
      
      	* configure: Regenerated.
      50ad1254
    • Mike Frysinger's avatar
      sim: replace rindex with strrchr · a9fd212a
      Mike Frysinger authored
      a9fd212a
    • Mike Frysinger's avatar
      sim: cr16/d10v: move storage out of header · 7eb99e5e
      Mike Frysinger authored
      These ports declare their State variable in a header and then include
      multiple times.  This causes linker errors with newer gcc due to the
      change in -fno-common behavior.  Move the storage to a C file so we
      only have one instance of it in the final program.
      7eb99e5e
    • Mike Frysinger's avatar
      sim: common: clean up asprintf includes a bit · f074c07d
      Mike Frysinger authored
      Delete stale prototypes that libiberty.h already provides, and add
      missing libiberty.h includes to files that use those functions.
      f074c07d
    • Mike Frysinger's avatar
      sim: sh64: delete port · f8cab0b9
      Mike Frysinger authored
      Support for sh64 was dropped from bfd et al in 2018.  Without
      that, the sim port is useless.  So clean up this code too.
      f8cab0b9
    • Mike Frysinger's avatar
      sim: clean up stale AC_PREREQ refs · 50df264d
      Mike Frysinger authored
      This was purged from the tree when we upgraded to autoconf-2.69,
      but a few references in the sim tree were missed.
      50df264d
    • Mike Frysinger's avatar
      sim: enable -Werror by default for some arches · bf470982
      Mike Frysinger authored
      We've had this off for a long time because the sim code was way too
      full of warnings for it to be feasible.  However, I've cleaned things
      up significantly from when this was first merged, and we can start to
      turn this around.
      
      Change the macro to enable -Werror by default, and allow ports to opt
      out.  New ports will get it automatically (and we can push back on
      them if they try to turn it off).
      
      Also turn it off for the few ports that still hit warnings for me.
      All the rest will get the new default, and we'll wait for feedback
      if/when new issues come up.
      bf470982
    • H.J. Lu's avatar
      ld/x86-64: Properly Handle -z lam-u48/lam-u57 · 0a94990b
      H.J. Lu authored
      Properly merge GNU properties for LAM_U48 and LAM_U57.
      
      bfd/
      
      	PR ld/27166
      	* elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Handle
      	-z lam-u48 and -z lam-u57.
      
      ld/
      
      	PR ld/27166
      	* testsuite/ld-x86-64/lam-u48.rd: New file.
      	* testsuite/ld-x86-64/lam-u57.rd: Likewise.
      	* testsuite/ld-x86-64/x86-64.exp: Add PR ld/27166 tests.
      0a94990b
    • Mike Frysinger's avatar
      sim: pru: fix include ordering with sim-main.h · f4146441
      Mike Frysinger authored
      Make sure config.h is included before C library headers otherwise the
      later libiberty.h include gets confused about asprintf state leading
      to warnings like:
      common/sim-utils.c:330:9:
      	warning: implicit declaration of function 'vasprintf';
      	did you mean 'xvasprintf'? [-Wimplicit-function-declaration]
      f4146441
    • Mike Frysinger's avatar
      sim: hw: rework code to avoid gcc warnings · b5a4a01a
      Mike Frysinger authored
      Newer gcc thinks we might return a pointer to a stack buffer, but
      we don't -- we strdup it before returning.  Rework the code to just
      malloc the buffer from the start and avoid the stack+strdup.
      b5a4a01a
    • Nick Clifton's avatar
      Update release howto with 2.37 numbers · be2c7885
      Nick Clifton authored
      be2c7885
    • Nick Clifton's avatar
      573fe3fb
    • Nick Clifton's avatar
      055bc77a
    • Mike Frysinger's avatar
      ce0be407
    • H.J. Lu's avatar
      ld/x86-64: Also set LAM_U57 when setting LAM_U48 · ba9e922f
      H.J. Lu authored
      Since LAM_U48 implies LAM_U57, also set LAM_U57 when setting LAM_U48.
      
      bfd/
      
      	* elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Also set
      	LAM_U57 when setting LAM_U48.
      
      ld/
      
      	* ld-x86-64/property-x86-lam-u48-4.d: Updated.
      	* ld-x86-64/property-x86-lam-u48-5.d: Likewise.
      ba9e922f
    • H.J. Lu's avatar
      elf: Verify section size for mixed ordered/unordered inputs · b1b29aa5
      H.J. Lu authored
      When fixing up SHF_LINK_ORDER, issue a fatal error if the output section
      size is increased.  Otherwise, bfd_set_section_contents will fail later
      when attempting to write contents past the end of the output section.
      
      	PR ld/26256
      	PR ld/27160
      	* elflink.c (elf_fixup_link_order): Verify that fixing up
      	SHF_LINK_ORDER doesn't increase the output section size.
      b1b29aa5
    • Peter Bergner's avatar
      POWER10: Add Return-Oriented Programming instructions · aae7fcb8
      Peter Bergner authored
      POWER10 adds some return-oriented programming (ROP) instructions and
      this patch adds support for them.  You will notice that they are enabled
      for POWER8 and later, not just POWER10 and later.  This is on purpose.
      This allows the instructions to be added to POWER8 binaries that can be
      run on POWER8, POWER9 and POWER10 cpus.  On POWER8 and POWER9, these
      instructions just act as nop's.
      
      opcodes/
      	* ppc-opc.c (insert_dw, (extract_dw): New functions.
      	(DW, (XRC_MASK): Define.
      	(powerpc_opcodes) <hashchk, hashchkp, hashst, haststp>: New mnemonics.
      gas/
      	* testsuite/gas/ppc/rop-checks.d,
      	* testsuite/gas/ppc/rop-checks.l,
      	* testsuite/gas/ppc/rop-checks.s,
      	* testsuite/gas/ppc/rop.d,
      	* testsuite/gas/ppc/rop.s: New tests.
      	* testsuite/gas/ppc/ppc.exp: Run them.
      aae7fcb8
    • Alan Modra's avatar
      configure regen · 64307045
      Alan Modra authored
      commit f4782128 did the regen by hand, missed a change in
      ld/configure and didn't update line numbers.  Fix that, and an old
      regen of ld/Makefile.in with the wrong automake.
      
      bfd/
      	* configure: Regenerate.
      binutils/
      	* configure: Regenerate.
      gas/
      	* configure: Regenerate.
      gprof/
      	* configure: Regenerate.
      ld/
      	* Makefile.in: Regenerate.
      	* configure: Regenerate.
      libctf/
      	* configure: Regenerate.
      opcodes/
      	* configure: Regenerate.
      zlib/
      	* configure: Regenerate.
      64307045