1. 29 Jun, 2016 12 commits
    • Tom Tromey's avatar
      PR gdb/17210 - fix possible memory leak in read_memory_robust · 9d78f827
      Tom Tromey authored
      PR gdb/17210 concerns a possible memory leak in read_memory_robust.
      The bug can happen because read_memory_robust allocates memory, does
      not install any cleanups, and invokes QUIT.  Similarly, target_read
      calls QUIT, so it too can potentially throw.
      
      The fix is to install cleanups to guard the allocated memory.
      
      Built and regtested on x86-64 Fedora 23.  I couldn't think of a way to
      test this, so no new test; and of course this means it should have
      more careful review.
      
      2016-06-29  Tom Tromey  <tom@tromey.com>
      
      	PR gdb/17210:
      	* target.c (free_memory_read_result_vector): Take a pointer to the
      	VEC as an argument.
      	(read_memory_robust): Install a cleanup for "result".
      	* mi/mi-main.c (mi_cmd_data_read_memory_bytes): Update.
      9d78f827
    • H.J. Lu's avatar
      gold: Support 386 TLS code sequences without PLT · b287eca3
      H.J. Lu authored
      There are extensions to 386 psABI:
      
      https://groups.google.com/forum/#!topic/ia32-abi/awsRSvJOJfs
      
      to call tls_get_addr via GOT:
      
      call *___tls_get_addr@GOT(%reg)
      
      where EBX register isn't required as GOT base.
      
      Since direct call is 4-byte long and indirect call, is 5-byte long, the
      extra one byte must be handled properly.
      
      For general dynamic model, 7-byte lea instruction before call
      instruction is replaced by 6-byte one to make room for indirect call.
      For local dynamic model, we simply use 5-byte indirect call.
      
      TLS linker optimization is updated to recognize new instruction
      patterns.  For local dynamic model to local exec model transition,
      we generate a 6-byte lea instruction as nop, instead of a 1-byte nop
      plus a 4-byte lea instruction.
      
      	PR gold/20308
      	* i386.cc (Target_i386::Relocate::relocate): Allow
      	R_386_GOT32X relocation against ___tls_get_addr.
      	(Target_i386::Relocate::tls_gd_to_ie): Support indirect
      	call to __tls_get_addr.
      	(Target_i386::Relocate::tls_gd_to_le): Likewise.
      	(Target_i386::Relocate::tls_ld_to_le): Likewise.
      	* testsuite/Makefile.am (check_PROGRAMS): Add pr20308a_test,
      	pr20308b_test, pr20308c_test, pr20308d_test, pr20308e_test.
      	(pr20308a_test_SOURCES): New.
      	(pr20308a_test_DEPENDENCIES): Likewise.
      	(pr20308a_test_CFLAGS): Likewise.
      	(pr20308a_test_LDFLAGS): Likewise.
      	(pr20308a_test_LDADD): Likewise.
      	(pr20308b_test_SOURCES): Likewise.
      	(pr20308b_test_DEPENDENCIES): Likewise.
      	(pr20308b_test_CFLAGS): Likewise.
      	(pr20308b_test_LDFLAGS): Likewise.
      	(pr20308b_test_LDADD): Likewise.
      	(pr20308c_test_SOURCES): Likewise.
      	(pr20308c_test_DEPENDENCIES): Likewise.
      	(pr20308c_test_CFLAGS): Likewise.
      	(pr20308c_test_LDFLAGS): Likewise.
      	(pr20308c_test_LDADD): Likewise.
      	(pr20308d_test_SOURCES): Likewise.
      	(pr20308d_test_DEPENDENCIES): Likewise.
      	(pr20308d_test_CFLAGS): Likewise.
      	(pr20308d_test_LDFLAGS): Likewise.
      	(pr20308d_test_LDADD): Likewise.
      	(pr20308e_test_SOURCES): Likewise.
      	(pr20308e_test_DEPENDENCIES): Likewise.
      	(pr20308e_test_CFLAGS): Likewise.
      	(pr20308e_test_LDFLAGS): Likewise.
      	(pr20308e_test_LDADD): Likewise.
      	(pr20308a.so): Likewise.
      	(pr20308b.so): Likewise.
      	(pr20308_gd.o): Likewise.
      	(pr20308_ld.o): Likewise.
      	(MOSTLYCLEANFILES): Add pr20308a.so pr20308b.so.
      	* testsuite/Makefile.in: Regenerated.
      	* testsuite/pr20308_def.c: New file.
      	* testsuite/pr20308_gd.S: Likewise.
      	* testsuite/pr20308_ld.S: Likewise.
      	* testsuite/pr20308_main.c: Likewise.
      b287eca3
    • H.J. Lu's avatar
      gold: Support x86-64 TLS code sequences without PLT · ad961eab
      H.J. Lu authored
      There are extensions to x86-64 psABI:
      
      https://groups.google.com/forum/#!topic/x86-64-abi/de5_KnLHxtI
      
      to call tls_get_addr via GOT:
      
      call *__tls_get_addr@GOTPCREL(%rip)
      
      Since direct call is 4-byte long and indirect call, is 5-byte long, the
      extra one byte must be handled properly.
      
      For general dynamic model, one 0x66 prefix before call instruction is
      removed to make room for indirect call.  For local dynamic model, we
      simply use 5-byte indirect call.
      
      TLS linker optimization is updated to recognize new instruction
      patterns.  For local dynamic model to local exec model transition, we
      generate 4 0x66 prefixes, instead of 3, before mov instruction in 64-bit
      and generate a 5-byte nop, instead of 4-byte, before mov instruction in
      32-bit.
      
      	PR gold/20216
      	* configure.ac (DEFAULT_TARGET_X86_64_OR_X32): New
      	AM_CONDITIONAL.
      	* configure: Regenerated.
      	* x86_64.cc (Target_x86_64<size>::Relocate::relocate): Allow
      	R_X86_64_GOTPCRELX relocation against __tls_get_addr.
      	(Target_x86_64<size>::Relocate::tls_gd_to_ie): Support indirect
      	call to __tls_get_addr.
      	(Target_x86_64<size>::Relocate::tls_gd_to_le): Likewise.
      	(Target_x86_64<size>::Relocate::tls_ld_to_le): Likewise.
      	* testsuite/Makefile.am (check_PROGRAMS): Add pr20216a_test,
      	pr20216b_test, pr20216c_test, pr20216d_test, pr20216e_test.
      	(pr20216a_test_SOURCES): New.
      	(pr20216a_test_DEPENDENCIES): Likewise.
      	(pr20216a_test_CFLAGS): Likewise.
      	(pr20216a_test_LDFLAGS): Likewise.
      	(pr20216a_test_LDADD): Likewise.
      	(pr20216b_test_SOURCES): Likewise.
      	(pr20216b_test_DEPENDENCIES): Likewise.
      	(pr20216b_test_CFLAGS): Likewise.
      	(pr20216b_test_LDFLAGS): Likewise.
      	(pr20216b_test_LDADD): Likewise.
      	(pr20216c_test_SOURCES): Likewise.
      	(pr20216c_test_DEPENDENCIES): Likewise.
      	(pr20216c_test_CFLAGS): Likewise.
      	(pr20216c_test_LDFLAGS): Likewise.
      	(pr20216c_test_LDADD): Likewise.
      	(pr20216d_test_SOURCES): Likewise.
      	(pr20216d_test_DEPENDENCIES): Likewise.
      	(pr20216d_test_CFLAGS): Likewise.
      	(pr20216d_test_LDFLAGS): Likewise.
      	(pr20216d_test_LDADD): Likewise.
      	(pr20216e_test_SOURCES): Likewise.
      	(pr20216e_test_DEPENDENCIES): Likewise.
      	(pr20216e_test_CFLAGS): Likewise.
      	(pr20216e_test_LDFLAGS): Likewise.
      	(pr20216e_test_LDADD): Likewise.
      	(pr20216a.so): Likewise.
      	(pr20216b.so): Likewise.
      	(pr20216_gd.o): Likewise.
      	(pr20216_ld.o): Likewise.
      	(MOSTLYCLEANFILES): Add pr20216a.so pr20216b.so.
      	* testsuite/Makefile.in: Regenerated.
      	* testsuite/pr20216_def.c: New file.
      	* testsuite/pr20216_gd.S: Likewise.
      	* testsuite/pr20216_ld.S: Likewise.
      	* testsuite/pr20216_main.c: Likewise.
      ad961eab
    • Manish Goregaokar's avatar
      Initialize strtok_r's saveptr to NULL · 9bf74fb2
      Manish Goregaokar authored
      Building gdb with --enable-build-with-cxx=no trips on a warning:
      
       ../../binutils-gdb/gdb/rust-lang.c:173:15: error: saveptr may be used
       uninitialized in this function [-Werror=maybe-uninitialized]
           ret.name = concat (TYPE_NAME (type), "::", token, (char *) NULL);
      
      The problem is that gcc doesn't understand that "tail" can never be
      NULL in the call to strtok_r:
      
            name = xstrdup (TYPE_FIELD_NAME (type, 0));
            cleanup = make_cleanup (xfree, name);
            tail = name + strlen (RUST_ENUM_PREFIX);
      ...
            for (token = strtok_r (tail, "$", &saveptr);
      
      Fix this by always initializing saveptr.
      
      2016-06-29  Manish Goregaokar  <manish@mozilla.com>
      
      gdb/ChangeLog:
          * rust-lang.c (rust_get_disr_info): Initialize saveptr to NULL.
      9bf74fb2
    • Yao Qi's avatar
      Set unknown_syscall differently on arm linux · 28244707
      Yao Qi authored
      Currently, we use 123456789 as unknown or illegal syscall number, and
      expect program return ENOSYS.  Although 123456789 is an illegal syscall
      number on arm linux, kernel sends SIGILL rather than returns -ENOSYS.
      However, arm linux kernel returns -ENOSYS if syscall number is within
      0xf0001..0xf07ff, so we can use 0xf07ff for unknown_syscall in test.
      
      gdb/testsuite:
      
      2016-06-29  Yao Qi  <yao.qi@linaro.org>
      
      	* gdb.base/catch-syscall.c [__arm__]: Set unknown_syscall to
      	0x0f07ff.
      28244707
    • Trevor Saunders's avatar
      sparc: make SPARC_OPCODE_ARCH_MAX part of its enum · 042c94de
      Trevor Saunders authored
      include/ChangeLog:
      
      2016-06-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
      
      	* opcode/sparc.h (enum sparc_opcode_arch_val): Move
      	SPARC_OPCODE_ARCH_MAX into the enum.
      042c94de
    • Manish Goregaokar's avatar
      Use strtok_r instead of strsep in rust_get_disr_info · a405c228
      Manish Goregaokar authored
      strsep doesn't exist on Windows.
      
      2016-06-29  Manish Goregaokar  <manish@mozilla.com>
      
      gdb/ChangeLog:
          * rust-lang.c (rust_get_disr_info): Use strtok_r instead of strsep.
      a405c228
    • Nick Clifton's avatar
      Preserve all mapping symbols in ARM and AArch64 object files. · d691934d
      Nick Clifton authored
      bfd	* elfnn-aarch64.c (is_aarch64_mapping_symbol): New function.
      	Returns TRUE for AArch64 mapping symbols.
      	(elfNN_aarch64_backend_symbol_processing): New function.  Marks
      	mapping symbols as precious in object files so that they will not
      	be stripped.
      	(elf_backend_symbol_processing): Define.
      
      	* elf32-arm.c (is_arm_mapping_symbol): New function.  Returns TRUE
      	for ARM mapping symbols.
      	(elf32_arm_backend_symbol_processing): Make use of the new function.
      d691934d
    • Nick Clifton's avatar
      Correct fix for typo · 6844c0cc
      Nick Clifton authored
      6844c0cc
    • Nick Clifton's avatar
      Fix typo · c8ec4434
      Nick Clifton authored
      c8ec4434
    • Maciej W. Rozycki's avatar
      GAS: Fix `abort' expansion in write.c · 6d44f09a
      Maciej W. Rozycki authored
      Remove an internal diagnostic regression introduced with the inclusion of
      "libbfd.h" from write.c, added with:
      
      commit e7ff5c73
      Author: Alan Modra <amodra@gmail.com>
      Date:   Fri Feb 16 03:40:17 2007 +0000
      
      That change made "libbfd.h" override the `abort' definition provided by
      "as.h" earlier on, making the message produced by any calls reached from
      write.c, which is a part of the GAS proper, look like they came from
      BFD, e.g.:
      
      .../gas/testsuite/gas/elf/type.s: Assembler messages:
      .../gas/testsuite/gas/elf/type.s:30: Error: symbol type "gnu_unique_object" is supported only by GNU targets
      ../as-new: BFD (GNU Binutils) 2.26.51.20160628 internal error, aborting at .../gas/write.c:608 in size_seg
      
      ../as-new: Please report this bug.
      
      vs:
      
      .../gas/testsuite/gas/elf/type.s: Assembler messages:
      .../gas/testsuite/gas/elf/type.s:30: Error: symbol type "gnu_unique_object" is supported only by GNU targets
      .../gas/testsuite/gas/elf/type.s: Internal error, aborting at .../gas/write.c:602 in size_seg
      Please report this bug.
      
      With the removal of "libbfd.h" restore the latter message format.
      
      	gas/
      	* write.c: Remove "libbfd.h" inclusion.
      6d44f09a
    • GDB Administrator's avatar
      Automatic date update in version.in · 2fafa20b
      GDB Administrator authored
      2fafa20b
  2. 28 Jun, 2016 28 commits
    • Alan Modra's avatar
      [GOLD] Modify script_test_12 · bebf0132
      Alan Modra authored
      Changes necessary to make this test pass on powerpc64.
      
      	* script_test_12.t: Delete .plt, specify 64k page size.
      	* script_test_12i.t: Likewise.
      bebf0132
    • Alan Modra's avatar
      [GOLD] alignment test · 1275dd72
      Alan Modra authored
      PowerPC gcc aligns char arrays to a word which results in the test
      failing since it expects a char alignment.  As the test already uses
      gcc attributes to assign variables to sections, we may as well use an
      attribute to align too.
      
      	* testsuite/plugin_layout_with_alignment.c: Explicitly align all
      	variables.
      1275dd72
    • Alan Modra's avatar
      [GOLD] Disable copy_test_protected on powerpc · 38ac44ac
      Alan Modra authored
      A target like powerpc64 that is PIC by default doesn't need copy relocs.
      
      	* testsuite/Makefile.am (copy_test_protected): Disable for powerpc.
      	* testsuite/Makefile.in: Regenerate.
      38ac44ac
    • Cary Coutant's avatar
    • Igor Kudrin's avatar
      Implement the R_AARCH64_NONE relocation. · 5627d875
      Igor Kudrin authored
      According to "ELF for the ARM(r) 64-bit Architecture (AArch64)",
      this relocation can be used "to prevent removal of sections that
      might otherwise appear to be unused."
      
      gold/
      	* aarch64-reloc.def (NONE): New relocation.
      	* aarch64.cc (Target_aarch64::Scan::local): Handle R_AARCH64_NONE.
      	(Target_aarch64::Scan::global): Likewise.
      	* testsuite/Makefile.am (aarch64_reloc_none): New test.
      	* testsuite/Makefile.in: Regenerate.
      	* testsuite/aarch64_reloc_none.s: New test source file.
      	* testsuite/aarch64_reloc_none.sh: New test script.
      5627d875
    • Sriraman Tallam's avatar
      Convert indirect calls to direct when possible. · 3a4f096e
      Sriraman Tallam authored
      Please see patch discussion:
      https://www.sourceware.org/ml/binutils/2016-05/msg00322.html
      
      2016-06-28  Sriraman Tallam  <tmsriram@google.com>
      
      	* x86_64.cc (Lazy_view): New class.
      	(can_convert_mov_to_lea): Templatize function.  Make the function
      	check for appropriate relocation types and use the view parameter
      	to get section contents.
      	(can_convert_callq_to_direct): New function.
      	(Target_x86_64<size>::Scan::global): Refactor.
      	(Target_x86_64<size>::Relocate::relocate): Refactor. Change any indirect
      	call via GOT that can be converted.
      	* testsuite/Makefile.am (x86_64_indirect_call_to_direct.sh): New test.
      	* testsuite/Makefile.in: Regenerate.
      	* testsuite/x86_64_indirect_call_to_direct1.s: New file.
      	* testsuite/x86_64_indirect_jump_to_direct1.s: New file.
      3a4f096e
    • Igor Kudrin's avatar
      Implement SORT_BY_INIT_PRIORITY. · 8032ac03
      Igor Kudrin authored
      2016-06-28  Igor Kudrin  <ikudrin@accesssoftek.com>
      
      gold/
      	PR gold/18098
      	* script-c.h (Sort_wildcard): Add SORT_WILDCARD_BY_INIT_PRIORITY.
      	* script-sections.cc (Input_section_sorter::get_init_priority): New method.
      	(Input_section_sorter::operator()): Handle SORT_WILDCARD_BY_INIT_PRIORITY.
      	(Output_section_element_input::print): Likewise.
      	* script.cc (script_keyword_parsecodes): Add entry SORT_BY_INIT_PRIORITY.
      	* yyscript.y (SORT_BY_INIT_PRIORITY): New token.
      	(wildcard_section): Handle SORT_BY_INIT_PRIORITY.
      
      	* testsuite/Makefile.am (script_test_14): New test.
      	* testsuite/Makefile.in: Regenerate.
      	* testsuite/script_test_14.s: New test source file.
      	* testsuite/script_test_14.sh: New test script.
      	* testsuite/script_test_14.t: New test linker script.
      8032ac03
    • Igor Kudrin's avatar
      Implement SORT_BY_INIT_PRIORITY. · f224a3c5
      Igor Kudrin authored
      2016-06-28  Igor Kudrin  <ikudrin@accesssoftek.com>
      
      gold/
      	PR gold/18098
      	* script-c.h (Sort_wildcard): Add SORT_WILDCARD_BY_INIT_PRIORITY.
      	* script-sections.cc (Input_section_sorter::get_init_priority): New method.
      	(Input_section_sorter::operator()): Handle SORT_WILDCARD_BY_INIT_PRIORITY.
      	(Output_section_element_input::print): Likewise.
      	* script.cc (script_keyword_parsecodes): Add entry SORT_BY_INIT_PRIORITY.
      	* yyscript.y (SORT_BY_INIT_PRIORITY): New token.
      	(wildcard_section): Handle SORT_BY_INIT_PRIORITY.
      
      	* testsuite/Makefile.am (script_test_14): New test.
      	* testsuite/Makefile.in: Regenerate.
      	* testsuite/script_test_14.s: New test source file.
      	* testsuite/script_test_14.sh: New test script.
      	* testsuite/script_test_14.t: New test linker script.
      f224a3c5
    • Walter Lee's avatar
      [TILEPro] Don't build gdb · 9abdce70
      Walter Lee authored
      In configure.ac, add gdb to noconfigdirs for TILEPro.
      
             * configure.ac (tilepro-*-*): Add gdb to noconfigdirs.
             * configure: Regenerate.
      9abdce70
    • Yao Qi's avatar
      [AArch64] Use int64_t for address offset · 2ac09a5b
      Yao Qi authored
      In AArch64 displaced stepping and fast tracepoint, GDB/GDBserver needs
      to check whether the offset can fit in the range.  We are using int32_t
      for offset, it is sufficient to get an offset from an instruction, but
      it is not enough to get an offset from two addresses.  For example,
      we have a BL in shared lib which is at 0x0000002000040774, and the
      scratch pad for displaced stepping is at 0x400698.  The offset can't
      fit in 28 bit imm.  However, since we are using int32_t for offset, GDB
      thinks the offset can fit it, and generate the B instruction with wrong
      offset.
      
      It fixes the following fail,
      
      -FAIL: gdb.base/dso2dso.exp: next over call to sub2
      
      gdb:
      
      2016-06-28  Yao Qi  <yao.qi@linaro.org>
      
      	* aarch64-tdep.c (aarch64_displaced_step_b): Use int64_t for
      	variable new_offset.
      
      gdb/gdbserver:
      
      2016-06-28  Yao Qi  <yao.qi@linaro.org>
      
      	* linux-aarch64-low.c (aarch64_ftrace_insn_reloc_b): Use int64_t
      	for variable new_offset.
      	(aarch64_ftrace_insn_reloc_b_cond): Likewise.
      	(aarch64_ftrace_insn_reloc_cb): Likewise.
      	(aarch64_ftrace_insn_reloc_tb): Likewise.
      	(aarch64_install_fast_tracepoint_jump_pad): Likewise.  Use
      	PRIx64 instead of PRIx32.
      2ac09a5b
    • Nick Clifton's avatar
      Fix typo in previous commit · bb95c51a
      Nick Clifton authored
      bb95c51a
    • H.J. Lu's avatar
      Skip version check for unreferenced and undefined symbol · f4ab0e2d
      H.J. Lu authored
      No need to check version if symbol is unreferenced and undefined.
      
      bfd/
      
      	PR ld/20306
      	* elflink.c (elf_link_check_versioned_symbol): Return false
      	for unreferenced undefined symbol.
      
      ld/testsuite/
      
      	* testsuite/ld-gc/gc.exp: Run pr20306 test.
      	* ld-gc/pr20306.c: New file.
      	* ld-gc/pr20306.d: Likewise.
      f4ab0e2d
    • Nick Clifton's avatar
      Fix more linker testsuite failures. · 1b857aee
      Nick Clifton authored
      bfin	* elf32-bfin.c (bfin_adjust_dynamic_symbol): Fail if a COPY reloc
      	is needed.
      
      ld	* testsuite/ld-elf/comm-data.exp: Expect comm-data2 test to fail
      	for bfin.
      	* testsuite/ld-elf/elf.exp: Expect pr14170 and symbolic function
      	tests to fail for bfin.
      	* testsuite/ld-elf/endsym.d: Expect to fail with cr16, crx, dlx,
      	nds32 and visium.
      	* testsuite/ld-elf/var1.d: Expect to fail with d30v, dlx, ft32 and
      	microblaze.
      	* testsuite/ld-pe/pe.exp: Expect foreign symbol test to fail for
      	mcore-pe.
      1b857aee
    • Nick Clifton's avatar
      Relax previous restriction on running binutils ar tests for Alpha targets,... · 50c901ed
      Nick Clifton authored
      Relax previous restriction on running binutils ar tests for Alpha targets, allowing the tests to be run for ELF variants.
      
      	* testsuite/binutils-all/ar.exp: Relax previous restriction on
      	Alpha targets.  Allow ELF based Alpha targets.
      50c901ed
    • Maciej W. Rozycki's avatar
      Use `supports_gnu_unique' with the `unique_symbol' and `type' tests · eb9bb5b4
      Maciej W. Rozycki authored
      Complement commit a43942db ("LD/ELF: Unify STB_GNU_UNIQUE handling")
      and use `supports_gnu_unique' with the `unique_symbol' and `type' tests,
      fixing failures like:
      
      .../binutils/testsuite/binutils-all/unique.s: Assembler messages:
      .../binutils/testsuite/binutils-all/unique.s:2: Error: symbol type "gnu_unique_object" is supported only by GNU targets
      
      ERROR: .../binutils/testsuite/binutils-all/unique.s: assembly failed
      UNRESOLVED: ar unique symbol in archive
      .../binutils/ar -s -r -c tmpdir/artest.a tmpdir/unique.o
      Executing on host: .../binutils/ar -s -r -c tmpdir/artest.a tmpdir/unique.o   (timeout = 300)
      .../binutils/ar: tmpdir/unique.o: No such file or directory
      
      FAIL: ar unique symbol in archive
      
      and:
      
      .../gas/testsuite/gas/elf/type.s: Assembler messages:
      .../gas/testsuite/gas/elf/type.s:30: Error: symbol type "gnu_unique_object" is supported only by GNU targets
      ../as-new: BFD (GNU Binutils) 2.26.51.20160628 internal error, aborting at .../gas/write.c:608 in size_seg
      
      ../as-new: Please report this bug.
      
      .../gas/testsuite/../../binutils/readelf -s dump.o | grep "1 *\[FIONTCU\]" > dump.out
      Executing on host: sh -c {.../gas/testsuite/../../binutils/readelf -s dump.o >readelf.out 2>gas.stderr}  /dev/null  (timeout = 300)
      readelf: Error: dump.o: Failed to read file's magic number
      FAIL: elf type list
      
      on MIPS/FreeBSD targets:
      
      mips-freebsd  -FAIL: ar unique symbol in archive
      mips-freebsd  -FAIL: elf type list
      mips64-freebsd  -FAIL: ar unique symbol in archive
      mips64-freebsd  -FAIL: elf type list
      mips64el-freebsd  -FAIL: ar unique symbol in archive
      mips64el-freebsd  -FAIL: elf type list
      mipsel-freebsd  -FAIL: ar unique symbol in archive
      mipsel-freebsd  -FAIL: elf type list
      
      	binutils/
      	* testsuite/binutils-all/ar.exp: Use `supports_gnu_unique' with
      	the `unique_symbol' test.
      
      	gas/
      	* testsuite/gas/elf/elf.exp: Use `supports_gnu_unique' with the
      	`type' test.
      eb9bb5b4
    • Nick Clifton's avatar
      Mark ARM mapping symbols in object files are precious, so that strip will not remove them. · fca2a38f
      Nick Clifton authored
      	* elf32-arm.c (elf32_arm_backend_symbol_processing): New
      	function.  Marks mapping symbols in object files as precious, so
      	that strip will not remove them.
      	(elf_backend_symbol_processing): Define.
      fca2a38f
    • Nick Clifton's avatar
      Fix RX and M68HC11 linker testsuite failures. · 8b9a915d
      Nick Clifton authored
      ld	* testsuite/ld-elf/merge.d: Add m68hc11 to list of targets that
      	expect to fail this test.
      	* testsuite/ld-scripts/overlay-size.d: Skip the entire test for
      	RX.
      	* testsuite/ld-scripts/rgn-at10.d: No longer expect this test to
      	fail for the RX.
      	* testsuite/ld-scripts/rgn-at11.d: Likewise.
      	* testsuite/ld-scripts/rgn-at2.d: Likewise.
      	* testsuite/ld-scripts/rgn-at6.d: Likewise.
      	* testsuite/ld-scripts/rgn-at7.d: Likewise.
      	* testsuite/ld-scripts/rgn-at8.d: Likewise.
      8b9a915d
    • Yao Qi's avatar
      Implement get_syscall_trapinfo for arm-linux · 79e7fd4f
      Yao Qi authored
      gdb/gdbserver:
      
      2016-06-28  Yao Qi  <yao.qi@linaro.org>
      
      	* linux-arm-low.c (arm_get_syscall_trapinfo): New function.
      	(the_low_target): Install arm_get_syscall_trapinfo.
      79e7fd4f
    • Yao Qi's avatar
      Implement get_syscall_trapinfo for aarch64-linux · 061fc021
      Yao Qi authored
      gdb/gdbserver:
      
      2016-06-28  Yao Qi  <yao.qi@linaro.org>
      
      	* linux-aarch64-low.c (aarch64_get_syscall_trapinfo): New
      	function.
      	(the_low_target): Install aarch64_get_syscall_trapinfo.
      061fc021
    • Yao Qi's avatar
      Remove parameter sysret from linux_target_ops.get_syscall_trapinfo · 4cc32bec
      Yao Qi authored
      When I implement linux_target_ops.get_syscall_trapinfo for aarch64 and arm,
      I find the second parameter sysret isn't used at all.  In RSP, we don't
      need syscall return value either, because GDB can figure out the return
      value from registers content got by 'g' packet.
      
      This patch is to remove them.
      
      gdb/gdbserver:
      
      2016-06-28  Yao Qi  <yao.qi@linaro.org>
      
      	* linux-low.c (get_syscall_trapinfo): Remove parameter sysret.
      	Callers updated.
      	* linux-low.h (struct linux_target_ops) <get_syscall_trapinfo>:
      	Remove parameter sysno.
      	* linux-x86-low.c (x86_get_syscall_trapinfo): Remove parameter
      	sysret.
      4cc32bec
    • Yao Qi's avatar
      Probe catch syscall support · a31d2f06
      Yao Qi authored
      In 82075af2 (Implement 'catch syscall'
      for gdbserver), only x86 is supported, but the test can still be run
      on other linux targets, like aarch64 and ppc, with native-gdbserver.
      This causes many new fails.
      
      This patch removes the check on isnative and on target triplets.
      Instead, we can insert catch point, and resume the program to see whether
      catch syscall is supported or not.
      
      gdb/testsuite:
      
      2016-06-28  Yao Qi  <yao.qi@linaro.org>
      
      	* gdb.base/catch-syscall.exp: Remove check on isnative and target
      	triplets.  Start gdb, execute catch syscall, and continue.  Check
      	gdb's output to determine catch syscall is supported.
      a31d2f06
    • James Clarke's avatar
      Don't convert R_SPARC_32 to R_SPARC_RELATIVE if class is ELFCLASS64. · 7160c10d
      James Clarke authored
      bfd	* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Don't convert
      	R_SPARC_32 to R_SPARC_RELATIVE if class is ELFCLASS64.
      
      gold	* sparc.cc (Target_sparc::Scan::local): Don't convert R_SPARC_32
      	to R_SPARC_RELATIVE if class is ELFCLASS64.
      	(Target_sparc::Scan::global): Likewise.
      
      ld	* testsuite/ld-elf/symbolic-func.r: Allow non-zero offsets from
      	.text.
      7160c10d
    • Maciej W. Rozycki's avatar
      MIPS/LD/testsuite: Accept any UNIX OS/ABI with GNU attribute tests · 6c9a7fb6
      Maciej W. Rozycki authored
      Remove failures with FreeBSD targets, e.g:
      
      regexp_diff match failure
      regexp "^  OS/ABI:                            UNIX - System V$"
      line   "  OS/ABI:                            UNIX - FreeBSD"
      FAIL: ld-mips-elf/attr-gnu-4-50
      
      introduced with commit 351cdf24 ("[MIPS] Implement O32 FPXX, FP64
      and FP64A ABI extensions").
      
      	ld/
      	* testsuite/ld-mips-elf/attr-gnu-4-10.d: Match any UNIX OS/ABI.
      	* testsuite/ld-mips-elf/attr-gnu-4-50.d: Likewise.
      	* testsuite/ld-mips-elf/attr-gnu-4-60.d: Likewise.
      	* testsuite/ld-mips-elf/attr-gnu-4-70.d: Likewise.
      6c9a7fb6
    • Alan Modra's avatar
      Fix new testcase for hppa64 · d48796b5
      Alan Modra authored
      Anything in first column is a label on hppa64.
      
      	PR gas/20247
      	* testsuite/gas/elf/section11.s: Don't start directives in first column.
      d48796b5
    • Alan Modra's avatar
      Don't run ld-scripts/pr20302 on linuxaout · 56a30421
      Alan Modra authored
      	PR ld/20302
      	* testsuite/ld-scripts/pr20302.d: Exclude *-*-*aout.
      56a30421
    • Alan Modra's avatar
      Invalid read in _bfd_elf_get_symbol_version_string · f2b2af2c
      Alan Modra authored
      	PR 20304
      	* objdump.c (objdump_print_symname): Don't attempt to retrieve
      	version info from synthetic symbols.
      f2b2af2c
    • Richard Sandiford's avatar
      [AArch64] Make register indices be full 64-bit values · dab26bf4
      Richard Sandiford authored
      aarch64_opnd_info used bitfields to hold vector element indices,
      but values were stored into those bitfields before their ranges had
      been checked.  This meant large invalid indices could be silently
      truncated to smaller valid indices.
      
      The two obvious fixes were to do the range checking earlier or use
      a full 64-bit field for the index.  I went for the latter for two
      reasons:
      
            - Doing the range checking in operand_general_constraint_met_p
              seems structurally cleaner than doing it while parsing.
      
            - The bitfields didn't really buy us anything.  The imm field
              of the union is already 128 bits, so we can use a full int64_t
              index without growing the structure.
      
      The patch also adds missing range checks for the elements in a register
      list index.
      
      include/
      	* opcode/aarch64.h (aarch64_opnd_info): Change index fields to int64_t.
      
      opcodes/
      	* aarch64-opc.c (operand_general_constraint_met_p): Check the
      	range of ldst_elemlist operands.
      	(print_register_list): Use PRIi64 to print the index.
      	(aarch64_print_operand): Likewise.
      
      gas/
      	* testsuite/gas/aarch64/diagnostic.s,
      	testsuite/gas/aarch64/diagnostic.l: Add tests for out-of-range indices.
      dab26bf4
    • 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