[haiku-commits] buildtools: btrev43119 - in binutils: . ld/testsuite/ld-i386 bfd ld ld/testsuite/ld-x86-64

  • From: jerome.duval@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 21 Jul 2016 22:01:34 +0200 (CEST)

btrev43119 adds 2 changesets to branch 'master'
old head: 8865c113a6608bbd7bdb80095c543e32307bab36
new head: 68e96393c7be88bc0e577404869a07ad3c0b48b3
overview: 
http://cgit.haiku-os.org/buildtools/log/?qt=range&q=68e96393c7be+%5E8865c113a660

----------------------------------------------------------------------------

5dcc710c269d: import binutils 2.26.1

68e96393c7be: Merge binutils 2.26.1

                                   [ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

----------------------------------------------------------------------------

343 files changed, 7634 insertions(+), 2027 deletions(-)
binutils/bfd/ChangeLog                           | 539 ++++++++++---
binutils/bfd/archive.c                           |   2 +-
binutils/bfd/coff-alpha.c                        |   2 +-
binutils/bfd/coff-i386.c                         |  64 +-
binutils/bfd/coff-x86_64.c                       |  98 +--
binutils/bfd/coffcode.h                          |   2 +
binutils/bfd/cofflink.c                          |   6 +
binutils/bfd/configure                           |  20 +-
binutils/bfd/development.sh                      |   2 +-
binutils/bfd/dwarf2.c                            |   4 +-
binutils/bfd/elf-bfd.h                           |   8 +-
binutils/bfd/elf-strtab.c                        |  41 +-
binutils/bfd/elf32-arm.c                         | 101 +--
binutils/bfd/elf32-avr.c                         |  36 +-
binutils/bfd/elf32-hppa.c                        |   9 +
binutils/bfd/elf32-i386.c                        | 133 ++--
binutils/bfd/elf32-ppc.c                         |   1 +
binutils/bfd/elf64-hppa.c                        |  18 +-
binutils/bfd/elf64-ppc.c                         |  81 +-
binutils/bfd/elf64-x86-64.c                      |  87 ++-
binutils/bfd/elflink.c                           |  87 ++-
binutils/bfd/elfnn-aarch64.c                     |  25 +-
binutils/bfd/version.h                           |   2 +-
binutils/bfd/version.m4                          |   2 +-
binutils/binutils/ChangeLog                      |  57 +-
binutils/binutils/Makefile.am                    |   1 +
binutils/binutils/Makefile.in                    |   1 +
binutils/binutils/configure                      |  20 +-
binutils/binutils/doc/addr2line.1                |   2 +-
binutils/binutils/doc/ar.1                       |   2 +-
binutils/binutils/doc/binutils.info              |   2 +-
binutils/binutils/doc/binutils.texi              |   2 +-
binutils/binutils/doc/cxxfilt.man                |   2 +-
binutils/binutils/doc/dlltool.1                  |   2 +-
binutils/binutils/doc/nlmconv.1                  |   2 +-
binutils/binutils/doc/nm.1                       |   2 +-
binutils/binutils/doc/objcopy.1                  |   4 +-
binutils/binutils/doc/objdump.1                  |   2 +-
binutils/binutils/doc/ranlib.1                   |   2 +-
binutils/binutils/doc/readelf.1                  |   2 +-
binutils/binutils/doc/size.1                     |   2 +-
binutils/binutils/doc/strings.1                  |   2 +-
binutils/binutils/doc/strip.1                    |   2 +-
binutils/binutils/doc/windmc.1                   |   2 +-
binutils/binutils/doc/windres.1                  |   2 +-
binutils/binutils/objcopy.c                      |   1 +
binutils/binutils/objdump.c                      |   3 +-
binutils/binutils/testsuite/ChangeLog            |   8 +-
binutils/binutils/testsuite/binutils-all/ar.exp  |  40 +
.../binutils/testsuite/binutils-all/compress.exp |  95 ++-
binutils/binutils/testsuite/binutils-all/empty   |   0
binutils/elfcpp/ChangeLog                        |   4 +-
binutils/gas/ChangeLog                           | 213 ++++-
binutils/gas/NEWS                                |   9 +-
binutils/gas/config.in                           |   3 +
binutils/gas/config/tc-arc.c                     |   1 +
binutils/gas/config/tc-i386.c                    |  36 +-
binutils/gas/config/tc-mips.c                    |  42 +-
binutils/gas/configure                           |  60 +-
binutils/gas/configure.ac                        |  31 +-
binutils/gas/doc/as.1                            |  15 +-
binutils/gas/doc/as.info                         | 772 ++++++++++---------
binutils/gas/doc/c-i386.texi                     |  12 +
binutils/gas/testsuite/ChangeLog                 |  19 +-
binutils/gas/testsuite/gas/i386/disp32.d         |  10 +-
binutils/gas/testsuite/gas/i386/disp32.s         |   4 +
binutils/gas/testsuite/gas/i386/got-no-relax.d   |  31 +
binutils/gas/testsuite/gas/i386/got.d            |   1 +
binutils/gas/testsuite/gas/i386/i386.exp         |   2 +
.../testsuite/gas/i386/ilp32/x86-64-gotpcrel.d   |   1 +
.../testsuite/gas/i386/ilp32/x86-64-localpic.d   |   1 +
binutils/gas/testsuite/gas/i386/localpic.d       |   1 +
.../gas/testsuite/gas/i386/mixed-mode-reloc32.d  |   1 +
binutils/gas/testsuite/gas/i386/reloc32.d        |   1 +
.../testsuite/gas/i386/x86-64-avx512f-intel.d    |   2 +
binutils/gas/testsuite/gas/i386/x86-64-avx512f.d |   2 +
binutils/gas/testsuite/gas/i386/x86-64-avx512f.s |   2 +
binutils/gas/testsuite/gas/i386/x86-64-disp32.d  |  10 +-
binutils/gas/testsuite/gas/i386/x86-64-disp32.s  |   3 +
.../gas/i386/x86-64-gotpcrel-no-relax.d          |  27 +
.../gas/testsuite/gas/i386/x86-64-gotpcrel.d     |   1 +
.../gas/testsuite/gas/i386/x86-64-localpic.d     |   1 +
binutils/gas/testsuite/gas/mips/isa-override-1.d |  49 ++
binutils/gas/testsuite/gas/mips/isa-override-1.s |  31 +
binutils/gas/testsuite/gas/mips/isa-override-2.l |   4 +
binutils/gas/testsuite/gas/mips/isa-override-2.s |  18 +
.../gas/mips/micromips@isa-override-1.d          |  50 ++
binutils/gas/testsuite/gas/mips/mips.exp         |   3 +
.../testsuite/gas/mips/mips1@isa-override-1.d    |  53 ++
.../testsuite/gas/mips/mips1@isa-override-2.l    |   4 +
.../testsuite/gas/mips/mips1@isa-override-2.s    |  18 +
.../testsuite/gas/mips/mips2@isa-override-1.d    |  50 ++
.../testsuite/gas/mips/mips2@isa-override-2.l    |   4 +
.../testsuite/gas/mips/mips2@isa-override-2.s    |  18 +
.../testsuite/gas/mips/mips32@isa-override-1.d   |   5 +
.../testsuite/gas/mips/mips32@isa-override-2.l   |   4 +
.../testsuite/gas/mips/mips32@isa-override-2.s   |  18 +
.../testsuite/gas/mips/mips32r2@isa-override-1.d |  50 ++
.../testsuite/gas/mips/mips32r2@isa-override-2.l |   4 +
[ *** stats truncated: 244 lines dropped *** ]

############################################################################

Commit:      5dcc710c269d6e55b5b473ee64d0f3601f4d1f79
URL:         http://cgit.haiku-os.org/buildtools/commit/?id=5dcc710c269d
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Thu Jul 21 19:35:07 2016 UTC

import binutils 2.26.1

----------------------------------------------------------------------------

diff --git a/binutils/bfd/ChangeLog b/binutils/bfd/ChangeLog
index e860c3e..7b4ccd1 100644
--- a/binutils/bfd/ChangeLog
+++ b/binutils/bfd/ChangeLog
@@ -1,3 +1,301 @@
+2016-06-29  Tristan Gingold  <gingold@xxxxxxxxxxx>
+
+       * version.m4: Bump version to 2.26.1
+       * configure: Regenerate.
+
+2016-06-29  Tristan Gingold  <gingold@xxxxxxxxxxx>
+
+       * development.sh: Set development to false.
+
+2016-06-28  Alan Modra  <amodra@xxxxxxxxx>
+
+       Apply from master
+       2016-05-19  Alan Modra  <amodra@xxxxxxxxx>
+       * elf64-ppc.c (ppc64_elf_branch_reloc): Check for NULL owner
+       before dereferencing.
+
+2016-06-28  Alan Modra  <amodra@xxxxxxxxx>
+
+       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.
+
+2016-06-14  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@xxxxxxxxx>
+
+       Backport from master
+       2016-06-14  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@xxxxxxxxx>
+
+       PR ld/20254
+       * elf32-avr.c (elf32_avr_relax_delete_bytes): Adjust reloc
+       offsets until reloc_toaddr.
+
+2016-06-14  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       Backport from master
+       2016-06-13  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       PR ld/20244
+       * elf32-i386.c (elf_i386_relocate_section): Add the .got.plt
+       section address for R_386_GOT32/R_386_GOT32X relocations against
+       IFUNC symbols if there is no base register and return error for
+       PIC.
+
+       2016-06-13  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       * elf32-i386.c (elf_i386_relocate_section): Simplify IFUNC
+       GOT32 adjustment for static executables.
+
+2016-06-14  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       Backport from master
+       2016-06-11  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       PR ld/20244
+       * elf32-i386.c (elf_i386_relocate_section): When relocating
+       R_386_GOT32, return error without a base register for PIC and
+       subtract the .got.plt section address only with a base register.
+
+2016-06-13  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@xxxxxxxxx>
+
+       Backport from master
+       2016-06-08  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@xxxxxxxxx>
+
+       PR ld/20221
+       * elf32-avr.c (elf32_avr_relax_delete_bytes): Adjust syms
+       and relocs only if shrinking occurred.
+
+2016-06-09  Alan Modra  <amodra@xxxxxxxxx>
+
+       PR ld/20159
+       PR ld/16467
+       * elflink.c (_bfd_elf_merge_symbol): Revert PR16467 change.
+       (_bfd_elf_add_default_symbol): Don't indirect to/from defined
+       symbol given a version by a script different to the version
+       of the symbol being added.
+       (elf_link_add_object_symbols): Use _bfd_elf_strtab_save and
+       _bfd_elf_strtab_restore.  Don't fudge dynstr references.
+       * elf-strtab.c (_bfd_elf_strtab_restore_size): Delete.
+       (struct strtab_save): New.
+       (_bfd_elf_strtab_save, _bfd_elf_strtab_restore): New functions.
+       * elf-bfd.h (_bfd_elf_strtab_restore_size): Delete.
+       (_bfd_elf_strtab_save, _bfd_elf_strtab_restore): Declare.
+
+2016-05-20  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       Backport from master
+       2016-05-20  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       * elf32-i386.c (elf_i386_check_relocs): Don't check R_386_GOT32
+       when setting need_convert_load.
+
+       2016-05-19  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       PR ld/20117
+       * elf32-i386.c (elf_i386_convert_load): Don't convert
+       R_386_GOT32.
+
+2016-05-18  Christophe Monat  <christophe.monat@xxxxxx>
+
+       Backport from master
+       2016-05-09  Christophe Monat  <christophe.monat@xxxxxx>
+
+       PR ld/20030
+       * elf32-arm.c (is_thumb2_vldm): Account for T1 (DP) encoding.
+       (stm32l4xx_need_create_replacing_stub): Rename ambiguous nb_regs
+       to nb_words.
+       (create_instruction_vldmia): Add is_dp to disambiguate SP/DP
+       encoding.
+       (create_instruction_vldmdb): Likewise.
+       (stm32l4xx_create_replacing_stub_vldm): is_dp detects DP encoding,
+       uses it to re-encode.
+
+2016-05-15  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       Backport from master
+       2016-05-13  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       PR ld/20093
+       * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Don't convert
+       GOTPCREL relocation against large section.
+
+       * elflink.c (bfd_elf_final_link): Likewise.
+
+2016-05-11  Alan Modra  <amodra@xxxxxxxxx>
+
+       PR 20060
+       * elf64-ppc.c (ppc64_elf_tls_setup): Clear forced_local.
+       * elf32-ppc.c (ppc_elf_tls_setup): Likewise.
+
+2016-04-30  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       Backport from master
+       2016-04-27  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       PR ld/20006
+       * elf64-x86-64.c (elf_x86_64_convert_load): Skip debug sections
+       when estimating distances between output sections.
+
+2016-03-29  Toni Spets  <toni.spets@xxxxxx>
+
+       PR 19878
+       * coffcode.h (coff_write_object_contents): Revert accidental
+       2014-11-10 change.
+
+2016-03-17  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       Backport from master
+       2016-03-15  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       PR ld/19827
+       * elf32-i386.c (elf_i386_check_relocs): Bind defined symbol
+       locally in PIE.
+       (elf_i386_relocate_section): Likewise.
+       * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
+       (elf_x86_64_relocate_section): Likewise.
+
+2016-03-15  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       Backport from master
+       2016-01-30  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       PR ld/19539
+       * elf32-i386.c (elf_i386_reloc_type_class): Check relocation
+       against STT_GNU_IFUNC symbol only with dynamic symbols.
+       * elf64-x86-64.c (elf_x86_64_reloc_type_class): Likewise.
+
+2016-03-15  Nick Clifton  <nickc@xxxxxxxxxx>
+
+       Backport from master:
+       2016-03-09  Leon Winter  <winter-gcc@xxxxxxxxxxxxx>
+
+       PR ld/19623
+       * cofflink.c (_bfd_coff_generic_relocate_section): Do not apply
+       relocations against absolute symbols.
+
+2016-03-14  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       Backport from master
+       2016-01-28  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       PR binutils/19523
+       * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Set BFD_DECOMPRESS to
+       decompress debug sections.
+
+2016-03-09  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       PR ld/19579
+       Backport from master
+       2016-03-08  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       * elflink.c (_bfd_elf_merge_symbol): Group common symbol checking
+       together.
+
+       2016-03-04  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       * elflink.c (_bfd_elf_merge_symbol): Treat common symbol in
+       executable as definition if the new definition comes from a
+       shared library.
+
+2016-03-09  Nick Clifton  <nickc@xxxxxxxxxx>
+           Alan Modra  <amodra@xxxxxxxxx>
+
+       PR binutils/19775
+       * archive.c (bfd_generic_openr_next_archived_file): Allow zero
+       length elements in the archive.
+       * coff-alpha.c (alpha_ecoff_openr_next_archived_file): Likewise.
+
+2016-03-01  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       PR ld/19752
+       Backport from master
+       2015-12-18  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       * coff-x86_64.c (coff_amd64_reloc): Fix formatting.
+
+       2015-12-18  Nick Clifton  <nickc@xxxxxxxxxx>
+
+       * coff-i386.c (coff_i386_reloc): Fix formatting.
+
+2016-02-26  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       Backport from master
+       2016-02-24  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       PR ld/19698
+       * elflink.c (bfd_elf_record_link_assignment): Set versioned if
+       symbol version is unknown.
+
+2016-02-26  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       Backport from master
+       2016-02-01  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       PR ld/19553
+       * elflink.c (elf_link_add_object_symbols): Don't add DT_NEEDED
+       if a symbol from a library loaded via DT_NEEDED doesn't match
+       the symbol referenced by regular object.
+
+2016-02-26  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       Backport from master
+       2016-02-24  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       * elf32-i386.c (elf_i386_allocate_dynrelocs): Set plt_got.offset
+       to (bfd_vma) -1 when setting needs_plt to 0.
+       * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
+
+2016-02-26  Alan Modra  <amodra@xxxxxxxxx>
+
+       * elf64-ppc.c (create_linkage_sections): Create sfpr when
+       save_restore_funcs, rest of sections when not relocatable.
+       (ppc64_elf_init_stub_bfd): Always call create_linkage_sections.
+       (sfpr_define): Define all symbols on emitted code.
+       (ppc64_elf_func_desc_adjust): Adjust for sfpr now being created
+       when relocatable.  Move sfpr_define loop earlier.
+
+2016-02-25  Jiong Wang  <jiong.wang@xxxxxxx>
+
+       Backport from master
+       2016-01-21  Jiong Wang  <jiong.wang@xxxxxxx>
+
+       * elfnn-aarch64.c (aarch64_type_of_stub): Allow insert long branch
+       veneer for sym_sec != input_sec.
+       (elfNN_aarch64_size_stub): Support STT_SECTION symbol.
+       (elfNN_aarch64_final_link_relocate): Take rela addend into account when
+       calculation destination.
+
+2016-02-10  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       Backport from master
+       2016-02-10  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       PR ld/19601
+       * elf32-i386.c (elf_i386_relocate_section): Mask off the least
+       significant bit in GOT offset for R_386_GOT32X.
+
+2016-02-02  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       Backport from master
+       2016-02-02  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       PR ld/19542
+       * elf64-x86-64.c (elf_x86_64_convert_load): Store the estimated
+       distances in the compressed_size field of the output section.
+
+2016-02-01  John David Anglin  <danglin@xxxxxxxxxxx>
+
+       PR ld/19526
+       * elf32-hppa.c (elf32_hppa_final_link): Don't sort non-regular output
+       files.
+       * elf64-hppa.c (elf32_hppa_final_link): Likewise.  Remove retval.
+
+2016-01-25  Tristan Gingold  <gingold@xxxxxxxxxxx>
+
+       * version.m4: Bump version to 2.26.0
+       * configure: Regenerate.
+
 2016-01-25  Tristan Gingold  <gingold@xxxxxxxxxxx>
 
        * version.m4: Bump version to 2.26
@@ -119,7 +417,7 @@
        * configure: Regenerate.
 
 2015-11-11  Alan Modra  <amodra@xxxxxxxxx>
-            Peter Bergner <bergner@xxxxxxxxxxxx>
+           Peter Bergner <bergner@xxxxxxxxxxxx>
 
        * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_REL16DX_HA.
        (ppc_elf_reloc_type_lookup): Handle R_PPC_REL16DX_HA.
@@ -179,8 +477,8 @@
 
 2015-10-29  Catherine Moore  <clm@xxxxxxxxxxxxxxxx>
 
-       * elfxx-mips.c (mips_elf_check_mips16_stubs): Set a stub's output
-       section to bfd_abs_section_ptr if the stub is discarded.
+       * elfxx-mips.c (mips_elf_check_mips16_stubs): Set a stub's output
+       section to bfd_abs_section_ptr if the stub is discarded.
 
 2015-10-29  Ed Schouten  <ed@xxxxxxx>
 
@@ -232,7 +530,7 @@
        * bfd-in2.h: Regenerate.
 
 2015-10-27  Laurent Alfonsi <laurent.alfonsi@xxxxxx>
-            Christophe Monat <christophe.monat@xxxxxx>
+           Christophe Monat <christophe.monat@xxxxxx>
 
        * bfd-in2.h: Regenerate.
        * bfd-in.h (bfd_arm_stm32l4xx_fix): New enum. Specify how
@@ -1225,115 +1523,115 @@
 
 2015-08-18  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
 
-       * bfd/aoutx.h: Replace shared, executable, relocatable and pie
+       * aoutx.h: Replace shared, executable, relocatable and pie
        fields with bfd_link_executable, bfd_link_dll,
        bfd_link_relocatable, bfd_link_pic and bfd_link_pie.
-       * bfd/bout.c: Likewise.
-       * bfd/coff-alpha.c: Likewise.
-       * bfd/coff-arm.c: Likewise.
-       * bfd/coff-i386.c: Likewise.
-       * bfd/coff-i960.c: Likewise.
-       * bfd/coff-m68k.c: Likewise.
-       * bfd/coff-mcore.c: Likewise.
-       * bfd/coff-mips.c: Likewise.
-       * bfd/coff-ppc.c: Likewise.
-       * bfd/coff-rs6000.c: Likewise.
-       * bfd/coff-sh.c: Likewise.
-       * bfd/coff-tic80.c: Likewise.
-       * bfd/coff-x86_64.c: Likewise.
-       * bfd/coff64-rs6000.c: Likewise.
-       * bfd/coffgen.c: Likewise.
-       * bfd/cofflink.c: Likewise.
-       * bfd/ecoff.c: Likewise.
-       * bfd/ecofflink.c: Likewise.
-       * bfd/elf-bfd.h: Likewise.
-       * bfd/elf-eh-frame.c: Likewise.
-       * bfd/elf-ifunc.c: Likewise.
-       * bfd/elf-m10200.c: Likewise.
-       * bfd/elf-m10300.c: Likewise.
-       * bfd/elf-s390-common.c: Likewise.
-       * bfd/elf-vxworks.c: Likewise.
-       * bfd/elf.c: Likewise.
-       * bfd/elf32-arm.c: Likewise.
-       * bfd/elf32-avr.c: Likewise.
-       * bfd/elf32-bfin.c: Likewise.
-       * bfd/elf32-cr16.c: Likewise.
-       * bfd/elf32-cr16c.c: Likewise.
-       * bfd/elf32-cris.c: Likewise.
-       * bfd/elf32-crx.c: Likewise.
-       * bfd/elf32-d10v.c: Likewise.
-       * bfd/elf32-dlx.c: Likewise.
-       * bfd/elf32-epiphany.c: Likewise.
-       * bfd/elf32-fr30.c: Likewise.
-       * bfd/elf32-frv.c: Likewise.
-       * bfd/elf32-ft32.c: Likewise.
-       * bfd/elf32-h8300.c: Likewise.
-       * bfd/elf32-hppa.c: Likewise.
-       * bfd/elf32-i370.c: Likewise.
-       * bfd/elf32-i386.c: Likewise.
-       * bfd/elf32-i860.c: Likewise.
-       * bfd/elf32-ip2k.c: Likewise.
-       * bfd/elf32-iq2000.c: Likewise.
-       * bfd/elf32-lm32.c: Likewise.
-       * bfd/elf32-m32c.c: Likewise.
-       * bfd/elf32-m32r.c: Likewise.
-       * bfd/elf32-m68hc11.c: Likewise.
-       * bfd/elf32-m68hc1x.c: Likewise.
-       * bfd/elf32-m68k.c: Likewise.
-       * bfd/elf32-mcore.c: Likewise.
-       * bfd/elf32-mep.c: Likewise.
-       * bfd/elf32-metag.c: Likewise.
-       * bfd/elf32-microblaze.c: Likewise.
-       * bfd/elf32-moxie.c: Likewise.
-       * bfd/elf32-msp430.c: Likewise.
-       * bfd/elf32-mt.c: Likewise.
-       * bfd/elf32-nds32.c: Likewise.
-       * bfd/elf32-nios2.c: Likewise.
-       * bfd/elf32-or1k.c: Likewise.
-       * bfd/elf32-ppc.c: Likewise.
-       * bfd/elf32-rl78.c: Likewise.
-       * bfd/elf32-rx.c: Likewise.
-       * bfd/elf32-s390.c: Likewise.
-       * bfd/elf32-score.c: Likewise.
-       * bfd/elf32-score7.c: Likewise.
-       * bfd/elf32-sh-symbian.c: Likewise.
-       * bfd/elf32-sh.c: Likewise.
-       * bfd/elf32-sh64.c: Likewise.
-       * bfd/elf32-spu.c: Likewise.
-       * bfd/elf32-tic6x.c: Likewise.
-       * bfd/elf32-tilepro.c: Likewise.
-       * bfd/elf32-v850.c: Likewise.
-       * bfd/elf32-vax.c: Likewise.
-       * bfd/elf32-visium.c: Likewise.
-       * bfd/elf32-xc16x.c: Likewise.
-       * bfd/elf32-xstormy16.c: Likewise.
-       * bfd/elf32-xtensa.c: Likewise.
-       * bfd/elf64-alpha.c: Likewise.
-       * bfd/elf64-hppa.c: Likewise.
-       * bfd/elf64-ia64-vms.c: Likewise.
-       * bfd/elf64-mmix.c: Likewise.
-       * bfd/elf64-ppc.c: Likewise.
-       * bfd/elf64-s390.c: Likewise.
-       * bfd/elf64-sh64.c: Likewise.
-       * bfd/elf64-x86-64.c: Likewise.
-       * bfd/elflink.c: Likewise.
-       * bfd/elfnn-aarch64.c: Likewise.
-       * bfd/elfnn-ia64.c: Likewise.
-       * bfd/elfxx-mips.c: Likewise.
-       * bfd/elfxx-sparc.c: Likewise.
-       * bfd/elfxx-tilegx.c: Likewise.
-       * bfd/i386linux.c: Likewise.
-       * bfd/linker.c: Likewise.
-       * bfd/m68klinux.c: Likewise.
-       * bfd/pdp11.c: Likewise.
-       * bfd/pe-mips.c: Likewise.
-       * bfd/peXXigen.c: Likewise.
-       * bfd/reloc.c: Likewise.
-       * bfd/reloc16.c: Likewise.
-       * bfd/sparclinux.c: Likewise.
-       * bfd/sunos.c: Likewise.
-       * bfd/vms-alpha.c: Likewise.
-       * bfd/xcofflink.c: Likewise.
+       * bout.c: Likewise.
+       * coff-alpha.c: Likewise.
+       * coff-arm.c: Likewise.
+       * coff-i386.c: Likewise.
+       * coff-i960.c: Likewise.
+       * coff-m68k.c: Likewise.
+       * coff-mcore.c: Likewise.
+       * coff-mips.c: Likewise.
+       * coff-ppc.c: Likewise.
+       * coff-rs6000.c: Likewise.
+       * coff-sh.c: Likewise.
+       * coff-tic80.c: Likewise.
+       * coff-x86_64.c: Likewise.
+       * coff64-rs6000.c: Likewise.
+       * coffgen.c: Likewise.
+       * cofflink.c: Likewise.
+       * ecoff.c: Likewise.
+       * ecofflink.c: Likewise.
+       * elf-bfd.h: Likewise.
+       * elf-eh-frame.c: Likewise.
+       * elf-ifunc.c: Likewise.
+       * elf-m10200.c: Likewise.
+       * elf-m10300.c: Likewise.
+       * elf-s390-common.c: Likewise.
+       * elf-vxworks.c: Likewise.
+       * elf.c: Likewise.
+       * elf32-arm.c: Likewise.
+       * elf32-avr.c: Likewise.
+       * elf32-bfin.c: Likewise.
+       * elf32-cr16.c: Likewise.
+       * elf32-cr16c.c: Likewise.
+       * elf32-cris.c: Likewise.
+       * elf32-crx.c: Likewise.
+       * elf32-d10v.c: Likewise.
+       * elf32-dlx.c: Likewise.
+       * elf32-epiphany.c: Likewise.
+       * elf32-fr30.c: Likewise.
+       * elf32-frv.c: Likewise.
+       * elf32-ft32.c: Likewise.
+       * elf32-h8300.c: Likewise.
+       * elf32-hppa.c: Likewise.
+       * elf32-i370.c: Likewise.
+       * elf32-i386.c: Likewise.
+       * elf32-i860.c: Likewise.
+       * elf32-ip2k.c: Likewise.
+       * elf32-iq2000.c: Likewise.
+       * elf32-lm32.c: Likewise.
+       * elf32-m32c.c: Likewise.
+       * elf32-m32r.c: Likewise.
+       * elf32-m68hc11.c: Likewise.
+       * elf32-m68hc1x.c: Likewise.
+       * elf32-m68k.c: Likewise.
+       * elf32-mcore.c: Likewise.
+       * elf32-mep.c: Likewise.
+       * elf32-metag.c: Likewise.
+       * elf32-microblaze.c: Likewise.
+       * elf32-moxie.c: Likewise.
+       * elf32-msp430.c: Likewise.
+       * elf32-mt.c: Likewise.
+       * elf32-nds32.c: Likewise.
+       * elf32-nios2.c: Likewise.
+       * elf32-or1k.c: Likewise.
+       * elf32-ppc.c: Likewise.
+       * elf32-rl78.c: Likewise.
+       * elf32-rx.c: Likewise.
+       * elf32-s390.c: Likewise.
+       * elf32-score.c: Likewise.
+       * elf32-score7.c: Likewise.
+       * elf32-sh-symbian.c: Likewise.
+       * elf32-sh.c: Likewise.
+       * elf32-sh64.c: Likewise.
+       * elf32-spu.c: Likewise.
+       * elf32-tic6x.c: Likewise.
+       * elf32-tilepro.c: Likewise.
+       * elf32-v850.c: Likewise.
+       * elf32-vax.c: Likewise.
+       * elf32-visium.c: Likewise.
+       * elf32-xc16x.c: Likewise.
+       * elf32-xstormy16.c: Likewise.
+       * elf32-xtensa.c: Likewise.
+       * elf64-alpha.c: Likewise.
+       * elf64-hppa.c: Likewise.
+       * elf64-ia64-vms.c: Likewise.
+       * elf64-mmix.c: Likewise.
+       * elf64-ppc.c: Likewise.
+       * elf64-s390.c: Likewise.
+       * elf64-sh64.c: Likewise.
+       * elf64-x86-64.c: Likewise.
+       * elflink.c: Likewise.
+       * elfnn-aarch64.c: Likewise.
+       * elfnn-ia64.c: Likewise.
+       * elfxx-mips.c: Likewise.
+       * elfxx-sparc.c: Likewise.
+       * elfxx-tilegx.c: Likewise.
+       * i386linux.c: Likewise.
+       * linker.c: Likewise.
+       * m68klinux.c: Likewise.
+       * pdp11.c: Likewise.
+       * pe-mips.c: Likewise.
+       * peXXigen.c: Likewise.
+       * reloc.c: Likewise.
+       * reloc16.c: Likewise.
+       * sparclinux.c: Likewise.
+       * sunos.c: Likewise.
+       * vms-alpha.c: Likewise.
+       * xcofflink.c: Likewise.
 
 2015-08-18  Alan Modra  <amodra@xxxxxxxxx>
 
@@ -1387,7 +1685,7 @@
 
 2015-08-11  Jiong Wang  <jiong.wang@xxxxxxx>
 
-       * bfd/elfnn-aarch64.c (aarch64_type_of_stub): New parameter "sym_sec".
+       * elfnn-aarch64.c (aarch64_type_of_stub): New parameter "sym_sec".
        Loose the check for symbol from ABS section.
        (elfNN_aarch64_size_stubs): Pass sym_sec.
 
@@ -1688,10 +1986,10 @@
 
 2015-07-10  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
 
-        PR binutils/18656
-        * bfd.c (bfd_convert_section_size): New function.
-        (bfd_convert_section_contents): Likewise.
-        * bfd-in2.h: Regenerated.
+       PR binutils/18656
+       * bfd.c (bfd_convert_section_size): New function.
+       (bfd_convert_section_contents): Likewise.
+       * bfd-in2.h: Regenerated.
 
 2015-07-09  Catherine Moore  <clm@xxxxxxxxxxxxxxxx>
 
@@ -2004,7 +2302,6 @@
            Bernd Schmidt <bernds@xxxxxxxxxxxxxxxx>
            Paul Brook <paul@xxxxxxxxxxxxxxxx>
 
-       bfd/
        * bfd-in2.h: Regenerated.
        * elf-bfd.h (DWARF2_EH_HDR, COMPACT_EH_HDR): Define.
        (COMPACT_EH_CANT_UNWIND_OPCODE): Define.
@@ -2913,7 +3210,7 @@
 2015-03-18  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
 
        * compress.c (bfd_compress_section_contents): Make it static.
-       * bfd/bfd-in2.h: Regenerated.
+       * bfd-in2.h: Regenerated.
 
 2015-03-18  Eric Youngdale  <eyoungdale@xxxxxxx>
 
@@ -3062,8 +3359,8 @@
 
 2015-02-27  Marcus Shawcroft  <marcus.shawcroft@xxxxxxx>
 
-       * bfd/bfd-in2.h: Regenerate.
-       * bfd/libbfd.h: Regenerate.
+       * bfd-in2.h: Regenerate.
+       * libbfd.h: Regenerate.
 
 2015-02-26  Marcus Shawcroft  <marcus.shawcroft@xxxxxxx>
 
@@ -3534,7 +3831,7 @@
        is weak or pointer_equality_needed is FALSE.
 
        * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Improve
-         comment discussing why we clear st_value for some symbols.
+       comment discussing why we clear st_value for some symbols.
 
 2015-02-02  Kuan-Lin Chen  <kuanlinchentw@xxxxxxxxx>
 
diff --git a/binutils/bfd/archive.c b/binutils/bfd/archive.c
index b3d03d3..1fc3a94 100644
--- a/binutils/bfd/archive.c
+++ b/binutils/bfd/archive.c
@@ -802,7 +802,7 @@ bfd_generic_openr_next_archived_file (bfd *archive, bfd 
*last_file)
             Note that last_file->origin can be odd in the case of
             BSD-4.4-style element with a long odd size.  */
          filestart += filestart % 2;
-         if (filestart <= last_file->proxy_origin)
+         if (filestart < last_file->proxy_origin)
            {
              /* Prevent looping.  See PR19256.  */
              bfd_set_error (bfd_error_malformed_archive);
diff --git a/binutils/bfd/coff-alpha.c b/binutils/bfd/coff-alpha.c
index 7478f2f..fffb9f7 100644
--- a/binutils/bfd/coff-alpha.c
+++ b/binutils/bfd/coff-alpha.c
@@ -2208,7 +2208,7 @@ alpha_ecoff_openr_next_archived_file (bfd *archive, bfd 
*last_file)
         BSD-4.4-style element with a long odd size.  */
       filestart = last_file->proxy_origin + size;
       filestart += filestart % 2;
-      if (filestart <= last_file->proxy_origin)
+      if (filestart < last_file->proxy_origin)
        {
          /* Prevent looping.  See PR19256.  */
          bfd_set_error (bfd_error_malformed_archive);
diff --git a/binutils/bfd/coff-i386.c b/binutils/bfd/coff-i386.c
index a9725c4..1b1a815 100644
--- a/binutils/bfd/coff-i386.c
+++ b/binutils/bfd/coff-i386.c
@@ -139,41 +139,41 @@ coff_i386_reloc (bfd *abfd,
 #define DOIT(x) \
   x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + diff) & 
howto->dst_mask))
 
-    if (diff != 0)
-      {
-       reloc_howto_type *howto = reloc_entry->howto;
-       unsigned char *addr = (unsigned char *) data + reloc_entry->address;
+  if (diff != 0)
+    {
+      reloc_howto_type *howto = reloc_entry->howto;
+      unsigned char *addr = (unsigned char *) data + reloc_entry->address;
+
+      switch (howto->size)
+       {
+       case 0:
+         {
+           char x = bfd_get_8 (abfd, addr);
+           DOIT (x);
+           bfd_put_8 (abfd, x, addr);
+         }
+         break;
 
-       switch (howto->size)
+       case 1:
          {
-         case 0:
-           {
-             char x = bfd_get_8 (abfd, addr);
-             DOIT (x);
-             bfd_put_8 (abfd, x, addr);
-           }
-           break;
-
-         case 1:
-           {
-             short x = bfd_get_16 (abfd, addr);
-             DOIT (x);
-             bfd_put_16 (abfd, (bfd_vma) x, addr);
-           }
-           break;
-
-         case 2:
-           {
-             long x = bfd_get_32 (abfd, addr);
-             DOIT (x);
-             bfd_put_32 (abfd, (bfd_vma) x, addr);
-           }
-           break;
-
-         default:
-           abort ();
+           short x = bfd_get_16 (abfd, addr);
+           DOIT (x);
+           bfd_put_16 (abfd, (bfd_vma) x, addr);
          }
-      }
+         break;
+
+       case 2:
+         {
+           long x = bfd_get_32 (abfd, addr);
+           DOIT (x);
+           bfd_put_32 (abfd, (bfd_vma) x, addr);
+         }
+         break;
+
+       default:
+         abort ();
+       }
+    }
 
   /* Now let bfd_perform_relocation finish everything up.  */
   return bfd_reloc_continue;
diff --git a/binutils/bfd/coff-x86_64.c b/binutils/bfd/coff-x86_64.c
index 4e6420a..9d7c845 100644
--- a/binutils/bfd/coff-x86_64.c
+++ b/binutils/bfd/coff-x86_64.c
@@ -138,59 +138,61 @@ coff_amd64_reloc (bfd *abfd,
 #define DOIT(x) \
   x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + diff) & 
howto->dst_mask))
 
