commit f8da57c6440d6cbd59eecfbd1979792619263b96 (HEAD -> gentoo/binutils-2.38, gentoo/gentoo/binutils-2.38)
Author:     Nick Clifton <nickc@redhat.com>
AuthorDate: Wed Mar 16 12:48:55 2022 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Sat Mar 19 00:04:13 2022 +0100

    Updated Serbian (for binutils/) and Russian (for gprof/) translations
    
    (cherry picked from commit 210bf1d622569a71c4b734909297c47a6785004d)

 binutils/ChangeLog |    4 +
 binutils/po/sr.po  | 4228 ++++++++++++++++++++++++++++------------------------
 gprof/ChangeLog    |    4 +
 gprof/po/ru.po     |  273 ++--
 4 files changed, 2451 insertions(+), 2058 deletions(-)

commit 27a707aece276a0dc51787d1514bec0c833f89d2
Author:     Alan Modra <amodra@gmail.com>
AuthorDate: Sun Mar 13 22:54:25 2022 +1030
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Sat Mar 19 00:03:51 2022 +0100

    PR28959, obdump doesn't disassemble mftb instruction
    
    Without a -M cpu option given, powerpc objdump defaults currently to
    -Mpower10 but -Many is also given.  Commit 1ff6a3b8e562 regressed
    -Many disassembly of instructions that are encoded differently
    depending on cpu, such as mftb which has pre- and post-power4
    encodings.
    
            PR 28959
            * ppc-dis.c (lookup_powerpc): Revert 2021-05-28 change.  Instead
            only look at deprecated PPC_OPCODE_RAW bit when -Many.
    
    (cherry picked from commit b508e46bf9c5b2cef5821b399dfc3b8009a81836)
    (cherry picked from commit fcf60fe8482346f543efdc4879a34c6bbd9cfea9)

 opcodes/ppc-dis.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

commit 1289601766533ffd6f115aa15dd8c3ab6cd57499
Author:     Alan Modra <amodra@gmail.com>
AuthorDate: Thu Mar 3 00:04:57 2022 +1030
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Sat Mar 19 00:03:31 2022 +0100

    PowerPC64 DT_RELR relative reloc addresses
    
    Section addresses can change between ppc64_elf_size_stubs and
    ppc64_elf_build_stubs due to .eh_frame editing.  The idea of stashing
    r_offset final addresses calculated in ppc64_elf_size_stubs for use by
    ppc64_elf_build_stubs was never a good idea.  Instead, we need to keep
    section/offset pairs.
    
            * elf64-ppc.c (struct ppc_link_hash_table): Delete relr_addr.
            Add relr section/offset array.
            (append_relr_off): Rewrite.  Update all callers.
            (sort_relr): New function.
            (ppc64_elf_size_stubs): Adjust to suit new relative reloc stash.
            (ppc64_elf_build_stubs): Likewise.
    
    (cherry picked from commit 0aac2413d39d9f6d9e6879a0daa6bd5dea3e0fe3)
    (cherry picked from commit e26ff4b5a90a67fc440052f6101464939347b1f2)
    (cherry picked from commit e4a35c7319628045302d4c597cb27f1b0a08c858)

 bfd/elf64-ppc.c | 125 ++++++++++++++++++++++++++++++++++----------------------
 1 file changed, 76 insertions(+), 49 deletions(-)

commit 0579b48b2172122f09da35d1d98122bd35f8b0d3
Author:     Alan Modra <amodra@gmail.com>
AuthorDate: Wed Feb 9 16:21:02 2022 +1030
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Sat Mar 19 00:03:11 2022 +0100

    Work around gcc-4 warnings in elf64-ppc.c
    
    elf64-ppc.c: In function 'ppc64_elf_size_dynamic_sections':
    elf64-ppc.c:10309:45: error: value computed is not used [-Werror=unused-value]
         ++lgot_ents, ++lgot_masks, isym != NULL && isym++)
    
    It is of course a silly warning, fixed in later versions of gcc.  I
    wrote "isym != NULL && isym++" rather than the simpler "isym++" to
    stop sanitisers complaining about incrementing a NULL pointer.  isym
    is of course unused in any code path where it might start off as
    NULL.  Sometimes you can't win.  So don't try to be clever in reading
    local symbols only when needed.  99 times out of 100 they will be
    cached anyway.
    
            * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Avoid annoying
            warnings by always reading local syms.
            (ppc64_elf_layout_multitoc): Likewise.
    
    (cherry picked from commit c9fecd62838e481d9902a7fba42a6928370c9b10)
    (cherry picked from commit 7183434818ec77ff8d81063c4cd2a5083f89f30a)

 bfd/elf64-ppc.c | 36 ++++++++++++++----------------------
 1 file changed, 14 insertions(+), 22 deletions(-)

