1. 28 Jun, 2016 2 commits
    • Maciej W. Rozycki's avatar
      MIPS16: Add R_MIPS16_PC16_S1 branch relocation support · c9775dde
      Maciej W. Rozycki authored
      For R_MIPS16_PC16_S1 the calculation is `(sign_extend(A) + S - P) >> 1'
      and the usual MIPS16 bit shuffling applies to relocated field handling,
      as per the encoding of the branch target in the extended form of the
      MIPS16 B, BEQZ, BNEZ, BTEQZ and BTNEZ instructions.
      
      	include/
      	* elf/mips.h (R_MIPS16_PC16_S1): New relocation.
      
      	bfd/
      	* elf32-mips.c (elf_mips16_howto_table_rel): Add
      	R_MIPS16_PC16_S1.
      	(mips16_reloc_map): Likewise.
      	* elf64-mips.c (mips16_elf64_howto_table_rel): Likewise.
      	(mips16_elf64_howto_table_rela): Likewise.
      	(mips16_reloc_map): Likewise.
      	* elfn32-mips.c (elf_mips16_howto_table_rel): Likewise.
      	(elf_mips16_howto_table_rela): Likewise.
      	(mips16_reloc_map): Likewise.
      	* elfxx-mips.c (mips16_branch_reloc_p): New function.
      	(mips16_reloc_p): Handle R_MIPS16_PC16_S1.
      	(b_reloc_p): Likewise.
      	(mips_elf_calculate_relocation): Likewise.
      	(_bfd_mips_elf_check_relocs): Likewise.
      	* reloc.c (BFD_RELOC_MIPS16_16_PCREL_S1): New relocation.
      	* bfd-in2.h: Regenerate.
      	* libbfd.h: Regenerate.
      
      	gas/
      	* config/tc-mips.c (mips16_reloc_p): Handle
      	BFD_RELOC_MIPS16_16_PCREL_S1.
      	(b_reloc_p): Likewise.
      	(limited_pcrel_reloc_p): Likewise.
      	(md_pcrel_from): Likewise.
      	(md_apply_fix): Likewise.
      	(tc_gen_reloc): Likewise.
      	(md_convert_frag): Likewise.
      	(mips_fix_adjustable): Update comment.
      	* testsuite/gas/mips/mips16-branch-reloc-2.d: Remove error
      	output, add dump patterns.
      	* testsuite/gas/mips/mips16-branch-reloc-3.d: Remove error
      	output, add dump patterns.
      	* testsuite/gas/mips/mips16-branch-addend-2.d: Remove error
      	output, add dump patterns.
      	* testsuite/gas/mips/mips16-branch-addend-3.d: Remove error
      	output, add dump patterns.
      	* testsuite/gas/mips/mips16-branch-absolute.d: Remove error
      	output, add dump patterns.
      	* testsuite/gas/mips/mips16-branch-reloc-2.l: Remove file.
      	* testsuite/gas/mips/mips16-branch-reloc-3.l: Remove file.
      	* testsuite/gas/mips/mips16-branch-addend-2.l: Remove file.
      	* testsuite/gas/mips/mips16-branch-addend-3.l: Remove file.
      	* testsuite/gas/mips/mips16-branch-absolute.l: Remove file.
      	* testsuite/gas/mips/mips16-branch-addend-2.s: Add padding.
      	* testsuite/gas/mips/branch-weak.s: Adjust alignment, avoid
      	implicit instruction padding, avoid MIPS16 JR->JRC conversion.
      	* testsuite/gas/mips/branch-weak-6.d: New test.
      	* testsuite/gas/mips/branch-weak-7.d: New test.
      	* testsuite/gas/mips/mips.exp: Run the new tests.
      
      	ld/
      	* testsuite/ld-mips-elf/mips16-branch-2.d: New test.
      	* testsuite/ld-mips-elf/mips16-branch-3.d: New test.
      	* testsuite/ld-mips-elf/mips16-branch-addend-2.d: New test.
      	* testsuite/ld-mips-elf/mips16-branch-addend-3.d: New test.
      	* testsuite/ld-mips-elf/mips16-branch.s: New test source.
      	* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
      c9775dde
    • GDB Administrator's avatar
      Automatic date update in version.in · bac13b9c
      GDB Administrator authored
      bac13b9c
  2. 27 Jun, 2016 13 commits
    • Manish Goregaokar's avatar
      Fix changelog · 6763d566
      Manish Goregaokar authored
      6763d566
    • Manish Goregaokar's avatar
      Print void types correctly in Rust · 921d8f54
      Manish Goregaokar authored
      Rust prefers to not specify the return type of a function when it is unit
      (`()`). The type is also referred to as "void" in debuginfo but not in actual
      usage, so we should never be printing "void" when the language is Rust.
      
      2016-06-27  Manish Goregaokar  <manish@mozilla.com>
      
      gdb/ChangeLog:
          * rust-lang.c (rust_print_type): Print unit types as "()"
          * rust-lang.c (rust_print_type): Omit return type for functions
          returning unit
      
      gdb/testsuite/ChangeLog:
          * gdb.rust/simple.rs: Add test for returning unit in a function
          * gdb.rust/simple.exp: Add expectation for functions returning unit
      921d8f54
    • Vineet Gupta's avatar
      Make the kernel dwarf stack unwinder work for ARC targets. · 45a54ee5
      Vineet Gupta authored
      	* config//tc-arc.c (tc_arc_frame_initial_instructions): Use
      	cfi_add_CFA_def_cfa to generate default CFA with offset
      	* testsuite/gas/cfi/cfi-arc-1.d: Update expected output.
      45a54ee5
    • Nick Clifton's avatar
      Allow a second -T<section>=<addr> to override a previous version on the same linker command line. · 42b7a39b
      Nick Clifton authored
      	PR ld/20302
      	* lexsup.c (set_segment_start): If resetting the start address of
      	a section, remember to generate a new script element as well.
      	* testsuite/ld-scripts/pr20302.d: New test.
      	* testsuite/ld-scripts/scripts.exp: Run the new test.
      42b7a39b
    • Nick Clifton's avatar
      oops - omitted from previous delta · 95daf210
      Nick Clifton authored
      95daf210
    • Nick Clifton's avatar
      Add command line option to stop the assembler from padding the end of sections... · 2edb36e7
      Nick Clifton authored
      Add command line option to stop the assembler from padding the end of sections to their alignment boundary.
      
      	PR gas/20247
      	* as.h (do_not_pad_sections_to_alignment): New global variable.
      	* as.c (show_usage): Add --no-pad-sections.
      	(parse_args): Likewise.
      	* write.c (size_seg): Skip padding the end of the section if
      	requested from the command line.
      	(SUB_SEGMENT_ALIGN): Likewise.
      	* doc/as.texinfo: Document the new option.
      	* NEWS: Mention the new feature.
      	* testsuite/gas/elf/section11.s: New test.
      	* testsuite/gas/elf/section11.d: New test driver.
      	* testsuite/gas/elf/elf.exp: Run the new test.
      2edb36e7
    • Alan Modra's avatar
      PR 19264 looping in ppc64_elf_size_stubs · c9301e31
      Alan Modra authored
      b3991020 fixed the testcase in this PR but it may be possible to
      trigger the problem in other ways.
      
      	PR ld/19264
      	* elf64-ppc.c (STUB_SHRINK_ITER): Define.
      	(ppc64_elf_size_stubs): Exit stub sizing loop past STUB_SHRINK_ITER
      	if shrinking stubs.
      	(ppc64_elf_size_stubs): Adjust to suit.
      c9301e31
    • Pierre-Marie de Rodat's avatar
      Fix use of a dangling pointer for Python breakpoint objects · f4952523
      Pierre-Marie de Rodat authored
      When a Python script tries to create a breakpoint but fails to do so,
      gdb.Breakpoint.__init__ raises an exception and the breakpoint does not
      exist anymore in the Python interpreter. However, GDB still keeps a
      reference to the Python object to be used for a later hook, which is
      wrong.
      
      This commit adds the necessary cleanup code so that there is no stale
      reference to this Python object. It also adds a new testcase to
      reproduce the bug and check the fix.
      
      2016-06-25  Pierre-Marie de Rodat  <derodat@adacore.com>
      
      gdb/
      	* python/py-breakpoint.c (bppy_init): Clear bppy_pending_object
      	when there is an error during the breakpoint creation.
      
      gdb/testsuite
      
      	* gdb.python/py-breakpoint-create-fail.c,
      	gdb.python/py-breakpoint-create-fail.exp,
      	gdb.python/py-breakpoint-create-fail.py: New testcase.
      f4952523
    • Trevor Saunders's avatar
      add ChangeLog entries · 3cd72572
      Trevor Saunders authored
      3cd72572
    • Trevor Saunders's avatar
      dlx: move prototype of dlx_set_skip_hi16 to elf/dlx.h · 48afb194
      Trevor Saunders authored
      bfd/ChangeLog:
      
      2016-06-27  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
      
      	* elf32-dlx.h: New file.
      	* elf32-dlx.c: Adjust.
      
      gas/ChangeLog:
      
      2016-06-27  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
      
      	* config/tc-dlx.c: Include bfd/elf32-dlx.h.
      	* config/tc-dlx.h: Remove prototype of dlx_set_skip_hi16.
      48afb194
    • Trevor Saunders's avatar
      xtensa: remove a sentinal · e066bf5f
      Trevor Saunders authored
      gas/ChangeLog:
      
      2016-06-27  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
      
      	* config/tc-xtensa.c (xtensa_elf_suffix): Use ARRAY_SIZE instead of a
      	sentinal element.
      	(map_suffix_reloc_to_operator): Likewise.
      	(map_operator_to_reloc): Likewise.
      e066bf5f
    • Trevor Saunders's avatar
      nds32: remove a sentinal · 0708347f
      Trevor Saunders authored
      gas/ChangeLog:
      
      2016-06-27  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
      
      	* config/tc-nds32.c (md_begin): Use ARRAY_SIZE instead of a sentinal
      	element in relax_table.
      0708347f
    • GDB Administrator's avatar
      Automatic date update in version.in · cd529d78
      GDB Administrator authored
      cd529d78
  3. 26 Jun, 2016 1 commit
  4. 25 Jun, 2016 9 commits
    • Trevor Saunders's avatar
      aarch64: make the type of reg_entry::type aarch64_reg_type · 8a0b252a
      Trevor Saunders authored
      gas/ChangeLog:
      
      2016-06-25  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
      
      	* config/tc-aarch64.c: Make the type of reg_entry::type
      	aarch_reg_type.
      8a0b252a
    • Trevor Saunders's avatar
      remove a few sentinals · 5703197e
      Trevor Saunders authored
      gas/ChangeLog:
      
      2016-06-25  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
      
      	* config/tc-bfin.c (bfin_cpus): Remove sentinal.
      	(md_parse_option): Adjust.
      	* config/tc-aarch64.c (aarch64_parse_abi): Replace use of a sentinal
      	with iteration from 0 to ARRAY_SIZE.
      	* config/tc-mcore.c (md_begin): Likewise.
      	* config/tc-visium.c (visium_parse_arch): Likewise.
      
      opcodes/ChangeLog:
      
      2016-06-25  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
      
      	* mcore-opc.h: Remove sentinal.
      	* mcore-dis.c (print_insn_mcore): Adjust.
      5703197e
    • Trevor Saunders's avatar
      simplify tic54x_set_default_include () · 4b92e388
      Trevor Saunders authored
      its only called with an argument of 0, so we might as well remove the code
      supporting other values.
      
      gas/ChangeLog:
      
      2016-06-25  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
      
      	* config/tc-tic54x.c (tic54x_set_default_include): remove argument
      							   and simplify accordingly.
      	(tic54x_include): Adjust.
      	(tic54x_mlib): Likewise.
      4b92e388
    • Trevor Saunders's avatar
      xtensa: prototype xtensa_make_property_section in elf/xtensa.h · 7c2c4aa1
      Trevor Saunders authored
      There's no reason to have multiple prototypes for the same function.
      
      include/ChangeLog:
      
      2016-06-25  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
      
      	* elf/xtensa.h (xtensa_make_property_section): New prototype.
      
      gas/ChangeLog:
      
      2016-06-25  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
      
      	* config/tc-xtensa.c (xtensa_make_property_section): Remove prototype.
      
      bfd/ChangeLog:
      
      2016-06-25  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
      
      	* elf32-xtensa.c (xtensa_make_property_section): Remove prototype.
      7c2c4aa1
    • Tom Tromey's avatar
      Fix formatting in rust-lang.c · 9e8a8ea8
      Tom Tromey authored
      This fixes up a few formatting nits in rust-lang.c.
      Built and regtested on x86-64 Fedora 23.
      
      2016-06-25  Tom Tromey  <tom@tromey.com>
      
      	* rust-lang.c (rust_get_disr_info, rust_print_type): Fix
      	formatting.
      9e8a8ea8
    • Manish Goregaokar's avatar
      Add tests for printing of NonZero-optimized enums in Rust · fccb08f8
      Manish Goregaokar authored
      gdb/testsuite/ChangeLog:
      2016-06-25  Manish Goregaokar  <manish@mozilla.com>
      
          PR gdb/20239
          * gdb.rust/simple.rs: Add more tests for printing NonZero enums.
          * gdb.rust/simple.exp: Add test expectations for new NonZero tests.
      fccb08f8
    • Manish Goregaokar's avatar
      Make evaluation and type-printing of all NonZero optimized enums work · b5a4b3c5
      Manish Goregaokar authored
      gdb/ChangeLog:
      2016-06-25  Manish Goregaokar  <manish@mozilla.com>
      
          PR gdb/20239
          * rust-lang.c (rust_get_disr_info): Correctly interpret
          NonZero-optimized enums of arbitrary depth.
          (rust_print_type): Correctly print NonZero-optimized
          enums.
      b5a4b3c5
    • David Taylor's avatar
      Support structure offsets that are 512K or larger. · 6b850546
      David Taylor authored
      GDB computes structure byte offsets using a 32 bit integer.  And,
      first it computes the offset in bits and then converts to bytes.  The
      result is that any offset that if 512K bytes or larger overflows.
      This patch changes GDB to use LONGEST for such calculations.
      
      	PR gdb/17520 Structure offset wrong when 1/4 GB or greater.
      	* c-lang.h: Change all parameters, variables, and struct or union
      	members used as struct or union fie3ld offsets from int to
      	LONGEST.
      	* c-valprint.c: Likewise.
      	* cp-abi.c: Likewise.
      	* cp-abi.h: Likewise.
      	* cp-valprint.c: Likewise.
      	* d-valprint.c: Likewise.
      	* dwarf2loc.c: Likewise.
      	* eval.c: Likewise.
      	* extension-priv.h: Likewise.
      	* extension.c: Likewise.
      	* extension.h: Likewise.
      	* findvar.c: Likewise.
      	* gdbtypes.h: Likewise.
      	* gnu-v2-abi.c: Likewise.
      	* gnu-v3-abi.c: Likewise.
      	* go-valprint.c: Likewise.
      	* guile/guile-internal.h: Likewise.
      	* guile/scm-pretty-print.c: Likewise.
      	* jv-valprint.c Likewise.
      	* opencl-lang.c: Likewise.
      	* p-lang.h: Likewise.
      	* python/py-prettyprint.c: Likewise.
      	* python/python-internal.h: Likewise.
      	* spu-tdep.c: Likewise.
      	* typeprint.c: Likewise.
      	* valarith.c: Likewise.
      	* valops.c: Likewise.
      	* valprint.c: Likewise.
      	* valprint.h: Likewise.
      	* value.c: Likewise.
      	* value.h: Likewise.
      	* p-valprint.c: Likewise.
      	* c-typeprint.c (c_type_print_base): When printing offset, use
      	plongest, not %d.
      	* gdbtypes.c (recursive_dump_type): Ditto.
      6b850546
    • GDB Administrator's avatar
      Automatic date update in version.in · e0204c4d
      GDB Administrator authored
      e0204c4d
  5. 24 Jun, 2016 15 commits
    • Maciej W. Rozycki's avatar
      MIPS16/GAS: Restore unsupported relocation diagnostics · 88a7ef16
      Maciej W. Rozycki authored
      Correct a MIPS16 relocation handling regression in GAS introduced with:
      
      commit 177b4a6a
      Author: Alexandre Oliva <aoliva@redhat.com>
      Date:   Mon Mar 18 18:56:18 2002 +0000
      
      discussed at <https://sourceware.org/ml/binutils/2002-03/msg00345.html>,
      which removed a preparatory call to `mips16_extended_frag' previously
      made from `md_estimate_size_before_relax'.  As a result the function is
      never called with its `sec' parameter non-NULL and consequently all the
      unsupported relocation checks within are dead and never trigger, causing
      any unhandled relocations to silently resolve to 0.  Unfortunately there
      was no sufficient test suite coverage back then to catch this.
      
      Remove all dead code then, and all the associated comments.  Update the
      remaining call to `mips16_extended_frag' from `mips_relax_frag' to pass
      the relocation section as the `sec' parameter and use it to mark frags
      which require an external relocation, as extended.  Finally handle any
      outstanding MIPS16 relocations in `md_convert_frag' and report an error
      since we don't support any except with percent operators.
      
      	gas/
      	* config/tc-mips.c (append_insn): Use any `O_symbol' expression
      	unchanged with relaxed MIPS16 instructions.
      	(mips16_extended_frag): Adjust accordingly.  Return 1 right
      	away if a relocation will be required for the symbol requested.
      	Remove dead first relaxation pass code.
      	(mips_relax_frag): Pass `sec' down to `mips16_extended_frag'.
      	(md_convert_frag): Adjust symbol value calculation.  Raise an
      	error if a relocation is required for the symbol requested.
      	* testsuite/gas/mips/mips16@relax-swap3.d: Remove dump patterns,
      	add error output.
      	* testsuite/gas/mips/mips16@relax-swap3.l: New error output.
      	* testsuite/gas/mips/mips16-pcrel-relax-0.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-relax-1.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-relax-2.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-relax-3.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-reloc-0.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-reloc-1.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-reloc-2.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-reloc-3.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-reloc-4.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-reloc-5.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-reloc-6.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-reloc-7.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-addend-0.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-addend-1.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-addend-2.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-addend-3.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-absolute.d: New test.
      	* testsuite/gas/mips/mips16-branch-reloc-0.d: New test.
      	* testsuite/gas/mips/mips16-branch-reloc-1.d: New test.
      	* testsuite/gas/mips/mips16-branch-reloc-2.d: New test.
      	* testsuite/gas/mips/mips16-branch-reloc-3.d: New test.
      	* testsuite/gas/mips/mips16-branch-addend-0.d: New test.
      	* testsuite/gas/mips/mips16-branch-addend-1.d: New test.
      	* testsuite/gas/mips/mips16-branch-addend-2.d: New test.
      	* testsuite/gas/mips/mips16-branch-addend-3.d: New test.
      	* testsuite/gas/mips/mips16-branch-absolute.d: New test.
      	* testsuite/gas/mips/mips16-absolute-reloc-0.d: New test.
      	* testsuite/gas/mips/mips16-absolute-reloc-1.d: New test.
      	* testsuite/gas/mips/mips16-absolute-reloc-2.d: New test.
      	* testsuite/gas/mips/mips16-absolute-reloc-3.d: New test.
      	* testsuite/gas/mips/mips16-pcrel-reloc-2.l: New error output.
      	* testsuite/gas/mips/mips16-pcrel-reloc-3.l: New error output.
      	* testsuite/gas/mips/mips16-pcrel-reloc-6.l: New error output.
      	* testsuite/gas/mips/mips16-pcrel-reloc-7.l: New error output.
      	* testsuite/gas/mips/mips16-pcrel-addend-2.l: New error output.
      	* testsuite/gas/mips/mips16-pcrel-addend-3.l: New error output.
      	* testsuite/gas/mips/mips16-pcrel-absolute.l: New error output.
      	* testsuite/gas/mips/mips16-branch-reloc-2.l: New error output.
      	* testsuite/gas/mips/mips16-branch-reloc-3.l: New error output.
      	* testsuite/gas/mips/mips16-branch-addend-2.l: New error output.
      	* testsuite/gas/mips/mips16-branch-addend-3.l: New error output.
      	* testsuite/gas/mips/mips16-branch-absolute.l: New error output.
      	* testsuite/gas/mips/mips16-absolute-reloc-2.l: New error output.
      	* testsuite/gas/mips/mips16-absolute-reloc-3.l: New error output.
      	* testsuite/gas/mips/mips16-pcrel-relax-0.s: New test source.
      	* testsuite/gas/mips/mips16-pcrel-relax-2.s: New test source.
      	* testsuite/gas/mips/mips16-pcrel-reloc-0.s: New test source.
      	* testsuite/gas/mips/mips16-pcrel-reloc-1.s: New test source.
      	* testsuite/gas/mips/mips16-pcrel-reloc-2.s: New test source.
      	* testsuite/gas/mips/mips16-pcrel-reloc-3.s: New test source.
      	* testsuite/gas/mips/mips16-pcrel-reloc-4.s: New test source.
      	* testsuite/gas/mips/mips16-pcrel-reloc-5.s: New test source.
      	* testsuite/gas/mips/mips16-pcrel-reloc-6.s: New test source.
      	* testsuite/gas/mips/mips16-pcrel-reloc-7.s: New test source.
      	* testsuite/gas/mips/mips16-pcrel-addend-0.s: New test source.
      	* testsuite/gas/mips/mips16-pcrel-addend-1.s: New test source.
      	* testsuite/gas/mips/mips16-pcrel-addend-2.s: New test source.
      	* testsuite/gas/mips/mips16-pcrel-addend-3.s: New test source.
      	* testsuite/gas/mips/mips16-pcrel-absolute.s: New test source.
      	* testsuite/gas/mips/mips16-branch-reloc-0.s: New test source.
      	* testsuite/gas/mips/mips16-branch-reloc-1.s: New test source.
      	* testsuite/gas/mips/mips16-branch-reloc-2.s: New test source.
      	* testsuite/gas/mips/mips16-branch-reloc-3.s: New test source.
      	* testsuite/gas/mips/mips16-branch-addend-0.s: New test source.
      	* testsuite/gas/mips/mips16-branch-addend-1.s: New test source.
      	* testsuite/gas/mips/mips16-branch-addend-2.s: New test source.
      	* testsuite/gas/mips/mips16-branch-addend-3.s: New test source.
      	* testsuite/gas/mips/mips16-branch-absolute.s: New test source.
      	* testsuite/gas/mips/mips16-absolute-reloc-0.s: New test source.
      	* testsuite/gas/mips/mips16-absolute-reloc-1.s: New test source.
      	* testsuite/gas/mips/mips16-absolute-reloc-2.s: New test source.
      	* testsuite/gas/mips/mips16-absolute-reloc-3.s: New test source.
      	* testsuite/gas/mips/mips.exp: Run the new tests.
      88a7ef16
    • David Taylor's avatar
      2907f414
    • John Baldwin's avatar
      Add support for catching system calls to native FreeBSD targets. · e6cdd38e
      John Baldwin authored
      All platforms on FreeBSD use a shared system call table, so use a
      single XML file to describe the system calls available on each FreeBSD
      platform.
      
      Recent versions of FreeBSD include the identifier of the current
      system call when reporting a system call entry or exit event in the
      ptrace_lwpinfo structure obtained via PT_LWPINFO in fbsd_wait.  As
      such, FreeBSD native targets do not use the gdbarch method to fetch
      the system call code.  In addition, FreeBSD register sets fetched via
      ptrace do not include an equivalent of 'orig_rax' (on amd64 for
      example), so the system call code cannot be extracted from the
      available registers during a system call exit.  However, GDB assumes
      that system call catch points are not supported if the gdbarch method
      is not present.  As a workaround, FreeBSD ABIs install a dummy gdbarch
      method that throws an internal_error if it is ever invoked.
      
      gdb/ChangeLog:
      
      	* configure.ac: Check for support for system call LWP fields on
      	FreeBSD.
      	* config.in, configure: Rebuild.
      	* data-directory/Makefile.in (SYSCALLS_FILES): Add freebsd.xml.
      	* fbsd-nat.c (fbsd_wait) [HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE]:
      	Report system call events.
      	[HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE]
      	(fbsd_set_syscall_catchpoint): New function.
      	(fbsd_nat_add_target) [HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE]:
      	Set "to_set_syscall_catchpoint" to "fbsd_set_syscall_catchpoint".
      	* fbsd-tdep.c: Include xml-syscall.h
      	(fbsd_get_syscall_number): New function.
      	(fbsd_init_abi): Set XML system call file name.
      	Add "get_syscall_number" gdbarch method.
      	* syscalls/freebsd.xml: New file.
      e6cdd38e
    • John Baldwin's avatar
      Add a gdbarch 'print_auxv_entry' method for FreeBSD ABIs. · 82372b2f
      John Baldwin authored
      Add a 'print_auxv_entry' method for FreeBSD ABIs that parses
      FreeBSD-specific auxiliary vector entries and outputs a suitable
      description using fprint_auxv_entry.
      
      gdb/ChangeLog:
      
      	* fbsd-tdep.c: Include "auxv.h".
      	(fbsd_print_auxv_entry): New function.
      	(fbsd_init_abi): Install gdbarch "print_auxv_entry" method.
      82372b2f
    • John Baldwin's avatar
      Add a new gdbarch method to print a single AUXV entry. · 2faa3447
      John Baldwin authored
      Different platforms have different meanings for auxiliary vector
      entries.  The 'print_auxv_entry' gdbarch method allows an architecture
      to output a suitable description for platform-specific entries.
      
      A fprint_auxv_entry function is split out of fprint_target_auxv.
      This function outputs the description of a single auxiliary vector
      entry to the specified file using caller-supplied formatting and
      strings to describe the vector type.
      
      The existing switch on auxiliary vector types is moved out of
      fprint_target_auxv into a new default_print_auxv_entry function.
      default_print_auxv_entry chooses an appropriate format and description
      and calls fprint_single_auxv to describe a single vector entry.
      This function is used as the default 'print_auxv_entry' gdbarch method.
      
      fprint_target_auxv now invokes the gdbarch 'print_auxv_entry' method
      on each vector entry.
      
      gdb/ChangeLog:
      
      	* auxv.c (fprint_auxv_entry): New function.
      	(default_print_auxv_entry): New function.
      	(fprint_target_auxv): Use gdbarch_print_auxv_entry.
      	* auxv.h (enum auxv_format): New enum.
      	(fprint_auxv_entry): Declare.
      	(default_print_auxv_entry): Declare.
      	* gdbarch.sh (print_auxv_entry): New.
      	* gdbarch.c, gdbarch.h: Re-generated.
      2faa3447
    • John Baldwin's avatar
      Create a pseudo section for the ELF AUXV core dump note on FreeBSD. · 3350c5f5
      John Baldwin authored
      The procstat AUXV core dump note in FreeBSD consists of 32-bit integer
      followed by an array of auxiliary vector entries.
      
      bfd/ChangeLog:
      
      	* elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PROCSTAT_AUXV
      	notes.
      3350c5f5
    • John Baldwin's avatar
      Fetch the ELF auxiliary vector from live processes on FreeBSD. · 7697fc9e
      John Baldwin authored
      Use the kern.proc.auxv.<pid> sysctl to fetch the ELF auxiliary vector for
      a live process.
      
      gdb/ChangeLog:
      
      	* fbsd-nat.c [KERN_PROC_AUXV] New variable super_xfer_partial.
      	(fbsd_xfer_partial): New function.
      	(fbsd_nat_add_target) [KERN_PROC_AUXV] Set "to_xfer_partial" to
      	"fbsd_xfer_partial".
      7697fc9e
    • John Baldwin's avatar
      Add elfcore_grok_freebsd_note to parse FreeBSD ELF core notes. · aa1ed4a9
      John Baldwin authored
      Move parsing of FreeBSD-specific ELF core notes out of elfcore_grok_note
      into a new elfcore_grok_freebsd_note function.  Add core note grok routines
      for FreeBSD's psinfo and prstatus notes while here rather than depending
      on the native handling in elfcore_grok_note.
      
      bfd/ChangeLog:
      
      	* elf.c (elfcore_grok_note): Remove handling of NT_X86_XSTATE for
      	FreeBSD.  Remove case for NT_FREEBSD_THRMISC.
      	(elfcore_grok_freebsd_psinfo): New function.
      	(elfcore_grok_freebsd_prstatus): New function.
      	(elfcore_grok_freebsd_note): New function.
      	(elf_parse_notes): Use "elfcore_grok_freebsd_note" for "FreeBSD"
      	notes.
      aa1ed4a9
    • John Baldwin's avatar
      Add constants for FreeBSD-specific auxiliary vector entry types. · b00f86d0
      John Baldwin authored
      include/ChangeLog:
      
      	* elf/common.h (AT_FREEBSD_EXECPATH, AT_FREEBSD_CANARY)
      	(AT_FREEBSD_CANARYLEN, AT_FREEBSD_OSRELDATE, AT_FREEBSD_NCPUS)
      	(AT_FREEBSD_PAGESIZES, AT_FREEBSD_PAGESIZESLEN)
      	(AT_FREEBSD_TIMEKEEP, AT_FREEBSD_STACKPROT): Define.
      b00f86d0
    • Joel Brobecker's avatar
    • Joel Brobecker's avatar
      fix undefined reference to bfd_link_plugin_object_p during link · 08ce1d72
      Joel Brobecker authored
      When configured with the default options, GDB currently fails to link,
      due to an undefined reference to bfd_link_plugin_object_p, coming from
      elflink.c:
      
          #ifdef BFD_SUPPORTS_PLUGINS
                 || (abfd->plugin_format == bfd_plugin_unknown
                    && bfd_link_plugin_object_p (abfd))
          #endif
      
      This is because BFD_SUPPORTS_PLUGINS is always defined. It is its value
      that determines whether plugin support is enabled or not.
      
      bfd/ChangeLog:
      
              * elflink.c: Check the value of BFD_SUPPORTS_PLUGINS rather
              than its existance.
      08ce1d72
    • Alan Modra's avatar
      MIPS objcopy --rename-section fix · 9cc0123f
      Alan Modra authored
      Some MIPS targets use a named section symbol rather than a symbol with
      no name as is used with most ELF targets.  When renaming sections, the
      named section symbol needs to be renamed too.
      
      Rather than fix this bug, I'd originally intended to just correct the
      xfail added recently for update-1.o vs update4.o in update-section.exp,
      using the same set of targets for the localize-hidden-1 mips xfail.
      I'd extracted that target test into a new function, is_bad_symtab.  It
      turns out to be useful in readelf.exp too.
      
      bfd/
      	* config.bfd: Delete mips vxworks patterns matched earlier.
      	Combine mips*-*-none with mips*-*-elf*.
      binutils/
      	* objcopy.c (find_section_rename): Forward declare.  Remove
      	ibfd and sec_ptr param.  Add old_name param.  Allow for NULL
      	returned_flags.  Move read of section name and flags to..
      	(setup_section): ..here.  Update find_section_rename call.
      	(filter_symbols): Rename section symbols for renamed sections.
      	(copy_object): Call filter_symbols when renamed sections.
      	* testsuite/lib/binutils-common.exp (is_bad_symtab): New.
      	* testsuite/binutils-all/update-section.exp: Revert 96037eb0
      	mips xfail.
      	* testsuite/binutils-all/objcopy.exp (copy_executable): Use
      	is_bad_symtab.
      	(localize-hidden-1): xfail if is_bad_symtab.
      	* testsuite/binutils-all/readelf.exp: Use is_bad_symtab to select
      	between mips/tmips.
      9cc0123f
    • Alan Modra's avatar
      aarch64 ld testsuite · 78da3bc1
      Alan Modra authored
      Fixes failure on aarch64-rtems.
      
      	* testsuite/ld-aarch64/aarch64-elf.exp (aarch64_choose_ilp32_emul):
      	Don't error out, always return an emulation.
      78da3bc1
    • Alan Modra's avatar
      alpha-openbsd build failure · 5c0ff163
      Alan Modra authored
      This target doesn't build, due to a missing gas/config/te-obsd.h file.
      It's been that way since the commit switching to elf, in 2002.
      https://lists.gnu.org/archive/html/bug-gnu-utils/2002-07/msg00128.html
      
      	* configure.tgt (alpha-*-openbsd*): Use em=nbsd.
      5c0ff163
    • Alan Modra's avatar
      Limit objdump -S context lines · 43339b1d
      Alan Modra authored
      Showing context lines is confusing in many cases, an obvious example
      being loops.
      
      	* objdump.c (struct print_file_list): Add "max_printed".
      	(try_print_file_open): Init new field.
      	(show_line): Don't show 5 context lines when redisplaying source.
      43339b1d