-    if (diff != 0)
-      {
-       reloc_howto_type *howto = reloc_entry->howto;
-       unsigned char *addr = (unsigned char *) data + reloc_entry->address;
-
-       /* FIXME: We do not have an end address for data, so we cannot
-          accurately range check any addresses computed against it.
-          cf: PR binutils/17512: file: 1085-1761-0.004.
-          For now we do the best that we can.  */
-       if (addr < (unsigned char *) data || addr > ((unsigned char *) data) + 
input_section->size)
+  if (diff != 0)
+    {
+      reloc_howto_type *howto = reloc_entry->howto;
+      unsigned char *addr = (unsigned char *) data + reloc_entry->address;
+
+      /* FIXME: We do not have an end address for data, so we cannot
+        accurately range check any addresses computed against it.
+        cf: PR binutils/17512: file: 1085-1761-0.004.
+        For now we do the best that we can.  */
+      if (addr < (unsigned char *) data
+         || addr > ((unsigned char *) data) + input_section->size)
+       {
+         bfd_set_error (bfd_error_bad_value);
+         return bfd_reloc_notsupported;
+       }
+
+      switch (howto->size)
+       {
+       case 0:
+         {
+           char x = bfd_get_8 (abfd, addr);
+           DOIT (x);
+           bfd_put_8 (abfd, x, addr);
+         }
+         break;
+
+       case 1:
+         {
+           short x = bfd_get_16 (abfd, addr);
+           DOIT (x);
+           bfd_put_16 (abfd, (bfd_vma) x, addr);
+         }
+         break;
+
+       case 2:
          {
-           bfd_set_error (bfd_error_bad_value);
-           return bfd_reloc_notsupported;
+           long x = bfd_get_32 (abfd, addr);
+           DOIT (x);
+           bfd_put_32 (abfd, (bfd_vma) x, addr);
          }
+         break;
 
-       switch (howto->size)
+       case 4:
          {
-         case 0:
-           {
-             char x = bfd_get_8 (abfd, addr);
-             DOIT (x);
-             bfd_put_8 (abfd, x, addr);
-           }
-           break;
-
-         case 1:
-           {
-             short x = bfd_get_16 (abfd, addr);
-             DOIT (x);
-             bfd_put_16 (abfd, (bfd_vma) x, addr);
-           }
-           break;
-
-         case 2:
-           {
-             long x = bfd_get_32 (abfd, addr);
-             DOIT (x);
-             bfd_put_32 (abfd, (bfd_vma) x, addr);
-           }
-           break;
-         case 4:
-           {
-             long long x = bfd_get_64 (abfd, addr);
-             DOIT (x);
-             bfd_put_64 (abfd, (bfd_vma) x, addr);
-           }
-           break;
-
-         default:
-           bfd_set_error (bfd_error_bad_value);
-           return bfd_reloc_notsupported;
+           long long x = bfd_get_64 (abfd, addr);
+           DOIT (x);
+           bfd_put_64 (abfd, (bfd_vma) x, addr);
          }
-      }
+         break;
+
+       default:
+         bfd_set_error (bfd_error_bad_value);
+         return bfd_reloc_notsupported;
+       }
+    }
 
   /* Now let bfd_perform_relocation finish everything up.  */
   return bfd_reloc_continue;