commit a9f0b24ce4c9e1ad9030ad4af46beca3fa11a65d
Author:     Alan Modra <amodra@gmail.com>
AuthorDate: Tue Mar 1 21:54:34 2022 +1030
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Sat Mar 19 00:02:27 2022 +0100

    Revert "Check thin archive element file size against archive header"
    
    This reverts commit 48e3e6aec8a4f37d00ea6c0da3ab45e76490e3db.
    
            PR 28929
            * archive.c (_bfd_get_elt_at_filepos): Don't check thin archive
            element file size.
    
    (cherry picked from commit 581c5ba435538c23fe63d6884ff885b7ef333568)
    (cherry picked from commit 2d92604cd30a254d6a8dcba206b8baba10ed51c7)

 bfd/archive.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

commit 543726573501886ed00e07b4398a1e03cfed51f5
Author:     Alan Modra <amodra@gmail.com>
AuthorDate: Mon Feb 21 10:58:57 2022 +1030
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Sat Mar 19 00:01:58 2022 +0100

    binutils 2.38 vs. ppc32 linux kernel
    
    Commit b25f942e18d6 made .machine more strict.  Weaken it again.
    
            * config/tc-ppc.c (ppc_machine): Treat an early .machine specially,
            keeping sticky options to work around gcc bugs.
    
    (cherry picked from commit cebc89b9328eab994f6b0314c263f94e7949a553)
    (cherry picked from commit ed9b2e40ebffec835d63473367da8dd8f80d7d5b)

 gas/config/tc-ppc.c | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

commit fc6d47cee26e4514c79259ffc083117096bcafd4
Author:     Nick Clifton <nickc@redhat.com>
AuthorDate: Thu Feb 17 15:17:48 2022 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Sat Mar 19 00:01:33 2022 +0100

    Updated Serbian translations for the bfd, gold, ld and opcodes directories
    
    (cherry picked from commit 40d32f56f6320bcd11a0d104d54dd667ab3d4d1c)

 bfd/ChangeLog     |    4 +
 bfd/po/sr.po      | 3123 ++++++++++++++++++++++++++------------------------
 gold/ChangeLog    |    4 +
 gold/po/sr.po     |  257 +++--
 ld/ChangeLog      |    4 +
 ld/po/sr.po       | 3266 +++++++++++++++++++++++++++--------------------------
 opcodes/ChangeLog |    4 +
 opcodes/po/sr.po  |  506 +++++----
 8 files changed, 3734 insertions(+), 3434 deletions(-)

commit 97f6b7a725396e0c8f1a84cd57d0523d01c2c483
Author:     H.J. Lu <hjl.tools@gmail.com>
AuthorDate: Fri Feb 11 15:13:19 2022 -0800
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Sat Mar 19 00:01:12 2022 +0100

    ld: Keep indirect symbol from IR if referenced from shared object
    
    Don't change indirect symbol defined in IR to undefined if it is
    referenced from shared object.
    
    bfd/
    
            PR ld/28879
            * elflink.c (_bfd_elf_merge_symbol): Don't change indirect
            symbol defined in IR to undefined if it is referenced from
            shared object.
    
    ld/
    
            PR ld/28879
            * testsuite/ld-plugin/lto.exp: Run PR ld/28879 tests.
            * testsuite/ld-plugin/pr28879a.cc: New file.
            * testsuite/ld-plugin/pr28879b.cc: Likewise.
    
    (cherry picked from commit 20ea3acc727f3be6322dfbd881e506873535231d)
    (cherry picked from commit 6aa1b7df2fc435ba1b744f20db5c6d3013496249)

 bfd/elflink.c                      |  5 ++---
 ld/testsuite/ld-plugin/lto.exp     | 26 ++++++++++++++++++++++++++
 ld/testsuite/ld-plugin/pr28879a.cc |  7 +++++++
 ld/testsuite/ld-plugin/pr28879b.cc |  8 ++++++++
 4 files changed, 43 insertions(+), 3 deletions(-)

