commit 347aaeb0d8c17399987c389a9885c6fd7f1f5423 (HEAD -> gentoo/binutils-2.29.1, gentoo/gentoo/binutils-2.29.1)
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Oct 9 13:21:44 2017 +1030

    PR22212, memory leak in nm
    
            PR 22212
            * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
            funcinfo_hash_table and varinfo_hash_table.

 bfd/dwarf2.c | 4 ++++
 1 file changed, 4 insertions(+)

commit bdad782cff2e62b57ddfa743dca05ff7e7985f62
Author: Nick Clifton <nickc@redhat.com>
Date:   Wed Sep 27 10:42:51 2017 +0100

    Prevent an infinite loop in the DWARF parsing code when encountering a CU structure with a small negative size.
    
            PR 22219
            * dwarf.c (process_debug_info): Add a check for a negative
            cu_length field.

 binutils/dwarf.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

commit a9be91b9e28aca6b11a27ed4de3bf63ded6b2c0a
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Sep 26 09:32:18 2017 +0930

    PR22204, Lack of DW_LNE_end_sequence causes "infinite" loop
    
            PR 22204
            * dwarf2.c (decode_line_info): Ensure line_ptr stays within
            bounds in inner loop.

 bfd/dwarf2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 4163943fb164480401a3a4e498b12905fd17f8e0
Author: Alan Modra <amodra@gmail.com>
Date:   Sun Sep 24 17:10:14 2017 +0930

    PR22191, memory leak in dwarf2.c
    
    table->sequences is a linked list before it is replaced by a bfd_alloc
    array in sort_line_sequences.
    
            PR 22191
            * dwarf2.c (decode_line_info): Properly free line sequences on error.

 bfd/dwarf2.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

commit 7ddfaf99fe30eaa61fb5fb0a74ed98524ca833bb
Author: GDB Administrator <gdbadmin@sourceware.org>
Date:   Sat Sep 16 00:01:38 2017 +0000

    Automatic date update in version.in

 bfd/version.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit c81afb30d7f79783d7b458f14d1eac10c6193bfb
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Oct 5 11:06:44 2017 +1030

    bfd_error_on_input is for archives
    
            * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
            fini_array error value.
    
    (cherry picked from commit 8c6716e57eb991ba6ceb07011045d626652aaf01)

 bfd/ChangeLog | 5 +++++
 bfd/elflink.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

commit 87483769d5af280476a488d237205cbfc2071096
Author: Pavel I. Kryukov <kryukov@frtk.ru>
Date:   Tue Oct 3 22:42:07 2017 +0300

    PR22245, Fix potential UB in bfd_set_error
    
    Passing enum as a first argument to variadic argument function
    may lead to undefined behavior. The explanation on CERT site:
    https://www.securecoding.cert.org/confluence/display/cplusplus/
    EXP58-CPP.+Pass+an+object+of+the+correct+type+to+va_start
    
    The bug was found by Kirill Nedostoev (nedostoev.ka@phystech.edu)
    when he tried to build GNU binutils with Clang 7.
    
            PR 22245
            * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
            undergoes default promotion.
            * bfd-in2.h: Regenerate.
    
    (cherry picked from commit 9ba5f27cdd15d22d6c5739ff5d2b1c81d796e114)

 bfd/ChangeLog | 7 +++++++
 bfd/bfd-in2.h | 2 +-
 bfd/bfd.c     | 4 ++--
 3 files changed, 10 insertions(+), 3 deletions(-)

commit cfcb0cbc84c19ce2c76d44275bdeb2e891de6b7a
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Sep 28 17:11:38 2017 +0930

    PR22220, BFD linker wrongly marks symbols as PREVAILING_DEF_IRONLY
    
    non_ir_ref_dynamic wasn't being set in the case where we have a
    versioned dynamic symbol definition with a non-versioned matching IR
    symbol.
    
    bfd/
            PR 22220
            * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
            a case where plugin_notice isn't called.
    ld/
            * testsuite/ld-plugin/pr22220.h,
            * testsuite/ld-plugin/pr22220lib.cc,
            * testsuite/ld-plugin/pr22220lib.ver,
            * testsuite/ld-plugin/pr22220main.cc: New test.
            * testsuite/ld-plugin/lto.exp: Run it.
    
    (cherry picked from commit 1a3b5c34fe371f618402f811a981839c9191ff9f)

 bfd/ChangeLog                         |  6 ++++++
 bfd/elflink.c                         | 10 ++++++++++
 ld/ChangeLog                          |  8 ++++++++
 ld/testsuite/ld-plugin/lto.exp        | 12 ++++++++++++
 ld/testsuite/ld-plugin/pr22220.h      |  8 ++++++++
 ld/testsuite/ld-plugin/pr22220lib.cc  |  6 ++++++
 ld/testsuite/ld-plugin/pr22220lib.ver |  1 +
 ld/testsuite/ld-plugin/pr22220main.cc | 12 ++++++++++++
 8 files changed, 63 insertions(+)