diff --git a/binutils/bfd/coffcode.h b/binutils/bfd/coffcode.h
index 2499885..97db5f7 100644
--- a/binutils/bfd/coffcode.h
+++ b/binutils/bfd/coffcode.h
@@ -4076,6 +4076,8 @@ coff_write_object_contents (bfd * abfd)
     internal_f.f_flags |= F_DYNLOAD;
 #endif
 
+  memset (&internal_a, 0, sizeof internal_a);
+
   /* Set up architecture-dependent stuff.  */
   {
     unsigned int magic = 0;
diff --git a/binutils/bfd/cofflink.c b/binutils/bfd/cofflink.c
index 8d98fec..88eb2b3 100644
--- a/binutils/bfd/cofflink.c
+++ b/binutils/bfd/cofflink.c
@@ -2977,6 +2977,12 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd,
          else
            {
              sec = sections[symndx];
+
+             /* PR 19623: Relocations against symbols in
+                the absolute sections should ignored.  */
+              if (bfd_is_abs_section (sec))
+               continue;
+
               val = (sec->output_section->vma
                     + sec->output_offset
                     + sym->n_value);
diff --git a/binutils/bfd/configure b/binutils/bfd/configure
index cf3c746..2cacd7a 100755
--- a/binutils/bfd/configure
+++ b/binutils/bfd/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.64 for bfd 2.26.
+# Generated by GNU Autoconf 2.64 for bfd 2.26.1.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
@@ -556,8 +556,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='bfd'
 PACKAGE_TARNAME='bfd'
-PACKAGE_VERSION='2.26'
-PACKAGE_STRING='bfd 2.26'
+PACKAGE_VERSION='2.26.1'
+PACKAGE_STRING='bfd 2.26.1'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1351,7 +1351,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures bfd 2.26 to adapt to many kinds of systems.
+\`configure' configures bfd 2.26.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1422,7 +1422,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of bfd 2.26:";;
+     short | recursive ) echo "Configuration of bfd 2.26.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1543,7 +1543,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-bfd configure 2.26
+bfd configure 2.26.1
 generated by GNU Autoconf 2.64
 
 Copyright (C) 2009 Free Software Foundation, Inc.
@@ -2185,7 +2185,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by bfd $as_me 2.26, which was
+It was created by bfd $as_me 2.26.1, which was
 generated by GNU Autoconf 2.64.  Invocation command line was
 
   $ $0 $@
@@ -3993,7 +3993,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='bfd'
- VERSION='2.26'
+ VERSION='2.26.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -16533,7 +16533,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by bfd $as_me 2.26, which was
+This file was extended by bfd $as_me 2.26.1, which was
 generated by GNU Autoconf 2.64.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16597,7 +16597,7 @@ Report bugs to the package provider."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
-bfd config.status 2.26
+bfd config.status 2.26.1
 configured by $0, generated by GNU Autoconf 2.64,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`\\"
 
diff --git a/binutils/bfd/development.sh b/binutils/bfd/development.sh
index 6bbef6d..0e65c07 100644
--- a/binutils/bfd/development.sh
+++ b/binutils/bfd/development.sh
@@ -16,4 +16,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Controls whether to enable development-mode features by default.
-development=true
+development=false
diff --git a/binutils/bfd/dwarf2.c b/binutils/bfd/dwarf2.c
index 176f018..64cfe9b 100644
--- a/binutils/bfd/dwarf2.c
+++ b/binutils/bfd/dwarf2.c
@@ -3706,8 +3706,10 @@ _bfd_dwarf2_slurp_debug_info (bfd *abfd, bfd *debug_bfd,
           fail more quickly.  */
        return FALSE;
 
+      /* Set BFD_DECOMPRESS to decompress debug sections.  */
       if ((debug_bfd = bfd_openr (debug_filename, NULL)) == NULL
-         || ! bfd_check_format (debug_bfd, bfd_object)
+         || !(debug_bfd->flags |= BFD_DECOMPRESS,
+              bfd_check_format (debug_bfd, bfd_object))
          || (msec = find_debug_info (debug_bfd,
                                      debug_sections, NULL)) == NULL
          || !bfd_generic_link_read_symbols (debug_bfd))
diff --git a/binutils/bfd/elf-bfd.h b/binutils/bfd/elf-bfd.h
index 70e3327..f36b945 100644
--- a/binutils/bfd/elf-bfd.h
+++ b/binutils/bfd/elf-bfd.h
@@ -2039,9 +2039,11 @@ extern void _bfd_elf_strtab_delref
 extern unsigned int _bfd_elf_strtab_refcount
   (struct elf_strtab_hash *, bfd_size_type);
 extern void _bfd_elf_strtab_clear_all_refs
-  (struct elf_strtab_hash *tab);
-extern void _bfd_elf_strtab_restore_size
-  (struct elf_strtab_hash *, bfd_size_type);
+  (struct elf_strtab_hash *);
+extern void *_bfd_elf_strtab_save
+  (struct elf_strtab_hash *);
+extern void _bfd_elf_strtab_restore
+  (struct elf_strtab_hash *, void *);
 extern bfd_size_type _bfd_elf_strtab_size
   (struct elf_strtab_hash *);
 extern bfd_size_type _bfd_elf_strtab_offset
diff --git a/binutils/bfd/elf-strtab.c b/binutils/bfd/elf-strtab.c
index 4d38e04..e7de973 100644
--- a/binutils/bfd/elf-strtab.c
+++ b/binutils/bfd/elf-strtab.c
@@ -215,16 +215,45 @@ _bfd_elf_strtab_clear_all_refs (struct elf_strtab_hash 
*tab)
     tab->array[idx]->refcount = 0;
 }
 
-/* Downsizes strtab.  Entries from IDX up to the current size are
-   removed from the array.  */
+/* Save strtab refcounts prior to adding --as-needed library.  */
+
+struct strtab_save
+{
+  bfd_size_type size;
+  unsigned int refcount[1];
+};
+
+void *
+_bfd_elf_strtab_save (struct elf_strtab_hash *tab)
+{
+  struct strtab_save *save;
+  bfd_size_type idx, size;
+
+  size = sizeof (*save) + (tab->size - 1) * sizeof (save->refcount[0]);
+  save = bfd_malloc (size);
+  if (save == NULL)
+    return save;
+
+  save->size = tab->size;
+  for (idx = 1; idx < tab->size; idx++)
+    save->refcount[idx] = tab->array[idx]->refcount;
+  return save;
+}
+
+/* Restore strtab refcounts on finding --as-needed library not needed.  */
+
 void
-_bfd_elf_strtab_restore_size (struct elf_strtab_hash *tab, bfd_size_type idx)
+_bfd_elf_strtab_restore (struct elf_strtab_hash *tab, void *buf)
 {
-  bfd_size_type curr_size = tab->size;
+  bfd_size_type idx, curr_size = tab->size;
+  struct strtab_save *save = (struct strtab_save *) buf;
 
   BFD_ASSERT (tab->sec_size == 0);
-  BFD_ASSERT (idx <= curr_size);
-  tab->size = idx;
+  BFD_ASSERT (save->size <= curr_size);
+  tab->size = save->size;
+  for (idx = 1; idx < save->size; ++idx)
+    tab->array[idx]->refcount = save->refcount[idx];
+
   for (; idx < curr_size; ++idx)
     {
       /* We don't remove entries from the hash table, just set their
diff --git a/binutils/bfd/elf32-arm.c b/binutils/bfd/elf32-arm.c
index 5affc76..b585e5b 100644
--- a/binutils/bfd/elf32-arm.c
+++ b/binutils/bfd/elf32-arm.c
@@ -7374,18 +7374,21 @@ is_thumb2_vldm (const insn32 insn)
 {
   /* A6.5 Extension register load or store instruction
      A7.7.229
-     We look only for the 32-bit registers case since the DP (64-bit
-     registers) are not supported for STM32L4XX
+     We look for SP 32-bit and DP 64-bit registers.
+     Encoding T1 VLDM{mode}<c> <Rn>{!}, <list>
+     <list> is consecutive 64-bit registers
+     1110 - 110P - UDW1 - rrrr - vvvv - 1011 - iiii - iiii
      Encoding T2 VLDM{mode}<c> <Rn>{!}, <list>
      <list> is consecutive 32-bit registers
      1110 - 110P - UDW1 - rrrr - vvvv - 1010 - iiii - iiii
      if P==0 && U==1 && W==1 && Rn=1101 VPOP
      if PUW=010 || PUW=011 || PUW=101 VLDM.  */
   return
-    ((insn & 0xfe100f00) == 0xec100a00)
+    (((insn & 0xfe100f00) == 0xec100b00) ||
+     ((insn & 0xfe100f00) == 0xec100a00))
     && /* (IA without !).  */
     (((((insn << 7) >> 28) & 0xd) == 0x4)
-     /* (IA with !), includes VPOP (when reg number is SP).  */     
+     /* (IA with !), includes VPOP (when reg number is SP).  */
      || ((((insn << 7) >> 28) & 0xd) == 0x5)
      /* (DB with !).  */
      || ((((insn << 7) >> 28) & 0xd) == 0x9));
@@ -7402,19 +7405,19 @@ static bfd_boolean
 stm32l4xx_need_create_replacing_stub (const insn32 insn,
                                      bfd_arm_stm32l4xx_fix stm32l4xx_fix)
 {
-  int nb_regs = 0;
+  int nb_words = 0;
 
   /* The field encoding the register list is the same for both LDMIA
      and LDMDB encodings.  */
   if (is_thumb2_ldmia (insn) || is_thumb2_ldmdb (insn))
-    nb_regs = popcount (insn & 0x0000ffff);
+    nb_words = popcount (insn & 0x0000ffff);
   else if (is_thumb2_vldm (insn))
-   nb_regs = (insn & 0xff);
+   nb_words = (insn & 0xff);
 
   /* DEFAULT mode accounts for the real bug condition situation,
      ALL mode inserts stubs for each LDM/VLDM instruction (testing).  */
   return
-    (stm32l4xx_fix == BFD_ARM_STM32L4XX_FIX_DEFAULT) ? nb_regs > 8 :
+    (stm32l4xx_fix == BFD_ARM_STM32L4XX_FIX_DEFAULT) ? nb_words > 8 :
     (stm32l4xx_fix == BFD_ARM_STM32L4XX_FIX_ALL) ? TRUE : FALSE;
 }
 
@@ -16242,30 +16245,31 @@ create_instruction_sub (int target_reg, int 
source_reg, int value)
 }
 
 static inline bfd_vma
-create_instruction_vldmia (int base_reg, int wback, int num_regs,
+create_instruction_vldmia (int base_reg, int is_dp, int wback, int num_words,
                           int first_reg)
 {
   /* A8.8.332 VLDM (A8-922)
-     VLMD{MODE} Rn{!}, {list} (Encoding T2).  */
-  bfd_vma patched_inst = 0xec900a00
+     VLMD{MODE} Rn{!}, {list} (Encoding T1 or T2).  */
+  bfd_vma patched_inst = (is_dp ? 0xec900b00 : 0xec900a00)
     | (/*W=*/wback << 21)
     | (base_reg << 16)
-    | (num_regs & 0x000000ff)
-    | (((unsigned)first_reg>>1) & 0x0000000f) << 12
+    | (num_words & 0x000000ff)
+    | (((unsigned)first_reg >> 1) & 0x0000000f) << 12
     | (first_reg & 0x00000001) << 22;
 
   return patched_inst;
 }
 
 static inline bfd_vma
-create_instruction_vldmdb (int base_reg, int num_regs, int first_reg)
+create_instruction_vldmdb (int base_reg, int is_dp, int num_words,
+                          int first_reg)
 {
   /* A8.8.332 VLDM (A8-922)
-     VLMD{MODE} Rn!, {} (Encoding T2).  */
-  bfd_vma patched_inst = 0xed300a00
+     VLMD{MODE} Rn!, {} (Encoding T1 or T2).  */
+  bfd_vma patched_inst = (is_dp ? 0xed300b00 : 0xed300a00)
     | (base_reg << 16)
-    | (num_regs & 0x000000ff)
-    | (((unsigned)first_reg>>1) & 0x0000000f) << 12
+    | (num_words & 0x000000ff)
+    | (((unsigned)first_reg >>1 ) & 0x0000000f) << 12
     | (first_reg & 0x00000001) << 22;
 
   return patched_inst;
@@ -16745,15 +16749,15 @@ stm32l4xx_create_replacing_stub_vldm (struct 
elf32_arm_link_hash_table * htab,
                                      const bfd_byte *const initial_insn_addr,
                                      bfd_byte *const base_stub_contents)
 {
-  int num_regs = ((unsigned int)initial_insn << 24) >> 24;
+  int num_words = ((unsigned int) initial_insn << 24) >> 24;
   bfd_byte *current_stub_contents = base_stub_contents;
 
   BFD_ASSERT (is_thumb2_vldm (initial_insn));
 
   /* In BFD_ARM_STM32L4XX_FIX_ALL mode we may have to deal with
-     smaller than 8 registers load sequences that do not cause the
+     smaller than 8 words load sequences that do not cause the
      hardware issue.  */
-  if (num_regs <= 8)
+  if (num_words <= 8)
     {
       /* Untouched instruction.  */
       current_stub_contents =
@@ -16768,28 +16772,30 @@ stm32l4xx_create_replacing_stub_vldm (struct 
elf32_arm_link_hash_table * htab,
     }
   else
     {
+      bfd_boolean is_dp = /* DP encoding. */
+       (initial_insn & 0xfe100f00) == 0xec100b00;
       bfd_boolean is_ia_nobang = /* (IA without !).  */
        (((initial_insn << 7) >> 28) & 0xd) == 0x4;
       bfd_boolean is_ia_bang = /* (IA with !) - includes VPOP.  */
        (((initial_insn << 7) >> 28) & 0xd) == 0x5;
       bfd_boolean is_db_bang = /* (DB with !).  */
        (((initial_insn << 7) >> 28) & 0xd) == 0x9;
-      int base_reg = ((unsigned int)initial_insn << 12) >> 28;
+      int base_reg = ((unsigned int) initial_insn << 12) >> 28;
       /* d = UInt (Vd:D);.  */
-      int first_reg = ((((unsigned int)initial_insn << 16) >> 28) << 1)
+      int first_reg = ((((unsigned int) initial_insn << 16) >> 28) << 1)
        | (((unsigned int)initial_insn << 9) >> 31);
 
-      /* Compute the number of 8-register chunks needed to split.  */
-      int chunks = (num_regs%8) ? (num_regs/8 + 1) : (num_regs/8);
+      /* Compute the number of 8-words chunks needed to split.  */
+      int chunks = (num_words % 8) ? (num_words / 8 + 1) : (num_words / 8);
       int chunk;
 
       /* The test coverage has been done assuming the following
         hypothesis that exactly one of the previous is_ predicates is
         true.  */
-      BFD_ASSERT ((is_ia_nobang ^ is_ia_bang ^ is_db_bang) &&
-                 !(is_ia_nobang & is_ia_bang & is_db_bang));
+      BFD_ASSERT (    (is_ia_nobang ^ is_ia_bang ^ is_db_bang)
+                 && !(is_ia_nobang & is_ia_bang & is_db_bang));
 
-      /* We treat the cutting of the register in one pass for all
+      /* We treat the cutting of the words in one pass for all
         cases, then we emit the adjustments:
 
         vldm rx, {...}
@@ -16802,29 +16808,34 @@ stm32l4xx_create_replacing_stub_vldm (struct 
elf32_arm_link_hash_table * htab,
 
         vldmd rx!, {...}
         -> vldmb rx!, {8_words_or_less} for each needed 8_word.  */
-      for (chunk = 0; chunk<chunks; ++chunk)
+      for (chunk = 0; chunk < chunks; ++chunk)
        {
+         bfd_vma new_insn = 0;
+
          if (is_ia_nobang || is_ia_bang)
            {
-             current_stub_contents =
-               push_thumb2_insn32 (htab, output_bfd, current_stub_contents,
-                                   create_instruction_vldmia
-                                   (base_reg,
-                                    /*wback= .  */1,
-                                    chunks - (chunk + 1) ?
-                                    8 : num_regs - chunk * 8,
-                                    first_reg + chunk * 8));
+             new_insn = create_instruction_vldmia
+               (base_reg,
+                is_dp,
+                /*wback= .  */1,
+                chunks - (chunk + 1) ?
+                8 : num_words - chunk * 8,
+                first_reg + chunk * 8);
            }
          else if (is_db_bang)
            {
-             current_stub_contents =
-               push_thumb2_insn32 (htab, output_bfd, current_stub_contents,
-                                   create_instruction_vldmdb
-                                   (base_reg,
-                                    chunks - (chunk + 1) ?
-                                    8 : num_regs - chunk * 8,
-                                    first_reg + chunk * 8));
+             new_insn = create_instruction_vldmdb
+               (base_reg,
+                is_dp,
+                chunks - (chunk + 1) ?
+                8 : num_words - chunk * 8,
+                first_reg + chunk * 8);
            }
+
+         if (new_insn)
+           current_stub_contents =
+             push_thumb2_insn32 (htab, output_bfd, current_stub_contents,
+                                 new_insn);
        }
 
       /* Only this case requires the base register compensation
@@ -16834,7 +16845,7 @@ stm32l4xx_create_replacing_stub_vldm (struct 
elf32_arm_link_hash_table * htab,
          current_stub_contents =
            push_thumb2_insn32 (htab, output_bfd, current_stub_contents,
                                create_instruction_sub
-                               (base_reg, base_reg, 4*num_regs));
+                               (base_reg, base_reg, 4*num_words));
        }
 
       /* B initial_insn_addr+4.  */
diff --git a/binutils/bfd/elf32-avr.c b/binutils/bfd/elf32-avr.c
index 9aa5a68..d55e093 100644
--- a/binutils/bfd/elf32-avr.c
+++ b/binutils/bfd/elf32-avr.c
@@ -1826,12 +1826,13 @@ elf32_avr_relax_delete_bytes (bfd *abfd,
   Elf_Internal_Rela *irel, *irelend;
   Elf_Internal_Sym *isym;
   Elf_Internal_Sym *isymbuf = NULL;
-  bfd_vma toaddr;
+  bfd_vma toaddr, reloc_toaddr;
   struct elf_link_hash_entry **sym_hashes;
   struct elf_link_hash_entry **end_hashes;
   unsigned int symcount;
   struct avr_relax_info *relax_info;
   struct avr_property_record *prop_record = NULL;
+  bfd_boolean did_shrink = FALSE;
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
@@ -1862,15 +1863,32 @@ elf32_avr_relax_delete_bytes (bfd *abfd,
         }
     }
 
+  /* We need to look at all relocs with offsets less than toaddr. prop
+     records handling adjusts toaddr downwards to avoid moving syms at the
+     address of the property record, but all relocs with offsets between addr
+     and the current value of toaddr need to have their offsets adjusted.
+     Assume addr = 0, toaddr = 4 and count = 2. After prop records handling,
+     toaddr becomes 2, but relocs with offsets 2 and 3 still need to be
+     adjusted (to 0 and 1 respectively), as the first 2 bytes are now gone.
+     So record the current value of toaddr here, and use it when adjusting
+     reloc offsets. */
+  reloc_toaddr = toaddr;
+
   irel = elf_section_data (sec)->relocs;
   irelend = irel + sec->reloc_count;
 
   /* Actually delete the bytes.  */
   if (toaddr - addr - count > 0)
-    memmove (contents + addr, contents + addr + count,
-             (size_t) (toaddr - addr - count));
+    {
+      memmove (contents + addr, contents + addr + count,
+               (size_t) (toaddr - addr - count));
+      did_shrink = TRUE;
+    }
   if (prop_record == NULL)
-    sec->size -= count;
+    {
+      sec->size -= count;
+      did_shrink = TRUE;
+    }
   else
     {
       /* Use the property record to fill in the bytes we've opened up.  */
@@ -1889,6 +1907,11 @@ elf32_avr_relax_delete_bytes (bfd *abfd,
           prop_record->data.align.preceding_deleted += count;
           break;
         };
+      /* If toaddr == (addr + count), then we didn't delete anything, yet
+         we fill count bytes backwards from toaddr. This is still ok - we
+         end up overwriting the bytes we would have deleted. We just need
+         to remember we didn't delete anything i.e. don't set did_shrink,
+         so that we don't corrupt reloc offsets or symbol values.*/
       memset (contents + toaddr - count, fill, count);
 
       /* Adjust the TOADDR to avoid moving symbols located at the address
@@ -1896,6 +1919,9 @@ elf32_avr_relax_delete_bytes (bfd *abfd,
       toaddr -= count;
     }
 
+  if (!did_shrink)
+    return TRUE;
+
   /* Adjust all the reloc addresses.  */
   for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
     {
@@ -1906,7 +1932,7 @@ elf32_avr_relax_delete_bytes (bfd *abfd,
 
       /* Get the new reloc address.  */
       if ((irel->r_offset > addr
-           && irel->r_offset < toaddr))
+           && irel->r_offset < reloc_toaddr))
         {
           if (debug_relax)
             printf ("Relocation at address 0x%x needs to be moved.\n"
diff --git a/binutils/bfd/elf32-hppa.c b/binutils/bfd/elf32-hppa.c
index ad40914..3fc1f57 100644
--- a/binutils/bfd/elf32-hppa.c
+++ b/binutils/bfd/elf32-hppa.c
@@ -3245,6 +3245,8 @@ tpoff (struct bfd_link_info *info, bfd_vma address)
 static bfd_boolean
 elf32_hppa_final_link (bfd *abfd, struct bfd_link_info *info)
 {
+  struct stat buf;
+
   /* Invoke the regular ELF linker to do all the work.  */
   if (!bfd_elf_final_link (abfd, info))
     return FALSE;
@@ -3254,6 +3256,13 @@ elf32_hppa_final_link (bfd *abfd, struct bfd_link_info 
*info)
   if (bfd_link_relocatable (info))
     return TRUE;
 
+  /* Do not attempt to sort non-regular files.  This is here
+     especially for configure scripts and kernel builds which run
+     tests with "ld [...] -o /dev/null".  */
+  if (stat (abfd->filename, &buf) != 0
+      || !S_ISREG(buf.st_mode))
+    return TRUE;
+
   return elf_hppa_sort_unwind (abfd);
 }
 
diff --git a/binutils/bfd/elf32-i386.c b/binutils/bfd/elf32-i386.c
index 300839b..73bba33 100644
--- a/binutils/bfd/elf32-i386.c
+++ b/binutils/bfd/elf32-i386.c
@@ -1830,7 +1830,8 @@ do_size:
               && (sec->flags & SEC_ALLOC) != 0
               && (r_type != R_386_PC32
                   || (h != NULL
-                      && (! SYMBOLIC_BIND (info, h)
+                      && (! (bfd_link_pie (info)
+                             || SYMBOLIC_BIND (info, h))
                           || h->root.type == bfd_link_hash_defweak
                           || !h->def_regular))))
              || (ELIMINATE_COPY_RELOCS
@@ -1961,7 +1962,7 @@ do_size:
            return FALSE;
        }
 
-      if ((r_type == R_386_GOT32 || r_type == R_386_GOT32X)
+      if (r_type == R_386_GOT32X
          && (h == NULL || h->type != STT_GNU_IFUNC))
        sec->need_convert_load = 1;
     }
@@ -2490,12 +2491,14 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry 
*h, void *inf)
        }
       else
        {
+         eh->plt_got.offset = (bfd_vma) -1;
          h->plt.offset = (bfd_vma) -1;
          h->needs_plt = 0;
        }
     }
   else
     {
+      eh->plt_got.offset = (bfd_vma) -1;
       h->plt.offset = (bfd_vma) -1;
       h->needs_plt = 0;
     }
@@ -2813,14 +2816,16 @@ elf_i386_convert_load (bfd *abfd, asection *sec,
       unsigned int nop;
       bfd_vma nop_offset;
 
-      if (r_type != R_386_GOT32 && r_type != R_386_GOT32X)
+      /* Don't convert R_386_GOT32 since we can't tell if it is applied
+        to "mov $foo@GOT, %reg" which isn't a load via GOT.  */
+      if (r_type != R_386_GOT32X)
        continue;
 
       roff = irel->r_offset;
       if (roff < 2)
        continue;
 
-      /* Addend for R_386_GOT32 and R_386_GOT32X relocations must be 0.  */
+      /* Addend for R_386_GOT32X relocation must be 0.  */
       addend = bfd_get_32 (abfd, contents + roff);
       if (addend != 0)
        continue;
@@ -2828,13 +2833,11 @@ elf_i386_convert_load (bfd *abfd, asection *sec,
       modrm = bfd_get_8 (abfd, contents + roff - 1);
       baseless = (modrm & 0xc7) == 0x5;
 
-      if (r_type == R_386_GOT32X
-         && baseless
+      if (baseless
          && bfd_link_pic (link_info))
        {
          /* For PIC, disallow R_386_GOT32X without a base register
-            since we don't know what the GOT base is.   Allow
-            R_386_GOT32 for existing object files.  */
+            since we don't know what the GOT base is.  */
          const char *name;
 
          if (r_symndx < symtab_hdr->sh_info)
@@ -2862,12 +2865,6 @@ elf_i386_convert_load (bfd *abfd, asection *sec,
       /* It is OK to convert mov to lea.  */
       if (opcode != 0x8b)
        {
-         /* Only convert R_386_GOT32X relocation for call, jmp or
-            one of adc, add, and, cmp, or, sbb, sub, test, xor
-            instructions.  */
-         if (r_type != R_386_GOT32X)
-           continue;
-
          /* It is OK to convert indirect branch to direct branch.  It
             is OK to convert adc, add, and, cmp, or, sbb, sub, test,
             xor only when PIC is false.   */
@@ -2875,8 +2872,8 @@ elf_i386_convert_load (bfd *abfd, asection *sec,
            continue;
        }
 
-      /* Try to convert R_386_GOT32 and R_386_GOT32X.  Get the symbol
-        referred to by the reloc.  */
+      /* Try to convert R_386_GOT32X.  Get the symbol referred to by
+         the reloc.  */
       if (r_symndx < symtab_hdr->sh_info)
        {
          isym = bfd_sym_from_r_symndx (&htab->sym_cache,
@@ -2988,8 +2985,7 @@ convert_load:
                {
                  /* Convert "mov foo@GOT(%reg1), %reg2" to
                     "lea foo@GOTOFF(%reg1), %reg2".  */
-                 if (r_type == R_386_GOT32X
-                     && (baseless || !bfd_link_pic (link_info)))
+                 if (baseless || !bfd_link_pic (link_info))
                    {
                      r_type = R_386_32;
                      /* For R_386_32, convert
@@ -3953,20 +3949,26 @@ elf_i386_relocate_section (bfd *output_bfd,
                    }
 
                  relocation = off;
-
-                 /* Adjust for static executables.  */
-                 if (htab->elf.splt == NULL)
-                   relocation += gotplt->output_offset;
                }
              else
+               relocation = (base_got->output_section->vma
+                             + base_got->output_offset + off
+                             - gotplt->output_section->vma
+                             - gotplt->output_offset);
+
+             if ((*(contents + rel->r_offset - 1) & 0xc7) == 0x5)
+               {
+                 if (bfd_link_pic (info))
+                   goto disallow_got32;
+
+                 /* Add the GOT base if there is no base register.  */
+                 relocation += (gotplt->output_section->vma
+                                + gotplt->output_offset);
+               }
+             else if (htab->elf.splt == NULL)
                {
-                 relocation = (base_got->output_section->vma
-                               + base_got->output_offset + off
-                               - gotplt->output_section->vma
-                               - gotplt->output_offset);
                  /* Adjust for static executables.  */
-                 if (htab->elf.splt == NULL)
-                   relocation += gotplt->output_offset;
+                 relocation += gotplt->output_offset;
                }
 
              goto do_relocation;
@@ -4016,10 +4018,12 @@ elf_i386_relocate_section (bfd *output_bfd,
 
          /* It is relative to .got.plt section.  */
          if (h->got.offset != (bfd_vma) -1)
-           /* Use GOT entry.  */
+           /* Use GOT entry.  Mask off the least significant bit in
+              GOT offset which may be set by R_386_GOT32 processing
+              below.  */
            relocation = (htab->elf.sgot->output_section->vma
                          + htab->elf.sgot->output_offset
-                         + h->got.offset - offplt);
+                         + (h->got.offset & ~1) - offplt);
          else
            /* Use GOTPLT entry.  */
            relocation = (h->plt.offset / plt_entry_size - 1 + 3) * 4;
@@ -4122,10 +4126,39 @@ r_386_got32:
          if (off >= (bfd_vma) -2)
            abort ();
 
-         relocation = htab->elf.sgot->output_section->vma
-                      + htab->elf.sgot->output_offset + off
-                      - htab->elf.sgotplt->output_section->vma
-                      - htab->elf.sgotplt->output_offset;
+         relocation = (htab->elf.sgot->output_section->vma
+                       + htab->elf.sgot->output_offset + off);
+         if ((*(contents + rel->r_offset - 1) & 0xc7) == 0x5)
+           {
+             if (bfd_link_pic (info))
+               {
+                 /* For PIC, disallow R_386_GOT32 without a base
+                    register since we don't know what the GOT base
+                    is.  */
+                 const char *name;
+
+disallow_got32:
+                 if (h == NULL)
+                   name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym,
+                                            NULL);
+                 else
+                   name = h->root.root.string;
+
+                 (*_bfd_error_handler)
+                   (_("%B: direct GOT relocation %s against `%s' without base 
register can not be used when making a shared object"),
+                    input_bfd, howto->name, name);
+                 bfd_set_error (bfd_error_bad_value);
+                 return FALSE;
+               }
+           }
+         else
+           {
+             /* Subtract the .got.plt section address only with a base
+                register.  */
+             relocation -= (htab->elf.sgotplt->output_section->vma
+                            + htab->elf.sgotplt->output_offset);
+           }
+
          break;
 
        case R_386_GOTOFF:
@@ -4285,8 +4318,8 @@ r_386_got32:
              else if (h != NULL
                       && h->dynindx != -1
                       && (r_type == R_386_PC32
-                          || !bfd_link_pic (info)
-                          || !SYMBOLIC_BIND (info, h)
+                          || !(bfd_link_executable (info)
+                               || SYMBOLIC_BIND (info, h))
                           || !h->def_regular))
                outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
              else
@@ -5355,19 +5388,23 @@ elf_i386_reloc_type_class (const struct bfd_link_info 
*info,
   bfd *abfd = info->output_bfd;
   const struct elf_backend_data *bed = get_elf_backend_data (abfd);
   struct elf_link_hash_table *htab = elf_hash_table (info);
-  unsigned long r_symndx = ELF32_R_SYM (rela->r_info);
-  Elf_Internal_Sym sym;
-
-  if (htab->dynsym == NULL
-      || !bed->s->swap_symbol_in (abfd,
-                                 (htab->dynsym->contents
-                                  + r_symndx * sizeof (Elf32_External_Sym)),
-                                 0, &sym))
-    abort ();
 
-  /* Check relocation against STT_GNU_IFUNC symbol.  */
-  if (ELF32_ST_TYPE (sym.st_info) == STT_GNU_IFUNC)
-    return reloc_class_ifunc;
+  if (htab->dynsym != NULL
+      && htab->dynsym->contents != NULL)
+    {
+      /* Check relocation against STT_GNU_IFUNC symbol if there are
+         dynamic symbols.  */
+      unsigned long r_symndx = ELF32_R_SYM (rela->r_info);
+      Elf_Internal_Sym sym;
+      if (!bed->s->swap_symbol_in (abfd,
+                                  (htab->dynsym->contents
+                                   + r_symndx * sizeof (Elf32_External_Sym)),
+                                  0, &sym))
+       abort ();
+
+      if (ELF32_ST_TYPE (sym.st_info) == STT_GNU_IFUNC)
+       return reloc_class_ifunc;
+    }
 
   switch (ELF32_R_TYPE (rela->r_info))
     {
diff --git a/binutils/bfd/elf32-ppc.c b/binutils/bfd/elf32-ppc.c
index ea03598..cfc6e57 100644
--- a/binutils/bfd/elf32-ppc.c
+++ b/binutils/bfd/elf32-ppc.c
@@ -5166,6 +5166,7 @@ ppc_elf_tls_setup (bfd *obfd, struct bfd_link_info *info)
                  tga->root.type = bfd_link_hash_indirect;
                  tga->root.u.i.link = &opt->root;
                  ppc_elf_copy_indirect_symbol (info, opt, tga);
+                 opt->forced_local = 0;
                  if (opt->dynindx != -1)
                    {
                      /* Use __tls_get_addr_opt in dynamic relocations.  */
diff --git a/binutils/bfd/elf64-hppa.c b/binutils/bfd/elf64-hppa.c
index 3b628b4..aa9cfd2 100644
--- a/binutils/bfd/elf64-hppa.c
+++ b/binutils/bfd/elf64-hppa.c
@@ -2945,7 +2945,7 @@ elf_hppa_record_segment_addrs (bfd *abfd,
 static bfd_boolean
 elf_hppa_final_link (bfd *abfd, struct bfd_link_info *info)
 {
-  bfd_boolean retval;
+  struct stat buf;
   struct elf64_hppa_link_hash_table *hppa_info = hppa_link_hash_table (info);
 
   if (hppa_info == NULL)
@@ -3029,7 +3029,8 @@ elf_hppa_final_link (bfd *abfd, struct bfd_link_info 
*info)
                          info);
 
   /* Invoke the regular ELF backend linker to do all the work.  */
-  retval = bfd_elf_final_link (abfd, info);
+  if (!bfd_elf_final_link (abfd, info))
+    return FALSE;
 
   elf_link_hash_traverse (elf_hash_table (info),
                          elf_hppa_remark_useless_dynamic_symbols,
@@ -3037,10 +3038,17 @@ elf_hppa_final_link (bfd *abfd, struct bfd_link_info 
*info)
 
   /* If we're producing a final executable, sort the contents of the
      unwind section. */
-  if (retval && !bfd_link_relocatable (info))
-    retval = elf_hppa_sort_unwind (abfd);
+  if (bfd_link_relocatable (info))
+    return TRUE;
+
+  /* Do not attempt to sort non-regular files.  This is here
+     especially for configure scripts and kernel builds which run
+     tests with "ld [...] -o /dev/null".  */
+  if (stat (abfd->filename, &buf) != 0
+      || !S_ISREG(buf.st_mode))
+    return TRUE;
 
-  return retval;
+  return elf_hppa_sort_unwind (abfd);
 }
 
 /* Relocate the given INSN.  VALUE should be the actual value we want
diff --git a/binutils/bfd/elf64-ppc.c b/binutils/bfd/elf64-ppc.c
index 162862c..aa6fe08 100644
--- a/binutils/bfd/elf64-ppc.c
+++ b/binutils/bfd/elf64-ppc.c
@@ -2570,6 +2570,7 @@ ppc64_elf_branch_reloc (bfd *abfd, arelent *reloc_entry, 
asymbol *symbol,
       elf_symbol_type *elfsym = (elf_symbol_type *) symbol;
 
       if (symbol->section->owner != abfd
+         && symbol->section->owner != NULL
          && abiversion (symbol->section->owner) >= 2)
        {
          unsigned int i;
@@ -4344,14 +4345,20 @@ create_linkage_sections (bfd *dynobj, struct 
bfd_link_info *info)
 
   htab = ppc_hash_table (info);
 
-  /* Create .sfpr for code to save and restore fp regs.  */
   flags = (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_READONLY
           | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED);
-  htab->sfpr = bfd_make_section_anyway_with_flags (dynobj, ".sfpr",
-                                                  flags);
-  if (htab->sfpr == NULL
-      || ! bfd_set_section_alignment (dynobj, htab->sfpr, 2))
-    return FALSE;
+  if (htab->params->save_restore_funcs)
+    {
+      /* Create .sfpr for code to save and restore fp regs.  */
+      htab->sfpr = bfd_make_section_anyway_with_flags (dynobj, ".sfpr",
+                                                      flags);
+      if (htab->sfpr == NULL
+         || ! bfd_set_section_alignment (dynobj, htab->sfpr, 2))
+       return FALSE;
+    }
+
+  if (bfd_link_relocatable (info))
+    return TRUE;
 
   /* Create .glink for lazy dynamic linking support.  */
   htab->glink = bfd_make_section_anyway_with_flags (dynobj, ".glink",
@@ -4429,9 +4436,6 @@ ppc64_elf_init_stub_bfd (struct bfd_link_info *info,
   htab->elf.dynobj = params->stub_bfd;
   htab->params = params;
 
-  if (bfd_link_relocatable (info))
-    return TRUE;
-
   return create_linkage_sections (htab->elf.dynobj, info);
 }
 
@@ -6665,7 +6669,7 @@ sfpr_define (struct bfd_link_info *info,
       sym[len + 0] = i / 10 + '0';
       sym[len + 1] = i % 10 + '0';
       h = (struct ppc_link_hash_entry *)
-       elf_link_hash_lookup (&htab->elf, sym, FALSE, FALSE, TRUE);
+       elf_link_hash_lookup (&htab->elf, sym, writing, TRUE, TRUE);
       if (stub_sec != NULL)
        {
          if (h != NULL
@@ -6706,6 +6710,7 @@ sfpr_define (struct bfd_link_info *info,
              h->elf.root.u.def.value = htab->sfpr->size;
              h->elf.type = STT_FUNC;
              h->elf.def_regular = 1;
+             h->elf.non_elf = 0;
              _bfd_elf_link_hash_hide_symbol (info, &h->elf, TRUE);
              writing = TRUE;
              if (htab->sfpr->contents == NULL)
@@ -7050,14 +7055,28 @@ ppc64_elf_func_desc_adjust (bfd *obfd ATTRIBUTE_UNUSED,
                            struct bfd_link_info *info)
 {
   struct ppc_link_hash_table *htab;
-  unsigned int i;
 
   htab = ppc_hash_table (info);
   if (htab == NULL)
     return FALSE;
 
-  if (!bfd_link_relocatable (info)
-      && htab->elf.hgot != NULL)
+  /* Provide any missing _save* and _rest* functions.  */
+  if (htab->sfpr != NULL)
+    {
+      unsigned int i;
+
+      htab->sfpr->size = 0;
+      for (i = 0; i < ARRAY_SIZE (save_res_funcs); i++)
+       if (!sfpr_define (info, &save_res_funcs[i], NULL))
+         return FALSE;
+      if (htab->sfpr->size == 0)
+       htab->sfpr->flags |= SEC_EXCLUDE;
+    }
+
+  if (bfd_link_relocatable (info))
+    return TRUE;
+
+  if (htab->elf.hgot != NULL)
     {
       _bfd_elf_link_hash_hide_symbol (info, htab->elf.hgot, TRUE);
       /* Make .TOC. defined so as to prevent it being made dynamic.
@@ -7076,22 +7095,8 @@ ppc64_elf_func_desc_adjust (bfd *obfd ATTRIBUTE_UNUSED,
                               | STV_HIDDEN);
     }
 
-  if (htab->sfpr == NULL)
-    /* We don't have any relocs.  */
-    return TRUE;
-
-  /* Provide any missing _save* and _rest* functions.  */
-  htab->sfpr->size = 0;
-  if (htab->params->save_restore_funcs)
-    for (i = 0; i < ARRAY_SIZE (save_res_funcs); i++)
-      if (!sfpr_define (info, &save_res_funcs[i], NULL))
-       return FALSE;
-
   elf_link_hash_traverse (&htab->elf, func_desc_adjust, info);
 
-  if (htab->sfpr->size == 0)
-    htab->sfpr->flags |= SEC_EXCLUDE;
-
   return TRUE;
 }
 
@@ -8224,6 +8229,7 @@ ppc64_elf_tls_setup (struct bfd_link_info *info)
                  tga_fd->root.type = bfd_link_hash_indirect;
                  tga_fd->root.u.i.link = &opt_fd->root;
                  ppc64_elf_copy_indirect_symbol (info, opt_fd, tga_fd);
+                 opt_fd->forced_local = 0;
                  if (opt_fd->dynindx != -1)
                    {
                      /* Use __tls_get_addr_opt in dynamic relocations.  */
@@ -8240,6 +8246,7 @@ ppc64_elf_tls_setup (struct bfd_link_info *info)
                      tga->root.type = bfd_link_hash_indirect;
                      tga->root.u.i.link = &opt->root;
                      ppc64_elf_copy_indirect_symbol (info, opt, tga);
+                     opt->forced_local = 0;
                      _bfd_elf_link_hash_hide_symbol (info, opt,
                                                      tga->forced_local);
                      htab->tls_get_addr = (struct ppc_link_hash_entry *) opt;
@@ -12177,6 +12184,13 @@ ppc64_elf_size_stubs (struct bfd_link_info *info)
   if (!group_sections (info, stub_group_size, stubs_always_before_branch))
     return FALSE;
 
+#define STUB_SHRINK_ITER 20
+  /* Loop until no stubs added.  After iteration 20 of this loop we may
+     exit on a stub section shrinking.  This is to break out of a
+     pathological case where adding stubs on one iteration decreases
+     section gaps (perhaps due to alignment), which then requires
+     fewer or smaller stubs on the next iteration.  */
+
   while (1)
     {
       bfd *input_bfd;
@@ -12558,11 +12572,11 @@ ppc64_elf_size_stubs (struct bfd_link_info *info)
           stub_sec != NULL;
           stub_sec = stub_sec->next)
        if ((stub_sec->flags & SEC_LINKER_CREATED) == 0
-           && stub_sec->rawsize != stub_sec->size)
+           && stub_sec->rawsize != stub_sec->size
+           && (htab->stub_iteration <= STUB_SHRINK_ITER
+               || stub_sec->rawsize < stub_sec->size))
          break;
 
-      /* Exit from this loop when no stubs have been added, and no stubs
-        have changed size.  */
       if (stub_sec == NULL
          && (htab->glink_eh_frame == NULL
              || htab->glink_eh_frame->rawsize == htab->glink_eh_frame->size))
@@ -12893,9 +12907,6 @@ ppc64_elf_build_stubs (struct bfd_link_info *info,
        stub_sec->contents = bfd_zalloc (htab->params->stub_bfd, 
stub_sec->size);
        if (stub_sec->contents == NULL)
          return FALSE;
-       /* We want to check that built size is the same as calculated
-          size.  rawsize is a convenient location to use.  */
-       stub_sec->rawsize = stub_sec->size;
        stub_sec->size = 0;
       }
 
@@ -13084,7 +13095,9 @@ ppc64_elf_build_stubs (struct bfd_link_info *info,
     if ((stub_sec->flags & SEC_LINKER_CREATED) == 0)
       {
        stub_sec_count += 1;
-       if (stub_sec->rawsize != stub_sec->size)
+       if (stub_sec->rawsize != stub_sec->size
+           && (htab->stub_iteration <= STUB_SHRINK_ITER
+               || stub_sec->rawsize < stub_sec->size))
          break;
       }
 
diff --git a/binutils/bfd/elf64-x86-64.c b/binutils/bfd/elf64-x86-64.c
index 63957bb..7261405 100644
--- a/binutils/bfd/elf64-x86-64.c
+++ b/binutils/bfd/elf64-x86-64.c
@@ -2029,7 +2029,8 @@ do_size:
               && (sec->flags & SEC_ALLOC) != 0
               && (! IS_X86_64_PCREL_TYPE (r_type)
                   || (h != NULL
-                      && (! SYMBOLIC_BIND (info, h)
+                      && (! (bfd_link_pie (info)
+                             || SYMBOLIC_BIND (info, h))
                           || h->root.type == bfd_link_hash_defweak
                           || !h->def_regular))))
              || (ELIMINATE_COPY_RELOCS
@@ -2723,12 +2724,14 @@ elf_x86_64_allocate_dynrelocs (struct 
elf_link_hash_entry *h, void * inf)
        }
       else
        {
+         eh->plt_got.offset = (bfd_vma) -1;
          h->plt.offset = (bfd_vma) -1;
          h->needs_plt = 0;
        }
     }
   else
     {
+      eh->plt_got.offset = (bfd_vma) -1;
       h->plt.offset = (bfd_vma) -1;
       h->needs_plt = 0;
     }
@@ -3151,6 +3154,11 @@ elf_x86_64_convert_load (bfd *abfd, asection *sec,
            continue;
        }
 
+      /* Don't convert GOTPCREL relocation against large section.  */
+      if (elf_section_data (tsec) !=  NULL
+         && (elf_section_flags (tsec) & SHF_X86_64_LARGE) != 0)
+       continue;
+
       if (tsec->sec_info_type == SEC_INFO_TYPE_MERGE)
        {
          /* At this stage in linking, no SEC_MERGE symbol has been
@@ -3190,35 +3198,46 @@ elf_x86_64_convert_load (bfd *abfd, asection *sec,
        }
       else
        {
-         asection *asect;
-         bfd_size_type size;
+         bfd_signed_vma distance;
 
          /* At this point, we don't know the load addresses of TSEC
             section nor SEC section.  We estimate the distrance between
-            SEC and TSEC.  */
-         size = 0;
-         for (asect = sec->output_section;
-              asect != NULL && asect != tsec->output_section;
-              asect = asect->next)
+            SEC and TSEC.  We store the estimated distances in the
+            compressed_size field of the output section, which is only
+            used to decompress the compressed input section.  */
+         if (sec->output_section->compressed_size == 0)
            {
-             asection *i;
-             for (i = asect->output_section->map_head.s;
-                  i != NULL;
-                  i = i->map_head.s)
-               {
-                 size = align_power (size, i->alignment_power);
-                 size += i->size;
-               }
+             asection *asect;
+             bfd_size_type size = 0;
+             for (asect = link_info->output_bfd->sections;
+                  asect != NULL;
+                  asect = asect->next)
+               /* Skip debug sections since compressed_size is used to
+                  compress debug sections.  */
+               if ((asect->flags & SEC_DEBUGGING) == 0)
+                 {
+                   asection *i;
+                   for (i = asect->map_head.s;
+                        i != NULL;
+                        i = i->map_head.s)
+                     {
+                       size = align_power (size, i->alignment_power);
+                       size += i->size;
+                     }
+                   asect->compressed_size = size;
+                 }
            }
 
          /* Don't convert GOTPCREL relocations if TSEC isn't placed
             after SEC.  */
-         if (asect == NULL)
+         distance = (tsec->output_section->compressed_size
+                     - sec->output_section->compressed_size);
+         if (distance < 0)
            continue;
 
          /* Take PT_GNU_RELRO segment into account by adding
             maxpagesize.  */
-         if ((toff + size + maxpagesize - roff + 0x80000000)
+         if ((toff + distance + maxpagesize - roff + 0x80000000)
              > 0xffffffff)
            continue;
        }
@@ -4631,8 +4650,8 @@ direct:
              else if (h != NULL
                       && h->dynindx != -1
                       && (IS_X86_64_PCREL_TYPE (r_type)
-                          || ! bfd_link_pic (info)
-                          || ! SYMBOLIC_BIND (info, h)
+                          || !(bfd_link_executable (info)
+                               || SYMBOLIC_BIND (info, h))
                           || ! h->def_regular))
                {
                  outrel.r_info = htab->r_info (h->dynindx, r_type);
@@ -5728,19 +5747,23 @@ elf_x86_64_reloc_type_class (const struct bfd_link_info 
*info,
   bfd *abfd = info->output_bfd;
   const struct elf_backend_data *bed = get_elf_backend_data (abfd);
   struct elf_x86_64_link_hash_table *htab = elf_x86_64_hash_table (info);
-  unsigned long r_symndx = htab->r_sym (rela->r_info);
-  Elf_Internal_Sym sym;
-
-  if (htab->elf.dynsym == NULL
-      || !bed->s->swap_symbol_in (abfd,
-                                 (htab->elf.dynsym->contents
-                                  + r_symndx * bed->s->sizeof_sym),
-                                 0, &sym))
-    abort ();
 
-  /* Check relocation against STT_GNU_IFUNC symbol.  */
-  if (ELF_ST_TYPE (sym.st_info) == STT_GNU_IFUNC)
-    return reloc_class_ifunc;
+  if (htab->elf.dynsym != NULL
+      && htab->elf.dynsym->contents != NULL)
+    {
+      /* Check relocation against STT_GNU_IFUNC symbol if there are
+         dynamic symbols.  */
+      unsigned long r_symndx = htab->r_sym (rela->r_info);
+      Elf_Internal_Sym sym;
+      if (!bed->s->swap_symbol_in (abfd,
+                                  (htab->elf.dynsym->contents
+                                   + r_symndx * bed->s->sizeof_sym),
+                                  0, &sym))
+       abort ();
+
+      if (ELF_ST_TYPE (sym.st_info) == STT_GNU_IFUNC)
+       return reloc_class_ifunc;
+    }
 
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
diff --git a/binutils/bfd/elflink.c b/binutils/bfd/elflink.c
index 3d37bb4..4e7de0c 100644
--- a/binutils/bfd/elflink.c
+++ b/binutils/bfd/elflink.c
@@ -555,6 +555,19 @@ bfd_elf_record_link_assignment (bfd *output_bfd,
   if (h == NULL)
     return provide;
 
+  if (h->versioned == unknown)
+    {
+      /* Set versioned if symbol version is unknown.  */
+      char *version = strrchr (name, ELF_VER_CHR);
+      if (version)
+       {
+         if (version > name && version[-1] != ELF_VER_CHR)
+           h->versioned = versioned_hidden;
+         else
+           h->versioned = versioned;
+       }
+    }
+
   switch (h->root.type)
     {
     case bfd_link_hash_defined:
@@ -1171,21 +1184,20 @@ _bfd_elf_merge_symbol (bfd *abfd,
   oldfunc = (h->type != STT_NOTYPE
             && bed->is_function_type (h->type));
 
-  /* When we try to create a default indirect symbol from the dynamic
-     definition with the default version, we skip it if its type and
-     the type of existing regular definition mismatch.  */
+  /* If creating a default indirect symbol ("foo" or "foo@") from a
+     dynamic versioned definition ("foo@@") skip doing so if there is
+     an existing regular definition with a different type.  We don't
+     want, for example, a "time" variable in the executable overriding
+     a "time" function in a shared library.  */
   if (pold_alignment == NULL
       && newdyn
       && newdef
       && !olddyn
-      && (((olddef || h->root.type == bfd_link_hash_common)
-          && ELF_ST_TYPE (sym->st_info) != h->type
-          && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE
-          && h->type != STT_NOTYPE
-          && !(newfunc && oldfunc))
-         || (olddef
-             && ((h->type == STT_GNU_IFUNC)
-                 != (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)))))
+      && (olddef || h->root.type == bfd_link_hash_common)
+      && ELF_ST_TYPE (sym->st_info) != h->type
+      && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE
+      && h->type != STT_NOTYPE
+      && !(newfunc && oldfunc))
     {
       *skip = TRUE;
       return TRUE;
@@ -1472,13 +1484,16 @@ _bfd_elf_merge_symbol (bfd *abfd,
      represent variables; this can cause confusion in principle, but
      any such confusion would seem to indicate an erroneous program or
      shared library.  We also permit a common symbol in a regular
-     object to override a weak symbol in a shared object.  */
+     object to override a weak symbol in a shared object.  A common
+     symbol in executable also overrides a symbol in a shared object.  */
 
   if (newdyn
       && newdef
       && (olddef
          || (h->root.type == bfd_link_hash_common
-             && (newweak || newfunc))))
+             && (newweak
+                 || newfunc
+                 || (!olddyn && bfd_link_executable (info))))))
     {
       *override = TRUE;
       newdef = FALSE;
@@ -1750,6 +1765,31 @@ _bfd_elf_add_default_symbol (bfd *abfd,
   if (skip)
     goto nondefault;
 
+  if (hi->def_regular)
+    {
+      /* If the undecorated symbol will have a version added by a
+        script different to H, then don't indirect to/from the
+        undecorated symbol.  This isn't ideal because we may not yet
+        have seen symbol versions, if given by a script on the
+        command line rather than via --version-script.  */
+      if (hi->verinfo.vertree == NULL && info->version_info != NULL)
+       {
+         bfd_boolean hide;
+
+         hi->verinfo.vertree
+           = bfd_find_version_for_sym (info->version_info,
+                                       hi->root.root.string, &hide);
+         if (hi->verinfo.vertree != NULL && hide)
+           {
+             (*bed->elf_backend_hide_symbol) (info, hi, TRUE);
+             goto nondefault;
+           }
+       }
+      if (hi->verinfo.vertree != NULL
+         && strcmp (p + 1 + (p[1] == '@'), hi->verinfo.vertree->name) != 0)
+       goto nondefault;
+    }
+
   if (! override)
     {
       /* Add the default symbol if not performing a relocatable link.  */
@@ -3481,8 +3521,7 @@ elf_link_add_object_symbols (bfd *abfd, struct 
bfd_link_info *info)
   void *old_ent;
   struct bfd_link_hash_entry *old_undefs = NULL;
   struct bfd_link_hash_entry *old_undefs_tail = NULL;
-  long old_dynsymcount = 0;
-  bfd_size_type old_dynstr_size = 0;
+  void *old_strtab = NULL;
   size_t tabsize = 0;
   asection *s;
   bfd_boolean just_syms;
@@ -3923,8 +3962,9 @@ error_free_dyn:
       old_table = htab->root.table.table;
       old_size = htab->root.table.size;
       old_count = htab->root.table.count;
-      old_dynsymcount = htab->dynsymcount;
-      old_dynstr_size = _bfd_elf_strtab_size (htab->dynstr);
+      old_strtab = _bfd_elf_strtab_save (htab->dynstr);
+      if (old_strtab == NULL)
+       goto error_free_vers;
 
       for (i = 0; i < htab->root.table.size; i++)
        {
@@ -4562,8 +4602,10 @@ error_free_dyn:
                break;
              }
 
-         /* Don't add DT_NEEDED for references from the dummy bfd.  */
+         /* Don't add DT_NEEDED for references from the dummy bfd nor
+            for unmatched symbol.  */
          if (!add_needed
+             && matched
              && definition
              && ((dynsym
                   && h->ref_regular_nonweak
@@ -4633,7 +4675,9 @@ error_free_dyn:
       memcpy (htab->root.table.table, old_tab, tabsize);
       htab->root.undefs = old_undefs;
       htab->root.undefs_tail = old_undefs_tail;
-      _bfd_elf_strtab_restore_size (htab->dynstr, old_dynstr_size);
+      _bfd_elf_strtab_restore (htab->dynstr, old_strtab);
+      free (old_strtab);
+      old_strtab = NULL;
       for (i = 0; i < htab->root.table.size; i++)
        {
          struct bfd_hash_entry *p;
@@ -4646,9 +4690,6 @@ error_free_dyn:
              h = (struct elf_link_hash_entry *) p;
              if (h->root.type == bfd_link_hash_warning)
                h = (struct elf_link_hash_entry *) h->root.u.i.link;
-             if (h->dynindx >= old_dynsymcount
-                 && h->dynstr_index < old_dynstr_size)
-               _bfd_elf_strtab_delref (htab->dynstr, h->dynstr_index);
 
              /* Preserve the maximum alignment and size for common
                 symbols even if this dynamic lib isn't on DT_NEEDED
@@ -5018,6 +5059,8 @@ error_free_dyn:
  error_free_vers:
   if (old_tab != NULL)
     free (old_tab);
+  if (old_strtab != NULL)
+    free (old_strtab);
   if (nondeflt_vers != NULL)
     free (nondeflt_vers);
   if (extversym != NULL)
diff --git a/binutils/bfd/elfnn-aarch64.c b/binutils/bfd/elfnn-aarch64.c
index 59c51cc..d83dc1b 100644
--- a/binutils/bfd/elfnn-aarch64.c
+++ b/binutils/bfd/elfnn-aarch64.c
@@ -2655,7 +2655,7 @@ aarch64_type_of_stub (struct bfd_link_info *info,
   bfd_boolean via_plt_p;
 
   if (st_type != STT_FUNC
-      && (sym_sec != bfd_abs_section_ptr))
+      && (sym_sec == input_sec))
     return stub_type;
 
   globals = elf_aarch64_hash_table (info);
@@ -4174,7 +4174,7 @@ elfNN_aarch64_size_stubs (bfd *output_bfd,
                      goto error_ret_free_internal;
                    }
 
-                 stub_entry->target_value = sym_value;
+                 stub_entry->target_value = sym_value + irela->r_addend;
                  stub_entry->target_section = sym_sec;
                  stub_entry->stub_type = stub_type;
                  stub_entry->h = hash;
@@ -5280,15 +5280,28 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type 
*howto,
        /* Check if a stub has to be inserted because the destination
           is too far away.  */
        struct elf_aarch64_stub_hash_entry *stub_entry = NULL;
-       if (! aarch64_valid_branch_p (value, place))
+
+       /* If the branch destination is directed to plt stub, "value" will be
+          the final destination, otherwise we should plus signed_addend, it may
+          contain non-zero value, for example call to local function symbol
+          which are turned into "sec_sym + sec_off", and sec_off is kept in
+          signed_addend.  */
+       if (! aarch64_valid_branch_p (via_plt_p ? value : value + signed_addend,
+                                     place))
          /* The target is out of reach, so redirect the branch to
             the local stub for this function.  */
        stub_entry = elfNN_aarch64_get_stub_entry (input_section, sym_sec, h,
                                                   rel, globals);
        if (stub_entry != NULL)
-         value = (stub_entry->stub_offset
-                  + stub_entry->stub_sec->output_offset
-                  + stub_entry->stub_sec->output_section->vma);
+         {
+           value = (stub_entry->stub_offset
+                    + stub_entry->stub_sec->output_offset
+                    + stub_entry->stub_sec->output_section->vma);
+
+           /* We have redirected the destination to stub entry address,
+              so ignore any addend record in the original rela entry.  */
+           signed_addend = 0;
+         }
       }
       value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value,
                                                   signed_addend, weak_undef_p);
diff --git a/binutils/bfd/version.h b/binutils/bfd/version.h
index ed51cc9..4806c47 100644
--- a/binutils/bfd/version.h
+++ b/binutils/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20160125
+#define BFD_VERSION_DATE 20160629
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/binutils/bfd/version.m4 b/binutils/bfd/version.m4
index 9fb81c5..42fca3d 100644
--- a/binutils/bfd/version.m4
+++ b/binutils/bfd/version.m4
@@ -1 +1 @@
-m4_define([BFD_VERSION], [2.26])
+m4_define([BFD_VERSION], [2.26.1])
diff --git a/binutils/binutils/ChangeLog b/binutils/binutils/ChangeLog
index 2250b30..9c26fe9 100644
--- a/binutils/binutils/ChangeLog
+++ b/binutils/binutils/ChangeLog
@@ -1,3 +1,48 @@
+2016-06-29  Tristan Gingold  <gingold@xxxxxxxxxxx>
+
+       * configure: Regenerate.
+
+2016-06-28  Alan Modra  <amodra@xxxxxxxxx>
+
+       PR 20304
+       * objdump.c (objdump_print_symname): Don't attempt to retrieve
+       version info from synthetic symbols.
+
+2016-06-13  Alan Modra  <amodra@xxxxxxxxx>
+
+       * objcopy.c (copy_main): Init newsym->othersym.
+
+2016-03-14  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       Backport from master
+       2016-01-28  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       PR binutils/19523
+       * Makefile.am (check-DEJAGNU): Pass CC and CC_FOR_BUILD to
+       runtest.
+       * Makefile.in: Regenerated.
+       * testsuite/binutils-all/compress.exp (test_gnu_debuglink): New
+       proc.
+       Run test_gnu_debuglink for native ELF build.
+
+2016-03-09  Nick Clifton  <nickc@xxxxxxxxxx>
+
+       PR binutils/19775
+       * testsuite/binutils-all/ar.exp (proc empty_archive): New proc.
+       Run the new proc.
+       * testsuite/binutils-all/empty: New, empty, file.
+
+2016-02-12  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       Backport from master
+       2016-02-12  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+       * doc/binutils.texi: Fix a typo.
+
+2016-01-25  Tristan Gingold  <gingold@xxxxxxxxxxx>
+
+       * configure: Regenerate.
+
 2016-01-25  Tristan Gingold  <gingold@xxxxxxxxxxx>
 
        * configure: Regenerate.
@@ -238,12 +283,12 @@
 
 2015-07-10  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
 
-        PR binutils/18656
-        * objcopy.c (setup_section): Call bfd_convert_section_size
-        to get the output section size.
-        (copy_section): Get the section size from the output section
-        and call bfd_get_full_section_contents to convert section
-        contents for output.
+       PR binutils/18656
+       * objcopy.c (setup_section): Call bfd_convert_section_size
+       to get the output section size.
+       (copy_section): Get the section size from the output section
+       and call bfd_get_full_section_contents to convert section
+       contents for output.
 
 2015-07-10  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
 
diff --git a/binutils/binutils/Makefile.am b/binutils/binutils/Makefile.am
index 1735022..4f618ce 100644
--- a/binutils/binutils/Makefile.am
+++ b/binutils/binutils/Makefile.am
@@ -192,6 +192,7 @@ check-DEJAGNU: site.exp
        EXPECT=$(EXPECT); export EXPECT; \
        runtest=$(RUNTEST); \
        if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+         CC="$(CC)" CC_FOR_BUILD="$(CC_FOR_BUILD)" \
          CC_FOR_TARGET="$(CC_FOR_TARGET)" CFLAGS_FOR_TARGET="$(CFLAGS)" \
                $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
                        $(RUNTESTFLAGS); \
diff --git a/binutils/binutils/Makefile.in b/binutils/binutils/Makefile.in
index 5642925..eddd617 100644
--- a/binutils/binutils/Makefile.in
+++ b/binutils/binutils/Makefile.in
@@ -1290,6 +1290,7 @@ check-DEJAGNU: site.exp
        EXPECT=$(EXPECT); export EXPECT; \
        runtest=$(RUNTEST); \
        if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+         CC="$(CC)" CC_FOR_BUILD="$(CC_FOR_BUILD)" \
          CC_FOR_TARGET="$(CC_FOR_TARGET)" CFLAGS_FOR_TARGET="$(CFLAGS)" \
                $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
                        $(RUNTESTFLAGS); \
diff --git a/binutils/binutils/configure b/binutils/binutils/configure
index 6e1f21e..53cb411 100755
--- a/binutils/binutils/configure
+++ b/binutils/binutils/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.64 for binutils 2.26.
+# Generated by GNU Autoconf 2.64 for binutils 2.26.1.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
@@ -556,8 +556,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='binutils'
 PACKAGE_TARNAME='binutils'
-PACKAGE_VERSION='2.26'
-PACKAGE_STRING='binutils 2.26'
+PACKAGE_VERSION='2.26.1'
+PACKAGE_STRING='binutils 2.26.1'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1335,7 +1335,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures binutils 2.26 to adapt to many kinds of systems.
+\`configure' configures binutils 2.26.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1406,7 +1406,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of binutils 2.26:";;
+     short | recursive ) echo "Configuration of binutils 2.26.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1527,7 +1527,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-binutils configure 2.26
+binutils configure 2.26.1
 generated by GNU Autoconf 2.64
 
 Copyright (C) 2009 Free Software Foundation, Inc.
@@ -2169,7 +2169,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by binutils $as_me 2.26, which was
+It was created by binutils $as_me 2.26.1, which was
 generated by GNU Autoconf 2.64.  Invocation command line was
 
   $ $0 $@
@@ -3977,7 +3977,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='binutils'
- VERSION='2.26'
+ VERSION='2.26.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -15142,7 +15142,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by binutils $as_me 2.26, which was
+This file was extended by binutils $as_me 2.26.1, which was
 generated by GNU Autoconf 2.64.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15206,7 +15206,7 @@ Report bugs to the package provider."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
-binutils config.status 2.26
+binutils config.status 2.26.1
 configured by $0, generated by GNU Autoconf 2.64,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`\\"
 
diff --git a/binutils/binutils/doc/addr2line.1 
b/binutils/binutils/doc/addr2line.1
index 8a312d5..f94e214 100644
--- a/binutils/binutils/doc/addr2line.1
+++ b/binutils/binutils/doc/addr2line.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "ADDR2LINE 1"
-.TH ADDR2LINE 1 "2016-01-25" "binutils-2.26" "GNU Development Tools"
+.TH ADDR2LINE 1 "2016-06-29" "binutils-2.26.1" "GNU Development Tools"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/binutils/binutils/doc/ar.1 b/binutils/binutils/doc/ar.1
index fed5051..df9dacb 100644
--- a/binutils/binutils/doc/ar.1
+++ b/binutils/binutils/doc/ar.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "AR 1"
-.TH AR 1 "2016-01-25" "binutils-2.26" "GNU Development Tools"
+.TH AR 1 "2016-06-29" "binutils-2.26.1" "GNU Development Tools"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/binutils/binutils/doc/binutils.info 
b/binutils/binutils/doc/binutils.info
index 6fb8e16..27d74f1 100644
--- a/binutils/binutils/doc/binutils.info
+++ b/binutils/binutils/doc/binutils.info
@@ -1627,7 +1627,7 @@ the `--reverse-bytes' option.)
 `--compress-debug-sections=zlib-gabi'
      For ELF files, these options control how DWARF debug sections are
      compressed.  `--compress-debug-sections=none' is equivalent to
-     `--nocompress-debug-sections'.  `--compress-debug-sections=zlib'
+     `--decompress-debug-sections'.  `--compress-debug-sections=zlib'
      and `--compress-debug-sections=zlib-gabi' are equivalent to
      `--compress-debug-sections'.  `--compress-debug-sections=zlib-gnu'
      compresses DWARF debug sections using zlib.  The debug sections
diff --git a/binutils/binutils/doc/binutils.texi 
b/binutils/binutils/doc/binutils.texi
index 7dc09c3..2e424ef 100644
--- a/binutils/binutils/doc/binutils.texi
+++ b/binutils/binutils/doc/binutils.texi
@@ -1872,7 +1872,7 @@ ELF ABI.  Note - if compression would actually make a 
section
 @itemx --compress-debug-sections=zlib-gabi
 For ELF files, these options control how DWARF debug sections are
 compressed.  @option{--compress-debug-sections=none} is equivalent
-to @option{--nocompress-debug-sections}.
+to @option{--decompress-debug-sections}.
 @option{--compress-debug-sections=zlib} and

[ *** diff truncated: 13897 lines dropped *** ]


############################################################################

Revision:    btrev43119
Commit:      68e96393c7be88bc0e577404869a07ad3c0b48b3
URL:         http://cgit.haiku-os.org/buildtools/commit/?id=68e96393c7be
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Thu Jul 21 19:36:13 2016 UTC

Merge binutils 2.26.1

----------------------------------------------------------------------------



Other related posts:

  • » [haiku-commits] buildtools: btrev43119 - in binutils: . ld/testsuite/ld-i386 bfd ld ld/testsuite/ld-x86-64 - jerome . duval