commit 08766e042056131db1e9223114cc6a69db15dd7b
Author:     H.J. Lu <hjl.tools@gmail.com>
AuthorDate: Tue Feb 15 15:03:02 2022 -0800
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Sat Mar 19 00:00:46 2022 +0100

    i386: Update I386_NEED_DYNAMIC_RELOC_TYPE_P for DT_TEXTREL
    
    Update I386_NEED_DYNAMIC_RELOC_TYPE_P to allow R_386_TLS_IE for relocation
    in read-only section.
    
    bfd/
    
            PR ld/28894
            * elfxx-x86.h (I386_NEED_DYNAMIC_RELOC_TYPE_P): Allow
            R_386_TLS_IE.
    
    ld/
            PR ld/28894
            * testsuite/ld-i386/i386.exp: Run pr28894.
            * testsuite/ld-i386/pr28894.d: New file.
            * testsuite/ld-i386/pr28894.s: Likewise.
    
    (cherry picked from commit 3319ba7a8d6a42ba071d691789bc184632399331)
    (cherry picked from commit ae1cab7d3f39686d9c7ddadbac297e9ae76ffccf)

 bfd/elfxx-x86.h                | 1 +
 ld/testsuite/ld-i386/i386.exp  | 1 +
 ld/testsuite/ld-i386/pr28894.d | 3 +++
 ld/testsuite/ld-i386/pr28894.s | 7 +++++++
 4 files changed, 12 insertions(+)

commit 3252ceca0cb71176dea18728493c7172b71d1d63
Author:     Alan Modra <amodra@gmail.com>
AuthorDate: Sun Feb 13 09:56:51 2022 +1030
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Sat Mar 19 00:00:20 2022 +0100

    PR28882, build failure with gcc-4.2 due to use of 0b literals
    
            PR 28882
            * elf/loongarch.h: Replace binary literals with hex.
    
    (cherry picked from commit ccbaaa36174c2c3184344ee0e6db648491149a33)
    (cherry picked from commit df9071487a8ff69370e932a1522054a69fa7cbb1)

 include/elf/loongarch.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