commit 8497dd7e7c7aaec14757380d403537c05a9f19c6
Author: Alan Modra <amodra@gmail.com>
Date:   Fri Sep 22 11:04:41 2017 +0930

    [GOLD] Set non-exec stack for ppc64
    
    gcc doesn't emit stack notes for ELFv1, since ELFv1 never needs an
    executable stack.  Note that ELFv1 is usually big-endian and ELFv2
    little-endian, but the ABI is really orthogonal to endiannes.
    
            * powerpc.cc (Target_powerpc<64,*>::powerpc_info): Set
            is_default_stack_executable false.
    
    (cherry picked from commit ec76901011c5af6a565936d4ad87247c51901b58)

 gold/ChangeLog  | 5 +++++
 gold/powerpc.cc | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

commit 7831b8864c82b7329d4a9ef9192ed6c3c8f24980
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Sep 26 14:41:22 2017 -0700

    x86-64: Don't pass output_bfd to info->callbacks->minfo
    
    Don't pass output_bfd to info->callbacks->minfo when dumping local IFUNC
    functions in the map file.
    
            PR ld/22199
            * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
            output_bfd to info->callbacks->minfo.
    
    (cherry picked from commit ac69a0d75bf472a140e5405c8a90420d5f63a998)

 bfd/ChangeLog      | 6 ++++++
 bfd/elf64-x86-64.c | 1 -
 2 files changed, 6 insertions(+), 1 deletion(-)

commit 2d75c0e2226421a50434d22bd0a78695f24f475b
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Sep 22 14:15:40 2017 -0700

    x86: Guard against corrupted PLT
    
    There should be only one entry in PLT for a given symbol.  Set howto to
    NULL after processing a PLT entry to guard against corrupted PLT so that
    the duplicated PLT entries are skipped.
    
            PR binutils/22170
             * elf32-i386.c (elf_i386_get_synthetic_symtab): Guard against
             corrupted PLT.
             * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
    
    (cherry picked from commit 61e3bf5f83f7e505b6bc51ef65426e5b31e6e360)

 bfd/ChangeLog      | 7 +++++++
 bfd/elf32-i386.c   | 4 ++++
 bfd/elf64-x86-64.c | 4 ++++
 3 files changed, 15 insertions(+)

commit 4e61c23cc1a2a8bb45a70159cbcfdc35ba129233
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Sep 22 07:25:16 2017 -0700

    x86: Return -1 if bfd_canonicalize_dynamic_reloc returns 0
    
    Stop if bfd_canonicalize_dynamic_reloc returns 0.
    
            PR binutils/22163
            * elf32-i386.c (elf_i386_get_synthetic_symtab): Also return -1
            if bfd_canonicalize_dynamic_reloc returns 0.
            * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
    
    (cherry picked from commit b69e9267d15a09ce3f3d4599eae2952dfc6df502)

 bfd/ChangeLog      | 7 +++++++
 bfd/elf32-i386.c   | 2 +-
 bfd/elf64-x86-64.c | 2 +-
 3 files changed, 9 insertions(+), 2 deletions(-)

commit 234bb6e27bc64075281fa343c2a840f88aa7ea47
Author: Maciej W. Rozycki <macro@imgtec.com>
Date:   Fri Sep 22 00:54:19 2017 +0100

    readelf: Handle E_MIPS_MACH_5900
    
    Fix commit e407c74b5b60 ("Support for MIPS R5900 (Sony Playstation 2)"),
    <https://sourceware.org/ml/binutils/2012-12/msg00240.html>, and add the
    handling of E_MIPS_MACH_5900, correctly showing `5900' among `Flags:' in
    the output of `-h' rather than `unknown CPU'.
    
            binutils/
            * readelf.c (get_machine_flags) <E_MIPS_MACH_5900>: New case.
    
            gas/
            * testsuite/gas/mips/elf_mach_5900.d: New test.
            * testsuite/gas/mips/mips.exp: Run it.
    
    (cherry picked from commit ef272caa7482bd9031e82a2e6f1b81870fe2129e)

 binutils/ChangeLog                     |  4 ++++
 binutils/readelf.c                     |  1 +
 gas/ChangeLog                          |  5 +++++
 gas/testsuite/gas/mips/elf_mach_5900.d | 22 ++++++++++++++++++++++
 gas/testsuite/gas/mips/mips.exp        |  1 +
 5 files changed, 33 insertions(+)

