1. 27 Jan, 2018 4 commits
  2. 26 Jan, 2018 3 commits
    • Maciej W. Rozycki's avatar
      MIPS/GAS: Correct default ABI selection for `mips64*-ps2-elf*' · 3010b182
      Maciej W. Rozycki authored
      Correct an issue with the `mips64*-ps2-elf*' target introduced with
      commit e407c74b ("Support for MIPS R5900 (Sony Playstation 2)"),
      <https://sourceware.org/ml/binutils/2012-12/msg00240.html> and make
      the n32 ABI the default for GAS, consistently with how BFD and LD
      are configured for this target.
      	* configure.ac: Also set `mips_default_abi' to N32_ABI for
      	* configure: Regenerate.
      (cherry picked from commit 0984958b)
    • Alan Modra's avatar
      PowerPC64 .branch_lt size change leads to "stubs don't match calculated size" · e1807cef
      Alan Modra authored
      I haven't analyzed this myself, I'm relying on Nick's excellent
      analysis.  What I believe is happening is that after some number of
      stub sizing iterations, a long-branch stub needs to be converted to a
      plt-branch, but either due to stub alignment or other stubs shrinking
      in size, the stub group section size doesn't change.
      That means we exit from ppc64_elf_size_stubs after sizing with an
      incorrect layout, in fact the additional .branch_lt entry overlays
      .got!  Since .TOC. is normally set to .got + 0x8000 the stub sizing
      code decides that entry is within +/-32k of the TOC pointer and so a
      three insn stub is sufficient.  When we come to build the stubs using
      a correct non-overlaying layout, a four insn plt-branch stub is
      generated and the stub group size doesn't match that calculated
      	* elf64-ppc.c (ppc64_elf_size_stubs): Iterate sizing when
      	.branch_lt changes size.
      (cherry picked from commit ba21f564)
    • GDB Administrator's avatar
      Automatic date update in version.in · dcfb97d4
      GDB Administrator authored
  3. 25 Jan, 2018 2 commits
    • Eric Botcazou's avatar
      Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC). · 220cf7e7
      Eric Botcazou authored
      There are actually 2 different bugs:
       1. TLS transition is broken in PIE mode.
       2. TLS is broken in PIC/PIE mode when the __tls_get_addr symbol
          is versioned  (as is the case on Linux and Solaris at least).
      The 1st bug is fixed by reverting the problematic change for now
      (note that the associated test doesn't pass on SPARC because of another
      issue so there is  no formal regression in the testsuite). The 2nd bug
      is fixed by changing the  call to _bfd_generic_link_add_one_symbol
      on __tls_get_addr into a mere lookup in _bfd_sparc_elf_check_relocs.
      	* elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
      	Do a mere lookup of the __tls_get_addr symbol instead of adding it.
      	2017-10-19  H.J. Lu  <hongjiu.lu@intel.com>
      	PR ld/22263
      	* elfxx-sparc.c (sparc_elf_tls_transition): Replace
      	bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
      	bfd_link_executable for TLS check.
      	(_bfd_sparc_elf_check_relocs): Likewise.
      	(allocate_dynrelocs): Likewise.
      	(_bfd_sparc_elf_relocate_section): Likewise.
      	* testsuite/ld-sparc/sparc.exp (32-bit: Helper shared library):
      	Link with a version script.
      	(32-bit: TLS -fpie): New test.
      	(64-bit: Helper shared library): Link with a version script.
      	(64-bit: TLS -fpie): New test.
      	(64-bit: GOTDATA relocations): Pass -Av9 to the assembler.
      	* testsuite/ld-sparc/tlslib.ver: New file.
      	* testsuite/ld-sparc/tlspie32.dd: Likewise.
      	* testsuite/ld-sparc/tlspie32.s: Likewise.
      	* testsuite/ld-sparc/tlspie64.dd: Likewise.
      	* testsuite/ld-sparc/tlspie64.s: Likewise.
      	* testsuite/ld-sparc/tlssunbin32.dd: Adjust for versioned symbol.
      	* testsuite/ld-sparc/tlssunbin32.rd: Likewise.
      	* testsuite/ld-sparc/tlssunbin32.sd: Likewise.
      	* testsuite/ld-sparc/tlssunbin64.dd: Likewise.
      	* testsuite/ld-sparc/tlssunbin64.rd: Likewise.
      	* testsuite/ld-sparc/tlssunbin64.sd: Likewise.
    • GDB Administrator's avatar
      Automatic date update in version.in · 8cf13bf2
      GDB Administrator authored
  4. 24 Jan, 2018 3 commits
  5. 23 Jan, 2018 2 commits
  6. 22 Jan, 2018 5 commits
  7. 21 Jan, 2018 1 commit
  8. 20 Jan, 2018 2 commits
    • H.J. Lu's avatar
      x86: Check the versioned __tls_get_addr symbol · 0a99d340
      H.J. Lu authored
      We need to check the versioned __tls_get_addr symbol when looking up
      	PR ld/22721
      	* elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Check the
      	versioned __tls_get_addr symbol.
      	PR ld/22721
      	* testsuite/ld-plugin/lto.exp: Run PR ld/22721 tests.
      	* testsuite/ld-plugin/pr22721.t: New file.
      	* testsuite/ld-plugin/pr22721a.s: Likewise.
      	* testsuite/ld-plugin/pr22721b.c: Likewise.
      (cherry picked from commit 8a1b824a)
    • GDB Administrator's avatar
      Automatic date update in version.in · 43b7f278
      GDB Administrator authored
  9. 19 Jan, 2018 2 commits
  10. 18 Jan, 2018 6 commits
    • Alan Modra's avatar
      PowerPC PLT stub alignment fixes · 430fb493
      Alan Modra authored
      Asking for ppc32 plt call stubs to be aligned at 32 byte boundaries
      didn't quite work.  For ld.bfd they were spaced 32 bytes apart, but
      only started on a 16 byte boundary.  ld.gold also didn't get it right.
      Finding that bug made me check over the ppc64 plt stub alignment,
      where I found that negative values for alignment (meaning align to
      minimize boundary crossing) were not accepted.  Since no one has
      complained about that, I guess I could have removed the feature from
      ld.bfd documentation, but I've opted instead to correct the code.
      I've also added an optional alignment paramenter for ppc32
      --plt-align, for some consistency with gold and ppc64 ld.bfd.
      	* elf32-ppc.c (ppc_elf_create_glink): Correct alignment of .glink.
      	* elf64-ppc.c (ppc64_elf_size_stubs): Handle negative plt_stub_align.
      	(ppc64_elf_build_stubs): Likewise.
      	* powerpc.cc (param_plt_align): New function supplying default
      	--plt-align values.  Use it..
      	(Stub_table::plt_call_align): ..here, and..
      	(Output_data_glink::global_entry_align): ..here.
      	(Stub_table::stub_align): Correct 32-bit minimum alignment.
      	* emultempl/ppc32elf.em: Support optional --plt-align arg.
      	* emultempl/ppc64elf.em: Support negative --plt-align arg.
      (cherry picked from commit 691d2e9a)
    • Alan Modra's avatar
      PowerPC PLT speculative execution barriers · d847d518
      Alan Modra authored
      Spectre variant 2 mitigation for PowerPC and PowerPC64.
      	* elf32-ppc.c (GLINK_ENTRY_SIZE): Handle speculation barrier.
      	(CRSETEQ, BEQCTRM): Define.
      	(is_nonpic_glink_stub): Don't check bctr.
      	(ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
      	(ppc_elf_relax_section): Size speculation barrier.
      	(output_bctr): New function.
      	(write_glink_stub): Use output_bctr.
      	(ppc_elf_relocate_section): Use output_bctr for long branch stub.
      	(ppc_elf_finish_dynamic_symbol): Likewise.
      	(ppc_elf_finish_dynamic_sections): Use output_bctr.
      	* elf32-ppc.h (struct ppc_elf_params): Add speculate_indirect_jumps.
      	* elf64-ppc.c (CRSETEQ, BEQCTRM, BEQCTRLM): Define.
      	(GLINK_PLTRESOLVE_SIZE): Size speculation barrier.
      	(size_global_entry_stubs): Handle speculation barrier sizing.
      	(plt_stub_size): Likewise.
      	(output_bctr): New function.
      	(build_plt_stub, build_tls_get_addr_stub): Output speculation
      	(ppc_build_one_stub): Likewise for ppc_stub_plt_branch.
      	(ppc_size_one_stub): Size speculation barrier in ppc_stub_plt_branch.
      	(build_global_entry_stubs): Output speculation barrier.
      	(ppc64_elf_build_stubs): Likewise in __glink_PLTresolve stub.
      	* elf64-ppc.h (struct ppc64_elf_params): Add speculate_indirect_jumps.
      	* options.h (speculate_indirect_jumps): New option.
      	* powerpc.cc (beqctrm, beqctrlm, crseteq): New insn constants.
      	(output_bctr): New function.
      	(Stub_table::plt_call_size): Add space for speculation barrier.
      	(Stub_table::branch_stub_size): Likewise.
      	(Output_data_glink::pltresolve_size): Likewise.
      	(Stub_table::do_write): Output speculation barriers.
      	* emultempl/ppc32elf.em (params): Init new field.
      	(PARSE_AND_LIST_LONGOPTS): Handle new options.
      	(PARSE_AND_LIST_ARGS_CASES): Likewise.
      	(PARSE_AND_LIST_OPTIONS): Likewise.
      	* emultempl/ppc64elf.em (params): Init new field.
      	(PARSE_AND_LIST_LONGOPTS): Handle --speculate-indirect-jumps.
      	(PARSE_AND_LIST_OPTIONS): Likewise.
      	(PARSE_AND_LIST_ARGS_CASES): Likewise.
      	* ld.texinfo (--no-plt-thread-safe): Correct itemx.
      	(--speculate-indirect-jumps): Document.
      	* testsuite/ld-powerpc/elfv2exe.d,
      	* testsuite/ld-powerpc/elfv2so.d,
      	* testsuite/ld-powerpc/relbrlt.d,
      	* testsuite/ld-powerpc/powerpc.exp: Disable plt alignment and
      	speculation barriers on various tests.
      (cherry picked from commit 1be5d8d3)
    • Alan Modra's avatar
      Warning fix · a6e9be3e
      Alan Modra authored
      	* elf64-ppc.c (ppc64_elf_build_stubs): Silence gcc warning.
      (cherry picked from commit c75bc4f7)
    • Alan Modra's avatar
      PowerPC PLT stub tidy · e01e20b2
      Alan Modra authored
      This is in preparation for the next patch adding Spectre variant 2
      mitigation for PowerPC and PowerPC64.  Besides tidying code involved
      in stub output (to reduce the number of places where bctr is output),
      the patch adds some user visible features:
      1) PowerPC64 ELFv2 global entry stubs now are aligned under the
         control of --plt-align, with a default alignment of 32 bytes.
      2) PowerPC64 __glink_PLTresolve is no longer padded out with nops.
      3) PowerPC32 PLT stubs are aligned under the control of --plt-align,
         with the default alignment being 16 bytes as before.
      4) The PowerPC32 branch/nop table emitted before __glink_PLTresolve
         is now smaller in many cases.  It was sized incorrectly when the
         __tls_get_addr_opt stub was used, and unnecessarily included space
         for local ifuncs.
      	* elf32-ppc.c (GLINK_ENTRY_SIZE): Add parameters, handle
      	__tls_get_addr_opt, and alignment sizing.
      	(TLS_GET_ADDR_GLINK_SIZE): Delete.
      	(is_nonpic_glink_stub): Don't use GLINK_ENTRY_SIZE.
      	(ppc_elf_get_synthetic_symtab): Recognize stubs spaced at 4, 6,
      	or 8 insns.
      	(ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
      	(allocate_dynrelocs): Use new GLINK_ENTRY_SIZE.
      	(ppc_elf_size_dynamic_sections): Likewise.  Size branch table
      	by PLT reloc count.
      	(write_glink_stub): Handle __tls_get_addr_opt stub.
      	Pad out to size given by GLINK_ENTRY_SIZE.
      	(ppc_elf_relocate_section): Adjust write_glink_stub call.
      	(ppc_elf_finish_dynamic_symbol): Likewise.
      	(ppc_elf_finish_dynamic_sections): Write PLTresolve without using
      	insn array since so many need rewriting.
      	* elf32-ppc.h (struct ppc_elf_params): Add plt_stub_align.
      	* elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Rename from
      	GLINK_CALL_STUB_SIZE.  Add htab param and evaluate to size without
      	nops.  Adjust all uses.
      	(ppc64_elf_get_synthetic_symtab): Don't use GLINK_CALL_STUB_SIZE
      	in glink_vma calculation.
      	(struct ppc_link_hash_table): Add global_entry section pointer.
      	(create_linkage_sections): Create separate section for global
      	entry stubs.
      	(PPC_LO, PPC_HI, PPC_HA): Move earlier.
      	(size_global_entry_stubs): Handle sizing for aligned stubs.
      	(ppc64_elf_size_dynamic_sections): Handle global_entry alloc,
      	and don't stash end of glink branch table in rawsize.
      	(ppc_build_one_stub): Rewrite stub size calculations.
      	(build_global_entry_stubs): Use new section.
      	(ppc64_elf_build_stubs): Don't pad __glink_PLTresolve with nops.
      	Build lazy link stubs out to end of section.  Build global entry
      	stubs in new section.
      	* options.h (plt_align): Support for PowerPC32 too.
      	* powerpc.cc (Stub_table::stub_align): Heed --plt-align for 32-bit.
      	(Stub_table::plt_call_size, branch_stub_size): Tidy.
      	(Stub_table::plt_call_align): Implement using stub_align.
      	(Output_data_glink::global_entry_align): New function.
      	(Output_data_glink::global_entry_off): New function.
      	(Output_data_glink::global_entry_address): Use global_entry_off.
      	(Output_data_glink::pltresolve_size): New function, replacing
      	pltresolve_size_ constant.  Update all uses.
      	(Output_data_glink::add_global_entry): Align offset.
      	(Output_data_glink::set_final_data_size): Use global_entry_align.
      	(Stub_table::do_write): Don't pad __glink_PLTrelsolve with nops.
      	Tidy stub output.  Use global_entry_off.
      	* emultempl/ppc32elf.em (params): Init new field.
      	(enum ppc32_opt): New enum to define OPTION_* values.  Add
      	(PARSE_AND_LIST_LONGOPTS): Handle new options.
      	(PARSE_AND_LIST_ARGS_CASES): Likewise.
      	(PARSE_AND_LIST_OPTIONS): Likewise.  Break up help output.
      	* emultempl/ppc64elf.em (ppc_add_stub_section): Init alignment
      	correctly for negative --plt-stub-align.
      	* testsuite/ld-powerpc/elfv2exe.d,
      	* testsuite/ld-powerpc/elfv2so.d,
      	* testsuite/ld-powerpc/relbrlt.d,
      	* testsuite/ld-powerpc/relbrlt.s,
      	* testsuite/ld-powerpc/tlsexe.d,
      	* testsuite/ld-powerpc/tlsexe.r,
      	* testsuite/ld-powerpc/tlsexe32.d,
      	* testsuite/ld-powerpc/tlsexe32.g,
      	* testsuite/ld-powerpc/tlsexe32.r,
      	* testsuite/ld-powerpc/tlsexetoc.d,
      	* testsuite/ld-powerpc/tlsexetoc.r,
      	* testsuite/ld-powerpc/tlsopt5_32.d,
      	* testsuite/ld-powerpc/tlsso.d,
      	* testsuite/ld-powerpc/tlstocso.d: Update for changed stub order.
      (cherry picked from commit 9e390558)
    • Nick Clifton's avatar
    • GDB Administrator's avatar
      Automatic date update in version.in · 780d50f3
      GDB Administrator authored
  11. 17 Jan, 2018 2 commits
  12. 16 Jan, 2018 4 commits
    • Thomas Preud'homme's avatar
      [ARM] No IT usage deprecation for ARMv8-M · 8627bcd7
      Thomas Preud'homme authored
      Deprecations related to the use of the IT instruction introduced in
      Armv8-A do not apply to Armv8-M Baseline and mainline. However the
      warning logic do not distinguish between the various profiles and warn
      whenever the architecture version is 8.
      This patch adds a check to exclude M profile architectures from this
      warning. This works as expected when -march is specified on the
      command-line or a .arch/.cpu directive exist. However, in autodetection
      mode the CPU/architecture targeted is only known once the instructions
      have been all processed but this code is run when IT instruction is
      processed. It is therefore not possible to distinguish between Armv8-M
      and Armv8-A in that mode.
      The approach chosen here is not to warn in autodetection mode. The udf.d
      testcase that relied on that behavior to test deprecation warning for
      Armv8-A is therefore updated to explicitely pass -march=armv8-a.
      2018-01-16  Thomas Preud'homme  <thomas.preudhomme@arm.com>
      	Backport from mainline
      	2018-01-15  Thomas Preud'homme  <thomas.preudhomme@arm.com>
      	* config/tc-arm.c (it_fsm_post_encode): Do not warn if targeting M
      	profile architecture or if in autodetection mode.  Clarify that
      	deprecation is for performance reason and concerns Armv8-A and Armv8-R.
      	* testsuite/gas/arm/armv8-ar-bad.l: Adapt to new IT deprecation warning
      	* testsuite/gas/arm/armv8-ar-it-bad.l: Likewise.
      	* testsuite/gas/arm/sp-pc-validations-bad-t-v8a.l: Likewise.
      	* testsuite/gas/arm/udf.l: Likewise.
      	* testsuite/gas/arm/udf.d: Assemble for Armv8-A explicitely.
    • Cary Coutant's avatar
      Fix -fuse-ld option to accept string argument. · 75400e01
      Cary Coutant authored
      PR 22042 complained that garbage text was being printed in the help
      for the -fuse-ld option; this was caused by passing an empty string
      to the gettext() function, which sometimes returns garbage when passed
      an empty string. The quick fix was to replace "" with NULL as the helparg,
      but that changed the parsing of the option, as gold uses the helparg to
      determine whether an option takes an argument. This patch adds a
      non-empty helparg string to fix both problems.
      	PR gold/22694
      	* options.h (-fuse-ld): Add correct helparg.
    • Nick Clifton's avatar
      Update translations for various binutils components. · 0830ca49
      Nick Clifton authored
      ld	* po/pt_BR.po: Updated Brazilian Portugese translation.
      opcodes	* po/pt_BR.po: Updated Brazilian Portugese translation.
      	* po/de.po: Updated German translation.
      gas	* po/fr.po: Updated French translation.
      binutils* po/fr.po: Updated French translation.
    • GDB Administrator's avatar
      Automatic date update in version.in · eb2c288a
      GDB Administrator authored
  13. 15 Jan, 2018 1 commit
  14. 13 Jan, 2018 3 commits