commit ccd0f3d3fc1efb1329a7ba6faa9af23304d32c8a
Author:     H.J. Lu <hjl.tools@gmail.com>
AuthorDate: Wed Feb 9 15:51:22 2022 -0800
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Fri Mar 18 23:59:53 2022 +0100

    x86: Disallow invalid relocation against protected symbol
    
    I am checking this into master and will backport it to 2.38 branch.
    
    H.J
    ----
    On x86, GCC 12 supports -mno-direct-extern-access to enable canonical
    reference to protected function and disable copy relocation.  With
    -mno-direct-extern-access, the canonical protected function symbols must
    be accessed via canonical reference and the protected data symbols in
    shared libraries are non-copyable. Under glibc 2.35, non-canonical
    reference to the canonical protected function will get the run-time error:
    
    ./y: internal_f: ./libfoo.so: non-canonical reference to canonical protected function
    
    and copy relocations against the non-copyable protected symbols will get
    the run-time error:
    
    ./x: internal_i: ./libfoo.so: copy relocation against non-copyable protected symbol
    
    Update x86 linker to disallow non-canonical reference to the canonical
    protected function:
    
    ld: plt.o: non-canonical reference to canonical protected function `internal_f' in libfoo.so
    ld: failed to set dynamic section sizes: bad value
    
    and copy relocation against the non-copyable protected symbol:
    
    ld: main.o: copy relocation against non-copyable protected symbol `internal_i' in libfoo.so
    
    at link-time.
    
    bfd/
    
            PR ld/28875
            * elf-properties.c (_bfd_elf_parse_gnu_properties): Don't skip
            shared libraries for GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS.
            * elf32-i386.c (elf_i386_scan_relocs): Disallow non-canonical
            reference to canonical protected function.
            * elf64-x86-64.c (elf_x86_64_scan_relocs): Likewise.
            * elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't allow copy
            relocation against non-copyable protected symbol.
    
    ld/
    
            PR ld/28875
            * testsuite/ld-i386/i386.exp: Check non-canonical reference to
            canonical protected function and check copy relocation against
            non-copyable protected symbol.
            * testsuite/ld-i386/pr21997-1.err: New file.
            * testsuite/ld-i386/pr28875.err: Likewise.
            * testsuite/ld-i386/pr28875a.c: Likewise.
            * testsuite/ld-i386/pr28875b.c: Likewise.
            * testsuite/ld-x86-64/pr21997-1a.err: Updated.
            * testsuite/ld-x86-64/pr21997-1b.err: Likewise.
            * testsuite/ld-x86-64/pr28875-data.err: New file.
            * testsuite/ld-x86-64/pr28875-func.err: Likewise.
            * testsuite/ld-x86-64/x86-64.exp: Check non-canonical reference
            to canonical protected function and check copy relocation against
            non-copyable protected symbol.
    
    (cherry picked from commit ebb191adac4ab45498dec0bfaac62f0a33537ba4)
    (cherry picked from commit caa6172de4b5100c9b45fd03eae714167a6085c1)

 bfd/elf-properties.c                    |  5 +----
 bfd/elf32-i386.c                        | 17 +++++++++++++++++
 bfd/elf64-x86-64.c                      | 17 +++++++++++++++++
 bfd/elfxx-x86.c                         | 18 ++++++++++++++++++
 ld/testsuite/ld-i386/i386.exp           | 33 ++++++++++++++++++++++++---------
 ld/testsuite/ld-i386/pr21997-1.err      |  2 ++
 ld/testsuite/ld-i386/pr28875.err        |  2 ++
 ld/testsuite/ld-i386/pr28875a.c         |  5 +++++
 ld/testsuite/ld-i386/pr28875b.c         |  7 +++++++
 ld/testsuite/ld-x86-64/pr21997-1a.err   |  2 +-
 ld/testsuite/ld-x86-64/pr21997-1b.err   |  2 +-
 ld/testsuite/ld-x86-64/pr28875-data.err |  2 ++
 ld/testsuite/ld-x86-64/pr28875-func.err |  2 ++
 ld/testsuite/ld-x86-64/x86-64.exp       | 27 +++++++++++++++++----------
 14 files changed, 116 insertions(+), 25 deletions(-)

commit 5c2e1de6df5c45ae290e2fd9a5f7a1a83adef895 (tag: gentoo/binutils-2.38-2)
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: Sat Jul 31 01:18:18 2021 +0200
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Thu Feb 10 12:37:04 2022 +0100

    Gentoo: XFAIL 15 broken ld.gold tests
    
    It seems like either the tests or ld.gold in general cannot handle
    compilers built with --enable-default-pie. No fix yet, so let's ignore
    these test failures for the moment. For details see the linked bugs.
    
    Bug: https://bugs.gentoo.org/684046
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22755
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27303

 gold/testsuite/Makefile.am |  6 ++++++
 gold/testsuite/Makefile.in | 16 ++++++++++++----
 2 files changed, 18 insertions(+), 4 deletions(-)

commit 87a79f0a90f1fc873ac4773a246457a6b15e4d54
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: Sat Jul 24 15:20:16 2021 +0200
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Thu Feb 10 12:37:03 2022 +0100

    Gentoo: Give also libctf optionally a gentoo-specific soversion

 libctf/Makefile.am  | 14 +++++++++++++-
 libctf/Makefile.in  |  9 ++++++++-
 libctf/configure    | 35 +++++++++++++++++++++++++++++++++--
 libctf/configure.ac | 10 ++++++++++
 4 files changed, 64 insertions(+), 4 deletions(-)