commit b6db30cc102223919742d6920fcb9980dc3a612d
Author: Nick Clifton <nickc@redhat.com>
Date:   Thu Sep 21 15:17:28 2017 +0100

    Re Revert previous change to bfd/development.sh, setting the development flag back to true.
    
    This flag should only be set in release tarballs, not on branches,
    as branches will continue to receive development updates.

 bfd/ChangeLog      | 4 ++++
 bfd/development.sh | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

commit b214664d330c04ad09a206170fb034f24bff399f
Author: James Clarke <jrtc27@jrtc27.com>
Date:   Thu Aug 3 22:44:21 2017 -0700

    Add --no-relax option.
    
    gold/
            * options.h (General_options): Set a non-NULL second help string
            argument for relax to allow --no-relax.

 gold/ChangeLog | 5 +++++
 gold/options.h | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

commit f06c451338e3df482b596f2b11d058bdb180c729
Author: Nick Clifton <nickc@redhat.com>
Date:   Wed Sep 20 09:45:15 2017 +0100

    Set the development flag to false on the 2.29 branch.
    
            * development.sh (development): Set to false.

 bfd/ChangeLog      | 4 ++++
 bfd/development.sh | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

commit 0d746ea4dd8d65e050e3b54911ed5b0295e5f432
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Sep 20 09:17:56 2017 +0930

    [GOLD] PowerPC function address in non-PIC
    
    ppc32, like many targets, defines the address of a function as the PLT
    call stub code for functions referenced but not defined in a non-PIC
    executable.  ppc32 gold, unlike other targets, inherits the ppc64
    multiple stub capability for dealing with very large binaries where
    one set of stubs can't be reached from all code locations.  This means
    there can be multiple choices of address for a function, which might
    cause function pointer comparison failures.  So for ppc32, make
    non-branch references always use the first stub group.
    
    (PowerPC64 ELFv1 is always PIC so doesn't need to define the address
    of an external function as the PLT stub.  PowerPC64 ELFv2 needs a
    special set of global entry stubs to serve as the address of external
    functions, so it too is not affected by this bug.)
    
            * powerpc.cc (Target_powerpc::Branch_info::make_stub): Put
            stubs for ppc32 non-branch relocs in first stub table.
            (Target_powerpc::Relocate::relocate): Resolve similarly.
    
    (cherry picked from commit 64b5d6d785eb4c337b7c071ab9607186541a8b14)

 gold/ChangeLog  |  6 ++++++
 gold/powerpc.cc | 25 ++++++++++++++++++++-----
 2 files changed, 26 insertions(+), 5 deletions(-)

commit 90427abb2aac0cc4ebcb73397cc3ad574c6fec5d
Author: Andreas K. Hüttel <dilfridge@gentoo.org>
Date:   Wed Oct 11 21:56:53 2017 +0200

    [no patch] Gentoo: Add patch tarball generation script

 scripts/gentoo/0000_all_Gentoo-Git-is-development |  22 +++++
 scripts/gentoo/9999_all_Gentoo-We-make-a-release  |  22 +++++
 scripts/gentoo/README.Gentoo.patches              |  39 ++++++++
 scripts/gentoo/make-tarball.sh                    | 109 ++++++++++++++++++++++
 4 files changed, 192 insertions(+)

commit 662586237b0b00ee881e79b56f6234ff36e8bfe6 (tag: gentoo/binutils-2.29.1-1.0)
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Tue Jul 5 20:24:00 2016 +0545

    Gentoo: opcodes: link against libbfd.la for rpath deps
    
    The reason opcodes doesn't link against libbfd.la is to workaround a
    libtool bug where it uses installed -L paths ahead of DESTDIR paths.
    The downside is that the library itself lacks rpath tags to find the
    right version of libbfd.so.
    
    Since Gentoo has patched the libtool bug for a while, we don't need
    the workaround.  Use the .la file so we get the rpath tags.
    
    URL: https://bugs.gentoo.org/563934

 opcodes/configure    | 2 +-
 opcodes/configure.ac | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

