and though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here

  1. 15 Nov, 2015 1 commit
  2. 14 Nov, 2015 3 commits
  3. 13 Nov, 2015 6 commits
    • Yao Qi's avatar
      PR 19051: support of inferior call with gnu vector support on ARM · c4312b19
      Yao Qi authored
      This patch teaches GDB to support gnu vector in inferior calls.  As a
      result, fails in gdb.base/gnu_vector.exp are fixed.  The calling
      convention of gnu vector isn't documented in the AAPCS, because it
      is the GCC extension.  I checked the gcc/config/arm/arm.c, understand
      how GCC pass arguments and return values, and do the same in GDB side.
      
      The patch is tested with both hard float and soft float on arm-linux.
      
      gdb:
      
      2015-11-13  Yao Qi  <yao.qi@linaro.org>
      
      	PR tdep/19051
      	* arm-tdep.c (arm_type_align): Return the right alignment
      	value for vector.
      	(arm_vfp_cprc_sub_candidate): Return true for 64-bit and
      	128-bit vector types.
      	(arm_return_in_memory): Handel vector type.
      c4312b19
    • Yao Qi's avatar
      Refactor arm_return_in_memory · b13c8ab2
      Yao Qi authored
      Current arm_return_in_memory isn't friendly to adding new things in it.
      Moreover, a lot of stuff are about APCS, which is not used nowadays (AAPCS
      is being used).  This patch is to refactor arm_return_in_memory, so that
      some code can be shared for both APCS and AAPCS at the beginning of
      arm_return_in_memory, and then each ABI (APCS and AAPCS) are processed
      separately.
      
      gdb:
      
      2015-11-13  Yao Qi  <yao.qi@linaro.org>
      
      	* arm-tdep.c (arm_return_in_memory): Rewrite it.
      	(arm_return_value): Call arm_return_in_memory for
      	TYPE_CODE_COMPLEX.
      b13c8ab2
    • Yao Qi's avatar
      Remove d10v from testsuite · c1862d0f
      Yao Qi authored
      This patch removes the leftover of the d10v stuff in the testsuite
      directory. The d10v port was removed in GDB 6.7, but I happen to see
      that there are still some leftovers about d10v in testsuite.
      
      gdb/testsuite:
      
      2015-11-13  Yao Qi  <yao.qi@linaro.org>
      
      	* gdb.base/call-sc.exp (test_scalar_returns): Remove the
      	comments about d10v.
      	(test_scalar_returns): Likewise.
      	* gdb.base/d10v.ld: Remove.
      	* gdb.base/overlays.exp: Remove the target triplet checking for
      	d10v-*-*.
      	* gdb.base/structs.exp (test_struct_returns): Remove the
      	comments about d10v.
      	(test_struct_calls): Likewise.
      c1862d0f
    • Yao Qi's avatar
      gdb.base/gnu_vector.exp: Don't test output from the inferior · 77ae9c19
      Yao Qi authored
      gdb.base/gnu_vector.c printf the vector and gdb.base/gnu_vector.exp
      expects the output by gdb_test_multiple.  Nowadays, the test doesn't
      expect the output from inferior_spawn_id, which is wrong.  Even we
      change the test to expect from inferior_spawn_id for the inferior
      output, it is still possible the inferior exit before tcl/expect gets
      the inferior output.  We see this fail on both s390x-linux and
      ppc-linux on buildbot,
      
        FAIL: gdb.base/gnu_vector.exp: verify vector return value (the program exited)
      
      https://sourceware.org/ml/gdb-testers/2015-q4/msg04922.html
      https://sourceware.org/ml/gdb-testers/2015-q4/msg04952.html
      
      In order to address these two shortcomings above in gnu_vector.exp,
      this patch rewrites the test a little bit.  Get rid of checking the
      inferior output, and instead checking them by printing them.  In this
      way, the test can also be run on the target without inferior io
      (gdb,noinferiorio is set in the board file).
      
      gdb/testsuite:
      
      2015-11-13  Yao Qi  <yao.qi@linaro.org>
      
      	* gdb.base/gnu_vector.exp: Check the return value by "p res".
      	* gdb.base/gnu_vector.c: Don't include stdio.h.
      	(main): Don't print res and call add_some_intvecs.
      77ae9c19
    • Tristan Gingold's avatar
      Add markers for release 2.26 · 7feec526
      Tristan Gingold authored
      binutils/
      2015-11-13  Tristan Gingold  <gingold@adacore.com>
      
      	* NEWS: Add marker for 2.26.
      
      gas/
      2015-11-13  Tristan Gingold  <gingold@adacore.com>
      
      	* NEWS: Add marker for 2.26.
      
      ld/
      2015-11-13  Tristan Gingold  <gingold@adacore.com>
      
      	* NEWS: Add marker for 2.26.
      7feec526
    • GDB Administrator's avatar
      Automatic date update in version.in · 3319bd54
      GDB Administrator authored
      3319bd54
  4. 12 Nov, 2015 8 commits
    • Marcus Shawcroft's avatar
      Revert "[LD][AARCH64]Add TLSIE relaxation support under large memory model." · 06d2788c
      Marcus Shawcroft authored
      This reverts commit 3ebe65c0.
      
      Reverted due to PR19188
      06d2788c
    • James Greenhalgh's avatar
      [AArch64] Add support for Cortex-A35 · 9c352f1c
      James Greenhalgh authored
      This patch adds support to the AArch64 back-end for the Cortex-A35
      processor, as recently announced by ARM. The ARM Cortex-A35 provides
      full support for the ARMv8-A architecture, including the CRC extension,
      with optional Advanced-SIMD and Floating-Point support. We therefore set
      feature flags for this CPU to AARCH64_ARCH_V8 and AARCH64_FEATURE_CRC, in
      the same fashion as Cortex-A53 and Cortex-A57.
      
      Tested in a cross environment for AArch64 with no issues.
      9c352f1c
    • Ramana Radhakrishnan's avatar
    • Ramana Radhakrishnan's avatar
      Add support for Cortex-A35 · 43cdc0a8
      Ramana Radhakrishnan authored
      2015-11-12  James Greenhalgh  <james.greenhalgh@arm.com>
      
      	* config/tc-arm.c (arm_cpus): Likewise.
      	* doc/c-arm.texi (-mcpu=): Likewise.
      43cdc0a8
    • Ramana Radhakrishnan's avatar
      Fix PR gas/19217 · 582cfe03
      Ramana Radhakrishnan authored
      2015-11-11  Matthew Wahab  <matthew.wahab@arm.com>
      
      	PR gas/19217
      	* config/tc-arm.c (move_or_literal_pool): Remove redundant feature
      	check.  Fix some code formatting.  Drop use of MOVT.  Add some
      	comments.
      
      2015-11-11  Matthew Wahab  <matthew.wahab@arm.com>
      
      	PR gas/19217
              * gas/arm/thumb2_ldr_immediate_armv6t2.d: Update expected output.
      582cfe03
    • Yao Qi's avatar
      Use gdb_byte * instead of void * in push_stack_item · df3b6708
      Yao Qi authored
      gdb:
      
      2015-11-12  Yao Qi  <yao.qi@linaro.org>
      
      	* arm-tdep.c (push_stack_item): Change contents type to
      	const gdb_byte *.
      df3b6708
    • Peter Bergner's avatar
      Add assembler, disassembler and linker support for power9. · a680de9a
      Peter Bergner authored
      include/opcode/
      	* ppc.h (PPC_OPCODE_POWER9): New define.
      	(PPC_OPCODE_VSX3): Likewise.
      
      opcodes/
      	* ppc-dis.c (ppc_opts): Add "power9" and "pwr9" entries.
      	Add PPC_OPCODE_VSX3 to the vsx entry.
      	(powerpc_init_dialect): Set default dialect to power9.
              * ppc-opc.c (insert_dcmxs, extract_dcmxs, insert_dxd, extract_dxd,
              insert_dxdn, extract_dxdn, insert_l0, extract_l0, insert_l1,
              extract_l1 insert_xtq6, extract_xtq6): New static functions.
              (insert_esync): Test for illegal L operand value.
      	(DCMX, DCMXS, DXD, NDXD, L0, L1, RC, FC, UIM6, X_R, RIC, PRS, XSQ6,
      	XTQ6, LRAND, IMM8, DQX, DQX_MASK, DX, DX_MASK, VXVAPS_MASK, VXVA,XVA,
      	XX2VA, XVARC, XBF_MASK, XX2UIM4_MASK, XX2BFD_MASK, XX2DCMXS_MASK,
      	XVA_MASK, XRLA_MASK, XBFRARB_MASK, XLRAND_MASK, POWER9, PPCVEC3,
      	PPCVSX3): New defines.
      	(powerpc_opcodes) <ps_cmpu0, ps_cmpo0, ps_cmpu1, ps_cmpo1, fcmpu,
      	fcmpo, ftdiv, ftsqrt>: Use XBF_MASK.
      	<mcrxr>: Use XBFRARB_MASK.
      	<addpcis, bcdcfn., bcdcfsq., bcdcfz., bcdcpsgn., bcdctn., bcdctsq.,
      	bcdctz., bcds., bcdsetsgn., bcdsr., bcdtrunc., bcdus., bcdutrunc.,
      	cmpeqb, cmprb, cnttzd, cnttzd., cnttzw, cnttzw., copy, copy_first,
      	cp_abort, darn, dtstsfi, dtstsfiq, extswsli, extswsli., ldat, ldmx,
      	lwat, lxsd, lxsibzx, lxsihzx, lxssp, lxv, lxvb16x, lxvh8x, lxvl, lxvll,
      	lxvwsx, lxvx, maddhd, maddhdu, maddld, mcrxrx, mfvsrld, modsd, modsw,
      	modud, moduw, msgsync, mtvsrdd, mtvsrws, paste, paste., paste_last,
      	rmieg, setb, slbieg, slbsync, stdat, stop, stwat, stxsd, stxsibx,
      	stxsihx, stxssp, stxv, stxvb16x, stxvh8x, stxvl, stxvll, stxvx,
      	subpcis, urfid, vbpermd, vclzlsbb, vcmpneb, vcmpneb., vcmpneh,
      	vcmpneh., vcmpnew, vcmpnew., vcmpnezb, vcmpnezb., vcmpnezh, vcmpnezh.,
      	vcmpnezw, vcmpnezw., vctzb, vctzd, vctzh, vctzlsbb, vctzw, vextractd,
      	vextractub, vextractuh, vextractuw, vextsb2d, vextsb2w, vextsh2d,
      	vextsh2w, vextsw2d, vextublx, vextubrx, vextuhlx, vextuhrx, vextuwlx,
      	vextuwrx, vinsertb, vinsertd, vinserth, vinsertw, vmul10cuq,
      	vmul10ecuq, vmul10euq, vmul10uq, vnegd, vnegw, vpermr, vprtybd,
      	vprtybq, vprtybw, vrldmi, vrldnm, vrlwmi, vrlwnm, vslv, vsrv, wait,
      	xsabsqp, xsaddqp, xsaddqpo, xscmpeqdp, xscmpexpdp, xscmpexpqp,
      	xscmpgedp, xscmpgtdp, xscmpnedp, xscmpoqp, xscmpuqp, xscpsgnqp,
      	xscvdphp, xscvdpqp, xscvhpdp, xscvqpdp, xscvqpdpo, xscvqpsdz,
      	xscvqpswz, xscvqpudz, xscvqpuwz, xscvsdqp, xscvudqp, xsdivqp,
      	xsdivqpo, xsiexpdp, xsiexpqp, xsmaddqp, xsmaddqpo, xsmaxcdp,
      	xsmaxjdp, xsmincdp, xsminjdp, xsmsubqp, xsmsubqpo, xsmulqp, xsmulqpo,
      	xsnabsqp, xsnegqp, xsnmaddqp, xsnmaddqpo, xsnmsubqp, xsnmsubqpo,
      	xsrqpi, xsrqpix, xsrqpxp, xssqrtqp, xssqrtqpo, xssubqp, xssubqpo,
      	xststdcdp, xststdcqp, xststdcsp, xsxexpdp, xsxexpqp, xsxsigdp,
      	xsxsigqp, xvcmpnedp, xvcmpnedp., xvcmpnesp, xvcmpnesp., xvcvhpsp,
      	xvcvsphp, xviexpdp, xviexpsp, xvtstdcdp, xvtstdcsp, xvxexpdp,
      	xvxexpsp, xvxsigdp, xvxsigsp, xxbrd, xxbrh, xxbrq, xxbrw, xxextractuw,
      	xxinsertw, xxperm, xxpermr, xxspltib>: New instructions.
      	<doze, nap, sleep, rvwinkle, waitasec, lxvx, stxvx>: Disable on POWER9.
      	<tlbiel, tlbie, sync, slbmfev, slbmfee>: Add additional operands.
      
      include/elf/
      	* ppc.h (R_PPC_REL16DX_HA): New reloction.
      	* ppc64.h (R_PPC64_REL16DX_HA): Likewise.
      
      bfd/
      	* elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_REL16DX_HA.
      	(ppc_elf_reloc_type_lookup): Handle R_PPC_REL16DX_HA.
      	(ppc_elf_addr16_ha_reloc): Likewise.
      	(ppc_elf_check_relocs): Likewise.
      	(ppc_elf_relocate_section): Likewise.
      	(is_insn_dq_form): Handle lxv and stxv instructions.
      	* elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_REL16DX_HA.
      	(ppc64_elf_reloc_type_lookup): Handle R_PPC64_REL16DX_HA.
      	(ppc64_elf_ha_reloc): Likewise.
      	(ppc64_elf_check_relocs): Likewise.
      	(ppc64_elf_relocate_section): Likewise.
      	* bfd-in2.h: Regenerate.
      	* libbfd.h: Likewise.
      	* reloc.c (BFD_RELOC_PPC_REL16DX_HA): New.
      
      elfcpp/
      	* powerpc.h (R_POWERPC_REL16DX_HA): Define.
      
      gas/
      	* doc/as.texinfo (Target PowerPC): Document -mpower9 and -mpwr9.
      	* doc/c-ppc.texi (PowerPC-Opts):  Likewise.
      	* config/tc-ppc.c (md_show_usage): Likewise.
      	(md_assemble): Handle BFD_RELOC_PPC_REL16DX_HA.
      	(md_apply_fix): Likewise.
      	(ppc_handle_align): Handle power9's group ending nop.
      
      gas/testsuite/
      	* gas/ppc/altivec3.s: New test.
      	* gas/ppc/altivec3.d: Likewise.
      	* gas/ppc/vsx3.s: Likewise.
      	* gas/ppc/vsx3.d: Likewise.
      	* gas/ppc/power9.s: Likewise.
      	* gas/ppc/power9.d: Likewise.
      	* gas/ppc/ppc.exp: Run them.
      	* gas/ppc/power8.s <lxvx, lxvd2x, stxvx, stxvd2x>: Add new tests.
      	* gas/ppc/power8.d: Likewise.
      	* gas/ppc/vsx.s: <lxvx, stxvx>: Rename invalid mnemonics ...
      	<lxvd2x, stxvd2x>: ...to this.
      	* gas/ppc/vsx.d: Likewise.
      
      gold/
      	* gold/powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function.
      	(Powerpc_relocate_functions::addr16dx_ha): Likewise.
      	(Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA.
      	(Target_powerpc::Scan::global): Likewise.
      	(Target_powerpc::Relocate::relocate): Likewise.
      
      ld/testsuite/
      	* ld-powerpc/addpcis.d: New test.
      	* ld-powerpc/addpcis.s: New test.
      	* ld-powerpc/powerpc.exp: Run it.
      a680de9a
    • GDB Administrator's avatar
      Automatic date update in version.in · 3604307d
      GDB Administrator authored
      3604307d
  5. 11 Nov, 2015 5 commits
    • Marcin Kościelnicki's avatar
      gdb/testsuite/gdb.trace: Deduplicate set_point assembly. · 430e004e
      Marcin Kościelnicki authored
      The assembly code for emitting the proper tracepointable instruction
      was duplicated in many places.  Keep it in one place, to reduce work
      needed for new targets.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.trace/change-loc.h: include "trace-common.h", remove SYMBOL
      	macro.
      	(func5): Removed.
      	(func4): Use FAST_TRACEPOINT_LABEL.
      	* gdb.trace/ftrace-lock.c: include "trace-common.h", remove SYMBOL
      	macro.
      	(func): Removed.
      	(thread_function): Use FAST_TRACEPOINT_LABEL.
      	* gdb.trace/ftrace.c: include "trace-common.h", remove SYMBOL macro.
      	(func): Remove.
      	(marker): Use FAST_TRACEPOINT_LABEL.
      	* gdb.trace/pendshr1.c: include "trace-common.h", remove SYMBOL macro.
      	(pendfunc1): Remove.
      	(pendfunc): Use FAST_TRACEPOINT_LABEL.
      	* gdb.trace/pendshr2.c: include "trace-common.h", remove SYMBOL macro.
      	(foo): Remove.
      	(pendfunc2): Use FAST_TRACEPOINT_LABEL.
      	* gdb.trace/trace-break.c: include "trace-common.h", remove SYMBOL
      	macro.
      	(func): Remove.
      	(marker): Use FAST_TRACEPOINT_LABEL.
      	* gdb.trace/trace-common.h: New header.
      	* gdb.trace/trace-condition.c: include "trace-common.h", remove SYMBOL
      	macro.
      	(func): Remove.
      	(marker): Use FAST_TRACEPOINT_LABEL.
      	* gdb.trace/trace-mt.c: include "trace-common.h", remove SYMBOL macro.
      	(func): Remove.
      	(thread_function): Use FAST_TRACEPOINT_LABEL.
      430e004e
    • Simon Marchi's avatar
      Replace long int * cast with PTRACE_TYPE_RET * · 4397c913
      Simon Marchi authored
      These casts uses the typedef target type (long int *) instead of the
      typedef name.  This was a little mistake in one of the big C++ cast
      patches.
      
      gdb/ChangeLog:
      
      	* inf-ptrace.c (inf_ptrace_fetch_register): Change long int *
      	cast to PTRACE_TYPE_RET *.
      	(inf_ptrace_store_register): Likewise.
      4397c913
    • Andrew Burgess's avatar
      gdb: Make use of 'add_info' to create info sub-commands. · 5f515954
      Andrew Burgess authored
      Switch to using 'add_info' function for creating basic info
      sub-commands.
      
      gdb/ChangeLog:
      
      	* avr-tdep.c (_initialize_avr_tdep): Switch to 'add_info' for creating
      	info sub-commands.
      	* gnu-nat.c (add_task_commands): Likewise.
      	* macrocmd.c (_initialize_macrocmd): Likewise.
      5f515954
    • Andrew Burgess's avatar
      gdb: Use class_info when creating info commands. · f3575e08
      Andrew Burgess authored
      The 'add_info' function is used for creating info commands, these
      commands should be created as 'class_info' rather than 'no_class'.
      
      gdb/ChangeLog:
      
      	* cli/cli-decode.c (add_info): Switch to class_info.
      f3575e08
    • GDB Administrator's avatar
      Automatic date update in version.in · be20f084
      GDB Administrator authored
      be20f084
  6. 10 Nov, 2015 12 commits
    • Marcin Kościelnicki's avatar
      gdb/testsuite/gdb.trace: Deduplicate pcreg/spreg/fpreg. · 6e7675a7
      Marcin Kościelnicki authored
      These variables were used in many gdb.trace tests.  Keep them in one place,
      to reduce work needed for new targets.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.trace/backtrace.exp: Use global fpreg/spreg definition, add $
      	in front.
      	* gdb.trace/change-loc.exp: Use global pcreg definition.
      	* gdb.trace/collection.exp: Use global pcreg/fpreg/spreg definition.
      	* gdb.trace/entry-values.exp: Use global spreg definition, add $
      	in front.
      	* gdb.trace/mi-trace-frame-collected.exp: Use global pcreg definition.
      	* gdb.trace/pending.exp: Likewise.
      	* gdb.trace/report.exp: Use global pcreg/fpreg/spreg definition.
      	* gdb.trace/trace-break.exp: Likewise.
      	* gdb.trace/trace-condition.exp: Use global pcreg definition, add $
      	in front.
      	* gdb.trace/unavailable.exp: Use global pcreg/fpreg/spreg definition.
      	* gdb.trace/while-dyn.exp: Use global fpreg definition, add $
      	in front.
      	* lib/trace-support.exp: Define fpreg, spreg, pcreg variables.
      6e7675a7
    • Jim Wilson's avatar
      Add Qualcomm qdf24xx support. · 6b21c2bf
      Jim Wilson authored
      gas/
      	* config/tc-aarch64.c (aarch64_cpus): Add qdf24xx.
      	* config/tc-arm.c (arm_cpus): Likewise.
      	* doc/c-arm.texi, doc/c-aarch64.texi: Likewise.
      6b21c2bf
    • Nick Clifton's avatar
      Update the RX simulator to handle the latest opcode types. · 634a9f67
      Nick Clifton authored
      	* rx.c (id_names): Add nop4, nop5, nop6 and nop7.
      	(decode_opcode): Likewise.
      	(get_op): Handle RX_Operand_Zero_Indirect.
      	Handle RX_Bad_Size and RX_MAX_SIZE.
      	(put_op): Likewise.
      	(N_MAP): Increase to 90.
      634a9f67
    • H.J. Lu's avatar
      Handle x86 VTINHERIT/VTENTRY relocs when deleting relocations · 18954b29
      H.J. Lu authored
      	* elf32-i386.c (elf_i386_relocate_section): Handle VTINHERIT
      	and VTENTRY relocations when deleting relocations.
      	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
      18954b29
    • H.J. Lu's avatar
      Properly move kept relocations when deleting relocations · 2d5da473
      H.J. Lu authored
      	* elf32-i386.c (elf_i386_relocate_section): Properly move
      	kept relocations when deleting relocations.
      	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
      2d5da473
    • H.J. Lu's avatar
      Fix performance regression on x86 with ld -r · 60f2e42e
      H.J. Lu authored
      Similar fix to "commit c316a17c".
      
      	* elf32-i386.c (elf_i386_relocate_section): Use read and write
      	pointers to reloc array, rather than memmove when deleting a
      	reloc.  Don't use RELOC_AGAINST_DISCARDED_SECTION.  Adjust
      	reloc counts at end of loop.
      	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
      60f2e42e
    • Mike Frysinger's avatar
      sim: cr16/d10v: localize translation funcs · 6637a426
      Mike Frysinger authored
      These functions are only used in the interp module, so there's no point
      in exporting them and declaring them in the external sim interface.
      6637a426
    • Alan Modra's avatar
      Fix performance regression due to ld -r memmove · c316a17c
      Alan Modra authored
      The idea here is that instead of using memmove to shuffle the relocs
      array every time one is deleted, to add a "wrel" pointer and copy from
      rel[0] to wrel[0] as we go.
      
      	* elf64-ppc.c (ppc64_elf_relocate_section): Use read and write
      	pointers to reloc array, rather than memmove when deleting a
      	reloc.  Don't use RELOC_AGAINST_DISCARDED_SECTION.  Adjust
      	reloc counts at end of loop.
      	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
      c316a17c
    • Mike Frysinger's avatar
      sim: m32c: move test code to testsuite · 1057567e
      Mike Frysinger authored
      Various target code belongs in the testsuite/ subdir, so move the m32c
      code to match all the other targets.
      1057567e
    • Mike Frysinger's avatar
      sim: m32c: drop redundant dependency info · 9b4888d5
      Mike Frysinger authored
      9b4888d5
    • Mike Frysinger's avatar
      5697b730
    • GDB Administrator's avatar
      Automatic date update in version.in · 87d094f3
      GDB Administrator authored
      87d094f3
  7. 09 Nov, 2015 5 commits
    • Vladimir Radosavljevic's avatar
      Recognize .pdr debug sections. · cc203475
      Vladimir Radosavljevic authored
      gold/
      	* layout.h (Layout::is_debug_info_section): Recognize .pdr debug
      	sections.
      cc203475
    • Cary Coutant's avatar
      Remove unnecessary target dependencies on relocation format. · 859d7987
      Cary Coutant authored
      2015-11-09  Cary Coutant  <ccoutant@gmail.com>
      	    Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
      
      gold/
      	* copy-relocs.h (Copy_relocs::copy_reloc): Replace reloc parameter
      	with type, offset, addend.
      	(Copy_relocs::save): Likewise.
      	* copy-relocs.cc (Copy_relocs::copy_reloc): Likewise.
      	(Copy_relocs::save): Likewise.
      	* aarch64.cc (Target_aarch64::copy_reloc): Pass r_type, r_offset,
      	and r_addend to Copy_relocs::copy_reloc.
      	* arm.cc (Target_arm::copy_reloc): Likewise.
      	* i386.cc (Target_i386::copy_reloc): Likewise.
      	* mips.cc (Target_mips::copy_reloc): Likewise.
      	* powerpc.cc (Target_powerpc::copy_reloc): Likewise.
      	* s390.cc (Target_s390::copy_reloc): Likewise.
      	* sparc.cc (Target_sparc::copy_reloc): Likewise.
      	* tilegx.cc (Target_tilegx::copy_reloc): Likewise.
      	* x86_64.cc (Target_x86_64::copy_reloc): Likewise.
      859d7987
    • Joel Brobecker's avatar
      [Ada] GDB crash during "finish" of function with out parameters · dddc0e16
      Joel Brobecker authored
      Consider a function with the following signature...
      
         function F (R : out Rec_Type) return Enum_Type;
      
      ... where Rec_Type is a simple record:
      
         type Rec_Type is record
            Cur : Integer;
         end record;
      
      Trying to "finish" from that function causes GDB to SEGV:
      
          (gdb) fin
          Run till exit from #0  bar.f (r=...) at bar.adb:5
          0x00000000004022fe in foo () at foo.adb:5
          5          I : Enum_Type := F (R);
          [1]    18949 segmentation fault (core dumped)  /[..]/gdb
      
      This is related to the fact that funtion F has a parameter (R)
      which is an "out" parameter being passed by copy. For those,
      GNAT transforms the return value to be a record with multiple
      fields: The first one is called "RETVAL" and contains the return
      value shown in the source, and the remaining fields have the same
      name as the "out" or "in out" parameters which are passed by copy.
      So, in the example above, function F returns a struct that has
      one field who name is "r".
      
      Because "RETVAL" starts with "R", GDB thinks it's a wrapper field,
      because it looks like the encoding used for  variant records:
      
         --    member_name ::= {choice} | others_choice
         --    choice ::= simple_choice | range_choice
         --    simple_choice ::= S number
         --    range_choice  ::= R number T number   <<<<<-----  here
         --    number ::= {decimal_digit} [m]
         --    others_choice ::= O (upper case letter O)
      
      See ada_is_wrapper_field:
      
        return (name != NULL
                && (startswith (name, "PARENT")
                    || strcmp (name, "REP") == 0
                    || startswith (name, "_parent")
                    || name[0] == 'S' || name[0] == 'R' || name[0] == 'O'));
      
      As a result of this, when trying to print the RETURN value,
      we think that RETVAL is a wrapper, and thus recurse into
      print_field_values...
      
            if (ada_is_wrapper_field (type, i))
              {
                comma_needed =
                  print_field_values (TYPE_FIELD_TYPE (type, i),
                                      valaddr,
                                      (offset
                                       + TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT),
                                      stream, recurse, val, options,
                                      comma_needed, type, offset, language);
      
      ... which is a problem since print_field_values assumes that
      the type it is given ("TYPE_FIELD_TYPE (type, i)" here), is also
      a record type. However, that's not the case, since RETVAL is
      an enum. That eventually leads GDB to a NULL type when trying to
      extract fields out of the enum, which then leads to a SEGV when
      trying to dereference it.
      
      Ideally, we'd want to be a little more careful in identifying
      wrapper fields, by enhancing ada_is_wrapper_field to be a little
      more complete in its analysis of the field name before declaring
      it a variant record wrapper. However, it's not super easy to do
      so, considering that the choices can be combined together when
      complex choices are used. Eg:
      
         -- [...] the choice 1 .. 4 | 7 | -10 would be represented by
         --    R1T4S7S10m
      
      Given that we are working towards getting rid of GNAT encodings,
      which means that the above will eventually disappear, we took
      the more pragmatic approach is just treating  RETVAL as a special
      case.
      
      gdb/ChangeLog:
      
              * ada-lang.c (ada_is_wrapper_field): Add special handling
              for fields called "RETVAL".
      
      gdb/testsuite/ChangeLog:
      
              * gdb.ada/fin_fun_out: New testcase.
      dddc0e16
    • Dominik Vogt's avatar
      gas: Fix left shift of negative value. · 8d3842cd
      Dominik Vogt authored
      This patch fixes all occurences of left-shifting negative constants in C cod
      which is undefined by the C standard.
      
      gas/ChangeLog:
      
              * read.c (parse_bitfield_cons): Fix left shift of negative value.
              * config/tc-xstormy16.c (md_section_align): Likewise.
              * config/tc-xgate.c (md_section_align): Likewise.
              * config/tc-visium.c (md_section_align): Likewise.
              * config/tc-v850.c (md_section_align): Likewise.
              * config/tc-tic6x.c (md_section_align): Likewise.
              * config/tc-sh.c (SH64PCREL32_M, SH64PCREL48_M, SH64PCREL32_M)
              (MOVI_32_M, MOVI_48_M, MOVI_32_M, md_section_align): Likewise.
              * config/tc-sh64.c (shmedia_md_estimate_size_before_relax): Likewise.
              * config/tc-score.c (s3_section_align): Likewise.
              * config/tc-score7.c (s7_section_align): Likewise.
              * config/tc-s390.c (md_section_align): Likewise.
              * config/tc-rx.c (md_section_align): Likewise.
              * config/tc-rl78.c (md_section_align): Likewise.
              * config/tc-ppc.c (md_section_align): Likewise.
              * config/tc-or1k.c (md_section_align): Likewise.
              * config/tc-nds32.c (md_section_align): Likewise.
              * config/tc-mt.c (md_section_align): Likewise.
              * config/tc-msp430.c (md_section_align): Likewise.
              * config/tc-mn10300.c (md_section_align): Likewise.
              * config/tc-mn10200.c (md_section_align): Likewise.
              * config/tc-mips.c (md_section_align): Likewise.
              * config/tc-microblaze.c (parse_imm): Likewise.
              * config/tc-mep.c (md_section_align): Likewise.
              * config/tc-m68k.c (md_section_align): Likewise.
              * config/tc-m68hc11.c (md_section_align): Likewise.
              * config/tc-m32r.c (md_section_align): Likewise.
              * config/tc-m32c.c (md_section_align): Likewise.
              * config/tc-lm32.c (md_section_align): Likewise.
              * config/tc-iq2000.c (md_section_align): Likewise.
              * config/tc-ip2k.c (md_section_align): Likewise.
              * config/tc-ia64.c (dot_save, dot_vframe): Likewise.
              * config/tc-i960.c (md_number_to_field, md_section_align): Likewise.
              * config/tc-i386.c (md_section_align): Likewise.
              * config/tc-i370.c (md_section_align): Likewise.
              * config/tc-frv.c (md_section_align): Likewise.
              * config/tc-fr30.c (md_section_align): Likewise.
              * config/tc-epiphany.c (md_section_align): Likewise.
              * config/tc-d30v.c (md_section_align): Likewise.
              * config/tc-d10v.c (md_section_align): Likewise.
              * config/tc-cr16.c (l_cons): Likewise.
              * config/tc-bfin.c (md_section_align): Likewise.
              * config/tc-arm.c (md_section_align): Likewise.
              * config/tc-arc.c (md_section_align): Likewise.
              * config/bfin-parse.y (expr_1): Likewise.
      
      gas/testsuite/ChangeLog:
      
              * gas/all/test-gen.c (random_order_16s, random_order_24s)
              (random_order_32s): Fix left shift of negative value.
      8d3842cd
    • Dominik Vogt's avatar
      binutils: Fix left shift of negative value. · c4e0beac
      Dominik Vogt authored
      This patch fixes all occurences of left-shifting negative constants in C code
      which is undefined by the C standard.
      
      binutils/ChangeLog:
      
              * dwarf.c (read_leb128): Fix left shift of negative value.
      c4e0beac