commit 6361c7d0e0a267b2bab209cfcf5562e8df0d7942
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: Tue Jul 20 21:15:24 2021 +0200
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Thu Feb 10 12:34:37 2022 +0100

    Gentoo: Pass --hash-style=sysv to ld in the testsuite

 binutils/testsuite/lib/binutils-common.exp |  2 +-
 ld/testsuite/lib/ld-lib.exp                | 16 ++++++++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)

commit 3af9888455069fbb1f50d54135d7a3ada02c5ba6
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: Tue Jul 20 21:12:38 2021 +0200
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Thu Feb 10 12:34:34 2022 +0100

    Gentoo: add --with-extra-soversion-suffix= option
    
    --with-extra-soversion-suffix= will allow Gentoo to
    distinct libbfd.so and libopcodes.so to have more precise
    SONAME.
    
    Today --enable-targets=all and --enable-64-bit-bfd change
    libbfd.so ABI:
    --enable-targets=all adds new symbols to the library
    --enable-64-bit-bfd modifies BFD_ARCH_SIZE default and
    changes sizes of integer parameters and fields to most
    APIs.
    
    --with-extra-soversion-suffix= will allow Gentoo to inject
    additional keys into SONAME to indicate ABI change and avoid
    hard to diagnose crashes when user reinstalls libbfd.so
    built with different flags (see https://bugs.gentoo.org/663690).
    
    Bug: https://bugs.gentoo.org/666100
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
    
    Ported to binutils 2.37 Andreas K. Hüttel <dilfridge@gentoo.org>

 bfd/Makefile.am  |  5 +++++
 bfd/Makefile.in  |  4 ++++
 bfd/configure    | 13 +++++++++++++
 bfd/configure.ac |  7 +++++++
 4 files changed, 29 insertions(+)

commit b4cc4742beac5340fa99e9fbfb81b65400e5ea55
Author:     Mike Frysinger <vapier@gentoo.org>
AuthorDate: Fri Jan 7 00:15:53 2005 -0500
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Thu Feb 10 12:34:31 2022 +0100

    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.
    
    (cherry picked from commit 112aff9ad3e2675556370c4281117a6df0a879d9)

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

commit 995148779a269109ee533c02e2a9e71dd8274bda
Author:     Mike Frysinger <vapier@gentoo.org>
AuthorDate: Tue Jul 20 21:08:31 2021 +0200
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Thu Feb 10 12:34:28 2022 +0100

    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
    (cherry picked from commit f92dbf35c00ab13cee36f6be8ae5ca46454d9000)
    
    Ported to binutils 2.37 Andreas K. Hütte <dilfridge@gentoo.org>

 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.texi      | 18 ++++++++++++++++++
 ld/ldfile.c     | 20 ++++++++++++++++++++
 ld/ldlex.h      |  3 +++
 ld/ldmain.c     |  7 +++++++
 ld/lexsup.c     | 24 ++++++++++++++++++++++++
 11 files changed, 146 insertions(+)

commit 9d22fb6c969f9948129eb03153e3589cdc94c2e2
Author:     Nick Clifton <nickc@redhat.com>
AuthorDate: Wed Feb 9 13:35:22 2022 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Thu Feb 10 12:33:38 2022 +0100

    Re-enable development on the 2.38 branch
    
    (cherry picked from commit d9198f9316553eab6093e46372599ce778429185)

 bfd/ChangeLog      | 5 +++++
 bfd/development.sh | 2 +-
 bfd/version.m4     | 2 +-
 src-release.sh     | 2 +-
 4 files changed, 8 insertions(+), 3 deletions(-)

commit ed2c889ad67a7282be44f295626ffe07d94e7495
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: Thu Feb 10 12:31:50 2022 +0100
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: Thu Feb 10 12:31:50 2022 +0100

    Revert "Set git to exaxt same state as 2.38 tarball"
    
    This reverts commit e98beab54f5eb6ee00a1d6559d6d7e7058ecdc90.

 configure.ac   | 2 +-
 src-release.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