commit 112aff9ad3e2675556370c4281117a6df0a879d9
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Fri Jan 7 00:15:53 2005 -0500

    Gentoo: libiberty: install PIC version of libiberty.a
    
    This will install a PIC version of libiberty.a by overwriting the non-PIC
    version of libiberty.a while compiling.  We do this because there is no
    shared version of libiberty for random apps to link against which means if
    someone wants to use this in a shared library or PIE, they're out of luck.
    It's arguable whether people should be able to use this in a shared lib,
    but usage in PIE should be fine.  You could argue that this penalizes the
    non-PIE users, but the counter point is that people using this library in
    general are fairly low, and we'd rather have things work for all of them.

 libiberty/Makefile.in | 1 +
 1 file changed, 1 insertion(+)

commit 78a174f23798ebd894923c4b41a70a8324527626
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sat Jan 27 15:01:08 2007 -0500

    Gentoo: gold/ld: enable gnu hash by default
    
    Glibc first added .gnu.hash support to glibc-2.5 (released 29 Sep 2006),
    and gold was first released after that.  Let's default the gnu hash style
    to the new "gnu" rather than the classic sysv.
    
    gold/:
    2012-02-03  Mike Frysinger  <vapier@gentoo.org>
    
            * options.h (General_options): Change default to gnu for hash_style.

 gold/options.h              |  2 +-
 ld/emultempl/elf32.em       | 13 +++++++++++++
 ld/testsuite/lib/ld-lib.exp |  2 +-
 3 files changed, 15 insertions(+), 2 deletions(-)

commit 3ed91ee23d7ba05bffe6fb00bdaf5fa089643d77
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Fri Jan 7 00:15:53 2005 -0500

    Gentoo: ld: enable new dtags by default for linux/gnu targets
    
    The "new" dtags options have been around for 14+ years now, so for Linux
    and GNU targets, enable them by default.
    
    2012-01-21  Mike Frysinger  <vapier@gentoo.org>
    
            * emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Set
            link_info.new_dtags to TRUE for linux/gnu targets.
            * NEWS: Mention new dtags default.
    
    2013-01-22  Roland McGrath  <mcgrathr@google.com>
    
            * emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Set
            new_dtags to TRUE for *-*-nacl* targets.

 ld/emultempl/elf32.em | 10 ++++++++++
 1 file changed, 10 insertions(+)

commit f92dbf35c00ab13cee36f6be8ae5ca46454d9000
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Tue Oct 10 22:53:53 2017 +0200

    Gentoo: gold/ld: add support for poisoned system directories
    
    This is based on the old CodeSourcery patch written by Joseph Myers to add
    support to the link for detecting & rejecting bad -L paths when using a
    cross-compiler.  The differences here:
    * The command line flags are always available.
    * We can turn on & off the warning via the command line.
    * The configure option controls the default warning behavior.
    * Add support for gold.
    
    It is not currently upstream, nor has it been submitted at all.  There are
    no plans to do so currently either.
    
    BUG=chromium:488360
    TEST=`cbuildbot chromiumos-sdk` passes  # tests arm/amd64/mipsel/x86
    TEST=`cbuildbot panther_moblab-full whirlwind-release` pass
    TEST=`cbuildbot {x32,arm64}-generic-full` has no new failures
    TEST=x86_64-cros-linux-gnu-ld throws warnings when using -L/lib (gold & bfd)
    
    Reviewed-on: https://chromium-review.googlesource.com/272083

 gold/options.cc | 33 +++++++++++++++++++++++++++++++++
 gold/options.h  |  7 +++++++
 ld/config.in    |  3 +++
 ld/configure    | 14 ++++++++++++++
 ld/configure.ac | 10 ++++++++++
 ld/ld.h         |  7 +++++++
 ld/ld.texinfo   | 18 ++++++++++++++++++
 ld/ldfile.c     | 20 ++++++++++++++++++++
 ld/ldlex.h      |  3 +++
 ld/ldmain.c     |  7 +++++++
 ld/lexsup.c     | 24 ++++++++++++++++++++++++
 11 files changed, 146 insertions(+)

commit cd6411ad57aab78686f67cbbc1ed70ee810ad335
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Mon May 16 22:10:19 2005 -0400

    Gentoo: ld: always warn about textrels in files
    
    textrels are bad for forcing copy-on-write (this affects everyone), and for
    security/runtime code generation, this affects security ppl.  But in either
    case, it doesn't matter who needs textrels, it's the very fact that they're
    needed at all.

 ld/ldmain.c                 | 1 +
 ld/testsuite/lib/ld-lib.exp | 4 ++++
 2 files changed, 5 insertions(+)
