1. Jun 15, 2021
    • Nelson Chu's avatar
      RISC-V: Don't report the mismatched version warning for the implicit extensions. · 76e5b654
      Nelson Chu authored
      bfd/
          * elfnn-riscv.c (riscv_version_mismatch): Do not report the warning
          when the version of input or output is RISCV_UNKNOWN_VERSION, since
          the extension is added implicitly.
          * elfxx-riscv.c: Updated the obsolete comments.
          (RISCV_UNKNOWN_VERSION): Moved to elfxx-riscv.h.
          * elfxx-riscv.h (RISCV_UNKNOWN_VERSION): Added.
      76e5b654
    • Nelson Chu's avatar
      RISC-V: The version of i-ext should be RISCV_UNKNOWN_VERSION when expanding g-ext. · 27469058
      Nelson Chu authored
      Fix the wrong version of i-ext when expanding g-ext.  This was changed by
      the previous patch accidently.
      
      bfd/
          * elfxx-riscv.c (riscv_parse_std_ext): Fixed the wrong versions of
          i-ext when expanding g-ext.
      27469058
    • Nelson Chu's avatar
      RISC-V: Add i-ext as the implicit extension when e-ext is set. · 0c1e3384
      Nelson Chu authored
      The linker does not care the default versions of the extensions, since
      it does not have the default ISA spec setting.  Therefore, linker won't
      insert the implicit extensions for the input objects.  But we used to
      insert the i-ext as the explicit extension, even if the e-ext is set.
      This causes linker to report "cannot find default versions of the ISA
      extension `i'" errors when linking the input objects with e-ext.
      
      This patch fixes the above linker problem, and also remove the confused
      riscv_ext_dont_care_version function.  Unless these "dont care" extensions
      are set in the input architecture explicitly, otherwise we always insert
      them as the implicit ones.  Afterwards, let riscv_arch_str1 surpress them
      not to output to the architecture string if their versions are
      RISCV_UNKNOWN_VERSION.
      
      bfd/
          * elfxx-riscv.c (riscv_ext_dont_care_version): Removed.
          (riscv_parse_add_subset): Always add the implicit extensions, even if
          their versions are RISCV_UNKNOWN_VERSION.
          (riscv_parse_std_ext): Delay to add i-ext as the implicit extension
          in the riscv_parse_add_implicit_subsets.  Besides, add g-ext as the
          implicit extension after it has been expanded.
          (riscv_parse_add_implicit_subsets): Updated.
      0c1e3384
  2. Feb 06, 2021
  3. Feb 05, 2021
  4. Feb 04, 2021
    • H.J. Lu's avatar
      ld: Restore PR ld/15146 tests · 3592ada3
      H.J. Lu authored
      commit 7d409ac0
      Author: Alan Modra <amodra@gmail.com>
      Date:   Thu Feb 4 13:56:34 2021 +1030
      
          PR27311, (symbol from plugin): undefined reference, hidden sym
      
      fixed PR ld/15146.  Restore PR ld/15146 tests.
      
      	PR ld/15146
      	* testsuite/ld-plugin/lto.exp: Run PR ld/15146 tests.
      	* testsuite/ld-plugin/pr15146.d: Restored.
      	* testsuite/ld-plugin/pr15146a.c: Likewise.
      	* testsuite/ld-plugin/pr15146b.c: Likewise.
      	* testsuite/ld-plugin/pr15146c.c: Likewise.
      	* testsuite/ld-plugin/pr15146d.c: Likewise.
      
      (cherry picked from commit 37707bd8)
      3592ada3
    • Alan Modra's avatar
      PR27311, (symbol from plugin): undefined reference, hidden sym · b71c7a58
      Alan Modra authored
      bfd/
      	PR 27311
      	* elflink.c (elf_link_add_object_symbols): Don't pull in as-needed
      	libraries for IR references on pass over libraries after LTO
      	recompilation.
      ld/
      	* testsuite/ld-plugin/pr27311d.c: New test.
      	* testsuite/ld-plugin/lto.exp: Rename pr27311 to pr27311-1, compile
      	and link new test as pr27311-2.
      
      (cherry picked from commit 7d409ac0)
      b71c7a58
    • GDB Administrator's avatar
      Automatic date update in version.in · 401fafe1
      GDB Administrator authored
      401fafe1
  5. Feb 03, 2021
    • Alan Modra's avatar
      pr27270 and pr27284, ar segfaults and wrong file mode · 6184480d
      Alan Modra authored
      	PR 27270
      	PR 27284
      	PR 26945
      	* ar.c: Don't include libbfd.h.
      	(write_archive): Replace xmalloc+strcpy with xstrdup.  Use
      	bfd_stat rather than fstat on iostream.  Move stat and fd tests
      	outside of _WIN32 ifdef.  Delete skip_stat variable.
      	* arsup.c (temp_name, real_ofd): New static variables.
      	(ar_open): Use make_tempname and bfd_fdopenw.
      	(ar_save): Adjust to suit ar_open changes.  Move stat output
      	of _WIN32 ifdef.
      	* objcopy.c: Don't include libbfd.h.
      	(copy_file): Use bfd_stat.
      
      (cherry picked from commit 95b91a04)
      6184480d
    • Alan Modra's avatar
      PR27311, ld.bfd (symbol from plugin): undefined reference · d2ea9f3a
      Alan Modra authored
      A default versioned symbol definition in a shared library is
      overridden by an unversioned definition in a regular object file, and
      thus should not be reason to make an as-needed library needed.
      
      bfd/
      	PR 27311
      	* elflink.c (elf_link_add_object_symbols): Don't pull in as-needed
      	libraries when H is an indirect symbol after calling
      	_bfd_elf_add_default_symbol.
      ld/
      	* testsuite/ld-ifunc/ifunc.exp (libpr16467b.so, libpr16467bn.so):
      	Link with --as-needed.
      
      	* testsuite/ld-plugin/pr27311.d,
      	* testsuite/ld-plugin/pr27311.ver,
      	* testsuite/ld-plugin/pr27311a.c,
      	* testsuite/ld-plugin/pr27311b.c,
      	* testsuite/ld-plugin/pr27311c.c: New testcase.
      	* testsuite/ld-plugin/lto.exp: Run it.  Correct PR14918 and
      	PR12982 entries.
      
      (cherry picked from commit 9918bff7)
      (cherry picked from commit 69551367)
      (cherry picked from commit f01fb44c)
      d2ea9f3a
    • GDB Administrator's avatar
      Automatic date update in version.in · ee6dd624
      GDB Administrator authored
      ee6dd624
  6. Feb 02, 2021
  7. Feb 01, 2021
  8. Jan 31, 2021
  9. Jan 30, 2021
    • GDB Administrator's avatar
      Automatic date update in version.in · 5eae73d7
      GDB Administrator authored
      5eae73d7
    • Alan Modra's avatar
      PR27259, SHF_LINK_ORDER self-link · fe0e8331
      Alan Modra authored
      This stops ld from endless looping on SHF_LINK_ORDER sh_link loops.
      
      bfd/
      	PR 27259
      	* elflink.c (_bfd_elf_gc_mark_extra_sections): Use linker_mark to
      	prevent endless looping of linked-to sections.
      ld/
      	PR 27259
      	* ldelf.c (ldelf_before_place_orphans): Use linker_mark to
      	prevent endless looping of linked-to sections.
      
      (cherry picked from commit def97fb9)
      fe0e8331
  10. Jan 29, 2021
  11. Jan 28, 2021
  12. Jan 27, 2021
    • Nick Alcock's avatar
      ld: depend on libctf · e9013bbd
      Nick Alcock authored
      Since ld may depend on libctf (if present), and libctf may be relinked
      by the installation process, libctf must be installed before ld is,
      or the relink may fail if it calls on symbols or symbol versions that do
      not exist in any libctf already present on the system.  (If none is
      present, the copy in the build tree will be automatically used, but
      if one *is* present, it may take precedence and break things.)
      
      (This is a maybe- dependency, so it will work even if libctf is
      disabled.)
      
      ChangeLog
      2021-01-26  Nick Alcock  <nick.alcock@oracle.com>
      
      	* Makefile.def: Add install-libctf dependency to install-ld.
      	* Makefile.in: Regenerated.
      e9013bbd
    • Nick Clifton's avatar
      Update the DWARF sections recognuised by ELF linker scripts. · 185390e3
      Nick Clifton authored
              PR ld/27230
              * scripttempl/DWARF.sc: Add DWARF-5 .debug_* sections.
      185390e3
    • GDB Administrator's avatar
      Automatic date update in version.in · 0dd1ac83
      GDB Administrator authored
      0dd1ac83
    • Alan Modra's avatar
      Segmentation fault i386-gen · 510753f8
      Alan Modra authored
      A case of inst->next being uninitialised.
      
      	* i386-gen.c (parse_template): Ensure entire template_instance
      	is initialised.
      
      (cherry picked from commit c3ffb8f3)
      510753f8
    • Alan Modra's avatar
      pr27228 testcase · 8a041786
      Alan Modra authored
      This failed on ft32, hppa, and mips-irix targets.  In the case of ft32
      the problem was iterating over an array in reverse and not using the
      proper condition, so BFD_RELOC_NONE was not recognised.
      
      bfd/
      	* elf32-ft32.c (ft32_reloc_type_lookup): Don't miss ft32_reloc_map[0].
      gas/
      	PR 27282
      	* testsuite/gas/all/none.d: Replace skip with xfail, don't xfail ft32.
      	* testsuite/gas/elf/pr27228.d: xfail hppa and allow OBJECT match.
      
      (cherry picked from commit 4287950e)
      8a041786
    • Frederic Cambus's avatar
      Fix thinko in objcopy's memory freeing code. · 3fb37e45
      Frederic Cambus authored
      	* objcopy.c (copy_main): Fix a double free happening when both
      	--localize-symbols and --globalize-symbols options are invoked
      	together.
      
      (cherry picked from commit e37709f0)
      3fb37e45
    • H.J. Lu's avatar
      nios2: Don't disable relaxation with --gdwarf-N · 0db21b8a
      H.J. Lu authored
      GCC 11 passes --gdwarf-5 to assembler to enable DWARF5 debug info.  Don't
      disable relaxation when --gdwarf-N is specified.  The assembler generated
      debug information will treat the sequence of the relaxed instructions as
      a single instruction.
      
      	PR gas/27243
      	* config/tc-nios2.c (md_begin): Don't disable relaxation with
      	--gdwarf-N.
      	* testsuite/gas/nios2/relax.d: New file.
      	* testsuite/gas/nios2/relax.s: Likewise.
      
      (cherry picked from commit 1f583bc2)
      0db21b8a
  13. Jan 26, 2021
  14. Jan 25, 2021
  15. Jan 24, 2021