From cfd1dc1714bdcfb4565e06362edc1945045a29e5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C3=ADas=20Fonzo?= Date: Sat, 22 Jan 2022 01:38:13 -0300 Subject: [PATCH] Start mass upgrade MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit A mass upgrade is needed to continue with the current components and the components or software that must be added. This bunch of updates also includes the following relevant changes: - Binutils has been reverted to the version 2.35.2, plus patched. - GCC has been reverted to the release 10 from latest snapshot. After testing binutils 2.36+ and GCC 11+ it gives errors. Errors when there are threads, random errors in the build (bootstrap) and errors for the build of binutils when you want to process libctf as dynamic. I have no plans, after a long burnout to try those versions again, since the current ones (binutils 2.35.2+ and GCC 10+) are working very well in Dragora. Continuing with the changes "gettext-tiny" has been replaced by GNU gettext, which is a bigger and more complex software, but I think necessary to cover a complete NLS (Native Language Support) base. There are also other minor but not less important changes and fixes in some recipes. Signed-off-by: Matías Fonzo --- archive/busybox/busybox-config_stage1 | 81 +- archive/busybox/busybox-config_stage2 | 65 +- .../binutils-2.22.52.0.4-no-config-h-check.patch} | 0 patches/binutils/2.35/binutils-2.25-version.patch | 44 + .../2.35/binutils-2.27-aarch64-ifunc.patch | 11 + .../binutils-2.29-filename-in-error-messages.patch | 145 + .../2.35/binutils-2.29-revert-PLT-elision.patch | 265 + patches/binutils/2.35/binutils-2.35.1-update.patch | 13035 +++++++ .../binutils/2.35/binutils-CVE-2019-1010204.patch | 15 + .../binutils/2.35/binutils-CVE-2020-35448.patch | 53 + .../binutils/2.35/binutils-CVE-2021-20197.patch | 1310 + .../binutils/2.35/binutils-CVE-2021-20284.patch | 58 + patches/binutils/2.35/binutils-CVE-2021-3487.patch | 34 + .../binutils-DWARF-5-line-number-parsing.patch | 24 + patches/binutils/2.35/binutils-LTO-fix.patch | 2148 ++ .../binutils/2.35/binutils-SHF_LINK_ORDER.patch | 223 + .../2.35/binutils-aarch64-condbranch-relocs.patch | 93 + .../binutils-add-sym-cache-to-elf-link-hash.patch | 1981 + .../binutils/2.35/binutils-attach-to-group.patch | 70 + patches/binutils/2.35/binutils-config.patch | 44 + ...inutils-do-not-link-with-static-libstdc++.patch | 83 + .../2.35/binutils-duplicate-sections.patch | 34 + patches/binutils/2.35/binutils-dwarf-5-dir0.patch | 186 + .../2.35/binutils-dwarf-DW_FORM_ref8.patch | 34 + .../binutils/2.35/binutils-dwarf-type-sign-2.patch | 142 + .../binutils/2.35/binutils-dwarf-type-sign.patch | 931 + .../binutils/2.35/binutils-elf-add-objects.patch | 36 + .../{ => 2.35}/binutils-export-demangle.h.patch | 0 .../2.35/binutils-extend-s390-arch14-support.patch | 657 + .../2.35/binutils-fix-testsuite-failures.patch | 330 + ...ils-gas-Use-the-directory-name-in-.file-0.patch | 292 + .../binutils/2.35/binutils-gas-auto-dwarf-5.patch | 47 + .../2.35/binutils-gas-multibyte-warnings.patch | 375 + patches/binutils/2.35/binutils-gcc-10-fixes.patch | 180 + .../2.35/binutils-gold-gnu-properties.patch | 181 + .../binutils-gold-mismatched-section-flags.patch | 19 + .../binutils-gold-warn-unsupported.patch | 0 .../2.35/binutils-ld-DWARF-5-sections.patch | 60 + .../binutils/2.35/binutils-plugin-as-needed.patch | 182 + .../2.35/binutils-ppc-annobin-disassembly.patch | 39 + .../2.35/binutils-ppc64le-note-merge.patch | 42 + .../2.35/binutils-readelf-no-warn-gaps.patch | 19 + .../2.35/binutils-readelf-other-sym-info.patch | 35 + .../binutils-recursive-debuglink-following.patch | 109 + .../binutils/2.35/binutils-s390-arch14-insns.patch | 109 + patches/binutils/2.35/binutils-s390-build.patch | 772 + .../2.35/binutils-special-sections-in-groups.patch | 27 + patches/binutils/2.35/binutils-strip-merge.patch | 19 + .../2.35/binutils-testsuite-failures.patch | 1207 + .../2.35/binutils-unexpected-form-20.patch | 10 + .../{ => 2.35}/binutils-use-long-long.patch | 0 patches/binutils/2.35/binutils-warnings.patch | 158 + patches/binutils/2.35/binutils.unicode.patch | 37455 +++++++++++++++++++ patches/binutils/branch-updates.diff | 2709 +- ...rgets-pass-as-needed-by-default-to-the-li.patch | 55 +- ...-on-nostdlib-nodefaultlibs-and-ffreestand.patch | 16 +- patches/gcc/{11 => 10}/0002-posix_memalign.patch | 6 +- patches/gcc/{11 => 10}/0003-j2.patch | 34 +- patches/gcc/{11 => 10}/0004-static-pie.patch | 16 +- patches/gcc/10/0005-libstdc-futex-time64.patch | 42 + .../0006-m68k-sqrt.patch} | 6 +- patches/gcc/{11 => 10}/extra-musl_libssp.patch | 0 .../gcc/{11 => 10}/extra-relro-in-dragora.patch | 0 patches/gcc/gcc-11-bug80196.patch | 26 - patches/gdbm/gcc-10-ftbfs.patch | 20 - .../gdbm/patch-fix-spelling-error-in-gdbm.3.patch | 22 - ...s-1.patch => glib-2.70.2-skip_warnings-1.patch} | 0 patches/musl/branch-updates.diff | 198 +- patches/readline/readline81-002 | 45 + recipes/00-core.order | 8 +- recipes/boot/sysvinit/recipe | 6 +- recipes/daemons/acpid/recipe | 4 +- recipes/daemons/at/recipe | 9 +- recipes/daemons/sysklogd/recipe | 4 +- recipes/data/alsa-ucm-conf/recipe | 4 +- recipes/data/iana-etc/recipe | 35 +- recipes/data/iso-codes/recipe | 6 +- recipes/db/gdbm/recipe | 14 +- recipes/db/sqlite/recipe | 4 +- recipes/devel/bc/recipe | 4 +- recipes/devel/binutils/recipe | 70 +- recipes/devel/bison/recipe | 4 +- recipes/devel/cmake/recipe | 4 +- recipes/devel/elfutils/recipe | 6 +- recipes/devel/gc/recipe | 10 +- recipes/devel/gcc/recipe | 21 +- recipes/devel/git/recipe | 8 +- recipes/devel/meson/recipe | 4 +- recipes/devel/rpcsvc-proto/recipe | 7 +- recipes/devel/strace/recipe | 4 +- recipes/devel/tcl/recipe | 10 +- recipes/devel/tk/recipe | 9 +- recipes/devel/vala/recipe | 4 +- recipes/devel/valgrind/recipe | 4 +- recipes/docbook/itstool/recipe | 6 +- recipes/gnupg/gnupg2/recipe | 7 +- recipes/gnupg/gpgme/recipe | 8 +- recipes/gnupg/libassuan/recipe | 7 +- recipes/gnupg/libgcrypt/recipe | 7 +- recipes/gnupg/libgpg-error/recipe | 7 +- recipes/gnupg/libksba/recipe | 11 +- recipes/gnupg/{pinentry-nox11 => pinentry}/recipe | 13 +- recipes/libs/alsa-lib/recipe | 4 +- recipes/libs/alsa-plugins/recipe | 4 +- recipes/libs/expat/recipe | 23 +- recipes/libs/{libidn2 => gettext}/recipe | 41 +- recipes/libs/glib2-pass1/recipe | 6 +- recipes/libs/glib2/recipe | 6 +- recipes/libs/icu/recipe | 4 +- recipes/libs/libcap-ng/recipe | 9 +- recipes/libs/libcap/recipe | 4 +- recipes/libs/libdatrie/recipe | 7 +- recipes/libs/libidn2/recipe | 4 +- recipes/libs/libjpeg-turbo/recipe | 4 +- recipes/libs/libpipeline/recipe | 11 +- recipes/libs/libsigsegv/recipe | 4 +- recipes/libs/libtasn1/recipe | 4 +- recipes/libs/libthai/recipe | 7 +- recipes/libs/libunistring/recipe | 9 +- recipes/libs/libuv/recipe | 4 +- recipes/libs/musl/recipe | 4 +- recipes/libs/readline/recipe | 4 +- recipes/perl/perl5/recipe | 4 +- recipes/python/mako/recipe | 6 +- recipes/python/markupsafe/recipe | 8 +- recipes/python/python3/recipe | 14 +- recipes/python/setuptools/recipe | 6 +- recipes/python/six/recipe | 6 +- recipes/tools/alsa-utils/recipe | 4 +- recipes/tools/file/recipe | 6 +- recipes/tools/gettext-tiny/recipe | 101 - recipes/tools/tarlz/recipe | 4 +- sources/Mako-1.1.3.tar.gz.sha256 | 1 - sources/Mako-1.1.6.tar.gz.sha256 | 1 + sources/MarkupSafe-1.1.1.tar.gz.sha256 | 1 - sources/MarkupSafe-2.0.1.tar.gz.sha256 | 1 + sources/Python-3.10.2.tgz.sha256 | 1 + sources/Python-3.9.1.tgz.sha256 | 1 - sources/SOURCELIST.txt | 111 +- sources/acpid-2.0.32.tar.xz.sha256 | 1 - sources/acpid-2.0.33.tar.xz.sha256 | 1 + sources/alsa-lib-1.2.5.1.tar.bz2.sha256 | 1 - sources/alsa-lib-1.2.6.1.tar.bz2.sha256 | 1 + sources/alsa-lib-1.2.6.tar.bz2.sha256 | 0 sources/alsa-plugins-1.2.5.tar.bz2.sha256 | 1 - sources/alsa-plugins-1.2.6.tar.bz2.sha256 | 1 + sources/alsa-ucm-conf-1.2.5.1.tar.bz2.sha256 | 1 - sources/alsa-ucm-conf-1.2.6.3.tar.bz2.sha256 | 1 + sources/alsa-utils-1.2.5.1.tar.bz2.sha256 | 1 - sources/alsa-utils-1.2.6.tar.bz2.sha256 | 1 + sources/at_3.2.1.orig.tar.gz.sha256 | 1 - sources/at_3.2.2.orig.tar.gz.sha256 | 1 + sources/bc-5.0.2.tar.xz.sha256 | 1 - sources/bc-5.2.1.tar.xz.sha256 | 1 + sources/binutils-2.35.2.tar.lz.sha256 | 1 + sources/binutils-2.36.1.tar.lz.sha256 | 1 - sources/bison-3.8.1.tar.lz.sha256 | 1 - sources/bison-3.8.2.tar.lz.sha256 | 1 + sources/busybox-1.33.0.tar.bz2.sha256 | 1 - sources/busybox-1.35.0.tar.bz2.sha256 | 1 + sources/clisp-20210628_de01f0f47.tar.lz.sha256 | 2 +- sources/cmake-20210720_6980b57.tar.lz.sha256 | 1 - sources/cmake-3.21.4.tar.gz.sha256 | 1 - sources/cmake-3.22.1.tar.gz.sha256 | 1 + sources/elfutils-0.185.tar.bz2.sha256 | 1 - sources/elfutils-0.186.tar.bz2.sha256 | 1 + sources/expat-2.2.10.tar.lz.sha256 | 1 - sources/expat-2.4.2.tar.lz.sha256 | 1 + sources/file-5.40.tar.gz.sha256 | 1 - sources/file-5.41.tar.gz.sha256 | 1 + sources/gc-8.0.4.tar.gz.sha256 | 1 - sources/gc-8.0.6.tar.gz.sha256 | 1 + sources/gcc-10-20220114.tar.xz.sha256 | 1 + sources/gcc-11-20220101.tar.xz.sha256 | 1 - sources/gdbm-1.18.1.tar.gz.sha256 | 1 - sources/gdbm-1.22.tar.gz.sha256 | 1 + sources/gettext-0.21.tar.lz.sha256 | 1 + sources/git-2.33.0.tar.gz.sha256 | 1 - sources/git-2.34.1.tar.gz.sha256 | 1 + sources/git-manpages-2.33.0.tar.gz.sha256 | 1 - sources/git-manpages-2.34.1.tar.gz.sha256 | 1 + sources/glib-2.70.1.tar.xz.sha256 | 1 - sources/glib-2.70.2.tar.xz.sha256 | 1 + sources/gnupg-2.2.27.tar.bz2.sha256 | 1 - sources/gnupg-2.2.33.tar.bz2.sha256 | 1 + sources/gpgme-1.15.1.tar.bz2.sha256 | 1 - sources/gpgme-1.16.0.tar.bz2.sha256 | 1 + sources/iana-etc-20211229.tar.gz.sha256 | 1 + sources/icu4c-69_1-src.tgz.sha256 | 1 - sources/icu4c-70_1-src.tgz.sha256 | 1 + sources/iso-codes-4.5.0.tar.xz.sha256 | 1 - sources/iso-codes-4.6.0.tar.xz.sha256 | 1 + sources/itstool-2.0.6.tar.bz2.sha256 | 1 - sources/itstool-2.0.7.tar.bz2.sha256 | 1 + sources/libassuan-2.5.4.tar.bz2.sha256 | 1 - sources/libassuan-2.5.5.tar.bz2.sha256 | 1 + sources/libcap-2.60.tar.gz.sha256 | 1 - sources/libcap-2.62.tar.gz.sha256 | 1 + sources/libgcrypt-1.9.1.tar.bz2.sha256 | 1 - sources/libgcrypt-1.9.4.tar.bz2.sha256 | 1 + sources/libgpg-error-1.41.tar.bz2.sha256 | 1 - sources/libgpg-error-1.43.tar.bz2.sha256 | 1 + sources/libidn2-2.3.1.tar.gz.sha256 | 1 - sources/libidn2-2.3.2.tar.gz.sha256 | 1 + sources/libjpeg-turbo-2.1.1.tar.gz.sha256 | 1 - sources/libjpeg-turbo-2.1.2.tar.gz.sha256 | 1 + sources/libksba-1.5.0.tar.bz2.sha256 | 1 - sources/libksba-1.6.0.tar.bz2.sha256 | 1 + sources/libpipeline-1.5.3.tar.gz.sha256 | 1 - sources/libpipeline-1.5.4.tar.gz.sha256 | 1 + sources/libsigsegv-2.13.tar.gz.sha256 | 1 - sources/libsigsegv-2.14.tar.gz.sha256 | 1 + sources/libtasn1-4.17.0.tar.gz.sha256 | 1 - sources/libtasn1-4.18.0.tar.gz.sha256 | 1 + sources/libthai-0.1.28.tar.xz.sha256 | 1 - sources/libthai-0.1.29.tar.xz.sha256 | 1 + sources/libunistring-0.9.10.tar.gz.sha256 | 1 - sources/libunistring-1.0.tar.gz.sha256 | 1 + sources/libuv-v1.42.0.tar.gz.sha256 | 1 - sources/libuv-v1.43.0.tar.gz.sha256 | 1 + sources/meson-0.59.1.tar.gz.sha256 | 1 - sources/meson-0.61.0.tar.gz.sha256 | 1 + sources/pinentry-1.1.0.tar.bz2.sha256 | 1 - sources/pinentry-1.2.0.tar.bz2.sha256 | 1 + sources/rpcsvc-proto-1.4.2.tar.xz.sha256 | 1 - sources/rpcsvc-proto-1.4.3.tar.xz.sha256 | 1 + sources/setuptools-51.1.2.tar.gz.sha256 | 1 - sources/setuptools-60.5.0.tar.gz.sha256 | 1 + sources/six-1.15.0.tar.gz.sha256 | 1 - sources/six-1.16.0.tar.gz.sha256 | 1 + sources/sqlite-autoconf-3340000.tar.gz.sha256 | 1 - sources/sqlite-autoconf-3370200.tar.gz.sha256 | 1 + sources/strace-5.14.tar.xz.sha256 | 1 - sources/strace-5.16.tar.xz.sha256 | 1 + sources/sysklogd-2.2.1.tar.gz.sha256 | 1 - sources/sysklogd-2.3.0.tar.gz.sha256 | 1 + sources/sysvinit-2.99.tar.xz.sha256 | 1 - sources/sysvinit-3.01.tar.xz.sha256 | 1 + sources/tarlz-0.21.tar.lz.sha256 | 1 - sources/tarlz-0.22.tar.lz.sha256 | 1 + sources/tcl8.6.11-src.tar.gz.sha256 | 1 - sources/tcl8.6.12-src.tar.gz.sha256 | 1 + sources/tk8.6.11.1-src.tar.gz.sha256 | 1 - sources/tk8.6.12-src.tar.gz.sha256 | 1 + sources/vala-0.54.1.tar.xz.sha256 | 1 - sources/vala-0.54.6.tar.xz.sha256 | 1 + sources/valgrind-3.17.0.tar.bz2.sha256 | 1 - sources/valgrind-3.18.1.tar.bz2.sha256 | 1 + stages/0/01-binutils | 49 +- stages/0/03-gcc-static | 15 +- stages/0/04-musl | 2 +- stages/0/05-gcc-final | 15 +- stages/1/02-musl | 2 +- stages/1/05-binutils | 52 +- stages/1/06-gcc | 26 +- stages/1/07-file | 4 +- stages/1/11-perl | 2 +- stages/1/15-tarlz | 4 +- stages/1/18-busybox | 4 +- stages/2/01-busybox | 4 +- 260 files changed, 64389 insertions(+), 3331 deletions(-) rename patches/binutils/{binutils-no-config-h-check.patch => 2.35/binutils-2.22.52.0.4-no-config-h-check.patch} (100%) create mode 100644 patches/binutils/2.35/binutils-2.25-version.patch create mode 100644 patches/binutils/2.35/binutils-2.27-aarch64-ifunc.patch create mode 100644 patches/binutils/2.35/binutils-2.29-filename-in-error-messages.patch create mode 100644 patches/binutils/2.35/binutils-2.29-revert-PLT-elision.patch create mode 100644 patches/binutils/2.35/binutils-2.35.1-update.patch create mode 100644 patches/binutils/2.35/binutils-CVE-2019-1010204.patch create mode 100644 patches/binutils/2.35/binutils-CVE-2020-35448.patch create mode 100644 patches/binutils/2.35/binutils-CVE-2021-20197.patch create mode 100644 patches/binutils/2.35/binutils-CVE-2021-20284.patch create mode 100644 patches/binutils/2.35/binutils-CVE-2021-3487.patch create mode 100644 patches/binutils/2.35/binutils-DWARF-5-line-number-parsing.patch create mode 100644 patches/binutils/2.35/binutils-LTO-fix.patch create mode 100644 patches/binutils/2.35/binutils-SHF_LINK_ORDER.patch create mode 100644 patches/binutils/2.35/binutils-aarch64-condbranch-relocs.patch create mode 100644 patches/binutils/2.35/binutils-add-sym-cache-to-elf-link-hash.patch create mode 100644 patches/binutils/2.35/binutils-attach-to-group.patch create mode 100644 patches/binutils/2.35/binutils-config.patch create mode 100644 patches/binutils/2.35/binutils-do-not-link-with-static-libstdc++.patch create mode 100644 patches/binutils/2.35/binutils-duplicate-sections.patch create mode 100644 patches/binutils/2.35/binutils-dwarf-5-dir0.patch create mode 100644 patches/binutils/2.35/binutils-dwarf-DW_FORM_ref8.patch create mode 100644 patches/binutils/2.35/binutils-dwarf-type-sign-2.patch create mode 100644 patches/binutils/2.35/binutils-dwarf-type-sign.patch create mode 100644 patches/binutils/2.35/binutils-elf-add-objects.patch rename patches/binutils/{ => 2.35}/binutils-export-demangle.h.patch (100%) create mode 100644 patches/binutils/2.35/binutils-extend-s390-arch14-support.patch create mode 100644 patches/binutils/2.35/binutils-fix-testsuite-failures.patch create mode 100644 patches/binutils/2.35/binutils-gas-Use-the-directory-name-in-.file-0.patch create mode 100644 patches/binutils/2.35/binutils-gas-auto-dwarf-5.patch create mode 100644 patches/binutils/2.35/binutils-gas-multibyte-warnings.patch create mode 100644 patches/binutils/2.35/binutils-gcc-10-fixes.patch create mode 100644 patches/binutils/2.35/binutils-gold-gnu-properties.patch create mode 100644 patches/binutils/2.35/binutils-gold-mismatched-section-flags.patch rename patches/binutils/{ => 2.35}/binutils-gold-warn-unsupported.patch (100%) create mode 100644 patches/binutils/2.35/binutils-ld-DWARF-5-sections.patch create mode 100644 patches/binutils/2.35/binutils-plugin-as-needed.patch create mode 100644 patches/binutils/2.35/binutils-ppc-annobin-disassembly.patch create mode 100644 patches/binutils/2.35/binutils-ppc64le-note-merge.patch create mode 100644 patches/binutils/2.35/binutils-readelf-no-warn-gaps.patch create mode 100644 patches/binutils/2.35/binutils-readelf-other-sym-info.patch create mode 100644 patches/binutils/2.35/binutils-recursive-debuglink-following.patch create mode 100644 patches/binutils/2.35/binutils-s390-arch14-insns.patch create mode 100644 patches/binutils/2.35/binutils-s390-build.patch create mode 100644 patches/binutils/2.35/binutils-special-sections-in-groups.patch create mode 100644 patches/binutils/2.35/binutils-strip-merge.patch create mode 100644 patches/binutils/2.35/binutils-testsuite-failures.patch create mode 100644 patches/binutils/2.35/binutils-unexpected-form-20.patch rename patches/binutils/{ => 2.35}/binutils-use-long-long.patch (100%) create mode 100644 patches/binutils/2.35/binutils-warnings.patch create mode 100644 patches/binutils/2.35/binutils.unicode.patch rewrite patches/binutils/branch-updates.diff (98%) rename patches/gcc/{11 => 10}/0002-posix_memalign.patch (90%) rename patches/gcc/{11 => 10}/0003-j2.patch (94%) rename patches/gcc/{11 => 10}/0004-static-pie.patch (90%) create mode 100644 patches/gcc/10/0005-libstdc-futex-time64.patch rename patches/gcc/{11/0005-m68k-sqrt.patch => 10/0006-m68k-sqrt.patch} (86%) rename patches/gcc/{11 => 10}/extra-musl_libssp.patch (100%) rename patches/gcc/{11 => 10}/extra-relro-in-dragora.patch (100%) delete mode 100644 patches/gcc/gcc-11-bug80196.patch delete mode 100644 patches/gdbm/gcc-10-ftbfs.patch delete mode 100644 patches/gdbm/patch-fix-spelling-error-in-gdbm.3.patch rename patches/glib2/{glib-2.70.0-skip_warnings-1.patch => glib-2.70.2-skip_warnings-1.patch} (100%) create mode 100644 patches/readline/readline81-002 rename recipes/gnupg/{pinentry-nox11 => pinentry}/recipe (88%) copy recipes/libs/{libidn2 => gettext}/recipe (69%) delete mode 100644 recipes/tools/gettext-tiny/recipe delete mode 100644 sources/Mako-1.1.3.tar.gz.sha256 create mode 100644 sources/Mako-1.1.6.tar.gz.sha256 delete mode 100644 sources/MarkupSafe-1.1.1.tar.gz.sha256 create mode 100644 sources/MarkupSafe-2.0.1.tar.gz.sha256 create mode 100644 sources/Python-3.10.2.tgz.sha256 delete mode 100644 sources/Python-3.9.1.tgz.sha256 delete mode 100644 sources/acpid-2.0.32.tar.xz.sha256 create mode 100644 sources/acpid-2.0.33.tar.xz.sha256 delete mode 100644 sources/alsa-lib-1.2.5.1.tar.bz2.sha256 create mode 100644 sources/alsa-lib-1.2.6.1.tar.bz2.sha256 create mode 100644 sources/alsa-lib-1.2.6.tar.bz2.sha256 delete mode 100644 sources/alsa-plugins-1.2.5.tar.bz2.sha256 create mode 100644 sources/alsa-plugins-1.2.6.tar.bz2.sha256 delete mode 100644 sources/alsa-ucm-conf-1.2.5.1.tar.bz2.sha256 create mode 100644 sources/alsa-ucm-conf-1.2.6.3.tar.bz2.sha256 delete mode 100644 sources/alsa-utils-1.2.5.1.tar.bz2.sha256 create mode 100644 sources/alsa-utils-1.2.6.tar.bz2.sha256 delete mode 100644 sources/at_3.2.1.orig.tar.gz.sha256 create mode 100644 sources/at_3.2.2.orig.tar.gz.sha256 delete mode 100644 sources/bc-5.0.2.tar.xz.sha256 create mode 100644 sources/bc-5.2.1.tar.xz.sha256 create mode 100644 sources/binutils-2.35.2.tar.lz.sha256 delete mode 100644 sources/binutils-2.36.1.tar.lz.sha256 delete mode 100644 sources/bison-3.8.1.tar.lz.sha256 create mode 100644 sources/bison-3.8.2.tar.lz.sha256 delete mode 100644 sources/busybox-1.33.0.tar.bz2.sha256 create mode 100644 sources/busybox-1.35.0.tar.bz2.sha256 delete mode 100644 sources/cmake-20210720_6980b57.tar.lz.sha256 delete mode 100644 sources/cmake-3.21.4.tar.gz.sha256 create mode 100644 sources/cmake-3.22.1.tar.gz.sha256 delete mode 100644 sources/elfutils-0.185.tar.bz2.sha256 create mode 100644 sources/elfutils-0.186.tar.bz2.sha256 delete mode 100644 sources/expat-2.2.10.tar.lz.sha256 create mode 100644 sources/expat-2.4.2.tar.lz.sha256 delete mode 100644 sources/file-5.40.tar.gz.sha256 create mode 100644 sources/file-5.41.tar.gz.sha256 delete mode 100644 sources/gc-8.0.4.tar.gz.sha256 create mode 100644 sources/gc-8.0.6.tar.gz.sha256 create mode 100644 sources/gcc-10-20220114.tar.xz.sha256 delete mode 100644 sources/gcc-11-20220101.tar.xz.sha256 delete mode 100644 sources/gdbm-1.18.1.tar.gz.sha256 create mode 100644 sources/gdbm-1.22.tar.gz.sha256 create mode 100644 sources/gettext-0.21.tar.lz.sha256 delete mode 100644 sources/git-2.33.0.tar.gz.sha256 create mode 100644 sources/git-2.34.1.tar.gz.sha256 delete mode 100644 sources/git-manpages-2.33.0.tar.gz.sha256 create mode 100644 sources/git-manpages-2.34.1.tar.gz.sha256 delete mode 100644 sources/glib-2.70.1.tar.xz.sha256 create mode 100644 sources/glib-2.70.2.tar.xz.sha256 delete mode 100644 sources/gnupg-2.2.27.tar.bz2.sha256 create mode 100644 sources/gnupg-2.2.33.tar.bz2.sha256 delete mode 100644 sources/gpgme-1.15.1.tar.bz2.sha256 create mode 100644 sources/gpgme-1.16.0.tar.bz2.sha256 create mode 100644 sources/iana-etc-20211229.tar.gz.sha256 delete mode 100644 sources/icu4c-69_1-src.tgz.sha256 create mode 100644 sources/icu4c-70_1-src.tgz.sha256 delete mode 100644 sources/iso-codes-4.5.0.tar.xz.sha256 create mode 100644 sources/iso-codes-4.6.0.tar.xz.sha256 delete mode 100644 sources/itstool-2.0.6.tar.bz2.sha256 create mode 100644 sources/itstool-2.0.7.tar.bz2.sha256 delete mode 100644 sources/libassuan-2.5.4.tar.bz2.sha256 create mode 100644 sources/libassuan-2.5.5.tar.bz2.sha256 delete mode 100644 sources/libcap-2.60.tar.gz.sha256 create mode 100644 sources/libcap-2.62.tar.gz.sha256 delete mode 100644 sources/libgcrypt-1.9.1.tar.bz2.sha256 create mode 100644 sources/libgcrypt-1.9.4.tar.bz2.sha256 delete mode 100644 sources/libgpg-error-1.41.tar.bz2.sha256 create mode 100644 sources/libgpg-error-1.43.tar.bz2.sha256 delete mode 100644 sources/libidn2-2.3.1.tar.gz.sha256 create mode 100644 sources/libidn2-2.3.2.tar.gz.sha256 delete mode 100644 sources/libjpeg-turbo-2.1.1.tar.gz.sha256 create mode 100644 sources/libjpeg-turbo-2.1.2.tar.gz.sha256 delete mode 100644 sources/libksba-1.5.0.tar.bz2.sha256 create mode 100644 sources/libksba-1.6.0.tar.bz2.sha256 delete mode 100644 sources/libpipeline-1.5.3.tar.gz.sha256 create mode 100644 sources/libpipeline-1.5.4.tar.gz.sha256 delete mode 100644 sources/libsigsegv-2.13.tar.gz.sha256 create mode 100644 sources/libsigsegv-2.14.tar.gz.sha256 delete mode 100644 sources/libtasn1-4.17.0.tar.gz.sha256 create mode 100644 sources/libtasn1-4.18.0.tar.gz.sha256 delete mode 100644 sources/libthai-0.1.28.tar.xz.sha256 create mode 100644 sources/libthai-0.1.29.tar.xz.sha256 delete mode 100644 sources/libunistring-0.9.10.tar.gz.sha256 create mode 100644 sources/libunistring-1.0.tar.gz.sha256 delete mode 100644 sources/libuv-v1.42.0.tar.gz.sha256 create mode 100644 sources/libuv-v1.43.0.tar.gz.sha256 delete mode 100644 sources/meson-0.59.1.tar.gz.sha256 create mode 100644 sources/meson-0.61.0.tar.gz.sha256 delete mode 100644 sources/pinentry-1.1.0.tar.bz2.sha256 create mode 100644 sources/pinentry-1.2.0.tar.bz2.sha256 delete mode 100644 sources/rpcsvc-proto-1.4.2.tar.xz.sha256 create mode 100644 sources/rpcsvc-proto-1.4.3.tar.xz.sha256 delete mode 100644 sources/setuptools-51.1.2.tar.gz.sha256 create mode 100644 sources/setuptools-60.5.0.tar.gz.sha256 delete mode 100644 sources/six-1.15.0.tar.gz.sha256 create mode 100644 sources/six-1.16.0.tar.gz.sha256 delete mode 100644 sources/sqlite-autoconf-3340000.tar.gz.sha256 create mode 100644 sources/sqlite-autoconf-3370200.tar.gz.sha256 delete mode 100644 sources/strace-5.14.tar.xz.sha256 create mode 100644 sources/strace-5.16.tar.xz.sha256 delete mode 100644 sources/sysklogd-2.2.1.tar.gz.sha256 create mode 100644 sources/sysklogd-2.3.0.tar.gz.sha256 delete mode 100644 sources/sysvinit-2.99.tar.xz.sha256 create mode 100644 sources/sysvinit-3.01.tar.xz.sha256 delete mode 100644 sources/tarlz-0.21.tar.lz.sha256 create mode 100644 sources/tarlz-0.22.tar.lz.sha256 delete mode 100644 sources/tcl8.6.11-src.tar.gz.sha256 create mode 100644 sources/tcl8.6.12-src.tar.gz.sha256 delete mode 100644 sources/tk8.6.11.1-src.tar.gz.sha256 create mode 100644 sources/tk8.6.12-src.tar.gz.sha256 delete mode 100644 sources/vala-0.54.1.tar.xz.sha256 create mode 100644 sources/vala-0.54.6.tar.xz.sha256 delete mode 100644 sources/valgrind-3.17.0.tar.bz2.sha256 create mode 100644 sources/valgrind-3.18.1.tar.bz2.sha256 diff --git a/archive/busybox/busybox-config_stage1 b/archive/busybox/busybox-config_stage1 index 2b7e3b97..82c03911 100644 --- a/archive/busybox/busybox-config_stage1 +++ b/archive/busybox/busybox-config_stage1 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Busybox version: 1.33.0 -# Sat Jan 9 08:40:01 2021 +# Busybox version: 1.35.0 +# Wed Jan 12 22:43:18 2022 # CONFIG_HAVE_DOT_CONFIG=y @@ -94,9 +94,12 @@ CONFIG_FEATURE_BUFFERS_USE_MALLOC=y CONFIG_PASSWORD_MINLEN=6 CONFIG_MD5_SMALL=1 CONFIG_SHA3_SMALL=1 -# CONFIG_FEATURE_FAST_TOP is not set -# CONFIG_FEATURE_ETC_NETWORKS is not set -# CONFIG_FEATURE_ETC_SERVICES is not set +# CONFIG_FEATURE_NON_POSIX_CP is not set +CONFIG_FEATURE_VERBOSE_CP_MESSAGE=y +CONFIG_FEATURE_USE_SENDFILE=y +CONFIG_FEATURE_COPYBUF_KB=4 +CONFIG_MONOTONIC_SYSCALL=y +CONFIG_IOCTL_HEX2STR_ERROR=y CONFIG_FEATURE_EDITING=y CONFIG_FEATURE_EDITING_MAX_LEN=1024 # CONFIG_FEATURE_EDITING_VI is not set @@ -120,14 +123,6 @@ CONFIG_LAST_SUPPORTED_WCHAR=0 # CONFIG_UNICODE_BIDI_SUPPORT is not set # CONFIG_UNICODE_NEUTRAL_TABLE is not set # CONFIG_UNICODE_PRESERVE_BROKEN is not set -# CONFIG_FEATURE_NON_POSIX_CP is not set -CONFIG_FEATURE_VERBOSE_CP_MESSAGE=y -CONFIG_FEATURE_USE_SENDFILE=y -CONFIG_FEATURE_COPYBUF_KB=4 -CONFIG_FEATURE_SKIP_ROOTFS=y -CONFIG_MONOTONIC_SYSCALL=y -CONFIG_IOCTL_HEX2STR_ERROR=y -# CONFIG_FEATURE_HWIB is not set # # Applets @@ -162,6 +157,8 @@ CONFIG_FEATURE_BZIP2_DECOMPRESS=y # CONFIG_CPIO is not set # CONFIG_FEATURE_CPIO_O is not set # CONFIG_FEATURE_CPIO_P is not set +# CONFIG_FEATURE_CPIO_IGNORE_DEVNO is not set +# CONFIG_FEATURE_CPIO_RENUMBER_INODES is not set # CONFIG_DPKG is not set # CONFIG_DPKG_DEB is not set CONFIG_GZIP=y @@ -197,6 +194,22 @@ CONFIG_FEATURE_UNZIP_CDF=y # # Coreutils # +CONFIG_FEATURE_VERBOSE=y + +# +# Common options for date and touch +# +# CONFIG_FEATURE_TIMEZONE is not set + +# +# Common options for cp and mv +# +CONFIG_FEATURE_PRESERVE_HARDLINKS=y + +# +# Common options for df, du, ls +# +CONFIG_FEATURE_HUMAN_READABLE=y CONFIG_BASENAME=y CONFIG_CAT=y CONFIG_FEATURE_CATN=y @@ -207,11 +220,13 @@ CONFIG_CHOWN=y CONFIG_FEATURE_CHOWN_LONG_OPTIONS=y # CONFIG_CHROOT is not set CONFIG_CKSUM=y +CONFIG_CRC32=y CONFIG_COMM=y CONFIG_CP=y CONFIG_FEATURE_CP_LONG_OPTIONS=y CONFIG_FEATURE_CP_REFLINK=y CONFIG_CUT=y +CONFIG_FEATURE_CUT_REGEX=y CONFIG_DATE=y CONFIG_FEATURE_DATE_ISOFMT=y CONFIG_FEATURE_DATE_NANO=y @@ -223,6 +238,7 @@ CONFIG_FEATURE_DD_IBS_OBS=y CONFIG_FEATURE_DD_STATUS=y CONFIG_DF=y CONFIG_FEATURE_DF_FANCY=y +CONFIG_FEATURE_SKIP_ROOTFS=y CONFIG_DIRNAME=y # CONFIG_DOS2UNIX is not set # CONFIG_UNIX2DOS is not set @@ -316,7 +332,6 @@ CONFIG_TEST2=y CONFIG_FEATURE_TEST_64=y # CONFIG_TIMEOUT is not set CONFIG_TOUCH=y -CONFIG_FEATURE_TOUCH_NODEREF=y CONFIG_FEATURE_TOUCH_SUSV3=y CONFIG_TR=y CONFIG_FEATURE_TR_CLASSES=y @@ -343,21 +358,6 @@ CONFIG_WHOAMI=y CONFIG_YES=y # -# Common options -# -CONFIG_FEATURE_VERBOSE=y - -# -# Common options for cp and mv -# -CONFIG_FEATURE_PRESERVE_HARDLINKS=y - -# -# Common options for df, du, ls -# -CONFIG_FEATURE_HUMAN_READABLE=y - -# # Console Utilities # # CONFIG_CHVT is not set @@ -420,6 +420,7 @@ CONFIG_SED=y CONFIG_FEATURE_VI_MAX_LEN=0 # CONFIG_FEATURE_VI_8BIT is not set # CONFIG_FEATURE_VI_COLON is not set +# CONFIG_FEATURE_VI_COLON_EXPAND is not set # CONFIG_FEATURE_VI_YANKMARK is not set # CONFIG_FEATURE_VI_SEARCH is not set # CONFIG_FEATURE_VI_REGEX_SEARCH is not set @@ -433,6 +434,7 @@ CONFIG_FEATURE_VI_MAX_LEN=0 # CONFIG_FEATURE_VI_UNDO is not set # CONFIG_FEATURE_VI_UNDO_QUEUE is not set CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=0 +# CONFIG_FEATURE_VI_VERBOSE_STATUS is not set CONFIG_FEATURE_ALLOW_EXEC=y # @@ -441,7 +443,11 @@ CONFIG_FEATURE_ALLOW_EXEC=y CONFIG_FIND=y CONFIG_FEATURE_FIND_PRINT0=y CONFIG_FEATURE_FIND_MTIME=y +CONFIG_FEATURE_FIND_ATIME=y +CONFIG_FEATURE_FIND_CTIME=y CONFIG_FEATURE_FIND_MMIN=y +CONFIG_FEATURE_FIND_AMIN=y +CONFIG_FEATURE_FIND_CMIN=y CONFIG_FEATURE_FIND_PERM=y CONFIG_FEATURE_FIND_TYPE=y CONFIG_FEATURE_FIND_EXECUTABLE=y @@ -449,6 +455,7 @@ CONFIG_FEATURE_FIND_XDEV=y CONFIG_FEATURE_FIND_MAXDEPTH=y CONFIG_FEATURE_FIND_NEWER=y CONFIG_FEATURE_FIND_INUM=y +CONFIG_FEATURE_FIND_SAMEFILE=y CONFIG_FEATURE_FIND_EXEC=y CONFIG_FEATURE_FIND_EXEC_PLUS=y CONFIG_FEATURE_FIND_USER=y @@ -731,6 +738,7 @@ CONFIG_REV=y # Miscellaneous Utilities # # CONFIG_ADJTIMEX is not set +CONFIG_ASCII=y CONFIG_BBCONFIG=y CONFIG_FEATURE_COMPRESS_BBCONFIG=y # CONFIG_BC is not set @@ -826,6 +834,7 @@ CONFIG_TIME=y # CONFIG_UBIRENAME is not set # CONFIG_VOLNAME is not set # CONFIG_WATCHDOG is not set +# CONFIG_FEATURE_WATCHDOG_OPEN_TWICE is not set # # Networking Utilities @@ -834,6 +843,9 @@ CONFIG_TIME=y # CONFIG_FEATURE_UNIX_LOCAL is not set # CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set # CONFIG_VERBOSE_RESOLUTION_ERRORS is not set +# CONFIG_FEATURE_ETC_NETWORKS is not set +# CONFIG_FEATURE_ETC_SERVICES is not set +# CONFIG_FEATURE_HWIB is not set # CONFIG_FEATURE_TLS_SHA1 is not set # CONFIG_ARP is not set # CONFIG_ARPING is not set @@ -852,6 +864,7 @@ CONFIG_TIME=y CONFIG_HOSTNAME=y CONFIG_DNSDOMAINNAME=y # CONFIG_HTTPD is not set +CONFIG_FEATURE_HTTPD_PORT_DEFAULT=0 # CONFIG_FEATURE_HTTPD_RANGES is not set # CONFIG_FEATURE_HTTPD_SETUID is not set # CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set @@ -944,6 +957,7 @@ CONFIG_PING=y # CONFIG_FEATURE_TELNET_WIDTH is not set # CONFIG_TELNETD is not set # CONFIG_FEATURE_TELNETD_STANDALONE is not set +CONFIG_FEATURE_TELNETD_PORT_DEFAULT=0 # CONFIG_FEATURE_TELNETD_INETD_WAIT is not set # CONFIG_TFTP is not set # CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set @@ -964,6 +978,7 @@ CONFIG_PING=y # CONFIG_WGET is not set # CONFIG_FEATURE_WGET_LONG_OPTIONS is not set # CONFIG_FEATURE_WGET_STATUSBAR is not set +# CONFIG_FEATURE_WGET_FTP is not set # CONFIG_FEATURE_WGET_AUTHENTICATION is not set # CONFIG_FEATURE_WGET_TIMEOUT is not set # CONFIG_FEATURE_WGET_HTTPS is not set @@ -985,6 +1000,7 @@ CONFIG_UDHCPC_DEFAULT_SCRIPT="" # CONFIG_FEATURE_UDHCPC6_RFC4704 is not set # CONFIG_FEATURE_UDHCPC6_RFC4833 is not set # CONFIG_FEATURE_UDHCPC6_RFC5970 is not set +CONFIG_UDHCPC_DEFAULT_INTERFACE="" # CONFIG_FEATURE_UDHCP_PORT is not set CONFIG_UDHCP_DEBUG=0 CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=0 @@ -1002,17 +1018,19 @@ CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="" # # Mail Utilities # +CONFIG_FEATURE_MIME_CHARSET="" # CONFIG_MAKEMIME is not set # CONFIG_POPMAILDIR is not set # CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set # CONFIG_REFORMIME is not set # CONFIG_FEATURE_REFORMIME_COMPAT is not set # CONFIG_SENDMAIL is not set -CONFIG_FEATURE_MIME_CHARSET="" # # Process Utilities # +# CONFIG_FEATURE_FAST_TOP is not set +# CONFIG_FEATURE_SHOW_THREADS is not set CONFIG_FREE=y # CONFIG_FUSER is not set # CONFIG_IOSTAT is not set @@ -1051,7 +1069,6 @@ CONFIG_FEATURE_PS_LONG=y # CONFIG_UPTIME is not set # CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set # CONFIG_WATCH is not set -# CONFIG_FEATURE_SHOW_THREADS is not set # # Runit Utilities @@ -1116,8 +1133,8 @@ CONFIG_ASH_CMDCMD=y # CONFIG_SHELL_HUSH is not set # CONFIG_HUSH_BASH_COMPAT is not set # CONFIG_HUSH_BRACE_EXPANSION is not set -# CONFIG_HUSH_LINENO_VAR is not set # CONFIG_HUSH_BASH_SOURCE_CURDIR is not set +# CONFIG_HUSH_LINENO_VAR is not set # CONFIG_HUSH_INTERACTIVE is not set # CONFIG_HUSH_SAVEHISTORY is not set # CONFIG_HUSH_JOB is not set diff --git a/archive/busybox/busybox-config_stage2 b/archive/busybox/busybox-config_stage2 index f5f8d207..8a72307e 100644 --- a/archive/busybox/busybox-config_stage2 +++ b/archive/busybox/busybox-config_stage2 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Busybox version: 1.33.0 -# Sat Jan 9 08:42:14 2021 +# Busybox version: 1.35.0 +# Wed Jan 12 22:45:33 2022 # CONFIG_HAVE_DOT_CONFIG=y @@ -94,9 +94,12 @@ CONFIG_FEATURE_BUFFERS_USE_MALLOC=y CONFIG_PASSWORD_MINLEN=6 CONFIG_MD5_SMALL=1 CONFIG_SHA3_SMALL=1 -# CONFIG_FEATURE_FAST_TOP is not set -# CONFIG_FEATURE_ETC_NETWORKS is not set -# CONFIG_FEATURE_ETC_SERVICES is not set +# CONFIG_FEATURE_NON_POSIX_CP is not set +# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set +# CONFIG_FEATURE_USE_SENDFILE is not set +CONFIG_FEATURE_COPYBUF_KB=4 +# CONFIG_MONOTONIC_SYSCALL is not set +# CONFIG_IOCTL_HEX2STR_ERROR is not set # CONFIG_FEATURE_EDITING is not set CONFIG_FEATURE_EDITING_MAX_LEN=0 # CONFIG_FEATURE_EDITING_VI is not set @@ -120,14 +123,6 @@ CONFIG_LAST_SUPPORTED_WCHAR=0 # CONFIG_UNICODE_BIDI_SUPPORT is not set # CONFIG_UNICODE_NEUTRAL_TABLE is not set # CONFIG_UNICODE_PRESERVE_BROKEN is not set -# CONFIG_FEATURE_NON_POSIX_CP is not set -# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set -# CONFIG_FEATURE_USE_SENDFILE is not set -CONFIG_FEATURE_COPYBUF_KB=4 -# CONFIG_FEATURE_SKIP_ROOTFS is not set -# CONFIG_MONOTONIC_SYSCALL is not set -# CONFIG_IOCTL_HEX2STR_ERROR is not set -# CONFIG_FEATURE_HWIB is not set # # Applets @@ -162,6 +157,8 @@ CONFIG_BZIP2_SMALL=0 # CONFIG_CPIO is not set # CONFIG_FEATURE_CPIO_O is not set # CONFIG_FEATURE_CPIO_P is not set +# CONFIG_FEATURE_CPIO_IGNORE_DEVNO is not set +# CONFIG_FEATURE_CPIO_RENUMBER_INODES is not set # CONFIG_DPKG is not set # CONFIG_DPKG_DEB is not set # CONFIG_GZIP is not set @@ -197,6 +194,14 @@ CONFIG_GZIP_FAST=0 # # Coreutils # +# CONFIG_FEATURE_VERBOSE is not set + +# +# Common options for date and touch +# +# CONFIG_FEATURE_TIMEZONE is not set +# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set +# CONFIG_FEATURE_HUMAN_READABLE is not set # CONFIG_BASENAME is not set # CONFIG_CAT is not set # CONFIG_FEATURE_CATN is not set @@ -207,11 +212,13 @@ CONFIG_GZIP_FAST=0 # CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set # CONFIG_CHROOT is not set # CONFIG_CKSUM is not set +# CONFIG_CRC32 is not set # CONFIG_COMM is not set # CONFIG_CP is not set # CONFIG_FEATURE_CP_LONG_OPTIONS is not set # CONFIG_FEATURE_CP_REFLINK is not set # CONFIG_CUT is not set +# CONFIG_FEATURE_CUT_REGEX is not set # CONFIG_DATE is not set # CONFIG_FEATURE_DATE_ISOFMT is not set # CONFIG_FEATURE_DATE_NANO is not set @@ -223,6 +230,7 @@ CONFIG_GZIP_FAST=0 # CONFIG_FEATURE_DD_STATUS is not set # CONFIG_DF is not set # CONFIG_FEATURE_DF_FANCY is not set +# CONFIG_FEATURE_SKIP_ROOTFS is not set # CONFIG_DIRNAME is not set # CONFIG_DOS2UNIX is not set # CONFIG_UNIX2DOS is not set @@ -312,7 +320,6 @@ CONFIG_SLEEP=y # CONFIG_FEATURE_TEST_64 is not set # CONFIG_TIMEOUT is not set # CONFIG_TOUCH is not set -# CONFIG_FEATURE_TOUCH_NODEREF is not set # CONFIG_FEATURE_TOUCH_SUSV3 is not set # CONFIG_TR is not set # CONFIG_FEATURE_TR_CLASSES is not set @@ -339,13 +346,6 @@ CONFIG_BASE32=y # CONFIG_YES is not set # -# Common options -# -# CONFIG_FEATURE_VERBOSE is not set -# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set -# CONFIG_FEATURE_HUMAN_READABLE is not set - -# # Console Utilities # # CONFIG_CHVT is not set @@ -408,6 +408,7 @@ CONFIG_DEFAULT_SETFONT_DIR="" CONFIG_FEATURE_VI_MAX_LEN=0 # CONFIG_FEATURE_VI_8BIT is not set # CONFIG_FEATURE_VI_COLON is not set +# CONFIG_FEATURE_VI_COLON_EXPAND is not set # CONFIG_FEATURE_VI_YANKMARK is not set # CONFIG_FEATURE_VI_SEARCH is not set # CONFIG_FEATURE_VI_REGEX_SEARCH is not set @@ -421,6 +422,7 @@ CONFIG_FEATURE_VI_MAX_LEN=0 # CONFIG_FEATURE_VI_UNDO is not set # CONFIG_FEATURE_VI_UNDO_QUEUE is not set CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=0 +# CONFIG_FEATURE_VI_VERBOSE_STATUS is not set # CONFIG_FEATURE_ALLOW_EXEC is not set # @@ -429,7 +431,11 @@ CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=0 # CONFIG_FIND is not set # CONFIG_FEATURE_FIND_PRINT0 is not set # CONFIG_FEATURE_FIND_MTIME is not set +# CONFIG_FEATURE_FIND_ATIME is not set +# CONFIG_FEATURE_FIND_CTIME is not set # CONFIG_FEATURE_FIND_MMIN is not set +# CONFIG_FEATURE_FIND_AMIN is not set +# CONFIG_FEATURE_FIND_CMIN is not set # CONFIG_FEATURE_FIND_PERM is not set # CONFIG_FEATURE_FIND_TYPE is not set # CONFIG_FEATURE_FIND_EXECUTABLE is not set @@ -437,6 +443,7 @@ CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=0 # CONFIG_FEATURE_FIND_MAXDEPTH is not set # CONFIG_FEATURE_FIND_NEWER is not set # CONFIG_FEATURE_FIND_INUM is not set +# CONFIG_FEATURE_FIND_SAMEFILE is not set # CONFIG_FEATURE_FIND_EXEC is not set # CONFIG_FEATURE_FIND_EXEC_PLUS is not set # CONFIG_FEATURE_FIND_USER is not set @@ -727,6 +734,7 @@ CONFIG_FEATURE_VOLUMEID_ISO9660=y # Miscellaneous Utilities # # CONFIG_ADJTIMEX is not set +# CONFIG_ASCII is not set # CONFIG_BBCONFIG is not set # CONFIG_FEATURE_COMPRESS_BBCONFIG is not set # CONFIG_BC is not set @@ -822,6 +830,7 @@ CONFIG_FEATURE_LESS_MAXLINES=0 # CONFIG_UBIRENAME is not set # CONFIG_VOLNAME is not set # CONFIG_WATCHDOG is not set +# CONFIG_FEATURE_WATCHDOG_OPEN_TWICE is not set # # Networking Utilities @@ -830,6 +839,9 @@ CONFIG_FEATURE_LESS_MAXLINES=0 # CONFIG_FEATURE_UNIX_LOCAL is not set # CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set # CONFIG_VERBOSE_RESOLUTION_ERRORS is not set +# CONFIG_FEATURE_ETC_NETWORKS is not set +# CONFIG_FEATURE_ETC_SERVICES is not set +# CONFIG_FEATURE_HWIB is not set # CONFIG_FEATURE_TLS_SHA1 is not set # CONFIG_ARP is not set # CONFIG_ARPING is not set @@ -848,6 +860,7 @@ CONFIG_FEATURE_LESS_MAXLINES=0 # CONFIG_HOSTNAME is not set # CONFIG_DNSDOMAINNAME is not set # CONFIG_HTTPD is not set +CONFIG_FEATURE_HTTPD_PORT_DEFAULT=0 # CONFIG_FEATURE_HTTPD_RANGES is not set # CONFIG_FEATURE_HTTPD_SETUID is not set # CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set @@ -940,6 +953,7 @@ CONFIG_FEATURE_IP_ROUTE_DIR="" # CONFIG_FEATURE_TELNET_WIDTH is not set # CONFIG_TELNETD is not set # CONFIG_FEATURE_TELNETD_STANDALONE is not set +CONFIG_FEATURE_TELNETD_PORT_DEFAULT=0 # CONFIG_FEATURE_TELNETD_INETD_WAIT is not set # CONFIG_TFTP is not set # CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set @@ -960,6 +974,7 @@ CONFIG_FEATURE_IP_ROUTE_DIR="" # CONFIG_WGET is not set # CONFIG_FEATURE_WGET_LONG_OPTIONS is not set # CONFIG_FEATURE_WGET_STATUSBAR is not set +# CONFIG_FEATURE_WGET_FTP is not set # CONFIG_FEATURE_WGET_AUTHENTICATION is not set # CONFIG_FEATURE_WGET_TIMEOUT is not set # CONFIG_FEATURE_WGET_HTTPS is not set @@ -981,6 +996,7 @@ CONFIG_UDHCPC_DEFAULT_SCRIPT="" # CONFIG_FEATURE_UDHCPC6_RFC4704 is not set # CONFIG_FEATURE_UDHCPC6_RFC4833 is not set # CONFIG_FEATURE_UDHCPC6_RFC5970 is not set +CONFIG_UDHCPC_DEFAULT_INTERFACE="" # CONFIG_FEATURE_UDHCP_PORT is not set CONFIG_UDHCP_DEBUG=0 CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=0 @@ -998,17 +1014,19 @@ CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="" # # Mail Utilities # +CONFIG_FEATURE_MIME_CHARSET="" # CONFIG_MAKEMIME is not set # CONFIG_POPMAILDIR is not set # CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set # CONFIG_REFORMIME is not set # CONFIG_FEATURE_REFORMIME_COMPAT is not set # CONFIG_SENDMAIL is not set -CONFIG_FEATURE_MIME_CHARSET="" # # Process Utilities # +# CONFIG_FEATURE_FAST_TOP is not set +# CONFIG_FEATURE_SHOW_THREADS is not set # CONFIG_FREE is not set # CONFIG_FUSER is not set # CONFIG_IOSTAT is not set @@ -1047,7 +1065,6 @@ CONFIG_FEATURE_MIME_CHARSET="" # CONFIG_UPTIME is not set # CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set # CONFIG_WATCH is not set -# CONFIG_FEATURE_SHOW_THREADS is not set # # Runit Utilities @@ -1112,8 +1129,8 @@ CONFIG_HUSH=y CONFIG_SHELL_HUSH=y # CONFIG_HUSH_BASH_COMPAT is not set # CONFIG_HUSH_BRACE_EXPANSION is not set -# CONFIG_HUSH_LINENO_VAR is not set # CONFIG_HUSH_BASH_SOURCE_CURDIR is not set +# CONFIG_HUSH_LINENO_VAR is not set # CONFIG_HUSH_INTERACTIVE is not set # CONFIG_HUSH_SAVEHISTORY is not set # CONFIG_HUSH_JOB is not set diff --git a/patches/binutils/binutils-no-config-h-check.patch b/patches/binutils/2.35/binutils-2.22.52.0.4-no-config-h-check.patch similarity index 100% rename from patches/binutils/binutils-no-config-h-check.patch rename to patches/binutils/2.35/binutils-2.22.52.0.4-no-config-h-check.patch diff --git a/patches/binutils/2.35/binutils-2.25-version.patch b/patches/binutils/2.35/binutils-2.25-version.patch new file mode 100644 index 00000000..d97e81bc --- /dev/null +++ b/patches/binutils/2.35/binutils-2.25-version.patch @@ -0,0 +1,44 @@ +--- binutils-2.26.orig/bfd/Makefile.am 2016-01-25 10:11:33.505289018 +0000 ++++ binutils-2.26/bfd/Makefile.am 2016-01-25 10:13:23.489964145 +0000 +@@ -1043,8 +1043,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD + bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in + @echo "creating $@" + @bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ +- bfd_version_string="\"$(VERSION)\"" ;\ +- bfd_soversion="$(VERSION)" ;\ ++ bfd_version_string="\"$(VERSION)-%{release}\"" ;\ ++ bfd_soversion="$(VERSION)-%{release}" ;\ + bfd_version_package="\"$(PKGVERSION)\"" ;\ + report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ + . $(srcdir)/development.sh ;\ +@@ -1055,7 +1055,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/ + fi ;\ + $(SED) -e "s,@bfd_version@,$$bfd_version," \ + -e "s,@bfd_version_string@,$$bfd_version_string," \ +- -e "s,@bfd_version_package@,$$bfd_version_package," \ ++ -e "s,@bfd_version_package@,\"version \"," \ + -e "s,@report_bugs_to@,$$report_bugs_to," \ + < $(srcdir)/version.h > $@; \ + echo "$${bfd_soversion}" > libtool-soversion +--- binutils-2.26.orig/bfd/Makefile.in 2016-01-25 10:11:33.505289018 +0000 ++++ binutils-2.26/bfd/Makefile.in 2016-01-25 10:14:17.818297941 +0000 +@@ -2111,8 +2111,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) + bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in + @echo "creating $@" + @bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ +- bfd_version_string="\"$(VERSION)\"" ;\ +- bfd_soversion="$(VERSION)" ;\ ++ bfd_version_string="\"$(VERSION)-%{release}\"" ;\ ++ bfd_soversion="$(VERSION)-%{release}" ;\ + bfd_version_package="\"$(PKGVERSION)\"" ;\ + report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ + . $(srcdir)/development.sh ;\ +@@ -2123,7 +2123,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/ + fi ;\ + $(SED) -e "s,@bfd_version@,$$bfd_version," \ + -e "s,@bfd_version_string@,$$bfd_version_string," \ +- -e "s,@bfd_version_package@,$$bfd_version_package," \ ++ -e "s,@bfd_version_package@,\"version \"," \ + -e "s,@report_bugs_to@,$$report_bugs_to," \ + < $(srcdir)/version.h > $@; \ + echo "$${bfd_soversion}" > libtool-soversion diff --git a/patches/binutils/2.35/binutils-2.27-aarch64-ifunc.patch b/patches/binutils/2.35/binutils-2.27-aarch64-ifunc.patch new file mode 100644 index 00000000..562ef18c --- /dev/null +++ b/patches/binutils/2.35/binutils-2.27-aarch64-ifunc.patch @@ -0,0 +1,11 @@ +diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.27/bfd/elfnn-aarch64.c +--- binutils.orig/bfd/elfnn-aarch64.c 2017-02-21 10:45:19.311956006 +0000 ++++ binutils-2.27/bfd/elfnn-aarch64.c 2017-02-21 11:55:07.517922655 +0000 +@@ -4947,6 +4947,7 @@ elfNN_aarch64_final_link_relocate (reloc + it here if it is defined in a non-shared object. */ + if (h != NULL + && h->type == STT_GNU_IFUNC ++ && (input_section->flags & SEC_ALLOC) + && h->def_regular) + { + asection *plt; diff --git a/patches/binutils/2.35/binutils-2.29-filename-in-error-messages.patch b/patches/binutils/2.35/binutils-2.29-filename-in-error-messages.patch new file mode 100644 index 00000000..1aa37377 --- /dev/null +++ b/patches/binutils/2.35/binutils-2.29-filename-in-error-messages.patch @@ -0,0 +1,145 @@ +--- binutils.orig/binutils/readelf.c 2020-07-24 14:55:25.163647522 +0100 ++++ binutils-2.35/binutils/readelf.c 2020-07-24 15:02:39.613851369 +0100 +@@ -20729,79 +20729,92 @@ process_file (char * file_name) + Filedata * filedata = NULL; + struct stat statbuf; + char armag[SARMAG]; +- bfd_boolean ret = TRUE; ++ bfd_boolean ret = FALSE; ++ char * name; ++ char * saved_program_name; ++ ++ /* Overload program_name to include file_name. Doing this means ++ that warning/error messages will positively identify the file ++ concerned even when multiple instances of readelf are running. */ ++ name = xmalloc (strlen (program_name) + strlen (file_name) + 3); ++ sprintf (name, "%s: %s", program_name, file_name); ++ saved_program_name = program_name; ++ program_name = name; + + if (stat (file_name, &statbuf) < 0) + { + if (errno == ENOENT) +- error (_("'%s': No such file\n"), file_name); ++ error (_("No such file\n")); + else +- error (_("Could not locate '%s'. System error message: %s\n"), +- file_name, strerror (errno)); +- return FALSE; ++ error (_("Could not locate file. System error message: %s\n"), ++ strerror (errno)); ++ goto done; + } + + if (! S_ISREG (statbuf.st_mode)) + { +- error (_("'%s' is not an ordinary file\n"), file_name); +- return FALSE; ++ error (_("Not an ordinary file\n")); ++ goto done; + } + + filedata = calloc (1, sizeof * filedata); + if (filedata == NULL) + { + error (_("Out of memory allocating file data structure\n")); +- return FALSE; ++ goto done; + } + + filedata->file_name = file_name; + filedata->handle = fopen (file_name, "rb"); + if (filedata->handle == NULL) + { +- error (_("Input file '%s' is not readable.\n"), file_name); +- free (filedata); +- return FALSE; ++ error (_("Not readable\n")); ++ goto done; + } + + if (fread (armag, SARMAG, 1, filedata->handle) != 1) + { +- error (_("%s: Failed to read file's magic number\n"), file_name); ++ error (_("Failed to read file's magic number\n")); + fclose (filedata->handle); +- free (filedata); +- return FALSE; ++ goto done; + } + + filedata->file_size = (bfd_size_type) statbuf.st_size; + + if (memcmp (armag, ARMAG, SARMAG) == 0) + { +- if (! process_archive (filedata, FALSE)) +- ret = FALSE; ++ if (process_archive (filedata, FALSE)) ++ ret = TRUE; + } + else if (memcmp (armag, ARMAGT, SARMAG) == 0) + { +- if ( ! process_archive (filedata, TRUE)) +- ret = FALSE; ++ if (process_archive (filedata, TRUE)) ++ ret = TRUE; + } + else + { + if (do_archive_index && !check_all) +- error (_("File %s is not an archive so its index cannot be displayed.\n"), +- file_name); ++ error (_("Not an archive so its index cannot be displayed.\n")); + + rewind (filedata->handle); + filedata->archive_file_size = filedata->archive_file_offset = 0; + +- if (! process_object (filedata)) +- ret = FALSE; ++ if (process_object (filedata)) ++ ret = TRUE; + } + +- fclose (filedata->handle); +- free (filedata->section_headers); +- free (filedata->program_headers); +- free (filedata->string_table); +- free (filedata->dump.dump_sects); +- free (filedata); ++ done: ++ if (filedata) ++ { ++ fclose (filedata->handle); ++ free (filedata->section_headers); ++ free (filedata->program_headers); ++ free (filedata->string_table); ++ free (filedata->dump.dump_sects); ++ free (filedata); ++ } ++ free (program_name); ++ program_name = saved_program_name; + + free (ba_cache.strtab); + ba_cache.strtab = NULL; +--- binutils.orig/binutils/readelf.c 2021-01-07 12:59:35.802994842 +0000 ++++ binutils-2.35.1/binutils/readelf.c 2021-01-07 13:02:36.591754005 +0000 +@@ -20818,7 +20818,8 @@ process_file (char * file_name) + done: + if (filedata) + { +- fclose (filedata->handle); ++ if (filedata->handle != NULL) ++ fclose (filedata->handle); + free (filedata->section_headers); + free (filedata->program_headers); + free (filedata->string_table); +--- binutils.orig/binutils/readelf.c 2021-01-08 17:01:23.573093204 +0000 ++++ binutils-2.35.1/binutils/readelf.c 2021-01-08 17:02:23.095677242 +0000 +@@ -20787,7 +20787,6 @@ process_file (char * file_name) + if (fread (armag, SARMAG, 1, filedata->handle) != 1) + { + error (_("Failed to read file's magic number\n")); +- fclose (filedata->handle); + goto done; + } + diff --git a/patches/binutils/2.35/binutils-2.29-revert-PLT-elision.patch b/patches/binutils/2.35/binutils-2.29-revert-PLT-elision.patch new file mode 100644 index 00000000..746a5518 --- /dev/null +++ b/patches/binutils/2.35/binutils-2.29-revert-PLT-elision.patch @@ -0,0 +1,265 @@ +diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d +--- binutils.orig/ld/testsuite/ld-i386/pltgot-1.d 2017-11-15 13:32:39.335065263 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d 2017-11-15 15:03:55.649727195 +0000 +@@ -2,6 +2,7 @@ + #readelf: -S --wide + #as: --32 + ++#pass + #... + +\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.* + #... +diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d +--- binutils.orig/ld/testsuite/ld-i386/pltgot-2.d 2017-11-15 13:32:39.329065335 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d 2017-11-15 15:04:20.803430034 +0000 +@@ -3,7 +3,6 @@ + #readelf: -d --wide + #as: --32 + +-#failif + #... + +0x[0-9a-f]+ +\(PLTREL.* + #... +diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d +--- binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d 2017-11-15 13:32:39.336065251 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d 2017-11-15 15:03:00.413379749 +0000 +@@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse + [0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func + [0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func + [0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func +- ++#... + Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name + #... +diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d +--- binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d 2017-11-15 13:32:39.330065323 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d 2017-11-15 15:03:28.928042882 +0000 +@@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse + [0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func + [0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func + [0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func +- ++#... + Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name + #... +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d +--- binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d 2017-11-15 13:32:39.415064300 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d 2017-11-15 15:08:39.333375801 +0000 +@@ -2,8 +2,4 @@ + #readelf: -S --wide + #as: --64 + +-#... +- +\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.* +-#... +- +\[ *[0-9]+\] \.got\.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+18 +.* + #pass +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d +--- binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d 2017-11-15 13:32:39.404064432 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d 2017-11-15 15:08:59.031143095 +0000 +@@ -3,7 +3,6 @@ + #readelf: -d --wide + #as: --64 + +-#failif + #... + +0x[0-9a-f]+ +\(PLTREL.* + #... +diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-bnd.dd +--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd 2017-11-15 13:32:39.405064420 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-bnd.dd 2017-11-15 15:06:53.694623801 +0000 +@@ -1,7 +1,4 @@ +-#... +-Disassembly of section .plt.got: + +-[a-f0-9]+ <[a-z_]+@plt>: +-[ ]*[a-f0-9]+: f2 ff 25 .. .. 20 00 bnd jmpq \*0x20....\(%rip\) # ...... <.*> ++#... + [ ]*[a-f0-9]+: 90 nop + #pass +diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd +--- binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 13:32:39.407064397 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 15:06:17.244054423 +0000 +@@ -1,4 +1,3 @@ +-#failif + #... + [0-9a-f ]+R_X86_64_JUMP_SLOT +0+ +bar \+ 0 + #... +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d 2017-11-15 13:32:39.412064336 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d 2017-11-15 15:15:09.918750288 +0000 +@@ -20,6 +20,7 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop ++#pass + + 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4 + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d 2017-11-15 13:32:39.413064324 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d 2017-11-15 15:16:08.227055104 +0000 +@@ -20,6 +20,7 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop ++#pass + + 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4 + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d 2017-11-15 13:32:39.413064324 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d 2017-11-15 15:16:20.115913358 +0000 +@@ -20,7 +20,8 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop +- ++#pass ++ + 0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000138..0000000000000144 + DW_CFA_nop + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d 2017-11-15 13:32:39.411064348 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d 2017-11-15 15:16:29.012807282 +0000 +@@ -20,7 +20,8 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop +- ++#pass ++ + 0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000138..0000000000000144 + DW_CFA_nop + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038a.d 2017-11-15 13:32:39.408064384 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a.d 2017-11-15 15:19:48.097433680 +0000 +@@ -19,7 +19,8 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop +- ++#pass ++ + 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4 + DW_CFA_nop + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a-now.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038a-now.d 2017-11-15 13:32:39.401064469 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a-now.d 2017-11-15 15:10:56.077760324 +0000 +@@ -20,7 +20,8 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop +- ++#pass ++ + 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4 + DW_CFA_nop + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038b.d 2017-11-15 13:32:39.405064420 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b.d 2017-11-15 15:10:42.828916844 +0000 +@@ -19,6 +19,7 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop ++#pass + + 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001d8..00000000000001dd + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b-now.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038b-now.d 2017-11-15 13:32:39.416064288 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b-now.d 2017-11-15 15:11:11.550577531 +0000 +@@ -20,7 +20,8 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop +- ++#pass ++ + 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001d8..00000000000001dd + DW_CFA_nop + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038c.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038c.d 2017-11-15 13:32:39.411064348 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c.d 2017-11-15 15:09:52.664509478 +0000 +@@ -19,7 +19,8 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop +- ++#pass ++ + 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000220..0000000000000231 + DW_CFA_nop + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038c-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c-now.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038c-now.d 2017-11-15 13:32:39.413064324 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c-now.d 2017-11-15 15:11:22.975442559 +0000 +@@ -20,7 +20,8 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop +- ++#pass ++ + 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000220..0000000000000231 + DW_CFA_nop + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd +--- binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 13:32:39.417064276 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 15:05:02.950932110 +0000 +@@ -14,6 +14,7 @@ Section Headers: + +\[[ 0-9]+\] .dynsym +.* + +\[[ 0-9]+\] .dynstr +.* + +\[[ 0-9]+\] .rela.dyn +.* ++#pass + +\[[ 0-9]+\] .plt +.* + +\[[ 0-9]+\] .plt.got +.* + +\[[ 0-9]+\] .text +PROGBITS +0+1000 0+1000 0+31a 00 +AX +0 +0 4096 +--- binutils.orig/bfd/elfxx-x86.c 2018-01-22 15:59:25.875788033 +0000 ++++ binutils-2.30.0/bfd/elfxx-x86.c 2018-01-22 16:00:20.789146597 +0000 +@@ -107,7 +107,7 @@ elf_x86_allocate_dynrelocs (struct elf_l + plt_entry_size = htab->plt.plt_entry_size; + + resolved_to_zero = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh); +- ++#if 0 + /* We can't use the GOT PLT if pointer equality is needed since + finish_dynamic_symbol won't clear symbol value and the dynamic + linker won't update the GOT slot. We will get into an infinite +@@ -125,7 +125,7 @@ elf_x86_allocate_dynrelocs (struct elf_l + /* Use the GOT PLT. */ + eh->plt_got.refcount = 1; + } +- ++#endif + /* Since STT_GNU_IFUNC symbol must go through PLT, we handle it + here if it is defined and referenced in a non-shared object. */ + if (h->type == STT_GNU_IFUNC +--- binutils.orig/ld/testsuite/ld-i386/pr20830.d 2018-07-09 09:49:51.277239857 +0100 ++++ binutils-2.30.90/ld/testsuite/ld-i386/pr20830.d 2018-07-09 10:32:41.113356733 +0100 +@@ -19,7 +19,7 @@ Contents of the .eh_frame section: + DW_CFA_offset: r8 \(eip\) at cfa-4 + DW_CFA_nop + DW_CFA_nop +- ++#pass + 0+18 00000010 0000001c FDE cie=00000000 pc=00000128..00000133 + DW_CFA_nop + DW_CFA_nop +--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2020-07-24 14:55:25.370646189 +0100 ++++ binutils-2.35/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2020-07-24 15:06:58.124189348 +0100 +@@ -1,7 +1,3 @@ + #... +-Disassembly of section .plt.got: +- +-[a-f0-9]+ <[_a-z]+@plt>: + [ ]*[a-f0-9]+: f3 0f 1e fa endbr64 +-[ ]*[a-f0-9]+: f2 ff 25 .. .. 20 00 bnd jmpq \*0x20....\(%rip\) # ...... <.*> + #pass diff --git a/patches/binutils/2.35/binutils-2.35.1-update.patch b/patches/binutils/2.35/binutils-2.35.1-update.patch new file mode 100644 index 00000000..bde9fb8f --- /dev/null +++ b/patches/binutils/2.35/binutils-2.35.1-update.patch @@ -0,0 +1,13035 @@ +diff -rup binutils-2.35.1/bfd/dwarf2.c fred/binutils-2.35.1/bfd/dwarf2.c +--- binutils-2.35.1/bfd/dwarf2.c 2020-08-25 15:36:38.000000000 +0100 ++++ fred/binutils-2.35.1/bfd/dwarf2.c 2020-11-25 14:37:33.000000000 +0000 +@@ -3404,7 +3404,8 @@ scan_unit_for_symbols (struct comp_unit + else + { + func = NULL; +- if (abbrev->tag == DW_TAG_variable) ++ if (abbrev->tag == DW_TAG_variable ++ || abbrev->tag == DW_TAG_member) + { + size_t amt = sizeof (struct varinfo); + var = (struct varinfo *) bfd_zalloc (abfd, amt); +@@ -3516,7 +3517,7 @@ scan_unit_for_symbols (struct comp_unit + spec_var = lookup_var_by_offset (attr.u.val, + unit->variable_table); + if (spec_var == NULL) +- { ++ { + _bfd_error_handler (_("DWARF error: could not find " + "variable specification " + "at offset %lx"), +diff -rup binutils-2.35.1/bfd/elf64-ppc.c fred/binutils-2.35.1/bfd/elf64-ppc.c +--- binutils-2.35.1/bfd/elf64-ppc.c 2020-09-11 09:19:09.000000000 +0100 ++++ fred/binutils-2.35.1/bfd/elf64-ppc.c 2020-11-25 14:37:33.000000000 +0000 +@@ -114,7 +114,7 @@ static bfd_vma opd_entry_value + #define elf_backend_adjust_dynamic_symbol ppc64_elf_adjust_dynamic_symbol + #define elf_backend_hide_symbol ppc64_elf_hide_symbol + #define elf_backend_maybe_function_sym ppc64_elf_maybe_function_sym +-#define elf_backend_always_size_sections ppc64_elf_func_desc_adjust ++#define elf_backend_always_size_sections ppc64_elf_edit + #define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections + #define elf_backend_hash_symbol ppc64_elf_hash_symbol + #define elf_backend_init_index_section _bfd_elf_init_2_index_sections +@@ -211,9 +211,10 @@ static bfd_vma opd_entry_value + #define PLD_R12_PC 0x04100000e5800000ULL + #define PNOP 0x0700000000000000ULL + +-/* __glink_PLTresolve stub instructions. We enter with the index in R0. */ ++/* __glink_PLTresolve stub instructions. We enter with the index in ++ R0 for ELFv1, and the address of a glink branch in R12 for ELFv2. */ + #define GLINK_PLTRESOLVE_SIZE(htab) \ +- (8u + (htab->opd_abi ? 11 * 4 : 14 * 4)) ++ (8u + (htab->opd_abi ? 11 * 4 : htab->has_plt_localentry0 ? 14 * 4 : 13 * 4)) + /* 0: */ + /* .quad plt0-1f */ + /* __glink: */ +@@ -229,11 +230,14 @@ static bfd_vma opd_entry_value + /* mtctr %12 */ + /* ld %11,16(%11) */ + /* bctr */ +-#define MFLR_R0 0x7c0802a6 /* mflr %r0 */ +-#define MTLR_R0 0x7c0803a6 /* mtlr %r0 */ +-#define SUB_R12_R12_R11 0x7d8b6050 /* subf %r12,%r11,%r12 */ +-#define ADDI_R0_R12 0x380c0000 /* addi %r0,%r12,0 */ +-#define SRDI_R0_R0_2 0x7800f082 /* rldicl %r0,%r0,62,2 */ ++ ++#define MFLR_R0 0x7c0802a6 /* mflr %r0 */ ++#define MTLR_R0 0x7c0803a6 /* mtlr %r0 */ ++#define SUB_R12_R12_R11 0x7d8b6050 /* subf %r12,%r11,%r12 */ ++#define ADDI_R0_R12 0x380c0000 /* addi %r0,%r12,0 */ ++#define SRDI_R0_R0_2 0x7800f082 /* rldicl %r0,%r0,62,2 */ ++#define LD_R0_0R11 0xe80b0000 /* ld %r0,0(%r11) */ ++#define ADD_R11_R0_R11 0x7d605a14 /* add %r11,%r0,%r11 */ + + /* Pad with this. */ + #define NOP 0x60000000 +@@ -6340,13 +6344,13 @@ static const struct sfpr_def_parms save_ + }; + + /* Called near the start of bfd_elf_size_dynamic_sections. We use +- this hook to a) provide some gcc support functions, and b) transfer +- dynamic linking information gathered so far on function code symbol +- entries, to their corresponding function descriptor symbol entries. */ ++ this hook to a) run the edit functions in this file, b) provide ++ some gcc support functions, and c) transfer dynamic linking ++ information gathered so far on function code symbol entries, to ++ their corresponding function descriptor symbol entries. */ + + static bfd_boolean +-ppc64_elf_func_desc_adjust (bfd *obfd ATTRIBUTE_UNUSED, +- struct bfd_link_info *info) ++ppc64_elf_edit (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) + { + struct ppc_link_hash_table *htab; + +@@ -6354,6 +6358,9 @@ ppc64_elf_func_desc_adjust (bfd *obfd AT + if (htab == NULL) + return FALSE; + ++ /* Call back into the linker, which then runs the edit functions. */ ++ htab->params->edit (); ++ + /* Provide any missing _save* and _rest* functions. */ + if (htab->sfpr != NULL) + { +@@ -7694,9 +7701,11 @@ ppc64_elf_inline_plt (struct bfd_link_in + return TRUE; + } + +-/* Set htab->tls_get_addr and call the generic ELF tls_setup function. */ ++/* Set htab->tls_get_addr and various other info specific to TLS. ++ This needs to run before dynamic symbols are processed in ++ bfd_elf_size_dynamic_sections. */ + +-asection * ++bfd_boolean + ppc64_elf_tls_setup (struct bfd_link_info *info) + { + struct ppc_link_hash_table *htab; +@@ -7704,7 +7713,7 @@ ppc64_elf_tls_setup (struct bfd_link_inf + + htab = ppc_hash_table (info); + if (htab == NULL) +- return NULL; ++ return FALSE; + + if (abiversion (info->output_bfd) == 1) + htab->opd_abi = 1; +@@ -7730,6 +7739,19 @@ ppc64_elf_tls_setup (struct bfd_link_inf + --plt-localentry can cause trouble. */ + if (htab->params->plt_localentry0 < 0) + htab->params->plt_localentry0 = 0; ++ if (htab->params->plt_localentry0 && htab->has_power10_relocs) ++ { ++ /* The issue is that __glink_PLTresolve saves r2, which is done ++ because glibc ld.so _dl_runtime_resolve restores r2 to support ++ a glibc plt call optimisation where global entry code is ++ skipped on calls that resolve to the same binary. The ++ __glink_PLTresolve save of r2 is incompatible with code ++ making tail calls, because the tail call might go via the ++ resolver and thus overwrite the proper saved r2. */ ++ _bfd_error_handler (_("warning: --plt-localentry is incompatible with " ++ "power10 pc-relative code")); ++ htab->params->plt_localentry0 = 0; ++ } + if (htab->params->plt_localentry0 + && elf_link_hash_lookup (&htab->elf, "GLIBC_2.26", + FALSE, FALSE, FALSE) == NULL) +@@ -7826,7 +7848,7 @@ ppc64_elf_tls_setup (struct bfd_link_inf + _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr, + opt_fd->dynstr_index); + if (!bfd_elf_link_record_dynamic_symbol (info, opt_fd)) +- return NULL; ++ return FALSE; + } + if (tga_fd != NULL) + { +@@ -7885,7 +7907,7 @@ ppc64_elf_tls_setup (struct bfd_link_inf + && htab->params->no_tls_get_addr_regsave == -1) + htab->params->no_tls_get_addr_regsave = 0; + +- return _bfd_elf_tls_setup (info->output_bfd, info); ++ return TRUE; + } + + /* Return TRUE iff REL is a branch reloc with a global symbol matching +@@ -10834,62 +10856,60 @@ eh_advance_size (unsigned int delta) + static inline unsigned int + plt_stub_size (struct ppc_link_hash_table *htab, + struct ppc_stub_hash_entry *stub_entry, +- bfd_vma off) ++ bfd_vma off, ++ unsigned int odd) + { + unsigned size; + + if (stub_entry->stub_type >= ppc_stub_plt_call_notoc) + { + if (htab->params->power10_stubs != 0) +- { +- bfd_vma start = (stub_entry->stub_offset +- + stub_entry->group->stub_sec->output_offset +- + stub_entry->group->stub_sec->output_section->vma); +- if (stub_entry->stub_type > ppc_stub_plt_call_notoc) +- start += 4; +- size = 8 + size_power10_offset (off, start & 4); +- } ++ size = 8 + size_power10_offset (off, odd); + else + size = 8 + size_offset (off - 8); + if (stub_entry->stub_type > ppc_stub_plt_call_notoc) + size += 4; +- return size; + } +- +- size = 12; +- if (ALWAYS_EMIT_R2SAVE +- || stub_entry->stub_type == ppc_stub_plt_call_r2save) +- size += 4; +- if (PPC_HA (off) != 0) +- size += 4; +- if (htab->opd_abi) ++ else + { +- size += 4; +- if (htab->params->plt_static_chain) ++ size = 12; ++ if (ALWAYS_EMIT_R2SAVE ++ || stub_entry->stub_type == ppc_stub_plt_call_r2save) + size += 4; +- if (htab->params->plt_thread_safe +- && htab->elf.dynamic_sections_created +- && stub_entry->h != NULL +- && stub_entry->h->elf.dynindx != -1) +- size += 8; +- if (PPC_HA (off + 8 + 8 * htab->params->plt_static_chain) != PPC_HA (off)) ++ if (PPC_HA (off) != 0) + size += 4; ++ if (htab->opd_abi) ++ { ++ size += 4; ++ if (htab->params->plt_static_chain) ++ size += 4; ++ if (htab->params->plt_thread_safe ++ && htab->elf.dynamic_sections_created ++ && stub_entry->h != NULL ++ && stub_entry->h->elf.dynindx != -1) ++ size += 8; ++ if (PPC_HA (off + 8 + 8 * htab->params->plt_static_chain) ++ != PPC_HA (off)) ++ size += 4; ++ } + } + if (stub_entry->h != NULL + && is_tls_get_addr (&stub_entry->h->elf, htab) + && htab->params->tls_get_addr_opt) + { +- if (htab->params->no_tls_get_addr_regsave) ++ if (!htab->params->no_tls_get_addr_regsave) + { +- size += 7 * 4; +- if (stub_entry->stub_type == ppc_stub_plt_call_r2save) +- size += 6 * 4; ++ size += 30 * 4; ++ if (stub_entry->stub_type == ppc_stub_plt_call_r2save ++ || stub_entry->stub_type == ppc_stub_plt_call_both) ++ size += 4; + } + else + { +- size += 30 * 4; +- if (stub_entry->stub_type == ppc_stub_plt_call_r2save) +- size += 4; ++ size += 7 * 4; ++ if (stub_entry->stub_type == ppc_stub_plt_call_r2save ++ || stub_entry->stub_type == ppc_stub_plt_call_both) ++ size += 6 * 4; + } + } + return size; +@@ -10904,7 +10924,8 @@ plt_stub_size (struct ppc_link_hash_tabl + static inline unsigned int + plt_stub_pad (struct ppc_link_hash_table *htab, + struct ppc_stub_hash_entry *stub_entry, +- bfd_vma plt_off) ++ bfd_vma plt_off, ++ unsigned int odd) + { + int stub_align; + unsigned stub_size; +@@ -10919,7 +10940,7 @@ plt_stub_pad (struct ppc_link_hash_table + } + + stub_align = 1 << -htab->params->plt_stub_align; +- stub_size = plt_stub_size (htab, stub_entry, plt_off); ++ stub_size = plt_stub_size (htab, stub_entry, plt_off, odd); + if (((stub_off + stub_size - 1) & -stub_align) - (stub_off & -stub_align) + > ((stub_size - 1) & -stub_align)) + return stub_align - (stub_off & (stub_align - 1)); +@@ -11114,14 +11135,12 @@ build_plt_stub (struct ppc_link_hash_tab + #define MR_R3_R0 0x7c030378 + #define BCTRL 0x4e800421 + +-static inline bfd_byte * +-build_tls_get_addr_stub (struct ppc_link_hash_table *htab, ++static bfd_byte * ++build_tls_get_addr_head (struct ppc_link_hash_table *htab, + struct ppc_stub_hash_entry *stub_entry, +- bfd_byte *p, bfd_vma offset, Elf_Internal_Rela *r) ++ bfd_byte *p) + { + bfd *obfd = htab->params->stub_bfd; +- bfd_byte *loc = p; +- unsigned int i; + + bfd_put_32 (obfd, LD_R0_0R3 + 0, p), p += 4; + bfd_put_32 (obfd, LD_R12_0R3 + 8, p), p += 4; +@@ -11130,21 +11149,43 @@ build_tls_get_addr_stub (struct ppc_link + bfd_put_32 (obfd, ADD_R3_R12_R13, p), p += 4; + bfd_put_32 (obfd, BEQLR, p), p += 4; + bfd_put_32 (obfd, MR_R3_R0, p), p += 4; +- if (htab->params->no_tls_get_addr_regsave) +- { +- if (r != NULL) +- r[0].r_offset += 7 * 4; +- if (stub_entry->stub_type != ppc_stub_plt_call_r2save) +- return build_plt_stub (htab, stub_entry, p, offset, r); + ++ if (!htab->params->no_tls_get_addr_regsave) ++ p = tls_get_addr_prologue (obfd, p, htab); ++ else if (stub_entry->stub_type == ppc_stub_plt_call_r2save ++ || stub_entry->stub_type == ppc_stub_plt_call_both) ++ { + bfd_put_32 (obfd, MFLR_R0, p); + p += 4; + bfd_put_32 (obfd, STD_R0_0R1 + STK_LINKER (htab), p); + p += 4; ++ } ++ return p; ++} + +- if (r != NULL) +- r[0].r_offset += 2 * 4; +- p = build_plt_stub (htab, stub_entry, p, offset, r); ++static bfd_byte * ++build_tls_get_addr_tail (struct ppc_link_hash_table *htab, ++ struct ppc_stub_hash_entry *stub_entry, ++ bfd_byte *p, ++ bfd_byte *loc) ++{ ++ bfd *obfd = htab->params->stub_bfd; ++ ++ if (!htab->params->no_tls_get_addr_regsave) ++ { ++ bfd_put_32 (obfd, BCTRL, p - 4); ++ ++ if (stub_entry->stub_type == ppc_stub_plt_call_r2save ++ || stub_entry->stub_type == ppc_stub_plt_call_both) ++ { ++ bfd_put_32 (obfd, LD_R2_0R1 + STK_TOC (htab), p); ++ p += 4; ++ } ++ p = tls_get_addr_epilogue (obfd, p, htab); ++ } ++ else if (stub_entry->stub_type == ppc_stub_plt_call_r2save ++ || stub_entry->stub_type == ppc_stub_plt_call_both) ++ { + bfd_put_32 (obfd, BCTRL, p - 4); + + bfd_put_32 (obfd, LD_R2_0R1 + STK_TOC (htab), p); +@@ -11156,24 +11197,6 @@ build_tls_get_addr_stub (struct ppc_link + bfd_put_32 (obfd, BLR, p); + p += 4; + } +- else +- { +- p = tls_get_addr_prologue (obfd, p, htab); +- +- if (r != NULL) +- r[0].r_offset += 18 * 4; +- +- p = build_plt_stub (htab, stub_entry, p, offset, r); +- bfd_put_32 (obfd, BCTRL, p - 4); +- +- if (stub_entry->stub_type == ppc_stub_plt_call_r2save) +- { +- bfd_put_32 (obfd, LD_R2_0R1 + STK_TOC (htab), p); +- p += 4; +- } +- +- p = tls_get_addr_epilogue (obfd, p, htab); +- } + + if (htab->glink_eh_frame != NULL + && htab->glink_eh_frame->size != 0) +@@ -11182,21 +11205,11 @@ build_tls_get_addr_stub (struct ppc_link + + base = htab->glink_eh_frame->contents + stub_entry->group->eh_base + 17; + eh = base + stub_entry->group->eh_size; +- if (htab->params->no_tls_get_addr_regsave) +- { +- unsigned int lr_used, delta; +- lr_used = stub_entry->stub_offset + (p - 20 - loc); +- delta = lr_used - stub_entry->group->lr_restore; +- stub_entry->group->lr_restore = lr_used + 16; +- eh = eh_advance (htab->elf.dynobj, eh, delta); +- *eh++ = DW_CFA_offset_extended_sf; +- *eh++ = 65; +- *eh++ = -(STK_LINKER (htab) / 8) & 0x7f; +- *eh++ = DW_CFA_advance_loc + 4; +- } +- else ++ ++ if (!htab->params->no_tls_get_addr_regsave) + { +- unsigned int cfa_updt, delta; ++ unsigned int cfa_updt, delta, i; ++ + /* After the bctrl, lr has been modified so we need to emit + .eh_frame info saying the return address is on the stack. In + fact we must put the EH info at or before the call rather +@@ -11235,10 +11248,27 @@ build_tls_get_addr_stub (struct ppc_link + for (i = 4; i < 12; i++) + *eh++ = DW_CFA_restore + i; + *eh++ = DW_CFA_advance_loc + 2; ++ *eh++ = DW_CFA_restore_extended; ++ *eh++ = 65; ++ stub_entry->group->eh_size = eh - base; ++ } ++ else if (stub_entry->stub_type == ppc_stub_plt_call_r2save ++ || stub_entry->stub_type == ppc_stub_plt_call_both) ++ { ++ unsigned int lr_used, delta; ++ ++ lr_used = stub_entry->stub_offset + (p - 20 - loc); ++ delta = lr_used - stub_entry->group->lr_restore; ++ stub_entry->group->lr_restore = lr_used + 16; ++ eh = eh_advance (htab->elf.dynobj, eh, delta); ++ *eh++ = DW_CFA_offset_extended_sf; ++ *eh++ = 65; ++ *eh++ = -(STK_LINKER (htab) / 8) & 0x7f; ++ *eh++ = DW_CFA_advance_loc + 4; ++ *eh++ = DW_CFA_restore_extended; ++ *eh++ = 65; ++ stub_entry->group->eh_size = eh - base; + } +- *eh++ = DW_CFA_restore_extended; +- *eh++ = 65; +- stub_entry->group->eh_size = eh - base; + } + return p; + } +@@ -11372,6 +11402,7 @@ ppc_build_one_stub (struct bfd_hash_entr + struct ppc_branch_hash_entry *br_entry; + struct bfd_link_info *info; + struct ppc_link_hash_table *htab; ++ bfd *obfd; + bfd_byte *loc; + bfd_byte *p, *relp; + bfd_vma targ, off; +@@ -11379,6 +11410,7 @@ ppc_build_one_stub (struct bfd_hash_entr + asection *plt; + int num_rel; + int odd; ++ bfd_boolean is_tga; + + /* Massage our args to the form they really have. */ + stub_entry = (struct ppc_stub_hash_entry *) gen_entry; +@@ -11428,6 +11460,7 @@ ppc_build_one_stub (struct bfd_hash_entr + off = targ - off; + + p = loc; ++ obfd = htab->params->stub_bfd; + if (stub_entry->stub_type == ppc_stub_long_branch_r2off) + { + bfd_vma r2off = get_r2off (info, stub_entry); +@@ -11437,23 +11470,21 @@ ppc_build_one_stub (struct bfd_hash_entr + htab->stub_error = TRUE; + return FALSE; + } +- bfd_put_32 (htab->params->stub_bfd, STD_R2_0R1 + STK_TOC (htab), p); ++ bfd_put_32 (obfd, STD_R2_0R1 + STK_TOC (htab), p); + p += 4; + if (PPC_HA (r2off) != 0) + { +- bfd_put_32 (htab->params->stub_bfd, +- ADDIS_R2_R2 | PPC_HA (r2off), p); ++ bfd_put_32 (obfd, ADDIS_R2_R2 | PPC_HA (r2off), p); + p += 4; + } + if (PPC_LO (r2off) != 0) + { +- bfd_put_32 (htab->params->stub_bfd, +- ADDI_R2_R2 | PPC_LO (r2off), p); ++ bfd_put_32 (obfd, ADDI_R2_R2 | PPC_LO (r2off), p); + p += 4; + } + off -= p - loc; + } +- bfd_put_32 (htab->params->stub_bfd, B_DOT | (off & 0x3fffffc), p); ++ bfd_put_32 (obfd, B_DOT | (off & 0x3fffffc), p); + p += 4; + + if (off + (1 << 25) >= (bfd_vma) (1 << 26)) +@@ -11579,19 +11610,17 @@ ppc_build_one_stub (struct bfd_hash_entr + } + + p = loc; ++ obfd = htab->params->stub_bfd; + if (stub_entry->stub_type != ppc_stub_plt_branch_r2off) + { + if (PPC_HA (off) != 0) + { +- bfd_put_32 (htab->params->stub_bfd, +- ADDIS_R12_R2 | PPC_HA (off), p); ++ bfd_put_32 (obfd, ADDIS_R12_R2 | PPC_HA (off), p); + p += 4; +- bfd_put_32 (htab->params->stub_bfd, +- LD_R12_0R12 | PPC_LO (off), p); ++ bfd_put_32 (obfd, LD_R12_0R12 | PPC_LO (off), p); + } + else +- bfd_put_32 (htab->params->stub_bfd, +- LD_R12_0R2 | PPC_LO (off), p); ++ bfd_put_32 (obfd, LD_R12_0R2 | PPC_LO (off), p); + } + else + { +@@ -11603,36 +11632,32 @@ ppc_build_one_stub (struct bfd_hash_entr + return FALSE; + } + +- bfd_put_32 (htab->params->stub_bfd, STD_R2_0R1 + STK_TOC (htab), p); ++ bfd_put_32 (obfd, STD_R2_0R1 + STK_TOC (htab), p); + p += 4; + if (PPC_HA (off) != 0) + { +- bfd_put_32 (htab->params->stub_bfd, +- ADDIS_R12_R2 | PPC_HA (off), p); ++ bfd_put_32 (obfd, ADDIS_R12_R2 | PPC_HA (off), p); + p += 4; +- bfd_put_32 (htab->params->stub_bfd, +- LD_R12_0R12 | PPC_LO (off), p); ++ bfd_put_32 (obfd, LD_R12_0R12 | PPC_LO (off), p); + } + else +- bfd_put_32 (htab->params->stub_bfd, LD_R12_0R2 | PPC_LO (off), p); ++ bfd_put_32 (obfd, LD_R12_0R2 | PPC_LO (off), p); + + if (PPC_HA (r2off) != 0) + { + p += 4; +- bfd_put_32 (htab->params->stub_bfd, +- ADDIS_R2_R2 | PPC_HA (r2off), p); ++ bfd_put_32 (obfd, ADDIS_R2_R2 | PPC_HA (r2off), p); + } + if (PPC_LO (r2off) != 0) + { + p += 4; +- bfd_put_32 (htab->params->stub_bfd, +- ADDI_R2_R2 | PPC_LO (r2off), p); ++ bfd_put_32 (obfd, ADDI_R2_R2 | PPC_LO (r2off), p); + } + } + p += 4; +- bfd_put_32 (htab->params->stub_bfd, MTCTR_R12, p); ++ bfd_put_32 (obfd, MTCTR_R12, p); + p += 4; +- bfd_put_32 (htab->params->stub_bfd, BCTR, p); ++ bfd_put_32 (obfd, BCTR, p); + p += 4; + break; + +@@ -11646,12 +11671,23 @@ ppc_build_one_stub (struct bfd_hash_entr + off = (stub_entry->stub_offset + + stub_entry->group->stub_sec->output_offset + + stub_entry->group->stub_sec->output_section->vma); ++ obfd = htab->params->stub_bfd; ++ is_tga = ((stub_entry->stub_type == ppc_stub_plt_call_notoc ++ || stub_entry->stub_type == ppc_stub_plt_call_both) ++ && stub_entry->h != NULL ++ && is_tls_get_addr (&stub_entry->h->elf, htab) ++ && htab->params->tls_get_addr_opt); ++ if (is_tga) ++ { ++ p = build_tls_get_addr_head (htab, stub_entry, p); ++ off += p - loc; ++ } + if (stub_entry->stub_type == ppc_stub_long_branch_both + || stub_entry->stub_type == ppc_stub_plt_branch_both + || stub_entry->stub_type == ppc_stub_plt_call_both) + { + off += 4; +- bfd_put_32 (htab->params->stub_bfd, STD_R2_0R1 + STK_TOC (htab), p); ++ bfd_put_32 (obfd, STD_R2_0R1 + STK_TOC (htab), p); + p += 4; + } + if (stub_entry->stub_type >= ppc_stub_plt_call_notoc) +@@ -11684,17 +11720,39 @@ ppc_build_one_stub (struct bfd_hash_entr + if (htab->params->power10_stubs != 0) + { + bfd_boolean load = stub_entry->stub_type >= ppc_stub_plt_call_notoc; +- p = build_power10_offset (htab->params->stub_bfd, p, off, odd, load); ++ p = build_power10_offset (obfd, p, off, odd, load); + } + else + { ++ if (htab->glink_eh_frame != NULL ++ && htab->glink_eh_frame->size != 0) ++ { ++ bfd_byte *base, *eh; ++ unsigned int lr_used, delta; ++ ++ base = (htab->glink_eh_frame->contents ++ + stub_entry->group->eh_base + 17); ++ eh = base + stub_entry->group->eh_size; ++ lr_used = stub_entry->stub_offset + (p - loc) + 8; ++ delta = lr_used - stub_entry->group->lr_restore; ++ stub_entry->group->lr_restore = lr_used + 8; ++ eh = eh_advance (htab->elf.dynobj, eh, delta); ++ *eh++ = DW_CFA_register; ++ *eh++ = 65; ++ *eh++ = 12; ++ *eh++ = DW_CFA_advance_loc + 2; ++ *eh++ = DW_CFA_restore_extended; ++ *eh++ = 65; ++ stub_entry->group->eh_size = eh - base; ++ } ++ + /* The notoc stubs calculate their target (either a PLT entry or + the global entry point of a function) relative to the PC + returned by the "bcl" two instructions past the start of the + sequence emitted by build_offset. The offset is therefore 8 + less than calculated from the start of the sequence. */ + off -= 8; +- p = build_offset (htab->params->stub_bfd, p, off, ++ p = build_offset (obfd, p, off, + stub_entry->stub_type >= ppc_stub_plt_call_notoc); + } + +@@ -11706,17 +11764,19 @@ ppc_build_one_stub (struct bfd_hash_entr + + stub_entry->group->stub_sec->output_offset + + stub_entry->group->stub_sec->output_section->vma + + (p - loc)); +- bfd_put_32 (htab->params->stub_bfd, +- B_DOT | ((targ - from) & 0x3fffffc), p); ++ bfd_put_32 (obfd, B_DOT | ((targ - from) & 0x3fffffc), p); + } + else + { +- bfd_put_32 (htab->params->stub_bfd, MTCTR_R12, p); ++ bfd_put_32 (obfd, MTCTR_R12, p); + p += 4; +- bfd_put_32 (htab->params->stub_bfd, BCTR, p); ++ bfd_put_32 (obfd, BCTR, p); + } + p += 4; + ++ if (is_tga) ++ p = build_tls_get_addr_tail (htab, stub_entry, p, loc); ++ + if (info->emitrelocations) + { + bfd_vma roff = relp - stub_entry->group->stub_sec->contents; +@@ -11747,33 +11807,6 @@ ppc_build_one_stub (struct bfd_hash_entr + return FALSE; + } + } +- +- if (htab->params->power10_stubs == 0 +- && htab->glink_eh_frame != NULL +- && htab->glink_eh_frame->size != 0) +- { +- bfd_byte *base, *eh; +- unsigned int lr_used, delta; +- +- base = (htab->glink_eh_frame->contents +- + stub_entry->group->eh_base + 17); +- eh = base + stub_entry->group->eh_size; +- lr_used = stub_entry->stub_offset + 8; +- if (stub_entry->stub_type == ppc_stub_long_branch_both +- || stub_entry->stub_type == ppc_stub_plt_branch_both +- || stub_entry->stub_type == ppc_stub_plt_call_both) +- lr_used += 4; +- delta = lr_used - stub_entry->group->lr_restore; +- stub_entry->group->lr_restore = lr_used + 8; +- eh = eh_advance (htab->elf.dynobj, eh, delta); +- *eh++ = DW_CFA_register; +- *eh++ = 65; +- *eh++ = 12; +- *eh++ = DW_CFA_advance_loc + 2; +- *eh++ = DW_CFA_restore_extended; +- *eh++ = 65; +- stub_entry->group->eh_size = eh - base; +- } + break; + + case ppc_stub_plt_call: +@@ -11842,12 +11875,20 @@ ppc_build_one_stub (struct bfd_hash_entr + r[0].r_offset += 2; + r[0].r_addend = targ; + } +- if (stub_entry->h != NULL +- && is_tls_get_addr (&stub_entry->h->elf, htab) +- && htab->params->tls_get_addr_opt) +- p = build_tls_get_addr_stub (htab, stub_entry, loc, off, r); +- else +- p = build_plt_stub (htab, stub_entry, loc, off, r); ++ p = loc; ++ obfd = htab->params->stub_bfd; ++ is_tga = (stub_entry->h != NULL ++ && is_tls_get_addr (&stub_entry->h->elf, htab) ++ && htab->params->tls_get_addr_opt); ++ if (is_tga) ++ { ++ p = build_tls_get_addr_head (htab, stub_entry, p); ++ if (r != NULL) ++ r[0].r_offset += p - loc; ++ } ++ p = build_plt_stub (htab, stub_entry, p, off, r); ++ if (is_tga) ++ p = build_tls_get_addr_tail (htab, stub_entry, p, loc); + break; + + case ppc_stub_save_res: +@@ -12143,11 +12184,19 @@ ppc_size_one_stub (struct bfd_hash_entry + + case ppc_stub_plt_call_notoc: + case ppc_stub_plt_call_both: +- off = (stub_entry->stub_offset +- + stub_entry->group->stub_sec->output_offset +- + stub_entry->group->stub_sec->output_section->vma); ++ lr_used = 0; ++ if (stub_entry->h != NULL ++ && is_tls_get_addr (&stub_entry->h->elf, htab) ++ && htab->params->tls_get_addr_opt) ++ { ++ lr_used += 7 * 4; ++ if (!htab->params->no_tls_get_addr_regsave) ++ lr_used += 11 * 4; ++ else if (stub_entry->stub_type == ppc_stub_plt_call_both) ++ lr_used += 2 * 4; ++ } + if (stub_entry->stub_type == ppc_stub_plt_call_both) +- off += 4; ++ lr_used += 4; + targ = stub_entry->plt_ent->plt.offset & ~1; + if (targ >= (bfd_vma) -2) + abort (); +@@ -12163,16 +12212,21 @@ ppc_size_one_stub (struct bfd_hash_entry + plt = htab->pltlocal; + } + targ += plt->output_offset + plt->output_section->vma; ++ off = (stub_entry->stub_offset ++ + stub_entry->group->stub_sec->output_offset ++ + stub_entry->group->stub_sec->output_section->vma ++ + lr_used); + odd = off & 4; + off = targ - off; + + if (htab->params->plt_stub_align != 0) + { +- unsigned pad = plt_stub_pad (htab, stub_entry, off); ++ unsigned pad = plt_stub_pad (htab, stub_entry, off, odd); + + stub_entry->group->stub_sec->size += pad; + stub_entry->stub_offset = stub_entry->group->stub_sec->size; + off -= pad; ++ odd ^= pad & 4; + } + + if (info->emitrelocations) +@@ -12186,15 +12240,13 @@ ppc_size_one_stub (struct bfd_hash_entry + stub_entry->group->stub_sec->flags |= SEC_RELOC; + } + +- size = plt_stub_size (htab, stub_entry, off); ++ size = plt_stub_size (htab, stub_entry, off, odd); + + if (htab->params->power10_stubs == 0) + { + /* After the bcl, lr has been modified so we need to emit + .eh_frame info saying the return address is in r12. */ +- lr_used = stub_entry->stub_offset + 8; +- if (stub_entry->stub_type == ppc_stub_plt_call_both) +- lr_used += 4; ++ lr_used += stub_entry->stub_offset + 8; + /* The eh_frame info will consist of a DW_CFA_advance_loc or + variant, DW_CFA_register, 65, 12, DW_CFA_advance_loc+2, + DW_CFA_restore_extended 65. */ +@@ -12202,6 +12254,30 @@ ppc_size_one_stub (struct bfd_hash_entry + stub_entry->group->eh_size += eh_advance_size (delta) + 6; + stub_entry->group->lr_restore = lr_used + 8; + } ++ if ((stub_entry->stub_type == ppc_stub_plt_call_notoc ++ || stub_entry->stub_type == ppc_stub_plt_call_both) ++ && stub_entry->h != NULL ++ && is_tls_get_addr (&stub_entry->h->elf, htab) ++ && htab->params->tls_get_addr_opt) ++ { ++ if (!htab->params->no_tls_get_addr_regsave) ++ { ++ unsigned int cfa_updt = stub_entry->stub_offset + 18 * 4; ++ delta = cfa_updt - stub_entry->group->lr_restore; ++ stub_entry->group->eh_size += eh_advance_size (delta); ++ stub_entry->group->eh_size += htab->opd_abi ? 36 : 35; ++ stub_entry->group->lr_restore ++ = stub_entry->stub_offset + size - 4; ++ } ++ else if (stub_entry->stub_type == ppc_stub_plt_call_both) ++ { ++ lr_used = stub_entry->stub_offset + size - 20; ++ delta = lr_used - stub_entry->group->lr_restore; ++ stub_entry->group->eh_size += eh_advance_size (delta) + 6; ++ stub_entry->group->lr_restore ++ = stub_entry->stub_offset + size - 4; ++ } ++ } + break; + + case ppc_stub_plt_call: +@@ -12227,7 +12303,7 @@ ppc_size_one_stub (struct bfd_hash_entry + + if (htab->params->plt_stub_align != 0) + { +- unsigned pad = plt_stub_pad (htab, stub_entry, off); ++ unsigned pad = plt_stub_pad (htab, stub_entry, off, 0); + + stub_entry->group->stub_sec->size += pad; + stub_entry->stub_offset = stub_entry->group->stub_sec->size; +@@ -12244,14 +12320,22 @@ ppc_size_one_stub (struct bfd_hash_entry + stub_entry->group->stub_sec->flags |= SEC_RELOC; + } + +- size = plt_stub_size (htab, stub_entry, off); ++ size = plt_stub_size (htab, stub_entry, off, 0); + + if (stub_entry->h != NULL + && is_tls_get_addr (&stub_entry->h->elf, htab) + && htab->params->tls_get_addr_opt + && stub_entry->stub_type == ppc_stub_plt_call_r2save) + { +- if (htab->params->no_tls_get_addr_regsave) ++ if (!htab->params->no_tls_get_addr_regsave) ++ { ++ /* Adjustments to r1 need to be described. */ ++ unsigned int cfa_updt = stub_entry->stub_offset + 18 * 4; ++ delta = cfa_updt - stub_entry->group->lr_restore; ++ stub_entry->group->eh_size += eh_advance_size (delta); ++ stub_entry->group->eh_size += htab->opd_abi ? 36 : 35; ++ } ++ else + { + lr_used = stub_entry->stub_offset + size - 20; + /* The eh_frame info will consist of a DW_CFA_advance_loc +@@ -12260,15 +12344,7 @@ ppc_size_one_stub (struct bfd_hash_entry + delta = lr_used - stub_entry->group->lr_restore; + stub_entry->group->eh_size += eh_advance_size (delta) + 6; + } +- else +- { +- /* Adjustments to r1 need to be described. */ +- unsigned int cfa_updt = stub_entry->stub_offset + 18 * 4; +- delta = cfa_updt - stub_entry->group->lr_restore; +- stub_entry->group->eh_size += eh_advance_size (delta); +- stub_entry->group->eh_size += htab->opd_abi ? 36 : 35; +- } +- stub_entry->group->lr_restore = size - 4; ++ stub_entry->group->lr_restore = stub_entry->stub_offset + size - 4; + } + break; + +@@ -13814,11 +13890,11 @@ ppc64_elf_size_stubs (struct bfd_link_in + /* Augmentation. */ + p += 1; + +- *p++ = DW_CFA_advance_loc + 1; ++ *p++ = DW_CFA_advance_loc + (htab->has_plt_localentry0 ? 3 : 2); + *p++ = DW_CFA_register; + *p++ = 65; + *p++ = htab->opd_abi ? 12 : 0; +- *p++ = DW_CFA_advance_loc + (htab->opd_abi ? 5 : 7); ++ *p++ = DW_CFA_advance_loc + (htab->opd_abi ? 4 : 2); + *p++ = DW_CFA_restore_extended; + *p++ = 65; + p += ((24 + align - 1) & -align) - 24; +@@ -14179,8 +14255,6 @@ write_plt_relocs_for_local_syms (struct + } + + val = sym->st_value + ent->addend; +- if (ELF_ST_TYPE (sym->st_info) != STT_GNU_IFUNC) +- val += PPC64_LOCAL_ENTRY_OFFSET (sym->st_other); + if (sym_sec != NULL && sym_sec->output_section != NULL) + val += sym_sec->output_offset + sym_sec->output_section->vma; + +@@ -14414,23 +14488,60 @@ ppc64_elf_build_stubs (struct bfd_link_i + } + else + { ++ unsigned int insn; ++ ++ /* 0: ++ . .quad plt0-1f # plt0 entry relative to 1: ++ # ++ # We get here with r12 initially @ a glink branch ++ # Load the address of _dl_runtime_resolve from plt0 and ++ # jump to it, with r0 set to the index of the PLT entry ++ # to be resolved and r11 the link map. ++ __glink_PLTresolve: ++ . std %r2,24(%r1) # optional ++ . mflr %r0 ++ . bcl 20,31,1f ++ 1: ++ . mflr %r11 ++ . mtlr %r0 ++ . ld %r0,(0b-1b)(%r11) ++ . sub %r12,%r12,%r11 ++ . add %r11,%r0,%r11 ++ . addi %r0,%r12,1b-2f ++ . ld %r12,0(%r11) ++ . srdi %r0,%r0,2 ++ . mtctr %r12 ++ . ld %r11,8(%r11) ++ . bctr ++ 2: ++ . b __glink_PLTresolve ++ . ... ++ . b __glink_PLTresolve */ ++ ++ if (htab->has_plt_localentry0) ++ { ++ bfd_put_32 (htab->glink->owner, STD_R2_0R1 + 24, p); ++ p += 4; ++ } + bfd_put_32 (htab->glink->owner, MFLR_R0, p); + p += 4; + bfd_put_32 (htab->glink->owner, BCL_20_31, p); + p += 4; + bfd_put_32 (htab->glink->owner, MFLR_R11, p); + p += 4; +- bfd_put_32 (htab->glink->owner, STD_R2_0R1 + 24, p); +- p += 4; +- bfd_put_32 (htab->glink->owner, LD_R2_0R11 | (-16 & 0xfffc), p); +- p += 4; + bfd_put_32 (htab->glink->owner, MTLR_R0, p); + p += 4; ++ if (htab->has_plt_localentry0) ++ insn = LD_R0_0R11 | (-20 & 0xfffc); ++ else ++ insn = LD_R0_0R11 | (-16 & 0xfffc); ++ bfd_put_32 (htab->glink->owner, insn, p); ++ p += 4; + bfd_put_32 (htab->glink->owner, SUB_R12_R12_R11, p); + p += 4; +- bfd_put_32 (htab->glink->owner, ADD_R11_R2_R11, p); ++ bfd_put_32 (htab->glink->owner, ADD_R11_R0_R11, p); + p += 4; +- bfd_put_32 (htab->glink->owner, ADDI_R0_R12 | (-48 & 0xffff), p); ++ bfd_put_32 (htab->glink->owner, ADDI_R0_R12 | (-44 & 0xffff), p); + p += 4; + bfd_put_32 (htab->glink->owner, LD_R12_0R11, p); + p += 4; +@@ -15880,22 +15991,25 @@ ppc64_elf_relocate_section (bfd *output_ + addend = 0; + reloc_dest = DEST_STUB; + +- if (((stub_entry->stub_type == ppc_stub_plt_call +- && ALWAYS_EMIT_R2SAVE) +- || stub_entry->stub_type == ppc_stub_plt_call_r2save +- || stub_entry->stub_type == ppc_stub_plt_call_both) +- && !(h != NULL +- && is_tls_get_addr (&h->elf, htab) +- && htab->params->tls_get_addr_opt) +- && rel + 1 < relend +- && rel[1].r_offset == rel->r_offset + 4 +- && ELF64_R_TYPE (rel[1].r_info) == R_PPC64_TOCSAVE) +- relocation += 4; +- else if ((stub_entry->stub_type == ppc_stub_long_branch_both +- || stub_entry->stub_type == ppc_stub_plt_branch_both +- || stub_entry->stub_type == ppc_stub_plt_call_both) +- && r_type == R_PPC64_REL24_NOTOC) +- relocation += 4; ++ if ((((stub_entry->stub_type == ppc_stub_plt_call ++ && ALWAYS_EMIT_R2SAVE) ++ || stub_entry->stub_type == ppc_stub_plt_call_r2save ++ || stub_entry->stub_type == ppc_stub_plt_call_both) ++ && rel + 1 < relend ++ && rel[1].r_offset == rel->r_offset + 4 ++ && ELF64_R_TYPE (rel[1].r_info) == R_PPC64_TOCSAVE) ++ || ((stub_entry->stub_type == ppc_stub_long_branch_both ++ || stub_entry->stub_type == ppc_stub_plt_branch_both ++ || stub_entry->stub_type == ppc_stub_plt_call_both) ++ && r_type == R_PPC64_REL24_NOTOC)) ++ { ++ /* Skip over the r2 store at the start of the stub. */ ++ if (!(stub_entry->stub_type >= ppc_stub_plt_call ++ && htab->params->tls_get_addr_opt ++ && h != NULL ++ && is_tls_get_addr (&h->elf, htab))) ++ relocation += 4; ++ } + + if (r_type == R_PPC64_REL24_NOTOC + && (stub_entry->stub_type == ppc_stub_plt_call_notoc +@@ -15944,7 +16058,8 @@ ppc64_elf_relocate_section (bfd *output_ + break; + + case R_PPC64_GOT16_DS: +- if ((h ? h->elf.type : ELF_ST_TYPE (sym->st_info)) == STT_GNU_IFUNC) ++ if ((h ? h->elf.type : ELF_ST_TYPE (sym->st_info)) == STT_GNU_IFUNC ++ || !htab->do_toc_opt) + break; + from = TOCstart + htab->sec_info[input_section->id].toc_off; + if (relocation + addend - from + 0x8000 < 0x10000 +@@ -15963,7 +16078,8 @@ ppc64_elf_relocate_section (bfd *output_ + + case R_PPC64_GOT16_LO_DS: + case R_PPC64_GOT16_HA: +- if ((h ? h->elf.type : ELF_ST_TYPE (sym->st_info)) == STT_GNU_IFUNC) ++ if ((h ? h->elf.type : ELF_ST_TYPE (sym->st_info)) == STT_GNU_IFUNC ++ || !htab->do_toc_opt) + break; + from = TOCstart + htab->sec_info[input_section->id].toc_off; + if (relocation + addend - from + 0x80008000ULL < 0x100000000ULL +@@ -15986,34 +16102,38 @@ ppc64_elf_relocate_section (bfd *output_ + break; + + case R_PPC64_GOT_PCREL34: +- if ((h ? h->elf.type : ELF_ST_TYPE (sym->st_info)) == STT_GNU_IFUNC) ++ if ((h ? h->elf.type : ELF_ST_TYPE (sym->st_info)) == STT_GNU_IFUNC ++ || !htab->do_toc_opt) + break; + from = (rel->r_offset + + input_section->output_section->vma + + input_section->output_offset); +- if (relocation - from + (1ULL << 33) < 1ULL << 34 +- && SYMBOL_REFERENCES_LOCAL (info, &h->elf)) +- { +- offset = rel->r_offset; +- pinsn = bfd_get_32 (input_bfd, contents + offset); +- pinsn <<= 32; +- pinsn |= bfd_get_32 (input_bfd, contents + offset + 4); +- if ((pinsn & ((-1ULL << 50) | (63ULL << 26))) +- == ((1ULL << 58) | (1ULL << 52) | (57ULL << 26) /* pld */)) +- { +- /* Replace with paddi. */ +- pinsn += (2ULL << 56) + (14ULL << 26) - (57ULL << 26); +- r_type = R_PPC64_PCREL34; +- rel->r_info = ELF64_R_INFO (r_symndx, r_type); +- bfd_put_32 (input_bfd, pinsn >> 32, contents + offset); +- bfd_put_32 (input_bfd, pinsn, contents + offset + 4); +- goto pcrelopt; +- } +- } +- break; ++ if (!(relocation - from + (1ULL << 33) < 1ULL << 34 ++ && SYMBOL_REFERENCES_LOCAL (info, &h->elf))) ++ break; ++ ++ offset = rel->r_offset; ++ pinsn = bfd_get_32 (input_bfd, contents + offset); ++ pinsn <<= 32; ++ pinsn |= bfd_get_32 (input_bfd, contents + offset + 4); ++ if ((pinsn & ((-1ULL << 50) | (63ULL << 26))) ++ != ((1ULL << 58) | (1ULL << 52) | (57ULL << 26) /* pld */)) ++ break; ++ ++ /* Replace with paddi. */ ++ pinsn += (2ULL << 56) + (14ULL << 26) - (57ULL << 26); ++ r_type = R_PPC64_PCREL34; ++ rel->r_info = ELF64_R_INFO (r_symndx, r_type); ++ bfd_put_32 (input_bfd, pinsn >> 32, contents + offset); ++ bfd_put_32 (input_bfd, pinsn, contents + offset + 4); ++ /* Fall through. */ + + case R_PPC64_PCREL34: +- if (SYMBOL_REFERENCES_LOCAL (info, &h->elf)) ++ if (!htab->params->no_pcrel_opt ++ && rel + 1 < relend ++ && rel[1].r_offset == rel->r_offset ++ && rel[1].r_info == ELF64_R_INFO (0, R_PPC64_PCREL_OPT) ++ && SYMBOL_REFERENCES_LOCAL (info, &h->elf)) + { + offset = rel->r_offset; + pinsn = bfd_get_32 (input_bfd, contents + offset); +@@ -16023,43 +16143,37 @@ ppc64_elf_relocate_section (bfd *output_ + == ((1ULL << 58) | (2ULL << 56) | (1ULL << 52) + | (14ULL << 26) /* paddi */)) + { +- pcrelopt: +- if (rel + 1 < relend +- && rel[1].r_offset == offset +- && rel[1].r_info == ELF64_R_INFO (0, R_PPC64_PCREL_OPT)) +- { +- bfd_vma off2 = rel[1].r_addend; +- if (off2 == 0) +- /* zero means next insn. */ +- off2 = 8; +- off2 += offset; +- if (off2 + 4 <= input_section->size) ++ bfd_vma off2 = rel[1].r_addend; ++ if (off2 == 0) ++ /* zero means next insn. */ ++ off2 = 8; ++ off2 += offset; ++ if (off2 + 4 <= input_section->size) ++ { ++ uint64_t pinsn2; ++ bfd_signed_vma addend_off; ++ pinsn2 = bfd_get_32 (input_bfd, contents + off2); ++ pinsn2 <<= 32; ++ if ((pinsn2 & (63ULL << 58)) == 1ULL << 58) + { +- uint64_t pinsn2; +- bfd_signed_vma addend_off; +- pinsn2 = bfd_get_32 (input_bfd, contents + off2); +- pinsn2 <<= 32; ++ if (off2 + 8 > input_section->size) ++ break; ++ pinsn2 |= bfd_get_32 (input_bfd, ++ contents + off2 + 4); ++ } ++ if (xlate_pcrel_opt (&pinsn, &pinsn2, &addend_off)) ++ { ++ addend += addend_off; ++ rel->r_addend = addend; ++ bfd_put_32 (input_bfd, pinsn >> 32, ++ contents + offset); ++ bfd_put_32 (input_bfd, pinsn, ++ contents + offset + 4); ++ bfd_put_32 (input_bfd, pinsn2 >> 32, ++ contents + off2); + if ((pinsn2 & (63ULL << 58)) == 1ULL << 58) +- { +- if (off2 + 8 > input_section->size) +- break; +- pinsn2 |= bfd_get_32 (input_bfd, +- contents + off2 + 4); +- } +- if (xlate_pcrel_opt (&pinsn, &pinsn2, &addend_off)) +- { +- addend += addend_off; +- rel->r_addend = addend; +- bfd_put_32 (input_bfd, pinsn >> 32, +- contents + offset); +- bfd_put_32 (input_bfd, pinsn, +- contents + offset + 4); +- bfd_put_32 (input_bfd, pinsn2 >> 32, +- contents + off2); +- if ((pinsn2 & (63ULL << 58)) == 1ULL << 58) +- bfd_put_32 (input_bfd, pinsn2, +- contents + off2 + 4); +- } ++ bfd_put_32 (input_bfd, pinsn2, ++ contents + off2 + 4); + } + } + } +diff -rup binutils-2.35.1/bfd/elf64-ppc.h fred/binutils-2.35.1/bfd/elf64-ppc.h +--- binutils-2.35.1/bfd/elf64-ppc.h 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/bfd/elf64-ppc.h 2020-11-25 14:37:34.000000000 +0000 +@@ -27,6 +27,7 @@ struct ppc64_elf_params + /* Linker call-backs. */ + asection * (*add_stub_section) (const char *, asection *); + void (*layout_sections_again) (void); ++ void (*edit) (void); + + /* Maximum size of a group of input sections that can be handled by + one stub section. A value of +/-1 indicates the bfd back-end +@@ -57,6 +58,9 @@ struct ppc64_elf_params + /* Whether to use power10 instructions in linkage stubs. */ + int power10_stubs; + ++ /* Whether R_PPC64_PCREL_OPT should be ignored. */ ++ int no_pcrel_opt; ++ + /* Whether to canonicalize .opd so that there are no overlapping + .opd entries. */ + int non_overlapping_opd; +@@ -77,7 +81,7 @@ bfd_boolean ppc64_elf_edit_opd + (struct bfd_link_info *); + bfd_boolean ppc64_elf_inline_plt + (struct bfd_link_info *); +-asection *ppc64_elf_tls_setup ++bfd_boolean ppc64_elf_tls_setup + (struct bfd_link_info *); + bfd_boolean ppc64_elf_tls_optimize + (struct bfd_link_info *); +diff -rup binutils-2.35.1/bfd/elfxx-x86.c fred/binutils-2.35.1/bfd/elfxx-x86.c +--- binutils-2.35.1/bfd/elfxx-x86.c 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/bfd/elfxx-x86.c 2020-11-25 14:37:34.000000000 +0000 +@@ -2417,15 +2417,19 @@ _bfd_x86_elf_merge_gnu_properties (struc + abort (); + if (aprop != NULL && bprop != NULL) + { +- features = 0; +- if (htab->params->ibt) +- features = GNU_PROPERTY_X86_FEATURE_1_IBT; +- if (htab->params->shstk) +- features |= GNU_PROPERTY_X86_FEATURE_1_SHSTK; + number = aprop->u.number; +- /* Add GNU_PROPERTY_X86_FEATURE_1_IBT and +- GNU_PROPERTY_X86_FEATURE_1_SHSTK. */ +- aprop->u.number = (number & bprop->u.number) | features; ++ aprop->u.number = number & bprop->u.number; ++ if (pr_type == GNU_PROPERTY_X86_FEATURE_1_AND) ++ { ++ features = 0; ++ if (htab->params->ibt) ++ features = GNU_PROPERTY_X86_FEATURE_1_IBT; ++ if (htab->params->shstk) ++ features |= GNU_PROPERTY_X86_FEATURE_1_SHSTK; ++ /* Add GNU_PROPERTY_X86_FEATURE_1_IBT and ++ GNU_PROPERTY_X86_FEATURE_1_SHSTK. */ ++ aprop->u.number |= features; ++ } + updated = number != (unsigned int) aprop->u.number; + /* Remove the property if all feature bits are cleared. */ + if (aprop->u.number == 0) +@@ -2437,10 +2441,13 @@ _bfd_x86_elf_merge_gnu_properties (struc + have them. Set IBT and SHSTK properties for -z ibt and -z + shstk if needed. */ + features = 0; +- if (htab->params->ibt) +- features = GNU_PROPERTY_X86_FEATURE_1_IBT; +- if (htab->params->shstk) +- features |= GNU_PROPERTY_X86_FEATURE_1_SHSTK; ++ if (pr_type == GNU_PROPERTY_X86_FEATURE_1_AND) ++ { ++ if (htab->params->ibt) ++ features = GNU_PROPERTY_X86_FEATURE_1_IBT; ++ if (htab->params->shstk) ++ features |= GNU_PROPERTY_X86_FEATURE_1_SHSTK; ++ } + if (features) + { + if (aprop != NULL) +diff -rup binutils-2.35.1/binutils/dwarf.c fred/binutils-2.35.1/binutils/dwarf.c +--- binutils-2.35.1/binutils/dwarf.c 2020-09-03 15:51:01.000000000 +0100 ++++ fred/binutils-2.35.1/binutils/dwarf.c 2020-11-25 14:37:35.000000000 +0000 +@@ -849,101 +849,208 @@ fetch_indexed_value (dwarf_vma offset, d + /* FIXME: There are better and more efficient ways to handle + these structures. For now though, I just want something that + is simple to implement. */ ++/* Records a single attribute in an abbrev. */ + typedef struct abbrev_attr + { +- unsigned long attribute; +- unsigned long form; +- bfd_signed_vma implicit_const; +- struct abbrev_attr *next; ++ unsigned long attribute; ++ unsigned long form; ++ bfd_signed_vma implicit_const; ++ struct abbrev_attr * next; + } + abbrev_attr; + ++/* Records a single abbrev. */ + typedef struct abbrev_entry + { +- unsigned long entry; +- unsigned long tag; +- int children; +- struct abbrev_attr *first_attr; +- struct abbrev_attr *last_attr; +- struct abbrev_entry *next; ++ unsigned long number; ++ unsigned long tag; ++ int children; ++ struct abbrev_attr * first_attr; ++ struct abbrev_attr * last_attr; ++ struct abbrev_entry * next; + } + abbrev_entry; + +-static abbrev_entry *first_abbrev = NULL; +-static abbrev_entry *last_abbrev = NULL; ++/* Records a set of abbreviations. */ ++typedef struct abbrev_list ++{ ++ abbrev_entry * first_abbrev; ++ abbrev_entry * last_abbrev; ++ dwarf_vma abbrev_base; ++ dwarf_vma abbrev_offset; ++ struct abbrev_list * next; ++ unsigned char * start_of_next_abbrevs; ++} ++abbrev_list; ++ ++/* Records all the abbrevs found so far. */ ++static struct abbrev_list * abbrev_lists = NULL; ++ ++typedef struct abbrev_map ++{ ++ dwarf_vma start; ++ dwarf_vma end; ++ abbrev_list * list; ++} abbrev_map; ++ ++/* Maps between CU offsets and abbrev sets. */ ++static abbrev_map * cu_abbrev_map = NULL; ++static unsigned long num_abbrev_map_entries = 0; ++static unsigned long next_free_abbrev_map_entry = 0; ++ ++#define INITIAL_NUM_ABBREV_MAP_ENTRIES 8 ++#define ABBREV_MAP_ENTRIES_INCREMENT 8 + + static void +-free_abbrevs (void) ++record_abbrev_list_for_cu (dwarf_vma start, dwarf_vma end, abbrev_list * list) + { +- abbrev_entry *abbrv; ++ if (cu_abbrev_map == NULL) ++ { ++ num_abbrev_map_entries = INITIAL_NUM_ABBREV_MAP_ENTRIES; ++ cu_abbrev_map = xmalloc (num_abbrev_map_entries * sizeof (* cu_abbrev_map)); ++ } ++ else if (next_free_abbrev_map_entry == num_abbrev_map_entries) ++ { ++ num_abbrev_map_entries += ABBREV_MAP_ENTRIES_INCREMENT; ++ cu_abbrev_map = xrealloc (cu_abbrev_map, num_abbrev_map_entries * sizeof (* cu_abbrev_map)); ++ } + +- for (abbrv = first_abbrev; abbrv;) ++ cu_abbrev_map[next_free_abbrev_map_entry].start = start; ++ cu_abbrev_map[next_free_abbrev_map_entry].end = end; ++ cu_abbrev_map[next_free_abbrev_map_entry].list = list; ++ next_free_abbrev_map_entry ++; ++} ++ ++static void ++free_all_abbrevs (void) ++{ ++ abbrev_list * list; ++ ++ for (list = abbrev_lists; list != NULL;) + { +- abbrev_entry *next_abbrev = abbrv->next; +- abbrev_attr *attr; ++ abbrev_list * next = list->next; ++ abbrev_entry * abbrv; + +- for (attr = abbrv->first_attr; attr;) ++ for (abbrv = list->first_abbrev; abbrv != NULL;) + { +- abbrev_attr *next_attr = attr->next; ++ abbrev_entry * next_abbrev = abbrv->next; ++ abbrev_attr * attr; ++ ++ for (attr = abbrv->first_attr; attr;) ++ { ++ abbrev_attr *next_attr = attr->next; + +- free (attr); +- attr = next_attr; ++ free (attr); ++ attr = next_attr; ++ } ++ ++ free (abbrv); ++ abbrv = next_abbrev; + } + +- free (abbrv); +- abbrv = next_abbrev; ++ free (list); ++ list = next; + } + +- last_abbrev = first_abbrev = NULL; ++ abbrev_lists = NULL; ++} ++ ++static abbrev_list * ++new_abbrev_list (dwarf_vma abbrev_base, dwarf_vma abbrev_offset) ++{ ++ abbrev_list * list = (abbrev_list *) xcalloc (sizeof * list, 1); ++ ++ list->abbrev_base = abbrev_base; ++ list->abbrev_offset = abbrev_offset; ++ ++ list->next = abbrev_lists; ++ abbrev_lists = list; ++ ++ return list; ++} ++ ++static abbrev_list * ++find_abbrev_list_by_abbrev_offset (dwarf_vma abbrev_base, ++ dwarf_vma abbrev_offset) ++{ ++ abbrev_list * list; ++ ++ for (list = abbrev_lists; list != NULL; list = list->next) ++ if (list->abbrev_base == abbrev_base ++ && list->abbrev_offset == abbrev_offset) ++ return list; ++ ++ return NULL; ++} ++ ++/* Find the abbreviation map for the CU that includes OFFSET. ++ OFFSET is an absolute offset from the start of the .debug_info section. */ ++/* FIXME: This function is going to slow down readelf & objdump. ++ Consider using a better algorithm to mitigate this effect. */ ++ ++static abbrev_map * ++find_abbrev_map_by_offset (dwarf_vma offset) ++{ ++ unsigned long i; ++ ++ for (i = 0; i < next_free_abbrev_map_entry; i++) ++ if (cu_abbrev_map[i].start <= offset ++ && cu_abbrev_map[i].end > offset) ++ return cu_abbrev_map + i; ++ ++ return NULL; + } + + static void +-add_abbrev (unsigned long number, unsigned long tag, int children) ++add_abbrev (unsigned long number, ++ unsigned long tag, ++ int children, ++ abbrev_list * list) + { +- abbrev_entry *entry; ++ abbrev_entry * entry; + +- entry = (abbrev_entry *) malloc (sizeof (*entry)); +- if (entry == NULL) +- /* ugg */ +- return; ++ entry = (abbrev_entry *) xmalloc (sizeof (*entry)); + +- entry->entry = number; ++ entry->number = number; + entry->tag = tag; + entry->children = children; + entry->first_attr = NULL; + entry->last_attr = NULL; + entry->next = NULL; + +- if (first_abbrev == NULL) +- first_abbrev = entry; ++ assert (list != NULL); ++ ++ if (list->first_abbrev == NULL) ++ list->first_abbrev = entry; + else +- last_abbrev->next = entry; ++ list->last_abbrev->next = entry; + +- last_abbrev = entry; ++ list->last_abbrev = entry; + } + + static void +-add_abbrev_attr (unsigned long attribute, unsigned long form, +- bfd_signed_vma implicit_const) ++add_abbrev_attr (unsigned long attribute, ++ unsigned long form, ++ bfd_signed_vma implicit_const, ++ abbrev_list * list) + { + abbrev_attr *attr; + +- attr = (abbrev_attr *) malloc (sizeof (*attr)); +- if (attr == NULL) +- /* ugg */ +- return; ++ attr = (abbrev_attr *) xmalloc (sizeof (*attr)); + + attr->attribute = attribute; + attr->form = form; + attr->implicit_const = implicit_const; + attr->next = NULL; + +- if (last_abbrev->first_attr == NULL) +- last_abbrev->first_attr = attr; ++ assert (list != NULL && list->last_abbrev != NULL); ++ ++ if (list->last_abbrev->first_attr == NULL) ++ list->last_abbrev->first_attr = attr; + else +- last_abbrev->last_attr->next = attr; ++ list->last_abbrev->last_attr->next = attr; + +- last_abbrev->last_attr = attr; ++ list->last_abbrev->last_attr = attr; + } + + /* Processes the (partial) contents of a .debug_abbrev section. +@@ -952,11 +1059,10 @@ add_abbrev_attr (unsigned long attribute + an abbreviation set was found. */ + + static unsigned char * +-process_abbrev_section (unsigned char *start, unsigned char *end) ++process_abbrev_set (unsigned char * start, ++ const unsigned char * end, ++ abbrev_list * list) + { +- if (first_abbrev != NULL) +- return NULL; +- + while (start < end) + { + unsigned long entry; +@@ -966,7 +1072,7 @@ process_abbrev_section (unsigned char *s + + READ_ULEB (entry, start, end); + +- /* A single zero is supposed to end the section according ++ /* A single zero is supposed to end the set according + to the standard. If there's more, then signal that to + the caller. */ + if (start == end) +@@ -980,7 +1086,7 @@ process_abbrev_section (unsigned char *s + + children = *start++; + +- add_abbrev (entry, tag, children); ++ add_abbrev (entry, tag, children, list); + + do + { +@@ -1003,7 +1109,7 @@ process_abbrev_section (unsigned char *s + break; + } + +- add_abbrev_attr (attribute, form, implicit_const); ++ add_abbrev_attr (attribute, form, implicit_const, list); + } + while (attribute != 0); + } +@@ -1868,7 +1974,7 @@ skip_attr_bytes (unsigned long + case DW_FORM_ref_addr: + if (dwarf_version == 2) + SAFE_BYTE_GET_AND_INC (uvalue, data, pointer_size, end); +- else if (dwarf_version == 3 || dwarf_version == 4) ++ else if (dwarf_version > 2) + SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end); + else + return NULL; +@@ -1919,7 +2025,23 @@ skip_attr_bytes (unsigned long + break; + + case DW_FORM_ref8: ++ { ++ dwarf_vma high_bits; ++ ++ SAFE_BYTE_GET64 (data, &high_bits, &uvalue, end); ++ data += 8; ++ if (sizeof (uvalue) > 4) ++ uvalue += high_bits << 32; ++ else if (high_bits != 0) ++ { ++ /* FIXME: What to do ? */ ++ return NULL; ++ } ++ break; ++ } ++ + case DW_FORM_data8: ++ case DW_FORM_ref_sig8: + data += 8; + break; + +@@ -1934,6 +2056,7 @@ skip_attr_bytes (unsigned long + case DW_FORM_block: + case DW_FORM_exprloc: + READ_ULEB (uvalue, data, end); ++ data += uvalue; + break; + + case DW_FORM_block1: +@@ -1951,12 +2074,12 @@ skip_attr_bytes (unsigned long + data += 4 + uvalue; + break; + +- case DW_FORM_ref_sig8: +- data += 8; +- break; +- + case DW_FORM_indirect: +- /* FIXME: Handle this form. */ ++ READ_ULEB (form, data, end); ++ if (form == DW_FORM_implicit_const) ++ SKIP_ULEB (data, end); ++ return skip_attr_bytes (form, data, end, pointer_size, offset_size, dwarf_version, value_return); ++ + default: + return NULL; + } +@@ -1967,40 +2090,137 @@ skip_attr_bytes (unsigned long + return data; + } + +-/* Return IS_SIGNED set to TRUE if the type at +- DATA can be determined to be a signed type. */ ++/* Given form FORM with value UVALUE, locate and return the abbreviation ++ associated with it. */ ++ ++static abbrev_entry * ++get_type_abbrev_from_form (unsigned long form, ++ unsigned long uvalue, ++ dwarf_vma cu_offset, ++ const struct dwarf_section * section, ++ unsigned long * abbrev_num_return, ++ unsigned char ** data_return, ++ unsigned long * cu_offset_return) ++{ ++ unsigned long abbrev_number; ++ abbrev_map * map; ++ abbrev_entry * entry; ++ unsigned char * data; ++ ++ if (abbrev_num_return != NULL) ++ * abbrev_num_return = 0; ++ if (data_return != NULL) ++ * data_return = NULL; ++ ++ switch (form) ++ { ++ case DW_FORM_GNU_ref_alt: ++ /* FIXME: We are unable to handle this form at the moment. */ ++ return NULL; ++ ++ case DW_FORM_ref_addr: ++ if (uvalue >= section->size) ++ { ++ warn (_("Unable to resolve ref_addr form: uvalue %lx > section size %lx (%s)\n"), ++ uvalue, (long) section->size, section->name); ++ return NULL; ++ } ++ break; ++ ++ case DW_FORM_ref1: ++ case DW_FORM_ref2: ++ case DW_FORM_ref4: ++ case DW_FORM_ref8: ++ case DW_FORM_ref_udata: ++ if (uvalue + cu_offset > section->size) ++ { ++ warn (_("Unable to resolve ref form: uvalue %lx + cu_offset %lx > section size %lx\n"), ++ uvalue, (long) cu_offset, (long) section->size); ++ return NULL; ++ } ++ uvalue += cu_offset; ++ break; ++ ++ /* FIXME: Are there other DW_FORMs that can be used by types ? */ ++ ++ default: ++ warn (_("Unexpected form %lx encountered whilst finding abbreviation for type\n"), form); ++ return NULL; ++ } ++ ++ data = (unsigned char *) section->start + uvalue; ++ map = find_abbrev_map_by_offset (uvalue); ++ ++ if (map == NULL) ++ { ++ warn (_("Unable to find abbreviations for CU offset %#lx\n"), uvalue); ++ return NULL; ++ } ++ if (map->list == NULL) ++ { ++ warn (_("Empty abbreviation list encountered for CU offset %lx\n"), uvalue); ++ return NULL; ++ } ++ ++ if (cu_offset_return != NULL) ++ { ++ if (form == DW_FORM_ref_addr) ++ * cu_offset_return = map->start; ++ else ++ * cu_offset_return = cu_offset; ++ } ++ ++ READ_ULEB (abbrev_number, data, section->start + section->size); ++ ++ for (entry = map->list->first_abbrev; entry != NULL; entry = entry->next) ++ if (entry->number == abbrev_number) ++ break; ++ ++ if (abbrev_num_return != NULL) ++ * abbrev_num_return = abbrev_number; ++ ++ if (data_return != NULL) ++ * data_return = data; ++ ++ if (entry == NULL) ++ warn (_("Unable to find entry for abbreviation %lu\n"), abbrev_number); ++ ++ return entry; ++} ++ ++/* Return IS_SIGNED set to TRUE if the type using abbreviation ENTRY ++ can be determined to be a signed type. The data for ENTRY can be ++ found starting at DATA. */ + + static void +-get_type_signedness (unsigned char * start, ++get_type_signedness (abbrev_entry * entry, ++ const struct dwarf_section * section, + unsigned char * data, + unsigned const char * end, ++ dwarf_vma cu_offset, + dwarf_vma pointer_size, + dwarf_vma offset_size, + int dwarf_version, + bfd_boolean * is_signed, +- bfd_boolean is_nested) ++ unsigned int nesting) + { +- unsigned long abbrev_number; +- abbrev_entry * entry; + abbrev_attr * attr; + + * is_signed = FALSE; + +- READ_ULEB (abbrev_number, data, end); +- +- for (entry = first_abbrev; +- entry != NULL && entry->entry != abbrev_number; +- entry = entry->next) +- continue; +- +- if (entry == NULL) +- /* FIXME: Issue a warning ? */ +- return; ++#define MAX_NESTING 20 ++ if (nesting > MAX_NESTING) ++ { ++ /* FIXME: Warn - or is this expected ? ++ NB/ We need to avoid infinite recursion. */ ++ return; ++ } + + for (attr = entry->first_attr; + attr != NULL && attr->attribute; + attr = attr->next) + { ++ unsigned char * orig_data = data; + dwarf_vma uvalue = 0; + + data = skip_attr_bytes (attr->form, data, end, pointer_size, +@@ -2010,25 +2230,38 @@ get_type_signedness (unsigned char * + + switch (attr->attribute) + { +-#if 0 /* FIXME: It would be nice to print the name of the type, +- but this would mean updating a lot of binutils tests. */ ++ case DW_AT_linkage_name: + case DW_AT_name: +- if (attr->form == DW_FORM_strp) +- printf ("%s", fetch_indirect_string (uvalue)); ++ if (do_wide) ++ { ++ if (attr->form == DW_FORM_strp) ++ printf (", %s", fetch_indirect_string (uvalue)); ++ else if (attr->form == DW_FORM_string) ++ printf (", %s", orig_data); ++ } + break; +-#endif ++ + case DW_AT_type: + /* Recurse. */ +- if (is_nested) +- { +- /* FIXME: Warn - or is this expected ? +- NB/ We need to avoid infinite recursion. */ +- return; +- } +- if (uvalue >= (size_t) (end - start)) +- return; +- get_type_signedness (start, start + uvalue, end, pointer_size, +- offset_size, dwarf_version, is_signed, TRUE); ++ { ++ abbrev_entry * type_abbrev; ++ unsigned char * type_data; ++ unsigned long type_cu_offset; ++ ++ type_abbrev = get_type_abbrev_from_form (attr->form, ++ uvalue, ++ cu_offset, ++ section, ++ NULL /* abbrev num return */, ++ & type_data, ++ & type_cu_offset); ++ if (type_abbrev == NULL) ++ break; ++ ++ get_type_signedness (type_abbrev, section, type_data, end, type_cu_offset, ++ pointer_size, offset_size, dwarf_version, ++ is_signed, nesting + 1); ++ } + break; + + case DW_AT_encoding: +@@ -2202,11 +2435,10 @@ read_and_display_attr_value (unsigned lo + case DW_FORM_ref_addr: + if (dwarf_version == 2) + SAFE_BYTE_GET_AND_INC (uvalue, data, pointer_size, end); +- else if (dwarf_version == 3 || dwarf_version == 4) ++ else if (dwarf_version > 2) + SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end); + else +- error (_("Internal error: DWARF version is not 2, 3 or 4.\n")); +- ++ error (_("Internal error: DW_FORM_ref_addr is not supported in DWARF version 1.\n")); + break; + + case DW_FORM_addr: +@@ -2271,12 +2503,12 @@ read_and_display_attr_value (unsigned lo + { + case DW_FORM_ref_addr: + if (!do_loc) +- printf ("%c<0x%s>", delimiter, dwarf_vmatoa ("x",uvalue)); ++ printf ("%c<0x%s>", delimiter, dwarf_vmatoa ("x", uvalue)); + break; + + case DW_FORM_GNU_ref_alt: + if (!do_loc) +- printf ("%c", delimiter, dwarf_vmatoa ("x",uvalue)); ++ printf ("%c", delimiter, dwarf_vmatoa ("x", uvalue)); + /* FIXME: Follow the reference... */ + break; + +@@ -2662,9 +2894,18 @@ read_and_display_attr_value (unsigned lo + && uvalue < (size_t) (end - start)) + { + bfd_boolean is_signed = FALSE; +- +- get_type_signedness (start, start + uvalue, end, pointer_size, +- offset_size, dwarf_version, & is_signed, FALSE); ++ abbrev_entry * type_abbrev; ++ unsigned char * type_data; ++ unsigned long type_cu_offset; ++ ++ type_abbrev = get_type_abbrev_from_form (form, uvalue, cu_offset, ++ section, NULL, & type_data, & type_cu_offset); ++ if (type_abbrev != NULL) ++ { ++ get_type_signedness (type_abbrev, section, type_data, end, type_cu_offset, ++ pointer_size, offset_size, dwarf_version, ++ & is_signed, 0); ++ } + level_type_signed[level] = is_signed; + } + break; +@@ -2986,40 +3227,22 @@ read_and_display_attr_value (unsigned lo + + case DW_AT_import: + { +- if (form == DW_FORM_ref_sig8 +- || form == DW_FORM_GNU_ref_alt) +- break; ++ unsigned long abbrev_number; ++ abbrev_entry *entry; + +- if (form == DW_FORM_ref1 +- || form == DW_FORM_ref2 +- || form == DW_FORM_ref4 +- || form == DW_FORM_ref_udata) +- uvalue += cu_offset; +- +- if (uvalue >= section->size) +- warn (_("Offset %s used as value for DW_AT_import attribute of DIE at offset 0x%lx is too big.\n"), +- dwarf_vmatoa ("x", uvalue), +- (unsigned long) (orig_data - section->start)); ++ entry = get_type_abbrev_from_form (form, uvalue, cu_offset, ++ section, & abbrev_number, NULL, NULL); ++ if (entry == NULL) ++ { ++ if (form != DW_FORM_GNU_ref_alt) ++ warn (_("Offset %s used as value for DW_AT_import attribute of DIE at offset 0x%lx is too big.\n"), ++ dwarf_vmatoa ("x", uvalue), ++ (unsigned long) (orig_data - section->start)); ++ } + else + { +- unsigned long abbrev_number; +- abbrev_entry *entry; +- unsigned char *p = section->start + uvalue; +- +- READ_ULEB (abbrev_number, p, end); +- + printf (_("\t[Abbrev Number: %ld"), abbrev_number); +- /* Don't look up abbrev for DW_FORM_ref_addr, as it very often will +- use different abbrev table, and we don't track .debug_info chunks +- yet. */ +- if (form != DW_FORM_ref_addr) +- { +- for (entry = first_abbrev; entry != NULL; entry = entry->next) +- if (entry->entry == abbrev_number) +- break; +- if (entry != NULL) +- printf (" (%s)", get_TAG_name (entry->tag)); +- } ++ printf (" (%s)", get_TAG_name (entry->tag)); + printf ("]"); + } + } +@@ -3238,8 +3461,100 @@ process_debug_info (struct dwarf_section + + if (!do_loc && dwarf_start_die == 0) + introduce (section, FALSE); ++ ++ free_all_abbrevs (); ++ free (cu_abbrev_map); ++ cu_abbrev_map = NULL; ++ next_free_abbrev_map_entry = 0; + +- for (section_begin = start, unit = 0; start < end; unit++) ++ /* In order to be able to resolve DW_FORM_ref_attr forms we need ++ to load *all* of the abbrevs for all CUs in this .debug_info ++ section. This does effectively mean that we (partially) read ++ every CU header twice. */ ++ for (section_begin = start; start < end;) ++ { ++ DWARF2_Internal_CompUnit compunit; ++ unsigned char * hdrptr; ++ dwarf_vma abbrev_base; ++ size_t abbrev_size; ++ dwarf_vma cu_offset; ++ unsigned int offset_size; ++ unsigned int initial_length_size; ++ struct cu_tu_set * this_set; ++ abbrev_list * list; ++ ++ hdrptr = start; ++ ++ SAFE_BYTE_GET_AND_INC (compunit.cu_length, hdrptr, 4, end); ++ ++ if (compunit.cu_length == 0xffffffff) ++ { ++ SAFE_BYTE_GET_AND_INC (compunit.cu_length, hdrptr, 8, end); ++ offset_size = 8; ++ initial_length_size = 12; ++ } ++ else ++ { ++ offset_size = 4; ++ initial_length_size = 4; ++ } ++ ++ SAFE_BYTE_GET_AND_INC (compunit.cu_version, hdrptr, 2, end); ++ ++ cu_offset = start - section_begin; ++ ++ this_set = find_cu_tu_set_v2 (cu_offset, do_types); ++ ++ if (compunit.cu_version < 5) ++ { ++ compunit.cu_unit_type = DW_UT_compile; ++ /* Initialize it due to a false compiler warning. */ ++ compunit.cu_pointer_size = -1; ++ } ++ else ++ { ++ SAFE_BYTE_GET_AND_INC (compunit.cu_unit_type, hdrptr, 1, end); ++ do_types = (compunit.cu_unit_type == DW_UT_type); ++ ++ SAFE_BYTE_GET_AND_INC (compunit.cu_pointer_size, hdrptr, 1, end); ++ } ++ ++ SAFE_BYTE_GET_AND_INC (compunit.cu_abbrev_offset, hdrptr, offset_size, end); ++ ++ if (this_set == NULL) ++ { ++ abbrev_base = 0; ++ abbrev_size = debug_displays [abbrev_sec].section.size; ++ } ++ else ++ { ++ abbrev_base = this_set->section_offsets [DW_SECT_ABBREV]; ++ abbrev_size = this_set->section_sizes [DW_SECT_ABBREV]; ++ } ++ ++ list = find_abbrev_list_by_abbrev_offset (abbrev_base, ++ compunit.cu_abbrev_offset); ++ if (list == NULL) ++ { ++ unsigned char * next; ++ ++ list = new_abbrev_list (abbrev_base, ++ compunit.cu_abbrev_offset); ++ next = process_abbrev_set ++ (((unsigned char *) debug_displays [abbrev_sec].section.start ++ + abbrev_base + compunit.cu_abbrev_offset), ++ ((unsigned char *) debug_displays [abbrev_sec].section.start ++ + abbrev_base + abbrev_size), ++ list); ++ list->start_of_next_abbrevs = next; ++ } ++ ++ start = section_begin + cu_offset + compunit.cu_length ++ + initial_length_size; ++ record_abbrev_list_for_cu (cu_offset, start - section_begin, list); ++ } ++ ++ for (start = section_begin, unit = 0; start < end; unit++) + { + DWARF2_Internal_CompUnit compunit; + unsigned char *hdrptr; +@@ -3255,6 +3570,7 @@ process_debug_info (struct dwarf_section + struct cu_tu_set *this_set; + dwarf_vma abbrev_base; + size_t abbrev_size; ++ abbrev_list * list = NULL; + + hdrptr = start; + +@@ -3361,6 +3677,10 @@ process_debug_info (struct dwarf_section + dwarf_vmatoa ("x", compunit.cu_length), + offset_size == 8 ? "64-bit" : "32-bit"); + printf (_(" Version: %d\n"), compunit.cu_version); ++ if (compunit.cu_version >= 5) ++ printf (_(" Unit Type: %s (%x)\n"), ++ get_DW_UT_name (compunit.cu_unit_type) ?: "???", ++ compunit.cu_unit_type); + printf (_(" Abbrev Offset: 0x%s\n"), + dwarf_vmatoa ("x", compunit.cu_abbrev_offset)); + printf (_(" Pointer Size: %d\n"), compunit.cu_pointer_size); +@@ -3419,6 +3739,7 @@ process_debug_info (struct dwarf_section + } + + if (compunit.cu_unit_type != DW_UT_compile ++ && compunit.cu_unit_type != DW_UT_partial + && compunit.cu_unit_type != DW_UT_type) + { + warn (_("CU at offset %s contains corrupt or " +@@ -3427,8 +3748,6 @@ process_debug_info (struct dwarf_section + continue; + } + +- free_abbrevs (); +- + /* Process the abbrevs used by this compilation unit. */ + if (compunit.cu_abbrev_offset >= abbrev_size) + warn (_("Debug info is corrupted, abbrev offset (%lx) is larger than abbrev section size (%lx)\n"), +@@ -3441,11 +3760,24 @@ process_debug_info (struct dwarf_section + (unsigned long) abbrev_base + abbrev_size, + (unsigned long) debug_displays [abbrev_sec].section.size); + else +- process_abbrev_section +- (((unsigned char *) debug_displays [abbrev_sec].section.start +- + abbrev_base + compunit.cu_abbrev_offset), +- ((unsigned char *) debug_displays [abbrev_sec].section.start +- + abbrev_base + abbrev_size)); ++ { ++ list = find_abbrev_list_by_abbrev_offset (abbrev_base, ++ compunit.cu_abbrev_offset); ++ if (list == NULL) ++ { ++ unsigned char * next; ++ ++ list = new_abbrev_list (abbrev_base, ++ compunit.cu_abbrev_offset); ++ next = process_abbrev_set ++ (((unsigned char *) debug_displays [abbrev_sec].section.start ++ + abbrev_base + compunit.cu_abbrev_offset), ++ ((unsigned char *) debug_displays [abbrev_sec].section.start ++ + abbrev_base + abbrev_size), ++ list); ++ list->start_of_next_abbrevs = next; ++ } ++ } + + level = 0; + last_level = level; +@@ -3525,11 +3857,13 @@ process_debug_info (struct dwarf_section + + /* Scan through the abbreviation list until we reach the + correct entry. */ +- for (entry = first_abbrev; +- entry && entry->entry != abbrev_number; +- entry = entry->next) ++ if (list == NULL) + continue; + ++ for (entry = list->first_abbrev; entry != NULL; entry = entry->next) ++ if (entry->number == abbrev_number) ++ break; ++ + if (entry == NULL) + { + if (!do_loc && do_printing) +@@ -5714,30 +6048,37 @@ display_debug_abbrev (struct dwarf_secti + { + abbrev_entry *entry; + unsigned char *start = section->start; +- unsigned char *end = start + section->size; ++ const unsigned char *end = start + section->size; + + introduce (section, FALSE); + + do + { +- unsigned char *last; +- +- free_abbrevs (); ++ abbrev_list * list; ++ dwarf_vma offset; + +- last = start; +- start = process_abbrev_section (start, end); ++ offset = start - section->start; ++ list = find_abbrev_list_by_abbrev_offset (0, offset); ++ if (list == NULL) ++ { ++ list = new_abbrev_list (0, offset); ++ start = process_abbrev_set (start, end, list); ++ list->start_of_next_abbrevs = start; ++ } ++ else ++ start = list->start_of_next_abbrevs; + +- if (first_abbrev == NULL) ++ if (list->first_abbrev == NULL) + continue; + +- printf (_(" Number TAG (0x%lx)\n"), (long) (last - section->start)); ++ printf (_(" Number TAG (0x%lx)\n"), (long) offset); + +- for (entry = first_abbrev; entry; entry = entry->next) ++ for (entry = list->first_abbrev; entry; entry = entry->next) + { + abbrev_attr *attr; + + printf (" %ld %s [%s]\n", +- entry->entry, ++ entry->number, + get_TAG_name (entry->tag), + entry->children ? _("has children") : _("no children")); + +@@ -6013,7 +6354,9 @@ display_loclists_list (struct dwarf_sect + + SAFE_BYTE_GET_AND_INC (llet, start, 1, section_end); + +- if (vstart && llet == DW_LLE_offset_pair) ++ if (vstart && (llet == DW_LLE_offset_pair ++ || llet == DW_LLE_start_end ++ || llet == DW_LLE_start_length)) + { + off = offset + (vstart - *start_ptr); + +@@ -6034,7 +6377,18 @@ display_loclists_list (struct dwarf_sect + break; + case DW_LLE_offset_pair: + READ_ULEB (begin, start, section_end); ++ begin += base_address; ++ READ_ULEB (end, start, section_end); ++ end += base_address; ++ break; ++ case DW_LLE_start_end: ++ SAFE_BYTE_GET_AND_INC (begin, start, pointer_size, section_end); ++ SAFE_BYTE_GET_AND_INC (end, start, pointer_size, section_end); ++ break; ++ case DW_LLE_start_length: ++ SAFE_BYTE_GET_AND_INC (begin, start, pointer_size, section_end); + READ_ULEB (end, start, section_end); ++ end += begin; + break; + case DW_LLE_base_address: + SAFE_BYTE_GET_AND_INC (base_address, start, pointer_size, +@@ -6061,7 +6415,9 @@ display_loclists_list (struct dwarf_sect + } + if (llet == DW_LLE_end_of_list) + break; +- if (llet != DW_LLE_offset_pair) ++ if (llet != DW_LLE_offset_pair ++ && llet != DW_LLE_start_end ++ && llet != DW_LLE_start_length) + continue; + + if (start + 2 > section_end) +@@ -6073,8 +6429,8 @@ display_loclists_list (struct dwarf_sect + + READ_ULEB (length, start, section_end); + +- print_dwarf_vma (begin + base_address, pointer_size); +- print_dwarf_vma (end + base_address, pointer_size); ++ print_dwarf_vma (begin, pointer_size); ++ print_dwarf_vma (end, pointer_size); + + putchar ('('); + need_frame_base = decode_location_expression (start, +@@ -7082,8 +7438,15 @@ display_debug_rnglists_list (unsigned ch + if (rlet == DW_RLE_base_address) + continue; + +- print_dwarf_vma (begin + base_address, pointer_size); +- print_dwarf_vma (end + base_address, pointer_size); ++ /* Only a DW_RLE_offset_pair needs the base address added. */ ++ if (rlet == DW_RLE_offset_pair) ++ { ++ begin += base_address; ++ end += base_address; ++ } ++ ++ print_dwarf_vma (begin, pointer_size); ++ print_dwarf_vma (end, pointer_size); + + if (begin == end) + fputs (_("(start == end)"), stdout); +@@ -10747,8 +11110,12 @@ free_debug_memory (void) + { + unsigned int i; + +- free_abbrevs (); ++ free_all_abbrevs (); + ++ free (cu_abbrev_map); ++ cu_abbrev_map = NULL; ++ next_free_abbrev_map_entry = 0; ++ + for (i = 0; i < max; i++) + free_debug_section ((enum dwarf_section_display_enum) i); + +diff -rup binutils-2.35.1/binutils/readelf.c fred/binutils-2.35.1/binutils/readelf.c +--- binutils-2.35.1/binutils/readelf.c 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/binutils/readelf.c 2020-11-25 14:37:35.000000000 +0000 +@@ -12091,9 +12091,9 @@ print_dynamic_symbol (Filedata *filedata + int len_avail = 21; + if (! do_wide && version_string != NULL) + { +- char buffer[256]; ++ char buffer[16]; + +- len_avail -= sprintf (buffer, "@%s", version_string); ++ len_avail -= 1 + strlen (version_string); + + if (sym_info == symbol_undefined) + len_avail -= sprintf (buffer," (%d)", vna_other); +diff -rup binutils-2.35.1/binutils/testsuite/binutils-all/dw5.W fred/binutils-2.35.1/binutils/testsuite/binutils-all/dw5.W +--- binutils-2.35.1/binutils/testsuite/binutils-all/dw5.W 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/binutils/testsuite/binutils-all/dw5.W 2020-11-25 14:37:36.000000000 +0000 +@@ -3,6 +3,7 @@ Contents of the .debug_info section: + Compilation Unit @ offset 0x0: + Length: 0x160 \(32-bit\) + Version: 5 ++ Unit Type: DW_UT_compile \(1\) + Abbrev Offset: 0x0 + Pointer Size: 8 + <0>: Abbrev Number: 6 \(DW_TAG_compile_unit\) +diff -rup binutils-2.35.1/binutils/testsuite/binutils-all/dwarf-attributes.W fred/binutils-2.35.1/binutils/testsuite/binutils-all/dwarf-attributes.W +--- binutils-2.35.1/binutils/testsuite/binutils-all/dwarf-attributes.W 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/binutils/testsuite/binutils-all/dwarf-attributes.W 2020-11-25 14:37:36.000000000 +0000 +@@ -3,6 +3,7 @@ Contents of the .debug_info section: + Compilation Unit @ offset 0x0: + Length: 0x40 \(32-bit\) + Version: 5 ++ Unit Type: DW_UT_compile \(1\) + Abbrev Offset: 0x0 + Pointer Size: 4 + <0>: Abbrev Number: 1 \(User TAG value: 0x5555\) +diff -rup binutils-2.35.1/binutils/testsuite/binutils-all/x86-64/x86-64.exp fred/binutils-2.35.1/binutils/testsuite/binutils-all/x86-64/x86-64.exp +--- binutils-2.35.1/binutils/testsuite/binutils-all/x86-64/x86-64.exp 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/binutils/testsuite/binutils-all/x86-64/x86-64.exp 2020-11-25 14:37:37.000000000 +0000 +@@ -27,3 +27,34 @@ foreach t $test_list { + verbose [file rootname $t] + run_dump_test [file rootname $t] + } ++ ++set t $srcdir/$subdir/pr26808.dwp.bz2 ++# We need to strip the ".bz2", but can leave the dirname. ++set test $subdir/[file tail $t] ++set testname [file rootname $test] ++verbose $testname ++if {[catch "system \"bzip2 -dc $t > $tempfile\""] != 0} { ++ untested "bzip2 -dc ($testname)" ++} else { ++ send_log "$READELF -wi $tempfile > tmpdir/pr26808.out 2> /dev/null\n" ++ verbose "$READELF -wi $tempfile > tmpdir/pr26808.out 2> /dev/null" 1 ++ set got [catch "system \"$READELF -wi $tempfile > tmpdir/pr26808.out 2> /dev/null\""] ++ ++ if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]]} then { ++ fail $testname ++ } else { ++ send_log "cmp tmpdir/pr26808.out $srcdir/$subdir/pr26808.dump\n" ++ verbose "cmp tmpdir/pr26808.out $srcdir/$subdir/pr26808.dump" 1 ++ set status [remote_exec build cmp "tmpdir/pr26808.out $srcdir/$subdir/pr26808.dump"] ++ set exec_output [lindex $status 1] ++ set exec_output [prune_warnings $exec_output] ++ ++ if [string match "" $exec_output] then { ++ pass "readelf -wi ($testname)" ++ } else { ++ send_log "$exec_output\n" ++ verbose "$exec_output" 1 ++ fail "readelf -wi ($testname)" ++ } ++ } ++} +diff -rup binutils-2.35.1/elfcpp/dwarf.h fred/binutils-2.35.1/elfcpp/dwarf.h +--- binutils-2.35.1/elfcpp/dwarf.h 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/elfcpp/dwarf.h 2020-11-25 14:37:39.000000000 +0000 +@@ -81,6 +81,11 @@ namespace elfcpp + #define DW_IDX_DUP(name, value) , name = value + #define DW_END_IDX }; + ++#define DW_FIRST_UT(name, value) enum dwarf_unit_type { \ ++ name = value ++#define DW_UT(name, value) , name = value ++#define DW_END_UT }; ++ + #include "dwarf2.def" + + #undef DW_FIRST_TAG +@@ -117,6 +122,10 @@ namespace elfcpp + #undef DW_IDX_DUP + #undef DW_END_IDX + ++#undef DW_FIRST_UT ++#undef DW_UT ++#undef DW_END_UT ++ + // Frame unwind information. + + enum DW_EH_PE +diff -rup binutils-2.35.1/gas/config/tc-aarch64.c fred/binutils-2.35.1/gas/config/tc-aarch64.c +--- binutils-2.35.1/gas/config/tc-aarch64.c 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/config/tc-aarch64.c 2020-11-25 14:37:39.000000000 +0000 +@@ -250,12 +250,6 @@ set_fatal_syntax_error (const char *erro + typedef struct + { + const char *template; +- unsigned long value; +-} asm_barrier_opt; +- +-typedef struct +-{ +- const char *template; + uint32_t value; + } asm_nzcv; + +@@ -3994,7 +3988,7 @@ static int + parse_barrier (char **str) + { + char *p, *q; +- const asm_barrier_opt *o; ++ const struct aarch64_name_value_pair *o; + + p = q = *str; + while (ISALPHA (*q)) +@@ -8936,6 +8930,25 @@ static const struct aarch64_cpu_option_t + | AARCH64_FEATURE_DOTPROD + | AARCH64_FEATURE_PROFILE), + "Neoverse N1"}, ++ {"neoverse-n2", AARCH64_FEATURE (AARCH64_ARCH_V8_5, ++ AARCH64_FEATURE_BFLOAT16 ++ | AARCH64_FEATURE_I8MM ++ | AARCH64_FEATURE_F16 ++ | AARCH64_FEATURE_SVE ++ | AARCH64_FEATURE_SVE2 ++ | AARCH64_FEATURE_SVE2_BITPERM ++ | AARCH64_FEATURE_MEMTAG ++ | AARCH64_FEATURE_RNG), ++ "Neoverse N2"}, ++ {"neoverse-v1", AARCH64_FEATURE (AARCH64_ARCH_V8_4, ++ AARCH64_FEATURE_PROFILE ++ | AARCH64_FEATURE_CVADP ++ | AARCH64_FEATURE_SVE ++ | AARCH64_FEATURE_SSBS ++ | AARCH64_FEATURE_RNG ++ | AARCH64_FEATURE_F16 ++ | AARCH64_FEATURE_BFLOAT16 ++ | AARCH64_FEATURE_I8MM), "Neoverse V1"}, + {"qdf24xx", AARCH64_FEATURE (AARCH64_ARCH_V8, + AARCH64_FEATURE_CRC | AARCH64_FEATURE_CRYPTO + | AARCH64_FEATURE_RDMA), +diff -rup binutils-2.35.1/gas/config/tc-arm.c fred/binutils-2.35.1/gas/config/tc-arm.c +--- binutils-2.35.1/gas/config/tc-arm.c 2020-08-14 08:14:39.000000000 +0100 ++++ fred/binutils-2.35.1/gas/config/tc-arm.c 2020-11-25 14:37:39.000000000 +0000 +@@ -5936,7 +5936,15 @@ parse_address_main (char **str, int i, i + + if (skip_past_char (&p, '[') == FAIL) + { +- if (skip_past_char (&p, '=') == FAIL) ++ if (group_type == GROUP_MVE ++ && (reg = arm_reg_parse (&p, REG_TYPE_RN)) != FAIL) ++ { ++ /* [r0-r15] expected as argument but receiving r0-r15 without ++ [] brackets. */ ++ inst.error = BAD_SYNTAX; ++ return PARSE_OPERAND_FAIL; ++ } ++ else if (skip_past_char (&p, '=') == FAIL) + { + /* Bare address - translate to PC-relative offset. */ + inst.relocs[0].pc_rel = 1; +@@ -26506,14 +26514,14 @@ static const struct asm_opcode insns[] = + #define ARM_VARIANT & fpu_vfp_ext_v1 + #undef THUMB_VARIANT + #define THUMB_VARIANT & arm_ext_v6t2 +- mnCEF(vmla, _vmla, 3, (RNSDQMQ, oRNSDQMQ, RNSDQ_RNSC_MQ_RR), neon_mac_maybe_scalar), +- mnCEF(vmul, _vmul, 3, (RNSDQMQ, oRNSDQMQ, RNSDQ_RNSC_MQ_RR), neon_mul), + + mcCE(fcpyd, eb00b40, 2, (RVD, RVD), vfp_dp_rd_rm), + + #undef ARM_VARIANT + #define ARM_VARIANT & fpu_vfp_ext_v1xd + ++ mnCEF(vmla, _vmla, 3, (RNSDQMQ, oRNSDQMQ, RNSDQ_RNSC_MQ_RR), neon_mac_maybe_scalar), ++ mnCEF(vmul, _vmul, 3, (RNSDQMQ, oRNSDQMQ, RNSDQ_RNSC_MQ_RR), neon_mul), + MNCE(vmov, 0, 1, (VMOV), neon_mov), + mcCE(fmrs, e100a10, 2, (RR, RVS), vfp_reg_from_sp), + mcCE(fmsr, e000a10, 2, (RVS, RR), vfp_sp_from_reg), +@@ -31587,6 +31595,16 @@ static const struct arm_cpu_option_table + ARM_CPU_OPT ("neoverse-n1", "Neoverse N1", ARM_ARCH_V8_2A, + ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST), + FPU_ARCH_CRYPTO_NEON_VFP_ARMV8_DOTPROD), ++ ARM_CPU_OPT ("neoverse-n2", "Neoverse N2", ARM_ARCH_V8_5A, ++ ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST ++ | ARM_EXT2_BF16 ++ | ARM_EXT2_I8MM), ++ FPU_ARCH_CRYPTO_NEON_VFP_ARMV8_4), ++ ARM_CPU_OPT ("neoverse-v1", "Neoverse V1", ARM_ARCH_V8_4A, ++ ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST ++ | ARM_EXT2_BF16 ++ | ARM_EXT2_I8MM), ++ FPU_ARCH_CRYPTO_NEON_VFP_ARMV8_4), + /* ??? XSCALE is really an architecture. */ + ARM_CPU_OPT ("xscale", NULL, ARM_ARCH_XSCALE, + ARM_ARCH_NONE, +diff -rup binutils-2.35.1/gas/config/tc-i386.c fred/binutils-2.35.1/gas/config/tc-i386.c +--- binutils-2.35.1/gas/config/tc-i386.c 2020-08-10 08:20:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/config/tc-i386.c 2020-11-25 14:37:39.000000000 +0000 +@@ -7115,6 +7115,23 @@ process_suffix (void) + unsigned int op; + enum { need_word, need_dword, need_qword } need; + ++ /* Check the register operand for the address size prefix if ++ the memory operand has no real registers, like symbol, DISP ++ or symbol(%rip). */ ++ if (i.mem_operands == 1 ++ && i.reg_operands == 1 ++ && i.operands == 2 ++ && i.types[1].bitfield.class == Reg ++ && (flag_code == CODE_32BIT ++ ? i.op[1].regs->reg_type.bitfield.word ++ : i.op[1].regs->reg_type.bitfield.dword) ++ && ((i.base_reg == NULL && i.index_reg == NULL) ++ || (i.base_reg ++ && i.base_reg->reg_num == RegIP ++ && i.base_reg->reg_type.bitfield.qword)) ++ && !add_prefix (ADDR_PREFIX_OPCODE)) ++ return 0; ++ + if (flag_code == CODE_32BIT) + need = i.prefix[ADDR_PREFIX] ? need_word : need_dword; + else if (i.prefix[ADDR_PREFIX]) +diff -rup binutils-2.35.1/gas/config/tc-ppc.c fred/binutils-2.35.1/gas/config/tc-ppc.c +--- binutils-2.35.1/gas/config/tc-ppc.c 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/config/tc-ppc.c 2020-11-25 14:37:39.000000000 +0000 +@@ -3335,6 +3335,15 @@ md_assemble (char *str) + } + + insn = opcode->opcode; ++ if (!target_big_endian ++ && ((insn & ~(1 << 26)) == 46u << 26 ++ || (insn & ~(0xc0 << 1)) == (31u << 26 | 533 << 1))) ++ { ++ /* lmw, stmw, lswi, lswx, stswi, stswx */ ++ as_bad (_("`%s' invalid when little-endian"), str); ++ ppc_clear_labels (); ++ return; ++ } + + str = s; + while (ISSPACE (*str)) +diff -rup binutils-2.35.1/gas/doc/c-aarch64.texi fred/binutils-2.35.1/gas/doc/c-aarch64.texi +--- binutils-2.35.1/gas/doc/c-aarch64.texi 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/doc/c-aarch64.texi 2020-11-25 14:37:40.000000000 +0000 +@@ -72,6 +72,8 @@ on the target processor. The following + @code{exynos-m1}, + @code{falkor}, + @code{neoverse-n1}, ++@code{neoverse-n2}, ++@code{neoverse-v1}, + @code{neoverse-e1}, + @code{qdf24xx}, + @code{saphira}, +diff -rup binutils-2.35.1/gas/doc/c-arm.texi fred/binutils-2.35.1/gas/doc/c-arm.texi +--- binutils-2.35.1/gas/doc/c-arm.texi 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/doc/c-arm.texi 2020-11-25 14:37:40.000000000 +0000 +@@ -151,6 +151,8 @@ recognized: + @code{marvell-pj4}, + @code{marvell-whitney}, + @code{neoverse-n1}, ++@code{neoverse-n2}, ++@code{neoverse-v1}, + @code{xgene1}, + @code{xgene2}, + @code{ep9312} (ARM920 with Cirrus Maverick coprocessor), +diff -rup binutils-2.35.1/gas/dwarf2dbg.c fred/binutils-2.35.1/gas/dwarf2dbg.c +--- binutils-2.35.1/gas/dwarf2dbg.c 2020-09-15 09:11:49.000000000 +0100 ++++ fred/binutils-2.35.1/gas/dwarf2dbg.c 2020-11-25 14:37:39.000000000 +0000 +@@ -211,7 +211,6 @@ struct file_entry + { + const char * filename; + unsigned int dir; +- bfd_boolean auto_assigned; + unsigned char md5[NUM_MD5_BYTES]; + }; + +@@ -219,6 +218,7 @@ struct file_entry + static struct file_entry *files; + static unsigned int files_in_use; + static unsigned int files_allocated; ++static unsigned int num_of_auto_assigned; + + /* Table of directories used by .debug_line. */ + static char ** dirs = NULL; +@@ -633,7 +633,7 @@ get_directory_table_entry (const char * + } + + static bfd_boolean +-assign_file_to_slot (unsigned long i, const char *file, unsigned int dir, bfd_boolean auto_assign) ++assign_file_to_slot (unsigned long i, const char *file, unsigned int dir) + { + if (i >= files_allocated) + { +@@ -653,7 +653,6 @@ assign_file_to_slot (unsigned long i, co + + files[i].filename = file; + files[i].dir = dir; +- files[i].auto_assigned = auto_assign; + memset (files[i].md5, 0, NUM_MD5_BYTES); + + if (files_in_use < i + 1) +@@ -717,9 +716,11 @@ allocate_filenum (const char * pathname) + return i; + } + +- if (!assign_file_to_slot (i, file, dir, TRUE)) ++ if (!assign_file_to_slot (i, file, dir)) + return -1; + ++ num_of_auto_assigned++; ++ + last_used = i; + last_used_dir_len = dir_len; + +@@ -792,30 +793,15 @@ allocate_filename_to_slot (const char * + } + + fail: +- /* If NUM was previously allocated automatically then +- choose another slot for it, so that we can reuse NUM. */ +- if (files[num].auto_assigned) +- { +- /* Find an unused slot. */ +- for (i = 1; i < files_in_use; ++i) +- if (files[i].filename == NULL) +- break; +- if (! assign_file_to_slot (i, files[num].filename, files[num].dir, TRUE)) +- return FALSE; +- files[num].filename = NULL; +- } +- else +- { +- as_bad (_("file table slot %u is already occupied by a different file (%s%s%s vs %s%s%s)"), +- num, +- dir == NULL ? "" : dir, +- dir == NULL ? "" : "/", +- files[num].filename, +- dirname == NULL ? "" : dirname, +- dirname == NULL ? "" : "/", +- filename); +- return FALSE; +- } ++ as_bad (_("file table slot %u is already occupied by a different file (%s%s%s vs %s%s%s)"), ++ num, ++ dir == NULL ? "" : dir, ++ dir == NULL ? "" : "/", ++ files[num].filename, ++ dirname == NULL ? "" : dirname, ++ dirname == NULL ? "" : "/", ++ filename); ++ return FALSE; + } + + if (dirname == NULL) +@@ -833,7 +819,7 @@ allocate_filename_to_slot (const char * + d = get_directory_table_entry (dirname, dirlen, num == 0); + i = num; + +- if (! assign_file_to_slot (i, file, d, FALSE)) ++ if (! assign_file_to_slot (i, file, d)) + return FALSE; + + if (with_md5) +@@ -1030,6 +1016,7 @@ dwarf2_directive_filename (void) + char *filename; + const char * dirname = NULL; + int filename_len; ++ unsigned int i; + + /* Continue to accept a bare string and pass it off. */ + SKIP_WHITESPACE (); +@@ -1096,6 +1083,18 @@ dwarf2_directive_filename (void) + return NULL; + } + ++ if (num_of_auto_assigned) ++ { ++ /* Clear slots auto-assigned before the first .file ++ directive was seen. */ ++ if (files_in_use != (num_of_auto_assigned + 1)) ++ abort (); ++ for (i = 1; i < files_in_use; i++) ++ files[i].filename = NULL; ++ files_in_use = 0; ++ num_of_auto_assigned = 0; ++ } ++ + if (! allocate_filename_to_slot (dirname, filename, (unsigned int) num, + with_md5)) + return NULL; +diff -rup binutils-2.35.1/gas/testsuite/gas/aarch64/system.d fred/binutils-2.35.1/gas/testsuite/gas/aarch64/system.d +--- binutils-2.35.1/gas/testsuite/gas/aarch64/system.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/aarch64/system.d 2020-11-25 14:37:40.000000000 +0000 +@@ -190,6 +190,7 @@ Disassembly of section \.text: + .*: d5033edf isb #0xe + .*: d5033fdf isb + .*: d5033fdf isb ++.*: d5033fdf isb + .*: d503309f ssbb + .*: d503349f pssbb + .*: d8000000 prfm pldl1keep, 0 +diff -rup binutils-2.35.1/gas/testsuite/gas/aarch64/system.s fred/binutils-2.35.1/gas/testsuite/gas/aarch64/system.s +--- binutils-2.35.1/gas/testsuite/gas/aarch64/system.s 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/aarch64/system.s 2020-11-25 14:37:40.000000000 +0000 +@@ -44,6 +44,7 @@ + all_barriers op=isb, from=0, to=15 + + isb ++ isb sy + ssbb + pssbb + +diff -rup binutils-2.35.1/gas/testsuite/gas/elf/dwarf-5-cu.d fred/binutils-2.35.1/gas/testsuite/gas/elf/dwarf-5-cu.d +--- binutils-2.35.1/gas/testsuite/gas/elf/dwarf-5-cu.d 2020-08-25 11:21:34.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/elf/dwarf-5-cu.d 2020-11-25 14:37:42.000000000 +0000 +@@ -6,6 +6,7 @@ + Compilation Unit @ offset 0x0: + Length: 0x.* + Version: 5 ++ Unit Type: DW_UT_compile \(1\) + Abbrev Offset: 0x0 + Pointer Size: . + #pass +diff -rup binutils-2.35.1/gas/testsuite/gas/i386/enqcmd-intel.d fred/binutils-2.35.1/gas/testsuite/gas/i386/enqcmd-intel.d +--- binutils-2.35.1/gas/testsuite/gas/i386/enqcmd-intel.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/i386/enqcmd-intel.d 2020-11-25 14:37:42.000000000 +0000 +@@ -8,13 +8,21 @@ + + Disassembly of section \.text: + +-00000000 <_start>: +-[ ]*[a-f0-9]+:[ ]*f2 0f 38 f8 01[ ]*enqcmd eax,\[ecx\] +-[ ]*[a-f0-9]+:[ ]*67 f2 0f 38 f8 04[ ]*enqcmd ax,\[si\] +-[ ]*[a-f0-9]+:[ ]*f3 0f 38 f8 01[ ]*enqcmds eax,\[ecx\] +-[ ]*[a-f0-9]+:[ ]*67 f3 0f 38 f8 04[ ]*enqcmds ax,\[si\] +-[ ]*[a-f0-9]+:[ ]*f2 0f 38 f8 01[ ]*enqcmd eax,\[ecx\] +-[ ]*[a-f0-9]+:[ ]*67 f2 0f 38 f8 04[ ]*enqcmd ax,\[si\] +-[ ]*[a-f0-9]+:[ ]*f3 0f 38 f8 01[ ]*enqcmds eax,\[ecx\] +-[ ]*[a-f0-9]+:[ ]*67 f3 0f 38 f8 04[ ]*enqcmds ax,\[si\] ++0+ <_start>: ++ +[a-f0-9]+: f2 0f 38 f8 01 enqcmd eax,\[ecx\] ++ +[a-f0-9]+: 67 f2 0f 38 f8 04 enqcmd ax,\[si\] ++ +[a-f0-9]+: f3 0f 38 f8 01 enqcmds eax,\[ecx\] ++ +[a-f0-9]+: 67 f3 0f 38 f8 04 enqcmds ax,\[si\] ++ +[a-f0-9]+: 67 f2 0f 38 f8 0e 00 00 enqcmd cx,ds:0x0 ++ +[a-f0-9]+: 67 f2 0f 38 f8 0e 34 12 enqcmd cx,ds:0x1234 ++ +[a-f0-9]+: 67 f3 0f 38 f8 0e 00 00 enqcmds cx,ds:0x0 ++ +[a-f0-9]+: 67 f3 0f 38 f8 0e 34 12 enqcmds cx,ds:0x1234 ++ +[a-f0-9]+: f2 0f 38 f8 01 enqcmd eax,\[ecx\] ++ +[a-f0-9]+: 67 f2 0f 38 f8 04 enqcmd ax,\[si\] ++ +[a-f0-9]+: f3 0f 38 f8 01 enqcmds eax,\[ecx\] ++ +[a-f0-9]+: 67 f3 0f 38 f8 04 enqcmds ax,\[si\] ++ +[a-f0-9]+: 67 f2 0f 38 f8 0e 00 00 enqcmd cx,ds:0x0 ++ +[a-f0-9]+: 67 f2 0f 38 f8 0e 34 12 enqcmd cx,ds:0x1234 ++ +[a-f0-9]+: 67 f3 0f 38 f8 0e 00 00 enqcmds cx,ds:0x0 ++ +[a-f0-9]+: 67 f3 0f 38 f8 0e 34 12 enqcmds cx,ds:0x1234 + #pass +diff -rup binutils-2.35.1/gas/testsuite/gas/i386/enqcmd.d fred/binutils-2.35.1/gas/testsuite/gas/i386/enqcmd.d +--- binutils-2.35.1/gas/testsuite/gas/i386/enqcmd.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/i386/enqcmd.d 2020-11-25 14:37:42.000000000 +0000 +@@ -8,13 +8,21 @@ + + Disassembly of section \.text: + +-00000000 <_start>: +-[ ]*[a-f0-9]+:[ ]*f2 0f 38 f8 01[ ]*enqcmd \(%ecx\),%eax +-[ ]*[a-f0-9]+:[ ]*67 f2 0f 38 f8 04[ ]*enqcmd \(%si\),%ax +-[ ]*[a-f0-9]+:[ ]*f3 0f 38 f8 01[ ]*enqcmds \(%ecx\),%eax +-[ ]*[a-f0-9]+:[ ]*67 f3 0f 38 f8 04[ ]*enqcmds \(%si\),%ax +-[ ]*[a-f0-9]+:[ ]*f2 0f 38 f8 01[ ]*enqcmd \(%ecx\),%eax +-[ ]*[a-f0-9]+:[ ]*67 f2 0f 38 f8 04[ ]*enqcmd \(%si\),%ax +-[ ]*[a-f0-9]+:[ ]*f3 0f 38 f8 01[ ]*enqcmds \(%ecx\),%eax +-[ ]*[a-f0-9]+:[ ]*67 f3 0f 38 f8 04[ ]*enqcmds \(%si\),%ax ++0+ <_start>: ++ +[a-f0-9]+: f2 0f 38 f8 01 enqcmd \(%ecx\),%eax ++ +[a-f0-9]+: 67 f2 0f 38 f8 04 enqcmd \(%si\),%ax ++ +[a-f0-9]+: f3 0f 38 f8 01 enqcmds \(%ecx\),%eax ++ +[a-f0-9]+: 67 f3 0f 38 f8 04 enqcmds \(%si\),%ax ++ +[a-f0-9]+: 67 f2 0f 38 f8 0e 00 00 enqcmd 0x0,%cx ++ +[a-f0-9]+: 67 f2 0f 38 f8 0e 34 12 enqcmd 0x1234,%cx ++ +[a-f0-9]+: 67 f3 0f 38 f8 0e 00 00 enqcmds 0x0,%cx ++ +[a-f0-9]+: 67 f3 0f 38 f8 0e 34 12 enqcmds 0x1234,%cx ++ +[a-f0-9]+: f2 0f 38 f8 01 enqcmd \(%ecx\),%eax ++ +[a-f0-9]+: 67 f2 0f 38 f8 04 enqcmd \(%si\),%ax ++ +[a-f0-9]+: f3 0f 38 f8 01 enqcmds \(%ecx\),%eax ++ +[a-f0-9]+: 67 f3 0f 38 f8 04 enqcmds \(%si\),%ax ++ +[a-f0-9]+: 67 f2 0f 38 f8 0e 00 00 enqcmd 0x0,%cx ++ +[a-f0-9]+: 67 f2 0f 38 f8 0e 34 12 enqcmd 0x1234,%cx ++ +[a-f0-9]+: 67 f3 0f 38 f8 0e 00 00 enqcmds 0x0,%cx ++ +[a-f0-9]+: 67 f3 0f 38 f8 0e 34 12 enqcmds 0x1234,%cx + #pass +diff -rup binutils-2.35.1/gas/testsuite/gas/i386/enqcmd.s fred/binutils-2.35.1/gas/testsuite/gas/i386/enqcmd.s +--- binutils-2.35.1/gas/testsuite/gas/i386/enqcmd.s 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/i386/enqcmd.s 2020-11-25 14:37:42.000000000 +0000 +@@ -7,9 +7,17 @@ _start: + enqcmd (%si),%ax + enqcmds (%ecx),%eax + enqcmds (%si),%ax ++ enqcmd foo, %cx ++ enqcmd 0x1234, %cx ++ enqcmds foo, %cx ++ enqcmds 0x1234, %cx + + .intel_syntax noprefix + enqcmd eax,[ecx] + enqcmd ax,[si] + enqcmds eax,[ecx] + enqcmds ax,[si] ++ enqcmd cx,ds:foo ++ enqcmd cx,ds:0x1234 ++ enqcmds cx,ds:foo ++ enqcmds cx,ds:0x1234 +diff -rup binutils-2.35.1/gas/testsuite/gas/i386/evex-no-scale-64.d fred/binutils-2.35.1/gas/testsuite/gas/i386/evex-no-scale-64.d +--- binutils-2.35.1/gas/testsuite/gas/i386/evex-no-scale-64.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/i386/evex-no-scale-64.d 2020-11-25 14:37:42.000000000 +0000 +@@ -10,5 +10,5 @@ Disassembly of section .text: + +[a-f0-9]+: 62 f1 7c 48 28 04 05 40 00 00 00 vmovaps 0x40\(,%rax,1\),%zmm0 + +[a-f0-9]+: 62 f1 7c 48 28 04 25 40 00 00 00 vmovaps 0x40,%zmm0 + +[a-f0-9]+: 67 62 f1 7c 48 28 04 05 40 00 00 00 vmovaps 0x40\(,%eax,1\),%zmm0 +- +[a-f0-9]+: 67 62 f1 7c 48 28 04 25 40 00 00 00 vmovaps 0x40,%zmm0 ++ +[a-f0-9]+: 67 62 f1 7c 48 28 04 25 40 00 00 00 vmovaps 0x40\(,%eiz,1\),%zmm0 + +[a-f0-9]+: 62 f1 7c 48 28 04 25 40 00 00 00 vmovaps 0x40,%zmm0 +diff -rup binutils-2.35.1/gas/testsuite/gas/i386/i386.exp fred/binutils-2.35.1/gas/testsuite/gas/i386/i386.exp +--- binutils-2.35.1/gas/testsuite/gas/i386/i386.exp 2020-09-15 09:11:49.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/i386/i386.exp 2020-11-25 14:37:42.000000000 +0000 +@@ -475,9 +475,11 @@ if [expr ([istarget "i*86-*-*"] || [ist + run_dump_test "cldemote-intel" + run_dump_test "movdir" + run_dump_test "movdir-intel" ++ run_dump_test "movdir-16bit" + run_list_test "movdir64b-reg" + run_dump_test "enqcmd" + run_dump_test "enqcmd-intel" ++ run_dump_test "enqcmd-16bit" + run_list_test "enqcmd-inval" + run_dump_test "serialize" + run_dump_test "tsxldtrk" +@@ -594,6 +596,10 @@ if [expr ([istarget "i*86-*-*"] || [ist + run_dump_test "dwarf2-line-2" + run_dump_test "dwarf2-line-3" + run_dump_test "dwarf2-line-4" ++ run_dump_test "dwarf4-line-1" ++ run_dump_test "dwarf5-line-1" ++ run_dump_test "dwarf5-line-2" ++ run_dump_test "dwarf5-line-3" + + run_dump_test "dw2-compress-2" + run_dump_test "dw2-compressed-2" +diff -rup binutils-2.35.1/gas/testsuite/gas/i386/movdir-intel.d fred/binutils-2.35.1/gas/testsuite/gas/i386/movdir-intel.d +--- binutils-2.35.1/gas/testsuite/gas/i386/movdir-intel.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/i386/movdir-intel.d 2020-11-25 14:37:42.000000000 +0000 +@@ -8,19 +8,16 @@ + + Disassembly of section \.text: + +-00000000 <_start>: +-[ ]*[a-f0-9]+:[ ]*0f 38 f9 01[ ]*movdiri DWORD PTR \[ecx\],eax +-[ ]*[a-f0-9]+:[ ]*66 0f 38 f8 01[ ]*movdir64b eax,\[ecx\] +-[ ]*[a-f0-9]+:[ ]*67 66 0f 38 f8 04[ ]*movdir64b ax,\[si\] +-[ ]*[a-f0-9]+:[ ]*0f 38 f9 01[ ]*movdiri DWORD PTR \[ecx\],eax +-[ ]*[a-f0-9]+:[ ]*0f 38 f9 01[ ]*movdiri DWORD PTR \[ecx\],eax +-[ ]*[a-f0-9]+:[ ]*66 0f 38 f8 01[ ]*movdir64b eax,\[ecx\] +-[ ]*[a-f0-9]+:[ ]*67 66 0f 38 f8 04[ ]*movdir64b ax,\[si\] +-[ ]*[a-f0-9]+:[ ]*67 0f 38 f9 01[ ]*movdiri DWORD PTR \[bx\+di\],eax +-[ ]*[a-f0-9]+:[ ]*67 66 0f 38 f8 01[ ]*movdir64b ax,\[bx\+di\] +-[ ]*[a-f0-9]+:[ ]*66 0f 38 f8 04 67[ ]*movdir64b eax,\[edi\+eiz\*2\] +-[ ]*[a-f0-9]+:[ ]*0f 38 f9 01[ ]*movdiri DWORD PTR \[ecx\],eax +-[ ]*[a-f0-9]+:[ ]*67 0f 38 f9 01[ ]*movdiri DWORD PTR \[bx\+di\],eax +-[ ]*[a-f0-9]+:[ ]*67 66 0f 38 f8 01[ ]*movdir64b ax,\[bx\+di\] +-[ ]*[a-f0-9]+:[ ]*66 0f 38 f8 04 90[ ]*movdir64b eax,\[eax\+edx\*4\] ++0+ <_start>: ++ +[a-f0-9]+: 0f 38 f9 01 movdiri DWORD PTR \[ecx\],eax ++ +[a-f0-9]+: 66 0f 38 f8 01 movdir64b eax,\[ecx\] ++ +[a-f0-9]+: 67 66 0f 38 f8 04 movdir64b ax,\[si\] ++ +[a-f0-9]+: 67 66 0f 38 f8 0e 00 00 movdir64b cx,ds:0x0 ++ +[a-f0-9]+: 67 66 0f 38 f8 0e 34 12 movdir64b cx,ds:0x1234 ++ +[a-f0-9]+: 0f 38 f9 01 movdiri DWORD PTR \[ecx\],eax ++ +[a-f0-9]+: 0f 38 f9 01 movdiri DWORD PTR \[ecx\],eax ++ +[a-f0-9]+: 66 0f 38 f8 01 movdir64b eax,\[ecx\] ++ +[a-f0-9]+: 67 66 0f 38 f8 04 movdir64b ax,\[si\] ++ +[a-f0-9]+: 67 66 0f 38 f8 0e 00 00 movdir64b cx,ds:0x0 ++ +[a-f0-9]+: 67 66 0f 38 f8 0e 34 12 movdir64b cx,ds:0x1234 + #pass +diff -rup binutils-2.35.1/gas/testsuite/gas/i386/movdir.d fred/binutils-2.35.1/gas/testsuite/gas/i386/movdir.d +--- binutils-2.35.1/gas/testsuite/gas/i386/movdir.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/i386/movdir.d 2020-11-25 14:37:42.000000000 +0000 +@@ -8,19 +8,16 @@ + + Disassembly of section \.text: + +-00000000 <_start>: +-[ ]*[a-f0-9]+:[ ]*0f 38 f9 01[ ]*movdiri %eax,\(%ecx\) +-[ ]*[a-f0-9]+:[ ]*66 0f 38 f8 01[ ]*movdir64b \(%ecx\),%eax +-[ ]*[a-f0-9]+:[ ]*67 66 0f 38 f8 04[ ]*movdir64b \(%si\),%ax +-[ ]*[a-f0-9]+:[ ]*0f 38 f9 01[ ]*movdiri %eax,\(%ecx\) +-[ ]*[a-f0-9]+:[ ]*0f 38 f9 01[ ]*movdiri %eax,\(%ecx\) +-[ ]*[a-f0-9]+:[ ]*66 0f 38 f8 01[ ]*movdir64b \(%ecx\),%eax +-[ ]*[a-f0-9]+:[ ]*67 66 0f 38 f8 04[ ]*movdir64b \(%si\),%ax +-[ ]*[a-f0-9]+:[ ]*67 0f 38 f9 01[ ]*movdiri %eax,\(%bx,%di\) +-[ ]*[a-f0-9]+:[ ]*67 66 0f 38 f8 01[ ]*movdir64b \(%bx,%di\),%ax +-[ ]*[a-f0-9]+:[ ]*66 0f 38 f8 04 67[ ]*movdir64b \(%edi,%eiz,2\),%eax +-[ ]*[a-f0-9]+:[ ]*0f 38 f9 01[ ]*movdiri %eax,\(%ecx\) +-[ ]*[a-f0-9]+:[ ]*67 0f 38 f9 01[ ]*movdiri %eax,\(%bx,%di\) +-[ ]*[a-f0-9]+:[ ]*67 66 0f 38 f8 01[ ]*movdir64b \(%bx,%di\),%ax +-[ ]*[a-f0-9]+:[ ]*66 0f 38 f8 04 90[ ]*movdir64b \(%eax,%edx,4\),%eax ++0+ <_start>: ++ +[a-f0-9]+: 0f 38 f9 01 movdiri %eax,\(%ecx\) ++ +[a-f0-9]+: 66 0f 38 f8 01 movdir64b \(%ecx\),%eax ++ +[a-f0-9]+: 67 66 0f 38 f8 04 movdir64b \(%si\),%ax ++ +[a-f0-9]+: 67 66 0f 38 f8 0e 00 00 movdir64b 0x0,%cx ++ +[a-f0-9]+: 67 66 0f 38 f8 0e 34 12 movdir64b 0x1234,%cx ++ +[a-f0-9]+: 0f 38 f9 01 movdiri %eax,\(%ecx\) ++ +[a-f0-9]+: 0f 38 f9 01 movdiri %eax,\(%ecx\) ++ +[a-f0-9]+: 66 0f 38 f8 01 movdir64b \(%ecx\),%eax ++ +[a-f0-9]+: 67 66 0f 38 f8 04 movdir64b \(%si\),%ax ++ +[a-f0-9]+: 67 66 0f 38 f8 0e 00 00 movdir64b 0x0,%cx ++ +[a-f0-9]+: 67 66 0f 38 f8 0e 34 12 movdir64b 0x1234,%cx + #pass +diff -rup binutils-2.35.1/gas/testsuite/gas/i386/movdir.s fred/binutils-2.35.1/gas/testsuite/gas/i386/movdir.s +--- binutils-2.35.1/gas/testsuite/gas/i386/movdir.s 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/i386/movdir.s 2020-11-25 14:37:42.000000000 +0000 +@@ -3,19 +3,16 @@ + .allow_index_reg + .text + _start: +- .rept 2 + movdiri %eax, (%ecx) + movdir64b (%ecx),%eax + movdir64b (%si),%ax ++ movdir64b foo, %cx ++ movdir64b 0x1234, %cx + + .intel_syntax noprefix + movdiri [ecx], eax + movdiri dword ptr [ecx], eax + movdir64b eax,[ecx] + movdir64b ax,[si] +- +- .att_syntax prefix +- .code16 +- .endr +- +- nop ++ movdir64b cx,ds:foo ++ movdir64b cx,ds:0x1234 +diff -rup binutils-2.35.1/gas/testsuite/gas/i386/x86-64-addr32-intel.d fred/binutils-2.35.1/gas/testsuite/gas/i386/x86-64-addr32-intel.d +--- binutils-2.35.1/gas/testsuite/gas/i386/x86-64-addr32-intel.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/i386/x86-64-addr32-intel.d 2020-11-25 14:37:42.000000000 +0000 +@@ -11,15 +11,15 @@ Disassembly of section .text: + [ ]*[a-f0-9]+: 67 48 8d 80 00 00 00 00[ ]+lea[ ]+rax,\[eax\+0x0\].* + [ ]*[a-f0-9]+: 67 49 8d 80 00 00 00 00[ ]+lea[ ]+rax,\[r8d\+0x0\].* + [ ]*[a-f0-9]+: 67 48 8d 05 00 00 00 00[ ]+lea[ ]+rax,\[eip\+0x0\].* +-[ ]*[a-f0-9]+: 67 48 8d 04 25 00 00 00 00 lea[ ]+rax,ds:0x0 .* ++[ ]*[a-f0-9]+: 67 48 8d 04 25 00 00 00 00 lea[ ]+rax,\[eiz\*1\+0x0\].* + [ ]*[a-f0-9]+: 67 a0 98 08 60 00 addr32 mov al,ds:0x600898 + [ ]*[a-f0-9]+: 67 66 a1 98 08 60 00 addr32 mov ax,ds:0x600898 + [ ]*[a-f0-9]+: 67 a1 98 08 60 00 addr32 mov eax,ds:0x600898 + [ ]*[a-f0-9]+: 67 48 a1 98 08 60 00 addr32 mov rax,ds:0x600898 + [ ]*[a-f0-9]+: 67 48 a1 98 08 80 00 addr32 mov rax,ds:0x800898 +-[ ]*[a-f0-9]+: 67 48 8b 1c 25 98 08 80 00 mov[ ]+rbx,QWORD PTR ds:0x800898 ++[ ]*[a-f0-9]+: 67 48 8b 1c 25 98 08 80 00 mov[ ]+rbx,QWORD PTR \[eiz\*1\+0x800898\] + [ ]*[a-f0-9]+: 67 48 a1 ef cd ab 89 addr32 mov rax,ds:0x89abcdef +-[ ]*[a-f0-9]+: 67 48 8b 1c 25 ef cd ab 89 mov[ ]+rbx,QWORD PTR ds:0x89abcdef ++[ ]*[a-f0-9]+: 67 48 8b 1c 25 ef cd ab 89 mov[ ]+rbx,QWORD PTR \[eiz\*1\+0x89abcdef\] + [ ]*[a-f0-9]+: 67 48 b8 ef cd ab 89 00 00 00 00 addr32 movabs rax,0x89abcdef + [ ]*[a-f0-9]+: 67 48 bb ef cd ab 89 00 00 00 00 addr32 movabs rbx,0x89abcdef + [ ]*[a-f0-9]+: 67 a2 98 08 60 00 addr32 mov ds:0x600898,al +@@ -27,9 +27,9 @@ Disassembly of section .text: + [ ]*[a-f0-9]+: 67 a3 98 08 60 00 addr32 mov ds:0x600898,eax + [ ]*[a-f0-9]+: 67 48 a3 98 08 60 00 addr32 mov ds:0x600898,rax + [ ]*[a-f0-9]+: 67 48 a3 98 08 80 00 addr32 mov ds:0x800898,rax +-[ ]*[a-f0-9]+: 67 48 89 1c 25 98 08 80 00 mov[ ]+QWORD PTR ds:0x800898,rbx ++[ ]*[a-f0-9]+: 67 48 89 1c 25 98 08 80 00 mov[ ]+QWORD PTR \[eiz\*1\+0x800898\],rbx + [ ]*[a-f0-9]+: 67 48 a3 ef cd ab 89 addr32 mov ds:0x89abcdef,rax +-[ ]*[a-f0-9]+: 67 48 89 1c 25 ef cd ab 89 mov[ ]+QWORD PTR ds:0x89abcdef,rbx +-[ ]*[a-f0-9]+: 67 89 04 25 11 22 33 ff mov[ ]+DWORD PTR ds:0xff332211,eax ++[ ]*[a-f0-9]+: 67 48 89 1c 25 ef cd ab 89 mov[ ]+QWORD PTR \[eiz\*1\+0x89abcdef\],rbx ++[ ]*[a-f0-9]+: 67 89 04 25 11 22 33 ff mov[ ]+DWORD PTR \[eiz\*1\+0xff332211\],eax + [ ]*[a-f0-9]+: 67 89 04 65 11 22 33 ff mov[ ]+DWORD PTR \[eiz\*2\+0xff332211\],eax + #pass +diff -rup binutils-2.35.1/gas/testsuite/gas/i386/x86-64-addr32.d fred/binutils-2.35.1/gas/testsuite/gas/i386/x86-64-addr32.d +--- binutils-2.35.1/gas/testsuite/gas/i386/x86-64-addr32.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/i386/x86-64-addr32.d 2020-11-25 14:37:42.000000000 +0000 +@@ -10,15 +10,15 @@ Disassembly of section .text: + [ ]*[a-f0-9]+: 67 48 8d 80 00 00 00 00[ ]+lea[ ]+0x0\(%eax\),%rax.* + [ ]*[a-f0-9]+: 67 49 8d 80 00 00 00 00[ ]+lea[ ]+0x0\(%r8d\),%rax.* + [ ]*[a-f0-9]+: 67 48 8d 05 00 00 00 00[ ]+lea[ ]+0x0\(%eip\),%rax.* +-[ ]*[a-f0-9]+: 67 48 8d 04 25 00 00 00 00[ ]+lea[ ]+0x0,%rax.* ++[ ]*[a-f0-9]+: 67 48 8d 04 25 00 00 00 00[ ]+lea[ ]+0x0\(,%eiz,1\),%rax.* + [ ]*[a-f0-9]+: 67 a0 98 08 60 00 addr32 mov 0x600898,%al + [ ]*[a-f0-9]+: 67 66 a1 98 08 60 00 addr32 mov 0x600898,%ax + [ ]*[a-f0-9]+: 67 a1 98 08 60 00 addr32 mov 0x600898,%eax + [ ]*[a-f0-9]+: 67 48 a1 98 08 60 00 addr32 mov 0x600898,%rax + [ ]*[a-f0-9]+: 67 48 a1 98 08 80 00 addr32 mov 0x800898,%rax +-[ ]*[a-f0-9]+: 67 48 8b 1c 25 98 08 80 00 mov[ ]+0x800898,%rbx ++[ ]*[a-f0-9]+: 67 48 8b 1c 25 98 08 80 00 mov[ ]+0x800898\(,%eiz,1\),%rbx + [ ]*[a-f0-9]+: 67 48 a1 ef cd ab 89 addr32 mov 0x89abcdef,%rax +-[ ]*[a-f0-9]+: 67 48 8b 1c 25 ef cd ab 89 mov[ ]+0x89abcdef,%rbx ++[ ]*[a-f0-9]+: 67 48 8b 1c 25 ef cd ab 89 mov[ ]+0x89abcdef\(,%eiz,1\),%rbx + [ ]*[a-f0-9]+: 67 48 b8 ef cd ab 89 00 00 00 00 addr32 movabs \$0x89abcdef,%rax + [ ]*[a-f0-9]+: 67 48 bb ef cd ab 89 00 00 00 00 addr32 movabs \$0x89abcdef,%rbx + [ ]*[a-f0-9]+: 67 a2 98 08 60 00 addr32 mov %al,0x600898 +@@ -26,9 +26,9 @@ Disassembly of section .text: + [ ]*[a-f0-9]+: 67 a3 98 08 60 00 addr32 mov %eax,0x600898 + [ ]*[a-f0-9]+: 67 48 a3 98 08 60 00 addr32 mov %rax,0x600898 + [ ]*[a-f0-9]+: 67 48 a3 98 08 80 00 addr32 mov %rax,0x800898 +-[ ]*[a-f0-9]+: 67 48 89 1c 25 98 08 80 00 mov[ ]+%rbx,0x800898 ++[ ]*[a-f0-9]+: 67 48 89 1c 25 98 08 80 00 mov[ ]+%rbx,0x800898\(,%eiz,1\) + [ ]*[a-f0-9]+: 67 48 a3 ef cd ab 89 addr32 mov %rax,0x89abcdef +-[ ]*[a-f0-9]+: 67 48 89 1c 25 ef cd ab 89 mov[ ]+%rbx,0x89abcdef +-[ ]*[a-f0-9]+: 67 89 04 25 11 22 33 ff mov[ ]+%eax,0xff332211 ++[ ]*[a-f0-9]+: 67 48 89 1c 25 ef cd ab 89 mov[ ]+%rbx,0x89abcdef\(,%eiz,1\) ++[ ]*[a-f0-9]+: 67 89 04 25 11 22 33 ff mov[ ]+%eax,0xff332211\(,%eiz,1\) + [ ]*[a-f0-9]+: 67 89 04 65 11 22 33 ff mov[ ]+%eax,0xff332211\(,%eiz,2\) + #pass +diff -rup binutils-2.35.1/gas/testsuite/gas/i386/x86-64-enqcmd-intel.d fred/binutils-2.35.1/gas/testsuite/gas/i386/x86-64-enqcmd-intel.d +--- binutils-2.35.1/gas/testsuite/gas/i386/x86-64-enqcmd-intel.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/i386/x86-64-enqcmd-intel.d 2020-11-25 14:37:42.000000000 +0000 +@@ -9,12 +9,32 @@ + Disassembly of section \.text: + + 0+ <_start>: +-[ ]*[a-f0-9]+:[ ]*f2 0f 38 f8 01[ ]*enqcmd rax,\[rcx\] +-[ ]*[a-f0-9]+:[ ]*67 f2 0f 38 f8 01[ ]*enqcmd eax,\[ecx\] +-[ ]*[a-f0-9]+:[ ]*f3 0f 38 f8 01[ ]*enqcmds rax,\[rcx\] +-[ ]*[a-f0-9]+:[ ]*67 f3 0f 38 f8 01[ ]*enqcmds eax,\[ecx\] +-[ ]*[a-f0-9]+:[ ]*f2 0f 38 f8 01[ ]*enqcmd rax,\[rcx\] +-[ ]*[a-f0-9]+:[ ]*67 f2 0f 38 f8 01[ ]*enqcmd eax,\[ecx\] +-[ ]*[a-f0-9]+:[ ]*f3 0f 38 f8 01[ ]*enqcmds rax,\[rcx\] +-[ ]*[a-f0-9]+:[ ]*67 f3 0f 38 f8 01[ ]*enqcmds eax,\[ecx\] ++ +[a-f0-9]+: f2 0f 38 f8 01 enqcmd rax,\[rcx\] ++ +[a-f0-9]+: 67 f2 0f 38 f8 01 enqcmd eax,\[ecx\] ++ +[a-f0-9]+: f3 0f 38 f8 01 enqcmds rax,\[rcx\] ++ +[a-f0-9]+: 67 f3 0f 38 f8 01 enqcmds eax,\[ecx\] ++ +[a-f0-9]+: f2 0f 38 f8 0d 00 00 00 00 enqcmd rcx,\[rip\+0x0\] #.* ++ +[a-f0-9]+: 67 f2 0f 38 f8 0d 00 00 00 00 enqcmd ecx,\[eip\+0x0\] #.* ++ +[a-f0-9]+: 67 f2 0f 38 f8 0d 00 00 00 00 enqcmd ecx,\[eip\+0x0\] #.* ++ +[a-f0-9]+: f3 0f 38 f8 0d 00 00 00 00 enqcmds rcx,\[rip\+0x0\] #.* ++ +[a-f0-9]+: 67 f3 0f 38 f8 0d 00 00 00 00 enqcmds ecx,\[eip\+0x0\] #.* ++ +[a-f0-9]+: 67 f3 0f 38 f8 0d 00 00 00 00 enqcmds ecx,\[eip\+0x0\] #.* ++ +[a-f0-9]+: 67 f2 0f 38 f8 0c 25 00 00 00 00 enqcmd ecx,\[eiz\*1\+0x0\] ++ +[a-f0-9]+: 67 f2 0f 38 f8 0c 25 78 56 34 12 enqcmd ecx,\[eiz\*1\+0x12345678\] ++ +[a-f0-9]+: 67 f3 0f 38 f8 0c 25 00 00 00 00 enqcmds ecx,\[eiz\*1\+0x0\] ++ +[a-f0-9]+: 67 f3 0f 38 f8 0c 25 78 56 34 12 enqcmds ecx,\[eiz\*1\+0x12345678\] ++ +[a-f0-9]+: f2 0f 38 f8 01 enqcmd rax,\[rcx\] ++ +[a-f0-9]+: 67 f2 0f 38 f8 01 enqcmd eax,\[ecx\] ++ +[a-f0-9]+: f3 0f 38 f8 01 enqcmds rax,\[rcx\] ++ +[a-f0-9]+: 67 f3 0f 38 f8 01 enqcmds eax,\[ecx\] ++ +[a-f0-9]+: f2 0f 38 f8 0d 00 00 00 00 enqcmd rcx,\[rip\+0x0\] #.* ++ +[a-f0-9]+: 67 f2 0f 38 f8 0d 00 00 00 00 enqcmd ecx,\[eip\+0x0\] #.* ++ +[a-f0-9]+: 67 f2 0f 38 f8 0d 00 00 00 00 enqcmd ecx,\[eip\+0x0\] #.* ++ +[a-f0-9]+: f3 0f 38 f8 0d 00 00 00 00 enqcmds rcx,\[rip\+0x0\] #.* ++ +[a-f0-9]+: 67 f3 0f 38 f8 0d 00 00 00 00 enqcmds ecx,\[eip\+0x0\] #.* ++ +[a-f0-9]+: 67 f3 0f 38 f8 0d 00 00 00 00 enqcmds ecx,\[eip\+0x0\] #.* ++ +[a-f0-9]+: 67 f2 0f 38 f8 0c 25 00 00 00 00 enqcmd ecx,\[eiz\*1\+0x0\] ++ +[a-f0-9]+: 67 f2 0f 38 f8 0c 25 78 56 34 12 enqcmd ecx,\[eiz\*1\+0x12345678\] ++ +[a-f0-9]+: 67 f3 0f 38 f8 0c 25 00 00 00 00 enqcmds ecx,\[eiz\*1\+0x0\] ++ +[a-f0-9]+: 67 f3 0f 38 f8 0c 25 78 56 34 12 enqcmds ecx,\[eiz\*1\+0x12345678\] + #pass +diff -rup binutils-2.35.1/gas/testsuite/gas/i386/x86-64-enqcmd.d fred/binutils-2.35.1/gas/testsuite/gas/i386/x86-64-enqcmd.d +--- binutils-2.35.1/gas/testsuite/gas/i386/x86-64-enqcmd.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/i386/x86-64-enqcmd.d 2020-11-25 14:37:42.000000000 +0000 +@@ -9,12 +9,32 @@ + Disassembly of section \.text: + + 0+ <_start>: +-[ ]*[a-f0-9]+:[ ]*f2 0f 38 f8 01[ ]*enqcmd \(%rcx\),%rax +-[ ]*[a-f0-9]+:[ ]*67 f2 0f 38 f8 01[ ]*enqcmd \(%ecx\),%eax +-[ ]*[a-f0-9]+:[ ]*f3 0f 38 f8 01[ ]*enqcmds \(%rcx\),%rax +-[ ]*[a-f0-9]+:[ ]*67 f3 0f 38 f8 01[ ]*enqcmds \(%ecx\),%eax +-[ ]*[a-f0-9]+:[ ]*f2 0f 38 f8 01[ ]*enqcmd \(%rcx\),%rax +-[ ]*[a-f0-9]+:[ ]*67 f2 0f 38 f8 01[ ]*enqcmd \(%ecx\),%eax +-[ ]*[a-f0-9]+:[ ]*f3 0f 38 f8 01[ ]*enqcmds \(%rcx\),%rax +-[ ]*[a-f0-9]+:[ ]*67 f3 0f 38 f8 01[ ]*enqcmds \(%ecx\),%eax ++ +[a-f0-9]+: f2 0f 38 f8 01 enqcmd \(%rcx\),%rax ++ +[a-f0-9]+: 67 f2 0f 38 f8 01 enqcmd \(%ecx\),%eax ++ +[a-f0-9]+: f3 0f 38 f8 01 enqcmds \(%rcx\),%rax ++ +[a-f0-9]+: 67 f3 0f 38 f8 01 enqcmds \(%ecx\),%eax ++ +[a-f0-9]+: f2 0f 38 f8 0d 00 00 00 00 enqcmd 0x0\(%rip\),%rcx #.* ++ +[a-f0-9]+: 67 f2 0f 38 f8 0d 00 00 00 00 enqcmd 0x0\(%eip\),%ecx #.* ++ +[a-f0-9]+: 67 f2 0f 38 f8 0d 00 00 00 00 enqcmd 0x0\(%eip\),%ecx #.* ++ +[a-f0-9]+: f3 0f 38 f8 0d 00 00 00 00 enqcmds 0x0\(%rip\),%rcx #.* ++ +[a-f0-9]+: 67 f3 0f 38 f8 0d 00 00 00 00 enqcmds 0x0\(%eip\),%ecx #.* ++ +[a-f0-9]+: 67 f3 0f 38 f8 0d 00 00 00 00 enqcmds 0x0\(%eip\),%ecx #.* ++ +[a-f0-9]+: 67 f2 0f 38 f8 0c 25 00 00 00 00 enqcmd 0x0\(,%eiz,1\),%ecx ++ +[a-f0-9]+: 67 f2 0f 38 f8 0c 25 78 56 34 12 enqcmd 0x12345678\(,%eiz,1\),%ecx ++ +[a-f0-9]+: 67 f3 0f 38 f8 0c 25 00 00 00 00 enqcmds 0x0\(,%eiz,1\),%ecx ++ +[a-f0-9]+: 67 f3 0f 38 f8 0c 25 78 56 34 12 enqcmds 0x12345678\(,%eiz,1\),%ecx ++ +[a-f0-9]+: f2 0f 38 f8 01 enqcmd \(%rcx\),%rax ++ +[a-f0-9]+: 67 f2 0f 38 f8 01 enqcmd \(%ecx\),%eax ++ +[a-f0-9]+: f3 0f 38 f8 01 enqcmds \(%rcx\),%rax ++ +[a-f0-9]+: 67 f3 0f 38 f8 01 enqcmds \(%ecx\),%eax ++ +[a-f0-9]+: f2 0f 38 f8 0d 00 00 00 00 enqcmd 0x0\(%rip\),%rcx #.* ++ +[a-f0-9]+: 67 f2 0f 38 f8 0d 00 00 00 00 enqcmd 0x0\(%eip\),%ecx #.* ++ +[a-f0-9]+: 67 f2 0f 38 f8 0d 00 00 00 00 enqcmd 0x0\(%eip\),%ecx #.* ++ +[a-f0-9]+: f3 0f 38 f8 0d 00 00 00 00 enqcmds 0x0\(%rip\),%rcx #.* ++ +[a-f0-9]+: 67 f3 0f 38 f8 0d 00 00 00 00 enqcmds 0x0\(%eip\),%ecx #.* ++ +[a-f0-9]+: 67 f3 0f 38 f8 0d 00 00 00 00 enqcmds 0x0\(%eip\),%ecx #.* ++ +[a-f0-9]+: 67 f2 0f 38 f8 0c 25 00 00 00 00 enqcmd 0x0\(,%eiz,1\),%ecx ++ +[a-f0-9]+: 67 f2 0f 38 f8 0c 25 78 56 34 12 enqcmd 0x12345678\(,%eiz,1\),%ecx ++ +[a-f0-9]+: 67 f3 0f 38 f8 0c 25 00 00 00 00 enqcmds 0x0\(,%eiz,1\),%ecx ++ +[a-f0-9]+: 67 f3 0f 38 f8 0c 25 78 56 34 12 enqcmds 0x12345678\(,%eiz,1\),%ecx + #pass +diff -rup binutils-2.35.1/gas/testsuite/gas/i386/x86-64-enqcmd.s fred/binutils-2.35.1/gas/testsuite/gas/i386/x86-64-enqcmd.s +--- binutils-2.35.1/gas/testsuite/gas/i386/x86-64-enqcmd.s 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/i386/x86-64-enqcmd.s 2020-11-25 14:37:42.000000000 +0000 +@@ -7,9 +7,29 @@ _start: + enqcmd (%ecx),%eax + enqcmds (%rcx),%rax + enqcmds (%ecx),%eax ++ enqcmd foo(%rip),%rcx ++ enqcmd foo(%rip),%ecx ++ enqcmd foo(%eip),%ecx ++ enqcmds foo(%rip),%rcx ++ enqcmds foo(%rip),%ecx ++ enqcmds foo(%eip),%ecx ++ enqcmd foo, %ecx ++ enqcmd 0x12345678, %ecx ++ enqcmds foo, %ecx ++ enqcmds 0x12345678, %ecx + + .intel_syntax noprefix + enqcmd rax,[rcx] + enqcmd eax,[ecx] + enqcmds rax,[rcx] + enqcmds eax,[ecx] ++ enqcmd rcx,[rip+foo] ++ enqcmd ecx,[rip+foo] ++ enqcmd ecx,[eip+foo] ++ enqcmds rcx,[rip+foo] ++ enqcmds ecx,[rip+foo] ++ enqcmds ecx,[eip+foo] ++ enqcmd ecx,ds:foo ++ enqcmd ecx,ds:0x12345678 ++ enqcmds ecx,ds:foo ++ enqcmds ecx,ds:0x12345678 +diff -rup binutils-2.35.1/gas/testsuite/gas/i386/x86-64-movdir-intel.d fred/binutils-2.35.1/gas/testsuite/gas/i386/x86-64-movdir-intel.d +--- binutils-2.35.1/gas/testsuite/gas/i386/x86-64-movdir-intel.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/i386/x86-64-movdir-intel.d 2020-11-25 14:37:42.000000000 +0000 +@@ -9,13 +9,23 @@ + Disassembly of section \.text: + + 0+ <_start>: +-[ ]*[a-f0-9]+:[ ]*48 0f 38 f9 01[ ]*movdiri QWORD PTR \[rcx\],rax +-[ ]*[a-f0-9]+:[ ]*66 0f 38 f8 01[ ]*movdir64b rax,\[rcx\] +-[ ]*[a-f0-9]+:[ ]*67 66 0f 38 f8 01[ ]*movdir64b eax,\[ecx] +-[ ]*[a-f0-9]+:[ ]*0f 38 f9 01[ ]*movdiri DWORD PTR \[rcx\],eax +-[ ]*[a-f0-9]+:[ ]*48 0f 38 f9 01[ ]*movdiri QWORD PTR \[rcx\],rax +-[ ]*[a-f0-9]+:[ ]*0f 38 f9 01[ ]*movdiri DWORD PTR \[rcx\],eax +-[ ]*[a-f0-9]+:[ ]*48 0f 38 f9 01[ ]*movdiri QWORD PTR \[rcx\],rax +-[ ]*[a-f0-9]+:[ ]*66 0f 38 f8 01[ ]*movdir64b rax,\[rcx\] +-[ ]*[a-f0-9]+:[ ]*67 66 0f 38 f8 01[ ]*movdir64b eax,\[ecx\] ++ +[a-f0-9]+: 48 0f 38 f9 01 movdiri QWORD PTR \[rcx\],rax ++ +[a-f0-9]+: 66 0f 38 f8 01 movdir64b rax,\[rcx\] ++ +[a-f0-9]+: 67 66 0f 38 f8 01 movdir64b eax,\[ecx\] ++ +[a-f0-9]+: 66 0f 38 f8 0d 00 00 00 00 movdir64b rcx,\[rip\+0x0\] #.* ++ +[a-f0-9]+: 67 66 0f 38 f8 0d 00 00 00 00 movdir64b ecx,\[eip\+0x0\] #.* ++ +[a-f0-9]+: 67 66 0f 38 f8 0d 00 00 00 00 movdir64b ecx,\[eip\+0x0\] #.* ++ +[a-f0-9]+: 67 66 0f 38 f8 0c 25 00 00 00 00 movdir64b ecx,\[eiz\*1\+0x0\] ++ +[a-f0-9]+: 67 66 0f 38 f8 0c 25 78 56 34 12 movdir64b ecx,\[eiz\*1\+0x12345678\] ++ +[a-f0-9]+: 0f 38 f9 01 movdiri DWORD PTR \[rcx\],eax ++ +[a-f0-9]+: 48 0f 38 f9 01 movdiri QWORD PTR \[rcx\],rax ++ +[a-f0-9]+: 0f 38 f9 01 movdiri DWORD PTR \[rcx\],eax ++ +[a-f0-9]+: 48 0f 38 f9 01 movdiri QWORD PTR \[rcx\],rax ++ +[a-f0-9]+: 66 0f 38 f8 01 movdir64b rax,\[rcx\] ++ +[a-f0-9]+: 67 66 0f 38 f8 01 movdir64b eax,\[ecx\] ++ +[a-f0-9]+: 66 0f 38 f8 0d 00 00 00 00 movdir64b rcx,\[rip\+0x0\] #.* ++ +[a-f0-9]+: 67 66 0f 38 f8 0d 00 00 00 00 movdir64b ecx,\[eip\+0x0\] #.* ++ +[a-f0-9]+: 67 66 0f 38 f8 0d 00 00 00 00 movdir64b ecx,\[eip\+0x0\] #.* ++ +[a-f0-9]+: 67 66 0f 38 f8 0c 25 00 00 00 00 movdir64b ecx,\[eiz\*1\+0x0\] ++ +[a-f0-9]+: 67 66 0f 38 f8 0c 25 78 56 34 12 movdir64b ecx,\[eiz\*1\+0x12345678\] + #pass +diff -rup binutils-2.35.1/gas/testsuite/gas/i386/x86-64-movdir.d fred/binutils-2.35.1/gas/testsuite/gas/i386/x86-64-movdir.d +--- binutils-2.35.1/gas/testsuite/gas/i386/x86-64-movdir.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/i386/x86-64-movdir.d 2020-11-25 14:37:42.000000000 +0000 +@@ -9,13 +9,23 @@ + Disassembly of section \.text: + + 0+ <_start>: +-[ ]*[a-f0-9]+:[ ]*48 0f 38 f9 01[ ]*movdiri %rax,\(%rcx\) +-[ ]*[a-f0-9]+:[ ]*66 0f 38 f8 01[ ]*movdir64b \(%rcx\),%rax +-[ ]*[a-f0-9]+:[ ]*67 66 0f 38 f8 01[ ]*movdir64b \(%ecx\),%eax +-[ ]*[a-f0-9]+:[ ]*0f 38 f9 01[ ]*movdiri %eax,\(%rcx\) +-[ ]*[a-f0-9]+:[ ]*48 0f 38 f9 01[ ]*movdiri %rax,\(%rcx\) +-[ ]*[a-f0-9]+:[ ]*0f 38 f9 01[ ]*movdiri %eax,\(%rcx\) +-[ ]*[a-f0-9]+:[ ]*48 0f 38 f9 01[ ]*movdiri %rax,\(%rcx\) +-[ ]*[a-f0-9]+:[ ]*66 0f 38 f8 01[ ]*movdir64b \(%rcx\),%rax +-[ ]*[a-f0-9]+:[ ]*67 66 0f 38 f8 01[ ]*movdir64b \(%ecx\),%eax ++ +[a-f0-9]+: 48 0f 38 f9 01 movdiri %rax,\(%rcx\) ++ +[a-f0-9]+: 66 0f 38 f8 01 movdir64b \(%rcx\),%rax ++ +[a-f0-9]+: 67 66 0f 38 f8 01 movdir64b \(%ecx\),%eax ++ +[a-f0-9]+: 66 0f 38 f8 0d 00 00 00 00 movdir64b 0x0\(%rip\),%rcx #.* ++ +[a-f0-9]+: 67 66 0f 38 f8 0d 00 00 00 00 movdir64b 0x0\(%eip\),%ecx #.* ++ +[a-f0-9]+: 67 66 0f 38 f8 0d 00 00 00 00 movdir64b 0x0\(%eip\),%ecx #.* ++ +[a-f0-9]+: 67 66 0f 38 f8 0c 25 00 00 00 00 movdir64b 0x0\(,%eiz,1\),%ecx ++ +[a-f0-9]+: 67 66 0f 38 f8 0c 25 78 56 34 12 movdir64b 0x12345678\(,%eiz,1\),%ecx ++ +[a-f0-9]+: 0f 38 f9 01 movdiri %eax,\(%rcx\) ++ +[a-f0-9]+: 48 0f 38 f9 01 movdiri %rax,\(%rcx\) ++ +[a-f0-9]+: 0f 38 f9 01 movdiri %eax,\(%rcx\) ++ +[a-f0-9]+: 48 0f 38 f9 01 movdiri %rax,\(%rcx\) ++ +[a-f0-9]+: 66 0f 38 f8 01 movdir64b \(%rcx\),%rax ++ +[a-f0-9]+: 67 66 0f 38 f8 01 movdir64b \(%ecx\),%eax ++ +[a-f0-9]+: 66 0f 38 f8 0d 00 00 00 00 movdir64b 0x0\(%rip\),%rcx #.* ++ +[a-f0-9]+: 67 66 0f 38 f8 0d 00 00 00 00 movdir64b 0x0\(%eip\),%ecx #.* ++ +[a-f0-9]+: 67 66 0f 38 f8 0d 00 00 00 00 movdir64b 0x0\(%eip\),%ecx #.* ++ +[a-f0-9]+: 67 66 0f 38 f8 0c 25 00 00 00 00 movdir64b 0x0\(,%eiz,1\),%ecx ++ +[a-f0-9]+: 67 66 0f 38 f8 0c 25 78 56 34 12 movdir64b 0x12345678\(,%eiz,1\),%ecx + #pass +diff -rup binutils-2.35.1/gas/testsuite/gas/i386/x86-64-movdir.s fred/binutils-2.35.1/gas/testsuite/gas/i386/x86-64-movdir.s +--- binutils-2.35.1/gas/testsuite/gas/i386/x86-64-movdir.s 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/i386/x86-64-movdir.s 2020-11-25 14:37:42.000000000 +0000 +@@ -6,6 +6,11 @@ _start: + movdiri %rax, (%rcx) + movdir64b (%rcx),%rax + movdir64b (%ecx),%eax ++ movdir64b foo(%rip),%rcx ++ movdir64b foo(%rip),%ecx ++ movdir64b foo(%eip),%ecx ++ movdir64b foo, %ecx ++ movdir64b 0x12345678, %ecx + + .intel_syntax noprefix + movdiri [rcx],eax +@@ -14,3 +19,8 @@ _start: + movdiri qword ptr [rcx],rax + movdir64b rax,[rcx] + movdir64b eax,[ecx] ++ movdir64b rcx,[rip+foo] ++ movdir64b ecx,[rip+foo] ++ movdir64b ecx,[eip+foo] ++ movdir64b ecx,ds:foo ++ movdir64b ecx,ds:0x12345678 +diff -rup binutils-2.35.1/gas/testsuite/gas/ppc/476.d fred/binutils-2.35.1/gas/testsuite/gas/ppc/476.d +--- binutils-2.35.1/gas/testsuite/gas/ppc/476.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/ppc/476.d 2020-11-25 14:37:47.000000000 +0000 +@@ -7,491 +7,485 @@ + Disassembly of section \.text: + + 0+00 : +- 0: (7c 64 2a 14|14 2a 64 7c) add r3,r4,r5 +- 4: (7c 64 2a 15|15 2a 64 7c) add\. r3,r4,r5 +- 8: (7c 64 28 14|14 28 64 7c) addc r3,r4,r5 +- c: (7c 64 28 15|15 28 64 7c) addc\. r3,r4,r5 +- 10: (7c 64 2c 14|14 2c 64 7c) addco r3,r4,r5 +- 14: (7c 64 2c 15|15 2c 64 7c) addco\. r3,r4,r5 +- 18: (7c 64 29 14|14 29 64 7c) adde r3,r4,r5 +- 1c: (7c 64 29 15|15 29 64 7c) adde\. r3,r4,r5 +- 20: (7c 64 2d 14|14 2d 64 7c) addeo r3,r4,r5 +- 24: (7c 64 2d 15|15 2d 64 7c) addeo\. r3,r4,r5 +- 28: (38 64 ff 80|80 ff 64 38) addi r3,r4,-128 +- 2c: (30 64 ff 80|80 ff 64 30) addic r3,r4,-128 +- 30: (34 64 ff 80|80 ff 64 34) addic\. r3,r4,-128 +- 34: (3c 64 ff 80|80 ff 64 3c) addis r3,r4,-128 +- 38: (7c 64 01 d4|d4 01 64 7c) addme r3,r4 +- 3c: (7c 64 01 d5|d5 01 64 7c) addme\. r3,r4 +- 40: (7c 64 05 d4|d4 05 64 7c) addmeo r3,r4 +- 44: (7c 64 05 d5|d5 05 64 7c) addmeo\. r3,r4 +- 48: (7c 64 2e 14|14 2e 64 7c) addo r3,r4,r5 +- 4c: (7c 64 2e 15|15 2e 64 7c) addo\. r3,r4,r5 +- 50: (7c 64 01 94|94 01 64 7c) addze r3,r4 +- 54: (7c 64 01 95|95 01 64 7c) addze\. r3,r4 +- 58: (7c 64 05 94|94 05 64 7c) addzeo r3,r4 +- 5c: (7c 64 05 95|95 05 64 7c) addzeo\. r3,r4 +- 60: (7c 83 28 38|38 28 83 7c) and r3,r4,r5 +- 64: (7c 83 28 39|39 28 83 7c) and\. r3,r4,r5 +- 68: (7d cd 78 78|78 78 cd 7d) andc r13,r14,r15 +- 6c: (7e 30 90 79|79 90 30 7e) andc\. r16,r17,r18 +- 70: (70 83 de ad|ad de 83 70) andi\. r3,r4,57005 +- 74: (74 83 de ad|ad de 83 74) andis\. r3,r4,57005 +- 78: (48 00 00 02|02 00 00 48) ba 0 +- 7c: (40 01 00 00|00 00 01 40) bdnzf gt,7c +- 80: (40 85 00 02|02 00 85 40) blea cr1,0 +- 84: (4d 80 04 20|20 04 80 4d) bltctr +- 88: (4c 8a 04 20|20 04 8a 4c) bnectr cr2 +- 8c: (4c 86 04 20|20 04 86 4c) bnectr cr1 +- 90: (4c 86 04 20|20 04 86 4c) bnectr cr1 +- 94: (4d 80 04 21|21 04 80 4d) bltctrl +- 98: (4c 8a 04 21|21 04 8a 4c) bnectrl cr2 +- 9c: (4c 86 04 21|21 04 86 4c) bnectrl cr1 +- a0: (4c 86 04 21|21 04 86 4c) bnectrl cr1 +- a4: (40 43 00 01|01 00 43 40) bdzfl so,a4 +- a8: (4d 80 00 20|20 00 80 4d) bltlr +- ac: (4c 8a 00 20|20 00 8a 4c) bnelr cr2 +- b0: (4c 86 00 20|20 00 86 4c) bnelr cr1 +- b4: (4c 86 00 20|20 00 86 4c) bnelr cr1 +- b8: (4d 80 00 21|21 00 80 4d) bltlrl +- bc: (4c 8a 00 21|21 00 8a 4c) bnelrl cr2 +- c0: (4c 86 00 21|21 00 86 4c) bnelrl cr1 +- c4: (4c 86 00 21|21 00 86 4c) bnelrl cr1 +- c8: (48 00 00 00|00 00 00 48) b c8 +- cc: (48 00 00 01|01 00 00 48) bl cc +- d0: (54 83 00 36|36 00 83 54) rlwinm r3,r4,0,0,27 +- d4: (7c 03 20 00|00 20 03 7c) cmpw r3,r4 +- d8: (7f 83 20 00|00 20 83 7f) cmpw cr7,r3,r4 +- dc: (7c 83 2b f8|f8 2b 83 7c) cmpb r3,r4,r5 +- e0: (7c 83 2b f8|f8 2b 83 7c) cmpb r3,r4,r5 +- e4: (2c 03 ff 59|59 ff 03 2c) cmpwi r3,-167 +- e8: (2f 83 ff 59|59 ff 83 2f) cmpwi cr7,r3,-167 +- ec: (7c 03 20 40|40 20 03 7c) cmplw r3,r4 +- f0: (7f 83 20 40|40 20 83 7f) cmplw cr7,r3,r4 +- f4: (28 03 00 a7|a7 00 03 28) cmplwi r3,167 +- f8: (2b 83 00 a7|a7 00 83 2b) cmplwi cr7,r3,167 +- fc: (7c 03 20 40|40 20 03 7c) cmplw r3,r4 +- 100: (28 03 00 a7|a7 00 03 28) cmplwi r3,167 +- 104: (7c 03 20 00|00 20 03 7c) cmpw r3,r4 +- 108: (2c 03 ff 59|59 ff 03 2c) cmpwi r3,-167 +- 10c: (7d 6a 00 34|34 00 6a 7d) cntlzw r10,r11 +- 110: (7d 6a 00 35|35 00 6a 7d) cntlzw\. r10,r11 +- 114: (4c 85 32 02|02 32 85 4c) crand 4\*cr1\+lt,4\*cr1\+gt,4\*cr1\+eq +- 118: (4c 64 29 02|02 29 64 4c) crandc so,4\*cr1\+lt,4\*cr1\+gt +- 11c: (4c e0 0a 42|42 0a e0 4c) creqv 4\*cr1\+so,lt,gt +- 120: (4c 22 19 c2|c2 19 22 4c) crnand gt,eq,so +- 124: (4c 01 10 42|42 10 01 4c) crnor lt,gt,eq +- 128: (4c a6 3b 82|82 3b a6 4c) cror 4\*cr1\+gt,4\*cr1\+eq,4\*cr1\+so +- 12c: (4c 43 23 42|42 23 43 4c) crorc eq,so,4\*cr1\+lt +- 130: (4c c7 01 82|82 01 c7 4c) crxor 4\*cr1\+eq,4\*cr1\+so,lt +- 134: (7c 09 55 ec|ec 55 09 7c) dcba r9,r10 +- 138: (7c 06 38 ac|ac 38 06 7c) dcbf r6,r7 +- 13c: (7c 06 38 ac|ac 38 06 7c) dcbf r6,r7 +- 140: (7c 06 3b ac|ac 3b 06 7c) dcbi r6,r7 +- 144: (7c 85 33 0c|0c 33 85 7c) dcblc 4,r5,r6 +- 148: (7c 06 38 6c|6c 38 06 7c) dcbst r6,r7 +- 14c: (7c 05 32 2c|2c 32 05 7c) dcbt r5,r6 +- 150: (7c 05 32 2c|2c 32 05 7c) dcbt r5,r6 +- 154: (7d 05 32 2c|2c 32 05 7d) dcbt 8,r5,r6 +- 158: (7c e8 49 4c|4c 49 e8 7c) dcbtls 7,r8,r9 +- 15c: (7c 06 39 ec|ec 39 06 7c) dcbtst r6,r7 +- 160: (7c 06 39 ec|ec 39 06 7c) dcbtst r6,r7 +- 164: (7d 26 39 ec|ec 39 26 7d) dcbtst 9,r6,r7 +- 168: (7d 4b 61 0c|0c 61 4b 7d) dcbtstls 10,r11,r12 +- 16c: (7c 01 17 ec|ec 17 01 7c) dcbz r1,r2 +- 170: (7c 05 37 ec|ec 37 05 7c) dcbz r5,r6 +- 174: (7c 00 03 8c|8c 03 00 7c) dccci +- 178: (7c 00 03 8c|8c 03 00 7c) dccci +- 17c: (7c 00 03 8c|8c 03 00 7c) dccci +- 180: (7c 20 03 8c|8c 03 20 7c) dci 1 +- 184: (7d 4b 63 d6|d6 63 4b 7d) divw r10,r11,r12 +- 188: (7d 6c 6b d7|d7 6b 6c 7d) divw\. r11,r12,r13 +- 18c: (7d 4b 67 d6|d6 67 4b 7d) divwo r10,r11,r12 +- 190: (7d 6c 6f d7|d7 6f 6c 7d) divwo\. r11,r12,r13 +- 194: (7d 4b 63 96|96 63 4b 7d) divwu r10,r11,r12 +- 198: (7d 6c 6b 97|97 6b 6c 7d) divwu\. r11,r12,r13 +- 19c: (7d 4b 67 96|96 67 4b 7d) divwuo r10,r11,r12 +- 1a0: (7d 6c 6f 97|97 6f 6c 7d) divwuo\. r11,r12,r13 +- 1a4: (7c 83 28 9c|9c 28 83 7c) dlmzb r3,r4,r5 +- 1a8: (7c 83 28 9d|9d 28 83 7c) dlmzb\. r3,r4,r5 +- 1ac: (7d 6a 62 38|38 62 6a 7d) eqv r10,r11,r12 +- 1b0: (7d 6a 62 39|39 62 6a 7d) eqv\. r10,r11,r12 +- 1b4: (54 83 20 26|26 20 83 54) rlwinm r3,r4,4,0,19 +- 1b8: (7c 83 07 74|74 07 83 7c) extsb r3,r4 +- 1bc: (7c 83 07 75|75 07 83 7c) extsb\. r3,r4 +- 1c0: (7c 83 07 34|34 07 83 7c) extsh r3,r4 +- 1c4: (7c 83 07 35|35 07 83 7c) extsh\. r3,r4 +- 1c8: (fe a0 fa 10|10 fa a0 fe) fabs f21,f31 +- 1cc: (fe a0 fa 11|11 fa a0 fe) fabs\. f21,f31 +- 1d0: (fd 4b 60 2a|2a 60 4b fd) fadd f10,f11,f12 +- 1d4: (fd 4b 60 2b|2b 60 4b fd) fadd\. f10,f11,f12 +- 1d8: (ed 4b 60 2a|2a 60 4b ed) fadds f10,f11,f12 +- 1dc: (ed 4b 60 2b|2b 60 4b ed) fadds\. f10,f11,f12 +- 1e0: (fd 40 5e 9c|9c 5e 40 fd) fcfid f10,f11 +- 1e4: (fd 40 5e 9d|9d 5e 40 fd) fcfid\. f10,f11 +- 1e8: (fd 8a 58 40|40 58 8a fd) fcmpo cr3,f10,f11 +- 1ec: (fd 84 28 00|00 28 84 fd) fcmpu cr3,f4,f5 +- 1f0: (fd 4b 60 10|10 60 4b fd) fcpsgn f10,f11,f12 +- 1f4: (fd 4b 60 11|11 60 4b fd) fcpsgn\. f10,f11,f12 +- 1f8: (fd 40 5e 5c|5c 5e 40 fd) fctid f10,f11 +- 1fc: (fd 40 5e 5d|5d 5e 40 fd) fctid\. f10,f11 +- 200: (fd 40 5e 5e|5e 5e 40 fd) fctidz f10,f11 +- 204: (fd 40 5e 5f|5f 5e 40 fd) fctidz\. f10,f11 +- 208: (fd 40 58 1c|1c 58 40 fd) fctiw f10,f11 +- 20c: (fd 40 58 1d|1d 58 40 fd) fctiw\. f10,f11 +- 210: (fd 40 58 1e|1e 58 40 fd) fctiwz f10,f11 +- 214: (fd 40 58 1f|1f 58 40 fd) fctiwz\. f10,f11 +- 218: (fd 4b 60 24|24 60 4b fd) fdiv f10,f11,f12 +- 21c: (fd 4b 60 25|25 60 4b fd) fdiv\. f10,f11,f12 +- 220: (ed 4b 60 24|24 60 4b ed) fdivs f10,f11,f12 +- 224: (ed 4b 60 25|25 60 4b ed) fdivs\. f10,f11,f12 +- 228: (fd 4b 6b 3a|3a 6b 4b fd) fmadd f10,f11,f12,f13 +- 22c: (fd 4b 6b 3b|3b 6b 4b fd) fmadd\. f10,f11,f12,f13 +- 230: (ed 4b 6b 3a|3a 6b 4b ed) fmadds f10,f11,f12,f13 +- 234: (ed 4b 6b 3b|3b 6b 4b ed) fmadds\. f10,f11,f12,f13 +- 238: (fc 60 20 90|90 20 60 fc) fmr f3,f4 +- 23c: (fc 60 20 91|91 20 60 fc) fmr\. f3,f4 +- 240: (fd 4b 6b 38|38 6b 4b fd) fmsub f10,f11,f12,f13 +- 244: (fd 4b 6b 39|39 6b 4b fd) fmsub\. f10,f11,f12,f13 +- 248: (ed 4b 6b 38|38 6b 4b ed) fmsubs f10,f11,f12,f13 +- 24c: (ed 4b 6b 39|39 6b 4b ed) fmsubs\. f10,f11,f12,f13 +- 250: (fd 4b 03 32|32 03 4b fd) fmul f10,f11,f12 +- 254: (fd 4b 03 33|33 03 4b fd) fmul\. f10,f11,f12 +- 258: (ed 4b 03 32|32 03 4b ed) fmuls f10,f11,f12 +- 25c: (ed 4b 03 33|33 03 4b ed) fmuls\. f10,f11,f12 +- 260: (fe 80 f1 10|10 f1 80 fe) fnabs f20,f30 +- 264: (fe 80 f1 11|11 f1 80 fe) fnabs\. f20,f30 +- 268: (fc 60 20 50|50 20 60 fc) fneg f3,f4 +- 26c: (fc 60 20 51|51 20 60 fc) fneg\. f3,f4 +- 270: (fd 4b 6b 3e|3e 6b 4b fd) fnmadd f10,f11,f12,f13 +- 274: (fd 4b 6b 3f|3f 6b 4b fd) fnmadd\. f10,f11,f12,f13 +- 278: (ed 4b 6b 3e|3e 6b 4b ed) fnmadds f10,f11,f12,f13 +- 27c: (ed 4b 6b 3f|3f 6b 4b ed) fnmadds\. f10,f11,f12,f13 +- 280: (fd 4b 6b 3c|3c 6b 4b fd) fnmsub f10,f11,f12,f13 +- 284: (fd 4b 6b 3d|3d 6b 4b fd) fnmsub\. f10,f11,f12,f13 +- 288: (ed 4b 6b 3c|3c 6b 4b ed) fnmsubs f10,f11,f12,f13 +- 28c: (ed 4b 6b 3d|3d 6b 4b ed) fnmsubs\. f10,f11,f12,f13 +- 290: (fd c0 78 30|30 78 c0 fd) fre f14,f15 +- 294: (fd c0 78 31|31 78 c0 fd) fre\. f14,f15 +- 298: (ed c0 78 30|30 78 c0 ed) fres f14,f15 +- 29c: (ed c0 78 31|31 78 c0 ed) fres\. f14,f15 +- 2a0: (fd 40 5b d0|d0 5b 40 fd) frim f10,f11 +- 2a4: (fd 40 5b d1|d1 5b 40 fd) frim\. f10,f11 +- 2a8: (fd 40 5b 10|10 5b 40 fd) frin f10,f11 +- 2ac: (fd 40 5b 11|11 5b 40 fd) frin\. f10,f11 +- 2b0: (fd 40 5b 90|90 5b 40 fd) frip f10,f11 +- 2b4: (fd 40 5b 91|91 5b 40 fd) frip\. f10,f11 +- 2b8: (fd 40 5b 50|50 5b 40 fd) friz f10,f11 +- 2bc: (fd 40 5b 51|51 5b 40 fd) friz\. f10,f11 +- 2c0: (fc c0 38 18|18 38 c0 fc) frsp f6,f7 +- 2c4: (fd 00 48 19|19 48 00 fd) frsp\. f8,f9 +- 2c8: (fd c0 78 34|34 78 c0 fd) frsqrte f14,f15 +- 2cc: (fd c0 78 35|35 78 c0 fd) frsqrte\. f14,f15 +- 2d0: (ed c0 78 34|34 78 c0 ed) frsqrtes f14,f15 +- 2d4: (ed c0 78 35|35 78 c0 ed) frsqrtes\. f14,f15 +- 2d8: (fd 4b 6b 2e|2e 6b 4b fd) fsel f10,f11,f12,f13 +- 2dc: (fd 4b 6b 2f|2f 6b 4b fd) fsel\. f10,f11,f12,f13 +- 2e0: (fd 40 58 2c|2c 58 40 fd) fsqrt f10,f11 +- 2e4: (fd 40 58 2d|2d 58 40 fd) fsqrt\. f10,f11 +- 2e8: (ed 40 58 2c|2c 58 40 ed) fsqrts f10,f11 +- 2ec: (ed 40 58 2d|2d 58 40 ed) fsqrts\. f10,f11 +- 2f0: (fd 4b 60 28|28 60 4b fd) fsub f10,f11,f12 +- 2f4: (fd 4b 60 29|29 60 4b fd) fsub\. f10,f11,f12 +- 2f8: (ed 4b 60 28|28 60 4b ed) fsubs f10,f11,f12 +- 2fc: (ed 4b 60 29|29 60 4b ed) fsubs\. f10,f11,f12 +- 300: (7c 03 27 ac|ac 27 03 7c) icbi r3,r4 +- 304: (7e 11 91 cc|cc 91 11 7e) icblc 16,r17,r18 +- 308: (7c a8 48 2c|2c 48 a8 7c) icbt 5,r8,r9 +- 30c: (7d ae 7b cc|cc 7b ae 7d) icbtls 13,r14,r15 +- 310: (7c 00 07 8c|8c 07 00 7c) iccci +- 314: (7c 00 07 8c|8c 07 00 7c) iccci +- 318: (7c 00 07 8c|8c 07 00 7c) iccci +- 31c: (7c 20 07 8c|8c 07 20 7c) ici 1 +- 320: (7c 03 27 cc|cc 27 03 7c) icread r3,r4 +- 324: (50 83 65 36|36 65 83 50) rlwimi r3,r4,12,20,27 +- 328: (7c 43 27 1e|1e 27 43 7c) isel r2,r3,r4,28 +- 32c: (4c 00 01 2c|2c 01 00 4c) isync +- 330: (89 21 00 00|00 00 21 89) lbz r9,0\(r1\) +- 334: (8d 41 00 01|01 00 41 8d) lbzu r10,1\(r1\) +- 338: (7e 95 b0 ee|ee b0 95 7e) lbzux r20,r21,r22 +- 33c: (7c 64 28 ae|ae 28 64 7c) lbzx r3,r4,r5 +- 340: (ca a1 00 08|08 00 a1 ca) lfd f21,8\(r1\) +- 344: (ce c1 00 10|10 00 c1 ce) lfdu f22,16\(r1\) +- 348: (7e 95 b4 ee|ee b4 95 7e) lfdux f20,r21,r22 +- 34c: (7d ae 7c ae|ae 7c ae 7d) lfdx f13,r14,r15 +- 350: (7d 43 26 ae|ae 26 43 7d) lfiwax f10,r3,r4 +- 354: (c2 61 00 00|00 00 61 c2) lfs f19,0\(r1\) +- 358: (c6 81 00 04|04 00 81 c6) lfsu f20,4\(r1\) +- 35c: (7d 4b 64 6e|6e 64 4b 7d) lfsux f10,r11,r12 +- 360: (7d 4b 64 2e|2e 64 4b 7d) lfsx f10,r11,r12 +- 364: (a9 e1 00 06|06 00 e1 a9) lha r15,6\(r1\) +- 368: (ae 01 00 08|08 00 01 ae) lhau r16,8\(r1\) +- 36c: (7d 2a 5a ee|ee 5a 2a 7d) lhaux r9,r10,r11 +- 370: (7d 2a 5a ae|ae 5a 2a 7d) lhax r9,r10,r11 +- 374: (7c 64 2e 2c|2c 2e 64 7c) lhbrx r3,r4,r5 +- 378: (a1 a1 00 00|00 00 a1 a1) lhz r13,0\(r1\) +- 37c: (a5 c1 00 02|02 00 c1 a5) lhzu r14,2\(r1\) +- 380: (7e 96 c2 6e|6e c2 96 7e) lhzux r20,r22,r24 +- 384: (7e f8 ca 2e|2e ca f8 7e) lhzx r23,r24,r25 +- 388: (b8 61 ff f0|f0 ff 61 b8) lmw r3,-16\(r1\) +- 38c: (7c a4 84 aa|aa 84 a4 7c) lswi r5,r4,16 +- 390: (7c 64 2c 2a|2a 2c 64 7c) lswx r3,r4,r5 +- 394: (7c 64 28 28|28 28 64 7c) lwarx r3,r4,r5 +- 398: (7c 64 28 28|28 28 64 7c) lwarx r3,r4,r5 +- 39c: (7c 64 28 29|29 28 64 7c) lwarx r3,r4,r5,1 +- 3a0: (7c 64 2c 2c|2c 2c 64 7c) lwbrx r3,r4,r5 +- 3a4: (80 c7 00 00|00 00 c7 80) lwz r6,0\(r7\) +- 3a8: (84 61 00 10|10 00 61 84) lwzu r3,16\(r1\) +- 3ac: (7c 64 28 6e|6e 28 64 7c) lwzux r3,r4,r5 +- 3b0: (7c 64 28 2e|2e 28 64 7c) lwzx r3,r4,r5 +- 3b4: (10 64 29 58|58 29 64 10) macchw r3,r4,r5 +- 3b8: (10 64 29 59|59 29 64 10) macchw\. r3,r4,r5 +- 3bc: (10 64 2d 58|58 2d 64 10) macchwo r3,r4,r5 +- 3c0: (10 64 2d 59|59 2d 64 10) macchwo\. r3,r4,r5 +- 3c4: (10 64 29 d8|d8 29 64 10) macchws r3,r4,r5 +- 3c8: (10 64 29 d9|d9 29 64 10) macchws\. r3,r4,r5 +- 3cc: (10 64 2d d8|d8 2d 64 10) macchwso r3,r4,r5 +- 3d0: (10 64 2d d9|d9 2d 64 10) macchwso\. r3,r4,r5 +- 3d4: (10 64 29 98|98 29 64 10) macchwsu r3,r4,r5 +- 3d8: (10 64 29 99|99 29 64 10) macchwsu\. r3,r4,r5 +- 3dc: (10 64 2d 98|98 2d 64 10) macchwsuo r3,r4,r5 +- 3e0: (10 64 2d 99|99 2d 64 10) macchwsuo\. r3,r4,r5 +- 3e4: (10 64 29 18|18 29 64 10) macchwu r3,r4,r5 +- 3e8: (10 64 29 19|19 29 64 10) macchwu\. r3,r4,r5 +- 3ec: (10 64 2d 18|18 2d 64 10) macchwuo r3,r4,r5 +- 3f0: (10 64 2d 19|19 2d 64 10) macchwuo\. r3,r4,r5 +- 3f4: (10 64 28 58|58 28 64 10) machhw r3,r4,r5 +- 3f8: (10 64 28 59|59 28 64 10) machhw\. r3,r4,r5 +- 3fc: (10 64 2c 58|58 2c 64 10) machhwo r3,r4,r5 +- 400: (10 64 2c 59|59 2c 64 10) machhwo\. r3,r4,r5 +- 404: (10 64 28 d8|d8 28 64 10) machhws r3,r4,r5 +- 408: (10 64 28 d9|d9 28 64 10) machhws\. r3,r4,r5 +- 40c: (10 64 2c d8|d8 2c 64 10) machhwso r3,r4,r5 +- 410: (10 64 2c d9|d9 2c 64 10) machhwso\. r3,r4,r5 +- 414: (10 64 28 98|98 28 64 10) machhwsu r3,r4,r5 +- 418: (10 64 28 99|99 28 64 10) machhwsu\. r3,r4,r5 +- 41c: (10 64 2c 98|98 2c 64 10) machhwsuo r3,r4,r5 +- 420: (10 64 2c 99|99 2c 64 10) machhwsuo\. r3,r4,r5 +- 424: (10 64 28 18|18 28 64 10) machhwu r3,r4,r5 +- 428: (10 64 28 19|19 28 64 10) machhwu\. r3,r4,r5 +- 42c: (10 64 2c 18|18 2c 64 10) machhwuo r3,r4,r5 +- 430: (10 64 2c 19|19 2c 64 10) machhwuo\. r3,r4,r5 +- 434: (10 64 2b 58|58 2b 64 10) maclhw r3,r4,r5 +- 438: (10 64 2b 59|59 2b 64 10) maclhw\. r3,r4,r5 +- 43c: (10 64 2f 58|58 2f 64 10) maclhwo r3,r4,r5 +- 440: (10 64 2f 59|59 2f 64 10) maclhwo\. r3,r4,r5 +- 444: (10 64 2b d8|d8 2b 64 10) maclhws r3,r4,r5 +- 448: (10 64 2b d9|d9 2b 64 10) maclhws\. r3,r4,r5 +- 44c: (10 64 2f d8|d8 2f 64 10) maclhwso r3,r4,r5 +- 450: (10 64 2f d9|d9 2f 64 10) maclhwso\. r3,r4,r5 +- 454: (10 64 2b 98|98 2b 64 10) maclhwsu r3,r4,r5 +- 458: (10 64 2b 99|99 2b 64 10) maclhwsu\. r3,r4,r5 +- 45c: (10 64 2f 98|98 2f 64 10) maclhwsuo r3,r4,r5 +- 460: (10 64 2f 99|99 2f 64 10) maclhwsuo\. r3,r4,r5 +- 464: (10 64 2b 18|18 2b 64 10) maclhwu r3,r4,r5 +- 468: (10 64 2b 19|19 2b 64 10) maclhwu\. r3,r4,r5 +- 46c: (10 64 2f 18|18 2f 64 10) maclhwuo r3,r4,r5 +- 470: (10 64 2f 19|19 2f 64 10) maclhwuo\. r3,r4,r5 +- 474: (7c 00 06 ac|ac 06 00 7c) mbar +- 478: (7c 00 06 ac|ac 06 00 7c) mbar +- 47c: (7c 20 06 ac|ac 06 20 7c) mbar 1 +- 480: (4c 04 00 00|00 00 04 4c) mcrf cr0,cr1 +- 484: (fd 90 00 80|80 00 90 fd) mcrfs cr3,cr4 +- 488: (7d 80 04 00|00 04 80 7d) mcrxr cr3 +- 48c: (7c 60 00 26|26 00 60 7c) mfcr r3 +- 490: (7c 60 00 26|26 00 60 7c) mfcr r3 +- 494: (7c aa 3a 86|86 3a aa 7c) mfdcr r5,234 +- 498: (7c 64 02 46|46 02 64 7c) mfdcrux r3,r4 +- 49c: (7c 85 02 06|06 02 85 7c) mfdcrx r4,r5 +- 4a0: (ff c0 04 8e|8e 04 c0 ff) mffs f30 +- 4a4: (ff e0 04 8f|8f 04 e0 ff) mffs\. f31 +- 4a8: (7e 60 00 a6|a6 00 60 7e) mfmsr r19 +- 4ac: (7c 78 00 26|26 00 78 7c) mfocrf r3,128 +- 4b0: (7c 60 22 a6|a6 22 60 7c) mfspr r3,128 +- 4b4: (7c 6c 42 a6|a6 42 6c 7c) mftb r3 +- 4b8: (7c 00 04 ac|ac 04 00 7c) msync +- 4bc: (7c 78 01 20|20 01 78 7c) mtocrf 128,r3 +- 4c0: (7c 6f f1 20|20 f1 6f 7c) mtcr r3 +- 4c4: (7d 10 6b 86|86 6b 10 7d) mtdcr 432,r8 +- 4c8: (7c 83 03 46|46 03 83 7c) mtdcrux r3,r4 +- 4cc: (7c e6 03 06|06 03 e6 7c) mtdcrx r6,r7 +- 4d0: (fc 60 00 8c|8c 00 60 fc) mtfsb0 3 +- 4d4: (fc 60 00 8d|8d 00 60 fc) mtfsb0\. 3 +- 4d8: (fc 60 00 4c|4c 00 60 fc) mtfsb1 3 +- 4dc: (fc 60 00 4d|4d 00 60 fc) mtfsb1\. 3 +- 4e0: (fc 0c 55 8e|8e 55 0c fc) mtfsf 6,f10 +- 4e4: (fc 0c 55 8e|8e 55 0c fc) mtfsf 6,f10 +- 4e8: (fc 0d 55 8e|8e 55 0d fc) mtfsf 6,f10,0,1 +- 4ec: (fe 0c 55 8e|8e 55 0c fe) mtfsf 6,f10,1 +- 4f0: (fc 0c 5d 8f|8f 5d 0c fc) mtfsf\. 6,f11 +- 4f4: (fc 0c 5d 8f|8f 5d 0c fc) mtfsf\. 6,f11 +- 4f8: (fc 0d 5d 8f|8f 5d 0d fc) mtfsf\. 6,f11,0,1 +- 4fc: (fe 0c 5d 8f|8f 5d 0c fe) mtfsf\. 6,f11,1 +- 500: (ff 00 01 0c|0c 01 00 ff) mtfsfi 6,0 +- 504: (ff 00 01 0c|0c 01 00 ff) mtfsfi 6,0 +- 508: (ff 00 01 0c|0c 01 00 ff) mtfsfi 6,0 +- 50c: (ff 01 01 0c|0c 01 01 ff) mtfsfi 6,0,1 +- 510: (ff 00 f1 0d|0d f1 00 ff) mtfsfi\. 6,15 +- 514: (ff 00 f1 0d|0d f1 00 ff) mtfsfi\. 6,15 +- 518: (ff 00 f1 0d|0d f1 00 ff) mtfsfi\. 6,15 +- 51c: (ff 01 f1 0d|0d f1 01 ff) mtfsfi\. 6,15,1 +- 520: (7d 40 01 24|24 01 40 7d) mtmsr r10 +- 524: (7c 78 01 20|20 01 78 7c) mtocrf 128,r3 +- 528: (7c 60 23 a6|a6 23 60 7c) mtspr 128,r3 +- 52c: (10 64 29 50|50 29 64 10) mulchw r3,r4,r5 +- 530: (10 64 29 51|51 29 64 10) mulchw\. r3,r4,r5 +- 534: (10 64 29 10|10 29 64 10) mulchwu r3,r4,r5 +- 538: (10 64 29 11|11 29 64 10) mulchwu\. r3,r4,r5 +- 53c: (10 64 28 50|50 28 64 10) mulhhw r3,r4,r5 +- 540: (10 64 28 51|51 28 64 10) mulhhw\. r3,r4,r5 +- 544: (10 64 28 10|10 28 64 10) mulhhwu r3,r4,r5 +- 548: (10 64 28 11|11 28 64 10) mulhhwu\. r3,r4,r5 +- 54c: (7c 64 28 96|96 28 64 7c) mulhw r3,r4,r5 +- 550: (7c 64 28 97|97 28 64 7c) mulhw\. r3,r4,r5 +- 554: (7c 64 28 16|16 28 64 7c) mulhwu r3,r4,r5 +- 558: (7c 64 28 17|17 28 64 7c) mulhwu\. r3,r4,r5 +- 55c: (10 64 2b 50|50 2b 64 10) mullhw r3,r4,r5 +- 560: (10 64 2b 51|51 2b 64 10) mullhw\. r3,r4,r5 +- 564: (10 64 2b 10|10 2b 64 10) mullhwu r3,r4,r5 +- 568: (10 64 2b 11|11 2b 64 10) mullhwu\. r3,r4,r5 +- 56c: (1c 64 00 05|05 00 64 1c) mulli r3,r4,5 +- 570: (7c 64 29 d6|d6 29 64 7c) mullw r3,r4,r5 +- 574: (7c 64 29 d7|d7 29 64 7c) mullw\. r3,r4,r5 +- 578: (7c 64 2d d6|d6 2d 64 7c) mullwo r3,r4,r5 +- 57c: (7c 64 2d d7|d7 2d 64 7c) mullwo\. r3,r4,r5 +- 580: (7f bc f3 b8|b8 f3 bc 7f) nand r28,r29,r30 +- 584: (7f bc f3 b9|b9 f3 bc 7f) nand\. r28,r29,r30 +- 588: (7c 64 00 d0|d0 00 64 7c) neg r3,r4 +- 58c: (7c 64 00 d1|d1 00 64 7c) neg\. r3,r4 +- 590: (7e 11 04 d0|d0 04 11 7e) nego r16,r17 +- 594: (7e 53 04 d1|d1 04 53 7e) nego\. r18,r19 +- 598: (10 64 29 5c|5c 29 64 10) nmacchw r3,r4,r5 +- 59c: (10 64 29 5d|5d 29 64 10) nmacchw\. r3,r4,r5 +- 5a0: (10 64 2d 5c|5c 2d 64 10) nmacchwo r3,r4,r5 +- 5a4: (10 64 2d 5d|5d 2d 64 10) nmacchwo\. r3,r4,r5 +- 5a8: (10 64 29 dc|dc 29 64 10) nmacchws r3,r4,r5 +- 5ac: (10 64 29 dd|dd 29 64 10) nmacchws\. r3,r4,r5 +- 5b0: (10 64 2d dc|dc 2d 64 10) nmacchwso r3,r4,r5 +- 5b4: (10 64 2d dd|dd 2d 64 10) nmacchwso\. r3,r4,r5 +- 5b8: (10 64 28 5c|5c 28 64 10) nmachhw r3,r4,r5 +- 5bc: (10 64 28 5d|5d 28 64 10) nmachhw\. r3,r4,r5 +- 5c0: (10 64 2c 5c|5c 2c 64 10) nmachhwo r3,r4,r5 +- 5c4: (10 64 2c 5d|5d 2c 64 10) nmachhwo\. r3,r4,r5 +- 5c8: (10 64 28 dc|dc 28 64 10) nmachhws r3,r4,r5 +- 5cc: (10 64 28 dd|dd 28 64 10) nmachhws\. r3,r4,r5 +- 5d0: (10 64 2c dc|dc 2c 64 10) nmachhwso r3,r4,r5 +- 5d4: (10 64 2c dd|dd 2c 64 10) nmachhwso\. r3,r4,r5 +- 5d8: (10 64 2b 5c|5c 2b 64 10) nmaclhw r3,r4,r5 +- 5dc: (10 64 2b 5d|5d 2b 64 10) nmaclhw\. r3,r4,r5 +- 5e0: (10 64 2f 5c|5c 2f 64 10) nmaclhwo r3,r4,r5 +- 5e4: (10 64 2f 5d|5d 2f 64 10) nmaclhwo\. r3,r4,r5 +- 5e8: (10 64 2b dc|dc 2b 64 10) nmaclhws r3,r4,r5 +- 5ec: (10 64 2b dd|dd 2b 64 10) nmaclhws\. r3,r4,r5 +- 5f0: (10 64 2f dc|dc 2f 64 10) nmaclhwso r3,r4,r5 +- 5f4: (10 64 2f dd|dd 2f 64 10) nmaclhwso\. r3,r4,r5 +- 5f8: (7e b4 b0 f8|f8 b0 b4 7e) nor r20,r21,r22 +- 5fc: (7e b4 b0 f9|f9 b0 b4 7e) nor\. r20,r21,r22 +- 600: (7c 40 23 78|78 23 40 7c) or r0,r2,r4 +- 604: (7d cc 83 79|79 83 cc 7d) or\. r12,r14,r16 +- 608: (7e 0f 8b 38|38 8b 0f 7e) orc r15,r16,r17 +- 60c: (7e 72 a3 39|39 a3 72 7e) orc\. r18,r19,r20 +- 610: (60 21 00 00|00 00 21 60) ori r1,r1,0 +- 614: (64 83 de ad|ad de 83 64) oris r3,r4,57005 +- 618: (7c 83 00 f4|f4 00 83 7c) popcntb r3,r4 +- 61c: (7c 83 01 34|34 01 83 7c) prtyw r3,r4 +- 620: (4c 00 00 66|66 00 00 4c) rfci +- 624: (4c 00 00 64|64 00 00 4c) rfi +- 628: (4c 00 00 4c|4c 00 00 4c) rfmci +- 62c: (50 83 65 36|36 65 83 50) rlwimi r3,r4,12,20,27 +- 630: (50 83 65 37|37 65 83 50) rlwimi\. r3,r4,12,20,27 +- 634: (54 83 00 36|36 00 83 54) rlwinm r3,r4,0,0,27 +- 638: (54 83 d1 be|be d1 83 54) rlwinm r3,r4,26,6,31 +- 63c: (54 83 20 26|26 20 83 54) rlwinm r3,r4,4,0,19 +- 640: (54 83 00 37|37 00 83 54) rlwinm\. r3,r4,0,0,27 +- 644: (5c 83 28 3e|3e 28 83 5c) rotlw r3,r4,r5 +- 648: (5c 83 28 3f|3f 28 83 5c) rotlw\. r3,r4,r5 +- 64c: (5c 83 28 3e|3e 28 83 5c) rotlw r3,r4,r5 +- 650: (5c 83 28 3f|3f 28 83 5c) rotlw\. r3,r4,r5 +- 654: (44 00 00 02|02 00 00 44) sc +- 658: (7c 83 28 30|30 28 83 7c) slw r3,r4,r5 +- 65c: (7c 83 28 31|31 28 83 7c) slw\. r3,r4,r5 +- 660: (7c 83 2e 30|30 2e 83 7c) sraw r3,r4,r5 +- 664: (7c 83 2e 31|31 2e 83 7c) sraw\. r3,r4,r5 +- 668: (7c 83 86 70|70 86 83 7c) srawi r3,r4,16 +- 66c: (7c 83 86 71|71 86 83 7c) srawi\. r3,r4,16 +- 670: (7c 83 2c 30|30 2c 83 7c) srw r3,r4,r5 +- 674: (7c 83 2c 31|31 2c 83 7c) srw\. r3,r4,r5 +- 678: (54 83 d1 be|be d1 83 54) rlwinm r3,r4,26,6,31 +- 67c: (99 61 00 02|02 00 61 99) stb r11,2\(r1\) +- 680: (9d 81 00 03|03 00 81 9d) stbu r12,3\(r1\) +- 684: (7d ae 79 ee|ee 79 ae 7d) stbux r13,r14,r15 +- 688: (7c 64 29 ae|ae 29 64 7c) stbx r3,r4,r5 +- 68c: (db 21 00 20|20 00 21 db) stfd f25,32\(r1\) +- 690: (df 41 00 28|28 00 41 df) stfdu f26,40\(r1\) +- 694: (7c 01 15 ee|ee 15 01 7c) stfdux f0,r1,r2 +- 698: (7f be fd ae|ae fd be 7f) stfdx f29,r30,r31 +- 69c: (7d 43 27 ae|ae 27 43 7d) stfiwx f10,r3,r4 +- 6a0: (d2 e1 00 14|14 00 e1 d2) stfs f23,20\(r1\) +- 6a4: (d7 01 00 18|18 00 01 d7) stfsu f24,24\(r1\) +- 6a8: (7f 5b e5 6e|6e e5 5b 7f) stfsux f26,r27,r28 +- 6ac: (7e f8 cd 2e|2e cd f8 7e) stfsx f23,r24,r25 +- 6b0: (b2 21 00 0a|0a 00 21 b2) sth r17,10\(r1\) +- 6b4: (7c c7 47 2c|2c 47 c7 7c) sthbrx r6,r7,r8 +- 6b8: (b6 41 00 0c|0c 00 41 b6) sthu r18,12\(r1\) +- 6bc: (7e b6 bb 6e|6e bb b6 7e) sthux r21,r22,r23 +- 6c0: (7d 8d 73 2e|2e 73 8d 7d) sthx r12,r13,r14 +- 6c4: (bc c1 ff f0|f0 ff c1 bc) stmw r6,-16\(r1\) +- 6c8: (7c 64 85 aa|aa 85 64 7c) stswi r3,r4,16 +- 6cc: (7c 64 2d 2a|2a 2d 64 7c) stswx r3,r4,r5 +- 6d0: (90 c7 ff f0|f0 ff c7 90) stw r6,-16\(r7\) +- 6d4: (7c 64 2d 2c|2c 2d 64 7c) stwbrx r3,r4,r5 +- 6d8: (7c 64 29 2d|2d 29 64 7c) stwcx\. r3,r4,r5 +- 6dc: (94 61 00 10|10 00 61 94) stwu r3,16\(r1\) +- 6e0: (7c 64 29 6e|6e 29 64 7c) stwux r3,r4,r5 +- 6e4: (7c 64 29 2e|2e 29 64 7c) stwx r3,r4,r5 +- 6e8: (7c 64 28 50|50 28 64 7c) subf r3,r4,r5 +- 6ec: (7c 64 28 51|51 28 64 7c) subf\. r3,r4,r5 +- 6f0: (7c 64 28 10|10 28 64 7c) subfc r3,r4,r5 +- 6f4: (7c 64 28 11|11 28 64 7c) subfc\. r3,r4,r5 +- 6f8: (7c 64 2c 10|10 2c 64 7c) subfco r3,r4,r5 +- 6fc: (7c 64 2c 11|11 2c 64 7c) subfco\. r3,r4,r5 +- 700: (7c 64 29 10|10 29 64 7c) subfe r3,r4,r5 +- 704: (7c 64 29 11|11 29 64 7c) subfe\. r3,r4,r5 +- 708: (7c 64 2d 10|10 2d 64 7c) subfeo r3,r4,r5 +- 70c: (7c 64 2d 11|11 2d 64 7c) subfeo\. r3,r4,r5 +- 710: (20 64 00 05|05 00 64 20) subfic r3,r4,5 +- 714: (7c 64 01 d0|d0 01 64 7c) subfme r3,r4 +- 718: (7c 64 01 d1|d1 01 64 7c) subfme\. r3,r4 +- 71c: (7c 64 05 d0|d0 05 64 7c) subfmeo r3,r4 +- 720: (7c 64 05 d1|d1 05 64 7c) subfmeo\. r3,r4 +- 724: (7c 64 2c 50|50 2c 64 7c) subfo r3,r4,r5 +- 728: (7c 64 2c 51|51 2c 64 7c) subfo\. r3,r4,r5 +- 72c: (7c 64 01 90|90 01 64 7c) subfze r3,r4 +- 730: (7c 64 01 91|91 01 64 7c) subfze\. r3,r4 +- 734: (7c 64 05 90|90 05 64 7c) subfzeo r3,r4 +- 738: (7c 64 05 91|91 05 64 7c) subfzeo\. r3,r4 +- 73c: (7c 07 46 24|24 46 07 7c) tlbivax r7,r8 +- 740: (7c 22 3f 64|64 3f 22 7c) tlbre r1,r2,7 +- 744: (7c 0b 67 24|24 67 0b 7c) tlbsx r11,r12 +- 748: (7d 8d 77 24|24 77 8d 7d) tlbsx r12,r13,r14 +- 74c: (7d 8d 77 25|25 77 8d 7d) tlbsx\. r12,r13,r14 +- 750: (7c 00 04 6c|6c 04 00 7c) tlbsync +- 754: (7c 00 07 a4|a4 07 00 7c) tlbwe +- 758: (7c 00 07 a4|a4 07 00 7c) tlbwe +- 75c: (7c 21 0f a4|a4 0f 21 7c) tlbwe r1,r1,1 +- 760: (7f e0 00 08|08 00 e0 7f) trap +- 764: (7f e0 00 08|08 00 e0 7f) trap +- 768: (7c 83 20 08|08 20 83 7c) tweq r3,r4 +- 76c: (7c a3 20 08|08 20 a3 7c) twlge r3,r4 +- 770: (7c 83 20 08|08 20 83 7c) tweq r3,r4 +- 774: (0d 03 00 0f|0f 00 03 0d) twgti r3,15 +- 778: (0c c3 00 0f|0f 00 c3 0c) twllei r3,15 +- 77c: (0d 03 00 0f|0f 00 03 0d) twgti r3,15 +- 780: (7c a3 20 08|08 20 a3 7c) twlge r3,r4 +- 784: (0c c3 00 0f|0f 00 c3 0c) twllei r3,15 +- 788: (7c 60 01 06|06 01 60 7c) wrtee r3 +- 78c: (7c 00 81 46|46 81 00 7c) wrteei 1 +- 790: (7f dd fa 78|78 fa dd 7f) xor r29,r30,r31 +- 794: (7f dd fa 79|79 fa dd 7f) xor\. r29,r30,r31 +- 798: (68 83 de ad|ad de 83 68) xori r3,r4,57005 +- 79c: (6c 83 de ad|ad de 83 6c) xoris r3,r4,57005 ++.*: (7c 64 2a 14|14 2a 64 7c) add r3,r4,r5 ++.*: (7c 64 2a 15|15 2a 64 7c) add\. r3,r4,r5 ++.*: (7c 64 28 14|14 28 64 7c) addc r3,r4,r5 ++.*: (7c 64 28 15|15 28 64 7c) addc\. r3,r4,r5 ++.*: (7c 64 2c 14|14 2c 64 7c) addco r3,r4,r5 ++.*: (7c 64 2c 15|15 2c 64 7c) addco\. r3,r4,r5 ++.*: (7c 64 29 14|14 29 64 7c) adde r3,r4,r5 ++.*: (7c 64 29 15|15 29 64 7c) adde\. r3,r4,r5 ++.*: (7c 64 2d 14|14 2d 64 7c) addeo r3,r4,r5 ++.*: (7c 64 2d 15|15 2d 64 7c) addeo\. r3,r4,r5 ++.*: (38 64 ff 80|80 ff 64 38) addi r3,r4,-128 ++.*: (30 64 ff 80|80 ff 64 30) addic r3,r4,-128 ++.*: (34 64 ff 80|80 ff 64 34) addic\. r3,r4,-128 ++.*: (3c 64 ff 80|80 ff 64 3c) addis r3,r4,-128 ++.*: (7c 64 01 d4|d4 01 64 7c) addme r3,r4 ++.*: (7c 64 01 d5|d5 01 64 7c) addme\. r3,r4 ++.*: (7c 64 05 d4|d4 05 64 7c) addmeo r3,r4 ++.*: (7c 64 05 d5|d5 05 64 7c) addmeo\. r3,r4 ++.*: (7c 64 2e 14|14 2e 64 7c) addo r3,r4,r5 ++.*: (7c 64 2e 15|15 2e 64 7c) addo\. r3,r4,r5 ++.*: (7c 64 01 94|94 01 64 7c) addze r3,r4 ++.*: (7c 64 01 95|95 01 64 7c) addze\. r3,r4 ++.*: (7c 64 05 94|94 05 64 7c) addzeo r3,r4 ++.*: (7c 64 05 95|95 05 64 7c) addzeo\. r3,r4 ++.*: (7c 83 28 38|38 28 83 7c) and r3,r4,r5 ++.*: (7c 83 28 39|39 28 83 7c) and\. r3,r4,r5 ++.*: (7d cd 78 78|78 78 cd 7d) andc r13,r14,r15 ++.*: (7e 30 90 79|79 90 30 7e) andc\. r16,r17,r18 ++.*: (70 83 de ad|ad de 83 70) andi\. r3,r4,57005 ++.*: (74 83 de ad|ad de 83 74) andis\. r3,r4,57005 ++.*: (48 00 00 02|02 00 00 48) ba 0 ++.*: (40 01 00 00|00 00 01 40) bdnzf gt,7c ++.*: (40 85 00 02|02 00 85 40) blea cr1,0 ++.*: (4d 80 04 20|20 04 80 4d) bltctr ++.*: (4c 8a 04 20|20 04 8a 4c) bnectr cr2 ++.*: (4c 86 04 20|20 04 86 4c) bnectr cr1 ++.*: (4c 86 04 20|20 04 86 4c) bnectr cr1 ++.*: (4d 80 04 21|21 04 80 4d) bltctrl ++.*: (4c 8a 04 21|21 04 8a 4c) bnectrl cr2 ++.*: (4c 86 04 21|21 04 86 4c) bnectrl cr1 ++.*: (4c 86 04 21|21 04 86 4c) bnectrl cr1 ++.*: (40 43 00 01|01 00 43 40) bdzfl so,a4 ++.*: (4d 80 00 20|20 00 80 4d) bltlr ++.*: (4c 8a 00 20|20 00 8a 4c) bnelr cr2 ++.*: (4c 86 00 20|20 00 86 4c) bnelr cr1 ++.*: (4c 86 00 20|20 00 86 4c) bnelr cr1 ++.*: (4d 80 00 21|21 00 80 4d) bltlrl ++.*: (4c 8a 00 21|21 00 8a 4c) bnelrl cr2 ++.*: (4c 86 00 21|21 00 86 4c) bnelrl cr1 ++.*: (4c 86 00 21|21 00 86 4c) bnelrl cr1 ++.*: (48 00 00 00|00 00 00 48) b c8 ++.*: (48 00 00 01|01 00 00 48) bl cc ++.*: (54 83 00 36|36 00 83 54) rlwinm r3,r4,0,0,27 ++.*: (7c 03 20 00|00 20 03 7c) cmpw r3,r4 ++.*: (7f 83 20 00|00 20 83 7f) cmpw cr7,r3,r4 ++.*: (7c 83 2b f8|f8 2b 83 7c) cmpb r3,r4,r5 ++.*: (7c 83 2b f8|f8 2b 83 7c) cmpb r3,r4,r5 ++.*: (2c 03 ff 59|59 ff 03 2c) cmpwi r3,-167 ++.*: (2f 83 ff 59|59 ff 83 2f) cmpwi cr7,r3,-167 ++.*: (7c 03 20 40|40 20 03 7c) cmplw r3,r4 ++.*: (7f 83 20 40|40 20 83 7f) cmplw cr7,r3,r4 ++.*: (28 03 00 a7|a7 00 03 28) cmplwi r3,167 ++.*: (2b 83 00 a7|a7 00 83 2b) cmplwi cr7,r3,167 ++.*: (7c 03 20 40|40 20 03 7c) cmplw r3,r4 ++.*: (28 03 00 a7|a7 00 03 28) cmplwi r3,167 ++.*: (7c 03 20 00|00 20 03 7c) cmpw r3,r4 ++.*: (2c 03 ff 59|59 ff 03 2c) cmpwi r3,-167 ++.*: (7d 6a 00 34|34 00 6a 7d) cntlzw r10,r11 ++.*: (7d 6a 00 35|35 00 6a 7d) cntlzw\. r10,r11 ++.*: (4c 85 32 02|02 32 85 4c) crand 4\*cr1\+lt,4\*cr1\+gt,4\*cr1\+eq ++.*: (4c 64 29 02|02 29 64 4c) crandc so,4\*cr1\+lt,4\*cr1\+gt ++.*: (4c e0 0a 42|42 0a e0 4c) creqv 4\*cr1\+so,lt,gt ++.*: (4c 22 19 c2|c2 19 22 4c) crnand gt,eq,so ++.*: (4c 01 10 42|42 10 01 4c) crnor lt,gt,eq ++.*: (4c a6 3b 82|82 3b a6 4c) cror 4\*cr1\+gt,4\*cr1\+eq,4\*cr1\+so ++.*: (4c 43 23 42|42 23 43 4c) crorc eq,so,4\*cr1\+lt ++.*: (4c c7 01 82|82 01 c7 4c) crxor 4\*cr1\+eq,4\*cr1\+so,lt ++.*: (7c 09 55 ec|ec 55 09 7c) dcba r9,r10 ++.*: (7c 06 38 ac|ac 38 06 7c) dcbf r6,r7 ++.*: (7c 06 38 ac|ac 38 06 7c) dcbf r6,r7 ++.*: (7c 06 3b ac|ac 3b 06 7c) dcbi r6,r7 ++.*: (7c 85 33 0c|0c 33 85 7c) dcblc 4,r5,r6 ++.*: (7c 06 38 6c|6c 38 06 7c) dcbst r6,r7 ++.*: (7c 05 32 2c|2c 32 05 7c) dcbt r5,r6 ++.*: (7c 05 32 2c|2c 32 05 7c) dcbt r5,r6 ++.*: (7d 05 32 2c|2c 32 05 7d) dcbt 8,r5,r6 ++.*: (7c e8 49 4c|4c 49 e8 7c) dcbtls 7,r8,r9 ++.*: (7c 06 39 ec|ec 39 06 7c) dcbtst r6,r7 ++.*: (7c 06 39 ec|ec 39 06 7c) dcbtst r6,r7 ++.*: (7d 26 39 ec|ec 39 26 7d) dcbtst 9,r6,r7 ++.*: (7d 4b 61 0c|0c 61 4b 7d) dcbtstls 10,r11,r12 ++.*: (7c 01 17 ec|ec 17 01 7c) dcbz r1,r2 ++.*: (7c 05 37 ec|ec 37 05 7c) dcbz r5,r6 ++.*: (7c 00 03 8c|8c 03 00 7c) dccci ++.*: (7c 00 03 8c|8c 03 00 7c) dccci ++.*: (7c 00 03 8c|8c 03 00 7c) dccci ++.*: (7c 20 03 8c|8c 03 20 7c) dci 1 ++.*: (7d 4b 63 d6|d6 63 4b 7d) divw r10,r11,r12 ++.*: (7d 6c 6b d7|d7 6b 6c 7d) divw\. r11,r12,r13 ++.*: (7d 4b 67 d6|d6 67 4b 7d) divwo r10,r11,r12 ++.*: (7d 6c 6f d7|d7 6f 6c 7d) divwo\. r11,r12,r13 ++.*: (7d 4b 63 96|96 63 4b 7d) divwu r10,r11,r12 ++.*: (7d 6c 6b 97|97 6b 6c 7d) divwu\. r11,r12,r13 ++.*: (7d 4b 67 96|96 67 4b 7d) divwuo r10,r11,r12 ++.*: (7d 6c 6f 97|97 6f 6c 7d) divwuo\. r11,r12,r13 ++.*: (7c 83 28 9c|9c 28 83 7c) dlmzb r3,r4,r5 ++.*: (7c 83 28 9d|9d 28 83 7c) dlmzb\. r3,r4,r5 ++.*: (7d 6a 62 38|38 62 6a 7d) eqv r10,r11,r12 ++.*: (7d 6a 62 39|39 62 6a 7d) eqv\. r10,r11,r12 ++.*: (54 83 20 26|26 20 83 54) rlwinm r3,r4,4,0,19 ++.*: (7c 83 07 74|74 07 83 7c) extsb r3,r4 ++.*: (7c 83 07 75|75 07 83 7c) extsb\. r3,r4 ++.*: (7c 83 07 34|34 07 83 7c) extsh r3,r4 ++.*: (7c 83 07 35|35 07 83 7c) extsh\. r3,r4 ++.*: (fe a0 fa 10|10 fa a0 fe) fabs f21,f31 ++.*: (fe a0 fa 11|11 fa a0 fe) fabs\. f21,f31 ++.*: (fd 4b 60 2a|2a 60 4b fd) fadd f10,f11,f12 ++.*: (fd 4b 60 2b|2b 60 4b fd) fadd\. f10,f11,f12 ++.*: (ed 4b 60 2a|2a 60 4b ed) fadds f10,f11,f12 ++.*: (ed 4b 60 2b|2b 60 4b ed) fadds\. f10,f11,f12 ++.*: (fd 40 5e 9c|9c 5e 40 fd) fcfid f10,f11 ++.*: (fd 40 5e 9d|9d 5e 40 fd) fcfid\. f10,f11 ++.*: (fd 8a 58 40|40 58 8a fd) fcmpo cr3,f10,f11 ++.*: (fd 84 28 00|00 28 84 fd) fcmpu cr3,f4,f5 ++.*: (fd 4b 60 10|10 60 4b fd) fcpsgn f10,f11,f12 ++.*: (fd 4b 60 11|11 60 4b fd) fcpsgn\. f10,f11,f12 ++.*: (fd 40 5e 5c|5c 5e 40 fd) fctid f10,f11 ++.*: (fd 40 5e 5d|5d 5e 40 fd) fctid\. f10,f11 ++.*: (fd 40 5e 5e|5e 5e 40 fd) fctidz f10,f11 ++.*: (fd 40 5e 5f|5f 5e 40 fd) fctidz\. f10,f11 ++.*: (fd 40 58 1c|1c 58 40 fd) fctiw f10,f11 ++.*: (fd 40 58 1d|1d 58 40 fd) fctiw\. f10,f11 ++.*: (fd 40 58 1e|1e 58 40 fd) fctiwz f10,f11 ++.*: (fd 40 58 1f|1f 58 40 fd) fctiwz\. f10,f11 ++.*: (fd 4b 60 24|24 60 4b fd) fdiv f10,f11,f12 ++.*: (fd 4b 60 25|25 60 4b fd) fdiv\. f10,f11,f12 ++.*: (ed 4b 60 24|24 60 4b ed) fdivs f10,f11,f12 ++.*: (ed 4b 60 25|25 60 4b ed) fdivs\. f10,f11,f12 ++.*: (fd 4b 6b 3a|3a 6b 4b fd) fmadd f10,f11,f12,f13 ++.*: (fd 4b 6b 3b|3b 6b 4b fd) fmadd\. f10,f11,f12,f13 ++.*: (ed 4b 6b 3a|3a 6b 4b ed) fmadds f10,f11,f12,f13 ++.*: (ed 4b 6b 3b|3b 6b 4b ed) fmadds\. f10,f11,f12,f13 ++.*: (fc 60 20 90|90 20 60 fc) fmr f3,f4 ++.*: (fc 60 20 91|91 20 60 fc) fmr\. f3,f4 ++.*: (fd 4b 6b 38|38 6b 4b fd) fmsub f10,f11,f12,f13 ++.*: (fd 4b 6b 39|39 6b 4b fd) fmsub\. f10,f11,f12,f13 ++.*: (ed 4b 6b 38|38 6b 4b ed) fmsubs f10,f11,f12,f13 ++.*: (ed 4b 6b 39|39 6b 4b ed) fmsubs\. f10,f11,f12,f13 ++.*: (fd 4b 03 32|32 03 4b fd) fmul f10,f11,f12 ++.*: (fd 4b 03 33|33 03 4b fd) fmul\. f10,f11,f12 ++.*: (ed 4b 03 32|32 03 4b ed) fmuls f10,f11,f12 ++.*: (ed 4b 03 33|33 03 4b ed) fmuls\. f10,f11,f12 ++.*: (fe 80 f1 10|10 f1 80 fe) fnabs f20,f30 ++.*: (fe 80 f1 11|11 f1 80 fe) fnabs\. f20,f30 ++.*: (fc 60 20 50|50 20 60 fc) fneg f3,f4 ++.*: (fc 60 20 51|51 20 60 fc) fneg\. f3,f4 ++.*: (fd 4b 6b 3e|3e 6b 4b fd) fnmadd f10,f11,f12,f13 ++.*: (fd 4b 6b 3f|3f 6b 4b fd) fnmadd\. f10,f11,f12,f13 ++.*: (ed 4b 6b 3e|3e 6b 4b ed) fnmadds f10,f11,f12,f13 ++.*: (ed 4b 6b 3f|3f 6b 4b ed) fnmadds\. f10,f11,f12,f13 ++.*: (fd 4b 6b 3c|3c 6b 4b fd) fnmsub f10,f11,f12,f13 ++.*: (fd 4b 6b 3d|3d 6b 4b fd) fnmsub\. f10,f11,f12,f13 ++.*: (ed 4b 6b 3c|3c 6b 4b ed) fnmsubs f10,f11,f12,f13 ++.*: (ed 4b 6b 3d|3d 6b 4b ed) fnmsubs\. f10,f11,f12,f13 ++.*: (fd c0 78 30|30 78 c0 fd) fre f14,f15 ++.*: (fd c0 78 31|31 78 c0 fd) fre\. f14,f15 ++.*: (ed c0 78 30|30 78 c0 ed) fres f14,f15 ++.*: (ed c0 78 31|31 78 c0 ed) fres\. f14,f15 ++.*: (fd 40 5b d0|d0 5b 40 fd) frim f10,f11 ++.*: (fd 40 5b d1|d1 5b 40 fd) frim\. f10,f11 ++.*: (fd 40 5b 10|10 5b 40 fd) frin f10,f11 ++.*: (fd 40 5b 11|11 5b 40 fd) frin\. f10,f11 ++.*: (fd 40 5b 90|90 5b 40 fd) frip f10,f11 ++.*: (fd 40 5b 91|91 5b 40 fd) frip\. f10,f11 ++.*: (fd 40 5b 50|50 5b 40 fd) friz f10,f11 ++.*: (fd 40 5b 51|51 5b 40 fd) friz\. f10,f11 ++.*: (fc c0 38 18|18 38 c0 fc) frsp f6,f7 ++.*: (fd 00 48 19|19 48 00 fd) frsp\. f8,f9 ++.*: (fd c0 78 34|34 78 c0 fd) frsqrte f14,f15 ++.*: (fd c0 78 35|35 78 c0 fd) frsqrte\. f14,f15 ++.*: (ed c0 78 34|34 78 c0 ed) frsqrtes f14,f15 ++.*: (ed c0 78 35|35 78 c0 ed) frsqrtes\. f14,f15 ++.*: (fd 4b 6b 2e|2e 6b 4b fd) fsel f10,f11,f12,f13 ++.*: (fd 4b 6b 2f|2f 6b 4b fd) fsel\. f10,f11,f12,f13 ++.*: (fd 40 58 2c|2c 58 40 fd) fsqrt f10,f11 ++.*: (fd 40 58 2d|2d 58 40 fd) fsqrt\. f10,f11 ++.*: (ed 40 58 2c|2c 58 40 ed) fsqrts f10,f11 ++.*: (ed 40 58 2d|2d 58 40 ed) fsqrts\. f10,f11 ++.*: (fd 4b 60 28|28 60 4b fd) fsub f10,f11,f12 ++.*: (fd 4b 60 29|29 60 4b fd) fsub\. f10,f11,f12 ++.*: (ed 4b 60 28|28 60 4b ed) fsubs f10,f11,f12 ++.*: (ed 4b 60 29|29 60 4b ed) fsubs\. f10,f11,f12 ++.*: (7c 03 27 ac|ac 27 03 7c) icbi r3,r4 ++.*: (7e 11 91 cc|cc 91 11 7e) icblc 16,r17,r18 ++.*: (7c a8 48 2c|2c 48 a8 7c) icbt 5,r8,r9 ++.*: (7d ae 7b cc|cc 7b ae 7d) icbtls 13,r14,r15 ++.*: (7c 00 07 8c|8c 07 00 7c) iccci ++.*: (7c 00 07 8c|8c 07 00 7c) iccci ++.*: (7c 00 07 8c|8c 07 00 7c) iccci ++.*: (7c 20 07 8c|8c 07 20 7c) ici 1 ++.*: (7c 03 27 cc|cc 27 03 7c) icread r3,r4 ++.*: (50 83 65 36|36 65 83 50) rlwimi r3,r4,12,20,27 ++.*: (7c 43 27 1e|1e 27 43 7c) isel r2,r3,r4,28 ++.*: (4c 00 01 2c|2c 01 00 4c) isync ++.*: (89 21 00 00|00 00 21 89) lbz r9,0\(r1\) ++.*: (8d 41 00 01|01 00 41 8d) lbzu r10,1\(r1\) ++.*: (7e 95 b0 ee|ee b0 95 7e) lbzux r20,r21,r22 ++.*: (7c 64 28 ae|ae 28 64 7c) lbzx r3,r4,r5 ++.*: (ca a1 00 08|08 00 a1 ca) lfd f21,8\(r1\) ++.*: (ce c1 00 10|10 00 c1 ce) lfdu f22,16\(r1\) ++.*: (7e 95 b4 ee|ee b4 95 7e) lfdux f20,r21,r22 ++.*: (7d ae 7c ae|ae 7c ae 7d) lfdx f13,r14,r15 ++.*: (7d 43 26 ae|ae 26 43 7d) lfiwax f10,r3,r4 ++.*: (c2 61 00 00|00 00 61 c2) lfs f19,0\(r1\) ++.*: (c6 81 00 04|04 00 81 c6) lfsu f20,4\(r1\) ++.*: (7d 4b 64 6e|6e 64 4b 7d) lfsux f10,r11,r12 ++.*: (7d 4b 64 2e|2e 64 4b 7d) lfsx f10,r11,r12 ++.*: (a9 e1 00 06|06 00 e1 a9) lha r15,6\(r1\) ++.*: (ae 01 00 08|08 00 01 ae) lhau r16,8\(r1\) ++.*: (7d 2a 5a ee|ee 5a 2a 7d) lhaux r9,r10,r11 ++.*: (7d 2a 5a ae|ae 5a 2a 7d) lhax r9,r10,r11 ++.*: (7c 64 2e 2c|2c 2e 64 7c) lhbrx r3,r4,r5 ++.*: (a1 a1 00 00|00 00 a1 a1) lhz r13,0\(r1\) ++.*: (a5 c1 00 02|02 00 c1 a5) lhzu r14,2\(r1\) ++.*: (7e 96 c2 6e|6e c2 96 7e) lhzux r20,r22,r24 ++.*: (7e f8 ca 2e|2e ca f8 7e) lhzx r23,r24,r25 ++.*: (7c 64 28 28|28 28 64 7c) lwarx r3,r4,r5 ++.*: (7c 64 28 28|28 28 64 7c) lwarx r3,r4,r5 ++.*: (7c 64 28 29|29 28 64 7c) lwarx r3,r4,r5,1 ++.*: (7c 64 2c 2c|2c 2c 64 7c) lwbrx r3,r4,r5 ++.*: (80 c7 00 00|00 00 c7 80) lwz r6,0\(r7\) ++.*: (84 61 00 10|10 00 61 84) lwzu r3,16\(r1\) ++.*: (7c 64 28 6e|6e 28 64 7c) lwzux r3,r4,r5 ++.*: (7c 64 28 2e|2e 28 64 7c) lwzx r3,r4,r5 ++.*: (10 64 29 58|58 29 64 10) macchw r3,r4,r5 ++.*: (10 64 29 59|59 29 64 10) macchw\. r3,r4,r5 ++.*: (10 64 2d 58|58 2d 64 10) macchwo r3,r4,r5 ++.*: (10 64 2d 59|59 2d 64 10) macchwo\. r3,r4,r5 ++.*: (10 64 29 d8|d8 29 64 10) macchws r3,r4,r5 ++.*: (10 64 29 d9|d9 29 64 10) macchws\. r3,r4,r5 ++.*: (10 64 2d d8|d8 2d 64 10) macchwso r3,r4,r5 ++.*: (10 64 2d d9|d9 2d 64 10) macchwso\. r3,r4,r5 ++.*: (10 64 29 98|98 29 64 10) macchwsu r3,r4,r5 ++.*: (10 64 29 99|99 29 64 10) macchwsu\. r3,r4,r5 ++.*: (10 64 2d 98|98 2d 64 10) macchwsuo r3,r4,r5 ++.*: (10 64 2d 99|99 2d 64 10) macchwsuo\. r3,r4,r5 ++.*: (10 64 29 18|18 29 64 10) macchwu r3,r4,r5 ++.*: (10 64 29 19|19 29 64 10) macchwu\. r3,r4,r5 ++.*: (10 64 2d 18|18 2d 64 10) macchwuo r3,r4,r5 ++.*: (10 64 2d 19|19 2d 64 10) macchwuo\. r3,r4,r5 ++.*: (10 64 28 58|58 28 64 10) machhw r3,r4,r5 ++.*: (10 64 28 59|59 28 64 10) machhw\. r3,r4,r5 ++.*: (10 64 2c 58|58 2c 64 10) machhwo r3,r4,r5 ++.*: (10 64 2c 59|59 2c 64 10) machhwo\. r3,r4,r5 ++.*: (10 64 28 d8|d8 28 64 10) machhws r3,r4,r5 ++.*: (10 64 28 d9|d9 28 64 10) machhws\. r3,r4,r5 ++.*: (10 64 2c d8|d8 2c 64 10) machhwso r3,r4,r5 ++.*: (10 64 2c d9|d9 2c 64 10) machhwso\. r3,r4,r5 ++.*: (10 64 28 98|98 28 64 10) machhwsu r3,r4,r5 ++.*: (10 64 28 99|99 28 64 10) machhwsu\. r3,r4,r5 ++.*: (10 64 2c 98|98 2c 64 10) machhwsuo r3,r4,r5 ++.*: (10 64 2c 99|99 2c 64 10) machhwsuo\. r3,r4,r5 ++.*: (10 64 28 18|18 28 64 10) machhwu r3,r4,r5 ++.*: (10 64 28 19|19 28 64 10) machhwu\. r3,r4,r5 ++.*: (10 64 2c 18|18 2c 64 10) machhwuo r3,r4,r5 ++.*: (10 64 2c 19|19 2c 64 10) machhwuo\. r3,r4,r5 ++.*: (10 64 2b 58|58 2b 64 10) maclhw r3,r4,r5 ++.*: (10 64 2b 59|59 2b 64 10) maclhw\. r3,r4,r5 ++.*: (10 64 2f 58|58 2f 64 10) maclhwo r3,r4,r5 ++.*: (10 64 2f 59|59 2f 64 10) maclhwo\. r3,r4,r5 ++.*: (10 64 2b d8|d8 2b 64 10) maclhws r3,r4,r5 ++.*: (10 64 2b d9|d9 2b 64 10) maclhws\. r3,r4,r5 ++.*: (10 64 2f d8|d8 2f 64 10) maclhwso r3,r4,r5 ++.*: (10 64 2f d9|d9 2f 64 10) maclhwso\. r3,r4,r5 ++.*: (10 64 2b 98|98 2b 64 10) maclhwsu r3,r4,r5 ++.*: (10 64 2b 99|99 2b 64 10) maclhwsu\. r3,r4,r5 ++.*: (10 64 2f 98|98 2f 64 10) maclhwsuo r3,r4,r5 ++.*: (10 64 2f 99|99 2f 64 10) maclhwsuo\. r3,r4,r5 ++.*: (10 64 2b 18|18 2b 64 10) maclhwu r3,r4,r5 ++.*: (10 64 2b 19|19 2b 64 10) maclhwu\. r3,r4,r5 ++.*: (10 64 2f 18|18 2f 64 10) maclhwuo r3,r4,r5 ++.*: (10 64 2f 19|19 2f 64 10) maclhwuo\. r3,r4,r5 ++.*: (7c 00 06 ac|ac 06 00 7c) mbar ++.*: (7c 00 06 ac|ac 06 00 7c) mbar ++.*: (7c 20 06 ac|ac 06 20 7c) mbar 1 ++.*: (4c 04 00 00|00 00 04 4c) mcrf cr0,cr1 ++.*: (fd 90 00 80|80 00 90 fd) mcrfs cr3,cr4 ++.*: (7d 80 04 00|00 04 80 7d) mcrxr cr3 ++.*: (7c 60 00 26|26 00 60 7c) mfcr r3 ++.*: (7c 60 00 26|26 00 60 7c) mfcr r3 ++.*: (7c aa 3a 86|86 3a aa 7c) mfdcr r5,234 ++.*: (7c 64 02 46|46 02 64 7c) mfdcrux r3,r4 ++.*: (7c 85 02 06|06 02 85 7c) mfdcrx r4,r5 ++.*: (ff c0 04 8e|8e 04 c0 ff) mffs f30 ++.*: (ff e0 04 8f|8f 04 e0 ff) mffs\. f31 ++.*: (7e 60 00 a6|a6 00 60 7e) mfmsr r19 ++.*: (7c 78 00 26|26 00 78 7c) mfocrf r3,128 ++.*: (7c 60 22 a6|a6 22 60 7c) mfspr r3,128 ++.*: (7c 6c 42 a6|a6 42 6c 7c) mftb r3 ++.*: (7c 00 04 ac|ac 04 00 7c) msync ++.*: (7c 78 01 20|20 01 78 7c) mtocrf 128,r3 ++.*: (7c 6f f1 20|20 f1 6f 7c) mtcr r3 ++.*: (7d 10 6b 86|86 6b 10 7d) mtdcr 432,r8 ++.*: (7c 83 03 46|46 03 83 7c) mtdcrux r3,r4 ++.*: (7c e6 03 06|06 03 e6 7c) mtdcrx r6,r7 ++.*: (fc 60 00 8c|8c 00 60 fc) mtfsb0 3 ++.*: (fc 60 00 8d|8d 00 60 fc) mtfsb0\. 3 ++.*: (fc 60 00 4c|4c 00 60 fc) mtfsb1 3 ++.*: (fc 60 00 4d|4d 00 60 fc) mtfsb1\. 3 ++.*: (fc 0c 55 8e|8e 55 0c fc) mtfsf 6,f10 ++.*: (fc 0c 55 8e|8e 55 0c fc) mtfsf 6,f10 ++.*: (fc 0d 55 8e|8e 55 0d fc) mtfsf 6,f10,0,1 ++.*: (fe 0c 55 8e|8e 55 0c fe) mtfsf 6,f10,1 ++.*: (fc 0c 5d 8f|8f 5d 0c fc) mtfsf\. 6,f11 ++.*: (fc 0c 5d 8f|8f 5d 0c fc) mtfsf\. 6,f11 ++.*: (fc 0d 5d 8f|8f 5d 0d fc) mtfsf\. 6,f11,0,1 ++.*: (fe 0c 5d 8f|8f 5d 0c fe) mtfsf\. 6,f11,1 ++.*: (ff 00 01 0c|0c 01 00 ff) mtfsfi 6,0 ++.*: (ff 00 01 0c|0c 01 00 ff) mtfsfi 6,0 ++.*: (ff 00 01 0c|0c 01 00 ff) mtfsfi 6,0 ++.*: (ff 01 01 0c|0c 01 01 ff) mtfsfi 6,0,1 ++.*: (ff 00 f1 0d|0d f1 00 ff) mtfsfi\. 6,15 ++.*: (ff 00 f1 0d|0d f1 00 ff) mtfsfi\. 6,15 ++.*: (ff 00 f1 0d|0d f1 00 ff) mtfsfi\. 6,15 ++.*: (ff 01 f1 0d|0d f1 01 ff) mtfsfi\. 6,15,1 ++.*: (7d 40 01 24|24 01 40 7d) mtmsr r10 ++.*: (7c 78 01 20|20 01 78 7c) mtocrf 128,r3 ++.*: (7c 60 23 a6|a6 23 60 7c) mtspr 128,r3 ++.*: (10 64 29 50|50 29 64 10) mulchw r3,r4,r5 ++.*: (10 64 29 51|51 29 64 10) mulchw\. r3,r4,r5 ++.*: (10 64 29 10|10 29 64 10) mulchwu r3,r4,r5 ++.*: (10 64 29 11|11 29 64 10) mulchwu\. r3,r4,r5 ++.*: (10 64 28 50|50 28 64 10) mulhhw r3,r4,r5 ++.*: (10 64 28 51|51 28 64 10) mulhhw\. r3,r4,r5 ++.*: (10 64 28 10|10 28 64 10) mulhhwu r3,r4,r5 ++.*: (10 64 28 11|11 28 64 10) mulhhwu\. r3,r4,r5 ++.*: (7c 64 28 96|96 28 64 7c) mulhw r3,r4,r5 ++.*: (7c 64 28 97|97 28 64 7c) mulhw\. r3,r4,r5 ++.*: (7c 64 28 16|16 28 64 7c) mulhwu r3,r4,r5 ++.*: (7c 64 28 17|17 28 64 7c) mulhwu\. r3,r4,r5 ++.*: (10 64 2b 50|50 2b 64 10) mullhw r3,r4,r5 ++.*: (10 64 2b 51|51 2b 64 10) mullhw\. r3,r4,r5 ++.*: (10 64 2b 10|10 2b 64 10) mullhwu r3,r4,r5 ++.*: (10 64 2b 11|11 2b 64 10) mullhwu\. r3,r4,r5 ++.*: (1c 64 00 05|05 00 64 1c) mulli r3,r4,5 ++.*: (7c 64 29 d6|d6 29 64 7c) mullw r3,r4,r5 ++.*: (7c 64 29 d7|d7 29 64 7c) mullw\. r3,r4,r5 ++.*: (7c 64 2d d6|d6 2d 64 7c) mullwo r3,r4,r5 ++.*: (7c 64 2d d7|d7 2d 64 7c) mullwo\. r3,r4,r5 ++.*: (7f bc f3 b8|b8 f3 bc 7f) nand r28,r29,r30 ++.*: (7f bc f3 b9|b9 f3 bc 7f) nand\. r28,r29,r30 ++.*: (7c 64 00 d0|d0 00 64 7c) neg r3,r4 ++.*: (7c 64 00 d1|d1 00 64 7c) neg\. r3,r4 ++.*: (7e 11 04 d0|d0 04 11 7e) nego r16,r17 ++.*: (7e 53 04 d1|d1 04 53 7e) nego\. r18,r19 ++.*: (10 64 29 5c|5c 29 64 10) nmacchw r3,r4,r5 ++.*: (10 64 29 5d|5d 29 64 10) nmacchw\. r3,r4,r5 ++.*: (10 64 2d 5c|5c 2d 64 10) nmacchwo r3,r4,r5 ++.*: (10 64 2d 5d|5d 2d 64 10) nmacchwo\. r3,r4,r5 ++.*: (10 64 29 dc|dc 29 64 10) nmacchws r3,r4,r5 ++.*: (10 64 29 dd|dd 29 64 10) nmacchws\. r3,r4,r5 ++.*: (10 64 2d dc|dc 2d 64 10) nmacchwso r3,r4,r5 ++.*: (10 64 2d dd|dd 2d 64 10) nmacchwso\. r3,r4,r5 ++.*: (10 64 28 5c|5c 28 64 10) nmachhw r3,r4,r5 ++.*: (10 64 28 5d|5d 28 64 10) nmachhw\. r3,r4,r5 ++.*: (10 64 2c 5c|5c 2c 64 10) nmachhwo r3,r4,r5 ++.*: (10 64 2c 5d|5d 2c 64 10) nmachhwo\. r3,r4,r5 ++.*: (10 64 28 dc|dc 28 64 10) nmachhws r3,r4,r5 ++.*: (10 64 28 dd|dd 28 64 10) nmachhws\. r3,r4,r5 ++.*: (10 64 2c dc|dc 2c 64 10) nmachhwso r3,r4,r5 ++.*: (10 64 2c dd|dd 2c 64 10) nmachhwso\. r3,r4,r5 ++.*: (10 64 2b 5c|5c 2b 64 10) nmaclhw r3,r4,r5 ++.*: (10 64 2b 5d|5d 2b 64 10) nmaclhw\. r3,r4,r5 ++.*: (10 64 2f 5c|5c 2f 64 10) nmaclhwo r3,r4,r5 ++.*: (10 64 2f 5d|5d 2f 64 10) nmaclhwo\. r3,r4,r5 ++.*: (10 64 2b dc|dc 2b 64 10) nmaclhws r3,r4,r5 ++.*: (10 64 2b dd|dd 2b 64 10) nmaclhws\. r3,r4,r5 ++.*: (10 64 2f dc|dc 2f 64 10) nmaclhwso r3,r4,r5 ++.*: (10 64 2f dd|dd 2f 64 10) nmaclhwso\. r3,r4,r5 ++.*: (7e b4 b0 f8|f8 b0 b4 7e) nor r20,r21,r22 ++.*: (7e b4 b0 f9|f9 b0 b4 7e) nor\. r20,r21,r22 ++.*: (7c 40 23 78|78 23 40 7c) or r0,r2,r4 ++.*: (7d cc 83 79|79 83 cc 7d) or\. r12,r14,r16 ++.*: (7e 0f 8b 38|38 8b 0f 7e) orc r15,r16,r17 ++.*: (7e 72 a3 39|39 a3 72 7e) orc\. r18,r19,r20 ++.*: (60 21 00 00|00 00 21 60) ori r1,r1,0 ++.*: (64 83 de ad|ad de 83 64) oris r3,r4,57005 ++.*: (7c 83 00 f4|f4 00 83 7c) popcntb r3,r4 ++.*: (7c 83 01 34|34 01 83 7c) prtyw r3,r4 ++.*: (4c 00 00 66|66 00 00 4c) rfci ++.*: (4c 00 00 64|64 00 00 4c) rfi ++.*: (4c 00 00 4c|4c 00 00 4c) rfmci ++.*: (50 83 65 36|36 65 83 50) rlwimi r3,r4,12,20,27 ++.*: (50 83 65 37|37 65 83 50) rlwimi\. r3,r4,12,20,27 ++.*: (54 83 00 36|36 00 83 54) rlwinm r3,r4,0,0,27 ++.*: (54 83 d1 be|be d1 83 54) rlwinm r3,r4,26,6,31 ++.*: (54 83 20 26|26 20 83 54) rlwinm r3,r4,4,0,19 ++.*: (54 83 00 37|37 00 83 54) rlwinm\. r3,r4,0,0,27 ++.*: (5c 83 28 3e|3e 28 83 5c) rotlw r3,r4,r5 ++.*: (5c 83 28 3f|3f 28 83 5c) rotlw\. r3,r4,r5 ++.*: (5c 83 28 3e|3e 28 83 5c) rotlw r3,r4,r5 ++.*: (5c 83 28 3f|3f 28 83 5c) rotlw\. r3,r4,r5 ++.*: (44 00 00 02|02 00 00 44) sc ++.*: (7c 83 28 30|30 28 83 7c) slw r3,r4,r5 ++.*: (7c 83 28 31|31 28 83 7c) slw\. r3,r4,r5 ++.*: (7c 83 2e 30|30 2e 83 7c) sraw r3,r4,r5 ++.*: (7c 83 2e 31|31 2e 83 7c) sraw\. r3,r4,r5 ++.*: (7c 83 86 70|70 86 83 7c) srawi r3,r4,16 ++.*: (7c 83 86 71|71 86 83 7c) srawi\. r3,r4,16 ++.*: (7c 83 2c 30|30 2c 83 7c) srw r3,r4,r5 ++.*: (7c 83 2c 31|31 2c 83 7c) srw\. r3,r4,r5 ++.*: (54 83 d1 be|be d1 83 54) rlwinm r3,r4,26,6,31 ++.*: (99 61 00 02|02 00 61 99) stb r11,2\(r1\) ++.*: (9d 81 00 03|03 00 81 9d) stbu r12,3\(r1\) ++.*: (7d ae 79 ee|ee 79 ae 7d) stbux r13,r14,r15 ++.*: (7c 64 29 ae|ae 29 64 7c) stbx r3,r4,r5 ++.*: (db 21 00 20|20 00 21 db) stfd f25,32\(r1\) ++.*: (df 41 00 28|28 00 41 df) stfdu f26,40\(r1\) ++.*: (7c 01 15 ee|ee 15 01 7c) stfdux f0,r1,r2 ++.*: (7f be fd ae|ae fd be 7f) stfdx f29,r30,r31 ++.*: (7d 43 27 ae|ae 27 43 7d) stfiwx f10,r3,r4 ++.*: (d2 e1 00 14|14 00 e1 d2) stfs f23,20\(r1\) ++.*: (d7 01 00 18|18 00 01 d7) stfsu f24,24\(r1\) ++.*: (7f 5b e5 6e|6e e5 5b 7f) stfsux f26,r27,r28 ++.*: (7e f8 cd 2e|2e cd f8 7e) stfsx f23,r24,r25 ++.*: (b2 21 00 0a|0a 00 21 b2) sth r17,10\(r1\) ++.*: (7c c7 47 2c|2c 47 c7 7c) sthbrx r6,r7,r8 ++.*: (b6 41 00 0c|0c 00 41 b6) sthu r18,12\(r1\) ++.*: (7e b6 bb 6e|6e bb b6 7e) sthux r21,r22,r23 ++.*: (7d 8d 73 2e|2e 73 8d 7d) sthx r12,r13,r14 ++.*: (90 c7 ff f0|f0 ff c7 90) stw r6,-16\(r7\) ++.*: (7c 64 2d 2c|2c 2d 64 7c) stwbrx r3,r4,r5 ++.*: (7c 64 29 2d|2d 29 64 7c) stwcx\. r3,r4,r5 ++.*: (94 61 00 10|10 00 61 94) stwu r3,16\(r1\) ++.*: (7c 64 29 6e|6e 29 64 7c) stwux r3,r4,r5 ++.*: (7c 64 29 2e|2e 29 64 7c) stwx r3,r4,r5 ++.*: (7c 64 28 50|50 28 64 7c) subf r3,r4,r5 ++.*: (7c 64 28 51|51 28 64 7c) subf\. r3,r4,r5 ++.*: (7c 64 28 10|10 28 64 7c) subfc r3,r4,r5 ++.*: (7c 64 28 11|11 28 64 7c) subfc\. r3,r4,r5 ++.*: (7c 64 2c 10|10 2c 64 7c) subfco r3,r4,r5 ++.*: (7c 64 2c 11|11 2c 64 7c) subfco\. r3,r4,r5 ++.*: (7c 64 29 10|10 29 64 7c) subfe r3,r4,r5 ++.*: (7c 64 29 11|11 29 64 7c) subfe\. r3,r4,r5 ++.*: (7c 64 2d 10|10 2d 64 7c) subfeo r3,r4,r5 ++.*: (7c 64 2d 11|11 2d 64 7c) subfeo\. r3,r4,r5 ++.*: (20 64 00 05|05 00 64 20) subfic r3,r4,5 ++.*: (7c 64 01 d0|d0 01 64 7c) subfme r3,r4 ++.*: (7c 64 01 d1|d1 01 64 7c) subfme\. r3,r4 ++.*: (7c 64 05 d0|d0 05 64 7c) subfmeo r3,r4 ++.*: (7c 64 05 d1|d1 05 64 7c) subfmeo\. r3,r4 ++.*: (7c 64 2c 50|50 2c 64 7c) subfo r3,r4,r5 ++.*: (7c 64 2c 51|51 2c 64 7c) subfo\. r3,r4,r5 ++.*: (7c 64 01 90|90 01 64 7c) subfze r3,r4 ++.*: (7c 64 01 91|91 01 64 7c) subfze\. r3,r4 ++.*: (7c 64 05 90|90 05 64 7c) subfzeo r3,r4 ++.*: (7c 64 05 91|91 05 64 7c) subfzeo\. r3,r4 ++.*: (7c 07 46 24|24 46 07 7c) tlbivax r7,r8 ++.*: (7c 22 3f 64|64 3f 22 7c) tlbre r1,r2,7 ++.*: (7c 0b 67 24|24 67 0b 7c) tlbsx r11,r12 ++.*: (7d 8d 77 24|24 77 8d 7d) tlbsx r12,r13,r14 ++.*: (7d 8d 77 25|25 77 8d 7d) tlbsx\. r12,r13,r14 ++.*: (7c 00 04 6c|6c 04 00 7c) tlbsync ++.*: (7c 00 07 a4|a4 07 00 7c) tlbwe ++.*: (7c 00 07 a4|a4 07 00 7c) tlbwe ++.*: (7c 21 0f a4|a4 0f 21 7c) tlbwe r1,r1,1 ++.*: (7f e0 00 08|08 00 e0 7f) trap ++.*: (7f e0 00 08|08 00 e0 7f) trap ++.*: (7c 83 20 08|08 20 83 7c) tweq r3,r4 ++.*: (7c a3 20 08|08 20 a3 7c) twlge r3,r4 ++.*: (7c 83 20 08|08 20 83 7c) tweq r3,r4 ++.*: (0d 03 00 0f|0f 00 03 0d) twgti r3,15 ++.*: (0c c3 00 0f|0f 00 c3 0c) twllei r3,15 ++.*: (0d 03 00 0f|0f 00 03 0d) twgti r3,15 ++.*: (7c a3 20 08|08 20 a3 7c) twlge r3,r4 ++.*: (0c c3 00 0f|0f 00 c3 0c) twllei r3,15 ++.*: (7c 60 01 06|06 01 60 7c) wrtee r3 ++.*: (7c 00 81 46|46 81 00 7c) wrteei 1 ++.*: (7f dd fa 78|78 fa dd 7f) xor r29,r30,r31 ++.*: (7f dd fa 79|79 fa dd 7f) xor\. r29,r30,r31 ++.*: (68 83 de ad|ad de 83 68) xori r3,r4,57005 ++.*: (6c 83 de ad|ad de 83 6c) xoris r3,r4,57005 +diff -rup binutils-2.35.1/gas/testsuite/gas/ppc/476.s fred/binutils-2.35.1/gas/testsuite/gas/ppc/476.s +--- binutils-2.35.1/gas/testsuite/gas/ppc/476.s 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/ppc/476.s 2020-11-25 14:37:47.000000000 +0000 +@@ -226,9 +226,6 @@ ppc476: + lhzu 14,2(1) + lhzux 20,22,24 + lhzx 23,24,25 +- lmw 3,-16(1) +- lswi 5,4,16 +- lswx 3,4,5 + lwarx 3,4,5 + lwarx 3,4,5,0 + lwarx 3,4,5,1 +@@ -433,9 +430,6 @@ ppc476: + sthu 18,12(1) + sthux 21,22,23 + sthx 12,13,14 +- stmw 6,-16(1) +- stswi 3,4,16 +- stswx 3,4,5 + stw 6,-16(7) + stwbrx 3,4,5 + stwcx. 3,4,5 +diff -rup binutils-2.35.1/gas/testsuite/gas/ppc/a2.d fred/binutils-2.35.1/gas/testsuite/gas/ppc/a2.d +--- binutils-2.35.1/gas/testsuite/gas/ppc/a2.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/ppc/a2.d 2020-11-25 14:37:47.000000000 +0000 +@@ -9,577 +9,569 @@ + Disassembly of section \.text: + + 0+00 : +- 0: (7c 85 32 15|15 32 85 7c) add\. r4,r5,r6 +- 4: (7c 85 32 14|14 32 85 7c) add r4,r5,r6 +- 8: (7c 85 30 15|15 30 85 7c) addc\. r4,r5,r6 +- c: (7c 85 30 14|14 30 85 7c) addc r4,r5,r6 +- 10: (7c 85 34 15|15 34 85 7c) addco\. r4,r5,r6 +- 14: (7c 85 34 14|14 34 85 7c) addco r4,r5,r6 +- 18: (7c 85 31 15|15 31 85 7c) adde\. r4,r5,r6 +- 1c: (7c 85 31 14|14 31 85 7c) adde r4,r5,r6 +- 20: (7c 85 35 15|15 35 85 7c) addeo\. r4,r5,r6 +- 24: (7c 85 35 14|14 35 85 7c) addeo r4,r5,r6 +- 28: (38 85 00 0d|0d 00 85 38) addi r4,r5,13 +- 2c: (38 85 ff f3|f3 ff 85 38) addi r4,r5,-13 +- 30: (34 85 00 0d|0d 00 85 34) addic\. r4,r5,13 +- 34: (34 85 ff f3|f3 ff 85 34) addic\. r4,r5,-13 +- 38: (30 85 00 0d|0d 00 85 30) addic r4,r5,13 +- 3c: (30 85 ff f3|f3 ff 85 30) addic r4,r5,-13 +- 40: (3c 85 00 17|17 00 85 3c) addis r4,r5,23 +- 44: (3c 85 ff e9|e9 ff 85 3c) addis r4,r5,-23 +- 48: (7c 85 01 d5|d5 01 85 7c) addme\. r4,r5 +- 4c: (7c 85 01 d4|d4 01 85 7c) addme r4,r5 +- 50: (7c 85 05 d5|d5 05 85 7c) addmeo\. r4,r5 +- 54: (7c 85 05 d4|d4 05 85 7c) addmeo r4,r5 +- 58: (7c 85 36 15|15 36 85 7c) addo\. r4,r5,r6 +- 5c: (7c 85 36 14|14 36 85 7c) addo r4,r5,r6 +- 60: (7c 85 01 95|95 01 85 7c) addze\. r4,r5 +- 64: (7c 85 01 94|94 01 85 7c) addze r4,r5 +- 68: (7c 85 05 95|95 05 85 7c) addzeo\. r4,r5 +- 6c: (7c 85 05 94|94 05 85 7c) addzeo r4,r5 +- 70: (7c a4 30 39|39 30 a4 7c) and\. r4,r5,r6 +- 74: (7c a4 30 38|38 30 a4 7c) and r4,r5,r6 +- 78: (7c a4 30 79|79 30 a4 7c) andc\. r4,r5,r6 +- 7c: (7c a4 30 78|78 30 a4 7c) andc r4,r5,r6 +- 80: (70 a4 00 06|06 00 a4 70) andi\. r4,r5,6 +- 84: (74 a4 00 06|06 00 a4 74) andis\. r4,r5,6 +- 88: (00 00 02 00|00 02 00 00) attn +- 8c: (48 00 00 02|02 00 00 48) ba 0 +- 8c: R_PPC(|64)_ADDR24 label_abs +- 90: (40 8a 00 00|00 00 8a 40) bne cr2,90 +- 90: R_PPC(|64)_REL14 foo +- 94: (40 ca 00 00|00 00 ca 40) bne- cr2,94 +- 94: R_PPC(|64)_REL14 foo +- 98: (40 ea 00 00|00 00 ea 40) bne\+ cr2,98 +- 98: R_PPC(|64)_REL14 foo +- 9c: (40 85 00 02|02 00 85 40) blea cr1,0 +- 9c: R_PPC(|64)_ADDR14 foo_abs +- a0: (40 c5 00 02|02 00 c5 40) blea- cr1,0 +- a0: R_PPC(|64)_ADDR14 foo_abs +- a4: (40 e5 00 02|02 00 e5 40) blea\+ cr1,0 +- a4: R_PPC(|64)_ADDR14 foo_abs +- a8: (4c 86 0c 20|20 0c 86 4c) bcctr 4,4\*cr1\+eq,1 +- ac: (4c c6 04 20|20 04 c6 4c) bnectr- cr1 +- b0: (4c e6 04 20|20 04 e6 4c) bnectr\+ cr1 +- b4: (4c 86 0c 21|21 0c 86 4c) bcctrl 4,4\*cr1\+eq,1 +- b8: (4c c6 04 21|21 04 c6 4c) bnectrl- cr1 +- bc: (4c e6 04 21|21 04 e6 4c) bnectrl\+ cr1 +- c0: (40 8a 00 01|01 00 8a 40) bnel cr2,c0 +- c0: R_PPC(|64)_REL14 foo +- c4: (40 ca 00 01|01 00 ca 40) bnel- cr2,c4 +- c4: R_PPC(|64)_REL14 foo +- c8: (40 ea 00 01|01 00 ea 40) bnel\+ cr2,c8 +- c8: R_PPC(|64)_REL14 foo +- cc: (40 85 00 03|03 00 85 40) blela cr1,0 +- cc: R_PPC(|64)_ADDR14 foo_abs +- d0: (40 c5 00 03|03 00 c5 40) blela- cr1,0 +- d0: R_PPC(|64)_ADDR14 foo_abs +- d4: (40 e5 00 03|03 00 e5 40) blela\+ cr1,0 +- d4: R_PPC(|64)_ADDR14 foo_abs +- d8: (4c 86 08 20|20 08 86 4c) bclr 4,4\*cr1\+eq,1 +- dc: (4c c6 00 20|20 00 c6 4c) bnelr- cr1 +- e0: (4c e6 00 20|20 00 e6 4c) bnelr\+ cr1 +- e4: (4c 86 08 21|21 08 86 4c) bclrl 4,4\*cr1\+eq,1 +- e8: (4c c6 00 21|21 00 c6 4c) bnelrl- cr1 +- ec: (4c e6 00 21|21 00 e6 4c) bnelrl\+ cr1 +- f0: (48 00 00 00|00 00 00 48) b f0 +- f0: R_PPC(|64)_REL24 label +- f4: (48 00 00 03|03 00 00 48) bla 0 +- f4: R_PPC(|64)_ADDR24 label_abs +- f8: (48 00 00 01|01 00 00 48) bl f8 +- f8: R_PPC(|64)_REL24 label +- fc: (7d 6a 61 f8|f8 61 6a 7d) bpermd r10,r11,r12 +- 100: (7c a7 40 00|00 40 a7 7c) cmpd cr1,r7,r8 +- 104: (7d 6a 63 f8|f8 63 6a 7d) cmpb r10,r11,r12 +- 108: (2c aa 00 0d|0d 00 aa 2c) cmpdi cr1,r10,13 +- 10c: (2c aa ff f3|f3 ff aa 2c) cmpdi cr1,r10,-13 +- 110: (7c a7 40 40|40 40 a7 7c) cmpld cr1,r7,r8 +- 114: (28 aa 00 64|64 00 aa 28) cmpldi cr1,r10,100 +- 118: (7e b4 00 75|75 00 b4 7e) cntlzd\. r20,r21 +- 11c: (7e b4 00 74|74 00 b4 7e) cntlzd r20,r21 +- 120: (7e b4 00 35|35 00 b4 7e) cntlzw\. r20,r21 +- 124: (7e b4 00 34|34 00 b4 7e) cntlzw r20,r21 +- 128: (4c 22 1a 02|02 1a 22 4c) crand gt,eq,so +- 12c: (4c 22 19 02|02 19 22 4c) crandc gt,eq,so +- 130: (4c 22 1a 42|42 1a 22 4c) creqv gt,eq,so +- 134: (4c 22 19 c2|c2 19 22 4c) crnand gt,eq,so +- 138: (4c 22 18 42|42 18 22 4c) crnor gt,eq,so +- 13c: (4c 22 1b 82|82 1b 22 4c) cror gt,eq,so +- 140: (4c 22 1b 42|42 1b 22 4c) crorc gt,eq,so +- 144: (4c 22 19 82|82 19 22 4c) crxor gt,eq,so +- 148: (7c 0a 5d ec|ec 5d 0a 7c) dcba r10,r11 +- 14c: (7c 0a 58 ac|ac 58 0a 7c) dcbf r10,r11 +- 150: (7c 2a 58 ac|ac 58 2a 7c) dcbfl r10,r11 +- 154: (7c 0a 58 fe|fe 58 0a 7c) dcbfep r10,r11 +- 158: (7c 0a 5b ac|ac 5b 0a 7c) dcbi r10,r11 +- 15c: (7c 0a 5b 0c|0c 5b 0a 7c) dcblc r10,r11 +- 160: (7c 2a 5b 0c|0c 5b 2a 7c) dcblc 1,r10,r11 +- 164: (7c 0a 58 6c|6c 58 0a 7c) dcbst r10,r11 +- 168: (7c 0a 58 7e|7e 58 0a 7c) dcbstep r10,r11 +- 16c: (7c 0a 5a 2c|2c 5a 0a 7c) dcbt r10,r11 +- 170: (7c 2a 5a 2c|2c 5a 2a 7c) dcbt 1,r10,r11 +- 174: (7d 4b 62 7e|7e 62 4b 7d) dcbtep r10,r11,r12 +- 178: (7c 0a 59 4c|4c 59 0a 7c) dcbtls r10,r11 +- 17c: (7c 2a 59 4c|4c 59 2a 7c) dcbtls 1,r10,r11 +- 180: (7c 0a 59 ec|ec 59 0a 7c) dcbtst r10,r11 +- 184: (7c 2a 59 ec|ec 59 2a 7c) dcbtst 1,r10,r11 +- 188: (7d 4b 61 fe|fe 61 4b 7d) dcbtstep r10,r11,r12 +- 18c: (7c 0a 59 0c|0c 59 0a 7c) dcbtstls r10,r11 +- 190: (7c 2a 59 0c|0c 59 2a 7c) dcbtstls 1,r10,r11 +- 194: (7c 0a 5f ec|ec 5f 0a 7c) dcbz r10,r11 +- 198: (7c 0a 5f fe|fe 5f 0a 7c) dcbzep r10,r11 +- 19c: (7c 00 03 8c|8c 03 00 7c) dccci +- 1a0: (7c 00 03 8c|8c 03 00 7c) dccci +- 1a4: (7c 00 03 8c|8c 03 00 7c) dccci +- 1a8: (7d 40 03 8c|8c 03 40 7d) dci 10 +- 1ac: (7e 95 b3 d3|d3 b3 95 7e) divd\. r20,r21,r22 +- 1b0: (7e 95 b3 d2|d2 b3 95 7e) divd r20,r21,r22 +- 1b4: (7e 95 b7 d3|d3 b7 95 7e) divdo\. r20,r21,r22 +- 1b8: (7e 95 b7 d2|d2 b7 95 7e) divdo r20,r21,r22 +- 1bc: (7e 95 b3 93|93 b3 95 7e) divdu\. r20,r21,r22 +- 1c0: (7e 95 b3 92|92 b3 95 7e) divdu r20,r21,r22 +- 1c4: (7e 95 b7 93|93 b7 95 7e) divduo\. r20,r21,r22 +- 1c8: (7e 95 b7 92|92 b7 95 7e) divduo r20,r21,r22 +- 1cc: (7e 95 b3 d7|d7 b3 95 7e) divw\. r20,r21,r22 +- 1d0: (7e 95 b3 d6|d6 b3 95 7e) divw r20,r21,r22 +- 1d4: (7e 95 b7 d7|d7 b7 95 7e) divwo\. r20,r21,r22 +- 1d8: (7e 95 b7 d6|d6 b7 95 7e) divwo r20,r21,r22 +- 1dc: (7e 95 b3 97|97 b3 95 7e) divwu\. r20,r21,r22 +- 1e0: (7e 95 b3 96|96 b3 95 7e) divwu r20,r21,r22 +- 1e4: (7e 95 b7 97|97 b7 95 7e) divwuo\. r20,r21,r22 +- 1e8: (7e 95 b7 96|96 b7 95 7e) divwuo r20,r21,r22 +- 1ec: (7e b4 b2 39|39 b2 b4 7e) eqv\. r20,r21,r22 +- 1f0: (7e b4 b2 38|38 b2 b4 7e) eqv r20,r21,r22 +- 1f4: (7c 0a 58 66|66 58 0a 7c) eratilx 0,r10,r11 +- 1f8: (7c 2a 58 66|66 58 2a 7c) eratilx 1,r10,r11 +- 1fc: (7c ea 58 66|66 58 ea 7c) eratilx 7,r10,r11 +- 200: (7d 4b 66 66|66 66 4b 7d) erativax r10,r11,r12 +- 204: (7d 4b 01 66|66 01 4b 7d) eratre r10,r11,0 +- 208: (7d 4b 19 66|66 19 4b 7d) eratre r10,r11,3 +- 20c: (7d 4b 61 27|27 61 4b 7d) eratsx\. r10,r11,r12 +- 210: (7d 4b 61 26|26 61 4b 7d) eratsx r10,r11,r12 +- 214: (7d 4b 01 a6|a6 01 4b 7d) eratwe r10,r11,0 +- 218: (7d 4b 19 a6|a6 19 4b 7d) eratwe r10,r11,3 +- 21c: (7d 6a 07 75|75 07 6a 7d) extsb\. r10,r11 +- 220: (7d 6a 07 74|74 07 6a 7d) extsb r10,r11 +- 224: (7d 6a 07 35|35 07 6a 7d) extsh\. r10,r11 +- 228: (7d 6a 07 34|34 07 6a 7d) extsh r10,r11 +- 22c: (7d 6a 07 b5|b5 07 6a 7d) extsw\. r10,r11 +- 230: (7d 6a 07 b4|b4 07 6a 7d) extsw r10,r11 +- 234: (fe 80 aa 11|11 aa 80 fe) fabs\. f20,f21 +- 238: (fe 80 aa 10|10 aa 80 fe) fabs f20,f21 +- 23c: (fe 95 b0 2b|2b b0 95 fe) fadd\. f20,f21,f22 +- 240: (fe 95 b0 2a|2a b0 95 fe) fadd f20,f21,f22 +- 244: (ee 95 b0 2b|2b b0 95 ee) fadds\. f20,f21,f22 +- 248: (ee 95 b0 2a|2a b0 95 ee) fadds f20,f21,f22 +- 24c: (fe 80 ae 9d|9d ae 80 fe) fcfid\. f20,f21 +- 250: (fe 80 ae 9c|9c ae 80 fe) fcfid f20,f21 +- 254: (fc 14 a8 40|40 a8 14 fc) fcmpo cr0,f20,f21 +- 258: (fc 94 a8 40|40 a8 94 fc) fcmpo cr1,f20,f21 +- 25c: (fc 14 a8 00|00 a8 14 fc) fcmpu cr0,f20,f21 +- 260: (fc 94 a8 00|00 a8 94 fc) fcmpu cr1,f20,f21 +- 264: (fe 95 b0 11|11 b0 95 fe) fcpsgn\. f20,f21,f22 +- 268: (fe 95 b0 10|10 b0 95 fe) fcpsgn f20,f21,f22 +- 26c: (fe 80 ae 5d|5d ae 80 fe) fctid\. f20,f21 +- 270: (fe 80 ae 5c|5c ae 80 fe) fctid f20,f21 +- 274: (fe 80 ae 5f|5f ae 80 fe) fctidz\. f20,f21 +- 278: (fe 80 ae 5e|5e ae 80 fe) fctidz f20,f21 +- 27c: (fe 80 a8 1d|1d a8 80 fe) fctiw\. f20,f21 +- 280: (fe 80 a8 1c|1c a8 80 fe) fctiw f20,f21 +- 284: (fe 80 a8 1f|1f a8 80 fe) fctiwz\. f20,f21 +- 288: (fe 80 a8 1e|1e a8 80 fe) fctiwz f20,f21 +- 28c: (fe 95 b0 25|25 b0 95 fe) fdiv\. f20,f21,f22 +- 290: (fe 95 b0 24|24 b0 95 fe) fdiv f20,f21,f22 +- 294: (ee 95 b0 25|25 b0 95 ee) fdivs\. f20,f21,f22 +- 298: (ee 95 b0 24|24 b0 95 ee) fdivs f20,f21,f22 +- 29c: (fe 95 bd bb|bb bd 95 fe) fmadd\. f20,f21,f22,f23 +- 2a0: (fe 95 bd ba|ba bd 95 fe) fmadd f20,f21,f22,f23 +- 2a4: (ee 95 bd bb|bb bd 95 ee) fmadds\. f20,f21,f22,f23 +- 2a8: (ee 95 bd ba|ba bd 95 ee) fmadds f20,f21,f22,f23 +- 2ac: (fe 80 a8 91|91 a8 80 fe) fmr\. f20,f21 +- 2b0: (fe 80 a8 90|90 a8 80 fe) fmr f20,f21 +- 2b4: (fe 95 bd b9|b9 bd 95 fe) fmsub\. f20,f21,f22,f23 +- 2b8: (fe 95 bd b8|b8 bd 95 fe) fmsub f20,f21,f22,f23 +- 2bc: (ee 95 bd b9|b9 bd 95 ee) fmsubs\. f20,f21,f22,f23 +- 2c0: (ee 95 bd b8|b8 bd 95 ee) fmsubs f20,f21,f22,f23 +- 2c4: (fe 95 05 b3|b3 05 95 fe) fmul\. f20,f21,f22 +- 2c8: (fe 95 05 b2|b2 05 95 fe) fmul f20,f21,f22 +- 2cc: (ee 95 05 b3|b3 05 95 ee) fmuls\. f20,f21,f22 +- 2d0: (ee 95 05 b2|b2 05 95 ee) fmuls f20,f21,f22 +- 2d4: (fe 80 a9 11|11 a9 80 fe) fnabs\. f20,f21 +- 2d8: (fe 80 a9 10|10 a9 80 fe) fnabs f20,f21 +- 2dc: (fe 80 a8 51|51 a8 80 fe) fneg\. f20,f21 +- 2e0: (fe 80 a8 50|50 a8 80 fe) fneg f20,f21 +- 2e4: (fe 95 bd bf|bf bd 95 fe) fnmadd\. f20,f21,f22,f23 +- 2e8: (fe 95 bd be|be bd 95 fe) fnmadd f20,f21,f22,f23 +- 2ec: (ee 95 bd bf|bf bd 95 ee) fnmadds\. f20,f21,f22,f23 +- 2f0: (ee 95 bd be|be bd 95 ee) fnmadds f20,f21,f22,f23 +- 2f4: (fe 95 bd bd|bd bd 95 fe) fnmsub\. f20,f21,f22,f23 +- 2f8: (fe 95 bd bc|bc bd 95 fe) fnmsub f20,f21,f22,f23 +- 2fc: (ee 95 bd bd|bd bd 95 ee) fnmsubs\. f20,f21,f22,f23 +- 300: (ee 95 bd bc|bc bd 95 ee) fnmsubs f20,f21,f22,f23 +- 304: (fe 80 a8 31|31 a8 80 fe) fre\. f20,f21 +- 308: (fe 80 a8 30|30 a8 80 fe) fre f20,f21 +- 30c: (fe 80 a8 31|31 a8 80 fe) fre\. f20,f21 +- 310: (fe 80 a8 30|30 a8 80 fe) fre f20,f21 +- 314: (fe 81 a8 31|31 a8 81 fe) fre\. f20,f21,1 +- 318: (fe 81 a8 30|30 a8 81 fe) fre f20,f21,1 +- 31c: (ee 80 a8 31|31 a8 80 ee) fres\. f20,f21 +- 320: (ee 80 a8 30|30 a8 80 ee) fres f20,f21 +- 324: (ee 80 a8 31|31 a8 80 ee) fres\. f20,f21 +- 328: (ee 80 a8 30|30 a8 80 ee) fres f20,f21 +- 32c: (ee 81 a8 31|31 a8 81 ee) fres\. f20,f21,1 +- 330: (ee 81 a8 30|30 a8 81 ee) fres f20,f21,1 +- 334: (fe 80 ab d1|d1 ab 80 fe) frim\. f20,f21 +- 338: (fe 80 ab d0|d0 ab 80 fe) frim f20,f21 +- 33c: (fe 80 ab 11|11 ab 80 fe) frin\. f20,f21 +- 340: (fe 80 ab 10|10 ab 80 fe) frin f20,f21 +- 344: (fe 80 ab 91|91 ab 80 fe) frip\. f20,f21 +- 348: (fe 80 ab 90|90 ab 80 fe) frip f20,f21 +- 34c: (fe 80 ab 51|51 ab 80 fe) friz\. f20,f21 +- 350: (fe 80 ab 50|50 ab 80 fe) friz f20,f21 +- 354: (fe 80 a8 19|19 a8 80 fe) frsp\. f20,f21 +- 358: (fe 80 a8 18|18 a8 80 fe) frsp f20,f21 +- 35c: (fe 80 a8 35|35 a8 80 fe) frsqrte\. f20,f21 +- 360: (fe 80 a8 34|34 a8 80 fe) frsqrte f20,f21 +- 364: (fe 80 a8 35|35 a8 80 fe) frsqrte\. f20,f21 +- 368: (fe 80 a8 34|34 a8 80 fe) frsqrte f20,f21 +- 36c: (fe 81 a8 35|35 a8 81 fe) frsqrte\. f20,f21,1 +- 370: (fe 81 a8 34|34 a8 81 fe) frsqrte f20,f21,1 +- 374: (ee 80 a8 34|34 a8 80 ee) frsqrtes f20,f21 +- 378: (ee 80 a8 35|35 a8 80 ee) frsqrtes\. f20,f21 +- 37c: (ee 80 a8 34|34 a8 80 ee) frsqrtes f20,f21 +- 380: (ee 80 a8 35|35 a8 80 ee) frsqrtes\. f20,f21 +- 384: (ee 81 a8 34|34 a8 81 ee) frsqrtes f20,f21,1 +- 388: (ee 81 a8 35|35 a8 81 ee) frsqrtes\. f20,f21,1 +- 38c: (fe 95 bd af|af bd 95 fe) fsel\. f20,f21,f22,f23 +- 390: (fe 95 bd ae|ae bd 95 fe) fsel f20,f21,f22,f23 +- 394: (fe 80 a8 2d|2d a8 80 fe) fsqrt\. f20,f21 +- 398: (fe 80 a8 2c|2c a8 80 fe) fsqrt f20,f21 +- 39c: (ee 80 a8 2d|2d a8 80 ee) fsqrts\. f20,f21 +- 3a0: (ee 80 a8 2c|2c a8 80 ee) fsqrts f20,f21 +- 3a4: (fe 95 b0 29|29 b0 95 fe) fsub\. f20,f21,f22 +- 3a8: (fe 95 b0 28|28 b0 95 fe) fsub f20,f21,f22 +- 3ac: (ee 95 b0 29|29 b0 95 ee) fsubs\. f20,f21,f22 +- 3b0: (ee 95 b0 28|28 b0 95 ee) fsubs f20,f21,f22 +- 3b4: (7c 0a 5f ac|ac 5f 0a 7c) icbi r10,r11 +- 3b8: (7c 0a 5f be|be 5f 0a 7c) icbiep r10,r11 +- 3bc: (7c 0a 58 2c|2c 58 0a 7c) icbt r10,r11 +- 3c0: (7c ea 58 2c|2c 58 ea 7c) icbt 7,r10,r11 +- 3c4: (7c 0a 5b cc|cc 5b 0a 7c) icbtls r10,r11 +- 3c8: (7c ea 5b cc|cc 5b ea 7c) icbtls 7,r10,r11 +- 3cc: (7c 00 07 8c|8c 07 00 7c) iccci +- 3d0: (7c 00 07 8c|8c 07 00 7c) iccci +- 3d4: (7c 00 07 8c|8c 07 00 7c) iccci +- 3d8: (7d 40 07 8c|8c 07 40 7d) ici 10 +- 3dc: (7d 4b 63 2d|2d 63 4b 7d) icswx\. r10,r11,r12 +- 3e0: (7d 4b 63 2c|2c 63 4b 7d) icswx r10,r11,r12 +- 3e4: (7d 4b 65 de|de 65 4b 7d) isel r10,r11,r12,23 +- 3e8: (4c 00 01 2c|2c 01 00 4c) isync +- 3ec: (7d 4b 60 be|be 60 4b 7d) lbepx r10,r11,r12 +- 3f0: (89 4b ff ef|ef ff 4b 89) lbz r10,-17\(r11\) +- 3f4: (89 4b 00 11|11 00 4b 89) lbz r10,17\(r11\) +- 3f8: (8d 4b ff ff|ff ff 4b 8d) lbzu r10,-1\(r11\) +- 3fc: (8d 4b 00 01|01 00 4b 8d) lbzu r10,1\(r11\) +- 400: (7d 4b 68 ee|ee 68 4b 7d) lbzux r10,r11,r13 +- 404: (7d 4b 68 ae|ae 68 4b 7d) lbzx r10,r11,r13 +- 408: (e9 4b ff f8|f8 ff 4b e9) ld r10,-8\(r11\) +- 40c: (e9 4b 00 08|08 00 4b e9) ld r10,8\(r11\) +- 410: (7d 4b 60 a8|a8 60 4b 7d) ldarx r10,r11,r12 +- 414: (7d 4b 60 a9|a9 60 4b 7d) ldarx r10,r11,r12,1 +- 418: (7d 4b 64 28|28 64 4b 7d) ldbrx r10,r11,r12 +- 41c: (7d 4b 60 3a|3a 60 4b 7d) ldepx r10,r11,r12 +- 420: (e9 4b ff f9|f9 ff 4b e9) ldu r10,-8\(r11\) +- 424: (e9 4b 00 09|09 00 4b e9) ldu r10,8\(r11\) +- 428: (7d 4b 60 6a|6a 60 4b 7d) ldux r10,r11,r12 +- 42c: (7d 4b 60 2a|2a 60 4b 7d) ldx r10,r11,r12 +- 430: (ca 8a ff f8|f8 ff 8a ca) lfd f20,-8\(r10\) +- 434: (ca 8a 00 08|08 00 8a ca) lfd f20,8\(r10\) +- 438: (7e 8a 5c be|be 5c 8a 7e) lfdepx f20,r10,r11 +- 43c: (ce 8a ff f8|f8 ff 8a ce) lfdu f20,-8\(r10\) +- 440: (ce 8a 00 08|08 00 8a ce) lfdu f20,8\(r10\) +- 444: (7e 8a 5c ee|ee 5c 8a 7e) lfdux f20,r10,r11 +- 448: (7e 8a 5c ae|ae 5c 8a 7e) lfdx f20,r10,r11 +- 44c: (7e 8a 5e ae|ae 5e 8a 7e) lfiwax f20,r10,r11 +- 450: (7e 8a 5e ee|ee 5e 8a 7e) lfiwzx f20,r10,r11 +- 454: (c2 8a ff fc|fc ff 8a c2) lfs f20,-4\(r10\) +- 458: (c2 8a 00 04|04 00 8a c2) lfs f20,4\(r10\) +- 45c: (c6 8a ff fc|fc ff 8a c6) lfsu f20,-4\(r10\) +- 460: (c6 8a 00 04|04 00 8a c6) lfsu f20,4\(r10\) +- 464: (7e 8a 5c 6e|6e 5c 8a 7e) lfsux f20,r10,r11 +- 468: (7e 8a 5c 2e|2e 5c 8a 7e) lfsx f20,r10,r11 +- 46c: (a9 4b 00 02|02 00 4b a9) lha r10,2\(r11\) +- 470: (ad 4b ff fe|fe ff 4b ad) lhau r10,-2\(r11\) +- 474: (7d 4b 62 ee|ee 62 4b 7d) lhaux r10,r11,r12 +- 478: (7d 4b 62 ae|ae 62 4b 7d) lhax r10,r11,r12 +- 47c: (7d 4b 66 2c|2c 66 4b 7d) lhbrx r10,r11,r12 +- 480: (7d 4b 62 3e|3e 62 4b 7d) lhepx r10,r11,r12 +- 484: (a1 4b ff fe|fe ff 4b a1) lhz r10,-2\(r11\) +- 488: (a1 4b 00 02|02 00 4b a1) lhz r10,2\(r11\) +- 48c: (a5 4b ff fe|fe ff 4b a5) lhzu r10,-2\(r11\) +- 490: (a5 4b 00 02|02 00 4b a5) lhzu r10,2\(r11\) +- 494: (7d 4b 62 6e|6e 62 4b 7d) lhzux r10,r11,r12 +- 498: (7d 4b 62 2e|2e 62 4b 7d) lhzx r10,r11,r12 +- 49c: (ba 8a 00 10|10 00 8a ba) lmw r20,16\(r10\) +- 4a0: (7d 4b 0c aa|aa 0c 4b 7d) lswi r10,r11,1 +- 4a4: (7d 8b 04 aa|aa 04 8b 7d) lswi r12,r11,32 +- 4a8: (7d 4b 64 2a|2a 64 4b 7d) lswx r10,r11,r12 +- 4ac: (e9 4b ff fe|fe ff 4b e9) lwa r10,-4\(r11\) +- 4b0: (e9 4b 00 06|06 00 4b e9) lwa r10,4\(r11\) +- 4b4: (7d 4b 60 28|28 60 4b 7d) lwarx r10,r11,r12 +- 4b8: (7d 4b 60 29|29 60 4b 7d) lwarx r10,r11,r12,1 +- 4bc: (7d 4b 62 ea|ea 62 4b 7d) lwaux r10,r11,r12 +- 4c0: (7d 4b 62 aa|aa 62 4b 7d) lwax r10,r11,r12 +- 4c4: (7d 4b 64 2c|2c 64 4b 7d) lwbrx r10,r11,r12 +- 4c8: (7d 4b 60 3e|3e 60 4b 7d) lwepx r10,r11,r12 +- 4cc: (81 4b ff fc|fc ff 4b 81) lwz r10,-4\(r11\) +- 4d0: (81 4b 00 04|04 00 4b 81) lwz r10,4\(r11\) +- 4d4: (85 4b ff fc|fc ff 4b 85) lwzu r10,-4\(r11\) +- 4d8: (85 4b 00 04|04 00 4b 85) lwzu r10,4\(r11\) +- 4dc: (7d 4b 60 6e|6e 60 4b 7d) lwzux r10,r11,r12 +- 4e0: (7d 4b 60 2e|2e 60 4b 7d) lwzx r10,r11,r12 +- 4e4: (7c 00 06 ac|ac 06 00 7c) mbar +- 4e8: (7c 00 06 ac|ac 06 00 7c) mbar +- 4ec: (7c 00 06 ac|ac 06 00 7c) mbar +- 4f0: (7c 20 06 ac|ac 06 20 7c) mbar 1 +- 4f4: (4c 04 00 00|00 00 04 4c) mcrf cr0,cr1 +- 4f8: (fd 90 00 80|80 00 90 fd) mcrfs cr3,cr4 +- 4fc: (7c 00 04 00|00 04 00 7c) mcrxr cr0 +- 500: (7d 80 04 00|00 04 80 7d) mcrxr cr3 +- 504: (7c 60 00 26|26 00 60 7c) mfcr r3 +- 508: (7c 70 20 26|26 20 70 7c) mfocrf r3,2 +- 50c: (7c 70 10 26|26 10 70 7c) mfocrf r3,1 +- 510: (7c 78 00 26|26 00 78 7c) mfocrf r3,128 +- 514: (7d 4a 3a 87|87 3a 4a 7d) mfdcr\. r10,234 +- 518: (7d 4a 3a 86|86 3a 4a 7d) mfdcr r10,234 +- 51c: (7d 4b 02 07|07 02 4b 7d) mfdcrx\. r10,r11 +- 520: (7d 4b 02 06|06 02 4b 7d) mfdcrx r10,r11 +- 524: (fe 80 04 8f|8f 04 80 fe) mffs\. f20 +- 528: (fe 80 04 8e|8e 04 80 fe) mffs f20 +- 52c: (7d 40 00 a6|a6 00 40 7d) mfmsr r10 +- 530: (7c 70 10 26|26 10 70 7c) mfocrf r3,1 +- 534: (7c 78 00 26|26 00 78 7c) mfocrf r3,128 +- 538: (7d 4a 3a a6|a6 3a 4a 7d) mfspr r10,234 +- 53c: (7d 4c 42 a6|a6 42 4c 7d) mftb r10 +- 540: (7d 4d 42 a6|a6 42 4d 7d) mftbu r10 +- 544: (7c 00 51 dc|dc 51 00 7c) msgclr r10 +- 548: (7c 00 51 9c|9c 51 00 7c) msgsnd r10 +- 54c: (7c 60 01 20|20 01 60 7c) mtcrf 0,r3 +- 550: (7c 70 11 20|20 11 70 7c) mtocrf 1,r3 +- 554: (7c 78 01 20|20 01 78 7c) mtocrf 128,r3 +- 558: (7c 6f f1 20|20 f1 6f 7c) mtcr r3 +- 55c: (7d 4a 3b 87|87 3b 4a 7d) mtdcr\. 234,r10 +- 560: (7d 4a 3b 86|86 3b 4a 7d) mtdcr 234,r10 +- 564: (7d 6a 03 07|07 03 6a 7d) mtdcrx\. r10,r11 +- 568: (7d 6a 03 06|06 03 6a 7d) mtdcrx r10,r11 +- 56c: (fc 60 00 8d|8d 00 60 fc) mtfsb0\. 3 +- 570: (fc 60 00 8c|8c 00 60 fc) mtfsb0 3 +- 574: (fc 60 00 4d|4d 00 60 fc) mtfsb1\. 3 +- 578: (fc 60 00 4c|4c 00 60 fc) mtfsb1 3 +- 57c: (fc 0c a5 8f|8f a5 0c fc) mtfsf\. 6,f20 +- 580: (fc 0c a5 8e|8e a5 0c fc) mtfsf 6,f20 +- 584: (fc 0c a5 8f|8f a5 0c fc) mtfsf\. 6,f20 +- 588: (fc 0c a5 8e|8e a5 0c fc) mtfsf 6,f20 +- 58c: (fe 0d a5 8f|8f a5 0d fe) mtfsf\. 6,f20,1,1 +- 590: (fe 0d a5 8e|8e a5 0d fe) mtfsf 6,f20,1,1 +- 594: (ff 00 01 0d|0d 01 00 ff) mtfsfi\. 6,0 +- 598: (ff 00 01 0c|0c 01 00 ff) mtfsfi 6,0 +- 59c: (ff 00 d1 0d|0d d1 00 ff) mtfsfi\. 6,13 +- 5a0: (ff 00 d1 0c|0c d1 00 ff) mtfsfi 6,13 +- 5a4: (ff 01 d1 0d|0d d1 01 ff) mtfsfi\. 6,13,1 +- 5a8: (ff 01 d1 0c|0c d1 01 ff) mtfsfi 6,13,1 +- 5ac: (7d 40 01 24|24 01 40 7d) mtmsr r10 +- 5b0: (7d 40 01 24|24 01 40 7d) mtmsr r10 +- 5b4: (7d 41 01 24|24 01 41 7d) mtmsr r10,1 +- 5b8: (7c 70 11 20|20 11 70 7c) mtocrf 1,r3 +- 5bc: (7c 78 01 20|20 01 78 7c) mtocrf 128,r3 +- 5c0: (7d 4a 3b a6|a6 3b 4a 7d) mtspr 234,r10 +- 5c4: (7e 95 b0 93|93 b0 95 7e) mulhd\. r20,r21,r22 +- 5c8: (7e 95 b0 92|92 b0 95 7e) mulhd r20,r21,r22 +- 5cc: (7e 95 b0 13|13 b0 95 7e) mulhdu\. r20,r21,r22 +- 5d0: (7e 95 b0 12|12 b0 95 7e) mulhdu r20,r21,r22 +- 5d4: (7e 95 b0 97|97 b0 95 7e) mulhw\. r20,r21,r22 +- 5d8: (7e 95 b0 96|96 b0 95 7e) mulhw r20,r21,r22 +- 5dc: (7e 95 b0 17|17 b0 95 7e) mulhwu\. r20,r21,r22 +- 5e0: (7e 95 b0 16|16 b0 95 7e) mulhwu r20,r21,r22 +- 5e4: (7e 95 b1 d3|d3 b1 95 7e) mulld\. r20,r21,r22 +- 5e8: (7e 95 b1 d2|d2 b1 95 7e) mulld r20,r21,r22 +- 5ec: (7e 95 b5 d3|d3 b5 95 7e) mulldo\. r20,r21,r22 +- 5f0: (7e 95 b5 d2|d2 b5 95 7e) mulldo r20,r21,r22 +- 5f4: (1e 95 00 64|64 00 95 1e) mulli r20,r21,100 +- 5f8: (1e 95 ff 9c|9c ff 95 1e) mulli r20,r21,-100 +- 5fc: (7e 95 b1 d7|d7 b1 95 7e) mullw\. r20,r21,r22 +- 600: (7e 95 b1 d6|d6 b1 95 7e) mullw r20,r21,r22 +- 604: (7e 95 b5 d7|d7 b5 95 7e) mullwo\. r20,r21,r22 +- 608: (7e 95 b5 d6|d6 b5 95 7e) mullwo r20,r21,r22 +- 60c: (7e b4 b3 b9|b9 b3 b4 7e) nand\. r20,r21,r22 +- 610: (7e b4 b3 b8|b8 b3 b4 7e) nand r20,r21,r22 +- 614: (7e 95 00 d1|d1 00 95 7e) neg\. r20,r21 +- 618: (7e 95 00 d0|d0 00 95 7e) neg r20,r21 +- 61c: (7e 95 04 d1|d1 04 95 7e) nego\. r20,r21 +- 620: (7e 95 04 d0|d0 04 95 7e) nego r20,r21 +- 624: (7e b4 b0 f9|f9 b0 b4 7e) nor\. r20,r21,r22 +- 628: (7e b4 b0 f8|f8 b0 b4 7e) nor r20,r21,r22 +- 62c: (7e b4 b3 79|79 b3 b4 7e) or\. r20,r21,r22 +- 630: (7e b4 b3 78|78 b3 b4 7e) or r20,r21,r22 +- 634: (7e b4 b3 39|39 b3 b4 7e) orc\. r20,r21,r22 +- 638: (7e b4 b3 38|38 b3 b4 7e) orc r20,r21,r22 +- 63c: (62 b4 10 00|00 10 b4 62) ori r20,r21,4096 +- 640: (66 b4 10 00|00 10 b4 66) oris r20,r21,4096 +- 644: (7d 6a 00 f4|f4 00 6a 7d) popcntb r10,r11 +- 648: (7d 6a 03 f4|f4 03 6a 7d) popcntd r10,r11 +- 64c: (7d 6a 02 f4|f4 02 6a 7d) popcntw r10,r11 +- 650: (7d 6a 01 74|74 01 6a 7d) prtyd r10,r11 +- 654: (7d 6a 01 34|34 01 6a 7d) prtyw r10,r11 +- 658: (4c 00 00 66|66 00 00 4c) rfci +- 65c: (4c 00 00 cc|cc 00 00 4c) rfgi +- 660: (4c 00 00 64|64 00 00 4c) rfi +- 664: (4c 00 00 4c|4c 00 00 4c) rfmci +- 668: (79 6a 67 f1|f1 67 6a 79) rldcl\. r10,r11,r12,63 +- 66c: (79 6a 67 f0|f0 67 6a 79) rldcl r10,r11,r12,63 +- 670: (79 6a 67 f3|f3 67 6a 79) rldcr\. r10,r11,r12,63 +- 674: (79 6a 67 f2|f2 67 6a 79) rldcr r10,r11,r12,63 +- 678: (79 6a bf e9|e9 bf 6a 79) rldic\. r10,r11,23,63 +- 67c: (79 6a bf e8|e8 bf 6a 79) rldic r10,r11,23,63 +- 680: (79 6a bf e1|e1 bf 6a 79) rldicl\. r10,r11,23,63 +- 684: (79 6a bf e0|e0 bf 6a 79) rldicl r10,r11,23,63 +- 688: (79 6a bf e5|e5 bf 6a 79) rldicr\. r10,r11,23,63 +- 68c: (79 6a bf e4|e4 bf 6a 79) rldicr r10,r11,23,63 +- 690: (79 6a bf ed|ed bf 6a 79) rldimi\. r10,r11,23,63 +- 694: (79 6a bf ec|ec bf 6a 79) rldimi r10,r11,23,63 +- 698: (51 6a b8 3f|3f b8 6a 51) rlwimi\. r10,r11,23,0,31 +- 69c: (51 6a b8 3e|3e b8 6a 51) rlwimi r10,r11,23,0,31 +- 6a0: (55 6a b8 3f|3f b8 6a 55) rotlwi\. r10,r11,23 +- 6a4: (55 6a b8 3e|3e b8 6a 55) rotlwi r10,r11,23 +- 6a8: (5d 6a b8 3f|3f b8 6a 5d) rotlw\. r10,r11,r23 +- 6ac: (5d 6a b8 3e|3e b8 6a 5d) rotlw r10,r11,r23 +- 6b0: (44 00 00 02|02 00 00 44) sc +- 6b4: (44 00 0c 82|82 0c 00 44) sc 100 +- 6b8: (7d 6a 60 37|37 60 6a 7d) sld\. r10,r11,r12 +- 6bc: (7d 6a 60 36|36 60 6a 7d) sld r10,r11,r12 +- 6c0: (7d 6a 60 31|31 60 6a 7d) slw\. r10,r11,r12 +- 6c4: (7d 6a 60 30|30 60 6a 7d) slw r10,r11,r12 +- 6c8: (7d 6a 66 35|35 66 6a 7d) srad\. r10,r11,r12 +- 6cc: (7d 6a 66 34|34 66 6a 7d) srad r10,r11,r12 +- 6d0: (7d 6a fe 77|77 fe 6a 7d) sradi\. r10,r11,63 +- 6d4: (7d 6a fe 76|76 fe 6a 7d) sradi r10,r11,63 +- 6d8: (7d 6a 66 31|31 66 6a 7d) sraw\. r10,r11,r12 +- 6dc: (7d 6a 66 30|30 66 6a 7d) sraw r10,r11,r12 +- 6e0: (7d 6a fe 71|71 fe 6a 7d) srawi\. r10,r11,31 +- 6e4: (7d 6a fe 70|70 fe 6a 7d) srawi r10,r11,31 +- 6e8: (7d 6a 64 37|37 64 6a 7d) srd\. r10,r11,r12 +- 6ec: (7d 6a 64 36|36 64 6a 7d) srd r10,r11,r12 +- 6f0: (7d 6a 64 31|31 64 6a 7d) srw\. r10,r11,r12 +- 6f4: (7d 6a 64 30|30 64 6a 7d) srw r10,r11,r12 +- 6f8: (99 4b ff ff|ff ff 4b 99) stb r10,-1\(r11\) +- 6fc: (99 4b 00 01|01 00 4b 99) stb r10,1\(r11\) +- 700: (7d 4b 61 be|be 61 4b 7d) stbepx r10,r11,r12 +- 704: (9d 4b ff ff|ff ff 4b 9d) stbu r10,-1\(r11\) +- 708: (9d 4b 00 01|01 00 4b 9d) stbu r10,1\(r11\) +- 70c: (7d 4b 61 ee|ee 61 4b 7d) stbux r10,r11,r12 +- 710: (7d 4b 61 ae|ae 61 4b 7d) stbx r10,r11,r12 +- 714: (f9 4b ff f8|f8 ff 4b f9) std r10,-8\(r11\) +- 718: (f9 4b 00 08|08 00 4b f9) std r10,8\(r11\) +- 71c: (7d 4b 65 28|28 65 4b 7d) stdbrx r10,r11,r12 +- 720: (7d 4b 61 ad|ad 61 4b 7d) stdcx\. r10,r11,r12 +- 724: (7d 4b 61 3a|3a 61 4b 7d) stdepx r10,r11,r12 +- 728: (f9 4b ff f9|f9 ff 4b f9) stdu r10,-8\(r11\) +- 72c: (f9 4b 00 09|09 00 4b f9) stdu r10,8\(r11\) +- 730: (7d 4b 61 6a|6a 61 4b 7d) stdux r10,r11,r12 +- 734: (7d 4b 61 2a|2a 61 4b 7d) stdx r10,r11,r12 +- 738: (da 8a ff f8|f8 ff 8a da) stfd f20,-8\(r10\) +- 73c: (da 8a 00 08|08 00 8a da) stfd f20,8\(r10\) +- 740: (7e 8a 5d be|be 5d 8a 7e) stfdepx f20,r10,r11 +- 744: (de 8a ff f8|f8 ff 8a de) stfdu f20,-8\(r10\) +- 748: (de 8a 00 08|08 00 8a de) stfdu f20,8\(r10\) +- 74c: (7e 8a 5d ee|ee 5d 8a 7e) stfdux f20,r10,r11 +- 750: (7e 8a 5d ae|ae 5d 8a 7e) stfdx f20,r10,r11 +- 754: (7e 8a 5f ae|ae 5f 8a 7e) stfiwx f20,r10,r11 +- 758: (d2 8a ff fc|fc ff 8a d2) stfs f20,-4\(r10\) +- 75c: (d2 8a 00 04|04 00 8a d2) stfs f20,4\(r10\) +- 760: (d6 8a ff fc|fc ff 8a d6) stfsu f20,-4\(r10\) +- 764: (d6 8a 00 04|04 00 8a d6) stfsu f20,4\(r10\) +- 768: (7e 8a 5d 6e|6e 5d 8a 7e) stfsux f20,r10,r11 +- 76c: (7e 8a 5d 2e|2e 5d 8a 7e) stfsx f20,r10,r11 +- 770: (b1 4b ff fe|fe ff 4b b1) sth r10,-2\(r11\) +- 774: (b1 4b 00 02|02 00 4b b1) sth r10,2\(r11\) +- 778: (b1 4b ff fc|fc ff 4b b1) sth r10,-4\(r11\) +- 77c: (b1 4b 00 04|04 00 4b b1) sth r10,4\(r11\) +- 780: (7d 4b 67 2c|2c 67 4b 7d) sthbrx r10,r11,r12 +- 784: (7d 4b 63 3e|3e 63 4b 7d) sthepx r10,r11,r12 +- 788: (b5 4b ff fe|fe ff 4b b5) sthu r10,-2\(r11\) +- 78c: (b5 4b 00 02|02 00 4b b5) sthu r10,2\(r11\) +- 790: (7d 4b 63 6e|6e 63 4b 7d) sthux r10,r11,r12 +- 794: (7d 4b 63 2e|2e 63 4b 7d) sthx r10,r11,r12 +- 798: (be 8a 00 10|10 00 8a be) stmw r20,16\(r10\) +- 79c: (7d 4b 0d aa|aa 0d 4b 7d) stswi r10,r11,1 +- 7a0: (7d 4b 05 aa|aa 05 4b 7d) stswi r10,r11,32 +- 7a4: (7d 4b 65 2a|2a 65 4b 7d) stswx r10,r11,r12 +- 7a8: (7d 4b 65 2c|2c 65 4b 7d) stwbrx r10,r11,r12 +- 7ac: (7d 4b 61 2d|2d 61 4b 7d) stwcx\. r10,r11,r12 +- 7b0: (7d 4b 61 3e|3e 61 4b 7d) stwepx r10,r11,r12 +- 7b4: (95 4b ff fc|fc ff 4b 95) stwu r10,-4\(r11\) +- 7b8: (95 4b 00 04|04 00 4b 95) stwu r10,4\(r11\) +- 7bc: (7d 4b 61 6e|6e 61 4b 7d) stwux r10,r11,r12 +- 7c0: (7d 4b 61 2e|2e 61 4b 7d) stwx r10,r11,r12 +- 7c4: (7e 95 b0 51|51 b0 95 7e) subf\. r20,r21,r22 +- 7c8: (7e 95 b0 50|50 b0 95 7e) subf r20,r21,r22 +- 7cc: (7e 95 b0 11|11 b0 95 7e) subfc\. r20,r21,r22 +- 7d0: (7e 95 b0 10|10 b0 95 7e) subfc r20,r21,r22 +- 7d4: (7e 95 b4 11|11 b4 95 7e) subfco\. r20,r21,r22 +- 7d8: (7e 95 b4 10|10 b4 95 7e) subfco r20,r21,r22 +- 7dc: (7e 95 b1 11|11 b1 95 7e) subfe\. r20,r21,r22 +- 7e0: (7e 95 b1 10|10 b1 95 7e) subfe r20,r21,r22 +- 7e4: (7e 95 b5 11|11 b5 95 7e) subfeo\. r20,r21,r22 +- 7e8: (7e 95 b5 10|10 b5 95 7e) subfeo r20,r21,r22 +- 7ec: (22 95 00 64|64 00 95 22) subfic r20,r21,100 +- 7f0: (22 95 ff 9c|9c ff 95 22) subfic r20,r21,-100 +- 7f4: (7e 95 01 d1|d1 01 95 7e) subfme\. r20,r21 +- 7f8: (7e 95 01 d0|d0 01 95 7e) subfme r20,r21 +- 7fc: (7e 95 05 d1|d1 05 95 7e) subfmeo\. r20,r21 +- 800: (7e 95 05 d0|d0 05 95 7e) subfmeo r20,r21 +- 804: (7e 95 b4 51|51 b4 95 7e) subfo\. r20,r21,r22 +- 808: (7e 95 b4 50|50 b4 95 7e) subfo r20,r21,r22 +- 80c: (7e 95 01 91|91 01 95 7e) subfze\. r20,r21 +- 810: (7e 95 01 90|90 01 95 7e) subfze r20,r21 +- 814: (7e 95 05 91|91 05 95 7e) subfzeo\. r20,r21 +- 818: (7e 95 05 90|90 05 95 7e) subfzeo r20,r21 +- 81c: (7c 00 04 ac|ac 04 00 7c) hwsync +- 820: (7c 00 04 ac|ac 04 00 7c) hwsync +- 824: (7c 00 04 ac|ac 04 00 7c) hwsync +- 828: (7c 20 04 ac|ac 04 20 7c) lwsync +- 82c: (7c aa 58 88|88 58 aa 7c) tdlge r10,r11 +- 830: (08 aa 00 64|64 00 aa 08) tdlgei r10,100 +- 834: (08 aa ff 9c|9c ff aa 08) tdlgei r10,-100 +- 838: (7c 6a 58 24|24 58 6a 7c) tlbilxva r10,r11 +- 83c: (7c 0a 5e 24|24 5e 0a 7c) tlbivax r10,r11 +- 840: (7c 00 07 64|64 07 00 7c) tlbre +- 844: (7d 4b 3f 64|64 3f 4b 7d) tlbre r10,r11,7 +- 848: (7c 0a 5e a5|a5 5e 0a 7c) tlbsrx\. r10,r11 +- 84c: (7d 4b 67 25|25 67 4b 7d) tlbsx\. r10,r11,r12 +- 850: (7d 4b 67 24|24 67 4b 7d) tlbsx r10,r11,r12 +- 854: (7c 00 04 6c|6c 04 00 7c) tlbsync +- 858: (7c 00 07 a4|a4 07 00 7c) tlbwe +- 85c: (7d 4b 3f a4|a4 3f 4b 7d) tlbwe r10,r11,7 +- 860: (7c aa 58 08|08 58 aa 7c) twlge r10,r11 +- 864: (0c aa 00 64|64 00 aa 0c) twlgei r10,100 +- 868: (0c aa ff 9c|9c ff aa 0c) twlgei r10,-100 +- 86c: (7c 00 00 7c|7c 00 00 7c) wait +- 870: (7c 00 00 7c|7c 00 00 7c) wait +- 874: (7c 20 00 7c|7c 00 20 7c) waitrsv +- 878: (7c 40 00 7c|7c 00 40 7c) waitimpl +- 87c: (7c 40 00 7c|7c 00 40 7c) waitimpl +- 880: (7c 20 00 7c|7c 00 20 7c) waitrsv +- 884: (7c 00 01 6c|6c 01 00 7c) wchkall +- 888: (7c 00 01 6c|6c 01 00 7c) wchkall +- 88c: (7d 80 01 6c|6c 01 80 7d) wchkall cr3 +- 890: (7c 2a 5f 4c|4c 5f 2a 7c) wclr 1,r10,r11 +- 894: (7c 20 07 4c|4c 07 20 7c) wclrall 1 +- 898: (7c 4a 5f 4c|4c 5f 4a 7c) wclrone r10,r11 +- 89c: (7d 40 01 06|06 01 40 7d) wrtee r10 +- 8a0: (7c 00 81 46|46 81 00 7c) wrteei 1 +- 8a4: (7d 6a 62 79|79 62 6a 7d) xor\. r10,r11,r12 +- 8a8: (7d 6a 62 78|78 62 6a 7d) xor r10,r11,r12 +- 8ac: (69 6a 10 00|00 10 6a 69) xori r10,r11,4096 +- 8b0: (6d 6a 10 00|00 10 6a 6d) xoris r10,r11,4096 ++.*: (7c 85 32 15|15 32 85 7c) add\. r4,r5,r6 ++.*: (7c 85 32 14|14 32 85 7c) add r4,r5,r6 ++.*: (7c 85 30 15|15 30 85 7c) addc\. r4,r5,r6 ++.*: (7c 85 30 14|14 30 85 7c) addc r4,r5,r6 ++.*: (7c 85 34 15|15 34 85 7c) addco\. r4,r5,r6 ++.*: (7c 85 34 14|14 34 85 7c) addco r4,r5,r6 ++.*: (7c 85 31 15|15 31 85 7c) adde\. r4,r5,r6 ++.*: (7c 85 31 14|14 31 85 7c) adde r4,r5,r6 ++.*: (7c 85 35 15|15 35 85 7c) addeo\. r4,r5,r6 ++.*: (7c 85 35 14|14 35 85 7c) addeo r4,r5,r6 ++.*: (38 85 00 0d|0d 00 85 38) addi r4,r5,13 ++.*: (38 85 ff f3|f3 ff 85 38) addi r4,r5,-13 ++.*: (34 85 00 0d|0d 00 85 34) addic\. r4,r5,13 ++.*: (34 85 ff f3|f3 ff 85 34) addic\. r4,r5,-13 ++.*: (30 85 00 0d|0d 00 85 30) addic r4,r5,13 ++.*: (30 85 ff f3|f3 ff 85 30) addic r4,r5,-13 ++.*: (3c 85 00 17|17 00 85 3c) addis r4,r5,23 ++.*: (3c 85 ff e9|e9 ff 85 3c) addis r4,r5,-23 ++.*: (7c 85 01 d5|d5 01 85 7c) addme\. r4,r5 ++.*: (7c 85 01 d4|d4 01 85 7c) addme r4,r5 ++.*: (7c 85 05 d5|d5 05 85 7c) addmeo\. r4,r5 ++.*: (7c 85 05 d4|d4 05 85 7c) addmeo r4,r5 ++.*: (7c 85 36 15|15 36 85 7c) addo\. r4,r5,r6 ++.*: (7c 85 36 14|14 36 85 7c) addo r4,r5,r6 ++.*: (7c 85 01 95|95 01 85 7c) addze\. r4,r5 ++.*: (7c 85 01 94|94 01 85 7c) addze r4,r5 ++.*: (7c 85 05 95|95 05 85 7c) addzeo\. r4,r5 ++.*: (7c 85 05 94|94 05 85 7c) addzeo r4,r5 ++.*: (7c a4 30 39|39 30 a4 7c) and\. r4,r5,r6 ++.*: (7c a4 30 38|38 30 a4 7c) and r4,r5,r6 ++.*: (7c a4 30 79|79 30 a4 7c) andc\. r4,r5,r6 ++.*: (7c a4 30 78|78 30 a4 7c) andc r4,r5,r6 ++.*: (70 a4 00 06|06 00 a4 70) andi\. r4,r5,6 ++.*: (74 a4 00 06|06 00 a4 74) andis\. r4,r5,6 ++.*: (00 00 02 00|00 02 00 00) attn ++.*: (48 00 00 02|02 00 00 48) ba 0 ++.*: R_PPC(|64)_ADDR24 label_abs ++.*: (40 8a 00 00|00 00 8a 40) bne cr2,90 ++.*: R_PPC(|64)_REL14 foo ++.*: (40 ca 00 00|00 00 ca 40) bne- cr2,94 ++.*: R_PPC(|64)_REL14 foo ++.*: (40 ea 00 00|00 00 ea 40) bne\+ cr2,98 ++.*: R_PPC(|64)_REL14 foo ++.*: (40 85 00 02|02 00 85 40) blea cr1,0 ++.*: R_PPC(|64)_ADDR14 foo_abs ++.*: (40 c5 00 02|02 00 c5 40) blea- cr1,0 ++.*: R_PPC(|64)_ADDR14 foo_abs ++.*: (40 e5 00 02|02 00 e5 40) blea\+ cr1,0 ++.*: R_PPC(|64)_ADDR14 foo_abs ++.*: (4c 86 0c 20|20 0c 86 4c) bcctr 4,4\*cr1\+eq,1 ++.*: (4c c6 04 20|20 04 c6 4c) bnectr- cr1 ++.*: (4c e6 04 20|20 04 e6 4c) bnectr\+ cr1 ++.*: (4c 86 0c 21|21 0c 86 4c) bcctrl 4,4\*cr1\+eq,1 ++.*: (4c c6 04 21|21 04 c6 4c) bnectrl- cr1 ++.*: (4c e6 04 21|21 04 e6 4c) bnectrl\+ cr1 ++.*: (40 8a 00 01|01 00 8a 40) bnel cr2,c0 ++.*: R_PPC(|64)_REL14 foo ++.*: (40 ca 00 01|01 00 ca 40) bnel- cr2,c4 ++.*: R_PPC(|64)_REL14 foo ++.*: (40 ea 00 01|01 00 ea 40) bnel\+ cr2,c8 ++.*: R_PPC(|64)_REL14 foo ++.*: (40 85 00 03|03 00 85 40) blela cr1,0 ++.*: R_PPC(|64)_ADDR14 foo_abs ++.*: (40 c5 00 03|03 00 c5 40) blela- cr1,0 ++.*: R_PPC(|64)_ADDR14 foo_abs ++.*: (40 e5 00 03|03 00 e5 40) blela\+ cr1,0 ++.*: R_PPC(|64)_ADDR14 foo_abs ++.*: (4c 86 08 20|20 08 86 4c) bclr 4,4\*cr1\+eq,1 ++.*: (4c c6 00 20|20 00 c6 4c) bnelr- cr1 ++.*: (4c e6 00 20|20 00 e6 4c) bnelr\+ cr1 ++.*: (4c 86 08 21|21 08 86 4c) bclrl 4,4\*cr1\+eq,1 ++.*: (4c c6 00 21|21 00 c6 4c) bnelrl- cr1 ++.*: (4c e6 00 21|21 00 e6 4c) bnelrl\+ cr1 ++.*: (48 00 00 00|00 00 00 48) b f0 ++.*: R_PPC(|64)_REL24 label ++.*: (48 00 00 03|03 00 00 48) bla 0 ++.*: R_PPC(|64)_ADDR24 label_abs ++.*: (48 00 00 01|01 00 00 48) bl f8 ++.*: R_PPC(|64)_REL24 label ++.*: (7d 6a 61 f8|f8 61 6a 7d) bpermd r10,r11,r12 ++.*: (7c a7 40 00|00 40 a7 7c) cmpd cr1,r7,r8 ++.*: (7d 6a 63 f8|f8 63 6a 7d) cmpb r10,r11,r12 ++.*: (2c aa 00 0d|0d 00 aa 2c) cmpdi cr1,r10,13 ++.*: (2c aa ff f3|f3 ff aa 2c) cmpdi cr1,r10,-13 ++.*: (7c a7 40 40|40 40 a7 7c) cmpld cr1,r7,r8 ++.*: (28 aa 00 64|64 00 aa 28) cmpldi cr1,r10,100 ++.*: (7e b4 00 75|75 00 b4 7e) cntlzd\. r20,r21 ++.*: (7e b4 00 74|74 00 b4 7e) cntlzd r20,r21 ++.*: (7e b4 00 35|35 00 b4 7e) cntlzw\. r20,r21 ++.*: (7e b4 00 34|34 00 b4 7e) cntlzw r20,r21 ++.*: (4c 22 1a 02|02 1a 22 4c) crand gt,eq,so ++.*: (4c 22 19 02|02 19 22 4c) crandc gt,eq,so ++.*: (4c 22 1a 42|42 1a 22 4c) creqv gt,eq,so ++.*: (4c 22 19 c2|c2 19 22 4c) crnand gt,eq,so ++.*: (4c 22 18 42|42 18 22 4c) crnor gt,eq,so ++.*: (4c 22 1b 82|82 1b 22 4c) cror gt,eq,so ++.*: (4c 22 1b 42|42 1b 22 4c) crorc gt,eq,so ++.*: (4c 22 19 82|82 19 22 4c) crxor gt,eq,so ++.*: (7c 0a 5d ec|ec 5d 0a 7c) dcba r10,r11 ++.*: (7c 0a 58 ac|ac 58 0a 7c) dcbf r10,r11 ++.*: (7c 2a 58 ac|ac 58 2a 7c) dcbfl r10,r11 ++.*: (7c 0a 58 fe|fe 58 0a 7c) dcbfep r10,r11 ++.*: (7c 0a 5b ac|ac 5b 0a 7c) dcbi r10,r11 ++.*: (7c 0a 5b 0c|0c 5b 0a 7c) dcblc r10,r11 ++.*: (7c 2a 5b 0c|0c 5b 2a 7c) dcblc 1,r10,r11 ++.*: (7c 0a 58 6c|6c 58 0a 7c) dcbst r10,r11 ++.*: (7c 0a 58 7e|7e 58 0a 7c) dcbstep r10,r11 ++.*: (7c 0a 5a 2c|2c 5a 0a 7c) dcbt r10,r11 ++.*: (7c 2a 5a 2c|2c 5a 2a 7c) dcbt 1,r10,r11 ++.*: (7d 4b 62 7e|7e 62 4b 7d) dcbtep r10,r11,r12 ++.*: (7c 0a 59 4c|4c 59 0a 7c) dcbtls r10,r11 ++.*: (7c 2a 59 4c|4c 59 2a 7c) dcbtls 1,r10,r11 ++.*: (7c 0a 59 ec|ec 59 0a 7c) dcbtst r10,r11 ++.*: (7c 2a 59 ec|ec 59 2a 7c) dcbtst 1,r10,r11 ++.*: (7d 4b 61 fe|fe 61 4b 7d) dcbtstep r10,r11,r12 ++.*: (7c 0a 59 0c|0c 59 0a 7c) dcbtstls r10,r11 ++.*: (7c 2a 59 0c|0c 59 2a 7c) dcbtstls 1,r10,r11 ++.*: (7c 0a 5f ec|ec 5f 0a 7c) dcbz r10,r11 ++.*: (7c 0a 5f fe|fe 5f 0a 7c) dcbzep r10,r11 ++.*: (7c 00 03 8c|8c 03 00 7c) dccci ++.*: (7c 00 03 8c|8c 03 00 7c) dccci ++.*: (7c 00 03 8c|8c 03 00 7c) dccci ++.*: (7d 40 03 8c|8c 03 40 7d) dci 10 ++.*: (7e 95 b3 d3|d3 b3 95 7e) divd\. r20,r21,r22 ++.*: (7e 95 b3 d2|d2 b3 95 7e) divd r20,r21,r22 ++.*: (7e 95 b7 d3|d3 b7 95 7e) divdo\. r20,r21,r22 ++.*: (7e 95 b7 d2|d2 b7 95 7e) divdo r20,r21,r22 ++.*: (7e 95 b3 93|93 b3 95 7e) divdu\. r20,r21,r22 ++.*: (7e 95 b3 92|92 b3 95 7e) divdu r20,r21,r22 ++.*: (7e 95 b7 93|93 b7 95 7e) divduo\. r20,r21,r22 ++.*: (7e 95 b7 92|92 b7 95 7e) divduo r20,r21,r22 ++.*: (7e 95 b3 d7|d7 b3 95 7e) divw\. r20,r21,r22 ++.*: (7e 95 b3 d6|d6 b3 95 7e) divw r20,r21,r22 ++.*: (7e 95 b7 d7|d7 b7 95 7e) divwo\. r20,r21,r22 ++.*: (7e 95 b7 d6|d6 b7 95 7e) divwo r20,r21,r22 ++.*: (7e 95 b3 97|97 b3 95 7e) divwu\. r20,r21,r22 ++.*: (7e 95 b3 96|96 b3 95 7e) divwu r20,r21,r22 ++.*: (7e 95 b7 97|97 b7 95 7e) divwuo\. r20,r21,r22 ++.*: (7e 95 b7 96|96 b7 95 7e) divwuo r20,r21,r22 ++.*: (7e b4 b2 39|39 b2 b4 7e) eqv\. r20,r21,r22 ++.*: (7e b4 b2 38|38 b2 b4 7e) eqv r20,r21,r22 ++.*: (7c 0a 58 66|66 58 0a 7c) eratilx 0,r10,r11 ++.*: (7c 2a 58 66|66 58 2a 7c) eratilx 1,r10,r11 ++.*: (7c ea 58 66|66 58 ea 7c) eratilx 7,r10,r11 ++.*: (7d 4b 66 66|66 66 4b 7d) erativax r10,r11,r12 ++.*: (7d 4b 01 66|66 01 4b 7d) eratre r10,r11,0 ++.*: (7d 4b 19 66|66 19 4b 7d) eratre r10,r11,3 ++.*: (7d 4b 61 27|27 61 4b 7d) eratsx\. r10,r11,r12 ++.*: (7d 4b 61 26|26 61 4b 7d) eratsx r10,r11,r12 ++.*: (7d 4b 01 a6|a6 01 4b 7d) eratwe r10,r11,0 ++.*: (7d 4b 19 a6|a6 19 4b 7d) eratwe r10,r11,3 ++.*: (7d 6a 07 75|75 07 6a 7d) extsb\. r10,r11 ++.*: (7d 6a 07 74|74 07 6a 7d) extsb r10,r11 ++.*: (7d 6a 07 35|35 07 6a 7d) extsh\. r10,r11 ++.*: (7d 6a 07 34|34 07 6a 7d) extsh r10,r11 ++.*: (7d 6a 07 b5|b5 07 6a 7d) extsw\. r10,r11 ++.*: (7d 6a 07 b4|b4 07 6a 7d) extsw r10,r11 ++.*: (fe 80 aa 11|11 aa 80 fe) fabs\. f20,f21 ++.*: (fe 80 aa 10|10 aa 80 fe) fabs f20,f21 ++.*: (fe 95 b0 2b|2b b0 95 fe) fadd\. f20,f21,f22 ++.*: (fe 95 b0 2a|2a b0 95 fe) fadd f20,f21,f22 ++.*: (ee 95 b0 2b|2b b0 95 ee) fadds\. f20,f21,f22 ++.*: (ee 95 b0 2a|2a b0 95 ee) fadds f20,f21,f22 ++.*: (fe 80 ae 9d|9d ae 80 fe) fcfid\. f20,f21 ++.*: (fe 80 ae 9c|9c ae 80 fe) fcfid f20,f21 ++.*: (fc 14 a8 40|40 a8 14 fc) fcmpo cr0,f20,f21 ++.*: (fc 94 a8 40|40 a8 94 fc) fcmpo cr1,f20,f21 ++.*: (fc 14 a8 00|00 a8 14 fc) fcmpu cr0,f20,f21 ++.*: (fc 94 a8 00|00 a8 94 fc) fcmpu cr1,f20,f21 ++.*: (fe 95 b0 11|11 b0 95 fe) fcpsgn\. f20,f21,f22 ++.*: (fe 95 b0 10|10 b0 95 fe) fcpsgn f20,f21,f22 ++.*: (fe 80 ae 5d|5d ae 80 fe) fctid\. f20,f21 ++.*: (fe 80 ae 5c|5c ae 80 fe) fctid f20,f21 ++.*: (fe 80 ae 5f|5f ae 80 fe) fctidz\. f20,f21 ++.*: (fe 80 ae 5e|5e ae 80 fe) fctidz f20,f21 ++.*: (fe 80 a8 1d|1d a8 80 fe) fctiw\. f20,f21 ++.*: (fe 80 a8 1c|1c a8 80 fe) fctiw f20,f21 ++.*: (fe 80 a8 1f|1f a8 80 fe) fctiwz\. f20,f21 ++.*: (fe 80 a8 1e|1e a8 80 fe) fctiwz f20,f21 ++.*: (fe 95 b0 25|25 b0 95 fe) fdiv\. f20,f21,f22 ++.*: (fe 95 b0 24|24 b0 95 fe) fdiv f20,f21,f22 ++.*: (ee 95 b0 25|25 b0 95 ee) fdivs\. f20,f21,f22 ++.*: (ee 95 b0 24|24 b0 95 ee) fdivs f20,f21,f22 ++.*: (fe 95 bd bb|bb bd 95 fe) fmadd\. f20,f21,f22,f23 ++.*: (fe 95 bd ba|ba bd 95 fe) fmadd f20,f21,f22,f23 ++.*: (ee 95 bd bb|bb bd 95 ee) fmadds\. f20,f21,f22,f23 ++.*: (ee 95 bd ba|ba bd 95 ee) fmadds f20,f21,f22,f23 ++.*: (fe 80 a8 91|91 a8 80 fe) fmr\. f20,f21 ++.*: (fe 80 a8 90|90 a8 80 fe) fmr f20,f21 ++.*: (fe 95 bd b9|b9 bd 95 fe) fmsub\. f20,f21,f22,f23 ++.*: (fe 95 bd b8|b8 bd 95 fe) fmsub f20,f21,f22,f23 ++.*: (ee 95 bd b9|b9 bd 95 ee) fmsubs\. f20,f21,f22,f23 ++.*: (ee 95 bd b8|b8 bd 95 ee) fmsubs f20,f21,f22,f23 ++.*: (fe 95 05 b3|b3 05 95 fe) fmul\. f20,f21,f22 ++.*: (fe 95 05 b2|b2 05 95 fe) fmul f20,f21,f22 ++.*: (ee 95 05 b3|b3 05 95 ee) fmuls\. f20,f21,f22 ++.*: (ee 95 05 b2|b2 05 95 ee) fmuls f20,f21,f22 ++.*: (fe 80 a9 11|11 a9 80 fe) fnabs\. f20,f21 ++.*: (fe 80 a9 10|10 a9 80 fe) fnabs f20,f21 ++.*: (fe 80 a8 51|51 a8 80 fe) fneg\. f20,f21 ++.*: (fe 80 a8 50|50 a8 80 fe) fneg f20,f21 ++.*: (fe 95 bd bf|bf bd 95 fe) fnmadd\. f20,f21,f22,f23 ++.*: (fe 95 bd be|be bd 95 fe) fnmadd f20,f21,f22,f23 ++.*: (ee 95 bd bf|bf bd 95 ee) fnmadds\. f20,f21,f22,f23 ++.*: (ee 95 bd be|be bd 95 ee) fnmadds f20,f21,f22,f23 ++.*: (fe 95 bd bd|bd bd 95 fe) fnmsub\. f20,f21,f22,f23 ++.*: (fe 95 bd bc|bc bd 95 fe) fnmsub f20,f21,f22,f23 ++.*: (ee 95 bd bd|bd bd 95 ee) fnmsubs\. f20,f21,f22,f23 ++.*: (ee 95 bd bc|bc bd 95 ee) fnmsubs f20,f21,f22,f23 ++.*: (fe 80 a8 31|31 a8 80 fe) fre\. f20,f21 ++.*: (fe 80 a8 30|30 a8 80 fe) fre f20,f21 ++.*: (fe 80 a8 31|31 a8 80 fe) fre\. f20,f21 ++.*: (fe 80 a8 30|30 a8 80 fe) fre f20,f21 ++.*: (fe 81 a8 31|31 a8 81 fe) fre\. f20,f21,1 ++.*: (fe 81 a8 30|30 a8 81 fe) fre f20,f21,1 ++.*: (ee 80 a8 31|31 a8 80 ee) fres\. f20,f21 ++.*: (ee 80 a8 30|30 a8 80 ee) fres f20,f21 ++.*: (ee 80 a8 31|31 a8 80 ee) fres\. f20,f21 ++.*: (ee 80 a8 30|30 a8 80 ee) fres f20,f21 ++.*: (ee 81 a8 31|31 a8 81 ee) fres\. f20,f21,1 ++.*: (ee 81 a8 30|30 a8 81 ee) fres f20,f21,1 ++.*: (fe 80 ab d1|d1 ab 80 fe) frim\. f20,f21 ++.*: (fe 80 ab d0|d0 ab 80 fe) frim f20,f21 ++.*: (fe 80 ab 11|11 ab 80 fe) frin\. f20,f21 ++.*: (fe 80 ab 10|10 ab 80 fe) frin f20,f21 ++.*: (fe 80 ab 91|91 ab 80 fe) frip\. f20,f21 ++.*: (fe 80 ab 90|90 ab 80 fe) frip f20,f21 ++.*: (fe 80 ab 51|51 ab 80 fe) friz\. f20,f21 ++.*: (fe 80 ab 50|50 ab 80 fe) friz f20,f21 ++.*: (fe 80 a8 19|19 a8 80 fe) frsp\. f20,f21 ++.*: (fe 80 a8 18|18 a8 80 fe) frsp f20,f21 ++.*: (fe 80 a8 35|35 a8 80 fe) frsqrte\. f20,f21 ++.*: (fe 80 a8 34|34 a8 80 fe) frsqrte f20,f21 ++.*: (fe 80 a8 35|35 a8 80 fe) frsqrte\. f20,f21 ++.*: (fe 80 a8 34|34 a8 80 fe) frsqrte f20,f21 ++.*: (fe 81 a8 35|35 a8 81 fe) frsqrte\. f20,f21,1 ++.*: (fe 81 a8 34|34 a8 81 fe) frsqrte f20,f21,1 ++.*: (ee 80 a8 34|34 a8 80 ee) frsqrtes f20,f21 ++.*: (ee 80 a8 35|35 a8 80 ee) frsqrtes\. f20,f21 ++.*: (ee 80 a8 34|34 a8 80 ee) frsqrtes f20,f21 ++.*: (ee 80 a8 35|35 a8 80 ee) frsqrtes\. f20,f21 ++.*: (ee 81 a8 34|34 a8 81 ee) frsqrtes f20,f21,1 ++.*: (ee 81 a8 35|35 a8 81 ee) frsqrtes\. f20,f21,1 ++.*: (fe 95 bd af|af bd 95 fe) fsel\. f20,f21,f22,f23 ++.*: (fe 95 bd ae|ae bd 95 fe) fsel f20,f21,f22,f23 ++.*: (fe 80 a8 2d|2d a8 80 fe) fsqrt\. f20,f21 ++.*: (fe 80 a8 2c|2c a8 80 fe) fsqrt f20,f21 ++.*: (ee 80 a8 2d|2d a8 80 ee) fsqrts\. f20,f21 ++.*: (ee 80 a8 2c|2c a8 80 ee) fsqrts f20,f21 ++.*: (fe 95 b0 29|29 b0 95 fe) fsub\. f20,f21,f22 ++.*: (fe 95 b0 28|28 b0 95 fe) fsub f20,f21,f22 ++.*: (ee 95 b0 29|29 b0 95 ee) fsubs\. f20,f21,f22 ++.*: (ee 95 b0 28|28 b0 95 ee) fsubs f20,f21,f22 ++.*: (7c 0a 5f ac|ac 5f 0a 7c) icbi r10,r11 ++.*: (7c 0a 5f be|be 5f 0a 7c) icbiep r10,r11 ++.*: (7c 0a 58 2c|2c 58 0a 7c) icbt r10,r11 ++.*: (7c ea 58 2c|2c 58 ea 7c) icbt 7,r10,r11 ++.*: (7c 0a 5b cc|cc 5b 0a 7c) icbtls r10,r11 ++.*: (7c ea 5b cc|cc 5b ea 7c) icbtls 7,r10,r11 ++.*: (7c 00 07 8c|8c 07 00 7c) iccci ++.*: (7c 00 07 8c|8c 07 00 7c) iccci ++.*: (7c 00 07 8c|8c 07 00 7c) iccci ++.*: (7d 40 07 8c|8c 07 40 7d) ici 10 ++.*: (7d 4b 63 2d|2d 63 4b 7d) icswx\. r10,r11,r12 ++.*: (7d 4b 63 2c|2c 63 4b 7d) icswx r10,r11,r12 ++.*: (7d 4b 65 de|de 65 4b 7d) isel r10,r11,r12,23 ++.*: (4c 00 01 2c|2c 01 00 4c) isync ++.*: (7d 4b 60 be|be 60 4b 7d) lbepx r10,r11,r12 ++.*: (89 4b ff ef|ef ff 4b 89) lbz r10,-17\(r11\) ++.*: (89 4b 00 11|11 00 4b 89) lbz r10,17\(r11\) ++.*: (8d 4b ff ff|ff ff 4b 8d) lbzu r10,-1\(r11\) ++.*: (8d 4b 00 01|01 00 4b 8d) lbzu r10,1\(r11\) ++.*: (7d 4b 68 ee|ee 68 4b 7d) lbzux r10,r11,r13 ++.*: (7d 4b 68 ae|ae 68 4b 7d) lbzx r10,r11,r13 ++.*: (e9 4b ff f8|f8 ff 4b e9) ld r10,-8\(r11\) ++.*: (e9 4b 00 08|08 00 4b e9) ld r10,8\(r11\) ++.*: (7d 4b 60 a8|a8 60 4b 7d) ldarx r10,r11,r12 ++.*: (7d 4b 60 a9|a9 60 4b 7d) ldarx r10,r11,r12,1 ++.*: (7d 4b 64 28|28 64 4b 7d) ldbrx r10,r11,r12 ++.*: (7d 4b 60 3a|3a 60 4b 7d) ldepx r10,r11,r12 ++.*: (e9 4b ff f9|f9 ff 4b e9) ldu r10,-8\(r11\) ++.*: (e9 4b 00 09|09 00 4b e9) ldu r10,8\(r11\) ++.*: (7d 4b 60 6a|6a 60 4b 7d) ldux r10,r11,r12 ++.*: (7d 4b 60 2a|2a 60 4b 7d) ldx r10,r11,r12 ++.*: (ca 8a ff f8|f8 ff 8a ca) lfd f20,-8\(r10\) ++.*: (ca 8a 00 08|08 00 8a ca) lfd f20,8\(r10\) ++.*: (7e 8a 5c be|be 5c 8a 7e) lfdepx f20,r10,r11 ++.*: (ce 8a ff f8|f8 ff 8a ce) lfdu f20,-8\(r10\) ++.*: (ce 8a 00 08|08 00 8a ce) lfdu f20,8\(r10\) ++.*: (7e 8a 5c ee|ee 5c 8a 7e) lfdux f20,r10,r11 ++.*: (7e 8a 5c ae|ae 5c 8a 7e) lfdx f20,r10,r11 ++.*: (7e 8a 5e ae|ae 5e 8a 7e) lfiwax f20,r10,r11 ++.*: (7e 8a 5e ee|ee 5e 8a 7e) lfiwzx f20,r10,r11 ++.*: (c2 8a ff fc|fc ff 8a c2) lfs f20,-4\(r10\) ++.*: (c2 8a 00 04|04 00 8a c2) lfs f20,4\(r10\) ++.*: (c6 8a ff fc|fc ff 8a c6) lfsu f20,-4\(r10\) ++.*: (c6 8a 00 04|04 00 8a c6) lfsu f20,4\(r10\) ++.*: (7e 8a 5c 6e|6e 5c 8a 7e) lfsux f20,r10,r11 ++.*: (7e 8a 5c 2e|2e 5c 8a 7e) lfsx f20,r10,r11 ++.*: (a9 4b 00 02|02 00 4b a9) lha r10,2\(r11\) ++.*: (ad 4b ff fe|fe ff 4b ad) lhau r10,-2\(r11\) ++.*: (7d 4b 62 ee|ee 62 4b 7d) lhaux r10,r11,r12 ++.*: (7d 4b 62 ae|ae 62 4b 7d) lhax r10,r11,r12 ++.*: (7d 4b 66 2c|2c 66 4b 7d) lhbrx r10,r11,r12 ++.*: (7d 4b 62 3e|3e 62 4b 7d) lhepx r10,r11,r12 ++.*: (a1 4b ff fe|fe ff 4b a1) lhz r10,-2\(r11\) ++.*: (a1 4b 00 02|02 00 4b a1) lhz r10,2\(r11\) ++.*: (a5 4b ff fe|fe ff 4b a5) lhzu r10,-2\(r11\) ++.*: (a5 4b 00 02|02 00 4b a5) lhzu r10,2\(r11\) ++.*: (7d 4b 62 6e|6e 62 4b 7d) lhzux r10,r11,r12 ++.*: (7d 4b 62 2e|2e 62 4b 7d) lhzx r10,r11,r12 ++.*: (e9 4b ff fe|fe ff 4b e9) lwa r10,-4\(r11\) ++.*: (e9 4b 00 06|06 00 4b e9) lwa r10,4\(r11\) ++.*: (7d 4b 60 28|28 60 4b 7d) lwarx r10,r11,r12 ++.*: (7d 4b 60 29|29 60 4b 7d) lwarx r10,r11,r12,1 ++.*: (7d 4b 62 ea|ea 62 4b 7d) lwaux r10,r11,r12 ++.*: (7d 4b 62 aa|aa 62 4b 7d) lwax r10,r11,r12 ++.*: (7d 4b 64 2c|2c 64 4b 7d) lwbrx r10,r11,r12 ++.*: (7d 4b 60 3e|3e 60 4b 7d) lwepx r10,r11,r12 ++.*: (81 4b ff fc|fc ff 4b 81) lwz r10,-4\(r11\) ++.*: (81 4b 00 04|04 00 4b 81) lwz r10,4\(r11\) ++.*: (85 4b ff fc|fc ff 4b 85) lwzu r10,-4\(r11\) ++.*: (85 4b 00 04|04 00 4b 85) lwzu r10,4\(r11\) ++.*: (7d 4b 60 6e|6e 60 4b 7d) lwzux r10,r11,r12 ++.*: (7d 4b 60 2e|2e 60 4b 7d) lwzx r10,r11,r12 ++.*: (7c 00 06 ac|ac 06 00 7c) mbar ++.*: (7c 00 06 ac|ac 06 00 7c) mbar ++.*: (7c 00 06 ac|ac 06 00 7c) mbar ++.*: (7c 20 06 ac|ac 06 20 7c) mbar 1 ++.*: (4c 04 00 00|00 00 04 4c) mcrf cr0,cr1 ++.*: (fd 90 00 80|80 00 90 fd) mcrfs cr3,cr4 ++.*: (7c 00 04 00|00 04 00 7c) mcrxr cr0 ++.*: (7d 80 04 00|00 04 80 7d) mcrxr cr3 ++.*: (7c 60 00 26|26 00 60 7c) mfcr r3 ++.*: (7c 70 20 26|26 20 70 7c) mfocrf r3,2 ++.*: (7c 70 10 26|26 10 70 7c) mfocrf r3,1 ++.*: (7c 78 00 26|26 00 78 7c) mfocrf r3,128 ++.*: (7d 4a 3a 87|87 3a 4a 7d) mfdcr\. r10,234 ++.*: (7d 4a 3a 86|86 3a 4a 7d) mfdcr r10,234 ++.*: (7d 4b 02 07|07 02 4b 7d) mfdcrx\. r10,r11 ++.*: (7d 4b 02 06|06 02 4b 7d) mfdcrx r10,r11 ++.*: (fe 80 04 8f|8f 04 80 fe) mffs\. f20 ++.*: (fe 80 04 8e|8e 04 80 fe) mffs f20 ++.*: (7d 40 00 a6|a6 00 40 7d) mfmsr r10 ++.*: (7c 70 10 26|26 10 70 7c) mfocrf r3,1 ++.*: (7c 78 00 26|26 00 78 7c) mfocrf r3,128 ++.*: (7d 4a 3a a6|a6 3a 4a 7d) mfspr r10,234 ++.*: (7d 4c 42 a6|a6 42 4c 7d) mftb r10 ++.*: (7d 4d 42 a6|a6 42 4d 7d) mftbu r10 ++.*: (7c 00 51 dc|dc 51 00 7c) msgclr r10 ++.*: (7c 00 51 9c|9c 51 00 7c) msgsnd r10 ++.*: (7c 60 01 20|20 01 60 7c) mtcrf 0,r3 ++.*: (7c 70 11 20|20 11 70 7c) mtocrf 1,r3 ++.*: (7c 78 01 20|20 01 78 7c) mtocrf 128,r3 ++.*: (7c 6f f1 20|20 f1 6f 7c) mtcr r3 ++.*: (7d 4a 3b 87|87 3b 4a 7d) mtdcr\. 234,r10 ++.*: (7d 4a 3b 86|86 3b 4a 7d) mtdcr 234,r10 ++.*: (7d 6a 03 07|07 03 6a 7d) mtdcrx\. r10,r11 ++.*: (7d 6a 03 06|06 03 6a 7d) mtdcrx r10,r11 ++.*: (fc 60 00 8d|8d 00 60 fc) mtfsb0\. 3 ++.*: (fc 60 00 8c|8c 00 60 fc) mtfsb0 3 ++.*: (fc 60 00 4d|4d 00 60 fc) mtfsb1\. 3 ++.*: (fc 60 00 4c|4c 00 60 fc) mtfsb1 3 ++.*: (fc 0c a5 8f|8f a5 0c fc) mtfsf\. 6,f20 ++.*: (fc 0c a5 8e|8e a5 0c fc) mtfsf 6,f20 ++.*: (fc 0c a5 8f|8f a5 0c fc) mtfsf\. 6,f20 ++.*: (fc 0c a5 8e|8e a5 0c fc) mtfsf 6,f20 ++.*: (fe 0d a5 8f|8f a5 0d fe) mtfsf\. 6,f20,1,1 ++.*: (fe 0d a5 8e|8e a5 0d fe) mtfsf 6,f20,1,1 ++.*: (ff 00 01 0d|0d 01 00 ff) mtfsfi\. 6,0 ++.*: (ff 00 01 0c|0c 01 00 ff) mtfsfi 6,0 ++.*: (ff 00 d1 0d|0d d1 00 ff) mtfsfi\. 6,13 ++.*: (ff 00 d1 0c|0c d1 00 ff) mtfsfi 6,13 ++.*: (ff 01 d1 0d|0d d1 01 ff) mtfsfi\. 6,13,1 ++.*: (ff 01 d1 0c|0c d1 01 ff) mtfsfi 6,13,1 ++.*: (7d 40 01 24|24 01 40 7d) mtmsr r10 ++.*: (7d 40 01 24|24 01 40 7d) mtmsr r10 ++.*: (7d 41 01 24|24 01 41 7d) mtmsr r10,1 ++.*: (7c 70 11 20|20 11 70 7c) mtocrf 1,r3 ++.*: (7c 78 01 20|20 01 78 7c) mtocrf 128,r3 ++.*: (7d 4a 3b a6|a6 3b 4a 7d) mtspr 234,r10 ++.*: (7e 95 b0 93|93 b0 95 7e) mulhd\. r20,r21,r22 ++.*: (7e 95 b0 92|92 b0 95 7e) mulhd r20,r21,r22 ++.*: (7e 95 b0 13|13 b0 95 7e) mulhdu\. r20,r21,r22 ++.*: (7e 95 b0 12|12 b0 95 7e) mulhdu r20,r21,r22 ++.*: (7e 95 b0 97|97 b0 95 7e) mulhw\. r20,r21,r22 ++.*: (7e 95 b0 96|96 b0 95 7e) mulhw r20,r21,r22 ++.*: (7e 95 b0 17|17 b0 95 7e) mulhwu\. r20,r21,r22 ++.*: (7e 95 b0 16|16 b0 95 7e) mulhwu r20,r21,r22 ++.*: (7e 95 b1 d3|d3 b1 95 7e) mulld\. r20,r21,r22 ++.*: (7e 95 b1 d2|d2 b1 95 7e) mulld r20,r21,r22 ++.*: (7e 95 b5 d3|d3 b5 95 7e) mulldo\. r20,r21,r22 ++.*: (7e 95 b5 d2|d2 b5 95 7e) mulldo r20,r21,r22 ++.*: (1e 95 00 64|64 00 95 1e) mulli r20,r21,100 ++.*: (1e 95 ff 9c|9c ff 95 1e) mulli r20,r21,-100 ++.*: (7e 95 b1 d7|d7 b1 95 7e) mullw\. r20,r21,r22 ++.*: (7e 95 b1 d6|d6 b1 95 7e) mullw r20,r21,r22 ++.*: (7e 95 b5 d7|d7 b5 95 7e) mullwo\. r20,r21,r22 ++.*: (7e 95 b5 d6|d6 b5 95 7e) mullwo r20,r21,r22 ++.*: (7e b4 b3 b9|b9 b3 b4 7e) nand\. r20,r21,r22 ++.*: (7e b4 b3 b8|b8 b3 b4 7e) nand r20,r21,r22 ++.*: (7e 95 00 d1|d1 00 95 7e) neg\. r20,r21 ++.*: (7e 95 00 d0|d0 00 95 7e) neg r20,r21 ++.*: (7e 95 04 d1|d1 04 95 7e) nego\. r20,r21 ++.*: (7e 95 04 d0|d0 04 95 7e) nego r20,r21 ++.*: (7e b4 b0 f9|f9 b0 b4 7e) nor\. r20,r21,r22 ++.*: (7e b4 b0 f8|f8 b0 b4 7e) nor r20,r21,r22 ++.*: (7e b4 b3 79|79 b3 b4 7e) or\. r20,r21,r22 ++.*: (7e b4 b3 78|78 b3 b4 7e) or r20,r21,r22 ++.*: (7e b4 b3 39|39 b3 b4 7e) orc\. r20,r21,r22 ++.*: (7e b4 b3 38|38 b3 b4 7e) orc r20,r21,r22 ++.*: (62 b4 10 00|00 10 b4 62) ori r20,r21,4096 ++.*: (66 b4 10 00|00 10 b4 66) oris r20,r21,4096 ++.*: (7d 6a 00 f4|f4 00 6a 7d) popcntb r10,r11 ++.*: (7d 6a 03 f4|f4 03 6a 7d) popcntd r10,r11 ++.*: (7d 6a 02 f4|f4 02 6a 7d) popcntw r10,r11 ++.*: (7d 6a 01 74|74 01 6a 7d) prtyd r10,r11 ++.*: (7d 6a 01 34|34 01 6a 7d) prtyw r10,r11 ++.*: (4c 00 00 66|66 00 00 4c) rfci ++.*: (4c 00 00 cc|cc 00 00 4c) rfgi ++.*: (4c 00 00 64|64 00 00 4c) rfi ++.*: (4c 00 00 4c|4c 00 00 4c) rfmci ++.*: (79 6a 67 f1|f1 67 6a 79) rldcl\. r10,r11,r12,63 ++.*: (79 6a 67 f0|f0 67 6a 79) rldcl r10,r11,r12,63 ++.*: (79 6a 67 f3|f3 67 6a 79) rldcr\. r10,r11,r12,63 ++.*: (79 6a 67 f2|f2 67 6a 79) rldcr r10,r11,r12,63 ++.*: (79 6a bf e9|e9 bf 6a 79) rldic\. r10,r11,23,63 ++.*: (79 6a bf e8|e8 bf 6a 79) rldic r10,r11,23,63 ++.*: (79 6a bf e1|e1 bf 6a 79) rldicl\. r10,r11,23,63 ++.*: (79 6a bf e0|e0 bf 6a 79) rldicl r10,r11,23,63 ++.*: (79 6a bf e5|e5 bf 6a 79) rldicr\. r10,r11,23,63 ++.*: (79 6a bf e4|e4 bf 6a 79) rldicr r10,r11,23,63 ++.*: (79 6a bf ed|ed bf 6a 79) rldimi\. r10,r11,23,63 ++.*: (79 6a bf ec|ec bf 6a 79) rldimi r10,r11,23,63 ++.*: (51 6a b8 3f|3f b8 6a 51) rlwimi\. r10,r11,23,0,31 ++.*: (51 6a b8 3e|3e b8 6a 51) rlwimi r10,r11,23,0,31 ++.*: (55 6a b8 3f|3f b8 6a 55) rotlwi\. r10,r11,23 ++.*: (55 6a b8 3e|3e b8 6a 55) rotlwi r10,r11,23 ++.*: (5d 6a b8 3f|3f b8 6a 5d) rotlw\. r10,r11,r23 ++.*: (5d 6a b8 3e|3e b8 6a 5d) rotlw r10,r11,r23 ++.*: (44 00 00 02|02 00 00 44) sc ++.*: (44 00 0c 82|82 0c 00 44) sc 100 ++.*: (7d 6a 60 37|37 60 6a 7d) sld\. r10,r11,r12 ++.*: (7d 6a 60 36|36 60 6a 7d) sld r10,r11,r12 ++.*: (7d 6a 60 31|31 60 6a 7d) slw\. r10,r11,r12 ++.*: (7d 6a 60 30|30 60 6a 7d) slw r10,r11,r12 ++.*: (7d 6a 66 35|35 66 6a 7d) srad\. r10,r11,r12 ++.*: (7d 6a 66 34|34 66 6a 7d) srad r10,r11,r12 ++.*: (7d 6a fe 77|77 fe 6a 7d) sradi\. r10,r11,63 ++.*: (7d 6a fe 76|76 fe 6a 7d) sradi r10,r11,63 ++.*: (7d 6a 66 31|31 66 6a 7d) sraw\. r10,r11,r12 ++.*: (7d 6a 66 30|30 66 6a 7d) sraw r10,r11,r12 ++.*: (7d 6a fe 71|71 fe 6a 7d) srawi\. r10,r11,31 ++.*: (7d 6a fe 70|70 fe 6a 7d) srawi r10,r11,31 ++.*: (7d 6a 64 37|37 64 6a 7d) srd\. r10,r11,r12 ++.*: (7d 6a 64 36|36 64 6a 7d) srd r10,r11,r12 ++.*: (7d 6a 64 31|31 64 6a 7d) srw\. r10,r11,r12 ++.*: (7d 6a 64 30|30 64 6a 7d) srw r10,r11,r12 ++.*: (99 4b ff ff|ff ff 4b 99) stb r10,-1\(r11\) ++.*: (99 4b 00 01|01 00 4b 99) stb r10,1\(r11\) ++.*: (7d 4b 61 be|be 61 4b 7d) stbepx r10,r11,r12 ++.*: (9d 4b ff ff|ff ff 4b 9d) stbu r10,-1\(r11\) ++.*: (9d 4b 00 01|01 00 4b 9d) stbu r10,1\(r11\) ++.*: (7d 4b 61 ee|ee 61 4b 7d) stbux r10,r11,r12 ++.*: (7d 4b 61 ae|ae 61 4b 7d) stbx r10,r11,r12 ++.*: (f9 4b ff f8|f8 ff 4b f9) std r10,-8\(r11\) ++.*: (f9 4b 00 08|08 00 4b f9) std r10,8\(r11\) ++.*: (7d 4b 65 28|28 65 4b 7d) stdbrx r10,r11,r12 ++.*: (7d 4b 61 ad|ad 61 4b 7d) stdcx\. r10,r11,r12 ++.*: (7d 4b 61 3a|3a 61 4b 7d) stdepx r10,r11,r12 ++.*: (f9 4b ff f9|f9 ff 4b f9) stdu r10,-8\(r11\) ++.*: (f9 4b 00 09|09 00 4b f9) stdu r10,8\(r11\) ++.*: (7d 4b 61 6a|6a 61 4b 7d) stdux r10,r11,r12 ++.*: (7d 4b 61 2a|2a 61 4b 7d) stdx r10,r11,r12 ++.*: (da 8a ff f8|f8 ff 8a da) stfd f20,-8\(r10\) ++.*: (da 8a 00 08|08 00 8a da) stfd f20,8\(r10\) ++.*: (7e 8a 5d be|be 5d 8a 7e) stfdepx f20,r10,r11 ++.*: (de 8a ff f8|f8 ff 8a de) stfdu f20,-8\(r10\) ++.*: (de 8a 00 08|08 00 8a de) stfdu f20,8\(r10\) ++.*: (7e 8a 5d ee|ee 5d 8a 7e) stfdux f20,r10,r11 ++.*: (7e 8a 5d ae|ae 5d 8a 7e) stfdx f20,r10,r11 ++.*: (7e 8a 5f ae|ae 5f 8a 7e) stfiwx f20,r10,r11 ++.*: (d2 8a ff fc|fc ff 8a d2) stfs f20,-4\(r10\) ++.*: (d2 8a 00 04|04 00 8a d2) stfs f20,4\(r10\) ++.*: (d6 8a ff fc|fc ff 8a d6) stfsu f20,-4\(r10\) ++.*: (d6 8a 00 04|04 00 8a d6) stfsu f20,4\(r10\) ++.*: (7e 8a 5d 6e|6e 5d 8a 7e) stfsux f20,r10,r11 ++.*: (7e 8a 5d 2e|2e 5d 8a 7e) stfsx f20,r10,r11 ++.*: (b1 4b ff fe|fe ff 4b b1) sth r10,-2\(r11\) ++.*: (b1 4b 00 02|02 00 4b b1) sth r10,2\(r11\) ++.*: (b1 4b ff fc|fc ff 4b b1) sth r10,-4\(r11\) ++.*: (b1 4b 00 04|04 00 4b b1) sth r10,4\(r11\) ++.*: (7d 4b 67 2c|2c 67 4b 7d) sthbrx r10,r11,r12 ++.*: (7d 4b 63 3e|3e 63 4b 7d) sthepx r10,r11,r12 ++.*: (b5 4b ff fe|fe ff 4b b5) sthu r10,-2\(r11\) ++.*: (b5 4b 00 02|02 00 4b b5) sthu r10,2\(r11\) ++.*: (7d 4b 63 6e|6e 63 4b 7d) sthux r10,r11,r12 ++.*: (7d 4b 63 2e|2e 63 4b 7d) sthx r10,r11,r12 ++.*: (7d 4b 65 2c|2c 65 4b 7d) stwbrx r10,r11,r12 ++.*: (7d 4b 61 2d|2d 61 4b 7d) stwcx\. r10,r11,r12 ++.*: (7d 4b 61 3e|3e 61 4b 7d) stwepx r10,r11,r12 ++.*: (95 4b ff fc|fc ff 4b 95) stwu r10,-4\(r11\) ++.*: (95 4b 00 04|04 00 4b 95) stwu r10,4\(r11\) ++.*: (7d 4b 61 6e|6e 61 4b 7d) stwux r10,r11,r12 ++.*: (7d 4b 61 2e|2e 61 4b 7d) stwx r10,r11,r12 ++.*: (7e 95 b0 51|51 b0 95 7e) subf\. r20,r21,r22 ++.*: (7e 95 b0 50|50 b0 95 7e) subf r20,r21,r22 ++.*: (7e 95 b0 11|11 b0 95 7e) subfc\. r20,r21,r22 ++.*: (7e 95 b0 10|10 b0 95 7e) subfc r20,r21,r22 ++.*: (7e 95 b4 11|11 b4 95 7e) subfco\. r20,r21,r22 ++.*: (7e 95 b4 10|10 b4 95 7e) subfco r20,r21,r22 ++.*: (7e 95 b1 11|11 b1 95 7e) subfe\. r20,r21,r22 ++.*: (7e 95 b1 10|10 b1 95 7e) subfe r20,r21,r22 ++.*: (7e 95 b5 11|11 b5 95 7e) subfeo\. r20,r21,r22 ++.*: (7e 95 b5 10|10 b5 95 7e) subfeo r20,r21,r22 ++.*: (22 95 00 64|64 00 95 22) subfic r20,r21,100 ++.*: (22 95 ff 9c|9c ff 95 22) subfic r20,r21,-100 ++.*: (7e 95 01 d1|d1 01 95 7e) subfme\. r20,r21 ++.*: (7e 95 01 d0|d0 01 95 7e) subfme r20,r21 ++.*: (7e 95 05 d1|d1 05 95 7e) subfmeo\. r20,r21 ++.*: (7e 95 05 d0|d0 05 95 7e) subfmeo r20,r21 ++.*: (7e 95 b4 51|51 b4 95 7e) subfo\. r20,r21,r22 ++.*: (7e 95 b4 50|50 b4 95 7e) subfo r20,r21,r22 ++.*: (7e 95 01 91|91 01 95 7e) subfze\. r20,r21 ++.*: (7e 95 01 90|90 01 95 7e) subfze r20,r21 ++.*: (7e 95 05 91|91 05 95 7e) subfzeo\. r20,r21 ++.*: (7e 95 05 90|90 05 95 7e) subfzeo r20,r21 ++.*: (7c 00 04 ac|ac 04 00 7c) hwsync ++.*: (7c 00 04 ac|ac 04 00 7c) hwsync ++.*: (7c 00 04 ac|ac 04 00 7c) hwsync ++.*: (7c 20 04 ac|ac 04 20 7c) lwsync ++.*: (7c aa 58 88|88 58 aa 7c) tdlge r10,r11 ++.*: (08 aa 00 64|64 00 aa 08) tdlgei r10,100 ++.*: (08 aa ff 9c|9c ff aa 08) tdlgei r10,-100 ++.*: (7c 6a 58 24|24 58 6a 7c) tlbilxva r10,r11 ++.*: (7c 0a 5e 24|24 5e 0a 7c) tlbivax r10,r11 ++.*: (7c 00 07 64|64 07 00 7c) tlbre ++.*: (7d 4b 3f 64|64 3f 4b 7d) tlbre r10,r11,7 ++.*: (7c 0a 5e a5|a5 5e 0a 7c) tlbsrx\. r10,r11 ++.*: (7d 4b 67 25|25 67 4b 7d) tlbsx\. r10,r11,r12 ++.*: (7d 4b 67 24|24 67 4b 7d) tlbsx r10,r11,r12 ++.*: (7c 00 04 6c|6c 04 00 7c) tlbsync ++.*: (7c 00 07 a4|a4 07 00 7c) tlbwe ++.*: (7d 4b 3f a4|a4 3f 4b 7d) tlbwe r10,r11,7 ++.*: (7c aa 58 08|08 58 aa 7c) twlge r10,r11 ++.*: (0c aa 00 64|64 00 aa 0c) twlgei r10,100 ++.*: (0c aa ff 9c|9c ff aa 0c) twlgei r10,-100 ++.*: (7c 00 00 7c|7c 00 00 7c) wait ++.*: (7c 00 00 7c|7c 00 00 7c) wait ++.*: (7c 20 00 7c|7c 00 20 7c) waitrsv ++.*: (7c 40 00 7c|7c 00 40 7c) waitimpl ++.*: (7c 40 00 7c|7c 00 40 7c) waitimpl ++.*: (7c 20 00 7c|7c 00 20 7c) waitrsv ++.*: (7c 00 01 6c|6c 01 00 7c) wchkall ++.*: (7c 00 01 6c|6c 01 00 7c) wchkall ++.*: (7d 80 01 6c|6c 01 80 7d) wchkall cr3 ++.*: (7c 2a 5f 4c|4c 5f 2a 7c) wclr 1,r10,r11 ++.*: (7c 20 07 4c|4c 07 20 7c) wclrall 1 ++.*: (7c 4a 5f 4c|4c 5f 4a 7c) wclrone r10,r11 ++.*: (7d 40 01 06|06 01 40 7d) wrtee r10 ++.*: (7c 00 81 46|46 81 00 7c) wrteei 1 ++.*: (7d 6a 62 79|79 62 6a 7d) xor\. r10,r11,r12 ++.*: (7d 6a 62 78|78 62 6a 7d) xor r10,r11,r12 ++.*: (69 6a 10 00|00 10 6a 69) xori r10,r11,4096 ++.*: (6d 6a 10 00|00 10 6a 6d) xoris r10,r11,4096 + #pass +diff -rup binutils-2.35.1/gas/testsuite/gas/ppc/a2.s fred/binutils-2.35.1/gas/testsuite/gas/ppc/a2.s +--- binutils-2.35.1/gas/testsuite/gas/ppc/a2.s 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/ppc/a2.s 2020-11-25 14:37:47.000000000 +0000 +@@ -295,10 +295,6 @@ start: + lhzu 10,2(11) + lhzux 10,11,12 + lhzx 10,11,12 +- lmw 20,16(10) +- lswi 10,11,1 +- lswi 12,11,32 +- lswx 10,11,12 + lwa 10,-4(11) + lwa 10,4(11) + lwarx 10,11,12,0 +@@ -486,10 +482,6 @@ start: + sthu 10,2(11) + sthux 10,11,12 + sthx 10,11,12 +- stmw 20,16(10) +- stswi 10,11,1 +- stswi 10,11,32 +- stswx 10,11,12 + stwbrx 10,11,12 + stwcx. 10,11,12 + stwepx 10,11,12 +diff -rup binutils-2.35.1/gas/testsuite/gas/ppc/int128.d fred/binutils-2.35.1/gas/testsuite/gas/ppc/int128.d +--- binutils-2.35.1/gas/testsuite/gas/ppc/int128.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/ppc/int128.d 2020-11-25 14:37:47.000000000 +0000 +@@ -20,7 +20,7 @@ Disassembly of section \.text: + .*: (13 9d f7 0b|0b f7 9d 13) vmodsq v28,v29,v30 + .*: (13 e0 0e 0b|0b 0e e0 13) vmoduq v31,v0,v1 + .*: (10 5b 1e 02|02 1e 5b 10) vextsd2q v2,v3 +-.*: (10 04 29 01|01 29 04 10) vcmpuq v4,v5 ++.*: (10 04 29 01|01 29 04 10) vcmpuq cr0,v4,v5 + .*: (10 86 39 41|41 39 86 10) vcmpsq cr1,v6,v7 + .*: (11 09 51 c7|c7 51 09 11) vcmpequq v8,v9,v10 + .*: (11 6c 6d c7|c7 6d 6c 11) vcmpequq. v11,v12,v13 +diff -rup binutils-2.35.1/gas/testsuite/gas/ppc/int128.s fred/binutils-2.35.1/gas/testsuite/gas/ppc/int128.s +--- binutils-2.35.1/gas/testsuite/gas/ppc/int128.s 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/ppc/int128.s 2020-11-25 14:37:47.000000000 +0000 +@@ -12,7 +12,7 @@ _start: + vmodsq 28,29,30 + vmoduq 31,0,1 + vextsd2q 2,3 +- vcmpuq 4,5 ++ vcmpuq 0,4,5 + vcmpsq 1,6,7 + vcmpequq 8,9,10 + vcmpequq. 11,12,13 +diff -rup binutils-2.35.1/gas/testsuite/gas/ppc/power8.d fred/binutils-2.35.1/gas/testsuite/gas/ppc/power8.d +--- binutils-2.35.1/gas/testsuite/gas/ppc/power8.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/ppc/power8.d 2020-11-25 14:37:47.000000000 +0000 +@@ -7,151 +7,151 @@ + Disassembly of section \.text: + + 0+00 : +- 0: (7c 05 07 1d|1d 07 05 7c) tabort\. r5 +- 4: (7c e8 86 1d|1d 86 e8 7c) tabortwc\. 7,r8,r16 +- 8: (7e 8b 56 5d|5d 56 8b 7e) tabortdc\. 20,r11,r10 +- c: (7e 2a 9e 9d|9d 9e 2a 7e) tabortwci\. 17,r10,-13 +- 10: (7f a3 de dd|dd de a3 7f) tabortdci\. 29,r3,-5 +- 14: (7c 00 05 1d|1d 05 00 7c) tbegin\. +- 18: (7f 80 05 9c|9c 05 80 7f) tcheck cr7 +- 1c: (7c 00 05 5d|5d 05 00 7c) tend\. +- 20: (7c 00 05 5d|5d 05 00 7c) tend\. +- 24: (7e 00 05 5d|5d 05 00 7e) tendall\. +- 28: (7e 00 05 5d|5d 05 00 7e) tendall\. +- 2c: (7c 18 07 5d|5d 07 18 7c) treclaim\. r24 +- 30: (7c 00 07 dd|dd 07 00 7c) trechkpt\. +- 34: (7c 00 05 dd|dd 05 00 7c) tsuspend\. +- 38: (7c 00 05 dd|dd 05 00 7c) tsuspend\. +- 3c: (7c 20 05 dd|dd 05 20 7c) tresume\. +- 40: (7c 20 05 dd|dd 05 20 7c) tresume\. +- 44: (60 42 00 00|00 00 42 60) ori r2,r2,0 +- 48: (60 00 00 00|00 00 00 60) nop +- 4c: (60 42 00 00|00 00 42 60) ori r2,r2,0 +- 50: (4c 00 01 24|24 01 00 4c) rfebb 0 +- 54: (4c 00 09 24|24 09 00 4c) rfebb +- 58: (4c 00 09 24|24 09 00 4c) rfebb +- 5c: (4d d5 04 60|60 04 d5 4d) bgttar- cr5 +- 60: (4c c7 04 61|61 04 c7 4c) bnstarl- cr1 +- 64: (4d ec 04 60|60 04 ec 4d) blttar\+ cr3 +- 68: (4c e2 04 61|61 04 e2 4c) bnetarl\+ +- 6c: (4c 88 0c 60|60 0c 88 4c) bctar 4,4\*cr2\+lt,1 +- 70: (4c 87 14 61|61 14 87 4c) bctarl 4,4\*cr1\+so,2 +- 74: (7c 00 00 3c|3c 00 00 7c) waitasec +- 78: (7c 00 41 1c|1c 41 00 7c) msgsndp r8 +- 7c: (7c 20 01 26|26 01 20 7c) mtsle 1 +- 80: (7c 00 d9 5c|5c d9 00 7c) msgclrp r27 +- 84: (7d 4a 61 6d|6d 61 4a 7d) stqcx\. r10,r10,r12 +- 88: (7f 80 39 6d|6d 39 80 7f) stqcx\. r28,0,r7 +- 8c: (7f 13 5a 28|28 5a 13 7f) lqarx r24,r19,r11 +- 90: (7e c0 5a 28|28 5a c0 7e) lqarx r22,0,r11 +- 94: (7e 80 32 5c|5c 32 80 7e) mfbhrbe r20,6 +- 98: (7f b1 83 29|29 83 b1 7f) pbt\. r29,r17,r16 +- 9c: (7d c0 3b 29|29 3b c0 7d) pbt\. r14,0,r7 +- a0: (7c 00 03 5c|5c 03 00 7c) clrbhrb +- a4: (11 6a 05 ed|ed 05 6a 11) vpermxor v11,v10,v0,v23 +- a8: (13 02 39 3c|3c 39 02 13) vaddeuqm v24,v2,v7,v4 +- ac: (11 4a 40 bd|bd 40 4a 11) vaddecuq v10,v10,v8,v2 +- b0: (10 af 44 fe|fe 44 af 10) vsubeuqm v5,v15,v8,v19 +- b4: (11 9f 87 7f|7f 87 9f 11) vsubecuq v12,v31,v16,v29 +- b8: (12 9d 68 88|88 68 9d 12) vmulouw v20,v29,v13 +- bc: (13 a0 d0 89|89 d0 a0 13) vmuluwm v29,v0,v26 +- c0: (11 15 e0 c0|c0 e0 15 11) vaddudm v8,v21,v28 +- c4: (10 3a 08 c2|c2 08 3a 10) vmaxud v1,v26,v1 +- c8: (12 83 08 c4|c4 08 83 12) vrld v20,v3,v1 +- cc: (10 93 58 c7|c7 58 93 10) vcmpequd v4,v19,v11 +- d0: (12 ee f1 00|00 f1 ee 12) vadduqm v23,v14,v30 +- d4: (11 08 69 40|40 69 08 11) vaddcuq v8,v8,v13 +- d8: (13 9b 21 88|88 21 9b 13) vmulosw v28,v27,v4 +- dc: (10 64 21 c2|c2 21 64 10) vmaxsd v3,v4,v4 +- e0: (10 13 aa 88|88 aa 13 10) vmuleuw v0,v19,v21 +- e4: (13 14 9a c2|c2 9a 14 13) vminud v24,v20,v19 +- e8: (10 1c 7a c7|c7 7a 1c 10) vcmpgtud v0,v28,v15 +- ec: (12 a0 13 88|88 13 a0 12) vmulesw v21,v0,v2 +- f0: (11 3a 4b c2|c2 4b 3a 11) vminsd v9,v26,v9 +- f4: (13 3d 5b c4|c4 5b 3d 13) vsrad v25,v29,v11 +- f8: (11 7c 5b c7|c7 5b 7c 11) vcmpgtsd v11,v28,v11 +- fc: (10 a8 d6 01|01 d6 a8 10) bcdadd\. v5,v8,v26,1 +- 100: (10 83 64 08|08 64 83 10) vpmsumb v4,v3,v12 +- 104: (13 5f ae 41|41 ae 5f 13) bcdsub\. v26,v31,v21,1 +- 108: (10 b1 84 48|48 84 b1 10) vpmsumh v5,v17,v16 +- 10c: (12 f1 a4 4e|4e a4 f1 12) vpkudum v23,v17,v20 +- 110: (13 15 ec 88|88 ec 15 13) vpmsumw v24,v21,v29 +- 114: (11 36 6c c8|c8 6c 36 11) vpmsumd v9,v22,v13 +- 118: (12 53 94 ce|ce 94 53 12) vpkudus v18,v19,v18 +- 11c: (13 d0 b5 00|00 b5 d0 13) vsubuqm v30,v16,v22 +- 120: (11 cb 3d 08|08 3d cb 11) vcipher v14,v11,v7 +- 124: (11 42 b5 09|09 b5 42 11) vcipherlast v10,v2,v22 +- 128: (12 e0 6d 0c|0c 6d e0 12) vgbbd v23,v13 +- 12c: (12 19 85 40|40 85 19 12) vsubcuq v16,v25,v16 +- 130: (13 e1 2d 44|44 2d e1 13) vorc v31,v1,v5 +- 134: (10 91 fd 48|48 fd 91 10) vncipher v4,v17,v31 +- 138: (13 02 dd 49|49 dd 02 13) vncipherlast v24,v2,v27 +- 13c: (12 f5 bd 4c|4c bd f5 12) vbpermq v23,v21,v23 +- 140: (13 72 4d 4e|4e 4d 72 13) vpksdus v27,v18,v9 +- 144: (13 7d dd 84|84 dd 7d 13) vnand v27,v29,v27 +- 148: (12 73 c5 c4|c4 c5 73 12) vsld v19,v19,v24 +- 14c: (10 ad 05 c8|c8 05 ad 10) vsbox v5,v13 +- 150: (13 23 3d ce|ce 3d 23 13) vpksdss v25,v3,v7 +- 154: (13 88 04 c7|c7 04 88 13) vcmpequd\. v28,v8,v0 +- 158: (13 40 d6 4e|4e d6 40 13) vupkhsw v26,v26 +- 15c: (10 a7 36 82|82 36 a7 10) vshasigmaw v5,v7,0,6 +- 160: (13 95 76 84|84 76 95 13) veqv v28,v21,v14 +- 164: (10 28 9e 8c|8c 9e 28 10) vmrgow v1,v8,v19 +- 168: (10 0a 56 c2|c2 56 0a 10) vshasigmad v0,v10,0,10 +- 16c: (10 bb 76 c4|c4 76 bb 10) vsrd v5,v27,v14 +- 170: (11 60 6e ce|ce 6e 60 11) vupklsw v11,v13 +- 174: (11 c0 87 02|02 87 c0 11) vclzb v14,v16 +- 178: (12 80 df 03|03 df 80 12) vpopcntb v20,v27 +- 17c: (13 80 5f 42|42 5f 80 13) vclzh v28,v11 +- 180: (13 00 4f 43|43 4f 00 13) vpopcnth v24,v9 +- 184: (13 60 ff 82|82 ff 60 13) vclzw v27,v31 +- 188: (12 20 9f 83|83 9f 20 12) vpopcntw v17,v19 +- 18c: (11 80 ef c2|c2 ef 80 11) vclzd v12,v29 +- 190: (12 e0 b7 c3|c3 b7 e0 12) vpopcntd v23,v22 +- 194: (13 14 ee c7|c7 ee 14 13) vcmpgtud\. v24,v20,v29 +- 198: (11 26 df c7|c7 df 26 11) vcmpgtsd\. v9,v6,v27 +- 19c: (7f ce d0 19|19 d0 ce 7f) lxsiwzx vs62,r14,r26 +- 1a0: (7d 00 c8 19|19 c8 00 7d) lxsiwzx vs40,0,r25 +- 1a4: (7f 20 d0 98|98 d0 20 7f) lxsiwax vs25,0,r26 +- 1a8: (7c 60 18 98|98 18 60 7c) lxsiwax vs3,0,r3 +- 1ac: (7f cc 00 67|67 00 cc 7f) mfvsrd r12,vs62 +- 1b0: (7d 94 00 e6|e6 00 94 7d) mffprwz r20,f12 +- 1b4: (7d c9 71 18|18 71 c9 7d) stxsiwx vs14,r9,r14 +- 1b8: (7e a0 41 18|18 41 a0 7e) stxsiwx vs21,0,r8 +- 1bc: (7e 0b 01 67|67 01 0b 7e) mtvsrd vs48,r11 +- 1c0: (7f f7 01 a7|a7 01 f7 7f) mtvrwa v31,r23 +- 1c4: (7e 1a 01 e6|e6 01 1a 7e) mtfprwz f16,r26 +- 1c8: (7d b3 6c 18|18 6c b3 7d) lxsspx vs13,r19,r13 +- 1cc: (7e 40 6c 18|18 6c 40 7e) lxsspx vs18,0,r13 +- 1d0: (7d 62 25 19|19 25 62 7d) stxsspx vs43,r2,r4 +- 1d4: (7e e0 5d 19|19 5d e0 7e) stxsspx vs55,0,r11 +- 1d8: (f2 d0 c8 05|05 c8 d0 f2) xsaddsp vs54,vs48,vs25 +- 1dc: (f1 d2 08 0c|0c 08 d2 f1) xsmaddasp vs14,vs50,vs1 +- 1e0: (f3 56 50 42|42 50 56 f3) xssubsp vs26,vs22,vs42 +- 1e4: (f3 75 a0 4e|4e a0 75 f3) xsmaddmsp vs27,vs53,vs52 +- 1e8: (f1 00 d8 2a|2a d8 00 f1) xsrsqrtesp vs8,vs59 +- 1ec: (f1 80 48 2e|2e 48 80 f1) xssqrtsp vs12,vs41 +- 1f0: (f3 2b 00 83|83 00 2b f3) xsmulsp vs57,vs11,vs32 +- 1f4: (f0 d4 d0 89|89 d0 d4 f0) xsmsubasp vs38,vs20,vs26 +- 1f8: (f3 53 30 c0|c0 30 53 f3) xsdivsp vs26,vs19,vs6 +- 1fc: (f0 65 b8 cf|cf b8 65 f0) xsmsubmsp vs35,vs37,vs55 +- 200: (f3 60 40 69|69 40 60 f3) xsresp vs59,vs8 +- 204: (f1 81 0c 0f|0f 0c 81 f1) xsnmaddasp vs44,vs33,vs33 +- 208: (f2 3e f4 4c|4c f4 3e f2) xsnmaddmsp vs17,vs62,vs30 +- 20c: (f2 d4 fc 8d|8d fc d4 f2) xsnmsubasp vs54,vs52,vs31 +- 210: (f0 a5 d4 cb|cb d4 a5 f0) xsnmsubmsp vs37,vs5,vs58 +- 214: (f3 d6 65 56|56 65 d6 f3) xxlorc vs30,vs54,vs44 +- 218: (f2 2e ed 91|91 ed 2e f2) xxlnand vs49,vs14,vs29 +- 21c: (f3 d6 f5 d1|d1 f5 d6 f3) xxleqv vs62,vs22,vs30 +- 220: (f3 80 b4 2f|2f b4 80 f3) xscvdpspn vs60,vs54 +- 224: (f2 c0 6c 66|66 6c c0 f2) xsrsp vs22,vs45 +- 228: (f3 40 dc a2|a2 dc 40 f3) xscvuxdsp vs26,vs59 +- 22c: (f0 c0 8c e3|e3 8c c0 f0) xscvsxdsp vs38,vs49 +- 230: (f3 60 d5 2d|2d d5 60 f3) xscvspdpn vs59,vs26 +- 234: (ff 0e 16 8c|8c 16 0e ff) fmrgow f24,f14,f2 +- 238: (fe c7 2f 8c|8c 2f c7 fe) fmrgew f22,f7,f5 +- 23c: (7c 00 71 9c|9c 71 00 7c) msgsnd r14 +- 240: (7c 00 b9 dc|dc b9 00 7c) msgclr r23 ++.*: (7c 05 07 1d|1d 07 05 7c) tabort\. r5 ++.*: (7c e8 86 1d|1d 86 e8 7c) tabortwc\. 7,r8,r16 ++.*: (7e 8b 56 5d|5d 56 8b 7e) tabortdc\. 20,r11,r10 ++.*: (7e 2a 9e 9d|9d 9e 2a 7e) tabortwci\. 17,r10,-13 ++.*: (7f a3 de dd|dd de a3 7f) tabortdci\. 29,r3,-5 ++.*: (7c 00 05 1d|1d 05 00 7c) tbegin\. ++.*: (7f 80 05 9c|9c 05 80 7f) tcheck cr7 ++.*: (7c 00 05 5d|5d 05 00 7c) tend\. ++.*: (7c 00 05 5d|5d 05 00 7c) tend\. ++.*: (7e 00 05 5d|5d 05 00 7e) tendall\. ++.*: (7e 00 05 5d|5d 05 00 7e) tendall\. ++.*: (7c 18 07 5d|5d 07 18 7c) treclaim\. r24 ++.*: (7c 00 07 dd|dd 07 00 7c) trechkpt\. ++.*: (7c 00 05 dd|dd 05 00 7c) tsuspend\. ++.*: (7c 00 05 dd|dd 05 00 7c) tsuspend\. ++.*: (7c 20 05 dd|dd 05 20 7c) tresume\. ++.*: (7c 20 05 dd|dd 05 20 7c) tresume\. ++.*: (60 42 00 00|00 00 42 60) ori r2,r2,0 ++.*: (60 00 00 00|00 00 00 60) nop ++.*: (60 42 00 00|00 00 42 60) ori r2,r2,0 ++.*: (4c 00 01 24|24 01 00 4c) rfebb 0 ++.*: (4c 00 09 24|24 09 00 4c) rfebb ++.*: (4c 00 09 24|24 09 00 4c) rfebb ++.*: (4d d5 04 60|60 04 d5 4d) bgttar- cr5 ++.*: (4c c7 04 61|61 04 c7 4c) bnstarl- cr1 ++.*: (4d ec 04 60|60 04 ec 4d) blttar\+ cr3 ++.*: (4c e2 04 61|61 04 e2 4c) bnetarl\+ ++.*: (4c 88 0c 60|60 0c 88 4c) bctar 4,4\*cr2\+lt,1 ++.*: (4c 87 14 61|61 14 87 4c) bctarl 4,4\*cr1\+so,2 ++.*: (7c 00 00 3c|3c 00 00 7c) waitasec ++.*: (7c 00 41 1c|1c 41 00 7c) msgsndp r8 ++.*: (7c 20 01 26|26 01 20 7c) mtsle 1 ++.*: (7c 00 d9 5c|5c d9 00 7c) msgclrp r27 ++.*: (7d 4a 61 6d|6d 61 4a 7d) stqcx\. r10,r10,r12 ++.*: (7f 80 39 6d|6d 39 80 7f) stqcx\. r28,0,r7 ++.*: (7f 13 5a 28|28 5a 13 7f) lqarx r24,r19,r11 ++.*: (7e c0 5a 28|28 5a c0 7e) lqarx r22,0,r11 ++.*: (7e 80 32 5c|5c 32 80 7e) mfbhrbe r20,6 ++.*: (7f b1 83 29|29 83 b1 7f) pbt\. r29,r17,r16 ++.*: (7d c0 3b 29|29 3b c0 7d) pbt\. r14,0,r7 ++.*: (7c 00 03 5c|5c 03 00 7c) clrbhrb ++.*: (11 6a 05 ed|ed 05 6a 11) vpermxor v11,v10,v0,v23 ++.*: (13 02 39 3c|3c 39 02 13) vaddeuqm v24,v2,v7,v4 ++.*: (11 4a 40 bd|bd 40 4a 11) vaddecuq v10,v10,v8,v2 ++.*: (10 af 44 fe|fe 44 af 10) vsubeuqm v5,v15,v8,v19 ++.*: (11 9f 87 7f|7f 87 9f 11) vsubecuq v12,v31,v16,v29 ++.*: (12 9d 68 88|88 68 9d 12) vmulouw v20,v29,v13 ++.*: (13 a0 d0 89|89 d0 a0 13) vmuluwm v29,v0,v26 ++.*: (11 15 e0 c0|c0 e0 15 11) vaddudm v8,v21,v28 ++.*: (10 3a 08 c2|c2 08 3a 10) vmaxud v1,v26,v1 ++.*: (12 83 08 c4|c4 08 83 12) vrld v20,v3,v1 ++.*: (10 93 58 c7|c7 58 93 10) vcmpequd v4,v19,v11 ++.*: (12 ee f1 00|00 f1 ee 12) vadduqm v23,v14,v30 ++.*: (11 08 69 40|40 69 08 11) vaddcuq v8,v8,v13 ++.*: (13 9b 21 88|88 21 9b 13) vmulosw v28,v27,v4 ++.*: (10 64 21 c2|c2 21 64 10) vmaxsd v3,v4,v4 ++.*: (10 13 aa 88|88 aa 13 10) vmuleuw v0,v19,v21 ++.*: (13 14 9a c2|c2 9a 14 13) vminud v24,v20,v19 ++.*: (10 1c 7a c7|c7 7a 1c 10) vcmpgtud v0,v28,v15 ++.*: (12 a0 13 88|88 13 a0 12) vmulesw v21,v0,v2 ++.*: (11 3a 4b c2|c2 4b 3a 11) vminsd v9,v26,v9 ++.*: (13 3d 5b c4|c4 5b 3d 13) vsrad v25,v29,v11 ++.*: (11 7c 5b c7|c7 5b 7c 11) vcmpgtsd v11,v28,v11 ++.*: (10 a8 d6 01|01 d6 a8 10) bcdadd\. v5,v8,v26,1 ++.*: (10 83 64 08|08 64 83 10) vpmsumb v4,v3,v12 ++.*: (13 5f ae 41|41 ae 5f 13) bcdsub\. v26,v31,v21,1 ++.*: (10 b1 84 48|48 84 b1 10) vpmsumh v5,v17,v16 ++.*: (12 f1 a4 4e|4e a4 f1 12) vpkudum v23,v17,v20 ++.*: (13 15 ec 88|88 ec 15 13) vpmsumw v24,v21,v29 ++.*: (11 36 6c c8|c8 6c 36 11) vpmsumd v9,v22,v13 ++.*: (12 53 94 ce|ce 94 53 12) vpkudus v18,v19,v18 ++.*: (13 d0 b5 00|00 b5 d0 13) vsubuqm v30,v16,v22 ++.*: (11 cb 3d 08|08 3d cb 11) vcipher v14,v11,v7 ++.*: (11 42 b5 09|09 b5 42 11) vcipherlast v10,v2,v22 ++.*: (12 e0 6d 0c|0c 6d e0 12) vgbbd v23,v13 ++.*: (12 19 85 40|40 85 19 12) vsubcuq v16,v25,v16 ++.*: (13 e1 2d 44|44 2d e1 13) vorc v31,v1,v5 ++.*: (10 91 fd 48|48 fd 91 10) vncipher v4,v17,v31 ++.*: (13 02 dd 49|49 dd 02 13) vncipherlast v24,v2,v27 ++.*: (12 f5 bd 4c|4c bd f5 12) vbpermq v23,v21,v23 ++.*: (13 72 4d 4e|4e 4d 72 13) vpksdus v27,v18,v9 ++.*: (13 7d dd 84|84 dd 7d 13) vnand v27,v29,v27 ++.*: (12 73 c5 c4|c4 c5 73 12) vsld v19,v19,v24 ++.*: (10 ad 05 c8|c8 05 ad 10) vsbox v5,v13 ++.*: (13 23 3d ce|ce 3d 23 13) vpksdss v25,v3,v7 ++.*: (13 88 04 c7|c7 04 88 13) vcmpequd\. v28,v8,v0 ++.*: (13 40 d6 4e|4e d6 40 13) vupkhsw v26,v26 ++.*: (10 a7 36 82|82 36 a7 10) vshasigmaw v5,v7,0,6 ++.*: (13 95 76 84|84 76 95 13) veqv v28,v21,v14 ++.*: (10 28 9e 8c|8c 9e 28 10) vmrgow v1,v8,v19 ++.*: (10 0a 56 c2|c2 56 0a 10) vshasigmad v0,v10,0,10 ++.*: (10 bb 76 c4|c4 76 bb 10) vsrd v5,v27,v14 ++.*: (11 60 6e ce|ce 6e 60 11) vupklsw v11,v13 ++.*: (11 c0 87 02|02 87 c0 11) vclzb v14,v16 ++.*: (12 80 df 03|03 df 80 12) vpopcntb v20,v27 ++.*: (13 80 5f 42|42 5f 80 13) vclzh v28,v11 ++.*: (13 00 4f 43|43 4f 00 13) vpopcnth v24,v9 ++.*: (13 60 ff 82|82 ff 60 13) vclzw v27,v31 ++.*: (12 20 9f 83|83 9f 20 12) vpopcntw v17,v19 ++.*: (11 80 ef c2|c2 ef 80 11) vclzd v12,v29 ++.*: (12 e0 b7 c3|c3 b7 e0 12) vpopcntd v23,v22 ++.*: (13 14 ee c7|c7 ee 14 13) vcmpgtud\. v24,v20,v29 ++.*: (11 26 df c7|c7 df 26 11) vcmpgtsd\. v9,v6,v27 ++.*: (7f ce d0 19|19 d0 ce 7f) lxsiwzx vs62,r14,r26 ++.*: (7d 00 c8 19|19 c8 00 7d) lxsiwzx vs40,0,r25 ++.*: (7f 20 d0 98|98 d0 20 7f) lxsiwax vs25,0,r26 ++.*: (7c 60 18 98|98 18 60 7c) lxsiwax vs3,0,r3 ++.*: (7f cc 00 67|67 00 cc 7f) (mfvrd r12,v30|mfvsrd r12,vs62) ++.*: (7d 94 00 e6|e6 00 94 7d) (mffprwz r20,f12|mfvsrwz r20,vs12) ++.*: (7d c9 71 18|18 71 c9 7d) stxsiwx vs14,r9,r14 ++.*: (7e a0 41 18|18 41 a0 7e) stxsiwx vs21,0,r8 ++.*: (7e 0b 01 67|67 01 0b 7e) (mtvrd v16,r11|mtvsrd vs48,r11) ++.*: (7f f7 01 a7|a7 01 f7 7f) (mtvrwa v31,r23|mtvsrwa vs63,r23) ++.*: (7e 1a 01 e6|e6 01 1a 7e) (mtfprwz f16,r26|mtvsrwz vs16,r26) ++.*: (7d b3 6c 18|18 6c b3 7d) lxsspx vs13,r19,r13 ++.*: (7e 40 6c 18|18 6c 40 7e) lxsspx vs18,0,r13 ++.*: (7d 62 25 19|19 25 62 7d) stxsspx vs43,r2,r4 ++.*: (7e e0 5d 19|19 5d e0 7e) stxsspx vs55,0,r11 ++.*: (f2 d0 c8 05|05 c8 d0 f2) xsaddsp vs54,vs48,vs25 ++.*: (f1 d2 08 0c|0c 08 d2 f1) xsmaddasp vs14,vs50,vs1 ++.*: (f3 56 50 42|42 50 56 f3) xssubsp vs26,vs22,vs42 ++.*: (f3 75 a0 4e|4e a0 75 f3) xsmaddmsp vs27,vs53,vs52 ++.*: (f1 00 d8 2a|2a d8 00 f1) xsrsqrtesp vs8,vs59 ++.*: (f1 80 48 2e|2e 48 80 f1) xssqrtsp vs12,vs41 ++.*: (f3 2b 00 83|83 00 2b f3) xsmulsp vs57,vs11,vs32 ++.*: (f0 d4 d0 89|89 d0 d4 f0) xsmsubasp vs38,vs20,vs26 ++.*: (f3 53 30 c0|c0 30 53 f3) xsdivsp vs26,vs19,vs6 ++.*: (f0 65 b8 cf|cf b8 65 f0) xsmsubmsp vs35,vs37,vs55 ++.*: (f3 60 40 69|69 40 60 f3) xsresp vs59,vs8 ++.*: (f1 81 0c 0f|0f 0c 81 f1) xsnmaddasp vs44,vs33,vs33 ++.*: (f2 3e f4 4c|4c f4 3e f2) xsnmaddmsp vs17,vs62,vs30 ++.*: (f2 d4 fc 8d|8d fc d4 f2) xsnmsubasp vs54,vs52,vs31 ++.*: (f0 a5 d4 cb|cb d4 a5 f0) xsnmsubmsp vs37,vs5,vs58 ++.*: (f3 d6 65 56|56 65 d6 f3) xxlorc vs30,vs54,vs44 ++.*: (f2 2e ed 91|91 ed 2e f2) xxlnand vs49,vs14,vs29 ++.*: (f3 d6 f5 d1|d1 f5 d6 f3) xxleqv vs62,vs22,vs30 ++.*: (f3 80 b4 2f|2f b4 80 f3) xscvdpspn vs60,vs54 ++.*: (f2 c0 6c 66|66 6c c0 f2) xsrsp vs22,vs45 ++.*: (f3 40 dc a2|a2 dc 40 f3) xscvuxdsp vs26,vs59 ++.*: (f0 c0 8c e3|e3 8c c0 f0) xscvsxdsp vs38,vs49 ++.*: (f3 60 d5 2d|2d d5 60 f3) xscvspdpn vs59,vs26 ++.*: (ff 0e 16 8c|8c 16 0e ff) fmrgow f24,f14,f2 ++.*: (fe c7 2f 8c|8c 2f c7 fe) fmrgew f22,f7,f5 ++.*: (7c 00 71 9c|9c 71 00 7c) msgsnd r14 ++.*: (7c 00 b9 dc|dc b9 00 7c) msgclr r23 + .*: (7d 00 2e 99|99 2e 00 7d) lxvd2x vs40,0,r5 + .*: (7d 00 2e 99|99 2e 00 7d) lxvd2x vs40,0,r5 + .*: (7d 54 36 98|98 36 54 7d) lxvd2x vs10,r20,r6 +@@ -310,4 +310,6 @@ Disassembly of section \.text: + .*: (4d 89 04 61|61 04 89 4d) bgttarl cr2 + .*: (4d 89 04 61|61 04 89 4d) bgttarl cr2 + .*: (4d 89 1c 61|61 1c 89 4d) bctarl 12,4\*cr2\+gt,3 ++.*: (7f 5a d3 78|78 d3 5a 7f) miso ++.*: (7f 5a d3 78|78 d3 5a 7f) miso + #pass +diff -rup binutils-2.35.1/gas/testsuite/gas/ppc/power8.s fred/binutils-2.35.1/gas/testsuite/gas/ppc/power8.s +--- binutils-2.35.1/gas/testsuite/gas/ppc/power8.s 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/ppc/power8.s 2020-11-25 14:37:47.000000000 +0000 +@@ -302,3 +302,5 @@ power8: + bctarl 0b01100,4*cr2+gt + bctarl 0b01100,4*cr2+gt,0 + bctarl 0b01100,4*cr2+gt,3 ++ or 26,26,26 ++ miso +diff -rup binutils-2.35.1/gas/testsuite/gas/ppc/power9.d fred/binutils-2.35.1/gas/testsuite/gas/ppc/power9.d +--- binutils-2.35.1/gas/testsuite/gas/ppc/power9.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/ppc/power9.d 2020-11-25 14:37:47.000000000 +0000 +@@ -399,4 +399,8 @@ Disassembly of section \.text: + .*: (7c 20 20 ac|ac 20 20 7c) dcbfl 0,r4 + .*: (7c 60 28 ac|ac 28 60 7c) dcbflp 0,r5 + .*: (7c 60 28 ac|ac 28 60 7c) dcbflp 0,r5 ++.*: (63 ff 00 00|00 00 ff 63) exser ++.*: (63 ff 00 00|00 00 ff 63) exser ++.*: (7c 00 18 9c|9c 18 00 7c) msgsndu r3 ++.*: (7c 00 d8 dc|dc d8 00 7c) msgclru r27 + #pass +diff -rup binutils-2.35.1/gas/testsuite/gas/ppc/power9.s fred/binutils-2.35.1/gas/testsuite/gas/ppc/power9.s +--- binutils-2.35.1/gas/testsuite/gas/ppc/power9.s 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/ppc/power9.s 2020-11-25 14:37:47.000000000 +0000 +@@ -390,3 +390,7 @@ power9: + dcbf 0,4,1 + dcbflp 0,5 + dcbf 0,5,3 ++ ori 31,31,0 ++ exser ++ msgsndu 3 ++ msgclru 27 +diff -rup binutils-2.35.1/gas/testsuite/gas/ppc/ppc.exp fred/binutils-2.35.1/gas/testsuite/gas/ppc/ppc.exp +--- binutils-2.35.1/gas/testsuite/gas/ppc/ppc.exp 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/ppc/ppc.exp 2020-11-25 14:37:47.000000000 +0000 +@@ -76,6 +76,8 @@ if { [istarget powerpc64*-*-*] || [istar + run_dump_test "common" + run_dump_test "476" + run_dump_test "a2" ++run_dump_test "be" ++run_dump_test "le_error" + run_dump_test "pr21303" + run_dump_test "vle" + run_dump_test "vle-reloc" +diff -rup binutils-2.35.1/gas/testsuite/gas/ppc/vsx2.d fred/binutils-2.35.1/gas/testsuite/gas/ppc/vsx2.d +--- binutils-2.35.1/gas/testsuite/gas/ppc/vsx2.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/ppc/vsx2.d 2020-11-25 14:37:47.000000000 +0000 +@@ -7,59 +7,59 @@ + Disassembly of section \.text: + + 0+00 : +- 0: (7f ce d0 19|19 d0 ce 7f) lxsiwzx vs62,r14,r26 +- 4: (7d 00 c8 19|19 c8 00 7d) lxsiwzx vs40,0,r25 +- 8: (7f 20 d0 98|98 d0 20 7f) lxsiwax vs25,0,r26 +- c: (7c 60 18 98|98 18 60 7c) lxsiwax vs3,0,r3 +- 10: (7f cc 00 66|66 00 cc 7f) mfvsrd r12,vs30 +- 14: (7f cc 00 66|66 00 cc 7f) mfvsrd r12,vs30 +- 18: (7f cc 00 67|67 00 cc 7f) mfvsrd r12,vs62 +- 1c: (7f cc 00 67|67 00 cc 7f) mfvsrd r12,vs62 +- 20: (7d 94 00 e6|e6 00 94 7d) mffprwz r20,f12 +- 24: (7d 94 00 e6|e6 00 94 7d) mffprwz r20,f12 +- 28: (7d 95 00 e7|e7 00 95 7d) mfvrwz r21,v12 +- 2c: (7d 95 00 e7|e7 00 95 7d) mfvrwz r21,v12 +- 30: (7d c9 71 18|18 71 c9 7d) stxsiwx vs14,r9,r14 +- 34: (7e a0 41 18|18 41 a0 7e) stxsiwx vs21,0,r8 +- 38: (7d 7c 01 66|66 01 7c 7d) mtvsrd vs11,r28 +- 3c: (7d 7c 01 66|66 01 7c 7d) mtvsrd vs11,r28 +- 40: (7d 7d 01 67|67 01 7d 7d) mtvsrd vs43,r29 +- 44: (7d 7d 01 67|67 01 7d 7d) mtvsrd vs43,r29 +- 48: (7f 16 01 a6|a6 01 16 7f) mtfprwa f24,r22 +- 4c: (7f 16 01 a6|a6 01 16 7f) mtfprwa f24,r22 +- 50: (7f 37 01 a7|a7 01 37 7f) mtvrwa v25,r23 +- 54: (7f 37 01 a7|a7 01 37 7f) mtvrwa v25,r23 +- 58: (7f 5b 01 e6|e6 01 5b 7f) mtfprwz f26,r27 +- 5c: (7f 5b 01 e6|e6 01 5b 7f) mtfprwz f26,r27 +- 60: (7f 7c 01 e7|e7 01 7c 7f) mtvrwz v27,r28 +- 64: (7f 7c 01 e7|e7 01 7c 7f) mtvrwz v27,r28 +- 68: (7d b3 6c 18|18 6c b3 7d) lxsspx vs13,r19,r13 +- 6c: (7e 40 6c 18|18 6c 40 7e) lxsspx vs18,0,r13 +- 70: (7d 62 25 19|19 25 62 7d) stxsspx vs43,r2,r4 +- 74: (7e e0 5d 19|19 5d e0 7e) stxsspx vs55,0,r11 +- 78: (f2 d0 c8 05|05 c8 d0 f2) xsaddsp vs54,vs48,vs25 +- 7c: (f1 d2 08 0c|0c 08 d2 f1) xsmaddasp vs14,vs50,vs1 +- 80: (f3 56 50 42|42 50 56 f3) xssubsp vs26,vs22,vs42 +- 84: (f3 75 a0 4e|4e a0 75 f3) xsmaddmsp vs27,vs53,vs52 +- 88: (f1 00 d8 2a|2a d8 00 f1) xsrsqrtesp vs8,vs59 +- 8c: (f1 80 48 2e|2e 48 80 f1) xssqrtsp vs12,vs41 +- 90: (f3 2b 00 83|83 00 2b f3) xsmulsp vs57,vs11,vs32 +- 94: (f0 d4 d0 89|89 d0 d4 f0) xsmsubasp vs38,vs20,vs26 +- 98: (f3 53 30 c0|c0 30 53 f3) xsdivsp vs26,vs19,vs6 +- 9c: (f0 65 b8 cf|cf b8 65 f0) xsmsubmsp vs35,vs37,vs55 +- a0: (f3 60 40 69|69 40 60 f3) xsresp vs59,vs8 +- a4: (f1 81 0c 0f|0f 0c 81 f1) xsnmaddasp vs44,vs33,vs33 +- a8: (f2 3e f4 4c|4c f4 3e f2) xsnmaddmsp vs17,vs62,vs30 +- ac: (f2 d4 fc 8d|8d fc d4 f2) xsnmsubasp vs54,vs52,vs31 +- b0: (f0 a5 d4 cb|cb d4 a5 f0) xsnmsubmsp vs37,vs5,vs58 +- b4: (f3 d6 65 56|56 65 d6 f3) xxlorc vs30,vs54,vs44 +- b8: (f2 2e ed 91|91 ed 2e f2) xxlnand vs49,vs14,vs29 +- bc: (f3 d6 f5 d1|d1 f5 d6 f3) xxleqv vs62,vs22,vs30 +- c0: (f3 80 b4 2f|2f b4 80 f3) xscvdpspn vs60,vs54 +- c4: (f2 c0 6c 66|66 6c c0 f2) xsrsp vs22,vs45 +- c8: (f3 40 dc a2|a2 dc 40 f3) xscvuxdsp vs26,vs59 +- cc: (f0 c0 8c e3|e3 8c c0 f0) xscvsxdsp vs38,vs49 +- d0: (f3 60 d5 2d|2d d5 60 f3) xscvspdpn vs59,vs26 +- d4: (ff 0e 16 8c|8c 16 0e ff) fmrgow f24,f14,f2 +- d8: (fe c7 2f 8c|8c 2f c7 fe) fmrgew f22,f7,f5 ++.*: (7f ce d0 19|19 d0 ce 7f) lxsiwzx vs62,r14,r26 ++.*: (7d 00 c8 19|19 c8 00 7d) lxsiwzx vs40,0,r25 ++.*: (7f 20 d0 98|98 d0 20 7f) lxsiwax vs25,0,r26 ++.*: (7c 60 18 98|98 18 60 7c) lxsiwax vs3,0,r3 ++.*: (7f cc 00 66|66 00 cc 7f) (mffprd r12,f30|mfvsrd r12,vs30) ++.*: (7f cc 00 66|66 00 cc 7f) (mffprd r12,f30|mfvsrd r12,vs30) ++.*: (7f cc 00 67|67 00 cc 7f) (mfvrd r12,v30|mfvsrd r12,vs62) ++.*: (7f cc 00 67|67 00 cc 7f) (mfvrd r12,v30|mfvsrd r12,vs62) ++.*: (7d 94 00 e6|e6 00 94 7d) (mffprwz r20,f12|mfvsrwz r20,vs12) ++.*: (7d 94 00 e6|e6 00 94 7d) (mffprwz r20,f12|mfvsrwz r20,vs12) ++.*: (7d 95 00 e7|e7 00 95 7d) (mfvrwz r21,v12|mfvsrwz r21,vs44) ++.*: (7d 95 00 e7|e7 00 95 7d) (mfvrwz r21,v12|mfvsrwz r21,vs44) ++.*: (7d c9 71 18|18 71 c9 7d) stxsiwx vs14,r9,r14 ++.*: (7e a0 41 18|18 41 a0 7e) stxsiwx vs21,0,r8 ++.*: (7d 7c 01 66|66 01 7c 7d) (mtfprd f11,r28|mtvsrd vs11,r28) ++.*: (7d 7c 01 66|66 01 7c 7d) (mtfprd f11,r28|mtvsrd vs11,r28) ++.*: (7d 7d 01 67|67 01 7d 7d) (mtvrd v11,r29|mtvsrd vs43,r29) ++.*: (7d 7d 01 67|67 01 7d 7d) (mtvrd v11,r29|mtvsrd vs43,r29) ++.*: (7f 16 01 a6|a6 01 16 7f) (mtfprwa f24,r22|mtvsrwa vs24,r22) ++.*: (7f 16 01 a6|a6 01 16 7f) (mtfprwa f24,r22|mtvsrwa vs24,r22) ++.*: (7f 37 01 a7|a7 01 37 7f) (mtvrwa v25,r23|mtvsrwa vs57,r23) ++.*: (7f 37 01 a7|a7 01 37 7f) (mtvrwa v25,r23|mtvsrwa vs57,r23) ++.*: (7f 5b 01 e6|e6 01 5b 7f) (mtfprwz f26,r27|mtvsrwz vs26,r27) ++.*: (7f 5b 01 e6|e6 01 5b 7f) (mtfprwz f26,r27|mtvsrwz vs26,r27) ++.*: (7f 7c 01 e7|e7 01 7c 7f) (mtvrwz v27,r28|mtvsrwz vs59,r28) ++.*: (7f 7c 01 e7|e7 01 7c 7f) (mtvrwz v27,r28|mtvsrwz vs59,r28) ++.*: (7d b3 6c 18|18 6c b3 7d) lxsspx vs13,r19,r13 ++.*: (7e 40 6c 18|18 6c 40 7e) lxsspx vs18,0,r13 ++.*: (7d 62 25 19|19 25 62 7d) stxsspx vs43,r2,r4 ++.*: (7e e0 5d 19|19 5d e0 7e) stxsspx vs55,0,r11 ++.*: (f2 d0 c8 05|05 c8 d0 f2) xsaddsp vs54,vs48,vs25 ++.*: (f1 d2 08 0c|0c 08 d2 f1) xsmaddasp vs14,vs50,vs1 ++.*: (f3 56 50 42|42 50 56 f3) xssubsp vs26,vs22,vs42 ++.*: (f3 75 a0 4e|4e a0 75 f3) xsmaddmsp vs27,vs53,vs52 ++.*: (f1 00 d8 2a|2a d8 00 f1) xsrsqrtesp vs8,vs59 ++.*: (f1 80 48 2e|2e 48 80 f1) xssqrtsp vs12,vs41 ++.*: (f3 2b 00 83|83 00 2b f3) xsmulsp vs57,vs11,vs32 ++.*: (f0 d4 d0 89|89 d0 d4 f0) xsmsubasp vs38,vs20,vs26 ++.*: (f3 53 30 c0|c0 30 53 f3) xsdivsp vs26,vs19,vs6 ++.*: (f0 65 b8 cf|cf b8 65 f0) xsmsubmsp vs35,vs37,vs55 ++.*: (f3 60 40 69|69 40 60 f3) xsresp vs59,vs8 ++.*: (f1 81 0c 0f|0f 0c 81 f1) xsnmaddasp vs44,vs33,vs33 ++.*: (f2 3e f4 4c|4c f4 3e f2) xsnmaddmsp vs17,vs62,vs30 ++.*: (f2 d4 fc 8d|8d fc d4 f2) xsnmsubasp vs54,vs52,vs31 ++.*: (f0 a5 d4 cb|cb d4 a5 f0) xsnmsubmsp vs37,vs5,vs58 ++.*: (f3 d6 65 56|56 65 d6 f3) xxlorc vs30,vs54,vs44 ++.*: (f2 2e ed 91|91 ed 2e f2) xxlnand vs49,vs14,vs29 ++.*: (f3 d6 f5 d1|d1 f5 d6 f3) xxleqv vs62,vs22,vs30 ++.*: (f3 80 b4 2f|2f b4 80 f3) xscvdpspn vs60,vs54 ++.*: (f2 c0 6c 66|66 6c c0 f2) xsrsp vs22,vs45 ++.*: (f3 40 dc a2|a2 dc 40 f3) xscvuxdsp vs26,vs59 ++.*: (f0 c0 8c e3|e3 8c c0 f0) xscvsxdsp vs38,vs49 ++.*: (f3 60 d5 2d|2d d5 60 f3) xscvspdpn vs59,vs26 ++.*: (ff 0e 16 8c|8c 16 0e ff) fmrgow f24,f14,f2 ++.*: (fe c7 2f 8c|8c 2f c7 fe) fmrgew f22,f7,f5 + #pass +diff -rup binutils-2.35.1/gas/testsuite/gas/ppc/xvtlsbb.d fred/binutils-2.35.1/gas/testsuite/gas/ppc/xvtlsbb.d +--- binutils-2.35.1/gas/testsuite/gas/ppc/xvtlsbb.d 2020-07-24 10:12:19.000000000 +0100 ++++ fred/binutils-2.35.1/gas/testsuite/gas/ppc/xvtlsbb.d 2020-11-25 14:37:47.000000000 +0000 +@@ -7,7 +7,7 @@ + Disassembly of section \.text: + + 0+0 <_start>: +-.*: (f0 02 ff 6e|6e ff 02 f0) xvtlsbb vs63 ++.*: (f0 02 ff 6e|6e ff 02 f0) xvtlsbb cr0,vs63 + .*: (f0 82 07 6c|6c 07 82 f0) xvtlsbb cr1,vs0 + .*: (f1 02 f7 6e|6e f7 02 f1) xvtlsbb cr2,vs62 + .*: (f1 82 0f 6c|6c 0f 82 f1) xvtlsbb cr3,vs1 +diff -rup binutils-2.35.1/gold/options.cc fred/binutils-2.35.1/gold/options.cc +--- binutils-2.35.1/gold/options.cc 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/gold/options.cc 2020-11-25 14:37:54.000000000 +0000 +@@ -465,6 +465,14 @@ General_options::parse_plugin_opt(const + } + + void ++General_options::parse_no_power10_stubs(const char*, const char*, ++ Command_line*) ++{ ++ this->set_power10_stubs("no"); ++ this->set_user_set_power10_stubs(); ++} ++ ++void + General_options::parse_R(const char* option, const char* arg, + Command_line* cmdline) + { +@@ -1183,6 +1191,27 @@ General_options::finalize() + this->set_start_stop_visibility_enum(elfcpp::STV_PROTECTED); + } + ++ // Parse the --power10-stubs argument. ++ if (!this->user_set_power10_stubs()) ++ { ++ // --power10-stubs without an arg is equivalent to --power10-stubs=yes ++ // but not specifying --power10-stubs at all should be equivalent to ++ // --power10-stubs=auto. This doesn't fit into the notion of ++ // "default_value", used both as a static initializer and to provide ++ // a missing optional arg. Fix it here. ++ this->set_power10_stubs("auto"); ++ this->set_power10_stubs_enum(POWER10_STUBS_AUTO); ++ } ++ else ++ { ++ if (strcmp(this->power10_stubs(), "auto") == 0) ++ this->set_power10_stubs_enum(POWER10_STUBS_AUTO); ++ else if (strcmp(this->power10_stubs(), "no") == 0) ++ this->set_power10_stubs_enum(POWER10_STUBS_NO); ++ else if (strcmp(this->power10_stubs(), "yes") == 0) ++ this->set_power10_stubs_enum(POWER10_STUBS_YES); ++ } ++ + // -M is equivalent to "-Map -". + if (this->print_map() && !this->user_set_Map()) + { +diff -rup binutils-2.35.1/gold/options.h fred/binutils-2.35.1/gold/options.h +--- binutils-2.35.1/gold/options.h 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/gold/options.h 2020-11-25 14:37:54.000000000 +0000 +@@ -481,9 +481,9 @@ struct Struct_special : public Struct_va + // After helparg__ should come an initializer list, like + // {"foo", "bar", "baz"} + #define DEFINE_enum(varname__, dashes__, shortname__, default_value__, \ +- helpstring__, helparg__, ...) \ ++ helpstring__, helparg__, optional_arg__, ...) \ + DEFINE_var(varname__, dashes__, shortname__, default_value__, \ +- default_value__, helpstring__, helparg__, false, \ ++ default_value__, helpstring__, helparg__, optional_arg__, \ + const char*, const char*, parse_choices_##varname__, false) \ + private: \ + static void parse_choices_##varname__(const char* option_name, \ +@@ -703,7 +703,7 @@ class General_options + N_("Use DT_NEEDED for all shared libraries")); + + DEFINE_enum(assert, options::ONE_DASH, '\0', NULL, +- N_("Ignored"), N_("[ignored]"), ++ N_("Ignored"), N_("[ignored]"), false, + {"definitions", "nodefinitions", "nosymbolic", "pure-text"}); + + // b +@@ -761,7 +761,7 @@ class General_options + + DEFINE_enum(compress_debug_sections, options::TWO_DASHES, '\0', "none", + N_("Compress .debug_* sections in the output file"), +- ("[none,zlib,zlib-gnu,zlib-gabi]"), ++ ("[none,zlib,zlib-gnu,zlib-gabi]"), false, + {"none", "zlib", "zlib-gnu", "zlib-gabi"}); + + DEFINE_bool(copy_dt_needed_entries, options::TWO_DASHES, '\0', false, +@@ -934,7 +934,7 @@ class General_options + N_("FRACTION")); + + DEFINE_enum(hash_style, options::TWO_DASHES, '\0', DEFAULT_HASH_STYLE, +- N_("Dynamic hash style"), N_("[sysv,gnu,both]"), ++ N_("Dynamic hash style"), N_("[sysv,gnu,both]"), false, + {"sysv", "gnu", "both"}); + + // i +@@ -946,7 +946,7 @@ class General_options + N_("Identical Code Folding. " + "\'--icf=safe\' Folds ctors, dtors and functions whose" + " pointers are definitely not taken"), +- ("[none,all,safe]"), ++ ("[none,all,safe]"), false, + {"none", "all", "safe"}); + + DEFINE_uint(icf_iterations, options::TWO_DASHES , '\0', 0, +@@ -1086,7 +1086,7 @@ class General_options + + DEFINE_enum(orphan_handling, options::TWO_DASHES, '\0', "place", + N_("Orphan section handling"), N_("[place,discard,warn,error]"), +- {"place", "discard", "warn", "error"}); ++ false, {"place", "discard", "warn", "error"}); + + // p + +@@ -1141,6 +1141,12 @@ class General_options + N_("Use posix_fallocate to reserve space in the output file"), + N_("Use fallocate or ftruncate to reserve space")); + ++ DEFINE_enum(power10_stubs, options::TWO_DASHES, '\0', "yes", ++ N_("(PowerPC64 only) stubs use power10 insns"), ++ N_("[=auto,no,yes]"), true, {"auto", "no", "yes"}); ++ DEFINE_special(no_power10_stubs, options::TWO_DASHES, '\0', ++ N_("(PowerPC64 only) stubs do not use power10 insns"), NULL); ++ + DEFINE_bool(preread_archive_symbols, options::TWO_DASHES, '\0', false, + N_("Preread archive symbols when multi-threaded"), NULL); + +@@ -1236,7 +1242,7 @@ class General_options + DEFINE_enum(sort_section, options::TWO_DASHES, '\0', "none", + N_("Sort sections by name. \'--no-text-reorder\'" + " will override \'--sort-section=name\' for .text"), +- N_("[none,name]"), ++ N_("[none,name]"), false, + {"none", "name"}); + + DEFINE_uint(spare_dynamic_tags, options::TWO_DASHES, '\0', 5, +@@ -1254,7 +1260,7 @@ class General_options + "output sections"), + N_("(PowerPC only) Each output section has its own stubs")); + +- DEFINE_uint(split_stack_adjust_size, options::TWO_DASHES, '\0', 0x4000, ++ DEFINE_uint(split_stack_adjust_size, options::TWO_DASHES, '\0', 0x100000, + N_("Stack size when -fsplit-stack function calls non-split"), + N_("SIZE")); + +@@ -1287,7 +1293,7 @@ class General_options + NULL); + DEFINE_enum(target2, options::TWO_DASHES, '\0', NULL, + N_("(ARM only) Set R_ARM_TARGET2 relocation type"), +- N_("[rel, abs, got-rel"), ++ N_("[rel, abs, got-rel"), false, + {"rel", "abs", "got-rel"}); + + DEFINE_bool(text_reorder, options::TWO_DASHES, '\0', true, +@@ -1344,7 +1350,7 @@ class General_options + DEFINE_enum(unresolved_symbols, options::TWO_DASHES, '\0', NULL, + N_("How to handle unresolved symbols"), + ("ignore-all,report-all,ignore-in-object-files," +- "ignore-in-shared-libs"), ++ "ignore-in-shared-libs"), false, + {"ignore-all", "report-all", "ignore-in-object-files", + "ignore-in-shared-libs"}); + +@@ -1507,7 +1513,7 @@ class General_options + DEFINE_enum(start_stop_visibility, options::DASH_Z, '\0', "protected", + N_("ELF symbol visibility for synthesized " + "__start_* and __stop_* symbols"), +- ("[default,internal,hidden,protected]"), ++ ("[default,internal,hidden,protected]"), false, + {"default", "internal", "hidden", "protected"}); + DEFINE_bool(text, options::DASH_Z, '\0', false, + N_("Do not permit relocations in read-only segments"), +@@ -1763,6 +1769,20 @@ class General_options + start_stop_visibility_enum() const + { return this->start_stop_visibility_enum_; } + ++ enum Power10_stubs ++ { ++ // Use Power10 insns on @notoc calls/branches, non-Power10 elsewhere. ++ POWER10_STUBS_AUTO, ++ // Don't use Power10 insns ++ POWER10_STUBS_NO, ++ // Always use Power10 insns ++ POWER10_STUBS_YES ++ }; ++ ++ Power10_stubs ++ power10_stubs_enum() const ++ { return this->power10_stubs_enum_; } ++ + private: + // Don't copy this structure. + General_options(const General_options&); +@@ -1826,6 +1846,10 @@ class General_options + set_start_stop_visibility_enum(elfcpp::STV value) + { this->start_stop_visibility_enum_ = value; } + ++ void ++ set_power10_stubs_enum(Power10_stubs value) ++ { this->power10_stubs_enum_ = value; } ++ + // These are called by finalize() to set up the search-path correctly. + void + add_to_library_path_with_sysroot(const std::string& arg) +@@ -1895,6 +1919,8 @@ class General_options + Orphan_handling orphan_handling_enum_; + // Symbol visibility for __start_* / __stop_* magic symbols. + elfcpp::STV start_stop_visibility_enum_; ++ // Power10 stubs option ++ Power10_stubs power10_stubs_enum_; + }; + + // The position-dependent options. We use this to store the state of +diff -rup binutils-2.35.1/gold/powerpc.cc fred/binutils-2.35.1/gold/powerpc.cc +--- binutils-2.35.1/gold/powerpc.cc 2020-09-11 09:19:10.000000000 +0100 ++++ fred/binutils-2.35.1/gold/powerpc.cc 2020-11-25 14:37:54.000000000 +0000 +@@ -647,10 +647,9 @@ class Target_powerpc : public Sized_targ + glink_(NULL), rela_dyn_(NULL), copy_relocs_(), + tlsld_got_offset_(-1U), + stub_tables_(), branch_lookup_table_(), branch_info_(), tocsave_loc_(), +- power10_stubs_(false), plt_thread_safe_(false), plt_localentry0_(false), ++ power10_relocs_(false), plt_thread_safe_(false), plt_localentry0_(false), + plt_localentry0_init_(false), has_localentry0_(false), +- has_tls_get_addr_opt_(false), +- tprel_opt_(parameters->options().tls_optimize()), ++ has_tls_get_addr_opt_(false), no_tprel_opt_(false), + relax_failed_(false), relax_fail_count_(0), + stub_group_size_(0), savres_section_(0), + tls_get_addr_(NULL), tls_get_addr_opt_(NULL), +@@ -1079,14 +1078,25 @@ class Target_powerpc : public Sized_targ + sym->set_dynsym_index(-1U); + } + ++ void ++ set_power10_relocs() ++ { ++ this->power10_relocs_ = true; ++ } ++ + bool + power10_stubs() const +- { return this->power10_stubs_; } ++ { ++ return (this->power10_relocs_ ++ && (parameters->options().power10_stubs_enum() ++ != General_options::POWER10_STUBS_NO)); ++ } + +- void +- set_power10_stubs() ++ bool ++ power10_stubs_auto() const + { +- this->power10_stubs_ = true; ++ return (parameters->options().power10_stubs_enum() ++ == General_options::POWER10_STUBS_AUTO); + } + + bool +@@ -1097,6 +1107,10 @@ class Target_powerpc : public Sized_targ + plt_localentry0() const + { return this->plt_localentry0_; } + ++ bool ++ has_localentry0() const ++ { return this->has_localentry0_; } ++ + void + set_has_localentry0() + { +@@ -1139,11 +1153,11 @@ class Target_powerpc : public Sized_targ + + bool + tprel_opt() const +- { return this->tprel_opt_; } ++ { return !this->no_tprel_opt_ && parameters->options().tls_optimize(); } + + void +- set_tprel_opt(bool val) +- { this->tprel_opt_ = val; } ++ set_no_tprel_opt() ++ { this->no_tprel_opt_ = true; } + + // Remember any symbols seen with non-zero localentry, even those + // not providing a definition +@@ -1696,13 +1710,13 @@ class Target_powerpc : public Sized_targ + Branches branch_info_; + Tocsave_loc tocsave_loc_; + +- bool power10_stubs_; ++ bool power10_relocs_; + bool plt_thread_safe_; + bool plt_localentry0_; + bool plt_localentry0_init_; + bool has_localentry0_; + bool has_tls_get_addr_opt_; +- bool tprel_opt_; ++ bool no_tprel_opt_; + + bool relax_failed_; + int relax_fail_count_; +@@ -1869,6 +1883,19 @@ is_plt16_reloc(unsigned int r_type) + || (size == 64 && r_type == elfcpp::R_PPC64_PLT16_LO_DS)); + } + ++// GOT_TYPE_STANDARD (ie. not TLS) GOT relocs ++inline bool ++is_got_reloc(unsigned int r_type) ++{ ++ return (r_type == elfcpp::R_POWERPC_GOT16 ++ || r_type == elfcpp::R_POWERPC_GOT16_LO ++ || r_type == elfcpp::R_POWERPC_GOT16_HI ++ || r_type == elfcpp::R_POWERPC_GOT16_HA ++ || r_type == elfcpp::R_PPC64_GOT16_DS ++ || r_type == elfcpp::R_PPC64_GOT16_LO_DS ++ || r_type == elfcpp::R_PPC64_GOT_PCREL34); ++} ++ + // If INSN is an opcode that may be used with an @tls operand, return + // the transformed insn for TLS optimisation, otherwise return 0. If + // REG is non-zero only match an insn with RB or RA equal to REG. +@@ -2739,8 +2766,6 @@ Powerpc_relobj::do_rel + if (this->local_has_plt_offset(i)) + { + Address value = this->local_symbol_value(i, 0); +- if (size == 64) +- value += ppc64_local_entry_offset(i); + size_t off = this->local_plt_offset(i); + elfcpp::Swap::writeval(oview + off, value); + modified = true; +@@ -3511,6 +3536,7 @@ Target_powerpc::Branch + from += (this->object_->output_section(this->shndx_)->address() + + this->offset_); + Address to; ++ unsigned int other; + if (gsym != NULL) + { + switch (gsym->source()) +@@ -3538,8 +3564,7 @@ Target_powerpc::Branch + to = symtab->compute_final_value(gsym, &status); + if (status != Symbol_table::CFVS_OK) + return true; +- if (size == 64) +- to += this->object_->ppc64_local_entry_offset(gsym); ++ other = gsym->nonvis() >> 3; + } + else + { +@@ -3556,8 +3581,7 @@ Target_powerpc::Branch + || !symval.has_output_value()) + return true; + to = symval.value(this->object_, 0); +- if (size == 64) +- to += this->object_->ppc64_local_entry_offset(this->r_sym_); ++ other = this->object_->st_other(this->r_sym_) >> 5; + } + if (!(size == 32 && this->r_type_ == elfcpp::R_PPC_PLTREL24)) + to += this->addend_; +@@ -3570,7 +3594,11 @@ Target_powerpc::Branch + &to, &dest_shndx)) + return true; + } +- Address delta = to - from; ++ unsigned int local_ent = 0; ++ if (size == 64 ++ && this->r_type_ != elfcpp::R_PPC64_REL24_NOTOC) ++ local_ent = elfcpp::ppc64_decode_local_entry(other); ++ Address delta = to + local_ent - from; + if (delta + max_branch_offset >= 2 * max_branch_offset + || (size == 64 + && this->r_type_ == elfcpp::R_PPC64_REL24_NOTOC +@@ -3592,7 +3620,7 @@ Target_powerpc::Branch + && gsym->output_data() == target->savres_section()); + ok = stub_table->add_long_branch_entry(this->object_, + this->r_type_, +- from, to, save_res); ++ from, to, other, save_res); + } + } + if (!ok) +@@ -4181,6 +4209,7 @@ static const uint32_t cmpwi_11_0 = 0x2c0 + static const uint32_t cror_15_15_15 = 0x4def7b82; + static const uint32_t cror_31_31_31 = 0x4ffffb82; + static const uint32_t ld_0_1 = 0xe8010000; ++static const uint32_t ld_0_11 = 0xe80b0000; + static const uint32_t ld_0_12 = 0xe80c0000; + static const uint32_t ld_2_1 = 0xe8410000; + static const uint32_t ld_2_2 = 0xe8420000; +@@ -4563,9 +4592,9 @@ static const unsigned char glink_eh_fram + 0, 0, 0, 0, // Replaced with offset to .glink. + 0, 0, 0, 0, // Replaced with size of .glink. + 0, // Augmentation size. +- elfcpp::DW_CFA_advance_loc + 1, ++ elfcpp::DW_CFA_advance_loc + 2, + elfcpp::DW_CFA_register, 65, 12, +- elfcpp::DW_CFA_advance_loc + 5, ++ elfcpp::DW_CFA_advance_loc + 4, + elfcpp::DW_CFA_restore_extended, 65 + }; + +@@ -4575,9 +4604,20 @@ static const unsigned char glink_eh_fram + 0, 0, 0, 0, // Replaced with offset to .glink. + 0, 0, 0, 0, // Replaced with size of .glink. + 0, // Augmentation size. +- elfcpp::DW_CFA_advance_loc + 1, ++ elfcpp::DW_CFA_advance_loc + 2, ++ elfcpp::DW_CFA_register, 65, 0, ++ elfcpp::DW_CFA_advance_loc + 2, ++ elfcpp::DW_CFA_restore_extended, 65 ++}; ++ ++static const unsigned char glink_eh_frame_fde_64v2_localentry0[] = ++{ ++ 0, 0, 0, 0, // Replaced with offset to .glink. ++ 0, 0, 0, 0, // Replaced with size of .glink. ++ 0, // Augmentation size. ++ elfcpp::DW_CFA_advance_loc + 3, + elfcpp::DW_CFA_register, 65, 0, +- elfcpp::DW_CFA_advance_loc + 7, ++ elfcpp::DW_CFA_advance_loc + 2, + elfcpp::DW_CFA_restore_extended, 65 + }; + +@@ -4631,26 +4671,33 @@ class Stub_table : public Output_relaxed + struct Plt_stub_ent + { + Plt_stub_ent(unsigned int off, unsigned int indx) +- : off_(off), indx_(indx), iter_(0), notoc_(0), r2save_(0), localentry0_(0) ++ : off_(off), indx_(indx), iter_(0), notoc_(0), toc_(0), ++ r2save_(0), localentry0_(0), tocoff_(0) + { } + + unsigned int off_; +- unsigned int indx_ : 28; ++ unsigned int indx_; + unsigned int iter_ : 1; + unsigned int notoc_ : 1; ++ unsigned int toc_ : 1; + unsigned int r2save_ : 1; + unsigned int localentry0_ : 1; ++ unsigned int tocoff_ : 8; + }; + struct Branch_stub_ent + { + Branch_stub_ent(unsigned int off, bool notoc, bool save_res) +- : off_(off), iter_(false), notoc_(notoc), save_res_(save_res) ++ : off_(off), iter_(0), notoc_(notoc), toc_(0), save_res_(save_res), ++ other_(0), tocoff_(0) + { } + + unsigned int off_; +- bool iter_; +- bool notoc_; +- bool save_res_; ++ unsigned int iter_ : 1; ++ unsigned int notoc_ : 1; ++ unsigned int toc_ : 1; ++ unsigned int save_res_ : 1; ++ unsigned int other_ : 3; ++ unsigned int tocoff_ : 8; + }; + typedef typename elfcpp::Elf_types::Elf_Addr Address; + static const Address invalid_address = static_cast
(0) - 1; +@@ -4716,7 +4763,7 @@ class Stub_table : public Output_relaxed + // Add a long branch stub. + bool + add_long_branch_entry(const Powerpc_relobj*, +- unsigned int, Address, Address, bool); ++ unsigned int, Address, Address, unsigned int, bool); + + const Branch_stub_ent* + find_long_branch_entry(const Powerpc_relobj*, +@@ -4898,7 +4945,7 @@ class Stub_table : public Output_relaxed + + // Size of a given plt call stub. + unsigned int +- plt_call_size(typename Plt_stub_entries::const_iterator p) const; ++ plt_call_size(typename Plt_stub_entries::iterator p) const; + + unsigned int + plt_call_align(unsigned int bytes) const +@@ -4909,16 +4956,14 @@ class Stub_table : public Output_relaxed + + // Return long branch stub size. + unsigned int +- branch_stub_size(typename Branch_stub_entries::const_iterator p, ++ branch_stub_size(typename Branch_stub_entries::iterator p, + bool* need_lt); + +- bool +- build_tls_opt_head(unsigned char** pp, +- typename Plt_stub_entries::const_iterator cs); ++ void ++ build_tls_opt_head(unsigned char** pp, bool save_lr); + +- bool +- build_tls_opt_tail(unsigned char* p, +- typename Plt_stub_entries::const_iterator cs); ++ void ++ build_tls_opt_tail(unsigned char* p); + + void + plt_error(const Plt_stub_key& p); +@@ -5083,15 +5128,22 @@ Stub_table::add_plt_ca + if (r_type == elfcpp::R_PPC64_REL24_NOTOC) + { + if (!p.second && !p.first->second.notoc_ +- && !this->targ_->power10_stubs()) ++ && (!this->targ_->power10_stubs() ++ || this->targ_->power10_stubs_auto())) + this->need_resize_ = true; + p.first->second.notoc_ = 1; + } +- else if (!tocsave && !p.first->second.localentry0_) ++ else + { +- if (!p.second && !p.first->second.r2save_) ++ if (!p.second && !p.first->second.toc_) + this->need_resize_ = true; +- p.first->second.r2save_ = 1; ++ p.first->second.toc_ = 1; ++ if (!tocsave && !p.first->second.localentry0_) ++ { ++ if (!p.second && !p.first->second.r2save_) ++ this->need_resize_ = true; ++ p.first->second.r2save_ = 1; ++ } + } + } + if (p.second || (this->resizing_ && !p.first->second.iter_)) +@@ -5134,15 +5186,22 @@ Stub_table::add_plt_ca + if (r_type == elfcpp::R_PPC64_REL24_NOTOC) + { + if (!p.second && !p.first->second.notoc_ +- && !this->targ_->power10_stubs()) ++ && (!this->targ_->power10_stubs() ++ || this->targ_->power10_stubs_auto())) + this->need_resize_ = true; + p.first->second.notoc_ = 1; + } +- else if (!tocsave && !p.first->second.localentry0_) ++ else + { +- if (!p.second && !p.first->second.r2save_) ++ if (!p.second && !p.first->second.toc_) + this->need_resize_ = true; +- p.first->second.r2save_ = 1; ++ p.first->second.toc_ = 1; ++ if (!tocsave && !p.first->second.localentry0_) ++ { ++ if (!p.second && !p.first->second.r2save_) ++ this->need_resize_ = true; ++ p.first->second.r2save_ = 1; ++ } + } + } + if (p.second || (this->resizing_ && !p.first->second.iter_)) +@@ -5224,6 +5283,7 @@ Stub_table::add_long_b + unsigned int r_type, + Address from, + Address to, ++ unsigned int other, + bool save_res) + { + Branch_stub_key key(object, to); +@@ -5231,11 +5291,20 @@ Stub_table::add_long_b + Branch_stub_ent ent(this->branch_size_, notoc, save_res); + std::pair p + = this->long_branch_stubs_.insert(std::make_pair(key, ent)); +- if (notoc && !p.first->second.notoc_) ++ if (notoc) + { +- this->need_resize_ = true; ++ if (!p.second && !p.first->second.notoc_) ++ this->need_resize_ = true; + p.first->second.notoc_ = true; + } ++ else ++ { ++ if (!p.second && !p.first->second.toc_) ++ this->need_resize_ = true; ++ p.first->second.toc_ = true; ++ } ++ if (p.first->second.other_ == 0) ++ p.first->second.other_ = other; + gold_assert(save_res == p.first->second.save_res_); + if (p.second || (this->resizing_ && !p.first->second.iter_)) + { +@@ -5330,7 +5399,7 @@ Stub_table::add_eh_fra + if (!this->targ_->has_glink()) + return; + +- typedef typename Plt_stub_entries::const_iterator plt_iter; ++ typedef typename Plt_stub_entries::iterator plt_iter; + std::vector calls; + if (!this->plt_call_stubs_.empty()) + for (plt_iter cs = this->plt_call_stubs_.begin(); +@@ -5491,7 +5560,8 @@ class Output_data_glink : public Output_ + { + if (size == 64) + return (8 +- + (this->targ_->abiversion() < 2 ? 11 * 4 : 14 * 4)); ++ + (this->targ_->abiversion() < 2 ? 11 * 4 ++ : this->targ_->has_localentry0() ? 14 * 4 : 13 * 4)); + return 16 * 4; + } + +@@ -5534,6 +5604,12 @@ Output_data_glink::add + sizeof (Eh_cie<64>::eh_frame_cie), + glink_eh_frame_fde_64v1, + sizeof (glink_eh_frame_fde_64v1)); ++ else if (this->targ_->has_localentry0()) ++ layout->add_eh_frame_for_plt(this, ++ Eh_cie<64>::eh_frame_cie, ++ sizeof (Eh_cie<64>::eh_frame_cie), ++ glink_eh_frame_fde_64v2_localentry0, ++ sizeof (glink_eh_frame_fde_64v2)); + else + layout->add_eh_frame_for_plt(this, + Eh_cie<64>::eh_frame_cie, +@@ -5632,7 +5708,7 @@ Stub_table::define_stu + // output .symtab ordering depends on the order in which symbols + // are added to the linker symtab. We want reproducible output + // so must sort the call stub symbols. +- typedef typename Plt_stub_entries::const_iterator plt_iter; ++ typedef typename Plt_stub_entries::iterator plt_iter; + std::vector sorted; + sorted.resize(this->plt_call_stubs_.size()); + +@@ -5676,7 +5752,7 @@ Stub_table::define_stu + } + } + +- typedef typename Branch_stub_entries::const_iterator branch_iter; ++ typedef typename Branch_stub_entries::iterator branch_iter; + for (branch_iter bs = this->long_branch_stubs_.begin(); + bs != this->long_branch_stubs_.end(); + ++bs) +@@ -5698,88 +5774,72 @@ Stub_table::define_stu + // Emit the start of a __tls_get_addr_opt plt call stub. + + template +-bool +-Stub_table::build_tls_opt_head( +- unsigned char** pp, +- typename Plt_stub_entries::const_iterator cs) ++void ++Stub_table::build_tls_opt_head(unsigned char** pp, ++ bool save_lr) + { +- if (this->targ_->is_tls_get_addr_opt(cs->first.sym_)) ++ unsigned char* p = *pp; ++ if (size == 64) + { +- unsigned char* p = *pp; +- if (size == 64) +- { +- write_insn(p, ld_11_3 + 0); +- p += 4; +- write_insn(p, ld_12_3 + 8); +- p += 4; +- write_insn(p, mr_0_3); +- p += 4; +- write_insn(p, cmpdi_11_0); +- p += 4; +- write_insn(p, add_3_12_13); +- p += 4; +- write_insn(p, beqlr); +- p += 4; +- write_insn(p, mr_3_0); +- p += 4; +- if (cs->second.r2save_ && !cs->second.localentry0_) +- { +- write_insn(p, mflr_11); +- p += 4; +- write_insn(p, (std_11_1 + this->targ_->stk_linker())); +- p += 4; +- } +- } +- else ++ write_insn(p, ld_11_3 + 0); ++ p += 4; ++ write_insn(p, ld_12_3 + 8); ++ p += 4; ++ write_insn(p, mr_0_3); ++ p += 4; ++ write_insn(p, cmpdi_11_0); ++ p += 4; ++ write_insn(p, add_3_12_13); ++ p += 4; ++ write_insn(p, beqlr); ++ p += 4; ++ write_insn(p, mr_3_0); ++ p += 4; ++ if (save_lr) + { +- write_insn(p, lwz_11_3 + 0); +- p += 4; +- write_insn(p, lwz_12_3 + 4); +- p += 4; +- write_insn(p, mr_0_3); +- p += 4; +- write_insn(p, cmpwi_11_0); +- p += 4; +- write_insn(p, add_3_12_2); +- p += 4; +- write_insn(p, beqlr); ++ write_insn(p, mflr_11); + p += 4; +- write_insn(p, mr_3_0); +- p += 4; +- write_insn(p, nop); ++ write_insn(p, (std_11_1 + this->targ_->stk_linker())); + p += 4; + } +- *pp = p; +- return true; + } +- return false; +-} +- +-// Emit the tail of a __tls_get_addr_opt plt call stub. +- +-template +-bool +-Stub_table::build_tls_opt_tail( +- unsigned char* p, +- typename Plt_stub_entries::const_iterator cs) +-{ +- if (size == 64 +- && cs->second.r2save_ +- && !cs->second.localentry0_ +- && this->targ_->is_tls_get_addr_opt(cs->first.sym_)) ++ else + { +- write_insn(p, bctrl); ++ write_insn(p, lwz_11_3 + 0); + p += 4; +- write_insn(p, ld_2_1 + this->targ_->stk_toc()); ++ write_insn(p, lwz_12_3 + 4); + p += 4; +- write_insn(p, ld_11_1 + this->targ_->stk_linker()); ++ write_insn(p, mr_0_3); + p += 4; +- write_insn(p, mtlr_11); ++ write_insn(p, cmpwi_11_0); ++ p += 4; ++ write_insn(p, add_3_12_2); ++ p += 4; ++ write_insn(p, beqlr); ++ p += 4; ++ write_insn(p, mr_3_0); ++ p += 4; ++ write_insn(p, nop); + p += 4; +- write_insn(p, blr); +- return true; + } +- return false; ++ *pp = p; ++} ++ ++// Emit the tail of a __tls_get_addr_opt plt call stub. ++ ++template ++void ++Stub_table::build_tls_opt_tail(unsigned char* p) ++{ ++ write_insn(p, bctrl); ++ p += 4; ++ write_insn(p, ld_2_1 + this->targ_->stk_toc()); ++ p += 4; ++ write_insn(p, ld_11_1 + this->targ_->stk_linker()); ++ p += 4; ++ write_insn(p, mtlr_11); ++ p += 4; ++ write_insn(p, blr); + } + + // Emit pc-relative plt call stub code. +@@ -5949,7 +6009,7 @@ build_notoc_offset(unsigned char* p, uin + template + unsigned int + Stub_table::plt_call_size( +- typename Plt_stub_entries::const_iterator p) const ++ typename Plt_stub_entries::iterator p) const + { + if (size == 32) + { +@@ -5961,77 +6021,122 @@ Stub_table::plt_call_s + const Output_data_plt_powerpc* plt; + uint64_t plt_addr = this->plt_off(p, &plt); + plt_addr += plt->address(); +- unsigned int bytes = 0; +- const Symbol* gsym = p->first.sym_; +- if (this->targ_->is_tls_get_addr_opt(gsym)) ++ if (this->targ_->power10_stubs() ++ && this->targ_->power10_stubs_auto()) + { +- if (p->second.r2save_ && !p->second.localentry0_) +- bytes = 13 * 4; +- else +- bytes = 7 * 4; ++ unsigned int bytes = 0; ++ if (p->second.notoc_) ++ { ++ if (this->targ_->is_tls_get_addr_opt(p->first.sym_)) ++ bytes = 7 * 4; ++ uint64_t from = this->stub_address() + p->second.off_ + bytes; ++ uint64_t odd = from & 4; ++ uint64_t off = plt_addr - from; ++ if (off - odd + (1ULL << 33) < 1ULL << 34) ++ bytes += odd + 4 * 4; ++ else if (off - (8 - odd) + (0x20002ULL << 32) < 0x40004ULL << 32) ++ bytes += 7 * 4; ++ else ++ bytes += 8 * 4; ++ bytes = this->plt_call_align(bytes); ++ } ++ unsigned int tail = 0; ++ if (p->second.toc_) ++ { ++ p->second.tocoff_ = bytes; ++ if (this->targ_->is_tls_get_addr_opt(p->first.sym_)) ++ { ++ bytes += 7 * 4; ++ if (p->second.r2save_ && !p->second.localentry0_) ++ { ++ bytes += 2 * 4; ++ tail = 4 * 4; ++ } ++ } ++ if (p->second.r2save_) ++ bytes += 4; ++ uint64_t got_addr ++ = this->targ_->got_section()->output_section()->address(); ++ const Powerpc_relobj* ppcobj = static_cast ++ *>(p->first.object_); ++ got_addr += ppcobj->toc_base_offset(); ++ uint64_t off = plt_addr - got_addr; ++ bytes += 3 * 4 + 4 * (ha(off) != 0); ++ } ++ return bytes + tail; + } +- +- if (p->second.r2save_) +- bytes += 4; +- +- if (this->targ_->power10_stubs()) ++ else + { +- uint64_t from = this->stub_address() + p->second.off_ + bytes; +- if (bytes > 8 * 4) +- from -= 4 * 4; +- uint64_t odd = from & 4; +- uint64_t off = plt_addr - from; +- if (off - odd + (1ULL << 33) < 1ULL << 34) +- bytes += odd + 4 * 4; +- else if (off - (8 - odd) + (0x20002ULL << 32) < 0x40004ULL << 32) +- bytes += 7 * 4; +- else +- bytes += 8 * 4; +- return bytes; +- } ++ unsigned int bytes = 0; ++ unsigned int tail = 0; ++ if (this->targ_->is_tls_get_addr_opt(p->first.sym_)) ++ { ++ bytes = 7 * 4; ++ if (p->second.r2save_ && !p->second.localentry0_) ++ { ++ bytes = 9 * 4; ++ tail = 4 * 4; ++ } ++ } + +- if (p->second.notoc_) +- { +- uint64_t from = this->stub_address() + p->second.off_ + bytes + 2 * 4; +- if (bytes > 32) +- from -= 4 * 4; +- uint64_t off = plt_addr - from; +- if (off + 0x8000 < 0x10000) +- bytes += 7 * 4; +- else if (off + 0x80008000ULL < 0x100000000ULL) +- bytes += 8 * 4; +- else ++ if (p->second.r2save_) ++ bytes += 4; ++ ++ if (this->targ_->power10_stubs()) + { +- bytes += 8 * 4; +- if (off + 0x800000000000ULL >= 0x1000000000000ULL +- && ((off >> 32) & 0xffff) != 0) +- bytes += 4; +- if (((off >> 32) & 0xffffffffULL) != 0) +- bytes += 4; +- if (hi(off) != 0) +- bytes += 4; +- if (l(off) != 0) +- bytes += 4; ++ uint64_t from = this->stub_address() + p->second.off_ + bytes; ++ uint64_t odd = from & 4; ++ uint64_t off = plt_addr - from; ++ if (off - odd + (1ULL << 33) < 1ULL << 34) ++ bytes += odd + 4 * 4; ++ else if (off - (8 - odd) + (0x20002ULL << 32) < 0x40004ULL << 32) ++ bytes += 7 * 4; ++ else ++ bytes += 8 * 4; ++ return bytes + tail; + } +- return bytes; +- } + +- uint64_t got_addr = this->targ_->got_section()->output_section()->address(); +- const Powerpc_relobj* ppcobj = static_cast +- *>(p->first.object_); +- got_addr += ppcobj->toc_base_offset(); +- uint64_t off = plt_addr - got_addr; +- bytes += 3 * 4 + 4 * (ha(off) != 0); +- if (this->targ_->abiversion() < 2) +- { +- bool static_chain = parameters->options().plt_static_chain(); +- bool thread_safe = this->targ_->plt_thread_safe(); +- bytes += (4 +- + 4 * static_chain +- + 8 * thread_safe +- + 4 * (ha(off + 8 + 8 * static_chain) != ha(off))); ++ if (p->second.notoc_) ++ { ++ uint64_t from = this->stub_address() + p->second.off_ + bytes + 2 * 4; ++ uint64_t off = plt_addr - from; ++ if (off + 0x8000 < 0x10000) ++ bytes += 7 * 4; ++ else if (off + 0x80008000ULL < 0x100000000ULL) ++ bytes += 8 * 4; ++ else ++ { ++ bytes += 8 * 4; ++ if (off + 0x800000000000ULL >= 0x1000000000000ULL ++ && ((off >> 32) & 0xffff) != 0) ++ bytes += 4; ++ if (((off >> 32) & 0xffffffffULL) != 0) ++ bytes += 4; ++ if (hi(off) != 0) ++ bytes += 4; ++ if (l(off) != 0) ++ bytes += 4; ++ } ++ return bytes + tail; ++ } ++ ++ uint64_t got_addr = this->targ_->got_section()->output_section()->address(); ++ const Powerpc_relobj* ppcobj = static_cast ++ *>(p->first.object_); ++ got_addr += ppcobj->toc_base_offset(); ++ uint64_t off = plt_addr - got_addr; ++ bytes += 3 * 4 + 4 * (ha(off) != 0); ++ if (this->targ_->abiversion() < 2) ++ { ++ bool static_chain = parameters->options().plt_static_chain(); ++ bool thread_safe = this->targ_->plt_thread_safe(); ++ bytes += (4 ++ + 4 * static_chain ++ + 8 * thread_safe ++ + 4 * (ha(off + 8 + 8 * static_chain) != ha(off))); ++ } ++ return bytes + tail; + } +- return bytes; + } + + // Return long branch stub size. +@@ -6039,7 +6144,7 @@ Stub_table::plt_call_s + template + unsigned int + Stub_table::branch_stub_size( +- typename Branch_stub_entries::const_iterator p, ++ typename Branch_stub_entries::iterator p, + bool* need_lt) + { + Address loc = this->stub_address() + this->last_plt_size_ + p->second.off_; +@@ -6053,46 +6158,57 @@ Stub_table::branch_stu + } + + uint64_t off = p->first.dest_ - loc; ++ unsigned int bytes = 0; + if (p->second.notoc_) + { + if (this->targ_->power10_stubs()) + { + Address odd = loc & 4; + if (off + (1 << 25) < 2 << 25) +- return odd + 12; +- if (off - odd + (1ULL << 33) < 1ULL << 34) +- return odd + 16; +- if (off - (8 - odd) + (0x20002ULL << 32) < 0x40004ULL << 32) +- return 28; +- return 32; +- } +- off -= 8; +- if (off + 0x8000 < 0x10000) +- return 24; +- if (off + 0x80008000ULL < 0x100000000ULL) +- { +- if (off + 24 + (1 << 25) < 2 << 25) +- return 28; +- return 32; +- } +- unsigned int bytes = 32; +- if (off + 0x800000000000ULL >= 0x1000000000000ULL +- && ((off >> 32) & 0xffff) != 0) +- bytes += 4; +- if (((off >> 32) & 0xffffffffULL) != 0) +- bytes += 4; +- if (hi(off) != 0) +- bytes += 4; +- if (l(off) != 0) +- bytes += 4; +- return bytes; ++ bytes = odd + 12; ++ else if (off - odd + (1ULL << 33) < 1ULL << 34) ++ bytes = odd + 16; ++ else if (off - (8 - odd) + (0x20002ULL << 32) < 0x40004ULL << 32) ++ bytes = 28; ++ else ++ bytes = 32; ++ if (!(p->second.toc_ && this->targ_->power10_stubs_auto())) ++ return bytes; ++ p->second.tocoff_ = bytes; ++ } ++ else ++ { ++ off -= 8; ++ if (off + 0x8000 < 0x10000) ++ return 24; ++ if (off + 0x80008000ULL < 0x100000000ULL) ++ { ++ if (off + 24 + (1 << 25) < 2 << 25) ++ return 28; ++ return 32; ++ } ++ ++ bytes = 32; ++ if (off + 0x800000000000ULL >= 0x1000000000000ULL ++ && ((off >> 32) & 0xffff) != 0) ++ bytes += 4; ++ if (((off >> 32) & 0xffffffffULL) != 0) ++ bytes += 4; ++ if (hi(off) != 0) ++ bytes += 4; ++ if (l(off) != 0) ++ bytes += 4; ++ return bytes; ++ } + } + ++ off += elfcpp::ppc64_decode_local_entry(p->second.other_); + if (off + (1 << 25) < 2 << 25) +- return 4; +- if (!this->targ_->power10_stubs()) ++ return bytes + 4; ++ if (!this->targ_->power10_stubs() ++ || (p->second.toc_ && this->targ_->power10_stubs_auto())) + *need_lt = true; +- return 16; ++ return bytes + 16; + } + + template +@@ -6128,6 +6244,10 @@ Stub_table::do_write(O + if (size == 64 + && this->targ_->power10_stubs()) + { ++ const Output_data_got_powerpc* got ++ = this->targ_->got_section(); ++ Address got_os_addr = got->output_section()->address(); ++ + if (!this->plt_call_stubs_.empty()) + { + // Write out plt call stubs. +@@ -6137,22 +6257,94 @@ Stub_table::do_write(O + ++cs) + { + p = oview + cs->second.off_; +- this->build_tls_opt_head(&p, cs); +- if (cs->second.r2save_) +- { +- write_insn(p, std_2_1 + this->targ_->stk_toc()); +- p += 4; +- } + const Output_data_plt_powerpc* plt; + Address pltoff = this->plt_off(cs, &plt); + Address plt_addr = pltoff + plt->address(); +- Address from = this->stub_address() + (p - oview); +- Address delta = plt_addr - from; +- p = build_power10_offset(p, delta, from & 4, true); +- write_insn(p, mtctr_12); +- p += 4; +- if (!this->build_tls_opt_tail(p, cs)) +- write_insn(p, bctr); ++ if (this->targ_->power10_stubs_auto()) ++ { ++ if (cs->second.notoc_) ++ { ++ if (this->targ_->is_tls_get_addr_opt(cs->first.sym_)) ++ this->build_tls_opt_head(&p, false); ++ Address from = this->stub_address() + (p - oview); ++ Address delta = plt_addr - from; ++ p = build_power10_offset(p, delta, from & 4, ++ true); ++ write_insn(p, mtctr_12); ++ p += 4; ++ write_insn(p, bctr); ++ p += 4; ++ p = oview + this->plt_call_align(p - oview); ++ } ++ if (cs->second.toc_) ++ { ++ if (this->targ_->is_tls_get_addr_opt(cs->first.sym_)) ++ { ++ bool save_lr ++ = cs->second.r2save_ && !cs->second.localentry0_; ++ this->build_tls_opt_head(&p, save_lr); ++ } ++ const Powerpc_relobj* ppcobj ++ = static_cast*>( ++ cs->first.object_); ++ Address got_addr = got_os_addr + ppcobj->toc_base_offset(); ++ Address off = plt_addr - got_addr; ++ ++ if (off + 0x80008000 > 0xffffffff || (off & 7) != 0) ++ this->plt_error(cs->first); ++ ++ if (cs->second.r2save_) ++ { ++ write_insn(p, std_2_1 + this->targ_->stk_toc()); ++ p += 4; ++ } ++ if (ha(off) != 0) ++ { ++ write_insn(p, addis_12_2 + ha(off)); ++ p += 4; ++ write_insn(p, ld_12_12 + l(off)); ++ p += 4; ++ } ++ else ++ { ++ write_insn(p, ld_12_2 + l(off)); ++ p += 4; ++ } ++ write_insn(p, mtctr_12); ++ p += 4; ++ if (cs->second.r2save_ ++ && !cs->second.localentry0_ ++ && this->targ_->is_tls_get_addr_opt(cs->first.sym_)) ++ this->build_tls_opt_tail(p); ++ else ++ write_insn(p, bctr); ++ } ++ } ++ else ++ { ++ if (this->targ_->is_tls_get_addr_opt(cs->first.sym_)) ++ { ++ bool save_lr ++ = cs->second.r2save_ && !cs->second.localentry0_; ++ this->build_tls_opt_head(&p, save_lr); ++ } ++ if (cs->second.r2save_) ++ { ++ write_insn(p, std_2_1 + this->targ_->stk_toc()); ++ p += 4; ++ } ++ Address from = this->stub_address() + (p - oview); ++ Address delta = plt_addr - from; ++ p = build_power10_offset(p, delta, from & 4, true); ++ write_insn(p, mtctr_12); ++ p += 4; ++ if (cs->second.r2save_ ++ && !cs->second.localentry0_ ++ && this->targ_->is_tls_get_addr_opt(cs->first.sym_)) ++ this->build_tls_opt_tail(p); ++ else ++ write_insn(p, bctr); ++ } + } + } + +@@ -6168,19 +6360,79 @@ Stub_table::do_write(O + p = oview + off; + Address loc = this->stub_address() + off; + Address delta = bs->first.dest_ - loc; +- if (bs->second.notoc_ || delta + (1 << 25) >= 2 << 25) ++ if (this->targ_->power10_stubs_auto()) + { +- unsigned char* startp = p; +- p = build_power10_offset(p, delta, loc & 4, false); +- delta -= p - startp; ++ if (bs->second.notoc_) ++ { ++ unsigned char* startp = p; ++ p = build_power10_offset(p, delta, ++ loc & 4, false); ++ delta -= p - startp; ++ startp = p; ++ if (delta + (1 << 25) < 2 << 25) ++ write_insn(p, b | (delta & 0x3fffffc)); ++ else ++ { ++ write_insn(p, mtctr_12); ++ p += 4; ++ write_insn(p, bctr); ++ } ++ p += 4; ++ delta -= p - startp; ++ } ++ if (bs->second.toc_) ++ { ++ delta += elfcpp::ppc64_decode_local_entry(bs->second.other_); ++ if (delta + (1 << 25) >= 2 << 25) ++ { ++ Address brlt_addr ++ = this->targ_->find_branch_lookup_table(bs->first.dest_); ++ gold_assert(brlt_addr != invalid_address); ++ brlt_addr += this->targ_->brlt_section()->address(); ++ Address got_addr = got_os_addr + bs->first.toc_base_off_; ++ Address brltoff = brlt_addr - got_addr; ++ if (ha(brltoff) == 0) ++ { ++ write_insn(p, ld_12_2 + l(brltoff)); ++ p += 4; ++ } ++ else ++ { ++ write_insn(p, addis_12_2 + ha(brltoff)); ++ p += 4; ++ write_insn(p, ld_12_12 + l(brltoff)); ++ p += 4; ++ } ++ } ++ if (delta + (1 << 25) < 2 << 25) ++ write_insn(p, b | (delta & 0x3fffffc)); ++ else ++ { ++ write_insn(p, mtctr_12); ++ p += 4; ++ write_insn(p, bctr); ++ } ++ } + } +- if (delta + (1 << 25) < 2 << 25) +- write_insn(p, b | (delta & 0x3fffffc)); + else + { +- write_insn(p, mtctr_12); +- p += 4; +- write_insn(p, bctr); ++ if (!bs->second.notoc_) ++ delta += elfcpp::ppc64_decode_local_entry(bs->second.other_); ++ if (bs->second.notoc_ || delta + (1 << 25) >= 2 << 25) ++ { ++ unsigned char* startp = p; ++ p = build_power10_offset(p, delta, ++ loc & 4, false); ++ delta -= p - startp; ++ } ++ if (delta + (1 << 25) < 2 << 25) ++ write_insn(p, b | (delta & 0x3fffffc)); ++ else ++ { ++ write_insn(p, mtctr_12); ++ p += 4; ++ write_insn(p, bctr); ++ } + } + } + } +@@ -6204,7 +6456,11 @@ Stub_table::do_write(O + Address plt_addr = pltoff + plt->address(); + + p = oview + cs->second.off_; +- this->build_tls_opt_head(&p, cs); ++ if (this->targ_->is_tls_get_addr_opt(cs->first.sym_)) ++ { ++ bool save_lr = cs->second.r2save_ && !cs->second.localentry0_; ++ this->build_tls_opt_head(&p, save_lr); ++ } + if (cs->second.r2save_) + { + write_insn(p, std_2_1 + this->targ_->stk_toc()); +@@ -6241,7 +6497,11 @@ Stub_table::do_write(O + } + write_insn(p, mtctr_12); + p += 4; +- if (!this->build_tls_opt_tail(p, cs)) ++ if (cs->second.r2save_ ++ && !cs->second.localentry0_ ++ && this->targ_->is_tls_get_addr_opt(cs->first.sym_)) ++ this->build_tls_opt_tail(p); ++ else + write_insn(p, bctr); + } + } +@@ -6292,8 +6552,12 @@ Stub_table::do_write(O + } + + p = oview + cs->second.off_; +- if (this->build_tls_opt_head(&p, cs)) +- use_fake_dep = thread_safe; ++ if (this->targ_->is_tls_get_addr_opt(cs->first.sym_)) ++ { ++ bool save_lr = cs->second.r2save_ && !cs->second.localentry0_; ++ this->build_tls_opt_head(&p, save_lr); ++ use_fake_dep = thread_safe; ++ } + if (cs->second.r2save_) + { + write_insn(p, std_2_1 + this->targ_->stk_toc()); +@@ -6355,8 +6619,10 @@ Stub_table::do_write(O + write_insn(p, ld_2_2 + l(off + 8)); + p += 4; + } +- if (this->build_tls_opt_tail(p, cs)) +- ; ++ if (cs->second.r2save_ ++ && !cs->second.localentry0_ ++ && this->targ_->is_tls_get_addr_opt(cs->first.sym_)) ++ this->build_tls_opt_tail(p); + else if (thread_safe && !use_fake_dep) + { + write_insn(p, cmpldi_2_0); +@@ -6382,6 +6648,8 @@ Stub_table::do_write(O + p = oview + off; + Address loc = this->stub_address() + off; + Address delta = bs->first.dest_ - loc; ++ if (!bs->second.notoc_) ++ delta += elfcpp::ppc64_decode_local_entry(bs->second.other_); + if (bs->second.notoc_) + { + unsigned char* startp = p; +@@ -6437,7 +6705,8 @@ Stub_table::do_write(O + plt_addr += plt->address(); + + p = oview + cs->second.off_; +- this->build_tls_opt_head(&p, cs); ++ if (this->targ_->is_tls_get_addr_opt(cs->first.sym_)) ++ this->build_tls_opt_head(&p, false); + if (parameters->options().output_is_position_independent()) + { + Address got_addr; +@@ -6577,15 +6846,25 @@ Output_data_glink::do_ + } + else + { ++ if (this->targ_->has_localentry0()) ++ { ++ write_insn(p, std_2_1 + 24), p += 4; ++ } + write_insn(p, mflr_0), p += 4; + write_insn(p, bcl_20_31), p += 4; + write_insn(p, mflr_11), p += 4; +- write_insn(p, std_2_1 + 24), p += 4; +- write_insn(p, ld_2_11 + l(-16)), p += 4; + write_insn(p, mtlr_0), p += 4; ++ if (this->targ_->has_localentry0()) ++ { ++ write_insn(p, ld_0_11 + l(-20)), p += 4; ++ } ++ else ++ { ++ write_insn(p, ld_0_11 + l(-16)), p += 4; ++ } + write_insn(p, sub_12_12_11), p += 4; +- write_insn(p, add_11_2_11), p += 4; +- write_insn(p, addi_0_12 + l(-48)), p += 4; ++ write_insn(p, add_11_0_11), p += 4; ++ write_insn(p, addi_0_12 + l(-44)), p += 4; + write_insn(p, ld_12_11 + 0), p += 4; + write_insn(p, srdi_0_0_2), p += 4; + write_insn(p, mtctr_12), p += 4; +@@ -8191,7 +8470,7 @@ Target_powerpc::Scan:: + uint32_t insn = elfcpp::Swap<32, big_endian>::readval(view + off); + if ((insn & ((0x3fu << 26) | 0x1f << 16)) + != ((15u << 26) | ((size == 32 ? 2 : 13) << 16))) +- target->set_tprel_opt(false); ++ target->set_no_tprel_opt(); + } + } + break; +@@ -8206,7 +8485,7 @@ Target_powerpc::Scan:: + break; + // Fall through. + case elfcpp::R_POWERPC_TPREL16_HI: +- target->set_tprel_opt(false); ++ target->set_no_tprel_opt(); + break; + default: + break; +@@ -8230,7 +8509,7 @@ Target_powerpc::Scan:: + case elfcpp::R_PPC64_GOT_TLSLD_PCREL34: + case elfcpp::R_PPC64_GOT_DTPREL_PCREL34: + case elfcpp::R_PPC64_GOT_TPREL_PCREL34: +- target->set_power10_stubs(); ++ target->set_power10_relocs(); + break; + default: + break; +@@ -8988,7 +9267,7 @@ Target_powerpc::Scan:: + uint32_t insn = elfcpp::Swap<32, big_endian>::readval(view + off); + if ((insn & ((0x3fu << 26) | 0x1f << 16)) + != ((15u << 26) | ((size == 32 ? 2 : 13) << 16))) +- target->set_tprel_opt(false); ++ target->set_no_tprel_opt(); + } + } + break; +@@ -9003,7 +9282,7 @@ Target_powerpc::Scan:: + break; + // Fall through. + case elfcpp::R_POWERPC_TPREL16_HI: +- target->set_tprel_opt(false); ++ target->set_no_tprel_opt(); + break; + default: + break; +@@ -9027,7 +9306,7 @@ Target_powerpc::Scan:: + case elfcpp::R_PPC64_GOT_TLSLD_PCREL34: + case elfcpp::R_PPC64_GOT_DTPREL_PCREL34: + case elfcpp::R_PPC64_GOT_TPREL_PCREL34: +- target->set_power10_stubs(); ++ target->set_power10_relocs(); + break; + default: + break; +@@ -9369,6 +9648,13 @@ Target_powerpc::scan_r + needs_special_offset_handling, + local_symbol_count, + plocal_symbols); ++ ++ if (this->plt_localentry0_ && this->power10_relocs_) ++ { ++ gold_warning(_("--plt-localentry is incompatible with " ++ "power10 pc-relative code")); ++ this->plt_localentry0_ = false; ++ } + } + + // Functor class for processing the global symbol table. +@@ -10118,6 +10404,7 @@ Target_powerpc::Reloca + ? gsym->use_plt_offset(Scan::get_reference_flags(r_type, target)) + : object->local_has_plt_offset(r_sym)); + if (has_plt_offset ++ && !is_got_reloc(r_type) + && !is_plt16_reloc(r_type) + && r_type != elfcpp::R_PPC64_PLT_PCREL34 + && r_type != elfcpp::R_PPC64_PLT_PCREL34_NOTOC +@@ -10176,18 +10463,28 @@ Target_powerpc::Reloca + elfcpp::Shdr shdr(relinfo->reloc_shdr); + size_t reloc_count = shdr.get_sh_size() / reloc_size; + if (size == 64 ++ && r_type != elfcpp::R_PPC64_REL24_NOTOC) ++ value += ent->tocoff_; ++ if (size == 64 + && ent->r2save_ +- && r_type == elfcpp::R_PPC64_REL24_NOTOC) +- value += 4; +- else if (size == 64 +- && ent->r2save_ +- && relnum < reloc_count - 1) ++ && !(gsym != NULL ++ && target->is_tls_get_addr_opt(gsym))) + { +- Reltype next_rela(preloc + reloc_size); +- if (elfcpp::elf_r_type(next_rela.get_r_info()) +- == elfcpp::R_PPC64_TOCSAVE +- && next_rela.get_r_offset() == rela.get_r_offset() + 4) +- value += 4; ++ if (r_type == elfcpp::R_PPC64_REL24_NOTOC) ++ { ++ if (!(target->power10_stubs() ++ && target->power10_stubs_auto())) ++ value += 4; ++ } ++ else if (relnum < reloc_count - 1) ++ { ++ Reltype next_rela(preloc + reloc_size); ++ if (elfcpp::elf_r_type(next_rela.get_r_info()) ++ == elfcpp::R_PPC64_TOCSAVE ++ && (next_rela.get_r_offset() ++ == rela.get_r_offset() + 4)) ++ value += 4; ++ } + } + localentry0 = ent->localentry0_; + has_stub_value = true; +@@ -10250,13 +10547,7 @@ Target_powerpc::Reloca + elfcpp::Swap<32, big_endian>::writeval(iview + 1, pnop & 0xffffffff); + r_type = elfcpp::R_POWERPC_NONE; + } +- else if (r_type == elfcpp::R_POWERPC_GOT16 +- || r_type == elfcpp::R_POWERPC_GOT16_LO +- || r_type == elfcpp::R_POWERPC_GOT16_HI +- || r_type == elfcpp::R_POWERPC_GOT16_HA +- || r_type == elfcpp::R_PPC64_GOT16_DS +- || r_type == elfcpp::R_PPC64_GOT16_LO_DS +- || r_type == elfcpp::R_PPC64_GOT_PCREL34) ++ else if (is_got_reloc(r_type)) + { + if (gsym != NULL) + { +@@ -10758,14 +11049,15 @@ Target_powerpc::Reloca + || r_type == elfcpp::R_POWERPC_PLT16_HA))) + addend = rela.get_r_addend(); + value = psymval->value(object, addend); ++ unsigned int local_ent = 0; + if (size == 64 && is_branch_reloc(r_type)) + { + if (target->abiversion() >= 2) + { + if (gsym != NULL) +- value += object->ppc64_local_entry_offset(gsym); ++ local_ent = object->ppc64_local_entry_offset(gsym); + else +- value += object->ppc64_local_entry_offset(r_sym); ++ local_ent = object->ppc64_local_entry_offset(r_sym); + } + else + { +@@ -10774,9 +11066,9 @@ Target_powerpc::Reloca + &value, &dest_shndx); + } + } +- Address max_branch_offset = max_branch_delta(r_type); +- if (max_branch_offset != 0 +- && (value - address + max_branch_offset >= 2 * max_branch_offset ++ Address max_branch = max_branch_delta(r_type); ++ if (max_branch != 0 ++ && (value + local_ent - address + max_branch >= 2 * max_branch + || (size == 64 + && r_type == elfcpp::R_PPC64_REL24_NOTOC + && (gsym != NULL +@@ -10795,12 +11087,20 @@ Target_powerpc::Reloca + value = (value - target->savres_section()->address() + + stub_table->branch_size()); + else +- value = (stub_table->stub_address() + stub_table->plt_size() +- + ent->off_); ++ { ++ value = (stub_table->stub_address() ++ + stub_table->plt_size() ++ + ent->off_); ++ if (size == 64 ++ && r_type != elfcpp::R_PPC64_REL24_NOTOC) ++ value += ent->tocoff_; ++ } + has_stub_value = true; + } + } + } ++ if (!has_stub_value) ++ value += local_ent; + } + + switch (r_type) +diff -rup binutils-2.35.1/gold/testsuite/split_i386.sh fred/binutils-2.35.1/gold/testsuite/split_i386.sh +--- binutils-2.35.1/gold/testsuite/split_i386.sh 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/gold/testsuite/split_i386.sh 2020-11-25 14:37:54.000000000 +0000 +@@ -45,7 +45,7 @@ match 'lea.*-0x200\(%esp\),' split_i386_ + match 'stc' split_i386_2.stdout + match 'call.*__morestack_non_split>?$' split_i386_2.stdout + nomatch 'call.*__morestack>?$' split_i386_2.stdout +-match 'lea.*-0x4200\(%esp\),' split_i386_2.stdout ++match 'lea.*-0x100200\(%esp\),' split_i386_2.stdout + + match 'failed to match' split_i386_3.stdout + +diff -rup binutils-2.35.1/gold/testsuite/split_x32.sh fred/binutils-2.35.1/gold/testsuite/split_x32.sh +--- binutils-2.35.1/gold/testsuite/split_x32.sh 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/gold/testsuite/split_x32.sh 2020-11-25 14:37:54.000000000 +0000 +@@ -44,9 +44,9 @@ match 'callq.*__morestack>?$' split_x32_ + match 'lea.*-0x200\(%rsp\),' split_x32_1.stdout + + match 'stc' split_x32_2.stdout +-match 'callq.*__morestack_non_split>?$' split_x32_2.stdout +-nomatch 'callq.*__morestack>?$' split_x32_2.stdout +-match 'lea.*-0x4200\(%rsp\),' split_x32_2.stdout ++match 'call.*__morestack_non_split>?$' split_x32_2.stdout ++nomatch 'call.*__morestack>?$' split_x32_2.stdout ++match 'lea.*-0x100200\(%rsp\),' split_x32_2.stdout + + match 'failed to match' split_x32_3.stdout + +diff -rup binutils-2.35.1/gold/testsuite/split_x86_64.sh fred/binutils-2.35.1/gold/testsuite/split_x86_64.sh +--- binutils-2.35.1/gold/testsuite/split_x86_64.sh 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/gold/testsuite/split_x86_64.sh 2020-11-25 14:37:54.000000000 +0000 +@@ -43,9 +43,9 @@ match 'callq.*__morestack>?$' split_x86_ + match 'lea.*-0x200\(%rsp\),' split_x86_64_1.stdout + + match 'stc' split_x86_64_2.stdout +-match 'callq.*__morestack_non_split>?$' split_x86_64_2.stdout +-nomatch 'callq.*__morestack>?$' split_x86_64_2.stdout +-match 'lea.*-0x4200\(%rsp\),' split_x86_64_2.stdout ++match 'call.*__morestack_non_split>?$' split_x86_64_2.stdout ++nomatch 'call.*__morestack>?$' split_x86_64_2.stdout ++match 'lea.*-0x100200\(%rsp\),' split_x86_64_2.stdout + + match 'failed to match' split_x86_64_3.stdout + +diff -rup binutils-2.35.1/include/dwarf2.def fred/binutils-2.35.1/include/dwarf2.def +--- binutils-2.35.1/include/dwarf2.def 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/include/dwarf2.def 2020-11-25 14:37:55.000000000 +0000 +@@ -805,3 +805,14 @@ DW_IDX (DW_IDX_hi_user, 0x3fff) + DW_IDX (DW_IDX_GNU_internal, 0x2000) + DW_IDX (DW_IDX_GNU_external, 0x2001) + DW_END_IDX ++ ++/* DWARF5 Unit type header encodings */ ++DW_FIRST_UT (DW_UT_compile, 0x01) ++DW_UT (DW_UT_type, 0x02) ++DW_UT (DW_UT_partial, 0x03) ++DW_UT (DW_UT_skeleton, 0x04) ++DW_UT (DW_UT_split_compile, 0x05) ++DW_UT (DW_UT_split_type, 0x06) ++DW_UT (DW_UT_lo_user, 0x80) ++DW_UT (DW_UT_hi_user, 0xff) ++DW_END_UT +diff -rup binutils-2.35.1/include/dwarf2.h fred/binutils-2.35.1/include/dwarf2.h +--- binutils-2.35.1/include/dwarf2.h 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/include/dwarf2.h 2020-11-25 14:37:55.000000000 +0000 +@@ -55,6 +55,7 @@ + #define DW_CFA_DUP(name, value) , name = value + #define DW_IDX(name, value) , name = value + #define DW_IDX_DUP(name, value) , name = value ++#define DW_UT(name, value) , name = value + + #define DW_FIRST_TAG(name, value) enum dwarf_tag { \ + name = value +@@ -77,6 +78,9 @@ + #define DW_FIRST_IDX(name, value) enum dwarf_name_index_attribute { \ + name = value + #define DW_END_IDX }; ++#define DW_FIRST_UT(name, value) enum dwarf_unit_type { \ ++ name = value ++#define DW_END_UT }; + + #include "dwarf2.def" + +@@ -94,6 +98,8 @@ + #undef DW_END_CFA + #undef DW_FIRST_IDX + #undef DW_END_IDX ++#undef DW_FIRST_UT ++#undef DW_END_UT + + #undef DW_TAG + #undef DW_TAG_DUP +@@ -108,6 +114,7 @@ + #undef DW_CFA_DUP + #undef DW_IDX + #undef DW_IDX_DUP ++#undef DW_UT + + /* Flag that tells whether entry has a child or not. */ + #define DW_children_no 0 +@@ -450,19 +457,6 @@ enum dwarf_range_list_entry + DW_RLE_start_end = 0x06, + DW_RLE_start_length = 0x07 + }; +- +-/* Unit types in unit_type unit header field. */ +-enum dwarf_unit_type +- { +- DW_UT_compile = 0x01, +- DW_UT_type = 0x02, +- DW_UT_partial = 0x03, +- DW_UT_skeleton = 0x04, +- DW_UT_split_compile = 0x05, +- DW_UT_split_type = 0x06, +- DW_UT_lo_user = 0x80, +- DW_UT_hi_user = 0xff +- }; + + /* @@@ For use with GNU frame unwind information. */ + +@@ -534,6 +528,10 @@ extern const char *get_DW_CFA_name (unsi + recognized. */ + extern const char *get_DW_IDX_name (unsigned int idx); + ++/* Return the name of a DW_UT_ constant, or NULL if the value is not ++ recognized. */ ++extern const char *get_DW_UT_name (unsigned int ut); ++ + #ifdef __cplusplus + } + #endif /* __cplusplus */ +diff -rup binutils-2.35.1/ld/emultempl/ppc64elf.em fred/binutils-2.35.1/ld/emultempl/ppc64elf.em +--- binutils-2.35.1/ld/emultempl/ppc64elf.em 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/emultempl/ppc64elf.em 2020-11-25 14:38:05.000000000 +0000 +@@ -32,13 +32,15 @@ fragment <tls_sec != NULL + && !no_tls_opt) + { + /* Size the sections. This is premature, but we want to know the +@@ -323,8 +337,6 @@ ppc_before_allocation (void) + sort_toc_sections (&toc_os->children, NULL, NULL); + } + } +- +- gld${EMULATION_NAME}_before_allocation (); + } + + struct hook_stub_info +@@ -686,6 +698,7 @@ enum ppc64_opt + OPTION_NO_PLT_LOCALENTRY, + OPTION_POWER10_STUBS, + OPTION_NO_POWER10_STUBS, ++ OPTION_NO_PCREL_OPT, + OPTION_STUBSYMS, + OPTION_NO_STUBSYMS, + OPTION_SAVRES, +@@ -717,6 +730,7 @@ PARSE_AND_LIST_LONGOPTS=${PARSE_AND_LIST + { "plt-localentry", optional_argument, NULL, OPTION_PLT_LOCALENTRY }, + { "no-plt-localentry", no_argument, NULL, OPTION_NO_PLT_LOCALENTRY }, + { "power10-stubs", optional_argument, NULL, OPTION_POWER10_STUBS }, ++ { "no-pcrel-optimize", no_argument, NULL, OPTION_NO_PCREL_OPT }, + { "no-power10-stubs", no_argument, NULL, OPTION_NO_POWER10_STUBS }, + { "emit-stub-syms", no_argument, NULL, OPTION_STUBSYMS }, + { "no-emit-stub-syms", no_argument, NULL, OPTION_NO_STUBSYMS }, +@@ -776,6 +790,9 @@ PARSE_AND_LIST_OPTIONS=${PARSE_AND_LIST_ + --power10-stubs [=auto] Use Power10 PLT call stubs (default auto)\n" + )); + fprintf (file, _("\ ++ --no-pcrel-optimize Don'\''t perform R_PPC64_PCREL_OPT optimization\n" ++ )); ++ fprintf (file, _("\ + --no-power10-stubs Don'\''t use Power10 PLT call stubs\n" + )); + fprintf (file, _("\ +@@ -909,6 +926,10 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LI + params.power10_stubs = 0; + break; + ++ case OPTION_NO_PCREL_OPT: ++ params.no_pcrel_opt = 1; ++ break; ++ + case OPTION_STUBSYMS: + params.emit_stub_syms = 1; + break; +@@ -985,6 +1006,7 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LI + params.no_multi_toc = 1; + no_toc_sort = 1; + params.plt_static_chain = 1; ++ params.no_pcrel_opt = 1; + return FALSE; + ' + +diff -rup binutils-2.35.1/ld/ldelf.c fred/binutils-2.35.1/ld/ldelf.c +--- binutils-2.35.1/ld/ldelf.c 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/ldelf.c 2020-11-25 14:38:05.000000000 +0000 +@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, ch + (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next, + sizeof ehdr_start_save_u); + ehdr_start->type = bfd_link_hash_defined; ++ /* It will be converted to section-relative later. */ ++ ehdr_start->rel_from_abs = 1; + ehdr_start->u.def.section = bfd_abs_section_ptr; + ehdr_start->u.def.value = 0; + } +diff -rup binutils-2.35.1/ld/testsuite/ld-i386/i386.exp fred/binutils-2.35.1/ld/testsuite/ld-i386/i386.exp +--- binutils-2.35.1/ld/testsuite/ld-i386/i386.exp 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-i386/i386.exp 2020-11-25 14:38:12.000000000 +0000 +@@ -470,6 +470,10 @@ run_dump_test "pr24322b" + run_dump_test "align-branch-1" + run_dump_test "pr26018" + run_dump_test "pr26263" ++run_dump_test "pr26711-1" ++run_dump_test "pr26711-2" ++run_dump_test "pr26711-3" ++run_dump_test "pr26869" + + if { !([istarget "i?86-*-linux*"] + || [istarget "i?86-*-gnu*"] +diff -rup binutils-2.35.1/ld/testsuite/ld-i386/property-3.r fred/binutils-2.35.1/ld/testsuite/ld-i386/property-3.r +--- binutils-2.35.1/ld/testsuite/ld-i386/property-3.r 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-i386/property-3.r 2020-11-25 14:38:12.000000000 +0000 +@@ -3,5 +3,6 @@ Displaying notes found in: .note.gnu.pro + [ ]+Owner[ ]+Data size[ ]+Description + GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 + Properties: stack size: 0x800000 ++#... + x86 ISA needed: CMOV, SSE + #pass +diff -rup binutils-2.35.1/ld/testsuite/ld-i386/property-4.r fred/binutils-2.35.1/ld/testsuite/ld-i386/property-4.r +--- binutils-2.35.1/ld/testsuite/ld-i386/property-4.r 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-i386/property-4.r 2020-11-25 14:38:12.000000000 +0000 +@@ -3,5 +3,6 @@ Displaying notes found in: .note.gnu.pro + [ ]+Owner[ ]+Data size[ ]+Description + GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 + Properties: stack size: 0x800000 ++#... + x86 ISA needed: CMOV, SSE, SSE3 + #pass +diff -rup binutils-2.35.1/ld/testsuite/ld-i386/property-5.r fred/binutils-2.35.1/ld/testsuite/ld-i386/property-5.r +--- binutils-2.35.1/ld/testsuite/ld-i386/property-5.r 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-i386/property-5.r 2020-11-25 14:38:12.000000000 +0000 +@@ -3,5 +3,6 @@ Displaying notes found in: .note.gnu.pro + [ ]+Owner[ ]+Data size[ ]+Description + GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 + Properties: stack size: 0x900000 ++#... + x86 ISA needed: CMOV, SSE, SSE3 + #pass +diff -rup binutils-2.35.1/ld/testsuite/ld-powerpc/elfv2so.d fred/binutils-2.35.1/ld/testsuite/ld-powerpc/elfv2so.d +--- binutils-2.35.1/ld/testsuite/ld-powerpc/elfv2so.d 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-powerpc/elfv2so.d 2020-11-25 14:38:13.000000000 +0000 +@@ -74,12 +74,11 @@ Disassembly of section \.text: + .*: (7c 08 02 a6|a6 02 08 7c) mflr r0 + .*: (42 9f 00 05|05 00 9f 42) bcl .* + .*: (7d 68 02 a6|a6 02 68 7d) mflr r11 +-.*: (18 00 41 f8|f8 41 00 18) std r2,24\(r1\) +-.*: (e8 4b ff f0|f0 ff 4b e8) ld r2,-16\(r11\) + .*: (7c 08 03 a6|a6 03 08 7c) mtlr r0 ++.*: (e8 0b ff f0|f0 ff 0b e8) ld r0,-16\(r11\) + .*: (7d 8b 60 50|50 60 8b 7d) subf r12,r11,r12 +-.*: (7d 62 5a 14|14 5a 62 7d) add r11,r2,r11 +-.*: (38 0c ff d0|d0 ff 0c 38) addi r0,r12,-48 ++.*: (7d 60 5a 14|14 5a 60 7d) add r11,r0,r11 ++.*: (38 0c ff d4|d4 ff 0c 38) addi r0,r12,-44 + .*: (e9 8b 00 00|00 00 8b e9) ld r12,0\(r11\) + .*: (78 00 f0 82|82 f0 00 78) rldicl r0,r0,62,2 + .*: (7d 89 03 a6|a6 03 89 7d) mtctr r12 +@@ -87,16 +86,16 @@ Disassembly of section \.text: + .*: (4e 80 04 20|20 04 80 4e) bctr + + .* : +-.*: (4b ff ff c8|c8 ff ff 4b) b .* <__glink_PLTresolve> ++.*: (4b ff ff cc|cc ff ff 4b) b .* <__glink_PLTresolve> + + .* : +-.*: (4b ff ff c4|c4 ff ff 4b) b .* <__glink_PLTresolve> ++.*: (4b ff ff c8|c8 ff ff 4b) b .* <__glink_PLTresolve> + + .* : +-.*: (4b ff ff c0|c0 ff ff 4b) b .* <__glink_PLTresolve> ++.*: (4b ff ff c4|c4 ff ff 4b) b .* <__glink_PLTresolve> + + .* : +-.*: (4b ff ff bc|bc ff ff 4b) b .* <__glink_PLTresolve> ++.*: (4b ff ff c0|c0 ff ff 4b) b .* <__glink_PLTresolve> + + .* : +-.*: (4b ff ff b8|b8 ff ff 4b) b .* <__glink_PLTresolve> ++.*: (4b ff ff bc|bc ff ff 4b) b .* <__glink_PLTresolve> +diff -rup binutils-2.35.1/ld/testsuite/ld-powerpc/notoc2.d fred/binutils-2.35.1/ld/testsuite/ld-powerpc/notoc2.d +--- binutils-2.35.1/ld/testsuite/ld-powerpc/notoc2.d 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-powerpc/notoc2.d 2020-11-25 14:38:13.000000000 +0000 +@@ -22,8 +22,8 @@ Disassembly of section \.text: + .*: (39 80 ff ff|ff ff 80 39) + .*: (06 10 00 00|00 00 10 06) pla r12,0 + .*: (39 80 00 00|00 00 80 39) +-.*: (06 10 00 00|00 00 10 06) pla r3,92 +-.*: (38 60 00 5c|5c 00 60 38) ++.*: (06 10 00 00|00 00 10 06) pla r3,88 ++.*: (38 60 00 58|58 00 60 38) + .*: (4b ff ff 99|99 ff ff 4b) bl .* <.*\.plt_call\.puts> + .*: (60 00 00 00|00 00 00 60) nop + #pass +diff -rup binutils-2.35.1/ld/testsuite/ld-powerpc/tlsdesc.wf fred/binutils-2.35.1/ld/testsuite/ld-powerpc/tlsdesc.wf +--- binutils-2.35.1/ld/testsuite/ld-powerpc/tlsdesc.wf 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-powerpc/tlsdesc.wf 2020-11-25 14:38:13.000000000 +0000 +@@ -38,9 +38,9 @@ Contents of the \.eh_frame section: + DW_CFA_nop + + 0+4c 0+14 0+50 FDE cie=0+ pc=0+2f8\.\.0+32c +- DW_CFA_advance_loc: 4 to 0+2fc ++ DW_CFA_advance_loc: 8 to 0+300 + DW_CFA_register: r65 in r12 +- DW_CFA_advance_loc: 20 to 0+310 ++ DW_CFA_advance_loc: 16 to 0+310 + DW_CFA_restore_extended: r65 + + 0+64 0+10 0+68 FDE cie=0+ pc=0+2e0\.\.0+2ec +diff -rup binutils-2.35.1/ld/testsuite/ld-powerpc/tlsdesc2.d fred/binutils-2.35.1/ld/testsuite/ld-powerpc/tlsdesc2.d +--- binutils-2.35.1/ld/testsuite/ld-powerpc/tlsdesc2.d 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-powerpc/tlsdesc2.d 2020-11-25 14:38:13.000000000 +0000 +@@ -53,12 +53,11 @@ Disassembly of section \.text: + .*: (7c 08 02 a6|a6 02 08 7c) mflr r0 + .*: (42 9f 00 05|05 00 9f 42) bcl .* + .*: (7d 68 02 a6|a6 02 68 7d) mflr r11 +-.*: (f8 41 00 18|18 00 41 f8) std r2,24\(r1\) +-.*: (e8 4b ff f0|f0 ff 4b e8) ld r2,-16\(r11\) + .*: (7c 08 03 a6|a6 03 08 7c) mtlr r0 ++.*: (e8 0b ff f0|f0 ff 0b e8) ld r0,-16\(r11\) + .*: (7d 8b 60 50|50 60 8b 7d) subf r12,r11,r12 +-.*: (7d 62 5a 14|14 5a 62 7d) add r11,r2,r11 +-.*: (38 0c ff d0|d0 ff 0c 38) addi r0,r12,-48 ++.*: (7d 60 5a 14|14 5a 60 7d) add r11,r0,r11 ++.*: (38 0c ff d4|d4 ff 0c 38) addi r0,r12,-44 + .*: (e9 8b 00 00|00 00 8b e9) ld r12,0\(r11\) + .*: (78 00 f0 82|82 f0 00 78) rldicl r0,r0,62,2 + .*: (7d 89 03 a6|a6 03 89 7d) mtctr r12 +@@ -66,4 +65,4 @@ Disassembly of section \.text: + .*: (4e 80 04 20|20 04 80 4e) bctr + + .* <__tls_get_addr_opt@plt>: +-.*: (4b ff ff c8|c8 ff ff 4b) b .* <__glink_PLTresolve> ++.*: (4b ff ff cc|cc ff ff 4b) b .* <__glink_PLTresolve> +diff -rup binutils-2.35.1/ld/testsuite/ld-powerpc/tlsdesc2.wf fred/binutils-2.35.1/ld/testsuite/ld-powerpc/tlsdesc2.wf +--- binutils-2.35.1/ld/testsuite/ld-powerpc/tlsdesc2.wf 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-powerpc/tlsdesc2.wf 2020-11-25 14:38:13.000000000 +0000 +@@ -37,10 +37,10 @@ Contents of the \.eh_frame section: + DW_CFA_nop + DW_CFA_nop + +-0+4c 0+14 0+50 FDE cie=0+ pc=0+318\.\.0+354 +- DW_CFA_advance_loc: 4 to 0+31c ++0+4c 0+14 0+50 FDE cie=0+ pc=0+318\.\.0+350 ++ DW_CFA_advance_loc: 8 to 0+320 + DW_CFA_register: r65 in r0 +- DW_CFA_advance_loc: 28 to 0+338 ++ DW_CFA_advance_loc: 8 to 0+328 + DW_CFA_restore_extended: r65 + + 0+64 0+10 0+68 FDE cie=0+ pc=0+300\.\.0+30c +diff -rup binutils-2.35.1/ld/testsuite/ld-powerpc/tlsopt5.d fred/binutils-2.35.1/ld/testsuite/ld-powerpc/tlsopt5.d +--- binutils-2.35.1/ld/testsuite/ld-powerpc/tlsopt5.d 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-powerpc/tlsopt5.d 2020-11-25 14:38:13.000000000 +0000 +@@ -49,12 +49,11 @@ Disassembly of section \.text: + .*: (a6 02 08 7c|7c 08 02 a6) mflr r0 + .*: (05 00 9f 42|42 9f 00 05) bcl .* + .*: (a6 02 68 7d|7d 68 02 a6) mflr r11 +-.*: (18 00 41 f8|f8 41 00 18) std r2,24\(r1\) +-.*: (f0 ff 4b e8|e8 4b ff f0) ld r2,-16\(r11\) + .*: (a6 03 08 7c|7c 08 03 a6) mtlr r0 ++.*: (f0 ff 0b e8|e8 0b ff f0) ld r0,-16\(r11\) + .*: (50 60 8b 7d|7d 8b 60 50) subf r12,r11,r12 +-.*: (14 5a 62 7d|7d 62 5a 14) add r11,r2,r11 +-.*: (d0 ff 0c 38|38 0c ff d0) addi r0,r12,-48 ++.*: (14 5a 60 7d|7d 60 5a 14) add r11,r0,r11 ++.*: (d4 ff 0c 38|38 0c ff d4) addi r0,r12,-44 + .*: (00 00 8b e9|e9 8b 00 00) ld r12,0\(r11\) + .*: (82 f0 00 78|78 00 f0 82) rldicl r0,r0,62,2 + .*: (a6 03 89 7d|7d 89 03 a6) mtctr r12 +@@ -62,7 +61,7 @@ Disassembly of section \.text: + .*: (20 04 80 4e|4e 80 04 20) bctr + + .* <__tls_get_addr_opt@plt>: +-.* (c8 ff ff 4b|4b ff ff c8) b .* ++.* (cc ff ff 4b|4b ff ff cc) b .* + + .* : +-.*: (c4 ff ff 4b|4b ff ff c4) b .* ++.*: (c8 ff ff 4b|4b ff ff c8) b .* +diff -rup binutils-2.35.1/ld/testsuite/ld-powerpc/tlsopt5.wf fred/binutils-2.35.1/ld/testsuite/ld-powerpc/tlsopt5.wf +--- binutils-2.35.1/ld/testsuite/ld-powerpc/tlsopt5.wf 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-powerpc/tlsopt5.wf 2020-11-25 14:38:13.000000000 +0000 +@@ -16,9 +16,9 @@ Contents of the \.eh_frame section: + DW_CFA_restore_extended: r65 + + 0+2c 0+14 0+30 FDE cie=0+ pc=.* +- DW_CFA_advance_loc: 4 to .* ++ DW_CFA_advance_loc: 8 to .* + DW_CFA_register: r65 in r0 +- DW_CFA_advance_loc: 28 to .* ++ DW_CFA_advance_loc: 8 to .* + DW_CFA_restore_extended: r65 + + 0+44 0+10 0+48 FDE cie=0+ pc=.* +diff -rup binutils-2.35.1/ld/testsuite/ld-powerpc/tlsopt6.d fred/binutils-2.35.1/ld/testsuite/ld-powerpc/tlsopt6.d +--- binutils-2.35.1/ld/testsuite/ld-powerpc/tlsopt6.d 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-powerpc/tlsopt6.d 2020-11-25 14:38:13.000000000 +0000 +@@ -67,12 +67,11 @@ Disassembly of section \.text: + .*: (a6 02 08 7c|7c 08 02 a6) mflr r0 + .*: (05 00 9f 42|42 9f 00 05) bcl .* + .*: (a6 02 68 7d|7d 68 02 a6) mflr r11 +-.*: (18 00 41 f8|f8 41 00 18) std r2,24\(r1\) +-.*: (f0 ff 4b e8|e8 4b ff f0) ld r2,-16\(r11\) + .*: (a6 03 08 7c|7c 08 03 a6) mtlr r0 ++.*: (f0 ff 0b e8|e8 0b ff f0) ld r0,-16\(r11\) + .*: (50 60 8b 7d|7d 8b 60 50) subf r12,r11,r12 +-.*: (14 5a 62 7d|7d 62 5a 14) add r11,r2,r11 +-.*: (d0 ff 0c 38|38 0c ff d0) addi r0,r12,-48 ++.*: (14 5a 60 7d|7d 60 5a 14) add r11,r0,r11 ++.*: (d4 ff 0c 38|38 0c ff d4) addi r0,r12,-44 + .*: (00 00 8b e9|e9 8b 00 00) ld r12,0\(r11\) + .*: (82 f0 00 78|78 00 f0 82) rldicl r0,r0,62,2 + .*: (a6 03 89 7d|7d 89 03 a6) mtctr r12 +@@ -80,7 +79,7 @@ Disassembly of section \.text: + .*: (20 04 80 4e|4e 80 04 20) bctr + + .* <__tls_get_addr_opt@plt>: +-.* (c8 ff ff 4b|4b ff ff c8) b .* ++.* (cc ff ff 4b|4b ff ff cc) b .* + + .* : +-.*: (c4 ff ff 4b|4b ff ff c4) b .* ++.*: (c8 ff ff 4b|4b ff ff c8) b .* +diff -rup binutils-2.35.1/ld/testsuite/ld-powerpc/tlsopt6.wf fred/binutils-2.35.1/ld/testsuite/ld-powerpc/tlsopt6.wf +--- binutils-2.35.1/ld/testsuite/ld-powerpc/tlsopt6.wf 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-powerpc/tlsopt6.wf 2020-11-25 14:38:13.000000000 +0000 +@@ -38,9 +38,9 @@ Contents of the \.eh_frame section: + DW_CFA_nop + + 0+4c 0+14 0+50 FDE cie=0+ pc=.* +- DW_CFA_advance_loc: 4 to .* ++ DW_CFA_advance_loc: 8 to .* + DW_CFA_register: r65 in r0 +- DW_CFA_advance_loc: 28 to .* ++ DW_CFA_advance_loc: 8 to .* + DW_CFA_restore_extended: r65 + + 0+64 0+10 0+68 FDE cie=0+ pc=.* +diff -rup binutils-2.35.1/ld/testsuite/ld-x86-64/property-3.r fred/binutils-2.35.1/ld/testsuite/ld-x86-64/property-3.r +--- binutils-2.35.1/ld/testsuite/ld-x86-64/property-3.r 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-x86-64/property-3.r 2020-11-25 14:38:13.000000000 +0000 +@@ -3,5 +3,6 @@ Displaying notes found in: .note.gnu.pro + [ ]+Owner[ ]+Data size[ ]+Description + GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 + Properties: stack size: 0x800000 ++#... + x86 ISA needed: CMOV, SSE + #pass +diff -rup binutils-2.35.1/ld/testsuite/ld-x86-64/property-4.r fred/binutils-2.35.1/ld/testsuite/ld-x86-64/property-4.r +--- binutils-2.35.1/ld/testsuite/ld-x86-64/property-4.r 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-x86-64/property-4.r 2020-11-25 14:38:13.000000000 +0000 +@@ -3,5 +3,6 @@ Displaying notes found in: .note.gnu.pro + [ ]+Owner[ ]+Data size[ ]+Description + GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 + Properties: stack size: 0x800000 ++#... + x86 ISA needed: CMOV, SSE, SSE3 + #pass +diff -rup binutils-2.35.1/ld/testsuite/ld-x86-64/property-5.r fred/binutils-2.35.1/ld/testsuite/ld-x86-64/property-5.r +--- binutils-2.35.1/ld/testsuite/ld-x86-64/property-5.r 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-x86-64/property-5.r 2020-11-25 14:38:13.000000000 +0000 +@@ -3,5 +3,6 @@ Displaying notes found in: .note.gnu.pro + [ ]+Owner[ ]+Data size[ ]+Description + GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 + Properties: stack size: 0x900000 ++#... + x86 ISA needed: CMOV, SSE, SSE3 + #pass +diff -rup binutils-2.35.1/ld/testsuite/ld-x86-64/x86-64.exp fred/binutils-2.35.1/ld/testsuite/ld-x86-64/x86-64.exp +--- binutils-2.35.1/ld/testsuite/ld-x86-64/x86-64.exp 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/ld/testsuite/ld-x86-64/x86-64.exp 2020-11-25 14:38:14.000000000 +0000 +@@ -432,6 +432,12 @@ run_dump_test "pr25416-3" + run_dump_test "pr25416-4" + run_dump_test "pr26018" + run_dump_test "pr26263" ++run_dump_test "pr26711-1" ++run_dump_test "pr26711-1-x32" ++run_dump_test "pr26711-2" ++run_dump_test "pr26711-2-x32" ++run_dump_test "pr26711-3" ++run_dump_test "pr26711-3-x32" + + if ![istarget "x86_64-*-linux*"] { + return +diff -rup binutils-2.35.1/libiberty/ChangeLog fred/binutils-2.35.1/libiberty/ChangeLog +--- binutils-2.35.1/libiberty/ChangeLog 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/libiberty/ChangeLog 2020-11-25 14:38:14.000000000 +0000 +@@ -1,3 +1,12 @@ ++2020-11-15 Mark Wielaard ++ ++ Backport from the mainline: ++ 2020-09-23 Mark Wielaard ++ ++ Sync with GCC ++ * dwarfnames.c (get_DW_UT_name): Define using DW_UT_FIRST, DW_UT ++ and DW_UT_END. ++ + 2020-06-23 Nick Alcock + + * bsearch_r.c: New file. +diff -rup binutils-2.35.1/libiberty/dwarfnames.c fred/binutils-2.35.1/libiberty/dwarfnames.c +--- binutils-2.35.1/libiberty/dwarfnames.c 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/libiberty/dwarfnames.c 2020-11-25 14:38:14.000000000 +0000 +@@ -64,6 +64,11 @@ Boston, MA 02110-1301, USA. */ + switch (idx) { \ + DW_IDX (name, value) + #define DW_END_IDX } return 0; } ++#define DW_FIRST_UT(name, value) \ ++ const char *get_DW_UT_name (unsigned int ut) { \ ++ switch (ut) { \ ++ DW_UT (name, value) ++#define DW_END_UT } return 0; } + + #define DW_TAG(name, value) case name: return # name ; + #define DW_TAG_DUP(name, value) +@@ -78,6 +83,7 @@ Boston, MA 02110-1301, USA. */ + #define DW_CFA_DUP(name, value) + #define DW_IDX(name, value) case name: return # name ; + #define DW_IDX_DUP(name, value) ++#define DW_UT(name, value) case name: return # name ; + + #include "dwarf2.def" + +@@ -95,6 +101,7 @@ Boston, MA 02110-1301, USA. */ + #undef DW_END_CFA + #undef DW_FIRST_IDX + #undef DW_END_IDX ++#undef DW_END_UT + + #undef DW_TAG + #undef DW_TAG_DUP +diff -rup binutils-2.35.1/md5.sum fred/binutils-2.35.1/md5.sum +--- binutils-2.35.1/md5.sum 2020-09-19 11:40:50.000000000 +0100 ++++ fred/binutils-2.35.1/md5.sum 2020-11-25 14:40:36.000000000 +0000 +@@ -49,7 +49,7 @@ d12089e756f4c1ed6e246474dbe05f6d bfd/do + 8ecd223de1a7cea63375ef737faf1b9e bfd/doc/Makefile.in + 065a5c588b90b2d96cc010c90d4f3ffb bfd/doc/opncls.texi + d41d8cd98f00b204e9800998ecf8427e bfd/doc/elfcode.texi +-1732861e8eeda2900e068be234408439 bfd/doc/bfd.info ++32e069284d5475ed9f18a86432e70a14 bfd/doc/bfd.info + 4635778e69bcb490e44389e420542276 bfd/doc/syms.texi + a11231531c5c3cd6e7babf06426a657e bfd/doc/ChangeLog-9103 + 9a6e644c9e94d7b18073f5cc6ef4395a bfd/doc/header.sed +@@ -68,7 +68,7 @@ e67d8b07516154c4ddbee2e3bab3d75e bfd/do + 32e807d8eab3afa2507095fe17ec73b3 bfd/doc/section.texi + 84a99eb217f66a88f8897fbca35b0d10 bfd/doc/mmo.texi + 930173859dab35d4c1c03efd5ddb18e3 bfd/doc/format.texi +-c9de9232d9175b113870d0ac5ebe31aa bfd/doc/bfdver.texi ++3cc46b417bd1d9eb18b04fab1273a142 bfd/doc/bfdver.texi + 0b9681af947fd0895c1aad2ccdead74c bfd/doc/linker.texi + d01f9e76a9c61f8ab1515177eda30283 bfd/doc/chew.c + fceb179f1a1bc85df44ec0ae3b917c1c bfd/doc/archive.texi +@@ -281,7 +281,7 @@ b21c979f62d62f954f612b63ee99dae5 bfd/bf + 8f7b5397a7bb5d502a9997e19d244cea bfd/ChangeLog-2014 + 5c0d4dd3f80060bd1e76014828bfc16c bfd/rs6000-core.c + 1e35ed78a9fdbfb07a6d94d2b441e202 bfd/pei-arm-wince.c +-631b35075890f152d1671bb88d463a47 bfd/ChangeLog ++971f01cd469cf08d10c6bad4e5974961 bfd/ChangeLog + 0ae280b39a62a17fb743514ae78c95a8 bfd/coff-ppc.c + 620a95a90035b8e4334f6f8691cdab88 bfd/elf32-frv.c + ac26580e531a7b18a8653d0cba189b49 bfd/xtensa-modules.c +@@ -308,7 +308,7 @@ a919bc62dc52ab557832759934e090c4 bfd/co + d3d4930147919f0140883106171bf2e0 bfd/cpu-pj.c + 408ef1462276b75d3708877103c85eb8 bfd/.gitignore + 4dddcd4a5a764871f8856f04ac280447 bfd/cpu-mcore.c +-f7c24616d8c2be965900a22003db3fb8 bfd/elf64-ppc.c ++2b58c74bb224f5c5281fa7ac70fe3fe3 bfd/elf64-ppc.c + 6921b6426a2273950ad87d34b1e3da64 bfd/elf32-h8300.c + b79d8726ad40d63367c0869bf0a173ab bfd/elf32-lm32.c + c00a335bf5927add5a9a82eaf1aa6ed5 bfd/elf64-mmix.c +@@ -325,45 +325,45 @@ d45630a9128a8b95d448a21ab42bfefb bfd/co + 00cc8a8822a249e656345b2941fabc31 bfd/xcofflink.h + a7fe983ac68020d4103c7fa7d625de4f bfd/merge.c + 4f683b032796acd7247220b18f5242e9 bfd/MAINTAINERS +-c03f87e1a341e4bae4bf2deff5577e0d bfd/elf64-ppc.h +-c4019a694f03cae81694f9c1c595e750 bfd/po/ja.gmo ++d162f4c687e1bf3e45c4e49d532dbb7f bfd/elf64-ppc.h ++5be26b66a180601b8d01ca75a7462819 bfd/po/ja.gmo + 4314f7dc707bdd16e1a3aa6318d52f8a bfd/po/rw.po + fa54ff2e8e918caa819a972852d5d58d bfd/po/uk.po + 01bab36c3c598ef18490b72808da5bf6 bfd/po/pt.po +-6098b3430f49cbbe6b289f2879ff4295 bfd/po/sr.gmo ++1f541d88c9a5a9ab162fd68d3187537a bfd/po/sr.gmo + e19bb962d689621ffdc549c064bda359 bfd/po/hr.po + 2e501eae8e2775bc3326ff506e6ff5b7 bfd/po/ru.po + 8ec07791735823e26b823098b97db3ba bfd/po/Make-in +-b93e7a254347a0c9d0aec92f503f82fe bfd/po/hr.gmo ++84dbf6e05a5a8d4b7b1b82b45673213e bfd/po/hr.gmo + c7515f4b454a1fa630412fa279a3164a bfd/po/id.po +-c4291d2c48fdf616cf5a219bc8dfc79b bfd/po/sv.gmo ++92b363dde95573bd774c4d075a370d6b bfd/po/sv.gmo + 59c606011b4035b5cf62d5182cb78201 bfd/po/fr.po + e92e0c0fdb85a3e07602d6d891f3c9f4 bfd/po/fi.po +-b35e9bdbf39377a1385504db7784d3f3 bfd/po/da.gmo ++e0ea6f92a4d3cff0ba82611c66ba1eb9 bfd/po/da.gmo + 14a6e4ab40cca6e5e4e8844ed1f38f75 bfd/po/bfd.pot +-d94efcf27579278ba3dc959774e52b70 bfd/po/ro.gmo +-1631cbf3c6f4d4a6171d8853ab4731bf bfd/po/fr.gmo +-64efa75ee23e3602dfd95d68b441ae72 bfd/po/es.gmo ++58395b2a0e2f3bb78dc6d29a4a138113 bfd/po/ro.gmo ++09fb9f7d1bc0af455e675be7c3205d23 bfd/po/fr.gmo ++829c286919c3e58f6d3310fb79252b0b bfd/po/es.gmo + 880a5b6d5856b7090209e3c2059ab6a4 bfd/po/SRC-POTFILES.in + 4d37138c8d35849276f5939f27ee211f bfd/po/BLD-POTFILES.in + 81570d19a349cd683436f77a9c8d13cc bfd/po/tr.po +-929c427c3c2c7206201bfe2b978d1f4e bfd/po/pt.gmo ++4b07a1755c5b1ffa7ffb3920329b9676 bfd/po/pt.gmo + 4301533a9f9af510a6519c49094063fe bfd/po/es.po +-17d1078d2cab7c86c24428861d07debc bfd/po/ru.gmo ++efeb1686a8060a17b757200b10433713 bfd/po/ru.gmo + 707a2271e7ae77dc322e9f2977002b3e bfd/po/zh_CN.po + 063bd370058e0656621e835f75f8d0af bfd/po/sv.po + 440d5018fb62b30ff5a819137633e364 bfd/po/ro.po + db9dd4a0b20b67e4ef912c9fd4cda91b bfd/po/vi.po +-6640519b8e1477c4c621e3524c8e320e bfd/po/zh_CN.gmo +-c47c7a53f52ded3368c3bd458b8b7d20 bfd/po/tr.gmo ++e60690926d6036874d5976fb892c5c66 bfd/po/zh_CN.gmo ++0dded802a6d91787da60e29fbb989423 bfd/po/tr.gmo + 0df7e50992986ea8a85eb6baa50bd279 bfd/po/da.po +-3df30e1e39753152d11d44cb2c965da7 bfd/po/vi.gmo ++ab504851491bbb4522d5616ffa37b6ac bfd/po/vi.gmo + 74cb3712e1e8c26eda36a992fefc023f bfd/po/ja.po + f3eef30966ed07605f9fb1d870994247 bfd/po/sr.po +-ed0372f4ddff71fb0e948338cc9d8559 bfd/po/id.gmo +-0ac8b8067067b849aeb810162fa751fa bfd/po/fi.gmo +-e15c998ffa3537ef5f5c5ed225c18279 bfd/po/rw.gmo +-39b1f8159becb3f344c6f465bb1a90ef bfd/po/uk.gmo ++7787d97a62c88c4e64020db70de14831 bfd/po/id.gmo ++27da1f0a8b3615124fe7f2fbdf8e7576 bfd/po/fi.gmo ++3238e488b33e9d3a61c9e1de199d3f21 bfd/po/rw.gmo ++1c86ec269e042f6e633fee9101616d7b bfd/po/uk.gmo + 74d318e6c9031a036336396ca55c2f94 bfd/sysdep.h + e30d31e2f7d2dd02acd540d16092f10e bfd/elf-vxworks.c + 53357a9b87dd158b90cf790c316fd438 bfd/targmatch.sed +@@ -387,7 +387,7 @@ bf2d5c4fdc87152491491ca57d9cd9f6 bfd/cp + 63cee58ce36c8c6ee13db9a793283dab bfd/pe-x86_64.c + 5cdaf80ddb15463873ce74db1d8de3c3 bfd/cpu-iq2000.c + a731b51928032dbaedfd0a07e7911de1 bfd/ecofflink.c +-32f673b9912f23f8f169870860a880ac bfd/elfxx-x86.c ++904f992aa15872764c32812a7c52b82e bfd/elfxx-x86.c + f3448e3780145b5a929cd51003702096 bfd/format.c + 1f1d4395e65db3e5a8172510108c07fc bfd/cpu-dlx.c + 50d9bd8d00e1988a3098aff9a05611a9 bfd/ppcboot.c +@@ -398,13 +398,13 @@ e79a330a15698ebb169fabb216e79c69 bfd/el + 01cb19ee1e561d16867576f1a2df7371 bfd/ChangeLog-2019 + 8a86b1f6c2c976f095834686abe62d6a bfd/elf32-sh.c + b15df15dae52aa50e18d288aa71439f3 bfd/cpu-arc.c +-4e44da7e0159ad4d76903a0ee5654738 bfd/version.h ++d498aad43e56c27ef133a485d40d0c94 bfd/version.h + 139261f84ac4b4777184511e1f46b129 bfd/cpu-nds32.c + 8dc5aeb0b08140c406ff2d793517c060 bfd/elf32-arm.c + 8e4f7bf28f096370e504ffd54cfa2c88 bfd/cpu-or1k.c + 4f8249f21b279414d5bd4f3523fe879d bfd/elf-attrs.c + bbbe3efaa4a09a228bca1920f579fbaf bfd/Makefile.am +-86bbe6f9cdfe71ff65d35665439f50b0 bfd/development.sh ++cf939453b9f0946162f9fea9d9b21ed6 bfd/development.sh + ec44634fc4d286c2f1f62e4f5f389b28 bfd/elfxx-mips.c + 24a910ef275dfe5a3e448941769b57e9 bfd/hppabsd-core.c + f07b547b8a7126d40be9b20682dd2d9a bfd/elf32-arm.h +@@ -515,7 +515,7 @@ f49d7385c4a0a957c0b0efca8a740b8d bfd/el + 60405f6c9c517aec9ef1bee7c063eee3 bfd/elf32-sparc.c + 2e32803c97feaa5d1841e3d628f017ad bfd/cpu-pdp11.c + fbe1741fa4f99e8df34cd3d44d6b6c07 bfd/pc532-mach.c +-36c02509856b2a1d33ac50af49229d97 bfd/dwarf2.c ++de34b3d1ffe56453c28f6c7a219d019e bfd/dwarf2.c + 2beb32b071e84e8f66bfbed4e7e2f076 bfd/i386msdos.c + 92cad294f8003d7641aae98c2a79477b bfd/elf-linker-x86.h + 6a65ceb48b34a21900db602d1fd1ad30 bfd/elf-nacl.h +@@ -548,29 +548,29 @@ bb8e0633e9e073a6899ace1b7f29853e binuti + 70d39762308205274ccd7964fe0d7887 binutils/windres.c + 7520b7c9d5552f2329cb83c9d03936ff binutils/rcparse.y + 28e12eab90e0b79afcc6533cf575ab38 binutils/objcopy.c +-577b1cb2ec5a1081ffc86f110c5a3a72 binutils/doc/elfedit.1 +-6423ae8bd74903a9068ae3f76f8a53a6 binutils/doc/objdump.1 +-80a3a944f539aea707d904c032c5203d binutils/doc/c++filt.1 +-9e0df0192b9e964196a57887dcb4604a binutils/doc/dlltool.1 ++59982f16d440aacec173411282d75702 binutils/doc/elfedit.1 ++6085edee5a66344785bda3620b16dd7b binutils/doc/objdump.1 ++109c4f812174198dbd30e1e9909840a5 binutils/doc/c++filt.1 ++a5503f8cd0d94325c9d06e63ea37fd7f binutils/doc/dlltool.1 + 072910d553f79906db69fa7c0e956bba binutils/doc/fdl.texi + 6e46201b338464eedfe8a48352cd6154 binutils/doc/Makefile.in +-4c9860b1a4b5c5cb08b7b088a19d900e binutils/doc/windmc.1 ++34f6417d467981f4591e2f6a09ee74ae binutils/doc/windmc.1 + ece25e000ad2d0c14d1f42546884a7c2 binutils/doc/ctf.options.texi +-bf01c6363cee338e45b065f5deb5d214 binutils/doc/windres.1 +-e7fced7b9ec0a0f113f5c833319cbb14 binutils/doc/binutils.info +-5d11d2b8fd35ce89674b917968c3c971 binutils/doc/ar.1 +-381ae708c14f2d65ddf7a1aacf8fc453 binutils/doc/strings.1 +-b2b33828aa03c985dd0ab0a7c86c8115 binutils/doc/ranlib.1 +-f73fa7a0e7334fd3ff386b3ecefc5da4 binutils/doc/cxxfilt.man +-7279281cfb85ebdb9628cf82e43a4b02 binutils/doc/size.1 ++06457b4533de4b032dcea1a844f76652 binutils/doc/windres.1 ++de6bc03c99784329b6a70745c757fd51 binutils/doc/binutils.info ++a4e4e6b4b30b0e16b947e162735b5a18 binutils/doc/ar.1 ++e124e79724d4ec0a0e8c38e51d3f09c0 binutils/doc/strings.1 ++10fba11bd5ce78764a7c9a0118756b6d binutils/doc/ranlib.1 ++202beb71ac7ab9d6dbdcc92f45106447 binutils/doc/cxxfilt.man ++b4007c5361331549d5f39c180e981f98 binutils/doc/size.1 + df8d1239fd79b3a1ae7dec03bed867e6 binutils/doc/binutils.texi + ab620229ecbac004c9ae21fa72bb9174 binutils/doc/Makefile.am +-b5a6e37518f73d9d1e702d81a9a9630b binutils/doc/nm.1 +-51f6a0af55072edc7bd1fc9a0d27f02a binutils/doc/addr2line.1 ++fa6c63577c55ee005ade13ecbcb5f4ce binutils/doc/nm.1 ++7d8c1ca43aa8d20abdcd66f71375204b binutils/doc/addr2line.1 + ed3fba7d5d6004d73589dce36ef0ac5d binutils/doc/debug.options.texi +-788073630065b2ad94990dca1b2c99d1 binutils/doc/objcopy.1 +-f62e31ad263342fb0c791897ee190ccf binutils/doc/readelf.1 +-76708ee156f9bdb69192bd5ae221e853 binutils/doc/strip.1 ++836fc7b23c6353ce9f40aa50689509c3 binutils/doc/objcopy.1 ++89aeb1a99f8eec811196d5707351711c binutils/doc/readelf.1 ++607ea2b942b583a03bb0050de50f19ce binutils/doc/strip.1 + fd98930deadd4b8bb2bf20924379fd06 binutils/maybe-strip.c + 7eb542599a0e75f28f7ac0c7832ec377 binutils/maybe-ranlib.c + cec602aa7e8925e06a658a3060d42c1b binutils/dep-in.sed +@@ -587,14 +587,14 @@ af265e948dab6b60dfa3d8965b5cc4fb binuti + 1d4a2cc8591172ff0885e7ec748618e9 binutils/deflex.c + f4806cb0d9ab955f5424565396a06227 binutils/unwind-ia64.c + 7bb26fe65eb83fe83cd3e051a6cbf192 binutils/budbg.h +-b4c7516471c5b7db9a5c2d29e84d8fea binutils/readelf.c ++006664443d1983a196e229d3045dd495 binutils/readelf.c + 4dd4f6db448208624501492aaaa8ab38 binutils/ChangeLog-0203 + 722bca08c2dbe3335e73c37baf88dd17 binutils/configure.com + b69ac95c338b86a08f25ee898c7cc7a4 binutils/ar.c + 9795f6d5f345111725ca75c060048683 binutils/elfedit.c + b78241984e0ecd85c2b64830df4c1ac7 binutils/winduni.c + 6e7aa58a273fd387649ff520828db294 binutils/windres.h +-0e8e18ae319c9d58a9c0d43ca0b60ca7 binutils/mcparse.c ++fc005e530d120da26e310592e4234999 binutils/mcparse.c + 27c5edb4c8f28c1e5ce680ecac6b78ce binutils/syslex_wrap.c + 9c44885be8d8185729ba6b7e881a195a binutils/objdump.h + 98af242e7090e2d4dca91e66d7d17e5a binutils/configure +@@ -624,9 +624,9 @@ b2e8d70c0c37962459c50f29ce6b9b85 binuti + 74db9cc9994ada7aedd808bb1b557562 binutils/emul_aix.c + 9607c99b2cc38f0c5b37c037449ab001 binutils/binemul.h + a5bd2fda981f1c341aa4723ea0bb7430 binutils/ChangeLog-2014 +-4fc0c429ebf6ca4a0db667147d4f95f4 binutils/ChangeLog ++ef7fd87f7f9a16b47ec4e4891ea2577f binutils/ChangeLog + 81f74beea5680160602e72f1bbbbf124 binutils/ChangeLog-2007 +-b3317782e008d83297d95e1c3e1aef6d binutils/sysinfo.h ++2a0ee027afbe9cf58cfa30e6f90b3ea3 binutils/sysinfo.h + 263e0ab4e30561aafb3f2e25a9d1d809 binutils/resbin.c + b583add834431cc44b5c67fac2c4d00e binutils/.gitignore + 056322425e9c65f084b74eb3ed872cd7 binutils/ChangeLog-2016 +@@ -636,56 +636,56 @@ bd3e8623ab04acb8402bb78d9a315289 binuti + 1d0817c53fe63734eef5c4d4cde4cdb9 binutils/dlltool.c + d94adb49274237435ace5b181eb90577 binutils/objdump.c + 0d6f8b380bda80a0df1a587a79990ecd binutils/MAINTAINERS +-186cd06d2adda90d35d5be562ccd7da6 binutils/po/ja.gmo ++4d04128be92f233b3c32afc365b08106 binutils/po/ja.gmo + 983ad2a28db3de55195aeb8680aff682 binutils/po/rw.po + a52519e317c45724a51e081179d3e521 binutils/po/uk.po + 4dd9bff50d2888f1ef536bf5c8c5621c binutils/po/it.po + a4be6f5c911091b0bc7aaa7af27fc677 binutils/po/pt.po +-93757dc903601f7738b696d242ecfc1a binutils/po/sr.gmo ++f7814c76bb9baa9e355519b2f63bbe63 binutils/po/sr.gmo + 634c33feed2dc9f83ce459ff0b0f5048 binutils/po/hr.po + 417ec3c5333cdff82f48ebe9503a14bc binutils/po/ru.po + 4438b95a4344144658f227bc2fd6865f binutils/po/Make-in +-58222a5e48cce1e874b36f7bf0f6acbe binutils/po/hr.gmo ++ae1d0c3aa2dd1f6a274e7b8a126edec6 binutils/po/hr.gmo + 686ac3bb430bd42e5d93ea5e55ba4b84 binutils/po/id.po +-8c6d82747294550465c0ca4c2a1c24f3 binutils/po/sv.gmo ++c8bf5d5b12aa58faaff69d2c3a56d1c1 binutils/po/sv.gmo + b348b88d2c650a0876183058593f1a10 binutils/po/binutils.pot + 0b033dfa32116abfe4f0d197eda3a9db binutils/po/fr.po + 30cd4e294c6a4eca76adb7471423f920 binutils/po/zh_TW.po + c46e1a34c8c6f01ef12991a49a5dfc88 binutils/po/fi.po +-90ff17c11d14805aecc1af8b58e2ba7e binutils/po/da.gmo +-5fb5eb218117d98344ea7681e7cfdfcd binutils/po/ro.gmo +-b3ef11d1e15f60b6726438f933661fae binutils/po/zh_TW.gmo +-a9c6e8347b3454a86eecc33f8141efd6 binutils/po/fr.gmo +-ec23acf43ce5bb40dd4376c83f4cd639 binutils/po/sk.gmo ++faa4320755b89f1464370e6a4e35d33f binutils/po/da.gmo ++68e27b0b0489642440947a0ccee94407 binutils/po/ro.gmo ++9782f7a3f719dff076818197b3c08f8b binutils/po/zh_TW.gmo ++7fed04b8820f0666dc9fdb3ff24b3b04 binutils/po/fr.gmo ++6b331db396c007b1080b6ec20d8266ea binutils/po/sk.gmo + 6c4c3dffb0d8ea881ca8052980c11688 binutils/po/POTFILES.in +-c04b6d081e6a3d72b8c55eaba7a23139 binutils/po/es.gmo ++2e8135fe781051400821ccde74c9b586 binutils/po/es.gmo + 0b00611becfeda2eb73fa936e9ee844b binutils/po/tr.po +-b4484bdcea1b762a8d65eb7a78b8404e binutils/po/pt.gmo ++ac1a09190d23b11c7a2b4f2057250b28 binutils/po/pt.gmo + bf982649dad79583e36042d4464afbec binutils/po/es.po + 1ca7ae6a67ebe6758df04084901c3879 binutils/po/sk.po +-37f3e5ffaa4080403227113998fec7f5 binutils/po/ru.gmo ++e57691630acda93afb93984de2c62a1b binutils/po/ru.gmo + 548d6b187264825e3164e2e805fdc495 binutils/po/zh_CN.po + 94c75ce158a50821caf43921e4210893 binutils/po/sv.po +-88604a3a8c25970615074f95f7bcebcc binutils/po/bg.gmo ++b48f64f5e0e652d29a85a76639ca7628 binutils/po/bg.gmo + d7eafbe0ac75d514bb2f1f06d49a46b9 binutils/po/ca.po + cb9d497be79788b6a9d86519b27f0740 binutils/po/ro.po + 71751b7c19354033927dd5cc0a846ce1 binutils/po/vi.po +-763150e6529398f9712177659a7f79b0 binutils/po/zh_CN.gmo +-6792c4c39624630611f7fd5ea7e380d9 binutils/po/tr.gmo ++ad061d3e974caf6bea6f7a50022b6ced binutils/po/zh_CN.gmo ++2973983f6a78f905cc917f10bceaa1ec binutils/po/tr.gmo + 402bf740ac7b127ea9d9ee38cdde6048 binutils/po/da.po +-cc1cc8491ddb4dbedb8ba7b7e2b30425 binutils/po/ca.gmo +-0cb7f5b9788b737fe1cef25d1bd7bffb binutils/po/it.gmo +-72e6cedf6d0c43d854a232d7eb01ea22 binutils/po/vi.gmo ++6f244f74f1f99ccc62ff8662a4e560e9 binutils/po/ca.gmo ++d44f9c879189c7867a4303fbf8599e4d binutils/po/it.gmo ++f08a24966ab6cfe475c818cffa65d061 binutils/po/vi.gmo + c2897ad2d8fbaa18f6326267c8f9f012 binutils/po/bg.po + 110599acfb3d5e2ab27e2ca4d67293b2 binutils/po/ja.po + 9d9fb1a014da7dd817f789f0dada2fc1 binutils/po/sr.po +-b679497b5e036ff25ab79ead2c6f7bb7 binutils/po/id.gmo +-b9ce7a2ff6ea38633ef48599473a42b8 binutils/po/fi.gmo +-574d299b75e61be9de2b50beda9a138a binutils/po/rw.gmo +-f6e23daea5b99afa9c4714dc97bf35e3 binutils/po/uk.gmo ++8f6551bacd00e603caceb2d019fd053c binutils/po/id.gmo ++86672ed6d386afa4dbf18172c47e55e8 binutils/po/fi.gmo ++46f8d6531f6b59d702f6e3f121387cb8 binutils/po/rw.gmo ++abae6561360671da11232fed68b9004a binutils/po/uk.gmo + 8ea125ea159a54a27f72f5cc1b2d7eaf binutils/sysdep.h + 74dc92b55cb859b48b3a0b820a7d1088 binutils/od-macho.c +-0ebee93791976fdc26e3937c6e2eb750 binutils/rcparse.c ++810a8d9e06e031077a13afaf2b7aba12 binutils/rcparse.c + 4c32e4e3e1eb21d4707d7143a9d6253f binutils/arlex.c + d49e51790624ee47da3da222902865d2 binutils/prdbg.c + 098bf16d44bcf26d0f3575b14c666edc binutils/syslex.c +@@ -907,7 +907,7 @@ aeaf1497f45c5bc3a770a4b66da07aa0 binuti + 7190c5c0a85c55584f19290d0ebeca9f binutils/testsuite/binutils-all/remove-relocs-08.d + fb277b3ae83d69880e62b21b89dd9ea6 binutils/testsuite/binutils-all/pr26160.dwp.bz2 + 1d96cb4b074018ab36084fd8fd15ba60 binutils/testsuite/binutils-all/group-6.d +-ed4ed18cf76838b8850ab0a965180bc8 binutils/testsuite/binutils-all/dw5.W ++7e499619c27c828e97110132e180c939 binutils/testsuite/binutils-all/dw5.W + d91ecc8b2ba6965842cf206d8144c3e1 binutils/testsuite/binutils-all/hppa/freg.s + 72764cc830e4e01ee9406281eab93969 binutils/testsuite/binutils-all/hppa/objdump.exp + 8e5c9079f46f332db8bbe679b64c878b binutils/testsuite/binutils-all/hppa/addendbug.s +@@ -966,7 +966,7 @@ b965b7172b99a74d32803b165e72bde5 binuti + bb964b923ff47fb47d58f74927120d8d binutils/testsuite/binutils-all/x86-64/ibt.d + b12f29209d85ee87b16c1ea911d358f9 binutils/testsuite/binutils-all/x86-64/pr21231a.s + efbff9bd8ca2ed489e011ab1a4ead1ff binutils/testsuite/binutils-all/x86-64/ibt-x32.d +-a8b4f9fc705fd01861b55a3fde53b479 binutils/testsuite/binutils-all/x86-64/x86-64.exp ++6cc659eeb08ad313b7981bf258d35fe5 binutils/testsuite/binutils-all/x86-64/x86-64.exp + 17490625f3c9194d05e01a2a49eb1c24 binutils/testsuite/binutils-all/x86-64/shstk.s + 26e8c726574ca7c27295b95bb100f8ba binutils/testsuite/binutils-all/x86-64/pr23494b.s + 3bb58eec4ae7e0bbea1d4c2cbfcd811f binutils/testsuite/binutils-all/x86-64/pr23494e-x32.d +@@ -975,6 +975,7 @@ a73b38bd54eda6b5dd6d18cc9735e3d1 binuti + bf80891dbbb50b6f75720def7c9ea2c0 binutils/testsuite/binutils-all/x86-64/pr23494a-x32.d + 6e1daacf44906764445efa5a40cfd89a binutils/testsuite/binutils-all/x86-64/pr23494a.s + b74857751e61745e2a6e2d2ad9623b41 binutils/testsuite/binutils-all/x86-64/empty.d ++fb277b3ae83d69880e62b21b89dd9ea6 binutils/testsuite/binutils-all/x86-64/pr26808.dwp.bz2 + 21e7a71f6ea97ec88fcf11c557d92393 binutils/testsuite/binutils-all/x86-64/pr23494c-x32.d + 94a8aaf7aa28ba0fabaf3edd5a04b7fc binutils/testsuite/binutils-all/x86-64/pr21231b.d + d21d3ee45ae633b4d6d4f9fe2646da28 binutils/testsuite/binutils-all/x86-64/pr23494b-x32.d +@@ -988,6 +989,7 @@ c48fe6e6ba1f75b0d1135088943b7c0e binuti + d188ecc684708929e15751940abce4ff binutils/testsuite/binutils-all/x86-64/pr23494d-x32.d + a0d3caba44bd9aa7bd07025e2c799b07 binutils/testsuite/binutils-all/x86-64/compressed-1a.d + c47003a15742b4879472f5bed8ffb530 binutils/testsuite/binutils-all/x86-64/pr23494a.d ++3d58b6c0241a16993a7e7f2e1e6966d4 binutils/testsuite/binutils-all/x86-64/pr26808.dump + bbf1d9c7617f35e4e831f247514cc946 binutils/testsuite/binutils-all/x86-64/pr21231b.s + c4c316578d940e90c34d18fd6084b52e binutils/testsuite/binutils-all/x86-64/pr23494c.d + 5b9686bb57a2b76585708e70d28b5706 binutils/testsuite/binutils-all/x86-64/empty-x32.d +@@ -1137,7 +1139,7 @@ d41d8cd98f00b204e9800998ecf8427e binuti + 92c42c1dd7d9cf476496ecf76442f216 binutils/testsuite/binutils-all/pr26112.o.bz2 + 7043daad3006d23ac1b2718b624df374 binutils/testsuite/binutils-all/strip-10.d + 0483f0e2f7f5bb565ab5a47506d9ef98 binutils/testsuite/binutils-all/cxxfilt.exp +-6b281dd900e053bf226dd50530fcd198 binutils/testsuite/binutils-all/dwarf-attributes.W ++9f926377eb4e94be971701fcc79cd92e binutils/testsuite/binutils-all/dwarf-attributes.W + bb2476b8d18058db2a178ea61c50d4b4 binutils/testsuite/binutils-all/pr19547.c + e36dde2922c493422341c9d5ee07b6ef binutils/testsuite/binutils-all/group-6.s + 8a6214b0181ec4a73a402e359daf9034 binutils/testsuite/binutils-all/copytest.s +@@ -1161,9 +1163,9 @@ bc92bbb251f116df5c1190b423f87b70 binuti + 45169d51be32d65706d7524a35b56a04 binutils/testsuite/ChangeLog-1215 + bf0ea0640752ce55976e88633c107ad4 binutils/testsuite/ChangeLog-9303 + 7779fe8954505ef8ef89098b15fa7e78 binutils/emul_vanilla.c +-8afeef4b7ab482266658e292297ac0fe binutils/dwarf.c +-4bb796e237a246c0ebb031f5d05e46d2 binutils/defparse.h +-73cd0da87569a91dac596ec6c645c70c binutils/mcparse.h ++2531993591269b9ff27aea59e487af02 binutils/dwarf.c ++58b27a7af7f846e8f380200aaefcd77f binutils/defparse.h ++739a18767805f98027e022dabf72294d binutils/mcparse.h + ab51c221a30bcc7852b4507f5fcbc6bc binutils/syslex.l + 168de50c2518c247172888657685b237 binutils/ChangeLog-2019 + e3346b0a6170844db3923ffbc0f60d6e binutils/is-strip.c +@@ -1178,7 +1180,7 @@ f2787034243454189e968d9020d6ed21 binuti + 09d7d1d96313e23a18687924c5c9c0b5 binutils/strings.c + 9f4fd5c98c4c74790fcdc199fec1d2ac binutils/debug.h + 4d3c37042f71ad368800311f624c6e85 binutils/stabs.c +-af43ad7cca85ec700641942e0999a505 binutils/rcparse.h ++6b37ef1a64b8a82f83d92b47a4474f88 binutils/rcparse.h + 1ded054093de910d9786c62bc4fe8cc6 binutils/stamp-h.in + 8d8dec85c95f53aa37b0d072cd7b2d18 binutils/arparse.y + 78ad8f876ee9f38094242d22975024dd binutils/README +@@ -1195,8 +1197,8 @@ b31314081b88b15ab4cc9466bca4897a binuti + afe137178d38202953a705e2ada53497 binutils/mclex.c + c93e0fc3705db6cb3f228cbceed5ccf0 binutils/windmc.c + d0c07c36019028be14a79202b0cc1e10 binutils/not-ranlib.c +-67fd7d6ede3e0355aaed530bbd477d79 binutils/arparse.h +-fdb0c016e7c942818a39611047727d24 binutils/arparse.c ++5797ef0ce0ff2ec4fb9cef393d715b5a binutils/arparse.h ++332a754c52bf7df013605c7ce26741be binutils/arparse.c + 1552ccacb4372931a480c687c220da41 binutils/od-elf32_avr.c + 297866da96316fa83c128406745fa6e9 binutils/rename.c + 33f36b9627a3805d522ec97b58a2bbcd binutils/NEWS +@@ -1209,8 +1211,8 @@ b3779dd97d057fe75136b9df0fb75218 binuti + c23acdb46ec8a2c600160835b1c7d858 binutils/defparse.y + 5f7af231d9ff88f0bc687eda9cd24e98 binutils/ChangeLog-2006 + 357f991c42deead68fd26d62c7b50f7e binutils/coffgrok.c +-8595fbbb67de468a1eca742b8aa43331 binutils/sysinfo.c +-838fd4762b0e7f34dc1eb1b49d35b036 binutils/defparse.c ++68d12e097806907103b1441da35c0ab9 binutils/sysinfo.c ++432b1ab521fadd280064148fc3ebc7e3 binutils/defparse.c + 500b9244caa7a7ab23ece1db37efa76d compile + e32906a3177f3b368bcd56f9e86a620c config/inttypes-pri.m4 + 612f740b46be9896cc7c4c14c03b5c4e config/mt-sde +@@ -1375,14 +1377,14 @@ eed39a6c83a0f350dfcf61c0c709249d cpu/fr + b069580bb18b8056bda3e816b144946b elfcpp/s390.h + da5ffa974c4076e2630933acbfa47540 elfcpp/tilegx.h + f4150289298e3ee2a8e88a8aaf914c6b elfcpp/ChangeLog-2017 +-6ec0f6c5d0611299af38e15b29e9c22d elfcpp/ChangeLog ++fee36e7cb1ee5feb353bbd106835326f elfcpp/ChangeLog + 32c2421a9cf0c70c6bf92e11d3f2772c elfcpp/i386.h + 8e7942097a4f092f856f23b00b530426 elfcpp/ChangeLog-2016 + 67f37d8b639a626019e8fda2a7b24280 elfcpp/ChangeLog-2019 + 59c9001e9fc4519443e0f6ef7fdab6aa elfcpp/elfcpp_internal.h + 8cb05e66a622b505e89dbca49abc52ae elfcpp/x86_64.h + efd3312aae953b098f9c608e01aba412 elfcpp/README +-0c58656072e547f25a4d5b9e92605be7 elfcpp/dwarf.h ++0f5459cf2ad81618f528b41985bd56a3 elfcpp/dwarf.h + 55ef4482037ec0bf95e978ed856163cc elfcpp/ChangeLog-2018 + 5bc9fd3238efa15ec8dc1b6ee5f440b8 elfcpp/elfcpp.h + 06459ea1bcfc10ed8b273600c39573ca elfcpp/elfcpp_file.h +@@ -1394,7 +1396,7 @@ efd3312aae953b098f9c608e01aba412 elfcpp + eaac0cdd8ac2b8c31194798a65896321 etc/Makefile.in + 4efa33cb728b66212af816a01e13d389 etc/ChangeLog + 48803ea66a5aa68af0c6f226395ddb42 etc/configure.in +-e07c730ccb4e8f8aa2a7f70894e7cebb gas/itbl-parse.h ++a23f7dfc772c95e4b913f0689422e459 gas/itbl-parse.h + 4d66333cf67411cdf72c877260e32494 gas/itbl-ops.c + 0dab8bd3852957a6955b28d42179a880 gas/ecoff.c + 365117e834c8bfb83ed025b270aaf4d0 gas/expr.c +@@ -1410,7 +1412,7 @@ f5079fd454b40033e689a3b9aa51de3d gas/do + 004872abc44a6ba29837a5c3ef6f119e gas/doc/c-cr16.texi + cd8225068dc98bc36d91ea607b5d6fa4 gas/doc/all.texi + 32297dabffa8f5a3cfeb8332036d3f53 gas/doc/c-microblaze.texi +-a201d7976ae682d38c76f6c9bfa56a8c gas/doc/c-arm.texi ++e74aa02fb0a2843a8c5a533f153c2d3d gas/doc/c-arm.texi + d545849a6c4ac7e66d13120b903934a8 gas/doc/c-vax.texi + ddf0b4dc6758ed5749976e75c0c5d090 gas/doc/c-m32r.texi + 27b2e92d73974b22ddc791fdcd07810a gas/doc/c-rx.texi +@@ -1436,7 +1438,7 @@ d08a2ca4dba2ffbbc39ce64f47a73eaa gas/do + 032ba9612a3ba821c593ad908c1e3954 gas/doc/c-ns32k.texi + 8fe1f50b805a13233bc435eee4bb0fd4 gas/doc/c-z8k.texi + 4c063d9616b6e09c65538f34a15856e6 gas/doc/c-tilegx.texi +-3b48b8970d8f85dfa671f87f2b203e92 gas/doc/as.1 ++94035ab6dec9845541b4b0de0441dc41 gas/doc/as.1 + 56ca3d78e4eaa13e9cf9b86e2b4e2d3d gas/doc/c-cris.texi + 992647b41df77390518a4d31dfd3fb69 gas/doc/c-pj.texi + f4593f53845c85cdbae0b302ee61f853 gas/doc/c-xgate.texi +@@ -1450,7 +1452,7 @@ ac5c3dcab453321f45cfde7457ce94fa gas/do + cd17540ee99679aeb1e0057904320554 gas/doc/c-alpha.texi + 5b4ea5dbb79dd41ee144b8c1130f53d9 gas/doc/c-z80.texi + e2ea5bf28ebee458be1616ea1abf1449 gas/doc/c-pru.texi +-81495b1ccdf495c203bf0107ee6c3673 gas/doc/as.info ++4a3aef6c52fe64139bbc444f351806a5 gas/doc/as.info + 65a6e44031693a9ed862119bbc033a27 gas/doc/c-visium.texi + 25ceac69670d6090e2df939b27a32727 gas/doc/c-s390.texi + fdce41a9df48afb9dac7fbfa48b5398b gas/doc/c-mt.texi +@@ -1459,7 +1461,7 @@ d194759e2334bb87cde60aff68f9270e gas/do + b74cc68feec84c819054560a42534ad2 gas/doc/c-or1k.texi + cfe1879ee8da5bcd7720a65486acbfb1 gas/doc/c-xtensa.texi + 79944c6528b1da612666e0fd145ccc59 gas/doc/c-metag.texi +-b85d1fdc8677fe8266d8b90d00ee898a gas/doc/c-aarch64.texi ++2ba341e274e9d750c9124808eef0beee gas/doc/c-aarch64.texi + cd8225068dc98bc36d91ea607b5d6fa4 gas/doc/asconfig.texi + 78432571448f6c807c86d9ac08c09d23 gas/doc/c-d30v.texi + 2ae6d5a42db2289165d939a860ae5cc5 gas/doc/c-i386.texi +@@ -1473,10 +1475,10 @@ fc4edcfa433cd831cb19a2fd990fc8a1 gas/do + 3e124a3b9d1cd7d6005a13a1d3ba4e1a gas/flonum-copy.c + 01eb0568b9dd9d6c895a2a6ce976faa2 gas/hash.h + 57ceb0529619f2fad757f61ddb98c0b9 gas/emul.h +-08b666e2f6cddf6e90febeb7d8617c08 gas/rl78-parse.h ++419c35f216afccaf7a95f0013ab92b78 gas/rl78-parse.h + dbea40b82d6c91ea62f18dc527b31a6a gas/itbl-lex.l + f2b5e2e589544ba614b907daed41600d gas/itbl-parse.y +-dc9ee874db8b0a1ded65b9d05cedf89d gas/itbl-parse.c ++459cf5d188a8bfd21be1cec6c56536cd gas/itbl-parse.c + f50eceed50514d40ef7a08ca2166e7b7 gas/makefile.vms + 453efb26cfc42c358866e007bf966a2d gas/ChangeLog-2008 + d32239bcb673463ab874e80d47fae504 gas/COPYING +@@ -1489,12 +1491,12 @@ e804d1dd3f2da531bdaa1d34df072daf gas/wr + 049cc6bd7fdf32fee2c4359cb1f43817 gas/itbl-lex.c + f1ca5c5da2255df11f9ff2e72840dd98 gas/CONTRIBUTORS + 3e1cb714a3280bde9f1a8aeb6becd4ee gas/macro.c +-1f51a756ec0500143628ac367a7b2aba gas/rl78-parse.c ++c60c75c9522fbf23c32e9827e0861115 gas/rl78-parse.c + efa00be218d044fb28e6c9147b85c63a gas/frags.c + bba211c420ad3256dff78d7b5e840dd8 gas/bfin-lex.c + 0b843d36c3ab4084d85ab886463d9da6 gas/depend.c + f56cca756cd8d6c99afc4f8d8443b842 gas/sb.h +-728064e5ef9a3a16e216db45d66692f4 gas/bfin-parse.c ++8b23a97ecc93885cb4bdf156318fb517 gas/bfin-parse.c + be7051b818a2e49d3545f9cdd51b14bc gas/configure + da9fbfd7ecabc4ef023a26c015d5d0e1 gas/ChangeLog-2011 + b90f61e8af5fe0b96a30dcf17b5346d8 gas/obj.h +@@ -1508,10 +1510,10 @@ c534d8e319454e3e11e5bdbafab66775 gas/Ch + 17a19f3766a8741b96689b1c6bd6e474 gas/ChangeLog-9899 + a1de7b852e1f5c4494e9dde175689dc4 gas/debug.c + 8526d3f350a34bd1413618497346bdf0 gas/read.c +-6ae65aab6612ba06c02f4217ddabff75 gas/dwarf2dbg.c ++6ffbabc709daa49860ff5e7eadcfa34d gas/dwarf2dbg.c + 7b9233dcc235d4ffed1af18314aa37c4 gas/Makefile.in + d8af5f629a8d1c18bef3579ba12a975a gas/input-file.h +-5dd4a8b94d242124f5acde4ebec690c3 gas/rx-parse.h ++eb84305fbb918809bfcd307727cc8168 gas/rx-parse.h + 50c2cf6648f39da8ac596dd3374a3103 gas/ChangeLog-9697 + 311831b942393f3447cf36735568d050 gas/output-file.h + ec0acab83b3befa6f0d1d2caa8326230 gas/asintl.h +@@ -1519,11 +1521,11 @@ ec0acab83b3befa6f0d1d2caa8326230 gas/as + 81cbaa3ff6e6038dd35a130191e0a2e4 gas/bignum.h + d0fa9f6f575c300dbd20ce4d36ab0b6c gas/ChangeLog-9295 + cba211c6e65e333bd2fc8bfdb986e3c0 gas/ChangeLog-2014 +-55a220a9c15716a2b5a68b91b24d4fc0 gas/ChangeLog ++5451cdee60d057464af751e515459867 gas/ChangeLog + d4dc91ce0173990d41130c7970c68214 gas/ChangeLog-2007 + 9a1294b8181876b5cfc1fa32773afeba gas/config/te-go32.h + d19ddb11e495a0013361478100ee3d89 gas/config/tc-msp430.h +-d25df0d33f242acb9fc1f499f4d1bc8a gas/config/tc-i386.c ++6244a545b9ee311c2f02c7c0d9a73176 gas/config/tc-i386.c + 72e02ea9799ce87196c7270168e4b2f2 gas/config/tc-ns32k.c + 1ce722f76dd40ef4e3ff54639f498490 gas/config/obj-coff-seh.c + 3092faf1ed231931a6356ab05609cac4 gas/config/tc-tic6x.c +@@ -1550,7 +1552,7 @@ c81c7d6389dd510114238bf4c4414bf8 gas/co + ab1590248c7bcfa93276603f019ea421 gas/config/vax-inst.h + 3b37a73e63f2b898e70c4ef1db091443 gas/config/tc-i386-intel.c + 7646590421ecfc86135d54f1dd1c6d0b gas/config/te-generic.h +-fb97b8aaada20fec287c6c0d7ec5040a gas/config/tc-ppc.c ++edb899a546fdd26b80abc1765e7012dd gas/config/tc-ppc.c + deca78961af1439bcebd723eedeb0055 gas/config/atof-vax.c + 02b33dd47074537cb87d67beba4030ad gas/config/e-i386coff.c + fcc0ce4075b2070d00d8658fe4f9f3ce gas/config/tc-sparc.c +@@ -1596,7 +1598,7 @@ fc6bf0306a0edc4aeaa948f2209a154f gas/co + e82cb21045a376e5658f8326160c1c1e gas/config/te-csky_abiv1.h + faf0a5614b81d67780df9a668b1164af gas/config/obj-som.h + baabc627b45d672b97abeb91e7d70290 gas/config/tc-pj.c +-8a3c7ab30c8d41141f2f5b4da2f5c689 gas/config/tc-arm.c ++b17d00ae6f5437e18e0fb645c4748132 gas/config/tc-arm.c + 0b1de19b9f54e7aa185781f45b369f06 gas/config/tc-tic4x.c + b34aaf4efc20b985585253380a6f2998 gas/config/obj-evax.c + 5fd0be0c9e9e02c9a9cfd34d265b2359 gas/config/te-lynx.h +@@ -1604,7 +1606,7 @@ b34aaf4efc20b985585253380a6f2998 gas/co + 30a29bf56cbca1a012e1a3c7d226dd5d gas/config/tc-v850.h + ef4ab58111e777fb6f2d138f426f8054 gas/config/tc-spu.c + 20d03bdd368423ccb171ed253c355116 gas/config/tc-mn10300.h +-5403ad16a92e754a26a33d4c792ecdf0 gas/config/tc-aarch64.c ++94e67ad34ad778cebfdaa623a646b8fd gas/config/tc-aarch64.c + 343c11ed022f43029ab5386d59ea02c2 gas/config/tc-pdp11.c + 9b352ac84168c39f95dfb121fbb4ab39 gas/config/tc-hppa.h + b2494e05bccb31fbb4d9ff0e5f97984d gas/config/tc-mcore.h +@@ -1765,35 +1767,35 @@ f31d4c8107ed2c8362b338d061dfbfc0 gas/Ch + 830acff75ab64cce9f1e4d80c337bc9a gas/frags.h + c9c5c064a5aca247818ea533d586610a gas/write.h + abe9186aa2b65b000546c8158085dda8 gas/MAINTAINERS +-c16b37056f1c21542b96dcd21793648a gas/po/ja.gmo ++cb2c3bc170dff26a5e6dd54f1cdda674 gas/po/ja.gmo + ecfefd4ef9c04f3bd2e486e73cc878db gas/po/rw.po + 06fc488a9a62c85abfce729e76087cdf gas/po/uk.po + cda6eaa34886a36828de8e3125a2daa9 gas/po/gas.pot + c55f7dc22a89b1801c0643fb57acc56e gas/po/ru.po + 4438b95a4344144658f227bc2fd6865f gas/po/Make-in + a423bc8e7ad0cd65075bf2d02c5489f3 gas/po/id.po +-37b70f456e739968cbe404a4e62f2cc7 gas/po/sv.gmo ++6dcfcf37241fc8a1f778823296077872 gas/po/sv.gmo + c3570b475c624391e84903a52b1d84e6 gas/po/fr.po + b6f755c4f422786669e9a537d026839d gas/po/fi.po +-9f6b211c477db23676f07e8523446dc4 gas/po/fr.gmo ++1f9479282ea6ed6b3a69870ccbce7783 gas/po/fr.gmo + 263702a8b43ca88207364322de002013 gas/po/POTFILES.in +-27b868a16efc71b47aa11c13caffba05 gas/po/es.gmo ++53a30bde3d0eaec02bdd8f60352dffc1 gas/po/es.gmo + 500c0589d1e9792fa3ed93b44a2bcc38 gas/po/tr.po + 1065383f59b49c7f18fe7d22b8134a6f gas/po/es.po +-fba0daf8038e64c2ccc2e7e9077f4602 gas/po/ru.gmo ++11b030fba72943cff263e37fe50df3a4 gas/po/ru.gmo + e8c548ee4d5f6b9a5cd6212359c38926 gas/po/zh_CN.po + a99cebdd932dfcb71ced344b13b9250c gas/po/sv.po +-4fcf5ebf03f06ef0e726d1fc8a95a8c0 gas/po/zh_CN.gmo +-d753ac1595c48fc2380c5837eca0f1bd gas/po/tr.gmo ++94ba369fb02f9323f30dbf628c3a89a1 gas/po/zh_CN.gmo ++268c5730abcb913f5b0b5438744e040f gas/po/tr.gmo + bbb7a74712101fd9a38bbebd15a3e219 gas/po/ja.po +-6ae02d09f082dcfee441c953764c8ae7 gas/po/id.gmo +-0b88d1de88bc447bae2d554aa5b7094c gas/po/fi.gmo +-3e890a0b3ab0fdf3474873d5627b21f4 gas/po/rw.gmo +-1389f821dcfa112612a1c0cc6214855e gas/po/uk.gmo ++ff54dee8b8ad1738932875c812828fd1 gas/po/id.gmo ++9f4afdc6b89624eeec67c8289c5cae45 gas/po/fi.gmo ++56207976a7d4d8d86e6ea14d8bbc64c4 gas/po/rw.gmo ++c9566657a125662a8e366dd05cd12d51 gas/po/uk.gmo + eda67849d846299781a40ae29eab9a7d gas/dw2gencfi.c + ae2f57545b6c7ce4a91fb749513ac6a1 gas/gdbinit.in + 24355282dde559ca65cd0e83bb77d7d9 gas/configure.tgt +-7c7c3e6e3a7669ef374d9aea5b235870 gas/rx-parse.c ++f2cd27a76933bfc460dad43468cf12fd gas/rx-parse.c + d669a0b71b5e695f0cadc7801c2af32f gas/remap.c + 5725f8e58e03bd6026f3e2721e1db22e gas/testsuite/lib/doboth + aad4965bf0067bf9fb71acc19f7877d4 gas/testsuite/lib/dostriptest +@@ -1914,7 +1916,7 @@ dfb4ddccf0f2e18e9d768b5b367de607 gas/te + 1430edc46a12ca363eafb2d0ea6f94b1 gas/testsuite/gas/i386/x86-64-sse-noavx.d + 833f164bd60a9f7c4db8ccf2b0bf711b gas/testsuite/gas/i386/sub.s + 037a982a9866a71bffadd1cb8870e467 gas/testsuite/gas/i386/intel-intel.d +-ff4aa65f1d7ec184096e4b0953fc204e gas/testsuite/gas/i386/x86-64-movdir.d ++6ca8e373b2750fdb58aec19449a27e78 gas/testsuite/gas/i386/x86-64-movdir.d + 71a7f25f253d301099ab3390c6be43a8 gas/testsuite/gas/i386/avx512f-opts.s + b66b458374927f587de8154fba02388a gas/testsuite/gas/i386/sib.s + f33adff4ea784a3ff651cece893d0fcc gas/testsuite/gas/i386/x86-64-avx512vnni.d +@@ -2046,7 +2048,8 @@ de0e3c5e1ca51d636ff85a74ff68dce8 gas/te + 139d225422978f9482993c9618fd7771 gas/testsuite/gas/i386/opcode-intel.d + a7240a2530308c3081d3c7bf0e69373e gas/testsuite/gas/i386/align-branch-4b.d + 4a2400eb7c770c68b6ce13d083f4f9c7 gas/testsuite/gas/i386/evex.s +-69993712e46d3b2a43c1913352983df5 gas/testsuite/gas/i386/evex-no-scale-64.d ++5ffe27691cb23e1ae7a24410643cf701 gas/testsuite/gas/i386/dwarf5-line-1.s ++c2f3708be75765a444eb9f60b3e2d412 gas/testsuite/gas/i386/evex-no-scale-64.d + cd3ffcd4ddb3a6b7513cd8c9a10aa4d2 gas/testsuite/gas/i386/property-3.d + 66d58ce78097a5cfe79ef4c6e235e361 gas/testsuite/gas/i386/string-ok.d + beb347373f542e66bff26cd182389897 gas/testsuite/gas/i386/optimize-3.s +@@ -2085,7 +2088,7 @@ e4b76af1ea9407ab6065adb42a4bec22 gas/te + 44145eef9a6621dc55ddcc2e390e3fe9 gas/testsuite/gas/i386/x86-64-opcode-bad.d + f29f9513a28ef8d696ca0af8cc813957 gas/testsuite/gas/i386/xmmword.s + d2dc5aa7066ee9f6edcf0eedcfb6da93 gas/testsuite/gas/i386/arch-10-prefetchw.d +-2e9f48a2ad5b4f83939469336dc56541 gas/testsuite/gas/i386/x86-64-enqcmd.s ++50113a3c758d86782cf7fb9c08857bc5 gas/testsuite/gas/i386/x86-64-enqcmd.s + 0f21416e489dae757bb03a5039e498d7 gas/testsuite/gas/i386/note.s + f64e2e3eb041710088b2617351597ed1 gas/testsuite/gas/i386/nop-5.s + c6c586624b1ee4e083a21165381faee7 gas/testsuite/gas/i386/noreg16.s +@@ -2123,7 +2126,7 @@ b83a2a0dbc42d7719c1f3773e5ece505 gas/te + d31e3c7bba73a74cc501402dfef3dc36 gas/testsuite/gas/i386/mixed-mode-reloc64.d + 459f6ab7a20572ce7bdf1640f7a6d6e6 gas/testsuite/gas/i386/avx512f_vl-wig1.d + a9200dd240e905e5dc74412527dc53b5 gas/testsuite/gas/i386/nops-5-i686.d +-b220126976f2a62df218bcb12a4e936a gas/testsuite/gas/i386/enqcmd-intel.d ++c0e33dab8414e93d37cd5916a1a496fc gas/testsuite/gas/i386/enqcmd-intel.d + 12f4d57eb3aeae85595763edafcbf4c4 gas/testsuite/gas/i386/x86-64-opcode-inval.s + 3bd5653695ef596e217e4e329f9ea8a8 gas/testsuite/gas/i386/x86-64-cet.d + d862c5bae3dc447ab40558f2bad4e6af gas/testsuite/gas/i386/x86-64-avx512f.d +@@ -2162,6 +2165,7 @@ ae2e0be16100f21dd7ca822d5d462e4a gas/te + c34551101e7ece3349e3242ee99fd65d gas/testsuite/gas/i386/noreg32.d + 7fb60c5abc1ef97894fe2d2f00c4298e gas/testsuite/gas/i386/x86-64-vex-lig-2.s + 40d683aa3ff76710f84cae0515965bf8 gas/testsuite/gas/i386/lfence-indbr.s ++20fd289b12267b5af566534036bb3de3 gas/testsuite/gas/i386/enqcmd-16bit.d + 54446b50504fde224122eaf7b8d14541 gas/testsuite/gas/i386/nops-2-i386.d + d30362e560f958fcb8809cd0f852b5aa gas/testsuite/gas/i386/avx512f.d + 6f2ae67812fe7716eb0da2c0ae3d12e0 gas/testsuite/gas/i386/size-4.s +@@ -2262,7 +2266,7 @@ c10822c38c0829d874e2ab8397c27c4c gas/te + 20903d8325b815f0461390b937a9ba02 gas/testsuite/gas/i386/x86-64-avx512_bf16_vl-inval.l + e8537191267ee9bfbbac049f1cf49850 gas/testsuite/gas/i386/x86-64-movsxd-intel64-intel.d + 077c9a5674131e1096ac5283e74a3657 gas/testsuite/gas/i386/avx512dq_vl.s +-0c6a6683f23887d5dcebe5f8a3f3b309 gas/testsuite/gas/i386/x86-64-enqcmd-intel.d ++518f653784399cd7f70138d1ac299b87 gas/testsuite/gas/i386/x86-64-enqcmd-intel.d + 09eb75575fe2158c1634100977167f15 gas/testsuite/gas/i386/x86-64-bmi2-intel.d + a21bb60d13f0f586b34c2d33c22942bb gas/testsuite/gas/i386/svme.d + 2a069b87359bb962df261b870b939b15 gas/testsuite/gas/i386/pcrel.s +@@ -2281,6 +2285,7 @@ ff4d903a42033b26ae8adf16af7ebb3b gas/te + 9e14a1b044d5ab4cadce1af8beaff84e gas/testsuite/gas/i386/x86-64-sib.s + b428f159989c04423fe126d08b109759 gas/testsuite/gas/i386/avx-scalar.d + 91156d4794530a60c72bd58f418a39b9 gas/testsuite/gas/i386/ptwrite-intel.d ++5ef74e9d0cd31064ebe11e125941b276 gas/testsuite/gas/i386/movdir-16bit.d + 5313e418221d24e63c58d95f87510bee gas/testsuite/gas/i386/x86-64-avx2.d + c040d1a38dd8dbe09d00e99590d09b77 gas/testsuite/gas/i386/relax-5.d + 1238c946aafa982187b0aba967587e9e gas/testsuite/gas/i386/nosse-2.s +@@ -2452,7 +2457,7 @@ f6d03c31b8442742692d009caea2c832 gas/te + e053ce2a4cdd8ee9106171c595313633 gas/testsuite/gas/i386/x86-64-avx512cd_vl.d + 870989709e8bb3e3f83ba82b0fee20de gas/testsuite/gas/i386/x86-64-branch-2.s + 91d2ea9440a46cb062ca127ae0892e9a gas/testsuite/gas/i386/noavx512-1.l +-a4b9a994f86ba83d2608409b21be58aa gas/testsuite/gas/i386/movdir-intel.d ++008eb1a6ea316799dcca86bd8a7533e2 gas/testsuite/gas/i386/movdir-intel.d + eef344a4086f99e8fc8e5d09cc7701d6 gas/testsuite/gas/i386/relax-4.d + 8c09cea912742744d023e341487caa2c gas/testsuite/gas/i386/x86-64-mem-intel.d + f23e19801029674bf12d2a6cb9473fa0 gas/testsuite/gas/i386/x86-64-stack-intel.d +@@ -2546,7 +2551,7 @@ a749d582613f8a30e046056af23c8d0f gas/te + a00783a8cf658b9312271f4d4c7fcd38 gas/testsuite/gas/i386/x86-64-avx512f_vaes-wig1.d + 0ee50a168a2106487dbe41247ad13f1d gas/testsuite/gas/i386/general.l + 28b97c827f91c80baf7d00777a8723cc gas/testsuite/gas/i386/x86-64-avx512bw-wig1.d +-6ef9d88cbf9120b4dbaf49f88da361da gas/testsuite/gas/i386/x86-64-movdir.s ++efacf0df27602969a3f70d22a83cb2db gas/testsuite/gas/i386/x86-64-movdir.s + fdb142aa76fad022fa423552cde40462 gas/testsuite/gas/i386/lock-1.d + b8f4c55f5234aeb290314b2d83edd0a3 gas/testsuite/gas/i386/ssse3.d + 703186c0d9c0bbf351d366ed39f40e89 gas/testsuite/gas/i386/x86-64-avx512f_vl-wig1.d +@@ -2557,8 +2562,10 @@ c211c30a2ca8c8af5dfb9de9ed947b54 gas/te + 2477eea02aae21936004f49c6e7397a9 gas/testsuite/gas/i386/x86-64-evex-lig.s + 5926795552df7942d593482625c9c50b gas/testsuite/gas/i386/mem.s + 05e5126338040a91e74a5ce32698e9aa gas/testsuite/gas/i386/x86-64-avx-swap-intel.d ++3337314e288e296442bd51081df51bb8 gas/testsuite/gas/i386/dwarf4-line-1.s + f5eae70842a215bcac877e124765f9b8 gas/testsuite/gas/i386/disp-intel.d + 4df00207aeb59f9a46cd8994185f16be gas/testsuite/gas/i386/x86-64-avx512bitalg_vl.d ++0575292aa0881a472e54b873b8495e6f gas/testsuite/gas/i386/enqcmd-16bit.s + 47d65759513743b58ec56ac196b4c2db gas/testsuite/gas/i386/intel-movs16.d + 1a64bceae866e85ed78b56b761c06a19 gas/testsuite/gas/i386/inval-crc32.s + 4c86fa86ac8e8915b23af2c545683496 gas/testsuite/gas/i386/x86-64-avx512er-intel.d +@@ -2597,7 +2604,7 @@ b30460dcec9e423df1500a870857ca5f gas/te + 92cd61eda5799892991427cc0f8fcc5b gas/testsuite/gas/i386/nosse-1.l + 0a00a1e66acff8f1b016e51f460f8e13 gas/testsuite/gas/i386/vpclmulqdq.d + 6e92c68ea77f3f3ce82c87474d239f1f gas/testsuite/gas/i386/x86-64-evex-lig512.d +-4f5a8462d7b59f64c0d3cf02578d3a83 gas/testsuite/gas/i386/x86-64-addr32-intel.d ++36a5e6eb568422e9e61eb0e3f6d8ec7b gas/testsuite/gas/i386/x86-64-addr32-intel.d + 69fdc5ef997d508b41b2b0da29a6c89c gas/testsuite/gas/i386/x86-64-sysenter-mixed.d + 5cb521fedc5a696fabc191fa6617d805 gas/testsuite/gas/i386/x86-64-inval-rep.s + 7d037c6a498297bb98d6f7a7b686831b gas/testsuite/gas/i386/x86-64-notrackbad.l +@@ -2641,7 +2648,7 @@ dc96f4df9f17bccb91cffef32e98bed8 gas/te + 405da6b812afca00da4b06d848463a12 gas/testsuite/gas/i386/x86-64-avx512f_vaes-wig.s + 1af0d380ed1563adbd60e53ea72ec07a gas/testsuite/gas/i386/vgather-check.d + 098a5f3776f41beb0c854382502002d9 gas/testsuite/gas/i386/nosse-5.s +-965486cb1c9c58871355f9eed9c478c2 gas/testsuite/gas/i386/i386.exp ++3f45f57bbed47103b2130745cbb89384 gas/testsuite/gas/i386/i386.exp + 92ee399bdc1231440c87f3bd035eef57 gas/testsuite/gas/i386/waitpkg.s + 1eb96aabc3d1172ecee1c818483d0caf gas/testsuite/gas/i386/immed64.s + 68de695bac60c5f7cce4c9980049663f gas/testsuite/gas/i386/nops-1-i386.d +@@ -2654,7 +2661,7 @@ f5c2950078d64dec53bdcc74469819ee gas/te + 908bdffcf04087bb53d54486dbb8b742 gas/testsuite/gas/i386/x86-64-tbm.d + 2c6b752faa6d31fd1e4f1e37d70413d1 gas/testsuite/gas/i386/x86-64-vmx.d + a2bd1287be60ae925923e128c5fe40b1 gas/testsuite/gas/i386/x86-64-mwaitx.s +-546ac81d2c660f3ae128a0c0676da1fe gas/testsuite/gas/i386/x86-64-movdir-intel.d ++f77afed1ba6d083791b88ab608dd077f gas/testsuite/gas/i386/x86-64-movdir-intel.d + 762170aa766e1898a409b691ffbe1738 gas/testsuite/gas/i386/nops-4.d + 8239469ac77bbb039844b146f5b5dddd gas/testsuite/gas/i386/avx512vl-ambig.l + a2b4be01be260e759dc8d4059dce61cf gas/testsuite/gas/i386/x86-64-inval-ept.l +@@ -2742,6 +2749,7 @@ de0b47c822c18ad27533a8f30cdea190 gas/te + a3f17309f76f5cc6c71e593d19e8236b gas/testsuite/gas/i386/stN.l + 29b902b0e65b5880650d7b28295341d1 gas/testsuite/gas/i386/x86-64-lfence-ret-d.d + a1a83f19df8c47932fcf764c0c123be6 gas/testsuite/gas/i386/pseudos.s ++12f66b51cb77cee9e8822a443218a54c gas/testsuite/gas/i386/dwarf5-line-1.d + 0154083d83fde516c822d2b71aa1cded gas/testsuite/gas/i386/avx512vl_vaes-wig1-intel.d + 04f5ee2e72d57c658273418b581c213c gas/testsuite/gas/i386/x86-64-size-inval-1.s + a1abd3f647477950a288b838c69d1a32 gas/testsuite/gas/i386/x86-64-clwb.s +@@ -2808,7 +2816,7 @@ c643432a697f1eaca5b6c2f04d9f2f59 gas/te + 28bbb19963a9f7f45e93c2c272b50fbe gas/testsuite/gas/i386/x86-64-sib-intel.d + 9aa138dc4bc96aab0f1f7b47999e1726 gas/testsuite/gas/i386/x86-64-evex-wig1-intel.d + 8ce5c9c0e81d86671d1df8bbbff297e3 gas/testsuite/gas/i386/x86-64-vp2intersect-intel.d +-c0e5704faaa8991aec6f130b0cc0084e gas/testsuite/gas/i386/enqcmd.d ++65337930a50a1466c01377f40ab95d52 gas/testsuite/gas/i386/enqcmd.d + e2a5b5920f2ec4a871fd8dcacdd9a274 gas/testsuite/gas/i386/x86-64-avx512f-rcigrd-intel.d + 8ce11aeb67d3ed972d5eb3c90e5e94f4 gas/testsuite/gas/i386/intel16.s + e8124a58d1a7711303acdf3497a0d0ee gas/testsuite/gas/i386/avx512f-rcigrz-intel.d +@@ -2862,6 +2870,7 @@ d79a2206a21c07deff6669a6cedb55ff gas/te + c5ef0349c39952d2cb48ed6b7e866602 gas/testsuite/gas/i386/x86-64-avx-scalar.d + 3ceafcdfdb4e5b068fe87b4ff1dde542 gas/testsuite/gas/i386/omit-lock-no.d + 4b6488b1095158a2199be1d381bbe170 gas/testsuite/gas/i386/rdpid.d ++ef95660a79640eda8f729f97834bd97e gas/testsuite/gas/i386/dwarf5-line-2.d + bcace8334bdab66ce39b660e19c4b800 gas/testsuite/gas/i386/optimize-3.d + 0d0cc5b2d6b7c0d2946e51354a0b4fa3 gas/testsuite/gas/i386/clflushopt-intel.d + 403de65ac2cc88cb9bf67aa7ed2115a5 gas/testsuite/gas/i386/x86-64-avx512vnni_vl.d +@@ -2926,6 +2935,7 @@ acd2c375477f632c61effc326355b0c9 gas/te + bb6a0e9ffcc1b7b608131bb2c950cdbb gas/testsuite/gas/i386/x86-64-lock-1-intel.d + 55b36af4509c78bd4fe27dcd906a7057 gas/testsuite/gas/i386/x86-64-mpx-inval-1.l + e3f8369e2b62c2e731f3dd732dbf2980 gas/testsuite/gas/i386/x86-64-tbm.s ++324571c1b85260d2a79935683bdc67b3 gas/testsuite/gas/i386/dwarf5-line-3.s + 9b97e61e9f96d57bcb27b6f76fab79dd gas/testsuite/gas/i386/x86-64-avx512bw-wig1-intel.d + ef8e11829cc8bdd4cd334422d062e32e gas/testsuite/gas/i386/align-branch-2c.d + b6cdcc6ff1a9d8624251e8bf0867dd96 gas/testsuite/gas/i386/x86-64-relax-4.d +@@ -2984,6 +2994,7 @@ e27152d79db72548bf3b3c1674b7d077 gas/te + 429dea44e45d9a9809c3e247ef6cefe2 gas/testsuite/gas/i386/clwb.d + 45ac38e370dc3430b5379fa70b255919 gas/testsuite/gas/i386/fpu-bad.d + 901e888fb0f8849218d4e8c2ef75264f gas/testsuite/gas/i386/optimize-2.d ++e2adbf418c4ce53536e0a1bdddb7694b gas/testsuite/gas/i386/dwarf4-line-1.d + 1b58ec1fff190cd70b86ec472e1fa87b gas/testsuite/gas/i386/xop32reg.d + 896b54b9ab0a9ea541d5fc9b4b82438b gas/testsuite/gas/i386/x86-64-aes-intel.d + 1032228937b3c89c054aaa3d57409641 gas/testsuite/gas/i386/x86-64-disp-intel.d +@@ -3020,7 +3031,7 @@ ee94105cd70b0ed6f7675b53e33268a5 gas/te + eb56b4f882f15fa40765604abe8e4b58 gas/testsuite/gas/i386/avx512_bf16_vl-inval.s + eda053f74ea771ea9199a06491cc23d8 gas/testsuite/gas/i386/cet.d + 09cc1da73d2902b633780cb2cb0bd14d gas/testsuite/gas/i386/nop-2.s +-890423069a66db84f9fd2777503d4d37 gas/testsuite/gas/i386/x86-64-addr32.d ++1c3d5125306ac3a72597cb873d2da557 gas/testsuite/gas/i386/x86-64-addr32.d + 0c804ba116de81860c5b4592ac701919 gas/testsuite/gas/i386/ifunc-2.l + b5bfffcc84282d76d21d6845f603872e gas/testsuite/gas/i386/x86-64-avx512vnni-intel.d + 8ea40f295e215df66b50da6004c15aed gas/testsuite/gas/i386/clzero.s +@@ -3254,7 +3265,7 @@ fd4af19a4e33a0d1e23d7827913a0565 gas/te + 53465d928999cc4cc3533466a6cefb86 gas/testsuite/gas/i386/x86-64-align-branch-1e.d + dfaa1687d6f098c81770f69001630490 gas/testsuite/gas/i386/x86-64-optimize-7.s + 00d8f39164080016611494920824e001 gas/testsuite/gas/i386/x86-64-avx512f_vpclmulqdq-wig1-intel.d +-bb0055b7cbbae51dc6377f7861428397 gas/testsuite/gas/i386/movdir.d ++09e1ae574d503ef7f2e638cd91e4f94c gas/testsuite/gas/i386/movdir.d + 7e5e384f1b32b26958f8af641023a2c6 gas/testsuite/gas/i386/fma4.d + 07b286547600a1436c95b6bd593728d2 gas/testsuite/gas/i386/x86-64-avx512er-rcig.s + b82675e46ad27cc7822c6d6d0a48e496 gas/testsuite/gas/i386/x86-64-inval-avx.l +@@ -3398,6 +3409,7 @@ dd5c556919ef2c377a504fa4d999a8a6 gas/te + 298779399b17b78f52c1fdcf886b46a1 gas/testsuite/gas/i386/relax-1.s + c487d81152a6244d9afbd943d54e17af gas/testsuite/gas/i386/pconfig.d + a6bacecf044190936cfb406731bf227a gas/testsuite/gas/i386/avx512bw_vl.s ++76d01594874415fba69dd689acabb101 gas/testsuite/gas/i386/dwarf5-line-2.s + cf6a07896b465b225e73b2aaff43902d gas/testsuite/gas/i386/x86-64-inval-avx512vl.s + 5c901832eabe7617704f91183f902ec5 gas/testsuite/gas/i386/nop-3.d + 6ca25f25d906ca4e1f42a524d56dedbb gas/testsuite/gas/i386/addr16.d +@@ -3407,7 +3419,7 @@ cf6a07896b465b225e73b2aaff43902d gas/te + 3255e1590ff3274d05e980a665daa0c8 gas/testsuite/gas/i386/x86-64-adx.s + d0c61cdbe5298df06a55875a8352b1ae gas/testsuite/gas/i386/lfence-ret-a.d + d9eb45c96277185cfd702373486435a9 gas/testsuite/gas/i386/notrackbad.s +-087227121a8bde00f628dbdcae6c04c4 gas/testsuite/gas/i386/x86-64-enqcmd.d ++138406556b86326eb23b058ce18e1a9a gas/testsuite/gas/i386/x86-64-enqcmd.d + b518d2eb2658745af0bf58cbd295eec9 gas/testsuite/gas/i386/gotpc.s + 2f8009f2123256311d7ce760f77e32e2 gas/testsuite/gas/i386/sha.d + df6c0e61c63d23fcee1cdad842f93dcb gas/testsuite/gas/i386/x86-64-io-suffix.d +@@ -3600,6 +3612,7 @@ f3a65bfb96cf2c53b942568fed2c1c75 gas/te + 8b405a013662d35dc4e8859c710ee57c gas/testsuite/gas/i386/x86-64-avx512dq_vl.d + 637458fa091411540e7f9fa913daaaca gas/testsuite/gas/i386/x86-64-default-suffix.d + 5c1b9124898c4b986a1001adfdbc3a51 gas/testsuite/gas/i386/x86-64-rdrnd.d ++a0604d4222ca0c1ff2d6e20e63844061 gas/testsuite/gas/i386/movdir-16bit.s + 4214e00df5eec94b3fb7eedba768fd85 gas/testsuite/gas/i386/x86-64-arch-2.d + bdb8e80da88c3562c17a0f251328106b gas/testsuite/gas/i386/x86-64-segovr.d + cfbacb867fc23e46eb5cc453b29e996e gas/testsuite/gas/i386/287.d +@@ -3608,6 +3621,7 @@ cfbacb867fc23e46eb5cc453b29e996e gas/te + d0f3db368e6ac72b79080f6e30fa501a gas/testsuite/gas/i386/x86-64-sse3.d + 809c6f65d78807372193c3881983f416 gas/testsuite/gas/i386/x86-64-align-branch-2c.d + 04fe6f49281f9ae5e4b0d2bdc772859e gas/testsuite/gas/i386/x86-64-enqcmd-inval.l ++f18ee892663af415210493751b90df4f gas/testsuite/gas/i386/dwarf5-line-3.d + a2d345a18dbfc8c9cb3daf64e704c300 gas/testsuite/gas/i386/size-2.d + 1580fe12e20d1689255d1db78f2db5ea gas/testsuite/gas/i386/x86-64-avx512ifma.d + 6699e2223eb722cd8fc0ee51d34fecba gas/testsuite/gas/i386/avx-wig.d +@@ -3671,7 +3685,7 @@ eab82109da44b6db29387bb3d32d1c2f gas/te + 8dc4e34c9b1fe8d7582db1437973c356 gas/testsuite/gas/i386/x86-64-segment.l + 982560db9563085ba922e9a3c15687bc gas/testsuite/gas/i386/x86-64-avx512vl_vpclmulqdq-wig1-intel.d + a3d50b175a9a22971c5fb45ab327dba2 gas/testsuite/gas/i386/x86-64-avx-scalar.s +-c65a0ca9f47a71e88a0c5c8553bf3078 gas/testsuite/gas/i386/movdir.s ++99b8a04c9666934afdbf018216f9e616 gas/testsuite/gas/i386/movdir.s + 7197034ef3ee35dbff5befbe3e7799a8 gas/testsuite/gas/i386/x86-64-reg.s + eeb535ee0eb552cd1393f1d490501ab0 gas/testsuite/gas/i386/relax-5.s + b8e138ff0e83f2909ba08f237cb8e28a gas/testsuite/gas/i386/unspec64.l +@@ -3686,7 +3700,7 @@ eeeac89ab5bf0d301ab89af243853978 gas/te + ff220a9aad690c64b192ee1eab0f2244 gas/testsuite/gas/i386/xmmhi32.s + f830c9fcaeabde0dc0c174abfa1ea7dd gas/testsuite/gas/i386/align-branch-1e.d + c1bb857224d18d13a7d774254f5c836e gas/testsuite/gas/i386/localpic.s +-a5483c38b333831615d7a564fc1496f2 gas/testsuite/gas/i386/enqcmd.s ++21a81a79f8c89266cc579cdeb0c43494 gas/testsuite/gas/i386/enqcmd.s + 465d5295cd6b3591fb63f77189f84b7e gas/testsuite/gas/i386/arch-10-bdver2.d + 486ab6970a2c1e0bfe90f61c1abe7ea3 gas/testsuite/gas/i386/x86-64-pseudos-bad.s + ab961d062b9e42924d1ce445461acdbc gas/testsuite/gas/i386/smx.s +@@ -4445,7 +4459,7 @@ f96c6ef9cb2e1718e696c7c2a7894dc7 gas/te + c76a9dc737c0e74cd65ce2918ab2cf1d gas/testsuite/gas/elf/elf.exp + 3ffd88c55a6075e35a6dd44e54d65538 gas/testsuite/gas/elf/section16b.d + 4e0cecedecf31818ef0d9697bdf9caf1 gas/testsuite/gas/elf/section0.d +-30685cb2077a5fb8fe61fa0c5ac8b0e2 gas/testsuite/gas/elf/dwarf-5-cu.d ++5f926e2fd811083c52c5aed6962653c0 gas/testsuite/gas/elf/dwarf-5-cu.d + 75f93f3a529c0f29408c2dddbbb254ff gas/testsuite/gas/elf/dwarf2-1.d + 146271a346446f9a841e6bdb17a77f8a gas/testsuite/gas/elf/section15.s + 7f1fa869c82de46d061db14327f2f92f gas/testsuite/gas/elf/section17.d +@@ -5674,7 +5688,7 @@ fd3bd8c4162aeaa991ae379d1e80a144 gas/te + 1b5c5cc6d5de0f5e8227b23e0ad86339 gas/testsuite/gas/aarch64/bfloat16.d + e087517d04006185f0773ce544b4ba6d gas/testsuite/gas/aarch64/reloc-dtprel_hi12-ilp32.d + 88d0b5df8ba39f25bc7a83df2b9f1283 gas/testsuite/gas/aarch64/sve-dup.d +-401477659df8b5530552772a19ffd965 gas/testsuite/gas/aarch64/system.s ++5fd6692d06edc0c16c8972ae0ec4d724 gas/testsuite/gas/aarch64/system.s + 97a92c9b6edd65fc0aa3f541645f3f30 gas/testsuite/gas/aarch64/illegal-sve2.l + 36196b4971b92fa5b8041b29351392ff gas/testsuite/gas/aarch64/reloc-dtprel_lo12-ldst16.d + 402be6bd18c09beea98c462a3af610d8 gas/testsuite/gas/aarch64/armv8_3-a-crypto-fp16.d +@@ -5733,7 +5747,7 @@ b71859fc8bab0fe357e770bdc00fb9cc gas/te + 5ba31b78011fd875f5b2dec6fbd8d0f1 gas/testsuite/gas/aarch64/undefined_advsimd_armv8_3.s + b9d4b8afc080dab4c12683130acc52b1 gas/testsuite/gas/aarch64/mapping_6.d + f2bf0808be790b1e70e98e857ca0a102 gas/testsuite/gas/aarch64/i8mm.d +-8d60f21a7be321b8c8e0b3115f54ad0b gas/testsuite/gas/aarch64/system.d ++af8dcfd6542c29947c8ad435d87f4bfe gas/testsuite/gas/aarch64/system.d + c25fc94aebadd6f8cae2d67bf6873fc6 gas/testsuite/gas/aarch64/illegal-crypto-nofp.d + 5b1f625ea3c76b4ff79492ceca4c8629 gas/testsuite/gas/aarch64/verbose-error.s + a4de2c2033d3c963564446022a10be4e gas/testsuite/gas/aarch64/sve-movprfx_22.s +@@ -9228,7 +9242,7 @@ b334f15354ebeffb3acba502cc1dae67 gas/te + 0bc8c01b9137eb5e637ed1d4c6ee5e3e gas/testsuite/gas/ppc/xcoff-br16-2.d + 313f5d9613a204036abe7728f4e0a81f gas/testsuite/gas/ppc/e6500.s + 52c2f10e54b1b94b494715da3c2a71f2 gas/testsuite/gas/ppc/test1elf.asm +-412bf1f1f461a8a3a5c9ae44b9170c11 gas/testsuite/gas/ppc/476.s ++01a7da9db11b4059a5c0dd41598b6b4f gas/testsuite/gas/ppc/476.s + a2229dad823c2fff839662835b3f1440 gas/testsuite/gas/ppc/ppc750ps.s + 2e7cf08f39a8f93eae434cfaa76d4478 gas/testsuite/gas/ppc/prefix-reloc.d + bf7138b0bd2200fe6b4cafbc46e44d43 gas/testsuite/gas/ppc/prefix-align.d +@@ -9263,7 +9277,7 @@ f40ead4882a3b0477c72b16942540c20 gas/te + 3afce79c83e5563787ad48c49cb7bad9 gas/testsuite/gas/ppc/common.d + 58828bd5095ede1e0fecf5af35914d4c gas/testsuite/gas/ppc/altivec2.s + 5f620ed105babe239107fc41ad0d8a23 gas/testsuite/gas/ppc/e5500_nop.s +-4a5b414fe8649a5d03efc42d7c1f735a gas/testsuite/gas/ppc/power8.s ++c1ccf8a127b5e1bd46b728b530c89434 gas/testsuite/gas/ppc/power8.s + 69b9dc5b20503079be857e83ad7e6d24 gas/testsuite/gas/ppc/test1elf32.s + e967e474a62c98234917b965893efb5b gas/testsuite/gas/ppc/regnames.d + 278393ce5d7715428b33dec80a5fe84d gas/testsuite/gas/ppc/bcy.d +@@ -9272,9 +9286,10 @@ ddc10efbeb242570e5555a2391298f61 gas/te + d64db4c655440c10d9a45b972794e4f5 gas/testsuite/gas/ppc/byte_rev.s + b09f6e7ab2e1416379f9512d1abe3afc gas/testsuite/gas/ppc/simpshft.s + b4f0d227d877d8544b3534c27e142b88 gas/testsuite/gas/ppc/vsx.d +-713276fe36cbb059aea8f67764e5ce2e gas/testsuite/gas/ppc/a2.s ++014ca139c220e720af1548fa099f402e gas/testsuite/gas/ppc/a2.s + 8e6f1a1808fb5a70e7658bbcf0adcdf5 gas/testsuite/gas/ppc/vle-simple-2.d + 9126ebdec705b53a59e810a128cea065 gas/testsuite/gas/ppc/spe2-checks.s ++9e261d29a5fe4aa35f4bba048f7767c7 gas/testsuite/gas/ppc/be.s + 1f3ca01c9d7afa8a580c73ee371fee03 gas/testsuite/gas/ppc/xcoff-ref-1.l + 82af549e714fd1c02225bebe05eab23d gas/testsuite/gas/ppc/e500-ill.s + 87d11cb66e10ea7d6a07293cb45e8799 gas/testsuite/gas/ppc/altivec_xcoff64.s +@@ -9291,6 +9306,7 @@ ab3c6a1d0aca76e63d73bb4d7eb80035 gas/te + 7c72de3078c3749698c21ede5afd9f0a gas/testsuite/gas/ppc/prefix-align.s + 5ad9be7f8dfb14e3364f158aca1842f0 gas/testsuite/gas/ppc/power7.s + 5254d1fc440f434a46e97eb96b2735c1 gas/testsuite/gas/ppc/astest.s ++d8c49b589e7a480b280b5653b3ba503b gas/testsuite/gas/ppc/le_error.l + bbd192748bceb61aacf40f50e0691333 gas/testsuite/gas/ppc/pr21303.d + 8e884141661fddd367c49211824ec4dc gas/testsuite/gas/ppc/xcoff-branch-1-64.d + afc3d3ec2754e8dc184c562e4de77a4a gas/testsuite/gas/ppc/reloc.d +@@ -9312,7 +9328,7 @@ a5e3b2da72f048b69bd0bb8905d824c3 gas/te + 45cbc6c02dc1f7e4e355b75dcb312f8e gas/testsuite/gas/ppc/common.s + 5469fabf8c12dbd0dc2c48ef7af1a7c7 gas/testsuite/gas/ppc/groupnop.s + 25f7266b7d2018e3d6ada872b8781bec gas/testsuite/gas/ppc/altivec_and_spe.s +-b1754bca903aba171dfc6a85f5d50cbd gas/testsuite/gas/ppc/power8.d ++8c81ed0f7862b2189318f565092a3586 gas/testsuite/gas/ppc/power8.d + e8401e493c9b7d28d214fff4dbfc8b60 gas/testsuite/gas/ppc/altivec.s + 28664cd25f2c76688bf150c9823261e5 gas/testsuite/gas/ppc/altivec3.s + df485ed9c47f6fccff94a01bacc22411 gas/testsuite/gas/ppc/bcaterr.d +@@ -9332,7 +9348,7 @@ aa463e442fe9faf027cd46460213d6fb gas/te + 1ba8fbbed3c4e9237919b0410da989ae gas/testsuite/gas/ppc/altivec_and_spe.d + 96d7df781d760c97e64217431d61a05e gas/testsuite/gas/ppc/vle-mult-ld-st-insns.d + f89d00a5249e47eef16bd7449185a9dc gas/testsuite/gas/ppc/booke_xcoff.d +-8d83ce45c5a4405eb70d16f4abe30e9f gas/testsuite/gas/ppc/power9.d ++6e762619305ec2257f725c83482d8f1d gas/testsuite/gas/ppc/power9.d + c79bc49c8460fd5c1f869bffdb70b173 gas/testsuite/gas/ppc/bcaterr.l + 08ea62f057fad4130ab4496b10773187 gas/testsuite/gas/ppc/xcoff-branch-1-32.d + 487b3873f50969a2defd99503835df58 gas/testsuite/gas/ppc/astest64.d +@@ -9348,7 +9364,7 @@ f358db9d5f8df65182e53f5e34f10ee8 gas/te + 9a8c8131d1ed55f1cd6b12d65d85cbd6 gas/testsuite/gas/ppc/e500mc64_nop.s + 679686746eeffb584f428b319e1d60e7 gas/testsuite/gas/ppc/astest2.s + 2fb3d64dd59daa93b0ccdd8a092b8344 gas/testsuite/gas/ppc/efs2.d +-8ec5202cb52a915df9b1a5c24bf9ed2f gas/testsuite/gas/ppc/vsx2.d ++13c5b4cb28f10b1120ef84982c4fd579 gas/testsuite/gas/ppc/vsx2.d + 1af7c90e3bbbe344f72c9ba13ad8be12 gas/testsuite/gas/ppc/vec_mul.s + a8240bfed727928d2807049c9432de5c gas/testsuite/gas/ppc/xcoff-br16-2.s + 44d86f3f3dbf083a5e2f8795bbc98fb2 gas/testsuite/gas/ppc/vle.s +@@ -9357,7 +9373,7 @@ a8240bfed727928d2807049c9432de5c gas/te + 6708e9b702505d523b2a0f86841ed249 gas/testsuite/gas/ppc/spe2.s + 3f42c228b5a1e4914eff729232eed634 gas/testsuite/gas/ppc/lsp-checks.s + 3d767321b9e50d84dcbb59167e75c42e gas/testsuite/gas/ppc/vle-simple-4.d +-b7e6305d59445d34285002c1fb925093 gas/testsuite/gas/ppc/476.d ++dac171512e1b7b09c3b5bfc3b485e3f2 gas/testsuite/gas/ppc/476.d + 3cd1bdcebfa5fd8add0e1fdd32106623 gas/testsuite/gas/ppc/power4.s + d710606b6763281691a79f7b1bae1486 gas/testsuite/gas/ppc/astest.d + ac5681bad739dbc93a0593b34dd4e884 gas/testsuite/gas/ppc/xcoff-dwsect-1.s +@@ -9368,7 +9384,7 @@ ac5681bad739dbc93a0593b34dd4e884 gas/te + b136c48de02880f92600e15502079cbd gas/testsuite/gas/ppc/range.l + 12d6a1b05ea97886acb3e42bf2a7722f gas/testsuite/gas/ppc/bcyerr.l + b60a4ad89a80b60d95fc5d73ec5e02d9 gas/testsuite/gas/ppc/textalign-xcoff-001.s +-c4472739523abfd8dca34ff1d0e8de72 gas/testsuite/gas/ppc/int128.s ++3e3c0b135fd7904fedc2223410727651 gas/testsuite/gas/ppc/int128.s + 61faf5b217455918b14b543f1d6d642f gas/testsuite/gas/ppc/e6500_nop.s + bf0744f167cd9419b967bc7f3e907638 gas/testsuite/gas/ppc/textalign-xcoff-001.d + 46c07d63c1cbfab24da7d862cc56b1b7 gas/testsuite/gas/ppc/maskmanip.d +@@ -9383,7 +9399,7 @@ ec0623cb663732f36358fbfc76e174f9 gas/te + 1144f1624f81b2bf57bc44af8e76f9bb gas/testsuite/gas/ppc/align.s + f7edad06d6721b1f05659701f3bfd5c5 gas/testsuite/gas/ppc/maskmanip.s + e5b68c5d62c9b873836ab2b5914a6bcb gas/testsuite/gas/ppc/bitmanip.d +-fea0246300d6d5a09f588eaea8534c5e gas/testsuite/gas/ppc/int128.d ++471634fc8d9be8f2b178282990d2bb31 gas/testsuite/gas/ppc/int128.d + bb9de98f6a7a3a2135831e275de417de gas/testsuite/gas/ppc/power10.d + d93ef7c4104ba26cf3552e3f315284cb gas/testsuite/gas/ppc/genpcv.s + b318f99332cc8875eeb2b1e63205efa4 gas/testsuite/gas/ppc/regnames.s +@@ -9391,8 +9407,10 @@ c0d53b6f5764c02ff1c15fcb01488c01 gas/te + dfff95bd30a9a013c984d1618468692d gas/testsuite/gas/ppc/e500.d + 7329943f7950c2a637c220ef978a90f4 gas/testsuite/gas/ppc/vle-simple-6.s + db560f88366d3c0e44c52d438bf7fa47 gas/testsuite/gas/ppc/range64.s ++b6f38e4ea0a5e76403ad5708f0db43d4 gas/testsuite/gas/ppc/le_error.d + 0ed23778cebfa8a0bbfb30ffc0a522ff gas/testsuite/gas/ppc/e500mc.d + 73b242f9a893260498fb7ebfe95b29be gas/testsuite/gas/ppc/spe_ambiguous.d ++f65560134d74e4e2264944409292ffe0 gas/testsuite/gas/ppc/be.d + 8a65cf6b0d6124cc27bf4f4a4fdddfe9 gas/testsuite/gas/ppc/vle-simple-2.s + b0f0a0f307149b00c01eb907197dd91e gas/testsuite/gas/ppc/textalign-xcoff-002.d + e2ca5089c4db50f97a3bec4e6f71854f gas/testsuite/gas/ppc/reloc.s +@@ -9401,7 +9419,7 @@ e2ca5089c4db50f97a3bec4e6f71854f gas/te + e0297246354a3c5ce5e78cf020659edb gas/testsuite/gas/ppc/astest2_64.d + c1e4082e3ac5809eacd7ed9c0ef739f8 gas/testsuite/gas/ppc/prefix-reloc.s + 438fcd6b72fbbeb485cb651020c2873e gas/testsuite/gas/ppc/prefix-pcrel.s +-7b407eb0008f8c5883f3f3c92334e98b gas/testsuite/gas/ppc/a2.d ++5957957fc02e0b1856d0c033e8a836f0 gas/testsuite/gas/ppc/a2.d + 5f6c3990213c5b7953ce091a7a2ca6b1 gas/testsuite/gas/ppc/vsx4.s + a7e80760d77bce51c54e0c9100d6e2b3 gas/testsuite/gas/ppc/astest2.d + e7de1e4b2ba2575938af0721d219d58e gas/testsuite/gas/ppc/titan.d +@@ -9423,12 +9441,12 @@ f65e14408c5f185e7d55e76590af9d56 gas/te + 161bb49cf4496c607050a7ae2f80cf12 gas/testsuite/gas/ppc/bc.s + 6b5dede6da756c49ce5fc9127d0a6510 gas/testsuite/gas/ppc/test1xcoff.asm + 7feeec962fcd47d8b0e24a247be8c14e gas/testsuite/gas/ppc/vsx.s +-54ce172f5a61e420d427ee92a947be47 gas/testsuite/gas/ppc/xvtlsbb.d ++599156290ace623297010d5941f8fe72 gas/testsuite/gas/ppc/xvtlsbb.d + 2e4afc4cb29128299e92bcd08687553c gas/testsuite/gas/ppc/vle-simple-4.s +-76cfad5d841232730b8429d465c68a46 gas/testsuite/gas/ppc/ppc.exp ++1548284e219a5badd6cf5740cfdb9f60 gas/testsuite/gas/ppc/ppc.exp + c2ca34845ded1c005f7a23bc5aa5af11 gas/testsuite/gas/ppc/misalign.d + da0fa7d28b8702829b77b9f2faf2e244 gas/testsuite/gas/ppc/bcat.d +-53da3a66b6eaa223b5cea2f9df2234ea gas/testsuite/gas/ppc/power9.s ++bfe96f13f18c73d629f885f45051b4c6 gas/testsuite/gas/ppc/power9.s + d93ead8a31f67112e4f73830342273d0 gas/testsuite/gas/ppc/htm.d + c8557b4b40ce9690c81d77b9502a959c gas/testsuite/gas/vax/flonum.d + b5281ff49f97d0836ede49ab60f0b84e gas/testsuite/gas/vax/quad_elf.s +@@ -10781,6 +10799,7 @@ ff20d70ac9dd37fdad40fb2f511300f4 gas/te + bed48359d27d45c02fd03907deeb7917 gas/testsuite/gas/arm/sp-pc-validations-bad-t.s + 08bc39a3a53206754122135bacf2e2a4 gas/testsuite/gas/arm/mve-vqdmull.d + 4cbd6120461f4c5f0788a1dfc11fac84 gas/testsuite/gas/arm/note-march-armv2.d ++1c186abc3c4c2fc35c0a8dfdd1757bb6 gas/testsuite/gas/arm/mve-vldr-vstr-bad.d + 458a135955b2a3b6c22d94df307154ef gas/testsuite/gas/arm/armv8_1-m-bf-rel.s + 4802575d22ba6a0f11af97d729d13487 gas/testsuite/gas/arm/blx-bl-convert.s + adcf406e5288a7ea8ddefee188e2343c gas/testsuite/gas/arm/mve-veor-bad.s +@@ -10844,6 +10863,7 @@ ea584b89abc24ada51ced872f90af05d gas/te + b7bd6720c516ae3ad3d789ea7af8244c gas/testsuite/gas/arm/mve-vadc-bad.d + 9a6fa12ed030e85078ea708f978159f9 gas/testsuite/gas/arm/unpredictable.s + ad99c92d4dece22ad25a32f0f1f78fa1 gas/testsuite/gas/arm/mve-vddup-bad.l ++13e4a1f131aab9a9789f32f62944f986 gas/testsuite/gas/arm/mve-vldr-vstr-bad.s + edb7b00d5f6bfe8c12de50b7e54ed2d8 gas/testsuite/gas/arm/thumb2_ldr_immediate_highregs_armv6t2.s + 7f02fa55199751240e558106e3659881 gas/testsuite/gas/arm/armv8_1-m-bf-bad.d + dd529d795ccef177d56651b92a514165 gas/testsuite/gas/arm/v8_1m-mve.d +@@ -11483,6 +11503,7 @@ ff2a7bf25ee0dc8c82fe6c5d6d001e15 gas/te + 4d1fd8cc3c1c026563f41c1d14199e96 gas/testsuite/gas/arm/cmdline-bad-arch.d + 0306eb195176f01ae8e183426f85b11d gas/testsuite/gas/arm/mve-vmov-bad-1.l + c3ebfa86cf715a1440fd370d210fcdb6 gas/testsuite/gas/arm/mve-vqdmull-bad.d ++d019098133c23d4f6a3da7a1890d499d gas/testsuite/gas/arm/pr26858.d + f1cc7be0aaea8f6d7926b4288d9e96cc gas/testsuite/gas/arm/arm.exp + 6b640bf52ba879d867c7f18dcd1c22c6 gas/testsuite/gas/arm/armv8-ar-barrier.s + 793e9588d044f6b38d86fff098dbccc6 gas/testsuite/gas/arm/ld-sp-warn.s +@@ -11703,6 +11724,7 @@ bef0f733aa2ebe8d5a78972bdbdb723e gas/te + f3efd02f5baeafb3c041bb8684fb0bd0 gas/testsuite/gas/arm/dfb.s + 171e9e4bfd5e7cf6437e63599624fc94 gas/testsuite/gas/arm/thumb2_ldr_immediate_highregs_armv6t2.d + 417be5ca4ee7c570e34e4490873e7b75 gas/testsuite/gas/arm/armv1.l ++5ec0006616858a1e3be7c5d859b925de gas/testsuite/gas/arm/mve-vldr-vstr-bad.l + 862c3087383dfd4279783ebaaf220e93 gas/testsuite/gas/arm/vldconst.d + 7952a043afb3f072d57fb4c26aad77a3 gas/testsuite/gas/arm/branch-reloc.d + fad17d80b95ff5a7d784d1ce0231ed5b gas/testsuite/gas/arm/neon-vmov-bad.l +@@ -12056,6 +12078,7 @@ ba904cc4640eadf5581acf7b64f2df16 gas/te + a1e53a73c778b85b8c56e3dc205ccc23 gas/testsuite/gas/arm/adds-thumb1-reloc-local-armv7-m.d + 42cf9770de566b73176f044a10e1521c gas/testsuite/gas/arm/cpu-arm1136j-s.d + dd53426f8d834ee1a0c2be239141cfca gas/testsuite/gas/arm/mve-vqshl-bad.d ++3053aeb16e3fe5bc085066fd325816bd gas/testsuite/gas/arm/pr26858.s + 8d63a3ff50c169a10cb14fea3bb20088 gas/testsuite/gas/arm/undefined-insn.s + 6c90d9bd654e7acf70a4479f8ac7d82a gas/testsuite/gas/arm/cpu-fa606te.d + a24e1db08e35323e4bc5c9f3b2865dea gas/testsuite/gas/arm/tcompat2.s +@@ -13130,7 +13153,7 @@ d2da9287ff389ddf7925fae5e8ce27a3 gas/Ch + 96aeb2d8b75822cf073f3c5747f54b0a gas/configure.ac + ea5e0357485632eeb3ed046b0d43c68d gas/itbl-ops.h + bc77badd5219273bbe54e73f10e35400 gas/listing.h +-4efef7a3f8d453bf8ec7175deeb09110 gas/m68k-parse.c ++f84a8a6b03bf72eb1275fe1cec45cfa5 gas/m68k-parse.c + 83f85888224d3ff05784d76897e6ade7 gas/messages.c + 5f6e59f87d8f74e748eabdb6d41b1647 gas/stabs.c + b3996e5678ccd04d817d5b75c674eb04 gas/cond.c +@@ -13147,7 +13170,7 @@ ead5745a0de496fe2b2835747e689917 gas/Ch + 1bb1ccb94b60500cd1f32f15ecaf0e6d gas/as.c + 0e664d128aae523c5421c50225dab762 gas/bit_fix.h + 5629611ddb1156ac050bbc4117501313 gas/flonum-mult.c +-cf5ff98b5d1ce42b43b8254d10c3e4ab gas/bfin-parse.h ++c37a9c59d771ce8b5b6e757e7d0257da gas/bfin-parse.h + e8e68950f71bc0e526e8f4762b537ff4 gas/NEWS + 907b9d83a9667721523820381274ea03 gas/ChangeLog-2015 + fb89cbded3fff625ab1895a25837eb15 gas/emul-target.h +@@ -13181,7 +13204,7 @@ f9b8adfb280a7acafe14682f50c27adf gold/s + 4b96a6e447e978333ba63cbd35793090 gold/fileread.h + 022b5df30a36069791e66d9c3ee75576 gold/mips.cc + bc423ceb8189fdb0d9fbd25fba6deefe gold/pread.c +-b4bbbc686fb86949932861a8f53d7b9e gold/options.cc ++be15b99870c6f76c1d2705780afbc697 gold/options.cc + 687b4f50d831982e9168afde2b226cf9 gold/aarch64-reloc-property.h + b1806a63703e0e1ded5331ffde4f4e19 gold/arm-reloc.def + 7ea9beb08e66b1e4e6cab34399dfdafb gold/icf.cc +@@ -13191,14 +13214,14 @@ b1806a63703e0e1ded5331ffde4f4e19 gold/a + 35ce5d6377add5949a963d54ca2ee077 gold/arm.cc + 0ed4af443cc3297ba90e4e2e7a531b85 gold/gdb-index.h + b63295b182d85cff6625726fd282f7e6 gold/dirsearch.h +-7bc4f9d5689a90913e4d63e931e612e2 gold/options.h ++a4ec070942fd8e45d2e8e9481c8e1394 gold/options.h + 647328fccd7df5d94c2f3a08c48c2b6b gold/compressed_output.h + cee0fbfc208667c2f1020c73134c587f gold/x86_64.cc + aa22d0f4dc5b700c249dd8ad14e0664a gold/incremental.h + 371ffcb42025c80b18253879f4189a4e gold/mapfile.cc + 48049fe668574d3b760b8eed9cd7c725 gold/dwp.cc + 063f80321eb6b4c65dc5073112a1abe2 gold/ChangeLog-0815 +-0f3e31cf4eb8beebe9c45fccba7e7267 gold/powerpc.cc ++7d06272388820171230a3ba54d38f69f gold/powerpc.cc + 3f61a21ae36638c8adf41746fc7a49eb gold/workqueue.h + e67713fb66e1d7065ef9a192c0d70904 gold/gc.h + 45ad5da123022485960036d3a8e0562c gold/nacl.h +@@ -13220,15 +13243,15 @@ bf9c2a5d89c8c65382368d82256acaed gold/f + aad8134151e7137b5af3dd49d5778b1c gold/Makefile.in + 5ce5d04b68f324c1d41eb701ef517508 gold/parameters.cc + 34fa2b213f0d6403136b11c9a5c06bac gold/i386.cc +-4caa5b4fb233fa75e4f6cd45e8be791d gold/yyscript.h ++da5e83df8214199fa7c301235b1ac29d gold/yyscript.h + 62bbe5d503c021e5bae60c7eb61e5878 gold/target.cc + eac12c65de47d947eaec16d8972406f4 gold/gold.h + 83a8cba0fa4dee23cdc783b66e65f386 gold/mapfile.h + e6357d99ab0c570431cba4a3d5e4ed2d gold/stringpool.h + 8e853071287e2227d57ed20206c61496 gold/copy-relocs.cc + fa7ac7f00083c7cccb97fd2f5d2ed455 gold/workqueue-threads.cc +-5052fbaba23dfd1c1f83978b81e7bc7a gold/ChangeLog +-50b3eaf655560434e9fb301178645bcf gold/yyscript.c ++79f4aa68e5eedb0a07190ab7ededf399 gold/ChangeLog ++a773f5b144c3aef68601ea6b67307405 gold/yyscript.c + 5c27d571b668ad803e9e1be03d01904b gold/dwp.h + 5d269143f00027b391169994aa0b677e gold/symtab.h + 9dc53739bd66ed923d6aab774d2fbf9b gold/TODO +@@ -13242,38 +13265,38 @@ a128cfb27a065a87e02e96c5fcca5324 gold/C + 96f022780963cba6da2dca0aee202b2d gold/binary.h + f2462e94cc1dec36ddd59f05c380fe1c gold/stringpool.cc + e989edd63f9e7cb246233b264a80887d gold/config.in +-7caa1cb215303330997d83e8d7dd464e gold/po/ja.gmo ++1fdfc810c544574fbfe9dcc95f5e7204 gold/po/ja.gmo + bd42e9b55c2352fd78441fe16eef7871 gold/po/uk.po + 49ada08dbd886463c71c01338fd6dae0 gold/po/it.po + 5456eeb720ff2c91aee9243f353ba96a gold/po/gold.pot +-6da942574248c13add15e0dc0b84eb49 gold/po/sr.gmo ++71db7fb3a0efb8aaf98e0b6390da5d28 gold/po/sr.gmo + b78d13fcefd3959c229ba45a446f61b0 gold/po/Make-in + 97d8cd453d0e9878496499858df8674b gold/po/id.po +-bb186492d4980540e6d9955a7666baba gold/po/sv.gmo ++7005570f1219828dc93110a02c3beba0 gold/po/sv.gmo + 639260651103ab96fe17c977acb491ee gold/po/fr.po + c55f24f55da269f77d645a7ecb8226b5 gold/po/fi.po +-476032255aa6ed22dd49b9db83a020bc gold/po/fr.gmo ++a44c84cc459d39b1840b6bbd37e9305e gold/po/fr.gmo + d86ff23f552c6fe827b482e094dceaa9 gold/po/POTFILES.in +-b0f67df1e570fc263860a402a901d4a0 gold/po/es.gmo ++198a6344577f0bb46a47259ef5e56c29 gold/po/es.gmo + 440ecab1a803bf97b8f99f3922de54dd gold/po/es.po + 5b73941887e846f5caf725189b985794 gold/po/zh_CN.po + c9636d3647ca30cf06b642fefa8ba716 gold/po/sv.po + e0826941edfa9073335731b5c2e409e5 gold/po/vi.po +-be90bbff90417e9ea89b48c51aaf5e71 gold/po/zh_CN.gmo +-8076141e94ebf4c8e3b9b3665b56eec7 gold/po/it.gmo +-6ef1d0383d66682b64918fa7c20861f2 gold/po/vi.gmo ++29fca2c6253b7330624581528d0d24fa gold/po/zh_CN.gmo ++2d5102c03ddded24b06177b079bcf5d0 gold/po/it.gmo ++2d7c5731e14a902a1b8962b0628eb748 gold/po/vi.gmo + ea2eafb4246eccbaeed2799b24bd3762 gold/po/ja.po + 81fb0ae0c0b2f295343089f67f8f16ac gold/po/sr.po +-fd0eca34c8b979145ccd744c6e2b1baa gold/po/id.gmo +-14a814242cd5cccf5c0e2a1617b08cba gold/po/fi.gmo +-ed720d8dff79e365c556ab7a41f80c97 gold/po/uk.gmo ++8275f3d8d0495abc013e0f4c47431894 gold/po/id.gmo ++b4cfa27f36c898309ba1fd5aa3e25a63 gold/po/fi.gmo ++5b9611e097c66fde6bb5f5af36b1f3f2 gold/po/uk.gmo + 97278cdbf3a9d3b73d4405ef6f09cbc3 gold/cref.h + ffb161f6d3f66b60d6a2f3db4578c5a1 gold/attributes.cc + dc38e31f8d88dfc101820a59c8d7d890 gold/layout.cc + 017fb7cd2c991fac27cb5f660ecc55f5 gold/configure.tgt + f92a0f3ada9f5c478c36b4ec41393113 gold/reloc-types.h + e59a6183c5fcd6a58b46d99d06859f4c gold/script.h +-a35203649465fdf3df2055fcdd23d28f gold/testsuite/split_x86_64.sh ++cb2d821ac04edf190898546f1ee7a7c9 gold/testsuite/split_x86_64.sh + eab49865278f511552f0937bfd8752b0 gold/testsuite/arm_cortex_a8_b_cond.s + c1529212f95bddb1d49c13967b3605cf gold/testsuite/weak_alias_test_main.cc + 3016ab93f6a91dd14af2164659bc198f gold/testsuite/script_test_1.t +@@ -13314,7 +13337,7 @@ db6ee45d78f8e4e03f54bcfa642978a0 gold/t + 6186ea5b9bdeb2dde93a89311b848203 gold/testsuite/split_s390.sh + 1e64070e2a03e450213a3dde2692ef39 gold/testsuite/gc_orphan_section_test.sh + 29e2697b11c48991cbbbbc2440147ad9 gold/testsuite/icf_safe_so_test.cc +-fb5c262d251a38aafc89119e7c031ffe gold/testsuite/split_i386.sh ++e9f098ea17fc505e60f36ccc25f8eca4 gold/testsuite/split_i386.sh + 70d904019b7a25eac9ce02562f3bfe17 gold/testsuite/weak_as_needed_b.script + 106a34f5aa9382bf39908c3f72b18d01 gold/testsuite/script_test_7.sh + ed57a00ebd236a5950828bca1783b4cc gold/testsuite/hidden_test_main.c +@@ -13383,7 +13406,7 @@ f67205103ab4ed24d22d1ee8600ab7a8 gold/t + 6a081b688f9360785480f965512cf5cc gold/testsuite/script_test_8.sh + bb4f90d0b4ff3ed5e0226ebeb1d5dc41 gold/testsuite/ver_test_1.cc + 9876c7b2d3fccec100015214263805d6 gold/testsuite/protected_main_1.cc +-afab896b2a212be04ef9aba3c4c9449f gold/testsuite/split_x32.sh ++0d9cbe592aa40d4a79179e16a37a5f5a gold/testsuite/split_x32.sh + 089f214ad380a2bb8129f66bce4811a2 gold/testsuite/plugin_common_test_1.c + ebf9914c2f7f2894a253c3c365748770 gold/testsuite/x86_64_indirect_call_to_direct1.s + d28eabe2127dbba804c187d6835fa6d5 gold/testsuite/arm_target_lazy_init.s +@@ -13914,55 +13937,55 @@ b0ae07c1305af47e096e94800f8d49d1 gprof/ + b167dc5dcf583c07feecea0f8003e647 gprof/.gdbinit + 10619ec279c9e89fbde46536f3431e54 gprof/ChangeLog-2016 + abe9186aa2b65b000546c8158085dda8 gprof/MAINTAINERS +-779ef571ddbcd8e5203ca03b7160013c gprof/po/ja.gmo ++38faa7b68d8893deb39574fe8280bdde gprof/po/ja.gmo + d324bc814fd81a744f853d48ca2f8807 gprof/po/rw.po + a418c1f1cd1c4f34e09e68cdea0682a5 gprof/po/uk.po +-696810b20eadba501b58d410ebb22df5 gprof/po/hu.gmo ++85dcca740a79b0b2d635312f6ca5c915 gprof/po/hu.gmo + 8681cd7c4b7c6286d94c4f59bb1283d7 gprof/po/it.po +-bcf6e9be091142d13e4d3c15a81e058f gprof/po/sr.gmo ++aa740577a92919cd8a3beba2fe596e78 gprof/po/sr.gmo + a803c87910084bd31a2ff2d5a1713d64 gprof/po/ga.po +-d0e2ae336c6989276b35ee8c4c712b94 gprof/po/de.gmo ++42744678bb0f1633ddc257ac424e8937 gprof/po/de.gmo + 073f4d03d9533fb204101adc3da53055 gprof/po/gprof.pot + 3200b107137800779c99ef43efe89299 gprof/po/ru.po +-47cc1e53113f8257863e47fdc5b30386 gprof/po/nl.gmo ++c989cd7c316f6036b6fe1884ac790809 gprof/po/nl.gmo + 76a3843b3608ac0340556b64abdb7c12 gprof/po/Make-in + bd6b67a82f39671135e22d6b82af9b92 gprof/po/id.po +-a6291e224a38571aa90c4c094842e80b gprof/po/sv.gmo ++1de73cd51f5c85f383a196043f2555bf gprof/po/sv.gmo + 6fd4220f5559ef54bd65740dbaf027b4 gprof/po/ms.po + c35bc1d7a1a56abfb6a2319930948b93 gprof/po/fr.po + 48d7f2e1a249fbed35a60d20a0d6bdd2 gprof/po/fi.po +-2b87c1764ec1b58eb944b222ba52e9a4 gprof/po/da.gmo +-3ffc0700fc323f64fa8388e6bb2d5ab0 gprof/po/ro.gmo ++37ad193eafc61b534e91b1fca1c58f13 gprof/po/da.gmo ++7067294c3f05a0c8863c12e55c14b6c6 gprof/po/ro.gmo + 9adf99ac0f499cd27ce0a09092542aa1 gprof/po/eo.po + 9cc0cd02def71f5e6ef2945c0fdb5d2d gprof/po/pt_BR.po + a52935eb8e1e266d36fbf5db73269510 gprof/po/de.po +-6de65c9491f6ff746010b4ce8bca6fa5 gprof/po/fr.gmo ++a3abd851ac7f132ac19f7c4f6e39e85c gprof/po/fr.gmo + ff9ad8b646b729cd31973c88491601d3 gprof/po/POTFILES.in +-faabeb1347fa5ecabd42b782555fd64b gprof/po/es.gmo ++7dd110af00a945c0d7f9d88bf15b1f3a gprof/po/es.gmo + 158d2b631f9135e470167dfc1657f4b2 gprof/po/nl.po + ab0c92d1e477f4bc4626d7acb175af4d gprof/po/tr.po +-35a0e0044d0163d108f773f3c4073b29 gprof/po/ga.gmo ++9c032753b1c72281437a22234a7535d0 gprof/po/ga.gmo + 93c0dba80444cad97217f531b8c5128b gprof/po/es.po +-bbde5be6e86cd0bf3314a1ad9f9e007f gprof/po/ms.gmo +-396f10f2b25e447de4461644e28d2303 gprof/po/ru.gmo ++cdecd7e02d2cf6fd3f92ad96bc7f4556 gprof/po/ms.gmo ++b9495a2ba103e7168f8eba42d86d3173 gprof/po/ru.gmo + 33b09ef08160aef7145f0e81c508b5a9 gprof/po/sv.po +-cf06bbad904fef556c0f56e5c937c80f gprof/po/bg.gmo ++aa2c1f2f3a7f53640b1ff634f0debd3c gprof/po/bg.gmo + 64b52a63f7385f504f5450407366b816 gprof/po/ro.po + 9f800bb7aceaae09bddf270ae4effd11 gprof/po/vi.po +-eab385bedc0e7b3e407ce6bf88f513c6 gprof/po/tr.gmo ++9848a4ccec5c474a73e46094c48fbce9 gprof/po/tr.gmo + 1b89a8120a0b39b02e8ecf8d8d016495 gprof/po/hu.po + 0810a10420813c84f28cccc3237cde38 gprof/po/da.po +-5b9214ada7105c4c6ea33f1a74578ea6 gprof/po/it.gmo +-f57af95b75e5f852d97fd5d30896e44b gprof/po/vi.gmo +-a31b942d64a13c261af290be03e40a60 gprof/po/pt_BR.gmo ++4d51d5415442587064587da37f3de0ab gprof/po/it.gmo ++8e8e2c4c30e1ae5dbf68c8bd6860ae6f gprof/po/vi.gmo ++4b1bfec4264e352513a88073af8a2830 gprof/po/pt_BR.gmo + 70aa3573bf03d4ec58c45b966e7c1a00 gprof/po/bg.po + 1e0c699b16bf864298283191829e7aca gprof/po/ja.po + 917f1270a68e00ff104adec000e4c1c0 gprof/po/sr.po +-3c60a40abe1663bc8577f7151c3bca6f gprof/po/eo.gmo +-bb33db615cee1741b18687c034874c6a gprof/po/id.gmo +-673bbd828790810dd775f6a08ac7aa6d gprof/po/fi.gmo +-6caef4d7466f584c8a1833f08dda3a5d gprof/po/rw.gmo +-691984b24c4d9880ebcccece1a1928e4 gprof/po/uk.gmo ++9ffe0fa30893d51ae23531da62da2a32 gprof/po/eo.gmo ++843c3d9276c55352d0f9bb835dca0f36 gprof/po/id.gmo ++71e5789d191525d9de45dcf38878516f gprof/po/fi.gmo ++cf26513cb17c498da2b2598c200a8d3e gprof/po/rw.gmo ++2990b7640e7e23817753263a424fafb9 gprof/po/uk.gmo + 980f47afbec5cac62db09df93b4ab6f3 gprof/cg_print.h + 490841b632df4cec81bed7991bb4b000 gprof/cg_dfn.h + b9244f926c41795d3ee901d0a7ff783f gprof/flat_bl.c +@@ -13978,7 +14001,7 @@ f6a3f0884b4107faf0b7000f6236e4db gprof/ + e7283b10d84f049416abdf4da00e4783 gprof/bbconv.pl + 7d36670d64d7d95b8a9394f0025afcb1 gprof/ChangeLog-9203 + 29b40bd7500168d526bc25ec5223a027 gprof/hist.h +-2ae96cc39d6dd66ca71eb87e640d8faa gprof/gprof.info ++c1b9cc589e9289e94d63be844a7aa0e0 gprof/gprof.info + 1ded054093de910d9786c62bc4fe8cc6 gprof/stamp-h.in + 970d15eb993afcb69d0fddcbc6f90ca6 gprof/basic_blocks.c + 7aade8a3440bb525f96e103158aa0ccd gprof/README +@@ -13991,7 +14014,7 @@ d77c6e9f87800c3a154de2eedaa81b73 gprof/ + fdcc8f993702b54ca52dce4953a60655 gprof/cg_arcs.c + 48d48d193408b10c5927a6b85911690a gprof/ChangeLog-2018 + 8aac881f089c8822f5b6e28a86039aca gprof/ChangeLog-2010 +-dccc080520376f9493fda2b87c2f9cec gprof/gprof.1 ++8abdd85ecd171924d116c52b2973766f gprof/gprof.1 + 35f9a3e59f13953e67adb299ce102e99 gprof/ChangeLog-2015 + a1584a3c9028aacd13ba40bc4f7b03a3 gprof/utils.h + 745ff1b458c66a2bdcc3d275761355c9 gprof/config.texi +@@ -14118,7 +14141,7 @@ ebea4fe7aa69a6072cacebe4e6575024 includ + a126860582100dd97b0464c8382b6f36 include/som/reloc.h + c8de48c3d7a8de69489757d4a947bb9e include/som/ChangeLog-1015 + dcb1773a033208d8841e7aeb934766f1 include/timeval-utils.h +-0e084a502d5e186cb4f3941f7fadd350 include/dwarf2.h ++2e53eb7cf97414eaada073f148118b5b include/dwarf2.h + 62073819d982d28def6d77eaf8875e99 include/leb128.h + ce77417f7a6b815c8b1fd23964e17ea3 include/aout/hppa.h + d0265b9508ff19ed532ad141a490e877 include/aout/hp.h +@@ -14132,7 +14155,7 @@ d648b1263fe90f97b6f56398612f81e5 includ + 8d8aa9eeec25b25da4bfafcc670162b3 include/aout/ChangeLog-9115 + b21cf2ec557184abd01d41430bf27416 include/aout/stab.def + d32239bcb673463ab874e80d47fae504 include/COPYING3 +-b05cfda2c49e29a91fad150f68d53b32 include/ChangeLog ++9956b5428ecd1cd3eed3befcb5badf68 include/ChangeLog + f0cdd5fb48621662ecc1681d6fc43ab9 include/dis-asm.h + bbcb9f48c2a005e0ae11abf31e419627 include/hp-symtab.h + 41879305404d3b06773b10ab3fa44539 include/ChangeLog-9103 +@@ -14213,7 +14236,7 @@ f930341d18cd2a1f436f172e816e833e includ + b9071821fd18dce5b86816d8eae210b5 include/gdb/sim-sh.h + a50c053cf83562cdd0f22ec5090f3f22 include/gdb/callback.h + bc5050da821be6e9ab7fd0731dc9cfdd include/gdb/sim-aarch64.h +-4edf065770486b1b7a5d19a727fb9483 include/dwarf2.def ++d7e15a47bb20b43ff9781a375d19450e include/dwarf2.def + 50e100c98a7470f850101e4e6430496b include/sha1.h + 9ed0881b1f6e0779c56e231138e18869 include/cgen/basic-ops.h + fe90cf258655934a38ca1b2356c3bad8 include/cgen/bitset.h +@@ -14423,7 +14446,7 @@ fc53ffc3e25b9391b452e238dda80f53 ld/emu + 9fec4f088a9658fa3daaa8b16c0dabe9 ld/emultempl/elf-x86.em + 25d18fdb63ffcad410d0380aecf0b61d ld/emultempl/README + 1c5d0b42defa7b7840d04583ad5e5f40 ld/emultempl/spuelf.em +-2c70898692270594aa9ea25779b591eb ld/emultempl/ppc64elf.em ++c8a63d6a74cd0516bc769472cb43f86b ld/emultempl/ppc64elf.em + 6de549c407c5de84c6bacda8f60f59fa ld/emultempl/riscvelf.em + c9f25408ae67ee31b42e684d940f1416 ld/emultempl/ticoff.em + e28937827a75cbecfa8a403a99b09061 ld/emultempl/elf-generic.em +@@ -14456,7 +14479,7 @@ e2db490aaf4ab5bd273fbdf607ca70f3 ld/pep + b4ea35b18cd631b1a84c4d66b5fbf17f ld/ChangeLog-0001 + 1af0967e3955a6689b9ae9469e89054e ld/ldexp.h + 21738d1e57a5141cbdacebdd917d2a86 ld/testplug4.c +-e68df390bafe8a495d072ab1e0dfa40e ld/ldgram.h ++1a77dc1c48e901c0a011104265b20ad5 ld/ldgram.h + cb83c58e2db10afdd1e6f57b2ab02d1a ld/ChangeLog-0203 + 52e0360f28b8ea9eb88d512c6c106c43 ld/ld.h + 3556a9e9c8d12c48a4fdb5f867351624 ld/ldmisc.h +@@ -14470,13 +14493,13 @@ dc2b83e6245120a4c1608e939b4a99b5 ld/ldv + 67fe5cbb43d1eaf0acf2b0b0f51a64a2 ld/lexsup.c + f264e32e04e4052058edc449dc29b054 ld/configure + dc2d5ed03d6fffab2a51a0a756205881 ld/ChangeLog-2011 +-34fd25381295478e92bc5100e9ed2999 ld/ldgram.c ++5c7d00a4ca5d8f095fd7c1bfd5c0c5cf ld/ldgram.c + ac84674bd3ec2f716f04644b72ceb568 ld/ChangeLog-2009 + ab0fe311032294b952da80585b8b90e7 ld/fdl.texi + f4be0f01d8cb3cf02227a654acea1f26 ld/aclocal.m4 + c9b12ed202af750ca8d9fa48b6efa963 ld/ldmain.c + ecd5454c7242d9f083003a2ca244d1c9 ld/deffile.h +-074bcbfc05b9f2cfbd5ae95312f07c0e ld/ld.1 ++432ab2db12389f6aac0fee1594181987 ld/ld.1 + 537064eef449bf7b709d0656d3b2df9d ld/ChangeLog-2017 + 59217f22ee78753701ad3d51e4e0b0e2 ld/ChangeLog-9899 + d743da872ddb6a4cc1cd5c367f2f8dfd ld/ldmisc.c +@@ -14484,12 +14507,12 @@ d743da872ddb6a4cc1cd5c367f2f8dfd ld/ldm + af4a32e889f1c8ef6388777faf504de0 ld/genscrba.sh + 8601875cbc504132fbc86f9812be3b40 ld/ldbuildid.h + 5879a97d6b285d29ef28381666db90ac ld/pe-dll.h +-d6fa19d36248f9b0e8421c997ff4f947 ld/deffilep.h ++2fcbecca64e2a16bdf6615bbcc9cad58 ld/deffilep.h + f37482f68e67b8c53e30ee5bb7d80788 ld/ChangeLog-2014 +-48a3ac95a93ebfd9f29e142c901fd0e8 ld/ChangeLog ++afdeda11de64c40857a14e0aee419c10 ld/ChangeLog + 2dcdec47a460e0200552a6bf23015dd7 ld/ChangeLog-2007 + 01627b664c7e61ab5dc202bb72913e0a ld/TODO +-9af086f12c0785a11d1c23b14446f176 ld/deffilep.c ++8d0b2fb6054ee621b3ffe5d0e3caa72c ld/deffilep.c + da73aad6396daa6072d443c12133ee0f ld/.gitignore + 88fd2f9d01dc19f269bdca34b78bf190 ld/testplug2.c + 11ae42f92445895faaf3bab1643dd7e7 ld/ldwrite.h +@@ -14497,48 +14520,48 @@ da73aad6396daa6072d443c12133ee0f ld/.gi + 905b76ac557237a098d3beabacfa490a ld/config.in + 4f683b032796acd7247220b18f5242e9 ld/MAINTAINERS + d97ae0b64bf61d279650e5d324318a43 ld/ldelf.h +-5649404d409e55103d6d836ffb213115 ld/po/ja.gmo ++709d4f1c430222fbe110d5942e885434 ld/po/ja.gmo + 47f3bb6752a2360e505e16799a15d617 ld/po/uk.po + ddca831708ab614c176c407295dc8718 ld/po/it.po +-565e862b6e9490da903f4f0327bfb9f0 ld/po/sr.gmo ++697a6d7ea7641c9068a78c3b7b3b3498 ld/po/sr.gmo + 76808e90c50bdc960355a5bbc633ece2 ld/po/ga.po +-019f1e5a823132b2fec968cfeb25d085 ld/po/de.gmo ++3ea8949fae591e0dfdf1c9def503d94e ld/po/de.gmo + f0a2305fde45fbb7b6f004acb65c2100 ld/po/ru.po + aabbcad997cb1b62c235ee3f466e0d71 ld/po/Make-in + dddaf916d4d6771dccb1772ea72967bb ld/po/id.po +-650e58538722b296856df53d3fb23a19 ld/po/sv.gmo ++f80448ca6933ffca08d242c3fa669981 ld/po/sv.gmo + 13e72f9d834478e398b471127c09b00d ld/po/ld.pot + c7b081a67214b64486622241dd1b6a57 ld/po/fr.po + 501023066526f511b03befadedc08b5d ld/po/zh_TW.po + 5157da0b4e36c8f075d80ad612e14dc8 ld/po/fi.po +-0a64b6be22df8da37be3722774a71346 ld/po/da.gmo ++24dd69962bb95d4a9d01f5358fa84243 ld/po/da.gmo + 033252866ebc10891863f09dfc23fa76 ld/po/pt_BR.po +-70711e4f28756861f3e3d101fad56600 ld/po/zh_TW.gmo ++1b3f92ab8b2874975229f20649f30cf1 ld/po/zh_TW.gmo + ecb903c9a332f2bdc20d610db9cfeada ld/po/de.po +-efe129845d74f7f7bc7f80cf9f929b90 ld/po/fr.gmo +-e1ffb00e86307abbfb35064f3ae7c1ad ld/po/es.gmo ++38a2d114fcb6455da8c93e46c9388413 ld/po/fr.gmo ++e0e6846c6a0416373f739507bf351857 ld/po/es.gmo + a1cea3aa157d181980cc5287929ca373 ld/po/SRC-POTFILES.in + fda23c07cd84833d38f85a52205b33b7 ld/po/BLD-POTFILES.in + d0ed07ceae7d5a1e24bffab138e8d87a ld/po/tr.po +-9de2b7e7eaba20a2b22c91d744471b6f ld/po/ga.gmo ++914b2898e7d4852dd89a3b71b5b81447 ld/po/ga.gmo + d9378bebd2aae3886d6839160d5f9577 ld/po/es.po +-0ebc6082fffb2cbaa16febfc87b900e6 ld/po/ru.gmo ++d0a0256c00bb399c4dc09b32ba8f0128 ld/po/ru.gmo + 3f0fa64944eb91e2d39dd38ae994c42f ld/po/zh_CN.po + 7c3f31a2afdf691579d5d39976003255 ld/po/sv.po +-cc3f55ac9ab50ebcbbc6c6f0ef85493d ld/po/bg.gmo ++e91eee9703c0c11948d00ab4f1d62468 ld/po/bg.gmo + 2f16bbd03d864146d2321b16d44fddbe ld/po/vi.po +-1d546d1e27523b1a55b7580d52298318 ld/po/zh_CN.gmo +-50a49653b96224aedd90221e3e4e4e15 ld/po/tr.gmo ++3e5ea929744545acf0f450f475202725 ld/po/zh_CN.gmo ++f2622efad02dc94f994f32a06b16d1c6 ld/po/tr.gmo + 8fbbfc6b92c235533090fe4362886399 ld/po/da.po +-dad5bd1e12674d48e178450acc3a53f0 ld/po/it.gmo +-fdd8f03c99edc24c71425bc8715f4beb ld/po/vi.gmo +-3b116ecf44fbf8036e03614379fec8b3 ld/po/pt_BR.gmo ++0cbdcb4959ed849025b12112c911a2c0 ld/po/it.gmo ++141a3a9bed0942909494ae67451c7b9a ld/po/vi.gmo ++811ae3079bdff37f65066a9cf04659a5 ld/po/pt_BR.gmo + 1f01c37f49fe8232eac6d7cba69f5dfb ld/po/bg.po + a846e092e1949919866df2fc7aa70974 ld/po/ja.po + 2f082e5fdc803a56cd35b60cfb21c099 ld/po/sr.po +-45227c4dcdf41fe389236ea8bf2dcb72 ld/po/id.gmo +-c5d2e1d5c16ace5e9a0f1af13c71e6d1 ld/po/fi.gmo +-2a71d67ac6ab1ed499f1ca820f226552 ld/po/uk.gmo ++c5169d44264f466f2b3669991da73b0e ld/po/id.gmo ++32f1e2f33b5c08a3ef7fd10e91f47950 ld/po/fi.gmo ++a2a1deb94ba5aa7b65067573fc973f78 ld/po/uk.gmo + 18912267e9bd292f80b832e33b6d66ec ld/sysdep.h + 1903f8caa7e43619ea9a1da5caae262b ld/configure.tgt + 3f7d50c17851cfe9950e7800985afc09 ld/ldwrite.c +@@ -17859,7 +17882,7 @@ d9665b4d01878353ed82a9a9f65bd4d6 ld/tes + fdaf994b2d3ebcedc72a9af413b8fc00 ld/testsuite/ld-powerpc/tlsdesc.s + 3857919e47dd829ed09d10b7e95ebd0f ld/testsuite/ld-powerpc/ppc476-shared.lnk + eae90335b934883174ffcb7075304fe0 ld/testsuite/ld-powerpc/tlsexe32no.d +-2221887e28dfb6f2b9d32e24b4a40ce1 ld/testsuite/ld-powerpc/tlsopt5.d ++d473889dee716533f4d6d719945d7d11 ld/testsuite/ld-powerpc/tlsopt5.d + a352b6b7bbeb8ffbfa429512fa97f22d ld/testsuite/ld-powerpc/tlstocso.t + b33f85b9adcc3beb02ccd352c9763e79 ld/testsuite/ld-powerpc/tlsso32.t + 183c6381d996d5542d6460c80e0342a8 ld/testsuite/ld-powerpc/tlsno.d +@@ -17887,7 +17910,7 @@ fb7e959e27d0729bfa5e91a3d4c082a7 ld/tes + ccae0b5ade0f69de00e983cb7e34a762 ld/testsuite/ld-powerpc/tlstocso.g + 519a83f6661f4e92b4f1cd2404e97f90 ld/testsuite/ld-powerpc/apuinfo-nul.s + a45bfbc7ed40f4d7c8e08bbd5e694922 ld/testsuite/ld-powerpc/notoc3.d +-27ed0d7b9f6a134088c3f729e46d991b ld/testsuite/ld-powerpc/elfv2so.d ++cad70a0bd3857afa4d97204b5f08dce6 ld/testsuite/ld-powerpc/elfv2so.d + fed89963c6094ee31776b29c918d6a24 ld/testsuite/ld-powerpc/relbrlt.s + b6ea6463608234d456d35f3cc9c372a9 ld/testsuite/ld-powerpc/tocopt2.s + f5680debd0ba406286990ffa16cbb481 ld/testsuite/ld-powerpc/relocsort.s +@@ -17909,7 +17932,7 @@ cb66c732360a0e5c19be21538f028089 ld/tes + a78cf83e5427170c21b55ba4a1106454 ld/testsuite/ld-powerpc/aix-glink-2a.ex + 123061df52af683bb91dcb4a84c3d83c ld/testsuite/ld-powerpc/aix-weak-3-64.dd + 100faa6f6f0ece8bc22cf9942604bdcf ld/testsuite/ld-powerpc/attr-gnu-4-10.d +-e8b89716ead8ddb541ac3368f06de664 ld/testsuite/ld-powerpc/tlsopt5.wf ++eaeff6718f279792e36306894b9af2a2 ld/testsuite/ld-powerpc/tlsopt5.wf + 6ca383d78ef4168f9d1ae127c7ba751c ld/testsuite/ld-powerpc/tocopt5.s + 5709dbb8cfaf695ab6e93c167ab6de30 ld/testsuite/ld-powerpc/apuinfo-vle.rd + e0e797cffd8e7a6332ce998ea84bd3c6 ld/testsuite/ld-powerpc/vle-reloc-def-1.s +@@ -17932,7 +17955,7 @@ d3b07384d113edec49eaa6238ad5ff00 ld/tes + 4e61b65b073284b8374f66dd17e9ac43 ld/testsuite/ld-powerpc/relaxrl.d + c519be98d68f3a272ce7e17d1d025a31 ld/testsuite/ld-powerpc/tls.d + 7620104bad7a2b27971dbddb20280fcf ld/testsuite/ld-powerpc/defsym.s +-27167e1a98bef6e6a93adbfa97399ea1 ld/testsuite/ld-powerpc/tlsopt6.wf ++fdbc9fd2459f6631ab4aaa4448acc669 ld/testsuite/ld-powerpc/tlsopt6.wf + 546d5841cc5a13b01ea4e1d47f3bdc25 ld/testsuite/ld-powerpc/vle-multiseg-6b.s + 8f65a3b55c41075af46b20b6cb3beceb ld/testsuite/ld-powerpc/plt1.d + d87e9f79c37daa3295d7d4bd17fdf2b6 ld/testsuite/ld-powerpc/tlstocso.d +@@ -17964,7 +17987,7 @@ b79171d8be5d847a9c5640044a63d929 ld/tes + 995efaf46f9360c2de42cc707df57cbe ld/testsuite/ld-powerpc/aix-ref-1-32.od + b11b5807e7a6fa381d608f06a71e0bb1 ld/testsuite/ld-powerpc/sdadyn.s + d175fb5ebf6d91d3b1a27c75d35025ed ld/testsuite/ld-powerpc/vle-multiseg-1.ld +-38aa03810fff957e57418d629e3ce3c0 ld/testsuite/ld-powerpc/tlsdesc2.d ++af9a2fd6ad977981238c1288fa454933 ld/testsuite/ld-powerpc/tlsdesc2.d + cb270bf337b981b81c1481dd8cfd485c ld/testsuite/ld-powerpc/aix-core-sec-1.hd + 49caafb69f40b8a577be43f820053636 ld/testsuite/ld-powerpc/non-contiguous-powerpc64.d + dd65a441f5f793c81ffbd7e0534afc5e ld/testsuite/ld-powerpc/dotsym3.d +@@ -18002,7 +18025,7 @@ aaab138c73a56e0d51a845129e531690 ld/tes + 8fadef018683c2f15d139339ffcac574 ld/testsuite/ld-powerpc/notoc3.wf + 8acd8ea8c67e5be3946058ca30146544 ld/testsuite/ld-powerpc/aix-weak-1-rel.nd + 374aa6a557b88260efd096cf5efb9daf ld/testsuite/ld-powerpc/aix-weak-3a.s +-df8a19d1dc602702029c582ffe1620a0 ld/testsuite/ld-powerpc/notoc2.d ++61e880275c117c395e46db7e067c6288 ld/testsuite/ld-powerpc/notoc2.d + ad9d2b5d73dfd934a9f3b3496d13bba3 ld/testsuite/ld-powerpc/ambiguousv1b.d + f4eb5269aff1f1e2c3a66d6ce975f819 ld/testsuite/ld-powerpc/ext.d + a0959eef8181dbee1a8059045e431ddd ld/testsuite/ld-powerpc/powerpc.exp +@@ -18076,7 +18099,7 @@ a5493cd07fc73ebfaa18aca44b813d9a ld/tes + cf7a65950ea5277d63c47063e3419409 ld/testsuite/ld-powerpc/tlsno.g + c4fb672b12a30041fe72cdf7cc9c21b5 ld/testsuite/ld-powerpc/powerpc-64-export-class.xd + 90e311a4e119e7d08bf05bc2d00e07f1 ld/testsuite/ld-powerpc/tocnovar.d +-700b8f805b304fe498d16d0f21fadee6 ld/testsuite/ld-powerpc/tlsopt6.d ++bfa0c9a1cacf0fc8237671185e990944 ld/testsuite/ld-powerpc/tlsopt6.d + b50df70b35e6fb46cc508111031d68df ld/testsuite/ld-powerpc/tlsdll.s + 4750c765b98ac834cc9c1b4174b54bfe ld/testsuite/ld-powerpc/tlsdll_32.s + 28194ee58721b06c5d73c7cf30d23dec ld/testsuite/ld-powerpc/relax.d +@@ -18086,7 +18109,7 @@ d0ee6fa6b995898c87e85a7bd2930f84 ld/tes + e5c3514810db821e5e91d793100a6844 ld/testsuite/ld-powerpc/non-contiguous-powerpc.ld + e351e17c0cf530ec3b31fa6a8dccd294 ld/testsuite/ld-powerpc/export-class.exp + 4237df48b26069a7f09cc9c38b10844e ld/testsuite/ld-powerpc/aix-toc-1-32.dd +-cad26f3c1bca5dcd610f843924fd83f9 ld/testsuite/ld-powerpc/tlsdesc.wf ++bc74d6aa89a28b15c2f43f0513136ece ld/testsuite/ld-powerpc/tlsdesc.wf + 4f54509ed276d07de0aaf4e369c4187a ld/testsuite/ld-powerpc/vle-multiseg-6.ld + 865a609d25ae921a90e55a8694faecdd ld/testsuite/ld-powerpc/aix-lineno-1.txt + 9fd2efd79e26dd704a262391abfbd37c ld/testsuite/ld-powerpc/aix-abs-reloc-1.im +@@ -18164,7 +18187,7 @@ d3c9a419b5e0dfe645f6cb581879d7e6 ld/tes + 748dbeb15f66cfd60128c9ac65a2a55a ld/testsuite/ld-powerpc/aix-weak-2c.nd + 5918d3170fd91d138640e5fe9e016f7e ld/testsuite/ld-powerpc/aix-glink-1.ex + b47146af1a449575aa5f1dc04f7a3cd1 ld/testsuite/ld-powerpc/aix-export-1-full.dd +-8a570ffd865d270d0f31a3bf9b6fb0b9 ld/testsuite/ld-powerpc/tlsdesc2.wf ++c22ff0351ef91f4d77814f832af91e3d ld/testsuite/ld-powerpc/tlsdesc2.wf + 9847eb1d47ed49e5b41f025760592bc5 ld/testsuite/ld-powerpc/tlsexenors.r + 53652025c67e058e17ee2f5b68f62577 ld/testsuite/ld-powerpc/reloc.s + 218a7083014093b0da1ec318e619b074 ld/testsuite/ld-powerpc/tlsopt1.s +@@ -20118,6 +20141,7 @@ d9175c5aca72e80d5d0658a075e95b67 ld/tes + 0068391443de89b45246238d498c1fe0 ld/testsuite/ld-x86-64/pr19175.d + 3bf401a827e886fca415b1f170087c7b ld/testsuite/ld-x86-64/tls.exp + a40f7aba3e070b5c9f979abd5dae4420 ld/testsuite/ld-x86-64/tls-ld1.S ++672ba6dfa584f01d5854a7dd743f4ac9 ld/testsuite/ld-x86-64/pr26711-2.d + 73db577c07079cb22cd17cef6f58ccf4 ld/testsuite/ld-x86-64/no-plt-1b.rd + 2938afd6c0980a9477fdc6033b3bfad4 ld/testsuite/ld-x86-64/pr19539.t + fe643bf810a7f5f4775e9f4fa0b21f2e ld/testsuite/ld-x86-64/pr19609-6.s +@@ -20234,9 +20258,9 @@ a28eb51c239d35150e9847f653c88ad0 ld/tes + a7f14cfdb1dcfdaa9c4b69488d4ef6bf ld/testsuite/ld-x86-64/pr24721.d + 2d95976a3e217d50d71ac6620bb1bf13 ld/testsuite/ld-x86-64/pr20830.s + 9d4826b472b420d03ec07e6642c1608a ld/testsuite/ld-x86-64/load1c.d +-def923170610fc1cb91815dbbe14cf67 ld/testsuite/ld-x86-64/property-3.r ++937f6daa0d6886f614ffa225a6503133 ld/testsuite/ld-x86-64/property-3.r + ba27b1cddc76e57ac01282f87133a8c2 ld/testsuite/ld-x86-64/property-x86-4a.d +-75a2383466907203a84d45d2a4b4a61a ld/testsuite/ld-x86-64/x86-64.exp ++e64550d6723a29378b2c8ed0475f81fc ld/testsuite/ld-x86-64/x86-64.exp + 6a4babcc074e9c5cbc182892cd9ec99a ld/testsuite/ld-x86-64/tlsbindesc.sd + 9b3116f94d6239d75f6670771ff38f80 ld/testsuite/ld-x86-64/pr19636-2h.d + fcc014aa298a185b3e0d7c79cb02515b ld/testsuite/ld-x86-64/pr18900c.c +@@ -20245,7 +20269,7 @@ f9117653fa0de99fc05abcc0eaf0bd58 ld/tes + 4536be93b70709a7fb05b1cdbd0835f5 ld/testsuite/ld-x86-64/pr19636-1e.d + 3854a14dddcd0cccb63327647db618f9 ld/testsuite/ld-x86-64/tlsgd9.s + 8d45d88edb169c63b9cde50875f663fa ld/testsuite/ld-x86-64/copyreloc-lib.c +-85c606d50a6d2b65e2cc1fb7c18f3585 ld/testsuite/ld-x86-64/property-4.r ++1739ddae1d37693f7dcae486ce88847d ld/testsuite/ld-x86-64/property-4.r + e5bceeea7613b8d9c157210660cadcb1 ld/testsuite/ld-x86-64/tlsie3.d + b2e2be1d95860c3b4b08e4a68c5c7cd2 ld/testsuite/ld-x86-64/no-plt-1c.dd + 6e219f6ed3d425933d2bda4b9159e35f ld/testsuite/ld-x86-64/pr23372f.s +@@ -20259,6 +20283,7 @@ a6a8eb73290596aa027a8ec596189f29 ld/tes + 6a3c89acc0efcd9deb696826c3f07db2 ld/testsuite/ld-x86-64/property-x86-5a.s + 898fe0d28f6857c383e8adcd9c65e438 ld/testsuite/ld-x86-64/tlspic.dd + 2d4b4a3cfc83821ce017dadedb160ff2 ld/testsuite/ld-x86-64/property-x86-cet3b.d ++d221f615ecc94f766b731b8c13fda15d ld/testsuite/ld-x86-64/pr26711-3.d + aef8fa1c89a722690f2ecf4e8aaba01d ld/testsuite/ld-x86-64/pr19175.s + 6ad69407205b1009d043a3740f09b143 ld/testsuite/ld-x86-64/pr12718.d + 7161501105959be64be4d6810784436b ld/testsuite/ld-x86-64/pr19609-2c.d +@@ -20393,7 +20418,7 @@ d80ec7cc946f8a32f238d28da7336933 ld/tes + 59bd2a154367c9bdaa33b43b8127ddd4 ld/testsuite/ld-x86-64/property-x86-cet3a.d + 496fd1a1f131249131bd4fb7e8337ca6 ld/testsuite/ld-x86-64/lea1h.d + f5569686ca0c5ad0ac96424dc63fd5f9 ld/testsuite/ld-x86-64/protected7.s +-2e5a4d2fc7328ee6ead08390b7438fbd ld/testsuite/ld-x86-64/property-5.r ++f3a5d3aa3047dd461baab4ae159c282e ld/testsuite/ld-x86-64/property-5.r + 5275a46fd93b3c5cfd209d23a2747bd4 ld/testsuite/ld-x86-64/property-no-copy.S + 4358331beb4e42afb63e916bdef1cd3b ld/testsuite/ld-x86-64/property-x86-5.d + 2bf1b084796dc25d224d575ab458900b ld/testsuite/ld-x86-64/gotpcrel1d.S +@@ -20558,6 +20583,7 @@ f2eec97b9af638c925d4f5a7eb8604c7 ld/tes + e9ab46d66af4070be7c2e3480418c950 ld/testsuite/ld-x86-64/pr23486b.s + a2a410581fa9b0812cb8bf313c72cec1 ld/testsuite/ld-x86-64/align-branch-1.d + 4188969906171c0e1f069624be84b762 ld/testsuite/ld-x86-64/mpx1c.rd ++cbabf560d14318b4311249a0b86af2b7 ld/testsuite/ld-x86-64/pr26711-1-x32.d + c393ef4b0a813e1c9bdfb422c19d176d ld/testsuite/ld-x86-64/tlspie2c.d + 400cfdf7cc6e65e74a95e5ecef20fe46 ld/testsuite/ld-x86-64/pr20253-1j.d + dd6c4c5423bc3836346aab14df0b5419 ld/testsuite/ld-x86-64/pr23372d.d +@@ -20570,6 +20596,7 @@ e2f08ab60db28304daeae42ad919d1f5 ld/tes + f89617445e5c509600ca74dd12577397 ld/testsuite/ld-x86-64/plt.s + 0cd540d75c98b4a8d5b4fe06e4ea3720 ld/testsuite/ld-x86-64/pr20253-1.s + 5bd7f1106eb754fa60bf7c141db76aa8 ld/testsuite/ld-x86-64/pr19636-2c.d ++acfdf5492dd0d316ff015fcb2413e48f ld/testsuite/ld-x86-64/pr26711-2-x32.d + 4188969906171c0e1f069624be84b762 ld/testsuite/ld-x86-64/mpx2a.rd + 86983dbba838659fbfb4cbdfdb7c0324 ld/testsuite/ld-x86-64/tlspie1.s + 8ce18bd44b3a9f276cd9cd80965650f3 ld/testsuite/ld-x86-64/pr19784c.c +@@ -20699,6 +20726,7 @@ c69b421c689e572c76f6063db501af9d ld/tes + 044e55f08c519af7769757900e6f7f75 ld/testsuite/ld-x86-64/property-1a.r + 24994c28b7c840d524f8c853a2fa7bff ld/testsuite/ld-x86-64/pr18176.s + fb3673f1e87f12300c62149504d1d5c6 ld/testsuite/ld-x86-64/pr23486a.s ++e319b1a3e44d1e3dd71b06d9b0e5cc2e ld/testsuite/ld-x86-64/pr26711-3-x32.d + c70a0e110d9207f9054e30143a5638ba ld/testsuite/ld-x86-64/property-x86-shstk2-x32.d + 7080a1e97e7d1681e5a1e9da28ccc65e ld/testsuite/ld-x86-64/tlsie1.dd + 5552fbc10a6a35623dc34733aae081f9 ld/testsuite/ld-x86-64/lea1a.d +@@ -20748,9 +20776,11 @@ f67e2f8f98f24d7e2e82c99bbc590805 ld/tes + 1eccb618d95e721641240b74ed62c642 ld/testsuite/ld-x86-64/ia32-1.d + 874bac252033f5d2e082954902385444 ld/testsuite/ld-x86-64/pr18815.s + 1f9a94a9cfa9c9c9a47e82e564694114 ld/testsuite/ld-x86-64/pr23372c.d ++3e4cb347bc9e5b04f8e46aa82606d5c0 ld/testsuite/ld-x86-64/pr26711-1.d + 21104172f0d83fab6d3f27b04857f112 ld/testsuite/ld-x86-64/tlsdesc.pd + 092551c720d9237b2142c771156f85bc ld/testsuite/ld-x86-64/split-by-file2.s + af608ebdb9d7b220212318f0308723ad ld/testsuite/ld-x86-64/bnd-plt-1.d ++bf16c1fa16fefe63f097213859f3572f ld/testsuite/ld-x86-64/pr26711.s + 6e01781f925609bb0cbf9950444aeea6 ld/testsuite/ld-x86-64/pr25416-3.s + 42fbc1989f2aedaf714a703311b996f3 ld/testsuite/ld-x86-64/pr20253-2b.S + 7a3750eaf2750784eaee64659eada40e ld/testsuite/ld-x86-64/ia32-3.d +@@ -22111,6 +22141,7 @@ f1c77b700705334ba881aacb565021e8 ld/tes + 8c4801ff70808f8dafaec24d9085dbb2 ld/testsuite/ld-i386/property-x86-empty.s + fbd1ad758d6421e87677adff7c6f874a ld/testsuite/ld-i386/tlspic2.rd + 8377d7a7055acee71697a1787cee770d ld/testsuite/ld-i386/property-6a.c ++1f0150312e0524ca038d9c65ce3cc8af ld/testsuite/ld-i386/pr26869.d + 2758da88c5ad71a80c1fda01e0c2d415 ld/testsuite/ld-i386/plt-main1.c + a0008682cc2494ebe07d6cd4bf4d9a01 ld/testsuite/ld-i386/protected6a.d + 64b6361a5383c255316478aa2a524f01 ld/testsuite/ld-i386/plt-main4.c +@@ -22140,6 +22171,7 @@ dc0a05383f59ac1cac7770c08a4df1bc ld/tes + ab7a71ba927c9f1c1688f7c79d87b3f1 ld/testsuite/ld-i386/tls-ld1.S + 6c8132b31d76a2534f28aa37107d6ce2 ld/testsuite/ld-i386/got1b.c + 8a7d276cd3303f692b21f2ab5d40f3b7 ld/testsuite/ld-i386/pr19636-4.s ++12e9151a83f44dba6d967499ce82beda ld/testsuite/ld-i386/pr26711-2.d + a0f3284062d2ecad28ae82ee5eba6e0b ld/testsuite/ld-i386/no-plt-1b.rd + 2938afd6c0980a9477fdc6033b3bfad4 ld/testsuite/ld-i386/pr19539.t + bb3d4ff0fc0e3af315453bc50a102bf2 ld/testsuite/ld-i386/tlsgd4.d +@@ -22215,13 +22247,13 @@ adf3d3417bacbbbbd44af52a3a9d1879 ld/tes + 51cf92616340cd638748f0f817061922 ld/testsuite/ld-i386/pr20244-4a.d + 4215e8b1b6b2d2ff606fd3b4b97b32d2 ld/testsuite/ld-i386/mov1b.d + dae2a41c47b52d598ae9d39c9322be58 ld/testsuite/ld-i386/pr20830.s +-def923170610fc1cb91815dbbe14cf67 ld/testsuite/ld-i386/property-3.r ++937f6daa0d6886f614ffa225a6503133 ld/testsuite/ld-i386/property-3.r + 40c7b3d9d3cb4099d7112b2d1d90dba1 ld/testsuite/ld-i386/property-x86-4a.d + e03c204939e1491698c9c1113df7c224 ld/testsuite/ld-i386/tlsbindesc.sd + fcc014aa298a185b3e0d7c79cb02515b ld/testsuite/ld-i386/pr18900c.c + 9a76857e115b6f6ed4654047fadfd0f4 ld/testsuite/ld-i386/pr19636-1e.d + 8d45d88edb169c63b9cde50875f663fa ld/testsuite/ld-i386/copyreloc-lib.c +-85c606d50a6d2b65e2cc1fb7c18f3585 ld/testsuite/ld-i386/property-4.r ++1739ddae1d37693f7dcae486ce88847d ld/testsuite/ld-i386/property-4.r + 2ebeb06b9e469679c1137f8dd88648e5 ld/testsuite/ld-i386/tlsie3.d + ba5ad774be690e362ab6ea0fbd13fdb8 ld/testsuite/ld-i386/no-plt-1c.dd + 8374b35f68412379bade5bfa6ce108b2 ld/testsuite/ld-i386/dummy.s +@@ -22231,6 +22263,7 @@ fbfd82c1904aafdc454c9b25164bf59e ld/tes + a7349003880697259340d64a45824e81 ld/testsuite/ld-i386/pr19636-3d.d + 8429c7bf2ca7750c8a36d9396b8885ee ld/testsuite/ld-i386/tlspic.dd + eb11b4ca625f95d8e4b78be8c07d3cec ld/testsuite/ld-i386/property-x86-cet3b.d ++548eb70eee34107e4be340ab1b163f36 ld/testsuite/ld-i386/pr26711-3.d + 14592c0e93294d76ec4d68c8d0b5bab3 ld/testsuite/ld-i386/pr19175.s + d78c5aedeb6ff3492edc6643fed456bc ld/testsuite/ld-i386/pr12718.d + 41b2930fb0e645070c66b878b9affd92 ld/testsuite/ld-i386/pr19609-2c.d +@@ -22295,7 +22328,7 @@ d3e5ca870e218a1b1dcb656e0bfaa3ce ld/tes + d2111de90708836dd985ebf2fab9c0c6 ld/testsuite/ld-i386/mov2.s + 1f67324497808c3a0ca2f85867fa7e0e ld/testsuite/ld-i386/pr17306b.s + 04071b12b009bcd5f62fa0bc21cc086a ld/testsuite/ld-i386/no-plt-1e.rd +-a8bb85844d6cc228cb97bc66c496ade2 ld/testsuite/ld-i386/i386.exp ++d29abc0536d9f5f8c3bde2f3ec6dc256 ld/testsuite/ld-i386/i386.exp + 757d20a2f3d062fd7a67bd3c98e67785 ld/testsuite/ld-i386/pltgot-2.d + dabd961c76ee8fbe5a666f217e83e1a5 ld/testsuite/ld-i386/property-unsorted-2.S + 7bb563a68c73c04c063145ef521edde3 ld/testsuite/ld-i386/tlsbin.dd +@@ -22330,7 +22363,7 @@ c270ac563d86329f5e235a20678b44fd ld/tes + 5ddb99810569a153d2019e1d012ffcdf ld/testsuite/ld-i386/got1a.S + 4e71cb709472d7ae3a1798c1a1043c70 ld/testsuite/ld-i386/tlspie3b.d + 77c39750e93b7e520944a4bf4c4a4024 ld/testsuite/ld-i386/protected7.s +-2e5a4d2fc7328ee6ead08390b7438fbd ld/testsuite/ld-i386/property-5.r ++f3a5d3aa3047dd461baab4ae159c282e ld/testsuite/ld-i386/property-5.r + e6677dab6b4d38bb7f178f66ee6f25ad ld/testsuite/ld-i386/property-no-copy.S + 6eccc1365d24adc8e881ed57bb5a8c81 ld/testsuite/ld-i386/property-x86-5.d + 42bef54559629b445513f8ffbbf445b9 ld/testsuite/ld-i386/pr14215.s +@@ -22364,6 +22397,7 @@ c8879832168a7e3fbb8185e3f668a4ff ld/tes + d9d64e8ca2b43c851eacaa021767eafa ld/testsuite/ld-i386/hidden3.s + 170e9fecd69212c4af449953b33a1ccf ld/testsuite/ld-i386/branch1.d + 94b6da333cef7b619c459007a7afbbe5 ld/testsuite/ld-i386/vxworks1.s ++6e8ed01bedfff10c21373150fc343b27 ld/testsuite/ld-i386/pr26869.s + 2ccc12d6f3696c2a95493b08c1977e60 ld/testsuite/ld-i386/ibt-plt-3b.d + 2fe2e197be7e56b420325c0aa5ab9c00 ld/testsuite/ld-i386/pr19636-2d.d + 4d55687220a930ac78d5153b16fa70ad ld/testsuite/ld-i386/pcrel8.d +@@ -22556,6 +22590,7 @@ d3eff844704a8f8a868fb0e221cba03f ld/tes + 4b385578f91c4d3a011c1b67e781f755 ld/testsuite/ld-i386/tlspic1.s + 857f54992ae18beb28f93df6dfe279dc ld/testsuite/ld-i386/pr18815.s + 0022848406081d37758eca781e8ffd47 ld/testsuite/ld-i386/pr23372c.d ++5812e22bfe8cbff07d998c6677c39df8 ld/testsuite/ld-i386/pr26711-1.d + c1db7937bfb9ff0288b35fec7a4b2913 ld/testsuite/ld-i386/call2.d + b420e4e82afdcf08ae21c5ecd2386ca7 ld/testsuite/ld-i386/pr20253-2b.S + da2a7c7506cc11a212853cbca1eebb96 ld/testsuite/ld-i386/pr21884.d +@@ -23459,13 +23494,13 @@ edbd3ce7f8ec12fac8c8f76869c472e6 ld/Cha + c7576fd1283c729f0b36c6047115e56e ld/ldfile.c + d875a4625b4f8aa6808c1b871fc647a5 ld/pe-dll.c + 829c3ef5ba9d3f4bd0eaa6239e7b7ef4 ld/NEWS +-b7acac6142684a37be27755f10e85cd9 ld/ld.info ++c710f895fdb2e66f73e4853d459ced78 ld/ld.info + a130b17d748d55878825a1060eb688f0 ld/ChangeLog-2015 + 248ce0b33616bb1205b224df6ff80705 ld/ldlex.l + f88d12991c76945bcd915181b9d95258 ld/ldgram.y + 0f35271901865ad3ac182be33e27bc11 ld/ldmain.h + d7ce0242bbe79cc369b415f0241de880 ld/configdoc.texi +-d7cff08dba11d5a7bd965864423623f3 ld/ldelf.c ++5a171c03498a636c2e760c14ade7ea7d ld/ldelf.c + 5dfd1b2c4d8997b2f947000e4eaf8d00 ld/ldint.texi + 8d7a3563e742410eea837873dcad6b42 ld/elf-hints-local.h + b29fc2be266792b7f3d34bc6b710a81b ld/ChangeLog-2006 +@@ -23582,7 +23617,7 @@ a707d2e5daa09d204d4441e8713048ca libibe + 94f22680349b4ae73ad658495d2eb542 libiberty/random.c + 65619c4e962d5590f7506a4dfa999af9 libiberty/regex.c + d72cecd2f491eb8759d5cb9807c4d5a3 libiberty/pex-one.c +-3b75f52525aa1117d1c4cf228cb171c3 libiberty/ChangeLog ++83c1eb8bd8fa47a5d876cc1fde42653a libiberty/ChangeLog + 9f681e91439ac44c9df8e1b1deef33b5 libiberty/strdup.c + 528cb7fe9ed2020f2ee12de85c28aa1c libiberty/objalloc.c + c90c2f09bdcbd65b4732a4be25a56d12 libiberty/memcpy.c +@@ -23647,7 +23682,7 @@ a49da50901109322fa446b9d34a94088 libibe + c68dbf7834af4281ebd84caa3fd54680 libiberty/README + 8446e21ec9d2833ae495541e07e84069 libiberty/mempcpy.c + f3d66c0f81af1c1b4e2e0ea41b022716 libiberty/stack-limit.c +-b3f503d376697e199d60829e3b46e9f8 libiberty/dwarfnames.c ++ffd8a921387ca98f9d130e9e73cd6d3e libiberty/dwarfnames.c + 2ecbb08e30f241584789d52913e58920 libiberty/bsearch_r.c + d550f4428dd2571dd6257b8b82d356fc libiberty/pex-unix.c + e2f3721273c7ef1ab0194aad78ffa3aa libiberty/strstr.c +@@ -23800,7 +23835,7 @@ aa3895af184ebb6d935b41fc89922e9e opcode + a5fa82e7bc64c887bf7deaee7ca5a8ea opcodes/m32r-desc.h + 9b06963656051ef64d6be0e77d9fb6ed opcodes/iq2000-desc.h + e263970edd5e90c3aed3ce1c59d16a79 opcodes/m32r-opinst.c +-ffd21c01c165934d3a5a7a7205ca7b84 opcodes/i386-dis.c ++9db7b27843036dab64bc0444caa33e90 opcodes/i386-dis.c + 5f8b9fdcd2550134a2b196ec646bfb7e opcodes/bpf-opc.c + 20d54844aca06dbf0637ccca248e96e9 opcodes/ChangeLog-2017 + 753a0533d1493d8eb512218d1186dee1 opcodes/xstormy16-desc.h +@@ -23842,7 +23877,7 @@ f1fefb4bb6b09a3d30c8cf8e273c04b3 opcode + 8203df8c8c15e7452fe0668da0315e3d opcodes/ia64-opc-b.c + 0452aeba4e1f72482880701c82952aac opcodes/tic4x-dis.c + c5cefc6c55710567cc64c0a1a1100b9d opcodes/ChangeLog-2014 +-bfb1e7f25b160fe4973def64d96c0b3c opcodes/ChangeLog ++5ff0f17359054997d6270c434b60de17 opcodes/ChangeLog + e266f9159d4b7e960a2f563864cd10ce opcodes/or1k-asm.c + c325a89b389599e79a63ff55e9e7aebc opcodes/ft32-dis.c + ae66c5fbea04c29db07e989f13f15025 opcodes/mt-dis.c +@@ -23871,41 +23906,41 @@ bc6252cb5d9adee258bc4c21f2f41548 opcode + abe9186aa2b65b000546c8158085dda8 opcodes/MAINTAINERS + 9d1cae79a25126dc0896dc2e82b5a698 opcodes/po/uk.po + e4444c7716d7f33ae1586f3d19dc5de1 opcodes/po/it.po +-e294d2684e9d57a79fef7fe2b8875337 opcodes/po/sr.gmo ++e66456de97b5aafdd2e0d025a20c53e5 opcodes/po/sr.gmo + 64163e7952ced31b2cf20dc47968a84e opcodes/po/ga.po +-98fac11518cc3c1a7eb9b465ff5a3c99 opcodes/po/de.gmo +-b2f69021ea41e08afb81acf033c7edf5 opcodes/po/nl.gmo ++79b08e088d990c640efad54c3788ef74 opcodes/po/de.gmo ++d54ddba4f1ecab20d57ff9452bba3076 opcodes/po/nl.gmo + 4438b95a4344144658f227bc2fd6865f opcodes/po/Make-in + eac8a474e91112124bc872824d26de92 opcodes/po/id.po +-a413b86d85b007d3a867ac743037c14a opcodes/po/sv.gmo ++a8ee89dd661a7b12af6f36c870d4c4c0 opcodes/po/sv.gmo + cf932bb836eca328eebe2f5e4c065855 opcodes/po/fr.po + 785cbecc7f597c1374b732ed3d23282f opcodes/po/fi.po +-9d1c427a5289a3666564f5409fdf16c9 opcodes/po/da.gmo +-4afa0ab75fd7849f29b445d8d8366b2d opcodes/po/ro.gmo ++060c0569db897d17ecc2f3c28415ba9d opcodes/po/da.gmo ++9fa87849e97f1e412646da4da3e2ded4 opcodes/po/ro.gmo + 171ad044cdc6b2707b6094583bb59173 opcodes/po/pt_BR.po + 6cab0da7ed0b3051e9f002e359fc8fb4 opcodes/po/de.po +-a0e89a22a96cdc0e97541e2e2886d08a opcodes/po/fr.gmo ++1561b68827f1e1fc6a5f480b34d64542 opcodes/po/fr.gmo + 20ec221c41da2d5e1c3e5b97f7f0e18a opcodes/po/POTFILES.in +-a08858d306dd29266caea6fb0ea57591 opcodes/po/es.gmo ++40c276423529210775c75de444ad94f1 opcodes/po/es.gmo + 28fa9a522cdf0eaf64347fa836e25d0c opcodes/po/nl.po + fcb127c8f57c6a38f36fe3eb53fe3d3f opcodes/po/tr.po +-9a5e613a9553966167850acd1dbf0f70 opcodes/po/ga.gmo ++3c5d7ac10fdc3b9c0fdf15d44512d163 opcodes/po/ga.gmo + 38a6dd92d3fd8f1a2eb2334be22de713 opcodes/po/es.po + 59287ccb744a860c9e54f5704505d11e opcodes/po/opcodes.pot + 18fe115c401c0e1605b2f2e4db52219b opcodes/po/zh_CN.po + f4989e54cf95c741a994fdd722b541ee opcodes/po/sv.po + 076be31a66a76e9a13089a58f2629d1f opcodes/po/ro.po + ac5bcf32b58e34029b5b004d5a8cd2c7 opcodes/po/vi.po +-f09eb1cbddec0ff16061a17e964d9e6e opcodes/po/zh_CN.gmo +-c7158f697e1199580a8d8946bf8af06d opcodes/po/tr.gmo ++7b57bd6a633669c3e550cfc665872a31 opcodes/po/zh_CN.gmo ++8582d98be0cbd4f13aacf73c5183c965 opcodes/po/tr.gmo + c32c7787ad8c899a3af5ec2e47518888 opcodes/po/da.po +-2100353c28cda8ddfc1e90989eabf44a opcodes/po/it.gmo +-93e89a462ca1c5f7ce29038a689f4749 opcodes/po/vi.gmo +-b5a06b091378eac0ab1297f7c4dc8c47 opcodes/po/pt_BR.gmo ++63cbcc9d5f4f1e1b5912755fd5e2d5cb opcodes/po/it.gmo ++54774a0f3f118df78dec815cdb50ca66 opcodes/po/vi.gmo ++f4cea170d318aa9757faade5a035318a opcodes/po/pt_BR.gmo + d8f7a299b95a0a3da8643c69829e025b opcodes/po/sr.po +-3dcb77f78dfd98bc8e4d9868b009debe opcodes/po/id.gmo +-4c931b889a393fc12e187bbaf1bd663a opcodes/po/fi.gmo +-ada3f3fa6fb15619c03f65ebb7d68f04 opcodes/po/uk.gmo ++d322f2267bd0813da989c4e0e189cbf0 opcodes/po/id.gmo ++acdfa8f12e84870793f907b8f963df90 opcodes/po/fi.gmo ++e5cdb2e3a54fbf2256ea5dadfc372055 opcodes/po/uk.gmo + 48a769304e55eaeba3950b5697686e24 opcodes/ia64-dis.c + ca16d8a4b504a573594c9f75cb4fbcd5 opcodes/sysdep.h + 75cb7f7a3fba79102efdd48bc1d936e8 opcodes/ia64-opc-f.c +@@ -24005,7 +24040,7 @@ b485b32d996d37afc89d2359c1d0c767 opcode + b4c54078c4debd6e9bd3703033bc7dbd opcodes/d10v-dis.c + 23232c71137fb48f4c964575eb061942 opcodes/score-opc.h + 52d3bc5e8206849119b615744c9dcc17 opcodes/tic54x-dis.c +-acb8289783fcf2bf697b87cbaa5b57c7 opcodes/ppc-opc.c ++93fff560337f9831e013adae309cc25b opcodes/ppc-opc.c + b2241084ce22b1be5fffaed5cd762739 opcodes/pj-dis.c + 2dc169586e4d06c7c260f32cfde8e174 opcodes/cgen-dis.c + 327cf11f5c08b578f3b0cdb7f3923280 opcodes/ia64-raw.tbl +diff -rup binutils-2.35.1/opcodes/ChangeLog fred/binutils-2.35.1/opcodes/ChangeLog +--- binutils-2.35.1/opcodes/ChangeLog 2020-09-19 11:35:50.000000000 +0100 ++++ fred/binutils-2.35.1/opcodes/ChangeLog 2020-11-25 14:37:37.000000000 +0000 +@@ -1,3 +1,31 @@ ++2020-10-07 H.J. Lu ++ ++ PR gas/26685 ++ * i386-dis.c (mod_table): Replace Gv with Gdq on movdiri. ++ ++2020-10-07 Jan Beulich ++ ++ * i386-dis.c (OP_E_memory): Revert previous change. ++ ++2020-09-24 Alan Modra ++ ++ Apply from master ++ 2020-08-19 Alan Modra ++ * ppc-opc.c (powerpc_opcodes): Replace OBF with BF for vcmpsq, ++ vcmpuq and xvtlsbb. ++ ++ 2020-08-10 Alan Modra ++ * ppc-opc.c (powerpc_opcodes): Add many mtspr and mfspr extended ++ instructions. ++ ++ 2020-08-10 Alan Modra ++ * ppc-opc.c (powerpc_opcodes): Add exser, msgsndu, msgclru. ++ Enable icbt for power5, miso for power8. ++ ++ 2020-08-10 Alan Modra ++ * ppc-opc.c (powerpc_opcodes): Prioritise mtfprd and mtvrd over ++ mtvsrd, and similarly for mfvsrd. ++ + 2020-09-19 Nick Clifton + + This is the 2.35.1 point release. +diff -rup binutils-2.35.1/opcodes/i386-dis.c fred/binutils-2.35.1/opcodes/i386-dis.c +--- binutils-2.35.1/opcodes/i386-dis.c 2020-07-24 10:12:20.000000000 +0100 ++++ fred/binutils-2.35.1/opcodes/i386-dis.c 2020-11-25 14:37:37.000000000 +0000 +@@ -10496,7 +10496,7 @@ static const struct dis386 mod_table[][2 + }, + { + /* MOD_0F38F9_PREFIX_0 */ +- { "movdiri", { Ev, Gv }, PREFIX_OPCODE }, ++ { "movdiri", { Ev, Gdq }, PREFIX_OPCODE }, + }, + { + /* MOD_62_32BIT */ +@@ -14190,7 +14190,7 @@ OP_E_memory (int bytemode, int sizeflag) + /* Without base nor index registers, zero-extend the + lower 32-bit displacement to 64 bits. */ + disp = (unsigned int) disp; +- needindex = scale; ++ needindex = 1; + } + needaddr32 = 1; + } +diff -rup binutils-2.35.1/opcodes/ppc-opc.c fred/binutils-2.35.1/opcodes/ppc-opc.c +--- binutils-2.35.1/opcodes/ppc-opc.c 2020-08-19 08:12:38.000000000 +0100 ++++ fred/binutils-2.35.1/opcodes/ppc-opc.c 2020-11-25 14:37:37.000000000 +0000 +@@ -4441,7 +4441,7 @@ const struct powerpc_opcode powerpc_opco + {"nmachhws", XO (4, 110,0,0), XO_MASK, MULHW, 0, {RT, RA, RB}}, + {"nmachhws.", XO (4, 110,0,1), XO_MASK, MULHW, 0, {RT, RA, RB}}, + {"vadduqm", VX (4, 256), VX_MASK, PPCVEC2, 0, {VD, VA, VB}}, +-{"vcmpuq", VX (4, 257), VXBF_MASK, POWER10, 0, {OBF, VA, VB}}, ++{"vcmpuq", VX (4, 257), VXBF_MASK, POWER10, 0, {BF, VA, VB}}, + {"vmaxsb", VX (4, 258), VX_MASK, PPCVEC, 0, {VD, VA, VB}}, + {"vslb", VX (4, 260), VX_MASK, PPCVEC, 0, {VD, VA, VB}}, + {"vslq", VX (4, 261), VX_MASK, POWER10, 0, {VD, VA, VB}}, +@@ -4459,7 +4459,7 @@ const struct powerpc_opcode powerpc_opco + {"macchwu", XO (4, 140,0,0), XO_MASK, MULHW, 0, {RT, RA, RB}}, + {"macchwu.", XO (4, 140,0,1), XO_MASK, MULHW, 0, {RT, RA, RB}}, + {"vaddcuq", VX (4, 320), VX_MASK, PPCVEC2, 0, {VD, VA, VB}}, +-{"vcmpsq", VX (4, 321), VXBF_MASK, POWER10, 0, {OBF, VA, VB}}, ++{"vcmpsq", VX (4, 321), VXBF_MASK, POWER10, 0, {BF, VA, VB}}, + {"vmaxsh", VX (4, 322), VX_MASK, PPCVEC, 0, {VD, VA, VB}}, + {"vslh", VX (4, 324), VX_MASK, PPCVEC, 0, {VD, VA, VB}}, + {"vrlqnm", VX (4, 325), VX_MASK, POWER10, 0, {VD, VA, VB}}, +@@ -6114,6 +6114,7 @@ const struct powerpc_opcode powerpc_opco + {"rlnm.", M(23,1), M_MASK, PWRCOM, PPCVLE, {RA, RS, RB, MBE, ME}}, + + {"nop", OP(24), 0xffffffff, PPCCOM, PPCVLE, {0}}, ++{"exser", 0x63ff0000, 0xffffffff, POWER9, PPCVLE, {0}}, + {"ori", OP(24), OP_MASK, PPCCOM, PPCVLE, {RA, RS, UI}}, + {"oril", OP(24), OP_MASK, PWRCOM, PPCVLE, {RA, RS, UI}}, + +@@ -6236,7 +6237,7 @@ const struct powerpc_opcode powerpc_opco + + {"ldx", X(31,21), X_MASK, PPC64, 0, {RT, RA0, RB}}, + +-{"icbt", X(31,22), X_MASK, BOOKE|PPCE300|PPCA2|PPC476, 0, {CT, RA0, RB}}, ++{"icbt", X(31,22), X_MASK, POWER5|BOOKE|PPCE300, 0, {CT, RA0, RB}}, + + {"lwzx", X(31,23), X_MASK, PPCCOM, 0, {RT, RA0, RB}}, + {"lx", X(31,23), X_MASK, PWRCOM, 0, {RT, RA, RB}}, +@@ -6302,9 +6303,9 @@ const struct powerpc_opcode powerpc_opco + {"subf.", XO(31,40,0,1), XO_MASK, PPC, 0, {RT, RA, RB}}, + {"sub.", XO(31,40,0,1), XO_MASK, PPC, 0, {RT, RB, RA}}, + +-{"mfvsrd", X(31,51), XX1RB_MASK, PPCVSX2, 0, {RA, XS6}}, + {"mffprd", X(31,51), XX1RB_MASK|1, PPCVSX2, 0, {RA, FRS}}, + {"mfvrd", X(31,51)|1, XX1RB_MASK|1, PPCVSX2, 0, {RA, VS}}, ++{"mfvsrd", X(31,51), XX1RB_MASK, PPCVSX2, 0, {RA, XS6}}, + {"eratilx", X(31,51), X_MASK, PPCA2, 0, {ERAT_T, RA, RB}}, + + {"lbarx", X(31,52), XEH_MASK, POWER8|E6500, 0, {RT, RA0, RB, EH}}, +@@ -6354,6 +6355,7 @@ const struct powerpc_opcode powerpc_opco + {"mulhw", XO(31,75,0,0), XO_MASK, PPC, 0, {RT, RA, RB}}, + {"mulhw.", XO(31,75,0,1), XO_MASK, PPC, 0, {RT, RA, RB}}, + ++{"msgsndu", XRTRA(31,78,0,0), XRTRA_MASK, POWER9, 0, {RB}}, + {"dlmzb", XRC(31,78,0), X_MASK, PPC403|PPC440|PPC476|TITAN, 0, {RA, RS, RB}}, + {"dlmzb.", XRC(31,78,1), X_MASK, PPC403|PPC440|PPC476|TITAN, 0, {RA, RS, RB}}, + +@@ -6387,6 +6389,7 @@ const struct powerpc_opcode powerpc_opco + + {"lxvrdx", X(31,109), XX1_MASK, POWER10, 0, {XT6, RA0, RB}}, + ++{"msgclru", XRTRA(31,110,0,0), XRTRA_MASK, POWER9, 0, {RB}}, + {"mvidsplt", X(31,110), X_MASK, E6500, 0, {VD, RA, RB}}, + + {"mtsrdin", X(31,114), XRA_MASK, PPC64, 0, {RS, RB}}, +@@ -6489,9 +6492,9 @@ const struct powerpc_opcode powerpc_opco + + {"mtmsrd", X(31,178), XRLARB_MASK, PPC64, 0, {RS, A_L}}, + +-{"mtvsrd", X(31,179), XX1RB_MASK, PPCVSX2, 0, {XT6, RA}}, + {"mtfprd", X(31,179), XX1RB_MASK|1, PPCVSX2, 0, {FRT, RA}}, + {"mtvrd", X(31,179)|1, XX1RB_MASK|1, PPCVSX2, 0, {VD, RA}}, ++{"mtvsrd", X(31,179), XX1RB_MASK, PPCVSX2, 0, {XT6, RA}}, + {"eratre", X(31,179), X_MASK, PPCA2, 0, {RT, RA, WS}}, + + {"stdux", X(31,181), X_MASK, PPC64, 0, {RS, RAS, RB}}, +@@ -6738,11 +6741,13 @@ const struct powerpc_opcode powerpc_opco + + {"mfmq", XSPR(31,339, 0), XSPR_MASK, M601, 0, {RT}}, + {"mfxer", XSPR(31,339, 1), XSPR_MASK, COM, 0, {RT}}, ++{"mfudscr", XSPR(31,339, 3), XSPR_MASK, POWER9, 0, {RS}}, + {"mfrtcu", XSPR(31,339, 4), XSPR_MASK, COM, TITAN, {RT}}, + {"mfrtcl", XSPR(31,339, 5), XSPR_MASK, COM, TITAN, {RT}}, + {"mfdec", XSPR(31,339, 6), XSPR_MASK, MFDEC1, 0, {RT}}, + {"mflr", XSPR(31,339, 8), XSPR_MASK, COM, 0, {RT}}, + {"mfctr", XSPR(31,339, 9), XSPR_MASK, COM, 0, {RT}}, ++{"mfuamr", XSPR(31,339, 13), XSPR_MASK, POWER9, 0, {RS}}, + {"mfdscr", XSPR(31,339, 17), XSPR_MASK, POWER6, 0, {RT}}, + {"mftid", XSPR(31,339, 17), XSPR_MASK, POWER, 0, {RT}}, + {"mfdsisr", XSPR(31,339, 18), XSPR_MASK, COM, TITAN, {RT}}, +@@ -6753,9 +6758,12 @@ const struct powerpc_opcode powerpc_opco + {"mfsrr0", XSPR(31,339, 26), XSPR_MASK, COM, 0, {RT}}, + {"mfsrr1", XSPR(31,339, 27), XSPR_MASK, COM, 0, {RT}}, + {"mfcfar", XSPR(31,339, 28), XSPR_MASK, POWER6, 0, {RT}}, ++{"mfamr", XSPR(31,339, 29), XSPR_MASK, POWER7, 0, {RS}}, ++{"mfpidr", XSPR(31,339, 48), XSPR_MASK, POWER10, 0, {RS}}, + {"mfpid", XSPR(31,339, 48), XSPR_MASK, BOOKE, 0, {RT}}, + {"mfcsrr0", XSPR(31,339, 58), XSPR_MASK, BOOKE, 0, {RT}}, + {"mfcsrr1", XSPR(31,339, 59), XSPR_MASK, BOOKE, 0, {RT}}, ++{"mfiamr", XSPR(31,339, 61), XSPR_MASK, POWER10, 0, {RS}}, + {"mfdear", XSPR(31,339, 61), XSPR_MASK, BOOKE, 0, {RT}}, + {"mfesr", XSPR(31,339, 62), XSPR_MASK, BOOKE, 0, {RT}}, + {"mfivpr", XSPR(31,339, 63), XSPR_MASK, BOOKE, 0, {RT}}, +@@ -6769,16 +6777,28 @@ const struct powerpc_opcode powerpc_opco + {"mfcounta", XSPR(31,339,150), XSPR_MASK, PPC860, 0, {RT}}, + {"mfcountb", XSPR(31,339,151), XSPR_MASK, PPC860, 0, {RT}}, + {"mfcmpe", XSPR(31,339,152), XSPR_MASK, PPC860, 0, {RT}}, ++{"mffscr", XSPR(31,339,153), XSPR_MASK, POWER10, 0, {RS}}, + {"mfcmpf", XSPR(31,339,153), XSPR_MASK, PPC860, 0, {RT}}, + {"mfcmpg", XSPR(31,339,154), XSPR_MASK, PPC860, 0, {RT}}, + {"mfcmph", XSPR(31,339,155), XSPR_MASK, PPC860, 0, {RT}}, + {"mflctrl1", XSPR(31,339,156), XSPR_MASK, PPC860, 0, {RT}}, ++{"mfuamor", XSPR(31,339,157), XSPR_MASK, POWER7, 0, {RS}}, + {"mflctrl2", XSPR(31,339,157), XSPR_MASK, PPC860, 0, {RT}}, + {"mfictrl", XSPR(31,339,158), XSPR_MASK, PPC860, 0, {RT}}, ++{"mfpspb", XSPR(31,339,159), XSPR_MASK, POWER10, 0, {RS}}, + {"mfbar", XSPR(31,339,159), XSPR_MASK, PPC860, 0, {RT}}, ++{"mfdpdes", XSPR(31,339,176), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfdawr0", XSPR(31,339,180), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfdawr1", XSPR(31,339,181), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfrpr", XSPR(31,339,186), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfciabr", XSPR(31,339,187), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfdawrx0", XSPR(31,339,188), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfdawrx1", XSPR(31,339,189), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfhfscr", XSPR(31,339,190), XSPR_MASK, POWER10, 0, {RS}}, + {"mfvrsave", XSPR(31,339,256), XSPR_MASK, PPCVEC, 0, {RT}}, + {"mfusprg0", XSPR(31,339,256), XSPR_MASK, BOOKE, 0, {RT}}, + {"mfsprg", XSPR(31,339,256), XSPRG_MASK, PPC, 0, {RT, SPRG}}, ++{"mfusprg3", XSPR(31,339,259), XSPR_MASK, POWER10, 0, {RT}}, + {"mfsprg4", XSPR(31,339,260), XSPR_MASK, PPC405|BOOKE, 0, {RT}}, + {"mfsprg5", XSPR(31,339,261), XSPR_MASK, PPC405|BOOKE, 0, {RT}}, + {"mfsprg6", XSPR(31,339,262), XSPR_MASK, PPC405|BOOKE, 0, {RT}}, +@@ -6794,20 +6814,37 @@ const struct powerpc_opcode powerpc_opco + {"mfear", XSPR(31,339,282), XSPR_MASK, PPC, TITAN, {RT}}, + {"mfpir", XSPR(31,339,286), XSPR_MASK, BOOKE, 0, {RT}}, + {"mfpvr", XSPR(31,339,287), XSPR_MASK, PPC, 0, {RT}}, ++{"mfhsprg0", XSPR(31,339,304), XSPR_MASK, POWER10, 0, {RS}}, + {"mfdbsr", XSPR(31,339,304), XSPR_MASK, BOOKE, 0, {RT}}, ++{"mfhsprg1", XSPR(31,339,305), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfhdisr", XSPR(31,339,306), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfhdar", XSPR(31,339,307), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfspurr", XSPR(31,339,308), XSPR_MASK, POWER10, 0, {RS}}, + {"mfdbcr0", XSPR(31,339,308), XSPR_MASK, BOOKE, 0, {RT}}, ++{"mfpurr", XSPR(31,339,309), XSPR_MASK, POWER10, 0, {RS}}, + {"mfdbcr1", XSPR(31,339,309), XSPR_MASK, BOOKE, 0, {RT}}, ++{"mfhdec", XSPR(31,339,310), XSPR_MASK, POWER10, 0, {RS}}, + {"mfdbcr2", XSPR(31,339,310), XSPR_MASK, BOOKE, 0, {RT}}, + {"mfiac1", XSPR(31,339,312), XSPR_MASK, BOOKE, 0, {RT}}, ++{"mfhrmor", XSPR(31,339,313), XSPR_MASK, POWER10, 0, {RS}}, + {"mfiac2", XSPR(31,339,313), XSPR_MASK, BOOKE, 0, {RT}}, ++{"mfhsrr0", XSPR(31,339,314), XSPR_MASK, POWER10, 0, {RS}}, + {"mfiac3", XSPR(31,339,314), XSPR_MASK, BOOKE, 0, {RT}}, ++{"mfhsrr1", XSPR(31,339,315), XSPR_MASK, POWER10, 0, {RS}}, + {"mfiac4", XSPR(31,339,315), XSPR_MASK, BOOKE, 0, {RT}}, + {"mfdac1", XSPR(31,339,316), XSPR_MASK, BOOKE, 0, {RT}}, + {"mfdac2", XSPR(31,339,317), XSPR_MASK, BOOKE, 0, {RT}}, ++{"mflpcr", XSPR(31,339,318), XSPR_MASK, POWER10, 0, {RS}}, + {"mfdvc1", XSPR(31,339,318), XSPR_MASK, BOOKE, 0, {RT}}, ++{"mflpidr", XSPR(31,339,319), XSPR_MASK, POWER10, 0, {RS}}, + {"mfdvc2", XSPR(31,339,319), XSPR_MASK, BOOKE, 0, {RT}}, ++{"mfhmer", XSPR(31,339,336), XSPR_MASK, POWER7, 0, {RS}}, + {"mftsr", XSPR(31,339,336), XSPR_MASK, BOOKE, 0, {RT}}, ++{"mfhmeer", XSPR(31,339,337), XSPR_MASK, POWER7, 0, {RS}}, ++{"mfpcr", XSPR(31,339,338), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfheir", XSPR(31,339,339), XSPR_MASK, POWER10, 0, {RS}}, + {"mftcr", XSPR(31,339,340), XSPR_MASK, BOOKE, 0, {RT}}, ++{"mfamor", XSPR(31,339,349), XSPR_MASK, POWER7, 0, {RS}}, + {"mfivor0", XSPR(31,339,400), XSPR_MASK, BOOKE, 0, {RT}}, + {"mfivor1", XSPR(31,339,401), XSPR_MASK, BOOKE, 0, {RT}}, + {"mfivor2", XSPR(31,339,402), XSPR_MASK, BOOKE, 0, {RT}}, +@@ -6824,6 +6861,14 @@ const struct powerpc_opcode powerpc_opco + {"mfivor13", XSPR(31,339,413), XSPR_MASK, BOOKE, 0, {RT}}, + {"mfivor14", XSPR(31,339,414), XSPR_MASK, BOOKE, 0, {RT}}, + {"mfivor15", XSPR(31,339,415), XSPR_MASK, BOOKE, 0, {RT}}, ++{"mftir", XSPR(31,339,446), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfptcr", XSPR(31,339,464), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfuspgr0", XSPR(31,339,496), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfuspgr1", XSPR(31,339,497), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfurmor", XSPR(31,339,505), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfusrr0", XSPR(31,339,506), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfusrr1", XSPR(31,339,507), XSPR_MASK, POWER10, 0, {RS}}, ++{"mfsmfctrl", XSPR(31,339,511), XSPR_MASK, POWER10, 0, {RS}}, + {"mfspefscr", XSPR(31,339,512), XSPR_MASK, PPCSPE, 0, {RT}}, + {"mfbbear", XSPR(31,339,513), XSPR_MASK, PPCBRLK, 0, {RT}}, + {"mfbbtar", XSPR(31,339,514), XSPR_MASK, PPCBRLK, 0, {RT}}, +@@ -6848,18 +6893,36 @@ const struct powerpc_opcode powerpc_opco + {"mfdpdr", XSPR(31,339,630), XSPR_MASK, PPC860, 0, {RT}}, + {"mfdpir", XSPR(31,339,631), XSPR_MASK, PPC860, 0, {RT}}, + {"mfimmr", XSPR(31,339,638), XSPR_MASK, PPC860, 0, {RT}}, ++{"mfusier2", XSPR(31,339,736), XSPR_MASK, POWER10, 0, {RT}}, ++{"mfsier2", XSPR(31,339,736), XSPR_MASK, POWER10, 0, {RT}}, ++{"mfusier3", XSPR(31,339,737), XSPR_MASK, POWER10, 0, {RT}}, ++{"mfsier3", XSPR(31,339,737), XSPR_MASK, POWER10, 0, {RT}}, ++{"mfummcr3", XSPR(31,339,738), XSPR_MASK, POWER10, 0, {RT}}, ++{"mfmmcr3", XSPR(31,339,738), XSPR_MASK, POWER10, 0, {RT}}, ++{"mfusier", XSPR(31,339,768), XSPR_MASK, POWER10, 0, {RT}}, ++{"mfsier", XSPR(31,339,768), XSPR_MASK, POWER10, 0, {RT}}, ++{"mfummcra", XSPR(31,339,770), XSPR_MASK, POWER9, 0, {RS}}, ++{"mfmmcra", XSPR(31,339,770), XSPR_MASK, POWER7, 0, {RS}}, + {"mfupmc1", XSPR(31,339,771), XSPR_MASK, POWER9, 0, {RT}}, +-{"mfpmc1", XSPR(31,339,771), XSPR_MASK, POWER9, 0, {RT}}, ++{"mfpmc1", XSPR(31,339,771), XSPR_MASK, POWER7, 0, {RT}}, + {"mfupmc2", XSPR(31,339,772), XSPR_MASK, POWER9, 0, {RT}}, +-{"mfpmc2", XSPR(31,339,772), XSPR_MASK, POWER9, 0, {RT}}, ++{"mfpmc2", XSPR(31,339,772), XSPR_MASK, POWER7, 0, {RT}}, + {"mfupmc3", XSPR(31,339,773), XSPR_MASK, POWER9, 0, {RT}}, +-{"mfpmc3", XSPR(31,339,773), XSPR_MASK, POWER9, 0, {RT}}, ++{"mfpmc3", XSPR(31,339,773), XSPR_MASK, POWER7, 0, {RT}}, + {"mfupmc4", XSPR(31,339,774), XSPR_MASK, POWER9, 0, {RT}}, +-{"mfpmc4", XSPR(31,339,774), XSPR_MASK, POWER9, 0, {RT}}, ++{"mfpmc4", XSPR(31,339,774), XSPR_MASK, POWER7, 0, {RT}}, + {"mfupmc5", XSPR(31,339,775), XSPR_MASK, POWER9, 0, {RT}}, +-{"mfpmc5", XSPR(31,339,775), XSPR_MASK, POWER9, 0, {RT}}, ++{"mfpmc5", XSPR(31,339,775), XSPR_MASK, POWER7, 0, {RT}}, + {"mfupmc6", XSPR(31,339,776), XSPR_MASK, POWER9, 0, {RT}}, +-{"mfpmc6", XSPR(31,339,776), XSPR_MASK, POWER9, 0, {RT}}, ++{"mfpmc6", XSPR(31,339,776), XSPR_MASK, POWER7, 0, {RT}}, ++{"mfummcr0", XSPR(31,339,779), XSPR_MASK, POWER9, 0, {RS}}, ++{"mfmmcr0", XSPR(31,339,779), XSPR_MASK, POWER7, 0, {RS}}, ++{"mfusiar", XSPR(31,339,780), XSPR_MASK, POWER9, 0, {RS}}, ++{"mfsiar", XSPR(31,339,780), XSPR_MASK, POWER9, 0, {RS}}, ++{"mfusdar", XSPR(31,339,781), XSPR_MASK, POWER9, 0, {RS}}, ++{"mfsdar", XSPR(31,339,781), XSPR_MASK, POWER9, 0, {RS}}, ++{"mfummcr1", XSPR(31,339,782), XSPR_MASK, POWER9, 0, {RS}}, ++{"mfmmcr1", XSPR(31,339,782), XSPR_MASK, POWER7, 0, {RS}}, + {"mfmi_ctr", XSPR(31,339,784), XSPR_MASK, PPC860, 0, {RT}}, + {"mfmi_ap", XSPR(31,339,786), XSPR_MASK, PPC860, 0, {RT}}, + {"mfmi_epn", XSPR(31,339,787), XSPR_MASK, PPC860, 0, {RT}}, +@@ -6873,12 +6936,25 @@ const struct powerpc_opcode powerpc_opco + {"mfmd_twc", XSPR(31,339,797), XSPR_MASK, PPC860, 0, {RT}}, + {"mfmd_rpn", XSPR(31,339,798), XSPR_MASK, PPC860, 0, {RT}}, + {"mfm_tw", XSPR(31,339,799), XSPR_MASK, PPC860, 0, {RT}}, ++{"mfbescrs", XSPR(31,339,800), XSPR_MASK, POWER9, 0, {RS}}, ++{"mfbescrsu", XSPR(31,339,801), XSPR_MASK, POWER9, 0, {RS}}, ++{"mfbescrr", XSPR(31,339,802), XSPR_MASK, POWER9, 0, {RS}}, ++{"mfbescrru", XSPR(31,339,803), XSPR_MASK, POWER9, 0, {RS}}, ++{"mfebbhr", XSPR(31,339,804), XSPR_MASK, POWER9, 0, {RS}}, ++{"mfebbrr", XSPR(31,339,805), XSPR_MASK, POWER9, 0, {RS}}, ++{"mfbescr", XSPR(31,339,806), XSPR_MASK, POWER9, 0, {RS}}, ++{"mftar", XSPR(31,339,815), XSPR_MASK, POWER9, 0, {RS}}, ++{"mfasdr", XSPR(31,339,816), XSPR_MASK, POWER10, 0, {RS}}, + {"mfmi_dbcam", XSPR(31,339,816), XSPR_MASK, PPC860, 0, {RT}}, + {"mfmi_dbram0", XSPR(31,339,817), XSPR_MASK, PPC860, 0, {RT}}, + {"mfmi_dbram1", XSPR(31,339,818), XSPR_MASK, PPC860, 0, {RT}}, ++{"mfpsscr", XSPR(31,339,823), XSPR_MASK, POWER10, 0, {RS}}, + {"mfmd_dbcam", XSPR(31,339,824), XSPR_MASK, PPC860, 0, {RT}}, + {"mfmd_dbram0", XSPR(31,339,825), XSPR_MASK, PPC860, 0, {RT}}, + {"mfmd_dbram1", XSPR(31,339,826), XSPR_MASK, PPC860, 0, {RT}}, ++{"mfic", XSPR(31,339,848), XSPR_MASK, POWER8, 0, {RS}}, ++{"mfvtb", XSPR(31,339,849), XSPR_MASK, POWER8, 0, {RS}}, ++{"mfhpsscr", XSPR(31,339,855), XSPR_MASK, POWER10, 0, {RS}}, + {"mfivndx", XSPR(31,339,880), XSPR_MASK, TITAN, 0, {RT}}, + {"mfdvndx", XSPR(31,339,881), XSPR_MASK, TITAN, 0, {RT}}, + {"mfivlim", XSPR(31,339,882), XSPR_MASK, TITAN, 0, {RT}}, +@@ -7051,14 +7127,15 @@ const struct powerpc_opcode powerpc_opco + + {"sthux", X(31,439), X_MASK, COM, 0, {RS, RAS, RB}}, + +-{"mdors", 0x7f9ce378, 0xffffffff, E500MC, 0, {0}}, +- +-{"miso", 0x7f5ad378, 0xffffffff, E6500, 0, {0}}, +- +-/* The "yield", "mdoio" and "mdoom" instructions are extended mnemonics for +- "or rX,rX,rX", with rX being r27, r29 and r30 respectively. */ ++/* or 26,26,26 */ ++{"miso", 0x7f5ad378, 0xffffffff, POWER8|E6500, 0, {0}}, ++/* or 27,27,27 */ + {"yield", 0x7f7bdb78, 0xffffffff, POWER7, 0, {0}}, ++/* or 28,28,28 */ ++{"mdors", 0x7f9ce378, 0xffffffff, E500MC, 0, {0}}, ++/* or 29,29,29 */ + {"mdoio", 0x7fbdeb78, 0xffffffff, POWER7, 0, {0}}, ++/* or 30,30,30 */ + {"mdoom", 0x7fdef378, 0xffffffff, POWER7, 0, {0}}, + {"mr", XRC(31,444,0), X_MASK, COM, 0, {RA, RSB}}, + {"or", XRC(31,444,0), X_MASK, COM, 0, {RA, RS, RB}}, +@@ -7124,8 +7201,10 @@ const struct powerpc_opcode powerpc_opco + + {"mtmq", XSPR(31,467, 0), XSPR_MASK, M601, 0, {RS}}, + {"mtxer", XSPR(31,467, 1), XSPR_MASK, COM, 0, {RS}}, ++{"mtudscr", XSPR(31,467, 3), XSPR_MASK, POWER9, 0, {RS}}, + {"mtlr", XSPR(31,467, 8), XSPR_MASK, COM, 0, {RS}}, + {"mtctr", XSPR(31,467, 9), XSPR_MASK, COM, 0, {RS}}, ++{"mtuamr", XSPR(31,467, 13), XSPR_MASK, POWER9, 0, {RS}}, + {"mtdscr", XSPR(31,467, 17), XSPR_MASK, POWER6, 0, {RS}}, + {"mttid", XSPR(31,467, 17), XSPR_MASK, POWER, 0, {RS}}, + {"mtdsisr", XSPR(31,467, 18), XSPR_MASK, COM, TITAN, {RS}}, +@@ -7138,13 +7217,20 @@ const struct powerpc_opcode powerpc_opco + {"mtsrr0", XSPR(31,467, 26), XSPR_MASK, COM, 0, {RS}}, + {"mtsrr1", XSPR(31,467, 27), XSPR_MASK, COM, 0, {RS}}, + {"mtcfar", XSPR(31,467, 28), XSPR_MASK, POWER6, 0, {RS}}, ++{"mtamr", XSPR(31,467, 29), XSPR_MASK, POWER7, 0, {RS}}, ++{"mtpidr", XSPR(31,467, 48), XSPR_MASK, POWER10, 0, {RS}}, + {"mtpid", XSPR(31,467, 48), XSPR_MASK, BOOKE, 0, {RS}}, + {"mtdecar", XSPR(31,467, 54), XSPR_MASK, BOOKE, 0, {RS}}, + {"mtcsrr0", XSPR(31,467, 58), XSPR_MASK, BOOKE, 0, {RS}}, + {"mtcsrr1", XSPR(31,467, 59), XSPR_MASK, BOOKE, 0, {RS}}, ++{"mtiamr", XSPR(31,467, 61), XSPR_MASK, POWER10, 0, {RS}}, + {"mtdear", XSPR(31,467, 61), XSPR_MASK, BOOKE, 0, {RS}}, + {"mtesr", XSPR(31,467, 62), XSPR_MASK, BOOKE, 0, {RS}}, + {"mtivpr", XSPR(31,467, 63), XSPR_MASK, BOOKE, 0, {RS}}, ++{"mttfhar", XSPR(31,467,128), XSPR_MASK, POWER9, 0, {RS}}, ++{"mttfiar", XSPR(31,467,129), XSPR_MASK, POWER9, 0, {RS}}, ++{"mttexasr", XSPR(31,467,130), XSPR_MASK, POWER9, 0, {RS}}, ++{"mttexasru", XSPR(31,467,131), XSPR_MASK, POWER9, 0, {RS}}, + {"mtcmpa", XSPR(31,467,144), XSPR_MASK, PPC860, 0, {RS}}, + {"mtcmpb", XSPR(31,467,145), XSPR_MASK, PPC860, 0, {RS}}, + {"mtcmpc", XSPR(31,467,146), XSPR_MASK, PPC860, 0, {RS}}, +@@ -7155,13 +7241,24 @@ const struct powerpc_opcode powerpc_opco + {"mtcountb", XSPR(31,467,151), XSPR_MASK, PPC860, 0, {RS}}, + {"mtctrl", XSPR(31,467,152), XSPR_MASK, POWER4, 0, {RS}}, + {"mtcmpe", XSPR(31,467,152), XSPR_MASK, PPC860, 0, {RS}}, ++{"mtfscr", XSPR(31,467,153), XSPR_MASK, POWER10, 0, {RS}}, + {"mtcmpf", XSPR(31,467,153), XSPR_MASK, PPC860, 0, {RS}}, + {"mtcmpg", XSPR(31,467,154), XSPR_MASK, PPC860, 0, {RS}}, + {"mtcmph", XSPR(31,467,155), XSPR_MASK, PPC860, 0, {RS}}, + {"mtlctrl1", XSPR(31,467,156), XSPR_MASK, PPC860, 0, {RS}}, ++{"mtuamor", XSPR(31,467,157), XSPR_MASK, POWER7, 0, {RS}}, + {"mtlctrl2", XSPR(31,467,157), XSPR_MASK, PPC860, 0, {RS}}, + {"mtictrl", XSPR(31,467,158), XSPR_MASK, PPC860, 0, {RS}}, ++{"mtpspb", XSPR(31,467,159), XSPR_MASK, POWER10, 0, {RS}}, + {"mtbar", XSPR(31,467,159), XSPR_MASK, PPC860, 0, {RS}}, ++{"mtdpdes", XSPR(31,467,176), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtdawr0", XSPR(31,467,180), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtdawr1", XSPR(31,467,181), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtrpr", XSPR(31,467,186), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtciabr", XSPR(31,467,187), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtdawrx0", XSPR(31,467,188), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtdawrx1", XSPR(31,467,189), XSPR_MASK, POWER10, 0, {RS}}, ++{"mthfscr", XSPR(31,467,190), XSPR_MASK, POWER10, 0, {RS}}, + {"mtvrsave", XSPR(31,467,256), XSPR_MASK, PPCVEC, 0, {RS}}, + {"mtusprg0", XSPR(31,467,256), XSPR_MASK, BOOKE, 0, {RS}}, + {"mtsprg", XSPR(31,467,256), XSPRG_MASK, PPC, 0, {SPRG, RS}}, +@@ -7177,20 +7274,38 @@ const struct powerpc_opcode powerpc_opco + {"mtear", XSPR(31,467,282), XSPR_MASK, PPC, TITAN, {RS}}, + {"mttbl", XSPR(31,467,284), XSPR_MASK, PPC, 0, {RS}}, + {"mttbu", XSPR(31,467,285), XSPR_MASK, PPC, 0, {RS}}, ++{"mttbu40", XSPR(31,467,286), XSPR_MASK, POWER10, 0, {RS}}, ++{"mthsprg0", XSPR(31,467,304), XSPR_MASK, POWER10, 0, {RS}}, + {"mtdbsr", XSPR(31,467,304), XSPR_MASK, BOOKE, 0, {RS}}, ++{"mthsprg1", XSPR(31,467,305), XSPR_MASK, POWER10, 0, {RS}}, ++{"mthdisr", XSPR(31,467,306), XSPR_MASK, POWER10, 0, {RS}}, ++{"mthdar", XSPR(31,467,307), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtspurr", XSPR(31,467,308), XSPR_MASK, POWER10, 0, {RS}}, + {"mtdbcr0", XSPR(31,467,308), XSPR_MASK, BOOKE, 0, {RS}}, ++{"mtpurr", XSPR(31,467,309), XSPR_MASK, POWER10, 0, {RS}}, + {"mtdbcr1", XSPR(31,467,309), XSPR_MASK, BOOKE, 0, {RS}}, ++{"mthdec", XSPR(31,467,310), XSPR_MASK, POWER10, 0, {RS}}, + {"mtdbcr2", XSPR(31,467,310), XSPR_MASK, BOOKE, 0, {RS}}, + {"mtiac1", XSPR(31,467,312), XSPR_MASK, BOOKE, 0, {RS}}, ++{"mthrmor", XSPR(31,467,313), XSPR_MASK, POWER10, 0, {RS}}, + {"mtiac2", XSPR(31,467,313), XSPR_MASK, BOOKE, 0, {RS}}, ++{"mthsrr0", XSPR(31,467,314), XSPR_MASK, POWER10, 0, {RS}}, + {"mtiac3", XSPR(31,467,314), XSPR_MASK, BOOKE, 0, {RS}}, ++{"mthsrr1", XSPR(31,467,315), XSPR_MASK, POWER10, 0, {RS}}, + {"mtiac4", XSPR(31,467,315), XSPR_MASK, BOOKE, 0, {RS}}, + {"mtdac1", XSPR(31,467,316), XSPR_MASK, BOOKE, 0, {RS}}, + {"mtdac2", XSPR(31,467,317), XSPR_MASK, BOOKE, 0, {RS}}, ++{"mtlpcr", XSPR(31,467,318), XSPR_MASK, POWER10, 0, {RS}}, + {"mtdvc1", XSPR(31,467,318), XSPR_MASK, BOOKE, 0, {RS}}, ++{"mtlpidr", XSPR(31,467,319), XSPR_MASK, POWER10, 0, {RS}}, + {"mtdvc2", XSPR(31,467,319), XSPR_MASK, BOOKE, 0, {RS}}, ++{"mthmer", XSPR(31,467,336), XSPR_MASK, POWER7, 0, {RS}}, + {"mttsr", XSPR(31,467,336), XSPR_MASK, BOOKE, 0, {RS}}, ++{"mthmeer", XSPR(31,467,337), XSPR_MASK, POWER7, 0, {RS}}, ++{"mtpcr", XSPR(31,467,338), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtheir", XSPR(31,467,339), XSPR_MASK, POWER10, 0, {RS}}, + {"mttcr", XSPR(31,467,340), XSPR_MASK, BOOKE, 0, {RS}}, ++{"mtamor", XSPR(31,467,349), XSPR_MASK, POWER7, 0, {RS}}, + {"mtivor0", XSPR(31,467,400), XSPR_MASK, BOOKE, 0, {RS}}, + {"mtivor1", XSPR(31,467,401), XSPR_MASK, BOOKE, 0, {RS}}, + {"mtivor2", XSPR(31,467,402), XSPR_MASK, BOOKE, 0, {RS}}, +@@ -7207,6 +7322,13 @@ const struct powerpc_opcode powerpc_opco + {"mtivor13", XSPR(31,467,413), XSPR_MASK, BOOKE, 0, {RS}}, + {"mtivor14", XSPR(31,467,414), XSPR_MASK, BOOKE, 0, {RS}}, + {"mtivor15", XSPR(31,467,415), XSPR_MASK, BOOKE, 0, {RS}}, ++{"mtptcr", XSPR(31,467,464), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtuspgr0", XSPR(31,467,496), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtuspgr1", XSPR(31,467,497), XSPR_MASK, POWER10, 0, {RS}}, ++{"mturmor", XSPR(31,467,505), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtusrr0", XSPR(31,467,506), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtusrr1", XSPR(31,467,507), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtsmfctrl", XSPR(31,467,511), XSPR_MASK, POWER10, 0, {RS}}, + {"mtspefscr", XSPR(31,467,512), XSPR_MASK, PPCSPE, 0, {RS}}, + {"mtbbear", XSPR(31,467,513), XSPR_MASK, PPCBRLK, 0, {RS}}, + {"mtbbtar", XSPR(31,467,514), XSPR_MASK, PPCBRLK, 0, {RS}}, +@@ -7221,12 +7343,44 @@ const struct powerpc_opcode powerpc_opco + {"mtmcsrr0", XSPR(31,467,570), XSPR_MASK, PPCRFMCI, 0, {RS}}, + {"mtmcsrr1", XSPR(31,467,571), XSPR_MASK, PPCRFMCI, 0, {RS}}, + {"mtmcsr", XSPR(31,467,572), XSPR_MASK, PPCRFMCI, 0, {RS}}, ++{"mtsier2", XSPR(31,467,752), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtsier3", XSPR(31,467,753), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtmmcr3", XSPR(31,467,754), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtummcr2", XSPR(31,467,769), XSPR_MASK, POWER9, 0, {RS}}, ++{"mtmmcr2", XSPR(31,467,769), XSPR_MASK, POWER9, 0, {RS}}, ++{"mtummcra", XSPR(31,467,770), XSPR_MASK, POWER9, 0, {RS}}, + {"mtupmc1", XSPR(31,467,771), XSPR_MASK, POWER9, 0, {RS}}, + {"mtupmc2", XSPR(31,467,772), XSPR_MASK, POWER9, 0, {RS}}, + {"mtupmc3", XSPR(31,467,773), XSPR_MASK, POWER9, 0, {RS}}, + {"mtupmc4", XSPR(31,467,774), XSPR_MASK, POWER9, 0, {RS}}, + {"mtupmc5", XSPR(31,467,775), XSPR_MASK, POWER9, 0, {RS}}, + {"mtupmc6", XSPR(31,467,776), XSPR_MASK, POWER9, 0, {RS}}, ++{"mtummcr0", XSPR(31,467,779), XSPR_MASK, POWER9, 0, {RS}}, ++{"mtsier", XSPR(31,467,784), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtmmcra", XSPR(31,467,786), XSPR_MASK, POWER7, 0, {RS}}, ++{"mtpmc1", XSPR(31,467,787), XSPR_MASK, POWER7, 0, {RS}}, ++{"mtpmc2", XSPR(31,467,788), XSPR_MASK, POWER7, 0, {RS}}, ++{"mtpmc3", XSPR(31,467,789), XSPR_MASK, POWER7, 0, {RS}}, ++{"mtpmc4", XSPR(31,467,790), XSPR_MASK, POWER7, 0, {RS}}, ++{"mtpmc5", XSPR(31,467,791), XSPR_MASK, POWER7, 0, {RS}}, ++{"mtpmc6", XSPR(31,467,792), XSPR_MASK, POWER7, 0, {RS}}, ++{"mtmmcr0", XSPR(31,467,795), XSPR_MASK, POWER7, 0, {RS}}, ++{"mtsiar", XSPR(31,467,796), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtsdar", XSPR(31,467,797), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtmmcr1", XSPR(31,467,798), XSPR_MASK, POWER7, 0, {RS}}, ++{"mtbescrs", XSPR(31,467,800), XSPR_MASK, POWER9, 0, {RS}}, ++{"mtbescrsu", XSPR(31,467,801), XSPR_MASK, POWER9, 0, {RS}}, ++{"mtbescrr", XSPR(31,467,802), XSPR_MASK, POWER9, 0, {RS}}, ++{"mtbescrru", XSPR(31,467,803), XSPR_MASK, POWER9, 0, {RS}}, ++{"mtebbhr", XSPR(31,467,804), XSPR_MASK, POWER9, 0, {RS}}, ++{"mtebbrr", XSPR(31,467,805), XSPR_MASK, POWER9, 0, {RS}}, ++{"mtbescr", XSPR(31,467,806), XSPR_MASK, POWER9, 0, {RS}}, ++{"mttar", XSPR(31,467,815), XSPR_MASK, POWER9, 0, {RS}}, ++{"mtasdr", XSPR(31,467,816), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtpsscr", XSPR(31,467,823), XSPR_MASK, POWER10, 0, {RS}}, ++{"mtic", XSPR(31,467,848), XSPR_MASK, POWER8, 0, {RS}}, ++{"mtvtb", XSPR(31,467,849), XSPR_MASK, POWER8, 0, {RS}}, ++{"mthpsscr", XSPR(31,467,855), XSPR_MASK, POWER10, 0, {RS}}, + {"mtivndx", XSPR(31,467,880), XSPR_MASK, TITAN, 0, {RS}}, + {"mtdvndx", XSPR(31,467,881), XSPR_MASK, TITAN, 0, {RS}}, + {"mtivlim", XSPR(31,467,882), XSPR_MASK, TITAN, 0, {RS}}, +@@ -8301,7 +8455,7 @@ const struct powerpc_opcode powerpc_opco + {"xxgenpcvdm", X(60,949), XX1_MASK, POWER10, PPCVLE, {XT6, VB, UIMM}}, + {"xvxexpdp", XX2VA(60,475,0),XX2_MASK, PPCVSX3, PPCVLE, {XT6, XB6}}, + {"xvxsigdp", XX2VA(60,475,1),XX2_MASK, PPCVSX3, PPCVLE, {XT6, XB6}}, +-{"xvtlsbb", XX2VA(60,475,2),XX2BF_MASK, POWER10, PPCVLE, {OBF, XB6}}, ++{"xvtlsbb", XX2VA(60,475,2),XX2BF_MASK, POWER10, PPCVLE, {BF, XB6}}, + {"xxbrh", XX2VA(60,475,7),XX2_MASK, PPCVSX3, PPCVLE, {XT6, XB6}}, + {"xvxexpsp", XX2VA(60,475,8),XX2_MASK, PPCVSX3, PPCVLE, {XT6, XB6}}, + {"xvxsigsp", XX2VA(60,475,9),XX2_MASK, PPCVSX3, PPCVLE, {XT6, XB6}}, +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/i386/movdir-16bit.d 2020-11-25 14:37:42.000000000 +0000 +@@ -0,0 +1,21 @@ ++#as: -I${srcdir}/$subdir ++#objdump: -dw -Mi8086 ++#name: i386 16-bit MOVDIR[I,64B] insns ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ <_start>: ++ +[a-f0-9]+: 67 0f 38 f9 01 movdiri %eax,\(%ecx\) ++ +[a-f0-9]+: 67 66 0f 38 f8 01 movdir64b \(%ecx\),%eax ++ +[a-f0-9]+: 66 0f 38 f8 04 movdir64b \(%si\),%ax ++ +[a-f0-9]+: 66 0f 38 f8 0e 00 00 movdir64b 0x0,%cx ++ +[a-f0-9]+: 66 0f 38 f8 0e 34 12 movdir64b 0x1234,%cx ++ +[a-f0-9]+: 67 0f 38 f9 01 movdiri %eax,\(%ecx\) ++ +[a-f0-9]+: 67 0f 38 f9 01 movdiri %eax,\(%ecx\) ++ +[a-f0-9]+: 67 66 0f 38 f8 01 movdir64b \(%ecx\),%eax ++ +[a-f0-9]+: 66 0f 38 f8 04 movdir64b \(%si\),%ax ++ +[a-f0-9]+: 66 0f 38 f8 0e 00 00 movdir64b 0x0,%cx ++ +[a-f0-9]+: 66 0f 38 f8 0e 34 12 movdir64b 0x1234,%cx ++#pass +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-i386/pr26711-1.d 2020-11-25 14:38:12.000000000 +0000 +@@ -0,0 +1,10 @@ ++#source: ../ld-x86-64/pr26711.s ++#source: ../ld-x86-64/start.s ++#as: --32 -mx86-used-note=no ++#ld: -m elf_i386 -z ibt ++#readelf: -n ++ ++Displaying notes found in: .note.gnu.property ++[ ]+Owner[ ]+Data size[ ]+Description ++ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 ++ Properties: x86 feature: IBT +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-i386/pr26711-2.d 2020-11-25 14:38:12.000000000 +0000 +@@ -0,0 +1,10 @@ ++#source: ../ld-x86-64/pr26711.s ++#source: ../ld-x86-64/start.s ++#as: --32 -mx86-used-note=no ++#ld: -m elf_i386 -z shstk ++#readelf: -n ++ ++Displaying notes found in: .note.gnu.property ++[ ]+Owner[ ]+Data size[ ]+Description ++ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 ++ Properties: x86 feature: SHSTK +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-i386/pr26711-3.d 2020-11-25 14:38:12.000000000 +0000 +@@ -0,0 +1,10 @@ ++#source: ../ld-x86-64/pr26711.s ++#source: ../ld-x86-64/start.s ++#as: --32 -mx86-used-note=no ++#ld: -m elf_i386 -z ibt -z shstk ++#readelf: -n ++ ++Displaying notes found in: .note.gnu.property ++[ ]+Owner[ ]+Data size[ ]+Description ++ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 ++ Properties: x86 feature: IBT, SHSTK +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-i386/pr26869.d 2020-11-25 14:38:12.000000000 +0000 +@@ -0,0 +1,14 @@ ++#as: --32 ++#ld: -shared -melf_i386 ++#readelf: -r -s --wide ++ ++Relocation section '.rel.dyn' at offset 0x[a-f0-9]+ contains 1 entry: ++ Offset Info Type Sym. Value Symbol's Name ++0+[a-f0-9]+ 00000008 R_386_RELATIVE ++ ++#... ++Symbol table '.symtab' contains [0-9]+ entries: ++ Num: Value Size Type Bind Vis Ndx Name ++#... ++ +[a-f0-9]+: 00000000 0 NOTYPE LOCAL DEFAULT 1 __ehdr_start ++#pass +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-i386/pr26869.s 2020-11-25 14:38:12.000000000 +0000 +@@ -0,0 +1,3 @@ ++ .text ++foo: ++ pushl __ehdr_start@GOT(%ebx) +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-x86-64/pr26711-1-x32.d 2020-11-25 14:38:14.000000000 +0000 +@@ -0,0 +1,10 @@ ++#source: pr26711.s ++#source: start.s ++#as: --x32 -mx86-used-note=no ++#ld: -m elf32_x86_64 -z ibt ++#readelf: -n ++ ++Displaying notes found in: .note.gnu.property ++[ ]+Owner[ ]+Data size[ ]+Description ++ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 ++ Properties: x86 feature: IBT +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-x86-64/pr26711-1.d 2020-11-25 14:38:14.000000000 +0000 +@@ -0,0 +1,10 @@ ++#source: pr26711.s ++#source: start.s ++#as: --64 -defsym __64_bit__=1 -mx86-used-note=no ++#ld: -m elf_x86_64 -z ibt ++#readelf: -n ++ ++Displaying notes found in: .note.gnu.property ++[ ]+Owner[ ]+Data size[ ]+Description ++ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 ++ Properties: x86 feature: IBT +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-x86-64/pr26711-2-x32.d 2020-11-25 14:38:14.000000000 +0000 +@@ -0,0 +1,10 @@ ++#source: pr26711.s ++#source: start.s ++#as: --x32 -mx86-used-note=no ++#ld: -m elf32_x86_64 -z shstk ++#readelf: -n ++ ++Displaying notes found in: .note.gnu.property ++[ ]+Owner[ ]+Data size[ ]+Description ++ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 ++ Properties: x86 feature: SHSTK +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-x86-64/pr26711-2.d 2020-11-25 14:38:14.000000000 +0000 +@@ -0,0 +1,10 @@ ++#source: pr26711.s ++#source: start.s ++#as: --64 -defsym __64_bit__=1 -mx86-used-note=no ++#ld: -m elf_x86_64 -z shstk ++#readelf: -n ++ ++Displaying notes found in: .note.gnu.property ++[ ]+Owner[ ]+Data size[ ]+Description ++ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 ++ Properties: x86 feature: SHSTK +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-x86-64/pr26711-3-x32.d 2020-11-25 14:38:14.000000000 +0000 +@@ -0,0 +1,10 @@ ++#source: pr26711.s ++#source: start.s ++#as: --x32 -mx86-used-note=no ++#ld: -m elf32_x86_64 -z ibt -z shstk ++#readelf: -n ++ ++Displaying notes found in: .note.gnu.property ++[ ]+Owner[ ]+Data size[ ]+Description ++ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 ++ Properties: x86 feature: IBT, SHSTK +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-x86-64/pr26711-3.d 2020-11-25 14:38:14.000000000 +0000 +@@ -0,0 +1,10 @@ ++#source: pr26711.s ++#source: start.s ++#as: --64 -defsym __64_bit__=1 -mx86-used-note=no ++#ld: -m elf_x86_64 -z ibt -z shstk ++#readelf: -n ++ ++Displaying notes found in: .note.gnu.property ++[ ]+Owner[ ]+Data size[ ]+Description ++ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 ++ Properties: x86 feature: IBT, SHSTK +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-x86-64/pr26711.s 2020-11-25 14:38:14.000000000 +0000 +@@ -0,0 +1,33 @@ ++ .section ".note.gnu.property", "a" ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++ .long 1f - 0f /* name length */ ++ .long 5f - 2f /* data length */ ++ .long 5 /* note type */ ++0: .asciz "GNU" /* vendor name */ ++1: ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++2: .long 0xc0001002 /* pr_type. */ ++ .long 4f - 3f /* pr_datasz. */ ++3: ++ .long 0x30 ++4: ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++5: ++ ++ .text ++ .globl foo ++ .type foo, @function ++foo: ++ ret +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/binutils/testsuite/binutils-all/x86-64/pr26808.dump 2020-11-25 14:37:37.000000000 +0000 +@@ -0,0 +1,1440 @@ ++Contents of the .debug_info.dwo section: ++ ++ Compilation Unit @ offset 0x0: ++ Length: 0x178 (32-bit) ++ Version: 4 ++ Abbrev Offset: 0x0 ++ Pointer Size: 8 ++ Section contributions: ++ .debug_abbrev.dwo: 0x0 0x154 ++ .debug_line.dwo: 0x0 0x40 ++ .debug_loc.dwo: 0x0 0x0 ++ .debug_str_offsets.dwo: 0x0 0x14 ++ <0>: Abbrev Number: 12 (DW_TAG_compile_unit) ++ DW_AT_producer : GNU C++ 4.7.x-google 20120720 (prerelease) ++ <37> DW_AT_language : 4 (C++) ++ <38> DW_AT_name : dwp_test_main.cc ++ <49> DW_AT_comp_dir : /home/ccoutant/opensource/binutils-git/binutils/gold/testsuite ++ <88> DW_AT_GNU_dwo_id : 0xe5ba51d95c9aebc8 ++ <1><90>: Abbrev Number: 7 (DW_TAG_base_type) ++ <91> DW_AT_byte_size : 4 ++ <92> DW_AT_encoding : 5 (signed) ++ <93> DW_AT_name : int ++ <1><97>: Abbrev Number: 7 (DW_TAG_base_type) ++ <98> DW_AT_byte_size : 1 ++ <99> DW_AT_encoding : 2 (boolean) ++ <9a> DW_AT_name : bool ++ <1><9f>: Abbrev Number: 13 (DW_TAG_subprogram) ++ DW_AT_external : 1 ++ DW_AT_name : main ++ DW_AT_decl_file : 1 ++ DW_AT_decl_line : 30 ++ DW_AT_type : <0x90> ++ DW_AT_low_pc : (addr_index: 0x0): ++ DW_AT_high_pc : 0x304 ++ DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ DW_AT_GNU_all_tail_call_sites: 1 ++ DW_AT_sibling : <0x11b> ++ <2>: Abbrev Number: 14 (DW_TAG_lexical_block) ++ DW_AT_low_pc : (addr_index: 0x1): ++ DW_AT_high_pc : 0x2fa ++ <3>: Abbrev Number: 15 (DW_TAG_variable) ++ DW_AT_name : c1 ++ DW_AT_decl_file : 1 ++ DW_AT_decl_line : 32 ++ DW_AT_type : signature: 0xb5faa2a4b7a919c4 ++ DW_AT_location : 2 byte block: 91 60 (DW_OP_fbreg: -32) ++ <3>: Abbrev Number: 15 (DW_TAG_variable) ++ DW_AT_name : c2 ++ DW_AT_decl_file : 1 ++ DW_AT_decl_line : 33 ++ DW_AT_type : signature: 0xab98c7bc886f5266 ++ DW_AT_location : 2 byte block: 91 50 (DW_OP_fbreg: -48) ++ <3>: Abbrev Number: 16 (DW_TAG_variable) ++ DW_AT_name : __PRETTY_FUNCTION__ ++ DW_AT_type : <0x13f> ++ DW_AT_artificial : 1 ++ DW_AT_location : 2 byte block: fb 2 (DW_OP_GNU_addr_index <0x2>) ++ <3><102>: Abbrev Number: 14 (DW_TAG_lexical_block) ++ <103> DW_AT_low_pc : (addr_index: 0x3): ++ <104> DW_AT_high_pc : 0x2f ++ <4><10c>: Abbrev Number: 17 (DW_TAG_variable) ++ <10d> DW_AT_name : i ++ <10f> DW_AT_decl_file : 1 ++ <110> DW_AT_decl_line : 37 ++ <111> DW_AT_type : <0x90> ++ <115> DW_AT_location : 2 byte block: 91 6c (DW_OP_fbreg: -20) ++ <4><118>: Abbrev Number: 0 ++ <3><119>: Abbrev Number: 0 ++ <2><11a>: Abbrev Number: 0 ++ <1><11b>: Abbrev Number: 18 (DW_TAG_array_type) ++ <11c> DW_AT_type : <0x137> ++ <120> DW_AT_sibling : <0x12b> ++ <2><124>: Abbrev Number: 19 (DW_TAG_subrange_type) ++ <125> DW_AT_type : <0x12b> ++ <129> DW_AT_upper_bound : 10 ++ <2><12a>: Abbrev Number: 0 ++ <1><12b>: Abbrev Number: 7 (DW_TAG_base_type) ++ <12c> DW_AT_byte_size : 8 ++ <12d> DW_AT_encoding : 7 (unsigned) ++ <12e> DW_AT_name : sizetype ++ <1><137>: Abbrev Number: 7 (DW_TAG_base_type) ++ <138> DW_AT_byte_size : 1 ++ <139> DW_AT_encoding : 6 (signed char) ++ <13a> DW_AT_name : char ++ <1><13f>: Abbrev Number: 20 (DW_TAG_const_type) ++ <140> DW_AT_type : <0x11b> ++ <1><144>: Abbrev Number: 21 (DW_TAG_variable) ++ <145> DW_AT_name : c3 ++ <148> DW_AT_decl_file : 2 ++ <149> DW_AT_decl_line : 57 ++ <14a> DW_AT_type : signature: 0xb534bdc1f01629bb ++ <152> DW_AT_external : 1 ++ <152> DW_AT_declaration : 1 ++ <1><152>: Abbrev Number: 22 (DW_TAG_variable) ++ <153> DW_AT_name : v3 ++ <156> DW_AT_decl_file : 2 ++ <157> DW_AT_decl_line : 60 ++ <158> DW_AT_type : <0x90> ++ <15c> DW_AT_external : 1 ++ <15c> DW_AT_declaration : 1 ++ <1><15c>: Abbrev Number: 18 (DW_TAG_array_type) ++ <15d> DW_AT_type : <0x137> ++ <161> DW_AT_sibling : <0x167> ++ <2><165>: Abbrev Number: 23 (DW_TAG_subrange_type) ++ <2><166>: Abbrev Number: 0 ++ <1><167>: Abbrev Number: 22 (DW_TAG_variable) ++ <168> DW_AT_name : v4 ++ <16b> DW_AT_decl_file : 2 ++ <16c> DW_AT_decl_line : 61 ++ <16d> DW_AT_type : <0x15c> ++ <171> DW_AT_external : 1 ++ <171> DW_AT_declaration : 1 ++ <1><171>: Abbrev Number: 22 (DW_TAG_variable) ++ <172> DW_AT_name : v5 ++ <175> DW_AT_decl_file : 2 ++ <176> DW_AT_decl_line : 62 ++ <177> DW_AT_type : <0x15c> ++ <17b> DW_AT_external : 1 ++ <17b> DW_AT_declaration : 1 ++ <1><17b>: Abbrev Number: 0 ++ Compilation Unit @ offset 0x17c: ++ Length: 0x5af (32-bit) ++ Version: 4 ++ Abbrev Offset: 0x0 ++ Pointer Size: 8 ++ Section contributions: ++ .debug_abbrev.dwo: 0x154 0x21d ++ .debug_line.dwo: 0x40 0x3d ++ .debug_loc.dwo: 0x0 0x0 ++ .debug_str_offsets.dwo: 0x14 0x44 ++ <0><187>: Abbrev Number: 12 (DW_TAG_compile_unit) ++ <188> DW_AT_producer : GNU C++ 4.7.x-google 20120720 (prerelease) ++ <1b3> DW_AT_language : 4 (C++) ++ <1b4> DW_AT_name : dwp_test_1.cc ++ <1c2> DW_AT_comp_dir : /home/ccoutant/opensource/binutils-git/binutils/gold/testsuite ++ <201> DW_AT_GNU_dwo_id : 0x52f9c6092fdc3727 ++ <1><209>: Abbrev Number: 13 (DW_TAG_class_type) ++ <20a> DW_AT_name : C1 ++ <20d> DW_AT_signature : signature: 0xb5faa2a4b7a919c4 ++ <215> DW_AT_declaration : 1 ++ <215> DW_AT_sibling : <0x242> ++ <2><219>: Abbrev Number: 14 (DW_TAG_subprogram) ++ <21a> DW_AT_external : 1 ++ <21a> DW_AT_name : (indexed string: 0x0): testcase1 ++ <21b> DW_AT_decl_file : 1 ++ <21c> DW_AT_decl_line : 28 ++ <21d> DW_AT_linkage_name: (indexed string: 0xc): _ZN2C19testcase1Ev ++ <21e> DW_AT_type : <0x249> ++ <222> DW_AT_accessibility: 1 (public) ++ <223> DW_AT_declaration : 1 ++ <2><223>: Abbrev Number: 14 (DW_TAG_subprogram) ++ <224> DW_AT_external : 1 ++ <224> DW_AT_name : (indexed string: 0x1): testcase2 ++ <225> DW_AT_decl_file : 1 ++ <226> DW_AT_decl_line : 31 ++ <227> DW_AT_linkage_name: (indexed string: 0xd): _ZN2C19testcase2Ev ++ <228> DW_AT_type : <0x249> ++ <22c> DW_AT_accessibility: 1 (public) ++ <22d> DW_AT_declaration : 1 ++ <2><22d>: Abbrev Number: 14 (DW_TAG_subprogram) ++ <22e> DW_AT_external : 1 ++ <22e> DW_AT_name : (indexed string: 0x4): testcase3 ++ <22f> DW_AT_decl_file : 1 ++ <230> DW_AT_decl_line : 32 ++ <231> DW_AT_linkage_name: (indexed string: 0xe): _ZN2C19testcase3Ev ++ <232> DW_AT_type : <0x249> ++ <236> DW_AT_accessibility: 1 (public) ++ <237> DW_AT_declaration : 1 ++ <2><237>: Abbrev Number: 14 (DW_TAG_subprogram) ++ <238> DW_AT_external : 1 ++ <238> DW_AT_name : (indexed string: 0xa): testcase4 ++ <239> DW_AT_decl_file : 1 ++ <23a> DW_AT_decl_line : 33 ++ <23b> DW_AT_linkage_name: (indexed string: 0xf): _ZN2C19testcase4Ev ++ <23c> DW_AT_type : <0x249> ++ <240> DW_AT_accessibility: 1 (public) ++ <241> DW_AT_declaration : 1 ++ <2><241>: Abbrev Number: 0 ++ <1><242>: Abbrev Number: 7 (DW_TAG_base_type) ++ <243> DW_AT_byte_size : 4 ++ <244> DW_AT_encoding : 5 (signed) ++ <245> DW_AT_name : int ++ <1><249>: Abbrev Number: 7 (DW_TAG_base_type) ++ <24a> DW_AT_byte_size : 1 ++ <24b> DW_AT_encoding : 2 (boolean) ++ <24c> DW_AT_name : bool ++ <1><251>: Abbrev Number: 15 (DW_TAG_pointer_type) ++ <252> DW_AT_byte_size : 8 ++ <253> DW_AT_type : signature: 0xb5faa2a4b7a919c4 ++ <1><25b>: Abbrev Number: 13 (DW_TAG_class_type) ++ <25c> DW_AT_name : C2 ++ <25f> DW_AT_signature : signature: 0xab98c7bc886f5266 ++ <267> DW_AT_declaration : 1 ++ <267> DW_AT_sibling : <0x294> ++ <2><26b>: Abbrev Number: 14 (DW_TAG_subprogram) ++ <26c> DW_AT_external : 1 ++ <26c> DW_AT_name : (indexed string: 0x0): testcase1 ++ <26d> DW_AT_decl_file : 1 ++ <26e> DW_AT_decl_line : 40 ++ <26f> DW_AT_linkage_name: (indexed string: 0x7): _ZN2C29testcase1Ev ++ <270> DW_AT_type : <0x249> ++ <274> DW_AT_accessibility: 1 (public) ++ <275> DW_AT_declaration : 1 ++ <2><275>: Abbrev Number: 14 (DW_TAG_subprogram) ++ <276> DW_AT_external : 1 ++ <276> DW_AT_name : (indexed string: 0x1): testcase2 ++ <277> DW_AT_decl_file : 1 ++ <278> DW_AT_decl_line : 41 ++ <279> DW_AT_linkage_name: (indexed string: 0x8): _ZN2C29testcase2Ev ++ <27a> DW_AT_type : <0x249> ++ <27e> DW_AT_accessibility: 1 (public) ++ <27f> DW_AT_declaration : 1 ++ <2><27f>: Abbrev Number: 14 (DW_TAG_subprogram) ++ <280> DW_AT_external : 1 ++ <280> DW_AT_name : (indexed string: 0x4): testcase3 ++ <281> DW_AT_decl_file : 1 ++ <282> DW_AT_decl_line : 42 ++ <283> DW_AT_linkage_name: (indexed string: 0x9): _ZN2C29testcase3Ev ++ <284> DW_AT_type : <0x249> ++ <288> DW_AT_accessibility: 1 (public) ++ <289> DW_AT_declaration : 1 ++ <2><289>: Abbrev Number: 14 (DW_TAG_subprogram) ++ <28a> DW_AT_external : 1 ++ <28a> DW_AT_name : (indexed string: 0xa): testcase4 ++ <28b> DW_AT_decl_file : 1 ++ <28c> DW_AT_decl_line : 43 ++ <28d> DW_AT_linkage_name: (indexed string: 0xb): _ZN2C29testcase4Ev ++ <28e> DW_AT_type : <0x249> ++ <292> DW_AT_accessibility: 1 (public) ++ <293> DW_AT_declaration : 1 ++ <2><293>: Abbrev Number: 0 ++ <1><294>: Abbrev Number: 15 (DW_TAG_pointer_type) ++ <295> DW_AT_byte_size : 8 ++ <296> DW_AT_type : signature: 0xab98c7bc886f5266 ++ <1><29e>: Abbrev Number: 13 (DW_TAG_class_type) ++ <29f> DW_AT_name : C3 ++ <2a2> DW_AT_signature : signature: 0xb534bdc1f01629bb ++ <2aa> DW_AT_declaration : 1 ++ <2aa> DW_AT_sibling : <0x2cd> ++ <2><2ae>: Abbrev Number: 14 (DW_TAG_subprogram) ++ <2af> DW_AT_external : 1 ++ <2af> DW_AT_name : (indexed string: 0x0): testcase1 ++ <2b0> DW_AT_decl_file : 1 ++ <2b1> DW_AT_decl_line : 50 ++ <2b2> DW_AT_linkage_name: (indexed string: 0x2): _ZN2C39testcase1Ev ++ <2b3> DW_AT_type : <0x249> ++ <2b7> DW_AT_accessibility: 1 (public) ++ <2b8> DW_AT_declaration : 1 ++ <2><2b8>: Abbrev Number: 14 (DW_TAG_subprogram) ++ <2b9> DW_AT_external : 1 ++ <2b9> DW_AT_name : (indexed string: 0x1): testcase2 ++ <2ba> DW_AT_decl_file : 1 ++ <2bb> DW_AT_decl_line : 51 ++ <2bc> DW_AT_linkage_name: (indexed string: 0x3): _ZN2C39testcase2Ev ++ <2bd> DW_AT_type : <0x249> ++ <2c1> DW_AT_accessibility: 1 (public) ++ <2c2> DW_AT_declaration : 1 ++ <2><2c2>: Abbrev Number: 14 (DW_TAG_subprogram) ++ <2c3> DW_AT_external : 1 ++ <2c3> DW_AT_name : (indexed string: 0x4): testcase3 ++ <2c4> DW_AT_decl_file : 1 ++ <2c5> DW_AT_decl_line : 52 ++ <2c6> DW_AT_linkage_name: (indexed string: 0x5): _ZN2C39testcase3Ev ++ <2c7> DW_AT_type : <0x249> ++ <2cb> DW_AT_accessibility: 1 (public) ++ <2cc> DW_AT_declaration : 1 ++ <2><2cc>: Abbrev Number: 0 ++ <1><2cd>: Abbrev Number: 15 (DW_TAG_pointer_type) ++ <2ce> DW_AT_byte_size : 8 ++ <2cf> DW_AT_type : signature: 0xb534bdc1f01629bb ++ <1><2d7>: Abbrev Number: 16 (DW_TAG_subprogram) ++ <2d8> DW_AT_external : 1 ++ <2d8> DW_AT_name : f13i ++ <2dd> DW_AT_decl_file : 1 ++ <2de> DW_AT_decl_line : 70 ++ <2df> DW_AT_linkage_name: _Z4f13iv ++ <2e8> DW_AT_low_pc : (addr_index: 0x0): ++ <2e9> DW_AT_high_pc : 0x6 ++ <2f1> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <2f3> DW_AT_GNU_all_call_sites: 1 ++ <1><2f3>: Abbrev Number: 17 (DW_TAG_subprogram) ++ <2f4> DW_AT_specification: <0x219> ++ <2f8> DW_AT_decl_file : 2 ++ <2f9> DW_AT_decl_line : 30 ++ <2fa> DW_AT_low_pc : (addr_index: 0x1): ++ <2fb> DW_AT_high_pc : 0x20 ++ <303> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <305> DW_AT_object_pointer: <0x30d> ++ <309> DW_AT_GNU_all_tail_call_sites: 1 ++ <309> DW_AT_sibling : <0x317> ++ <2><30d>: Abbrev Number: 18 (DW_TAG_formal_parameter) ++ <30e> DW_AT_name : (indexed string: 0x10): this ++ <30f> DW_AT_type : <0x317> ++ <313> DW_AT_artificial : 1 ++ <313> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <2><316>: Abbrev Number: 0 ++ <1><317>: Abbrev Number: 19 (DW_TAG_const_type) ++ <318> DW_AT_type : <0x251> ++ <1><31c>: Abbrev Number: 20 (DW_TAG_subprogram) ++ <31d> DW_AT_specification: <0x223> ++ <321> DW_AT_decl_file : 2 ++ <322> DW_AT_decl_line : 38 ++ <323> DW_AT_low_pc : (addr_index: 0x2): ++ <324> DW_AT_high_pc : 0x18 ++ <32c> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <32e> DW_AT_object_pointer: <0x336> ++ <332> DW_AT_GNU_all_call_sites: 1 ++ <332> DW_AT_sibling : <0x340> ++ <2><336>: Abbrev Number: 18 (DW_TAG_formal_parameter) ++ <337> DW_AT_name : (indexed string: 0x10): this ++ <338> DW_AT_type : <0x317> ++ <33c> DW_AT_artificial : 1 ++ <33c> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <2><33f>: Abbrev Number: 0 ++ <1><340>: Abbrev Number: 20 (DW_TAG_subprogram) ++ <341> DW_AT_specification: <0x22d> ++ <345> DW_AT_decl_file : 2 ++ <346> DW_AT_decl_line : 46 ++ <347> DW_AT_low_pc : (addr_index: 0x3): ++ <348> DW_AT_high_pc : 0x18 ++ <350> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <352> DW_AT_object_pointer: <0x35a> ++ <356> DW_AT_GNU_all_call_sites: 1 ++ <356> DW_AT_sibling : <0x364> ++ <2><35a>: Abbrev Number: 18 (DW_TAG_formal_parameter) ++ <35b> DW_AT_name : (indexed string: 0x10): this ++ <35c> DW_AT_type : <0x317> ++ <360> DW_AT_artificial : 1 ++ <360> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <2><363>: Abbrev Number: 0 ++ <1><364>: Abbrev Number: 20 (DW_TAG_subprogram) ++ <365> DW_AT_specification: <0x237> ++ <369> DW_AT_decl_file : 2 ++ <36a> DW_AT_decl_line : 54 ++ <36b> DW_AT_low_pc : (addr_index: 0x4): ++ <36c> DW_AT_high_pc : 0x16 ++ <374> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <376> DW_AT_object_pointer: <0x37e> ++ <37a> DW_AT_GNU_all_call_sites: 1 ++ <37a> DW_AT_sibling : <0x388> ++ <2><37e>: Abbrev Number: 18 (DW_TAG_formal_parameter) ++ <37f> DW_AT_name : (indexed string: 0x10): this ++ <380> DW_AT_type : <0x317> ++ <384> DW_AT_artificial : 1 ++ <384> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <2><387>: Abbrev Number: 0 ++ <1><388>: Abbrev Number: 20 (DW_TAG_subprogram) ++ <389> DW_AT_specification: <0x26b> ++ <38d> DW_AT_decl_file : 2 ++ <38e> DW_AT_decl_line : 62 ++ <38f> DW_AT_low_pc : (addr_index: 0x5): ++ <390> DW_AT_high_pc : 0x16 ++ <398> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <39a> DW_AT_object_pointer: <0x3a2> ++ <39e> DW_AT_GNU_all_call_sites: 1 ++ <39e> DW_AT_sibling : <0x3ac> ++ <2><3a2>: Abbrev Number: 18 (DW_TAG_formal_parameter) ++ <3a3> DW_AT_name : (indexed string: 0x10): this ++ <3a4> DW_AT_type : <0x3ac> ++ <3a8> DW_AT_artificial : 1 ++ <3a8> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <2><3ab>: Abbrev Number: 0 ++ <1><3ac>: Abbrev Number: 19 (DW_TAG_const_type) ++ <3ad> DW_AT_type : <0x294> ++ <1><3b1>: Abbrev Number: 20 (DW_TAG_subprogram) ++ <3b2> DW_AT_specification: <0x275> ++ <3b6> DW_AT_decl_file : 2 ++ <3b7> DW_AT_decl_line : 72 ++ <3b8> DW_AT_low_pc : (addr_index: 0x6): ++ <3b9> DW_AT_high_pc : 0x1b ++ <3c1> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <3c3> DW_AT_object_pointer: <0x3cb> ++ <3c7> DW_AT_GNU_all_call_sites: 1 ++ <3c7> DW_AT_sibling : <0x3d5> ++ <2><3cb>: Abbrev Number: 18 (DW_TAG_formal_parameter) ++ <3cc> DW_AT_name : (indexed string: 0x10): this ++ <3cd> DW_AT_type : <0x3ac> ++ <3d1> DW_AT_artificial : 1 ++ <3d1> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <2><3d4>: Abbrev Number: 0 ++ <1><3d5>: Abbrev Number: 20 (DW_TAG_subprogram) ++ <3d6> DW_AT_specification: <0x27f> ++ <3da> DW_AT_decl_file : 2 ++ <3db> DW_AT_decl_line : 82 ++ <3dc> DW_AT_low_pc : (addr_index: 0x7): ++ <3dd> DW_AT_high_pc : 0x1b ++ <3e5> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <3e7> DW_AT_object_pointer: <0x3ef> ++ <3eb> DW_AT_GNU_all_call_sites: 1 ++ <3eb> DW_AT_sibling : <0x3f9> ++ <2><3ef>: Abbrev Number: 18 (DW_TAG_formal_parameter) ++ <3f0> DW_AT_name : (indexed string: 0x10): this ++ <3f1> DW_AT_type : <0x3ac> ++ <3f5> DW_AT_artificial : 1 ++ <3f5> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <2><3f8>: Abbrev Number: 0 ++ <1><3f9>: Abbrev Number: 20 (DW_TAG_subprogram) ++ <3fa> DW_AT_specification: <0x289> ++ <3fe> DW_AT_decl_file : 2 ++ <3ff> DW_AT_decl_line : 92 ++ <400> DW_AT_low_pc : (addr_index: 0x8): ++ <401> DW_AT_high_pc : 0x19 ++ <409> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <40b> DW_AT_object_pointer: <0x413> ++ <40f> DW_AT_GNU_all_call_sites: 1 ++ <40f> DW_AT_sibling : <0x41d> ++ <2><413>: Abbrev Number: 18 (DW_TAG_formal_parameter) ++ <414> DW_AT_name : (indexed string: 0x10): this ++ <415> DW_AT_type : <0x3ac> ++ <419> DW_AT_artificial : 1 ++ <419> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <2><41c>: Abbrev Number: 0 ++ <1><41d>: Abbrev Number: 20 (DW_TAG_subprogram) ++ <41e> DW_AT_specification: <0x2ae> ++ <422> DW_AT_decl_file : 2 ++ <423> DW_AT_decl_line : 102 ++ <424> DW_AT_low_pc : (addr_index: 0x9): ++ <425> DW_AT_high_pc : 0x19 ++ <42d> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <42f> DW_AT_object_pointer: <0x437> ++ <433> DW_AT_GNU_all_call_sites: 1 ++ <433> DW_AT_sibling : <0x441> ++ <2><437>: Abbrev Number: 18 (DW_TAG_formal_parameter) ++ <438> DW_AT_name : (indexed string: 0x10): this ++ <439> DW_AT_type : <0x441> ++ <43d> DW_AT_artificial : 1 ++ <43d> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <2><440>: Abbrev Number: 0 ++ <1><441>: Abbrev Number: 19 (DW_TAG_const_type) ++ <442> DW_AT_type : <0x2cd> ++ <1><446>: Abbrev Number: 17 (DW_TAG_subprogram) ++ <447> DW_AT_specification: <0x2b8> ++ <44b> DW_AT_decl_file : 2 ++ <44c> DW_AT_decl_line : 112 ++ <44d> DW_AT_low_pc : (addr_index: 0xa): ++ <44e> DW_AT_high_pc : 0x1f ++ <456> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <458> DW_AT_object_pointer: <0x460> ++ <45c> DW_AT_GNU_all_tail_call_sites: 1 ++ <45c> DW_AT_sibling : <0x46a> ++ <2><460>: Abbrev Number: 18 (DW_TAG_formal_parameter) ++ <461> DW_AT_name : (indexed string: 0x10): this ++ <462> DW_AT_type : <0x441> ++ <466> DW_AT_artificial : 1 ++ <466> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <2><469>: Abbrev Number: 0 ++ <1><46a>: Abbrev Number: 21 (DW_TAG_subprogram) ++ <46b> DW_AT_external : 1 ++ <46b> DW_AT_name : f11a ++ <470> DW_AT_decl_file : 2 ++ <471> DW_AT_decl_line : 120 ++ <472> DW_AT_linkage_name: _Z4f11av ++ <47b> DW_AT_type : <0x242> ++ <47f> DW_AT_low_pc : (addr_index: 0xb): ++ <480> DW_AT_high_pc : 0xb ++ <488> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <48a> DW_AT_GNU_all_call_sites: 1 ++ <1><48a>: Abbrev Number: 17 (DW_TAG_subprogram) ++ <48b> DW_AT_specification: <0x2c2> ++ <48f> DW_AT_decl_file : 2 ++ <490> DW_AT_decl_line : 126 ++ <491> DW_AT_low_pc : (addr_index: 0xc): ++ <492> DW_AT_high_pc : 0x20 ++ <49a> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <49c> DW_AT_object_pointer: <0x4a4> ++ <4a0> DW_AT_GNU_all_tail_call_sites: 1 ++ <4a0> DW_AT_sibling : <0x4ae> ++ <2><4a4>: Abbrev Number: 18 (DW_TAG_formal_parameter) ++ <4a5> DW_AT_name : (indexed string: 0x10): this ++ <4a6> DW_AT_type : <0x441> ++ <4aa> DW_AT_artificial : 1 ++ <4aa> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <2><4ad>: Abbrev Number: 0 ++ <1><4ae>: Abbrev Number: 22 (DW_TAG_subprogram) ++ <4af> DW_AT_external : 1 ++ <4af> DW_AT_name : t12 ++ <4b3> DW_AT_decl_file : 2 ++ <4b4> DW_AT_decl_line : 134 ++ <4b5> DW_AT_linkage_name: _Z3t12v ++ <4bd> DW_AT_type : <0x249> ++ <4c1> DW_AT_low_pc : (addr_index: 0xd): ++ <4c2> DW_AT_high_pc : 0x19 ++ <4ca> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <4cc> DW_AT_GNU_all_tail_call_sites: 1 ++ <1><4cc>: Abbrev Number: 22 (DW_TAG_subprogram) ++ <4cd> DW_AT_external : 1 ++ <4cd> DW_AT_name : t13 ++ <4d1> DW_AT_decl_file : 2 ++ <4d2> DW_AT_decl_line : 142 ++ <4d3> DW_AT_linkage_name: _Z3t13v ++ <4db> DW_AT_type : <0x249> ++ <4df> DW_AT_low_pc : (addr_index: 0xe): ++ <4e0> DW_AT_high_pc : 0x14 ++ <4e8> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <4ea> DW_AT_GNU_all_tail_call_sites: 1 ++ <1><4ea>: Abbrev Number: 23 (DW_TAG_subprogram) ++ <4eb> DW_AT_external : 1 ++ <4eb> DW_AT_name : t14 ++ <4ef> DW_AT_decl_file : 2 ++ <4f0> DW_AT_decl_line : 150 ++ <4f1> DW_AT_linkage_name: _Z3t14v ++ <4f9> DW_AT_type : <0x249> ++ <4fd> DW_AT_low_pc : (addr_index: 0xf): ++ <4fe> DW_AT_high_pc : 0x61 ++ <506> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <508> DW_AT_GNU_all_tail_call_sites: 1 ++ <508> DW_AT_sibling : <0x532> ++ <2><50c>: Abbrev Number: 24 (DW_TAG_lexical_block) ++ <50d> DW_AT_low_pc : (addr_index: 0x10): ++ <50e> DW_AT_high_pc : 0x57 ++ <3><516>: Abbrev Number: 25 (DW_TAG_variable) ++ <517> DW_AT_name : s1 ++ <51a> DW_AT_decl_file : 2 ++ <51b> DW_AT_decl_line : 152 ++ <51c> DW_AT_type : <0x532> ++ <520> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <3><523>: Abbrev Number: 25 (DW_TAG_variable) ++ <524> DW_AT_name : s2 ++ <527> DW_AT_decl_file : 2 ++ <528> DW_AT_decl_line : 153 ++ <529> DW_AT_type : <0x532> ++ <52d> DW_AT_location : 2 byte block: 91 60 (DW_OP_fbreg: -32) ++ <3><530>: Abbrev Number: 0 ++ <2><531>: Abbrev Number: 0 ++ <1><532>: Abbrev Number: 8 (DW_TAG_pointer_type) ++ <533> DW_AT_byte_size : 8 ++ <534> DW_AT_type : <0x538> ++ <1><538>: Abbrev Number: 19 (DW_TAG_const_type) ++ <539> DW_AT_type : <0x53d> ++ <1><53d>: Abbrev Number: 7 (DW_TAG_base_type) ++ <53e> DW_AT_byte_size : 1 ++ <53f> DW_AT_encoding : 6 (signed char) ++ <540> DW_AT_name : char ++ <1><545>: Abbrev Number: 23 (DW_TAG_subprogram) ++ <546> DW_AT_external : 1 ++ <546> DW_AT_name : t15 ++ <54a> DW_AT_decl_file : 2 ++ <54b> DW_AT_decl_line : 163 ++ <54c> DW_AT_linkage_name: _Z3t15v ++ <554> DW_AT_type : <0x249> ++ <558> DW_AT_low_pc : (addr_index: 0x11): ++ <559> DW_AT_high_pc : 0x5d ++ <561> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <563> DW_AT_GNU_all_tail_call_sites: 1 ++ <563> DW_AT_sibling : <0x58d> ++ <2><567>: Abbrev Number: 24 (DW_TAG_lexical_block) ++ <568> DW_AT_low_pc : (addr_index: 0x12): ++ <569> DW_AT_high_pc : 0x53 ++ <3><571>: Abbrev Number: 25 (DW_TAG_variable) ++ <572> DW_AT_name : s1 ++ <575> DW_AT_decl_file : 2 ++ <576> DW_AT_decl_line : 165 ++ <577> DW_AT_type : <0x58d> ++ <57b> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <3><57e>: Abbrev Number: 25 (DW_TAG_variable) ++ <57f> DW_AT_name : s2 ++ <582> DW_AT_decl_file : 2 ++ <583> DW_AT_decl_line : 166 ++ <584> DW_AT_type : <0x58d> ++ <588> DW_AT_location : 2 byte block: 91 60 (DW_OP_fbreg: -32) ++ <3><58b>: Abbrev Number: 0 ++ <2><58c>: Abbrev Number: 0 ++ <1><58d>: Abbrev Number: 8 (DW_TAG_pointer_type) ++ <58e> DW_AT_byte_size : 8 ++ <58f> DW_AT_type : <0x593> ++ <1><593>: Abbrev Number: 19 (DW_TAG_const_type) ++ <594> DW_AT_type : <0x598> ++ <1><598>: Abbrev Number: 7 (DW_TAG_base_type) ++ <599> DW_AT_byte_size : 4 ++ <59a> DW_AT_encoding : 5 (signed) ++ <59b> DW_AT_name : wchar_t ++ <1><5a3>: Abbrev Number: 22 (DW_TAG_subprogram) ++ <5a4> DW_AT_external : 1 ++ <5a4> DW_AT_name : t16 ++ <5a8> DW_AT_decl_file : 2 ++ <5a9> DW_AT_decl_line : 176 ++ <5aa> DW_AT_linkage_name: _Z3t16v ++ <5b2> DW_AT_type : <0x249> ++ <5b6> DW_AT_low_pc : (addr_index: 0x13): ++ <5b7> DW_AT_high_pc : 0x13 ++ <5bf> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <5c1> DW_AT_GNU_all_tail_call_sites: 1 ++ <1><5c1>: Abbrev Number: 26 (DW_TAG_subprogram) ++ <5c2> DW_AT_external : 1 ++ <5c2> DW_AT_name : t17 ++ <5c6> DW_AT_decl_file : 2 ++ <5c7> DW_AT_decl_line : 184 ++ <5c8> DW_AT_linkage_name: _Z3t17v ++ <5d0> DW_AT_type : <0x249> ++ <5d4> DW_AT_low_pc : (addr_index: 0x14): ++ <5d5> DW_AT_high_pc : 0x5f ++ <5dd> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <5df> DW_AT_GNU_all_call_sites: 1 ++ <5df> DW_AT_sibling : <0x612> ++ <2><5e3>: Abbrev Number: 24 (DW_TAG_lexical_block) ++ <5e4> DW_AT_low_pc : (addr_index: 0x15): ++ <5e5> DW_AT_high_pc : 0x59 ++ <3><5ed>: Abbrev Number: 25 (DW_TAG_variable) ++ <5ee> DW_AT_name : c ++ <5f0> DW_AT_decl_file : 2 ++ <5f1> DW_AT_decl_line : 186 ++ <5f2> DW_AT_type : <0x53d> ++ <5f6> DW_AT_location : 2 byte block: 91 6f (DW_OP_fbreg: -17) ++ <3><5f9>: Abbrev Number: 24 (DW_TAG_lexical_block) ++ <5fa> DW_AT_low_pc : (addr_index: 0x16): ++ <5fb> DW_AT_high_pc : 0x50 ++ <4><603>: Abbrev Number: 25 (DW_TAG_variable) ++ <604> DW_AT_name : i ++ <606> DW_AT_decl_file : 2 ++ <607> DW_AT_decl_line : 187 ++ <608> DW_AT_type : <0x242> ++ <60c> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <4><60f>: Abbrev Number: 0 ++ <3><610>: Abbrev Number: 0 ++ <2><611>: Abbrev Number: 0 ++ <1><612>: Abbrev Number: 23 (DW_TAG_subprogram) ++ <613> DW_AT_external : 1 ++ <613> DW_AT_name : t18 ++ <617> DW_AT_decl_file : 2 ++ <618> DW_AT_decl_line : 199 ++ <619> DW_AT_linkage_name: _Z3t18v ++ <621> DW_AT_type : <0x249> ++ <625> DW_AT_low_pc : (addr_index: 0x17): ++ <626> DW_AT_high_pc : 0x5f ++ <62e> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <630> DW_AT_GNU_all_tail_call_sites: 1 ++ <630> DW_AT_sibling : <0x67a> ++ <2><634>: Abbrev Number: 24 (DW_TAG_lexical_block) ++ <635> DW_AT_low_pc : (addr_index: 0x18): ++ <636> DW_AT_high_pc : 0x55 ++ <3><63e>: Abbrev Number: 25 (DW_TAG_variable) ++ <63f> DW_AT_name : c ++ <641> DW_AT_decl_file : 2 ++ <642> DW_AT_decl_line : 201 ++ <643> DW_AT_type : <0x53d> ++ <647> DW_AT_location : 2 byte block: 91 6f (DW_OP_fbreg: -17) ++ <3><64a>: Abbrev Number: 24 (DW_TAG_lexical_block) ++ <64b> DW_AT_low_pc : (addr_index: 0x19): ++ <64c> DW_AT_high_pc : 0x4c ++ <4><654>: Abbrev Number: 25 (DW_TAG_variable) ++ <655> DW_AT_name : i ++ <657> DW_AT_decl_file : 2 ++ <658> DW_AT_decl_line : 202 ++ <659> DW_AT_type : <0x242> ++ <65d> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <4><660>: Abbrev Number: 24 (DW_TAG_lexical_block) ++ <661> DW_AT_low_pc : (addr_index: 0x1a): ++ <662> DW_AT_high_pc : 0x34 ++ <5><66a>: Abbrev Number: 25 (DW_TAG_variable) ++ <66b> DW_AT_name : s ++ <66d> DW_AT_decl_file : 2 ++ <66e> DW_AT_decl_line : 204 ++ <66f> DW_AT_type : <0x532> ++ <673> DW_AT_location : 2 byte block: 91 60 (DW_OP_fbreg: -32) ++ <5><676>: Abbrev Number: 0 ++ <4><677>: Abbrev Number: 0 ++ <3><678>: Abbrev Number: 0 ++ <2><679>: Abbrev Number: 0 ++ <1><67a>: Abbrev Number: 27 (DW_TAG_variable) ++ <67b> DW_AT_name : c3 ++ <67e> DW_AT_decl_file : 1 ++ <67f> DW_AT_decl_line : 57 ++ <680> DW_AT_type : signature: 0xb534bdc1f01629bb ++ <688> DW_AT_external : 1 ++ <688> DW_AT_declaration : 1 ++ <1><688>: Abbrev Number: 28 (DW_TAG_variable) ++ <689> DW_AT_name : v2 ++ <68c> DW_AT_decl_file : 1 ++ <68d> DW_AT_decl_line : 59 ++ <68e> DW_AT_type : <0x242> ++ <692> DW_AT_external : 1 ++ <692> DW_AT_declaration : 1 ++ <1><692>: Abbrev Number: 28 (DW_TAG_variable) ++ <693> DW_AT_name : v3 ++ <696> DW_AT_decl_file : 1 ++ <697> DW_AT_decl_line : 60 ++ <698> DW_AT_type : <0x242> ++ <69c> DW_AT_external : 1 ++ <69c> DW_AT_declaration : 1 ++ <1><69c>: Abbrev Number: 29 (DW_TAG_array_type) ++ <69d> DW_AT_type : <0x53d> ++ <6a1> DW_AT_sibling : <0x6a7> ++ <2><6a5>: Abbrev Number: 30 (DW_TAG_subrange_type) ++ <2><6a6>: Abbrev Number: 0 ++ <1><6a7>: Abbrev Number: 28 (DW_TAG_variable) ++ <6a8> DW_AT_name : v4 ++ <6ab> DW_AT_decl_file : 1 ++ <6ac> DW_AT_decl_line : 61 ++ <6ad> DW_AT_type : <0x69c> ++ <6b1> DW_AT_external : 1 ++ <6b1> DW_AT_declaration : 1 ++ <1><6b1>: Abbrev Number: 28 (DW_TAG_variable) ++ <6b2> DW_AT_name : v5 ++ <6b5> DW_AT_decl_file : 1 ++ <6b6> DW_AT_decl_line : 62 ++ <6b7> DW_AT_type : <0x69c> ++ <6bb> DW_AT_external : 1 ++ <6bb> DW_AT_declaration : 1 ++ <1><6bb>: Abbrev Number: 29 (DW_TAG_array_type) ++ <6bc> DW_AT_type : <0x532> ++ <6c0> DW_AT_sibling : <0x6c6> ++ <2><6c4>: Abbrev Number: 30 (DW_TAG_subrange_type) ++ <2><6c5>: Abbrev Number: 0 ++ <1><6c6>: Abbrev Number: 28 (DW_TAG_variable) ++ <6c7> DW_AT_name : t17data ++ <6cf> DW_AT_decl_file : 1 ++ <6d0> DW_AT_decl_line : 83 ++ <6d1> DW_AT_type : <0x6bb> ++ <6d5> DW_AT_external : 1 ++ <6d5> DW_AT_declaration : 1 ++ <1><6d5>: Abbrev Number: 31 (DW_TAG_variable) ++ <6d6> DW_AT_name : p6 ++ <6d9> DW_AT_decl_file : 2 ++ <6da> DW_AT_decl_line : 69 ++ <6db> DW_AT_type : <0x6e2> ++ <6df> DW_AT_external : 1 ++ <6df> DW_AT_location : 2 byte block: fb 1b (DW_OP_GNU_addr_index <0x1b>) ++ <1><6e2>: Abbrev Number: 8 (DW_TAG_pointer_type) ++ <6e3> DW_AT_byte_size : 8 ++ <6e4> DW_AT_type : <0x242> ++ <1><6e8>: Abbrev Number: 31 (DW_TAG_variable) ++ <6e9> DW_AT_name : p7 ++ <6ec> DW_AT_decl_file : 2 ++ <6ed> DW_AT_decl_line : 79 ++ <6ee> DW_AT_type : <0x6e2> ++ <6f2> DW_AT_external : 1 ++ <6f2> DW_AT_location : 2 byte block: fb 1c (DW_OP_GNU_addr_index <0x1c>) ++ <1><6f5>: Abbrev Number: 31 (DW_TAG_variable) ++ <6f6> DW_AT_name : p8 ++ <6f9> DW_AT_decl_file : 2 ++ <6fa> DW_AT_decl_line : 89 ++ <6fb> DW_AT_type : <0x702> ++ <6ff> DW_AT_external : 1 ++ <6ff> DW_AT_location : 2 byte block: fb 1d (DW_OP_GNU_addr_index <0x1d>) ++ <1><702>: Abbrev Number: 8 (DW_TAG_pointer_type) ++ <703> DW_AT_byte_size : 8 ++ <704> DW_AT_type : <0x53d> ++ <1><708>: Abbrev Number: 31 (DW_TAG_variable) ++ <709> DW_AT_name : p9 ++ <70c> DW_AT_decl_file : 2 ++ <70d> DW_AT_decl_line : 99 ++ <70e> DW_AT_type : <0x702> ++ <712> DW_AT_external : 1 ++ <712> DW_AT_location : 2 byte block: fb 1e (DW_OP_GNU_addr_index <0x1e>) ++ <1><715>: Abbrev Number: 9 (DW_TAG_subroutine_type) ++ <716> DW_AT_type : <0x242> ++ <1><71a>: Abbrev Number: 31 (DW_TAG_variable) ++ <71b> DW_AT_name : pfn ++ <71f> DW_AT_decl_file : 2 ++ <720> DW_AT_decl_line : 109 ++ <721> DW_AT_type : <0x728> ++ <725> DW_AT_external : 1 ++ <725> DW_AT_location : 2 byte block: fb 1f (DW_OP_GNU_addr_index <0x1f>) ++ <1><728>: Abbrev Number: 8 (DW_TAG_pointer_type) ++ <729> DW_AT_byte_size : 8 ++ <72a> DW_AT_type : <0x715> ++ <1><72e>: Abbrev Number: 0 ++ Compilation Unit @ offset 0x72f: ++ Length: 0xcb (32-bit) ++ Version: 4 ++ Abbrev Offset: 0x0 ++ Pointer Size: 8 ++ Section contributions: ++ .debug_abbrev.dwo: 0x371 0xbd ++ .debug_line.dwo: 0x7d 0x3e ++ .debug_loc.dwo: 0x0 0x0 ++ .debug_str_offsets.dwo: 0x0 0x0 ++ <0><73a>: Abbrev Number: 10 (DW_TAG_compile_unit) ++ <73b> DW_AT_producer : GNU C++ 4.7.x-google 20120720 (prerelease) ++ <766> DW_AT_language : 4 (C++) ++ <767> DW_AT_name : dwp_test_1b.cc ++ <776> DW_AT_comp_dir : /home/ccoutant/opensource/binutils-git/binutils/gold/testsuite ++ <7b5> DW_AT_GNU_dwo_id : 0xbd6ec13ea247eff6 ++ <1><7bd>: Abbrev Number: 7 (DW_TAG_base_type) ++ <7be> DW_AT_byte_size : 4 ++ <7bf> DW_AT_encoding : 5 (signed) ++ <7c0> DW_AT_name : int ++ <1><7c4>: Abbrev Number: 7 (DW_TAG_base_type) ++ <7c5> DW_AT_byte_size : 1 ++ <7c6> DW_AT_encoding : 2 (boolean) ++ <7c7> DW_AT_name : bool ++ <1><7cc>: Abbrev Number: 11 (DW_TAG_subprogram) ++ <7cd> DW_AT_external : 1 ++ <7cd> DW_AT_name : t16a ++ <7d2> DW_AT_decl_file : 1 ++ <7d3> DW_AT_decl_line : 32 ++ <7d4> DW_AT_linkage_name: _Z4t16av ++ <7dd> DW_AT_type : <0x7c4> ++ <7e1> DW_AT_low_pc : (addr_index: 0x0): ++ <7e2> DW_AT_high_pc : 0x13 ++ <7ea> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <7ec> DW_AT_GNU_all_tail_call_sites: 1 ++ <1><7ec>: Abbrev Number: 12 (DW_TAG_variable) ++ <7ed> DW_AT_name : c3 ++ <7f0> DW_AT_decl_file : 1 ++ <7f1> DW_AT_decl_line : 29 ++ <7f2> DW_AT_type : signature: 0xb534bdc1f01629bb ++ <7fa> DW_AT_external : 1 ++ <7fa> DW_AT_location : 2 byte block: fb 1 (DW_OP_GNU_addr_index <0x1>) ++ <1><7fd>: Abbrev Number: 0 ++ Compilation Unit @ offset 0x7fe: ++ Length: 0x329 (32-bit) ++ Version: 4 ++ Abbrev Offset: 0x0 ++ Pointer Size: 8 ++ Section contributions: ++ .debug_abbrev.dwo: 0x42e 0x1f2 ++ .debug_line.dwo: 0xbb 0x3d ++ .debug_loc.dwo: 0x0 0x0 ++ .debug_str_offsets.dwo: 0x58 0x18 ++ <0><809>: Abbrev Number: 12 (DW_TAG_compile_unit) ++ <80a> DW_AT_producer : GNU C++ 4.7.x-google 20120720 (prerelease) ++ <835> DW_AT_language : 4 (C++) ++ <836> DW_AT_name : dwp_test_2.cc ++ <844> DW_AT_comp_dir : /home/ccoutant/opensource/binutils-git/binutils/gold/testsuite ++ <883> DW_AT_GNU_dwo_id : 0xcf0cab718ce0f8b9 ++ <1><88b>: Abbrev Number: 13 (DW_TAG_class_type) ++ <88c> DW_AT_name : C1 ++ <88f> DW_AT_signature : signature: 0xb5faa2a4b7a919c4 ++ <897> DW_AT_declaration : 1 ++ <897> DW_AT_sibling : <0x8b7> ++ <2><89b>: Abbrev Number: 14 (DW_TAG_subprogram) ++ <89c> DW_AT_external : 1 ++ <89c> DW_AT_name : t1a ++ <8a0> DW_AT_decl_file : 1 ++ <8a1> DW_AT_decl_line : 29 ++ <8a2> DW_AT_linkage_name: (indexed string: 0x4): _ZN2C13t1aEv ++ <8a3> DW_AT_type : <0x8be> ++ <8a7> DW_AT_accessibility: 1 (public) ++ <8a8> DW_AT_declaration : 1 ++ <2><8a8>: Abbrev Number: 14 (DW_TAG_subprogram) ++ <8a9> DW_AT_external : 1 ++ <8a9> DW_AT_name : t1_2 ++ <8ae> DW_AT_decl_file : 1 ++ <8af> DW_AT_decl_line : 30 ++ <8b0> DW_AT_linkage_name: (indexed string: 0x5): _ZN2C14t1_2Ev ++ <8b1> DW_AT_type : <0x8b7> ++ <8b5> DW_AT_accessibility: 1 (public) ++ <8b6> DW_AT_declaration : 1 ++ <2><8b6>: Abbrev Number: 0 ++ <1><8b7>: Abbrev Number: 7 (DW_TAG_base_type) ++ <8b8> DW_AT_byte_size : 4 ++ <8b9> DW_AT_encoding : 5 (signed) ++ <8ba> DW_AT_name : int ++ <1><8be>: Abbrev Number: 7 (DW_TAG_base_type) ++ <8bf> DW_AT_byte_size : 1 ++ <8c0> DW_AT_encoding : 2 (boolean) ++ <8c1> DW_AT_name : bool ++ <1><8c6>: Abbrev Number: 15 (DW_TAG_pointer_type) ++ <8c7> DW_AT_byte_size : 8 ++ <8c8> DW_AT_type : signature: 0xb5faa2a4b7a919c4 ++ <1><8d0>: Abbrev Number: 13 (DW_TAG_class_type) ++ <8d1> DW_AT_name : C3 ++ <8d4> DW_AT_signature : signature: 0xb534bdc1f01629bb ++ <8dc> DW_AT_declaration : 1 ++ <8dc> DW_AT_sibling : <0x8ed> ++ <2><8e0>: Abbrev Number: 14 (DW_TAG_subprogram) ++ <8e1> DW_AT_external : 1 ++ <8e1> DW_AT_name : f4 ++ <8e4> DW_AT_decl_file : 1 ++ <8e5> DW_AT_decl_line : 53 ++ <8e6> DW_AT_linkage_name: (indexed string: 0x3): _ZN2C32f4Ev ++ <8e7> DW_AT_type : <0x8fc> ++ <8eb> DW_AT_accessibility: 1 (public) ++ <8ec> DW_AT_declaration : 1 ++ <2><8ec>: Abbrev Number: 0 ++ <1><8ed>: Abbrev Number: 15 (DW_TAG_pointer_type) ++ <8ee> DW_AT_byte_size : 8 ++ <8ef> DW_AT_type : signature: 0xb534bdc1f01629bb ++ <1><8f7>: Abbrev Number: 9 (DW_TAG_subroutine_type) ++ <8f8> DW_AT_type : <0x8be> ++ <1><8fc>: Abbrev Number: 8 (DW_TAG_pointer_type) ++ <8fd> DW_AT_byte_size : 8 ++ <8fe> DW_AT_type : <0x8f7> ++ <1><902>: Abbrev Number: 16 (DW_TAG_subprogram) ++ <903> DW_AT_external : 1 ++ <903> DW_AT_name : f13i ++ <908> DW_AT_decl_file : 1 ++ <909> DW_AT_decl_line : 70 ++ <90a> DW_AT_linkage_name: _Z4f13iv ++ <913> DW_AT_low_pc : (addr_index: 0x0): ++ <914> DW_AT_high_pc : 0x6 ++ <91c> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <91e> DW_AT_GNU_all_call_sites: 1 ++ <1><91e>: Abbrev Number: 17 (DW_TAG_subprogram) ++ <91f> DW_AT_specification: <0x8a8> ++ <923> DW_AT_decl_file : 2 ++ <924> DW_AT_low_pc : (addr_index: 0x1): ++ <925> DW_AT_high_pc : 0xf ++ <92d> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <92f> DW_AT_object_pointer: <0x937> ++ <933> DW_AT_GNU_all_call_sites: 1 ++ <933> DW_AT_sibling : <0x945> ++ <2><937>: Abbrev Number: 18 (DW_TAG_formal_parameter) ++ <938> DW_AT_name : this ++ <93d> DW_AT_type : <0x945> ++ <941> DW_AT_artificial : 1 ++ <941> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <2><944>: Abbrev Number: 0 ++ <1><945>: Abbrev Number: 19 (DW_TAG_const_type) ++ <946> DW_AT_type : <0x8c6> ++ <1><94a>: Abbrev Number: 20 (DW_TAG_subprogram) ++ <94b> DW_AT_specification: <0x89b> ++ <94f> DW_AT_decl_file : 2 ++ <950> DW_AT_decl_line : 36 ++ <951> DW_AT_low_pc : (addr_index: 0x2): ++ <952> DW_AT_high_pc : 0x20 ++ <95a> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <95c> DW_AT_object_pointer: <0x964> ++ <960> DW_AT_GNU_all_tail_call_sites: 1 ++ <960> DW_AT_sibling : <0x972> ++ <2><964>: Abbrev Number: 18 (DW_TAG_formal_parameter) ++ <965> DW_AT_name : this ++ <96a> DW_AT_type : <0x945> ++ <96e> DW_AT_artificial : 1 ++ <96e> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <2><971>: Abbrev Number: 0 ++ <1><972>: Abbrev Number: 21 (DW_TAG_subprogram) ++ <973> DW_AT_external : 1 ++ <973> DW_AT_name : f10 ++ <977> DW_AT_decl_file : 2 ++ <978> DW_AT_decl_line : 72 ++ <979> DW_AT_linkage_name: _Z3f10v ++ <981> DW_AT_type : <0x8b7> ++ <985> DW_AT_low_pc : (addr_index: 0x3): ++ <986> DW_AT_high_pc : 0xb ++ <98e> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <990> DW_AT_GNU_all_call_sites: 1 ++ <1><990>: Abbrev Number: 22 (DW_TAG_subprogram) ++ <991> DW_AT_external : 1 ++ <991> DW_AT_name : f11b ++ <996> DW_AT_decl_file : 2 ++ <997> DW_AT_decl_line : 80 ++ <998> DW_AT_linkage_name: _Z4f11bPFivE ++ <9a5> DW_AT_type : <0x8b7> ++ <9a9> DW_AT_low_pc : (addr_index: 0x4): ++ <9aa> DW_AT_high_pc : 0x14 ++ <9b2> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <9b4> DW_AT_GNU_all_tail_call_sites: 1 ++ <9b4> DW_AT_sibling : <0x9c7> ++ <2><9b8>: Abbrev Number: 23 (DW_TAG_formal_parameter) ++ <9b9> DW_AT_name : pfn ++ <9bd> DW_AT_decl_file : 2 ++ <9be> DW_AT_decl_line : 80 ++ <9bf> DW_AT_type : <0x9cc> ++ <9c3> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <2><9c6>: Abbrev Number: 0 ++ <1><9c7>: Abbrev Number: 9 (DW_TAG_subroutine_type) ++ <9c8> DW_AT_type : <0x8b7> ++ <1><9cc>: Abbrev Number: 8 (DW_TAG_pointer_type) ++ <9cd> DW_AT_byte_size : 8 ++ <9ce> DW_AT_type : <0x9c7> ++ <1><9d2>: Abbrev Number: 24 (DW_TAG_subprogram) ++ <9d3> DW_AT_specification: <0x8e0> ++ <9d7> DW_AT_decl_file : 2 ++ <9d8> DW_AT_decl_line : 88 ++ <9d9> DW_AT_low_pc : (addr_index: 0x5): ++ <9da> DW_AT_high_pc : 0xf ++ <9e2> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ <9e4> DW_AT_object_pointer: <0x9ec> ++ <9e8> DW_AT_GNU_all_call_sites: 1 ++ <9e8> DW_AT_sibling : <0x9fa> ++ <2><9ec>: Abbrev Number: 18 (DW_TAG_formal_parameter) ++ <9ed> DW_AT_name : this ++ <9f2> DW_AT_type : <0x9fa> ++ <9f6> DW_AT_artificial : 1 ++ <9f6> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24) ++ <2><9f9>: Abbrev Number: 0 ++ <1><9fa>: Abbrev Number: 19 (DW_TAG_const_type) ++ <9fb> DW_AT_type : <0x8ed> ++ <1><9ff>: Abbrev Number: 25 (DW_TAG_subroutine_type) ++ <1>: Abbrev Number: 21 (DW_TAG_subprogram) ++ DW_AT_external : 1 ++ DW_AT_name : f13 ++ DW_AT_decl_file : 2 ++ DW_AT_decl_line : 96 ++ DW_AT_linkage_name: _Z3f13v ++ DW_AT_type : <0xa1e> ++ DW_AT_low_pc : (addr_index: 0x6): ++ DW_AT_high_pc : 0xb ++ DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ DW_AT_GNU_all_call_sites: 1 ++ <1>: Abbrev Number: 8 (DW_TAG_pointer_type) ++ DW_AT_byte_size : 8 ++ DW_AT_type : <0x9ff> ++ <1>: Abbrev Number: 21 (DW_TAG_subprogram) ++ DW_AT_external : 1 ++ DW_AT_name : f14 ++ DW_AT_decl_file : 2 ++ DW_AT_decl_line : 104 ++ DW_AT_linkage_name: _Z3f14v ++ DW_AT_type : <0xa42> ++ DW_AT_low_pc : (addr_index: 0x7): ++ DW_AT_high_pc : 0xb ++ DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ DW_AT_GNU_all_call_sites: 1 ++ <1>: Abbrev Number: 8 (DW_TAG_pointer_type) ++ DW_AT_byte_size : 8 ++ DW_AT_type : <0xa48> ++ <1>: Abbrev Number: 19 (DW_TAG_const_type) ++ DW_AT_type : <0xa4d> ++ <1>: Abbrev Number: 7 (DW_TAG_base_type) ++ DW_AT_byte_size : 1 ++ DW_AT_encoding : 6 (signed char) ++ DW_AT_name : char ++ <1>: Abbrev Number: 21 (DW_TAG_subprogram) ++ DW_AT_external : 1 ++ DW_AT_name : f15 ++ DW_AT_decl_file : 2 ++ DW_AT_decl_line : 112 ++ DW_AT_linkage_name: _Z3f15v ++ DW_AT_type : <0xa73> ++ DW_AT_low_pc : (addr_index: 0x8): ++ DW_AT_high_pc : 0xb ++ DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ DW_AT_GNU_all_call_sites: 1 ++ <1>: Abbrev Number: 8 (DW_TAG_pointer_type) ++ DW_AT_byte_size : 8 ++ DW_AT_type : <0xa79> ++ <1>: Abbrev Number: 19 (DW_TAG_const_type) ++ DW_AT_type : <0xa7e> ++ <1>: Abbrev Number: 7 (DW_TAG_base_type) ++ DW_AT_byte_size : 4 ++ DW_AT_encoding : 5 (signed) ++ DW_AT_name : wchar_t ++ <1>: Abbrev Number: 26 (DW_TAG_subprogram) ++ DW_AT_external : 1 ++ DW_AT_name : f18 ++ DW_AT_decl_file : 2 ++ DW_AT_decl_line : 127 ++ DW_AT_linkage_name: _Z3f18i ++ DW_AT_type : <0xa42> ++ DW_AT_low_pc : (addr_index: 0x9): ++ DW_AT_high_pc : 0x44 ++ DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) ++ DW_AT_GNU_all_call_sites: 1 ++ DW_AT_sibling : <0xab8> ++ <2>: Abbrev Number: 23 (DW_TAG_formal_parameter) ++ DW_AT_name : i ++ DW_AT_decl_file : 2 ++ DW_AT_decl_line : 127 ++ DW_AT_type : <0x8b7> ++ DW_AT_location : 2 byte block: 91 6c (DW_OP_fbreg: -20) ++ <2>: Abbrev Number: 0 ++ <1>: Abbrev Number: 27 (DW_TAG_variable) ++ DW_AT_name : v2 ++ DW_AT_decl_file : 2 ++ DW_AT_decl_line : 43 ++ DW_AT_type : <0x8b7> ++ DW_AT_external : 1 ++ DW_AT_location : 2 byte block: fb a (DW_OP_GNU_addr_index <0xa>) ++ <1>: Abbrev Number: 27 (DW_TAG_variable) ++ DW_AT_name : v3 ++ DW_AT_decl_file : 2 ++ DW_AT_decl_line : 48 ++ DW_AT_type : <0x8b7> ++ DW_AT_external : 1 ++ DW_AT_location : 2 byte block: fb b (DW_OP_GNU_addr_index <0xb>) ++ <1>: Abbrev Number: 28 (DW_TAG_array_type) ++ DW_AT_type : <0xa4d> ++ DW_AT_sibling : <0xae2> ++ <2>: Abbrev Number: 29 (DW_TAG_subrange_type) ++ DW_AT_type : <0xae2> ++ DW_AT_upper_bound : 12 ++ <2>: Abbrev Number: 0 ++ <1>: Abbrev Number: 7 (DW_TAG_base_type) ++ DW_AT_byte_size : 8 ++ DW_AT_encoding : 7 (unsigned) ++ DW_AT_name : sizetype ++ <1>: Abbrev Number: 27 (DW_TAG_variable) ++ DW_AT_name : v4 ++ DW_AT_decl_file : 2 ++ DW_AT_decl_line : 52 ++ DW_AT_type : <0xad2> ++ DW_AT_external : 1 ++ DW_AT_location : 2 byte block: fb c (DW_OP_GNU_addr_index <0xc>) ++ <1>: Abbrev Number: 27 (DW_TAG_variable) ++ DW_AT_name : v5 ++ DW_AT_decl_file : 2 ++ DW_AT_decl_line : 57 ++ DW_AT_type : <0xad2> ++ DW_AT_external : 1 ++ DW_AT_location : 2 byte block: fb d (DW_OP_GNU_addr_index <0xd>) ++ <1>: Abbrev Number: 28 (DW_TAG_array_type) ++ DW_AT_type : <0xa42> ++ DW_AT_sibling : <0xb18> ++ <2>: Abbrev Number: 29 (DW_TAG_subrange_type) ++ DW_AT_type : <0xae2> ++ DW_AT_upper_bound : 4 ++ <2>: Abbrev Number: 0 ++ <1>: Abbrev Number: 27 (DW_TAG_variable) ++ DW_AT_name : t17data ++ DW_AT_decl_file : 2 ++ DW_AT_decl_line : 119 ++ DW_AT_type : <0xb08> ++ DW_AT_external : 1 ++ DW_AT_location : 2 byte block: fb e (DW_OP_GNU_addr_index <0xe>) ++ <1>: Abbrev Number: 0 ++ ++Contents of the .debug_types.dwo section: ++ ++ Compilation Unit @ offset 0x0: ++ Length: 0xf7 (32-bit) ++ Version: 4 ++ Abbrev Offset: 0x0 ++ Pointer Size: 8 ++ Signature: 0xb534bdc1f01629bb ++ Type Offset: 0x25 ++ Section contributions: ++ .debug_abbrev.dwo: 0x0 0x154 ++ .debug_line.dwo: 0x0 0x40 ++ .debug_loc.dwo: 0x0 0x0 ++ .debug_str_offsets.dwo: 0x0 0x14 ++ <0><17>: Abbrev Number: 1 (DW_TAG_type_unit) ++ <18> DW_AT_language : 4 (C++) ++ <19> DW_AT_GNU_odr_signature: 0x880a5c4d6e59da8a ++ <21> DW_AT_stmt_list : 0x0 ++ <1><25>: Abbrev Number: 2 (DW_TAG_class_type) ++ <26> DW_AT_name : C3 ++ <29> DW_AT_byte_size : 4 ++ <2a> DW_AT_decl_file : 2 ++ <2b> DW_AT_decl_line : 47 ++ <2c> DW_AT_sibling : <0xda> ++ <2><30>: Abbrev Number: 3 (DW_TAG_member) ++ <31> DW_AT_name : (indexed string: 0x3): member1 ++ <32> DW_AT_decl_file : 2 ++ <33> DW_AT_decl_line : 54 ++ <34> DW_AT_type : <0xda> ++ <38> DW_AT_data_member_location: 0 ++ <39> DW_AT_accessibility: 1 (public) ++ <2><3a>: Abbrev Number: 4 (DW_TAG_subprogram) ++ <3b> DW_AT_external : 1 ++ <3b> DW_AT_name : (indexed string: 0x0): testcase1 ++ <3c> DW_AT_decl_file : 2 ++ <3d> DW_AT_decl_line : 50 ++ <3e> DW_AT_linkage_name: _ZN2C39testcase1Ev ++ <51> DW_AT_type : <0xe1> ++ <55> DW_AT_accessibility: 1 (public) ++ <56> DW_AT_declaration : 1 ++ <56> DW_AT_object_pointer: <0x5e> ++ <5a> DW_AT_sibling : <0x64> ++ <3><5e>: Abbrev Number: 5 (DW_TAG_formal_parameter) ++ <5f> DW_AT_type : <0xe9> ++ <63> DW_AT_artificial : 1 ++ <3><63>: Abbrev Number: 0 ++ <2><64>: Abbrev Number: 4 (DW_TAG_subprogram) ++ <65> DW_AT_external : 1 ++ <65> DW_AT_name : (indexed string: 0x1): testcase2 ++ <66> DW_AT_decl_file : 2 ++ <67> DW_AT_decl_line : 51 ++ <68> DW_AT_linkage_name: _ZN2C39testcase2Ev ++ <7b> DW_AT_type : <0xe1> ++ <7f> DW_AT_accessibility: 1 (public) ++ <80> DW_AT_declaration : 1 ++ <80> DW_AT_object_pointer: <0x88> ++ <84> DW_AT_sibling : <0x8e> ++ <3><88>: Abbrev Number: 5 (DW_TAG_formal_parameter) ++ <89> DW_AT_type : <0xe9> ++ <8d> DW_AT_artificial : 1 ++ <3><8d>: Abbrev Number: 0 ++ <2><8e>: Abbrev Number: 4 (DW_TAG_subprogram) ++ <8f> DW_AT_external : 1 ++ <8f> DW_AT_name : (indexed string: 0x2): testcase3 ++ <90> DW_AT_decl_file : 2 ++ <91> DW_AT_decl_line : 52 ++ <92> DW_AT_linkage_name: _ZN2C39testcase3Ev ++ DW_AT_type : <0xe1> ++ DW_AT_accessibility: 1 (public) ++ DW_AT_declaration : 1 ++ DW_AT_object_pointer: <0xb2> ++ DW_AT_sibling : <0xb8> ++ <3>: Abbrev Number: 5 (DW_TAG_formal_parameter) ++ DW_AT_type : <0xe9> ++ DW_AT_artificial : 1 ++ <3>: Abbrev Number: 0 ++ <2>: Abbrev Number: 6 (DW_TAG_subprogram) ++ DW_AT_external : 1 ++ DW_AT_name : f4 ++ DW_AT_decl_file : 2 ++ DW_AT_decl_line : 53 ++ DW_AT_linkage_name: _ZN2C32f4Ev ++ DW_AT_type : <0xef> ++ DW_AT_accessibility: 1 (public) ++ DW_AT_declaration : 1 ++ DW_AT_object_pointer: <0xd3> ++ <3>: Abbrev Number: 5 (DW_TAG_formal_parameter) ++ DW_AT_type : <0xe9> ++ DW_AT_artificial : 1 ++ <3>: Abbrev Number: 0 ++ <2>: Abbrev Number: 0 ++ <1>: Abbrev Number: 7 (DW_TAG_base_type) ++ DW_AT_byte_size : 4 ++ DW_AT_encoding : 5 (signed) ++
DW_AT_name : int ++ <1>: Abbrev Number: 7 (DW_TAG_base_type) ++ DW_AT_byte_size : 1 ++ DW_AT_encoding : 2 (boolean) ++ DW_AT_name : bool ++ <1>: Abbrev Number: 8 (DW_TAG_pointer_type) ++ DW_AT_byte_size : 8 ++ DW_AT_type : <0x25> ++ <1>: Abbrev Number: 8 (DW_TAG_pointer_type) ++ DW_AT_byte_size : 8 ++ DW_AT_type : <0xf5> ++ <1>: Abbrev Number: 9 (DW_TAG_subroutine_type) ++ DW_AT_type : <0xe1> ++ <1>: Abbrev Number: 0 ++ Compilation Unit @ offset 0xfb: ++ Length: 0xf1 (32-bit) ++ Version: 4 ++ Abbrev Offset: 0x0 ++ Pointer Size: 8 ++ Signature: 0xab98c7bc886f5266 ++ Type Offset: 0x25 ++ Section contributions: ++ .debug_abbrev.dwo: 0x0 0x154 ++ .debug_line.dwo: 0x0 0x40 ++ .debug_loc.dwo: 0x0 0x0 ++ .debug_str_offsets.dwo: 0x0 0x14 ++ <0><112>: Abbrev Number: 1 (DW_TAG_type_unit) ++ <113> DW_AT_language : 4 (C++) ++ <114> DW_AT_GNU_odr_signature: 0xae4af0d8bfcef94b ++ <11c> DW_AT_stmt_list : 0x0 ++ <1><120>: Abbrev Number: 2 (DW_TAG_class_type) ++ <121> DW_AT_name : C2 ++ <124> DW_AT_byte_size : 4 ++ <125> DW_AT_decl_file : 2 ++ <126> DW_AT_decl_line : 37 ++ <127> DW_AT_sibling : <0x1da> ++ <2><12b>: Abbrev Number: 3 (DW_TAG_member) ++ <12c> DW_AT_name : (indexed string: 0x3): member1 ++ <12d> DW_AT_decl_file : 2 ++ <12e> DW_AT_decl_line : 44 ++ <12f> DW_AT_type : <0x1da> ++ <133> DW_AT_data_member_location: 0 ++ <134> DW_AT_accessibility: 1 (public) ++ <2><135>: Abbrev Number: 4 (DW_TAG_subprogram) ++ <136> DW_AT_external : 1 ++ <136> DW_AT_name : (indexed string: 0x0): testcase1 ++ <137> DW_AT_decl_file : 2 ++ <138> DW_AT_decl_line : 40 ++ <139> DW_AT_linkage_name: _ZN2C29testcase1Ev ++ <14c> DW_AT_type : <0x1e1> ++ <150> DW_AT_accessibility: 1 (public) ++ <151> DW_AT_declaration : 1 ++ <151> DW_AT_object_pointer: <0x159> ++ <155> DW_AT_sibling : <0x15f> ++ <3><159>: Abbrev Number: 5 (DW_TAG_formal_parameter) ++ <15a> DW_AT_type : <0x1e9> ++ <15e> DW_AT_artificial : 1 ++ <3><15e>: Abbrev Number: 0 ++ <2><15f>: Abbrev Number: 4 (DW_TAG_subprogram) ++ <160> DW_AT_external : 1 ++ <160> DW_AT_name : (indexed string: 0x1): testcase2 ++ <161> DW_AT_decl_file : 2 ++ <162> DW_AT_decl_line : 41 ++ <163> DW_AT_linkage_name: _ZN2C29testcase2Ev ++ <176> DW_AT_type : <0x1e1> ++ <17a> DW_AT_accessibility: 1 (public) ++ <17b> DW_AT_declaration : 1 ++ <17b> DW_AT_object_pointer: <0x183> ++ <17f> DW_AT_sibling : <0x189> ++ <3><183>: Abbrev Number: 5 (DW_TAG_formal_parameter) ++ <184> DW_AT_type : <0x1e9> ++ <188> DW_AT_artificial : 1 ++ <3><188>: Abbrev Number: 0 ++ <2><189>: Abbrev Number: 4 (DW_TAG_subprogram) ++ <18a> DW_AT_external : 1 ++ <18a> DW_AT_name : (indexed string: 0x2): testcase3 ++ <18b> DW_AT_decl_file : 2 ++ <18c> DW_AT_decl_line : 42 ++ <18d> DW_AT_linkage_name: _ZN2C29testcase3Ev ++ <1a0> DW_AT_type : <0x1e1> ++ <1a4> DW_AT_accessibility: 1 (public) ++ <1a5> DW_AT_declaration : 1 ++ <1a5> DW_AT_object_pointer: <0x1ad> ++ <1a9> DW_AT_sibling : <0x1b3> ++ <3><1ad>: Abbrev Number: 5 (DW_TAG_formal_parameter) ++ <1ae> DW_AT_type : <0x1e9> ++ <1b2> DW_AT_artificial : 1 ++ <3><1b2>: Abbrev Number: 0 ++ <2><1b3>: Abbrev Number: 10 (DW_TAG_subprogram) ++ <1b4> DW_AT_external : 1 ++ <1b4> DW_AT_name : (indexed string: 0x4): testcase4 ++ <1b5> DW_AT_decl_file : 2 ++ <1b6> DW_AT_decl_line : 43 ++ <1b7> DW_AT_linkage_name: _ZN2C29testcase4Ev ++ <1ca> DW_AT_type : <0x1e1> ++ <1ce> DW_AT_accessibility: 1 (public) ++ <1cf> DW_AT_declaration : 1 ++ <1cf> DW_AT_object_pointer: <0x1d3> ++ <3><1d3>: Abbrev Number: 5 (DW_TAG_formal_parameter) ++ <1d4> DW_AT_type : <0x1e9> ++ <1d8> DW_AT_artificial : 1 ++ <3><1d8>: Abbrev Number: 0 ++ <2><1d9>: Abbrev Number: 0 ++ <1><1da>: Abbrev Number: 7 (DW_TAG_base_type) ++ <1db> DW_AT_byte_size : 4 ++ <1dc> DW_AT_encoding : 5 (signed) ++ <1dd> DW_AT_name : int ++ <1><1e1>: Abbrev Number: 7 (DW_TAG_base_type) ++ <1e2> DW_AT_byte_size : 1 ++ <1e3> DW_AT_encoding : 2 (boolean) ++ <1e4> DW_AT_name : bool ++ <1><1e9>: Abbrev Number: 8 (DW_TAG_pointer_type) ++ <1ea> DW_AT_byte_size : 8 ++ <1eb> DW_AT_type : <0x120> ++ <1><1ef>: Abbrev Number: 0 ++ Compilation Unit @ offset 0x1f0: ++ Length: 0x141 (32-bit) ++ Version: 4 ++ Abbrev Offset: 0x0 ++ Pointer Size: 8 ++ Signature: 0xb5faa2a4b7a919c4 ++ Type Offset: 0x25 ++ Section contributions: ++ .debug_abbrev.dwo: 0x0 0x154 ++ .debug_line.dwo: 0x0 0x40 ++ .debug_loc.dwo: 0x0 0x0 ++ .debug_str_offsets.dwo: 0x0 0x14 ++ <0><207>: Abbrev Number: 1 (DW_TAG_type_unit) ++ <208> DW_AT_language : 4 (C++) ++ <209> DW_AT_GNU_odr_signature: 0xc7fbeb753b05ade3 ++ <211> DW_AT_stmt_list : 0x0 ++ <1><215>: Abbrev Number: 2 (DW_TAG_class_type) ++ <216> DW_AT_name : C1 ++ <219> DW_AT_byte_size : 4 ++ <21a> DW_AT_decl_file : 2 ++ <21b> DW_AT_decl_line : 25 ++ <21c> DW_AT_sibling : <0x31f> ++ <2><220>: Abbrev Number: 3 (DW_TAG_member) ++ <221> DW_AT_name : (indexed string: 0x3): member1 ++ <222> DW_AT_decl_file : 2 ++ <223> DW_AT_decl_line : 34 ++ <224> DW_AT_type : <0x31f> ++ <228> DW_AT_data_member_location: 0 ++ <229> DW_AT_accessibility: 1 (public) ++ <2><22a>: Abbrev Number: 4 (DW_TAG_subprogram) ++ <22b> DW_AT_external : 1 ++ <22b> DW_AT_name : (indexed string: 0x0): testcase1 ++ <22c> DW_AT_decl_file : 2 ++ <22d> DW_AT_decl_line : 28 ++ <22e> DW_AT_linkage_name: _ZN2C19testcase1Ev ++ <241> DW_AT_type : <0x326> ++ <245> DW_AT_accessibility: 1 (public) ++ <246> DW_AT_declaration : 1 ++ <246> DW_AT_object_pointer: <0x24e> ++ <24a> DW_AT_sibling : <0x254> ++ <3><24e>: Abbrev Number: 5 (DW_TAG_formal_parameter) ++ <24f> DW_AT_type : <0x32e> ++ <253> DW_AT_artificial : 1 ++ <3><253>: Abbrev Number: 0 ++ <2><254>: Abbrev Number: 11 (DW_TAG_subprogram) ++ <255> DW_AT_external : 1 ++ <255> DW_AT_name : t1a ++ <259> DW_AT_decl_file : 2 ++ <25a> DW_AT_decl_line : 29 ++ <25b> DW_AT_linkage_name: _ZN2C13t1aEv ++ <268> DW_AT_type : <0x326> ++ <26c> DW_AT_accessibility: 1 (public) ++ <26d> DW_AT_declaration : 1 ++ <26d> DW_AT_object_pointer: <0x275> ++ <271> DW_AT_sibling : <0x27b> ++ <3><275>: Abbrev Number: 5 (DW_TAG_formal_parameter) ++ <276> DW_AT_type : <0x32e> ++ <27a> DW_AT_artificial : 1 ++ <3><27a>: Abbrev Number: 0 ++ <2><27b>: Abbrev Number: 11 (DW_TAG_subprogram) ++ <27c> DW_AT_external : 1 ++ <27c> DW_AT_name : t1_2 ++ <281> DW_AT_decl_file : 2 ++ <282> DW_AT_decl_line : 30 ++ <283> DW_AT_linkage_name: _ZN2C14t1_2Ev ++ <291> DW_AT_type : <0x31f> ++ <295> DW_AT_accessibility: 1 (public) ++ <296> DW_AT_declaration : 1 ++ <296> DW_AT_object_pointer: <0x29e> ++ <29a> DW_AT_sibling : <0x2a4> ++ <3><29e>: Abbrev Number: 5 (DW_TAG_formal_parameter) ++ <29f> DW_AT_type : <0x32e> ++ <2a3> DW_AT_artificial : 1 ++ <3><2a3>: Abbrev Number: 0 ++ <2><2a4>: Abbrev Number: 4 (DW_TAG_subprogram) ++ <2a5> DW_AT_external : 1 ++ <2a5> DW_AT_name : (indexed string: 0x1): testcase2 ++ <2a6> DW_AT_decl_file : 2 ++ <2a7> DW_AT_decl_line : 31 ++ <2a8> DW_AT_linkage_name: _ZN2C19testcase2Ev ++ <2bb> DW_AT_type : <0x326> ++ <2bf> DW_AT_accessibility: 1 (public) ++ <2c0> DW_AT_declaration : 1 ++ <2c0> DW_AT_object_pointer: <0x2c8> ++ <2c4> DW_AT_sibling : <0x2ce> ++ <3><2c8>: Abbrev Number: 5 (DW_TAG_formal_parameter) ++ <2c9> DW_AT_type : <0x32e> ++ <2cd> DW_AT_artificial : 1 ++ <3><2cd>: Abbrev Number: 0 ++ <2><2ce>: Abbrev Number: 4 (DW_TAG_subprogram) ++ <2cf> DW_AT_external : 1 ++ <2cf> DW_AT_name : (indexed string: 0x2): testcase3 ++ <2d0> DW_AT_decl_file : 2 ++ <2d1> DW_AT_decl_line : 32 ++ <2d2> DW_AT_linkage_name: _ZN2C19testcase3Ev ++ <2e5> DW_AT_type : <0x326> ++ <2e9> DW_AT_accessibility: 1 (public) ++ <2ea> DW_AT_declaration : 1 ++ <2ea> DW_AT_object_pointer: <0x2f2> ++ <2ee> DW_AT_sibling : <0x2f8> ++ <3><2f2>: Abbrev Number: 5 (DW_TAG_formal_parameter) ++ <2f3> DW_AT_type : <0x32e> ++ <2f7> DW_AT_artificial : 1 ++ <3><2f7>: Abbrev Number: 0 ++ <2><2f8>: Abbrev Number: 10 (DW_TAG_subprogram) ++ <2f9> DW_AT_external : 1 ++ <2f9> DW_AT_name : (indexed string: 0x4): testcase4 ++ <2fa> DW_AT_decl_file : 2 ++ <2fb> DW_AT_decl_line : 33 ++ <2fc> DW_AT_linkage_name: _ZN2C19testcase4Ev ++ <30f> DW_AT_type : <0x326> ++ <313> DW_AT_accessibility: 1 (public) ++ <314> DW_AT_declaration : 1 ++ <314> DW_AT_object_pointer: <0x318> ++ <3><318>: Abbrev Number: 5 (DW_TAG_formal_parameter) ++ <319> DW_AT_type : <0x32e> ++ <31d> DW_AT_artificial : 1 ++ <3><31d>: Abbrev Number: 0 ++ <2><31e>: Abbrev Number: 0 ++ <1><31f>: Abbrev Number: 7 (DW_TAG_base_type) ++ <320> DW_AT_byte_size : 4 ++ <321> DW_AT_encoding : 5 (signed) ++ <322> DW_AT_name : int ++ <1><326>: Abbrev Number: 7 (DW_TAG_base_type) ++ <327> DW_AT_byte_size : 1 ++ <328> DW_AT_encoding : 2 (boolean) ++ <329> DW_AT_name : bool ++ <1><32e>: Abbrev Number: 8 (DW_TAG_pointer_type) ++ <32f> DW_AT_byte_size : 8 ++ <330> DW_AT_type : <0x215> ++ <1><334>: Abbrev Number: 0 ++ +Binary files /dev/null and binutils-2.35.1/binutils/testsuite/binutils-all/x86-64/pr26808.dwp.bz2 differ +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/arm/mve-vldr-vstr-bad.d 2020-11-25 14:37:41.000000000 +0000 +@@ -0,0 +1,5 @@ ++#name: bad MVE VLDR VSTR wrong error message for addressing mode without []. ++#as: -march=armv8.1-m.main+mve.fp -mthumb -mfloat-abi=hard ++#error_output: mve-vldr-vstr-bad.l ++ ++.*: +file format .*arm.* +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/arm/mve-vldr-vstr-bad.l 2020-11-25 14:37:41.000000000 +0000 +@@ -0,0 +1,811 @@ ++[^:]*: Assembler messages: ++[^:]*:12: Error: syntax error -- `vldrb.s8 q0,r0' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q0,r0' ++[^:]*:12: Error: syntax error -- `vstrb.8 q0,r0' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q0,r1' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q0,r1' ++[^:]*:12: Error: syntax error -- `vstrb.8 q0,r1' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q0,r2' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q0,r2' ++[^:]*:12: Error: syntax error -- `vstrb.8 q0,r2' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q0,r4' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q0,r4' ++[^:]*:12: Error: syntax error -- `vstrb.8 q0,r4' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q0,r7' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q0,r7' ++[^:]*:12: Error: syntax error -- `vstrb.8 q0,r7' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q0,r8' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q0,r8' ++[^:]*:12: Error: syntax error -- `vstrb.8 q0,r8' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q0,r10' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q0,r10' ++[^:]*:12: Error: syntax error -- `vstrb.8 q0,r10' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q0,r12' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q0,r12' ++[^:]*:12: Error: syntax error -- `vstrb.8 q0,r12' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q0,r14' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q0,r14' ++[^:]*:12: Error: syntax error -- `vstrb.8 q0,r14' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q1,r0' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q1,r0' ++[^:]*:12: Error: syntax error -- `vstrb.8 q1,r0' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q1,r1' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q1,r1' ++[^:]*:12: Error: syntax error -- `vstrb.8 q1,r1' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q1,r2' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q1,r2' ++[^:]*:12: Error: syntax error -- `vstrb.8 q1,r2' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q1,r4' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q1,r4' ++[^:]*:12: Error: syntax error -- `vstrb.8 q1,r4' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q1,r7' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q1,r7' ++[^:]*:12: Error: syntax error -- `vstrb.8 q1,r7' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q1,r8' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q1,r8' ++[^:]*:12: Error: syntax error -- `vstrb.8 q1,r8' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q1,r10' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q1,r10' ++[^:]*:12: Error: syntax error -- `vstrb.8 q1,r10' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q1,r12' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q1,r12' ++[^:]*:12: Error: syntax error -- `vstrb.8 q1,r12' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q1,r14' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q1,r14' ++[^:]*:12: Error: syntax error -- `vstrb.8 q1,r14' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q2,r0' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q2,r0' ++[^:]*:12: Error: syntax error -- `vstrb.8 q2,r0' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q2,r1' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q2,r1' ++[^:]*:12: Error: syntax error -- `vstrb.8 q2,r1' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q2,r2' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q2,r2' ++[^:]*:12: Error: syntax error -- `vstrb.8 q2,r2' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q2,r4' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q2,r4' ++[^:]*:12: Error: syntax error -- `vstrb.8 q2,r4' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q2,r7' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q2,r7' ++[^:]*:12: Error: syntax error -- `vstrb.8 q2,r7' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q2,r8' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q2,r8' ++[^:]*:12: Error: syntax error -- `vstrb.8 q2,r8' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q2,r10' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q2,r10' ++[^:]*:12: Error: syntax error -- `vstrb.8 q2,r10' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q2,r12' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q2,r12' ++[^:]*:12: Error: syntax error -- `vstrb.8 q2,r12' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q2,r14' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q2,r14' ++[^:]*:12: Error: syntax error -- `vstrb.8 q2,r14' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q4,r0' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q4,r0' ++[^:]*:12: Error: syntax error -- `vstrb.8 q4,r0' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q4,r1' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q4,r1' ++[^:]*:12: Error: syntax error -- `vstrb.8 q4,r1' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q4,r2' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q4,r2' ++[^:]*:12: Error: syntax error -- `vstrb.8 q4,r2' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q4,r4' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q4,r4' ++[^:]*:12: Error: syntax error -- `vstrb.8 q4,r4' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q4,r7' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q4,r7' ++[^:]*:12: Error: syntax error -- `vstrb.8 q4,r7' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q4,r8' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q4,r8' ++[^:]*:12: Error: syntax error -- `vstrb.8 q4,r8' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q4,r10' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q4,r10' ++[^:]*:12: Error: syntax error -- `vstrb.8 q4,r10' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q4,r12' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q4,r12' ++[^:]*:12: Error: syntax error -- `vstrb.8 q4,r12' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q4,r14' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q4,r14' ++[^:]*:12: Error: syntax error -- `vstrb.8 q4,r14' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q7,r0' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q7,r0' ++[^:]*:12: Error: syntax error -- `vstrb.8 q7,r0' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q7,r1' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q7,r1' ++[^:]*:12: Error: syntax error -- `vstrb.8 q7,r1' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q7,r2' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q7,r2' ++[^:]*:12: Error: syntax error -- `vstrb.8 q7,r2' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q7,r4' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q7,r4' ++[^:]*:12: Error: syntax error -- `vstrb.8 q7,r4' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q7,r7' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q7,r7' ++[^:]*:12: Error: syntax error -- `vstrb.8 q7,r7' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q7,r8' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q7,r8' ++[^:]*:12: Error: syntax error -- `vstrb.8 q7,r8' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q7,r10' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q7,r10' ++[^:]*:12: Error: syntax error -- `vstrb.8 q7,r10' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q7,r12' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q7,r12' ++[^:]*:12: Error: syntax error -- `vstrb.8 q7,r12' ++[^:]*:12: Error: syntax error -- `vldrb.s8 q7,r14' ++[^:]*:12: Error: syntax error -- `vldrb.u8 q7,r14' ++[^:]*:12: Error: syntax error -- `vstrb.8 q7,r14' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q0,r0' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q0,r0' ++[^:]*:12: Error: syntax error -- `vstrb.16 q0,r0' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q0,r1' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q0,r1' ++[^:]*:12: Error: syntax error -- `vstrb.16 q0,r1' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q0,r2' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q0,r2' ++[^:]*:12: Error: syntax error -- `vstrb.16 q0,r2' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q0,r4' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q0,r4' ++[^:]*:12: Error: syntax error -- `vstrb.16 q0,r4' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q0,r7' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q0,r7' ++[^:]*:12: Error: syntax error -- `vstrb.16 q0,r7' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q0,r8' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q0,r8' ++[^:]*:12: Error: syntax error -- `vstrb.16 q0,r8' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q0,r10' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q0,r10' ++[^:]*:12: Error: syntax error -- `vstrb.16 q0,r10' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q0,r12' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q0,r12' ++[^:]*:12: Error: syntax error -- `vstrb.16 q0,r12' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q0,r14' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q0,r14' ++[^:]*:12: Error: syntax error -- `vstrb.16 q0,r14' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q1,r0' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q1,r0' ++[^:]*:12: Error: syntax error -- `vstrb.16 q1,r0' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q1,r1' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q1,r1' ++[^:]*:12: Error: syntax error -- `vstrb.16 q1,r1' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q1,r2' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q1,r2' ++[^:]*:12: Error: syntax error -- `vstrb.16 q1,r2' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q1,r4' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q1,r4' ++[^:]*:12: Error: syntax error -- `vstrb.16 q1,r4' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q1,r7' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q1,r7' ++[^:]*:12: Error: syntax error -- `vstrb.16 q1,r7' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q1,r8' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q1,r8' ++[^:]*:12: Error: syntax error -- `vstrb.16 q1,r8' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q1,r10' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q1,r10' ++[^:]*:12: Error: syntax error -- `vstrb.16 q1,r10' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q1,r12' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q1,r12' ++[^:]*:12: Error: syntax error -- `vstrb.16 q1,r12' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q1,r14' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q1,r14' ++[^:]*:12: Error: syntax error -- `vstrb.16 q1,r14' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q2,r0' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q2,r0' ++[^:]*:12: Error: syntax error -- `vstrb.16 q2,r0' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q2,r1' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q2,r1' ++[^:]*:12: Error: syntax error -- `vstrb.16 q2,r1' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q2,r2' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q2,r2' ++[^:]*:12: Error: syntax error -- `vstrb.16 q2,r2' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q2,r4' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q2,r4' ++[^:]*:12: Error: syntax error -- `vstrb.16 q2,r4' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q2,r7' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q2,r7' ++[^:]*:12: Error: syntax error -- `vstrb.16 q2,r7' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q2,r8' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q2,r8' ++[^:]*:12: Error: syntax error -- `vstrb.16 q2,r8' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q2,r10' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q2,r10' ++[^:]*:12: Error: syntax error -- `vstrb.16 q2,r10' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q2,r12' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q2,r12' ++[^:]*:12: Error: syntax error -- `vstrb.16 q2,r12' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q2,r14' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q2,r14' ++[^:]*:12: Error: syntax error -- `vstrb.16 q2,r14' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q4,r0' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q4,r0' ++[^:]*:12: Error: syntax error -- `vstrb.16 q4,r0' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q4,r1' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q4,r1' ++[^:]*:12: Error: syntax error -- `vstrb.16 q4,r1' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q4,r2' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q4,r2' ++[^:]*:12: Error: syntax error -- `vstrb.16 q4,r2' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q4,r4' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q4,r4' ++[^:]*:12: Error: syntax error -- `vstrb.16 q4,r4' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q4,r7' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q4,r7' ++[^:]*:12: Error: syntax error -- `vstrb.16 q4,r7' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q4,r8' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q4,r8' ++[^:]*:12: Error: syntax error -- `vstrb.16 q4,r8' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q4,r10' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q4,r10' ++[^:]*:12: Error: syntax error -- `vstrb.16 q4,r10' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q4,r12' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q4,r12' ++[^:]*:12: Error: syntax error -- `vstrb.16 q4,r12' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q4,r14' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q4,r14' ++[^:]*:12: Error: syntax error -- `vstrb.16 q4,r14' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q7,r0' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q7,r0' ++[^:]*:12: Error: syntax error -- `vstrb.16 q7,r0' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q7,r1' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q7,r1' ++[^:]*:12: Error: syntax error -- `vstrb.16 q7,r1' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q7,r2' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q7,r2' ++[^:]*:12: Error: syntax error -- `vstrb.16 q7,r2' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q7,r4' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q7,r4' ++[^:]*:12: Error: syntax error -- `vstrb.16 q7,r4' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q7,r7' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q7,r7' ++[^:]*:12: Error: syntax error -- `vstrb.16 q7,r7' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q7,r8' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q7,r8' ++[^:]*:12: Error: syntax error -- `vstrb.16 q7,r8' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q7,r10' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q7,r10' ++[^:]*:12: Error: syntax error -- `vstrb.16 q7,r10' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q7,r12' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q7,r12' ++[^:]*:12: Error: syntax error -- `vstrb.16 q7,r12' ++[^:]*:12: Error: syntax error -- `vldrb.s16 q7,r14' ++[^:]*:12: Error: syntax error -- `vldrb.u16 q7,r14' ++[^:]*:12: Error: syntax error -- `vstrb.16 q7,r14' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q0,r0' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q0,r0' ++[^:]*:12: Error: syntax error -- `vstrb.32 q0,r0' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q0,r1' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q0,r1' ++[^:]*:12: Error: syntax error -- `vstrb.32 q0,r1' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q0,r2' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q0,r2' ++[^:]*:12: Error: syntax error -- `vstrb.32 q0,r2' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q0,r4' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q0,r4' ++[^:]*:12: Error: syntax error -- `vstrb.32 q0,r4' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q0,r7' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q0,r7' ++[^:]*:12: Error: syntax error -- `vstrb.32 q0,r7' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q0,r8' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q0,r8' ++[^:]*:12: Error: syntax error -- `vstrb.32 q0,r8' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q0,r10' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q0,r10' ++[^:]*:12: Error: syntax error -- `vstrb.32 q0,r10' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q0,r12' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q0,r12' ++[^:]*:12: Error: syntax error -- `vstrb.32 q0,r12' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q0,r14' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q0,r14' ++[^:]*:12: Error: syntax error -- `vstrb.32 q0,r14' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q1,r0' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q1,r0' ++[^:]*:12: Error: syntax error -- `vstrb.32 q1,r0' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q1,r1' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q1,r1' ++[^:]*:12: Error: syntax error -- `vstrb.32 q1,r1' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q1,r2' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q1,r2' ++[^:]*:12: Error: syntax error -- `vstrb.32 q1,r2' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q1,r4' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q1,r4' ++[^:]*:12: Error: syntax error -- `vstrb.32 q1,r4' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q1,r7' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q1,r7' ++[^:]*:12: Error: syntax error -- `vstrb.32 q1,r7' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q1,r8' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q1,r8' ++[^:]*:12: Error: syntax error -- `vstrb.32 q1,r8' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q1,r10' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q1,r10' ++[^:]*:12: Error: syntax error -- `vstrb.32 q1,r10' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q1,r12' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q1,r12' ++[^:]*:12: Error: syntax error -- `vstrb.32 q1,r12' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q1,r14' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q1,r14' ++[^:]*:12: Error: syntax error -- `vstrb.32 q1,r14' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q2,r0' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q2,r0' ++[^:]*:12: Error: syntax error -- `vstrb.32 q2,r0' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q2,r1' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q2,r1' ++[^:]*:12: Error: syntax error -- `vstrb.32 q2,r1' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q2,r2' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q2,r2' ++[^:]*:12: Error: syntax error -- `vstrb.32 q2,r2' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q2,r4' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q2,r4' ++[^:]*:12: Error: syntax error -- `vstrb.32 q2,r4' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q2,r7' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q2,r7' ++[^:]*:12: Error: syntax error -- `vstrb.32 q2,r7' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q2,r8' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q2,r8' ++[^:]*:12: Error: syntax error -- `vstrb.32 q2,r8' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q2,r10' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q2,r10' ++[^:]*:12: Error: syntax error -- `vstrb.32 q2,r10' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q2,r12' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q2,r12' ++[^:]*:12: Error: syntax error -- `vstrb.32 q2,r12' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q2,r14' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q2,r14' ++[^:]*:12: Error: syntax error -- `vstrb.32 q2,r14' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q4,r0' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q4,r0' ++[^:]*:12: Error: syntax error -- `vstrb.32 q4,r0' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q4,r1' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q4,r1' ++[^:]*:12: Error: syntax error -- `vstrb.32 q4,r1' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q4,r2' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q4,r2' ++[^:]*:12: Error: syntax error -- `vstrb.32 q4,r2' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q4,r4' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q4,r4' ++[^:]*:12: Error: syntax error -- `vstrb.32 q4,r4' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q4,r7' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q4,r7' ++[^:]*:12: Error: syntax error -- `vstrb.32 q4,r7' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q4,r8' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q4,r8' ++[^:]*:12: Error: syntax error -- `vstrb.32 q4,r8' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q4,r10' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q4,r10' ++[^:]*:12: Error: syntax error -- `vstrb.32 q4,r10' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q4,r12' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q4,r12' ++[^:]*:12: Error: syntax error -- `vstrb.32 q4,r12' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q4,r14' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q4,r14' ++[^:]*:12: Error: syntax error -- `vstrb.32 q4,r14' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q7,r0' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q7,r0' ++[^:]*:12: Error: syntax error -- `vstrb.32 q7,r0' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q7,r1' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q7,r1' ++[^:]*:12: Error: syntax error -- `vstrb.32 q7,r1' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q7,r2' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q7,r2' ++[^:]*:12: Error: syntax error -- `vstrb.32 q7,r2' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q7,r4' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q7,r4' ++[^:]*:12: Error: syntax error -- `vstrb.32 q7,r4' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q7,r7' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q7,r7' ++[^:]*:12: Error: syntax error -- `vstrb.32 q7,r7' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q7,r8' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q7,r8' ++[^:]*:12: Error: syntax error -- `vstrb.32 q7,r8' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q7,r10' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q7,r10' ++[^:]*:12: Error: syntax error -- `vstrb.32 q7,r10' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q7,r12' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q7,r12' ++[^:]*:12: Error: syntax error -- `vstrb.32 q7,r12' ++[^:]*:12: Error: syntax error -- `vldrb.s32 q7,r14' ++[^:]*:12: Error: syntax error -- `vldrb.u32 q7,r14' ++[^:]*:12: Error: syntax error -- `vstrb.32 q7,r14' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q0,r0' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q0,r0' ++[^:]*:22: Error: syntax error -- `vstrh.16 q0,r0' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q0,r1' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q0,r1' ++[^:]*:22: Error: syntax error -- `vstrh.16 q0,r1' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q0,r2' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q0,r2' ++[^:]*:22: Error: syntax error -- `vstrh.16 q0,r2' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q0,r4' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q0,r4' ++[^:]*:22: Error: syntax error -- `vstrh.16 q0,r4' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q0,r7' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q0,r7' ++[^:]*:22: Error: syntax error -- `vstrh.16 q0,r7' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q0,r8' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q0,r8' ++[^:]*:22: Error: syntax error -- `vstrh.16 q0,r8' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q0,r10' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q0,r10' ++[^:]*:22: Error: syntax error -- `vstrh.16 q0,r10' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q0,r12' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q0,r12' ++[^:]*:22: Error: syntax error -- `vstrh.16 q0,r12' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q0,r14' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q0,r14' ++[^:]*:22: Error: syntax error -- `vstrh.16 q0,r14' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q1,r0' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q1,r0' ++[^:]*:22: Error: syntax error -- `vstrh.16 q1,r0' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q1,r1' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q1,r1' ++[^:]*:22: Error: syntax error -- `vstrh.16 q1,r1' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q1,r2' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q1,r2' ++[^:]*:22: Error: syntax error -- `vstrh.16 q1,r2' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q1,r4' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q1,r4' ++[^:]*:22: Error: syntax error -- `vstrh.16 q1,r4' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q1,r7' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q1,r7' ++[^:]*:22: Error: syntax error -- `vstrh.16 q1,r7' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q1,r8' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q1,r8' ++[^:]*:22: Error: syntax error -- `vstrh.16 q1,r8' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q1,r10' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q1,r10' ++[^:]*:22: Error: syntax error -- `vstrh.16 q1,r10' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q1,r12' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q1,r12' ++[^:]*:22: Error: syntax error -- `vstrh.16 q1,r12' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q1,r14' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q1,r14' ++[^:]*:22: Error: syntax error -- `vstrh.16 q1,r14' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q2,r0' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q2,r0' ++[^:]*:22: Error: syntax error -- `vstrh.16 q2,r0' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q2,r1' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q2,r1' ++[^:]*:22: Error: syntax error -- `vstrh.16 q2,r1' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q2,r2' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q2,r2' ++[^:]*:22: Error: syntax error -- `vstrh.16 q2,r2' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q2,r4' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q2,r4' ++[^:]*:22: Error: syntax error -- `vstrh.16 q2,r4' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q2,r7' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q2,r7' ++[^:]*:22: Error: syntax error -- `vstrh.16 q2,r7' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q2,r8' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q2,r8' ++[^:]*:22: Error: syntax error -- `vstrh.16 q2,r8' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q2,r10' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q2,r10' ++[^:]*:22: Error: syntax error -- `vstrh.16 q2,r10' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q2,r12' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q2,r12' ++[^:]*:22: Error: syntax error -- `vstrh.16 q2,r12' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q2,r14' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q2,r14' ++[^:]*:22: Error: syntax error -- `vstrh.16 q2,r14' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q4,r0' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q4,r0' ++[^:]*:22: Error: syntax error -- `vstrh.16 q4,r0' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q4,r1' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q4,r1' ++[^:]*:22: Error: syntax error -- `vstrh.16 q4,r1' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q4,r2' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q4,r2' ++[^:]*:22: Error: syntax error -- `vstrh.16 q4,r2' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q4,r4' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q4,r4' ++[^:]*:22: Error: syntax error -- `vstrh.16 q4,r4' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q4,r7' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q4,r7' ++[^:]*:22: Error: syntax error -- `vstrh.16 q4,r7' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q4,r8' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q4,r8' ++[^:]*:22: Error: syntax error -- `vstrh.16 q4,r8' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q4,r10' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q4,r10' ++[^:]*:22: Error: syntax error -- `vstrh.16 q4,r10' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q4,r12' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q4,r12' ++[^:]*:22: Error: syntax error -- `vstrh.16 q4,r12' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q4,r14' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q4,r14' ++[^:]*:22: Error: syntax error -- `vstrh.16 q4,r14' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q7,r0' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q7,r0' ++[^:]*:22: Error: syntax error -- `vstrh.16 q7,r0' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q7,r1' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q7,r1' ++[^:]*:22: Error: syntax error -- `vstrh.16 q7,r1' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q7,r2' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q7,r2' ++[^:]*:22: Error: syntax error -- `vstrh.16 q7,r2' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q7,r4' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q7,r4' ++[^:]*:22: Error: syntax error -- `vstrh.16 q7,r4' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q7,r7' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q7,r7' ++[^:]*:22: Error: syntax error -- `vstrh.16 q7,r7' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q7,r8' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q7,r8' ++[^:]*:22: Error: syntax error -- `vstrh.16 q7,r8' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q7,r10' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q7,r10' ++[^:]*:22: Error: syntax error -- `vstrh.16 q7,r10' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q7,r12' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q7,r12' ++[^:]*:22: Error: syntax error -- `vstrh.16 q7,r12' ++[^:]*:22: Error: syntax error -- `vldrh.s16 q7,r14' ++[^:]*:22: Error: syntax error -- `vldrh.u16 q7,r14' ++[^:]*:22: Error: syntax error -- `vstrh.16 q7,r14' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q0,r0' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q0,r0' ++[^:]*:22: Error: syntax error -- `vstrh.32 q0,r0' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q0,r1' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q0,r1' ++[^:]*:22: Error: syntax error -- `vstrh.32 q0,r1' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q0,r2' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q0,r2' ++[^:]*:22: Error: syntax error -- `vstrh.32 q0,r2' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q0,r4' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q0,r4' ++[^:]*:22: Error: syntax error -- `vstrh.32 q0,r4' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q0,r7' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q0,r7' ++[^:]*:22: Error: syntax error -- `vstrh.32 q0,r7' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q0,r8' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q0,r8' ++[^:]*:22: Error: syntax error -- `vstrh.32 q0,r8' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q0,r10' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q0,r10' ++[^:]*:22: Error: syntax error -- `vstrh.32 q0,r10' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q0,r12' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q0,r12' ++[^:]*:22: Error: syntax error -- `vstrh.32 q0,r12' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q0,r14' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q0,r14' ++[^:]*:22: Error: syntax error -- `vstrh.32 q0,r14' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q1,r0' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q1,r0' ++[^:]*:22: Error: syntax error -- `vstrh.32 q1,r0' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q1,r1' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q1,r1' ++[^:]*:22: Error: syntax error -- `vstrh.32 q1,r1' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q1,r2' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q1,r2' ++[^:]*:22: Error: syntax error -- `vstrh.32 q1,r2' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q1,r4' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q1,r4' ++[^:]*:22: Error: syntax error -- `vstrh.32 q1,r4' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q1,r7' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q1,r7' ++[^:]*:22: Error: syntax error -- `vstrh.32 q1,r7' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q1,r8' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q1,r8' ++[^:]*:22: Error: syntax error -- `vstrh.32 q1,r8' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q1,r10' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q1,r10' ++[^:]*:22: Error: syntax error -- `vstrh.32 q1,r10' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q1,r12' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q1,r12' ++[^:]*:22: Error: syntax error -- `vstrh.32 q1,r12' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q1,r14' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q1,r14' ++[^:]*:22: Error: syntax error -- `vstrh.32 q1,r14' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q2,r0' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q2,r0' ++[^:]*:22: Error: syntax error -- `vstrh.32 q2,r0' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q2,r1' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q2,r1' ++[^:]*:22: Error: syntax error -- `vstrh.32 q2,r1' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q2,r2' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q2,r2' ++[^:]*:22: Error: syntax error -- `vstrh.32 q2,r2' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q2,r4' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q2,r4' ++[^:]*:22: Error: syntax error -- `vstrh.32 q2,r4' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q2,r7' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q2,r7' ++[^:]*:22: Error: syntax error -- `vstrh.32 q2,r7' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q2,r8' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q2,r8' ++[^:]*:22: Error: syntax error -- `vstrh.32 q2,r8' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q2,r10' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q2,r10' ++[^:]*:22: Error: syntax error -- `vstrh.32 q2,r10' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q2,r12' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q2,r12' ++[^:]*:22: Error: syntax error -- `vstrh.32 q2,r12' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q2,r14' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q2,r14' ++[^:]*:22: Error: syntax error -- `vstrh.32 q2,r14' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q4,r0' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q4,r0' ++[^:]*:22: Error: syntax error -- `vstrh.32 q4,r0' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q4,r1' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q4,r1' ++[^:]*:22: Error: syntax error -- `vstrh.32 q4,r1' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q4,r2' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q4,r2' ++[^:]*:22: Error: syntax error -- `vstrh.32 q4,r2' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q4,r4' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q4,r4' ++[^:]*:22: Error: syntax error -- `vstrh.32 q4,r4' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q4,r7' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q4,r7' ++[^:]*:22: Error: syntax error -- `vstrh.32 q4,r7' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q4,r8' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q4,r8' ++[^:]*:22: Error: syntax error -- `vstrh.32 q4,r8' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q4,r10' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q4,r10' ++[^:]*:22: Error: syntax error -- `vstrh.32 q4,r10' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q4,r12' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q4,r12' ++[^:]*:22: Error: syntax error -- `vstrh.32 q4,r12' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q4,r14' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q4,r14' ++[^:]*:22: Error: syntax error -- `vstrh.32 q4,r14' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q7,r0' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q7,r0' ++[^:]*:22: Error: syntax error -- `vstrh.32 q7,r0' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q7,r1' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q7,r1' ++[^:]*:22: Error: syntax error -- `vstrh.32 q7,r1' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q7,r2' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q7,r2' ++[^:]*:22: Error: syntax error -- `vstrh.32 q7,r2' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q7,r4' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q7,r4' ++[^:]*:22: Error: syntax error -- `vstrh.32 q7,r4' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q7,r7' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q7,r7' ++[^:]*:22: Error: syntax error -- `vstrh.32 q7,r7' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q7,r8' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q7,r8' ++[^:]*:22: Error: syntax error -- `vstrh.32 q7,r8' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q7,r10' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q7,r10' ++[^:]*:22: Error: syntax error -- `vstrh.32 q7,r10' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q7,r12' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q7,r12' ++[^:]*:22: Error: syntax error -- `vstrh.32 q7,r12' ++[^:]*:22: Error: syntax error -- `vldrh.s32 q7,r14' ++[^:]*:22: Error: syntax error -- `vldrh.u32 q7,r14' ++[^:]*:22: Error: syntax error -- `vstrh.32 q7,r14' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q0,r0' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q0,r0' ++[^:]*:30: Error: syntax error -- `vstrw.32 q0,r0' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q0,r1' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q0,r1' ++[^:]*:30: Error: syntax error -- `vstrw.32 q0,r1' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q0,r2' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q0,r2' ++[^:]*:30: Error: syntax error -- `vstrw.32 q0,r2' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q0,r4' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q0,r4' ++[^:]*:30: Error: syntax error -- `vstrw.32 q0,r4' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q0,r7' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q0,r7' ++[^:]*:30: Error: syntax error -- `vstrw.32 q0,r7' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q0,r8' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q0,r8' ++[^:]*:30: Error: syntax error -- `vstrw.32 q0,r8' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q0,r10' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q0,r10' ++[^:]*:30: Error: syntax error -- `vstrw.32 q0,r10' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q0,r12' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q0,r12' ++[^:]*:30: Error: syntax error -- `vstrw.32 q0,r12' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q0,r14' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q0,r14' ++[^:]*:30: Error: syntax error -- `vstrw.32 q0,r14' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q1,r0' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q1,r0' ++[^:]*:30: Error: syntax error -- `vstrw.32 q1,r0' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q1,r1' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q1,r1' ++[^:]*:30: Error: syntax error -- `vstrw.32 q1,r1' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q1,r2' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q1,r2' ++[^:]*:30: Error: syntax error -- `vstrw.32 q1,r2' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q1,r4' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q1,r4' ++[^:]*:30: Error: syntax error -- `vstrw.32 q1,r4' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q1,r7' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q1,r7' ++[^:]*:30: Error: syntax error -- `vstrw.32 q1,r7' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q1,r8' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q1,r8' ++[^:]*:30: Error: syntax error -- `vstrw.32 q1,r8' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q1,r10' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q1,r10' ++[^:]*:30: Error: syntax error -- `vstrw.32 q1,r10' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q1,r12' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q1,r12' ++[^:]*:30: Error: syntax error -- `vstrw.32 q1,r12' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q1,r14' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q1,r14' ++[^:]*:30: Error: syntax error -- `vstrw.32 q1,r14' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q2,r0' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q2,r0' ++[^:]*:30: Error: syntax error -- `vstrw.32 q2,r0' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q2,r1' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q2,r1' ++[^:]*:30: Error: syntax error -- `vstrw.32 q2,r1' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q2,r2' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q2,r2' ++[^:]*:30: Error: syntax error -- `vstrw.32 q2,r2' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q2,r4' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q2,r4' ++[^:]*:30: Error: syntax error -- `vstrw.32 q2,r4' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q2,r7' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q2,r7' ++[^:]*:30: Error: syntax error -- `vstrw.32 q2,r7' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q2,r8' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q2,r8' ++[^:]*:30: Error: syntax error -- `vstrw.32 q2,r8' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q2,r10' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q2,r10' ++[^:]*:30: Error: syntax error -- `vstrw.32 q2,r10' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q2,r12' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q2,r12' ++[^:]*:30: Error: syntax error -- `vstrw.32 q2,r12' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q2,r14' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q2,r14' ++[^:]*:30: Error: syntax error -- `vstrw.32 q2,r14' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q4,r0' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q4,r0' ++[^:]*:30: Error: syntax error -- `vstrw.32 q4,r0' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q4,r1' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q4,r1' ++[^:]*:30: Error: syntax error -- `vstrw.32 q4,r1' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q4,r2' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q4,r2' ++[^:]*:30: Error: syntax error -- `vstrw.32 q4,r2' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q4,r4' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q4,r4' ++[^:]*:30: Error: syntax error -- `vstrw.32 q4,r4' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q4,r7' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q4,r7' ++[^:]*:30: Error: syntax error -- `vstrw.32 q4,r7' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q4,r8' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q4,r8' ++[^:]*:30: Error: syntax error -- `vstrw.32 q4,r8' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q4,r10' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q4,r10' ++[^:]*:30: Error: syntax error -- `vstrw.32 q4,r10' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q4,r12' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q4,r12' ++[^:]*:30: Error: syntax error -- `vstrw.32 q4,r12' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q4,r14' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q4,r14' ++[^:]*:30: Error: syntax error -- `vstrw.32 q4,r14' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q7,r0' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q7,r0' ++[^:]*:30: Error: syntax error -- `vstrw.32 q7,r0' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q7,r1' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q7,r1' ++[^:]*:30: Error: syntax error -- `vstrw.32 q7,r1' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q7,r2' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q7,r2' ++[^:]*:30: Error: syntax error -- `vstrw.32 q7,r2' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q7,r4' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q7,r4' ++[^:]*:30: Error: syntax error -- `vstrw.32 q7,r4' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q7,r7' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q7,r7' ++[^:]*:30: Error: syntax error -- `vstrw.32 q7,r7' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q7,r8' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q7,r8' ++[^:]*:30: Error: syntax error -- `vstrw.32 q7,r8' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q7,r10' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q7,r10' ++[^:]*:30: Error: syntax error -- `vstrw.32 q7,r10' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q7,r12' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q7,r12' ++[^:]*:30: Error: syntax error -- `vstrw.32 q7,r12' ++[^:]*:30: Error: syntax error -- `vldrw.s32 q7,r14' ++[^:]*:30: Error: syntax error -- `vldrw.u32 q7,r14' ++[^:]*:30: Error: syntax error -- `vstrw.32 q7,r14' +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/arm/mve-vldr-vstr-bad.s 2020-11-25 14:37:41.000000000 +0000 +@@ -0,0 +1,30 @@ ++.syntax unified ++.thumb ++ ++.irp op1, 8, 16, 32 ++.irp op2, q0, q1, q2, q4, q7 ++.irp op3, r0, r1, r2, r4, r7, r8, r10, r12, r14 ++vldrb.s\op1 \op2, \op3 ++vldrb.u\op1 \op2, \op3 ++vstrb.\op1 \op2, \op3 ++.endr ++.endr ++.endr ++ ++.irp op1, 16, 32 ++.irp op2, q0, q1, q2, q4, q7 ++.irp op3, r0, r1, r2, r4, r7, r8, r10, r12, r14 ++vldrh.s\op1 \op2, \op3 ++vldrh.u\op1 \op2, \op3 ++vstrh.\op1 \op2, \op3 ++.endr ++.endr ++.endr ++ ++.irp op2, q0, q1, q2, q4, q7 ++.irp op3, r0, r1, r2, r4, r7, r8, r10, r12, r14 ++vldrw.s32 \op2, \op3 ++vldrw.u32 \op2, \op3 ++vstrw.32 \op2, \op3 ++.endr ++.endr +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/arm/pr26858.d 2020-11-25 14:37:41.000000000 +0000 +@@ -0,0 +1,8 @@ ++# name: PR26858 ++# objdump: -dr --prefix-addresses --show-raw-insn ++ ++.*: +file format .*arm.* ++ ++Disassembly of section .text: ++[^>]*> ee266a87 vmul.f32 s12, s13, s14 ++[^>]*> ee000a81 vmla.f32 s0, s1, s2 +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/arm/pr26858.s 2020-11-25 14:37:41.000000000 +0000 +@@ -0,0 +1,6 @@ ++.syntax unified ++.arch armv8-r ++.arm ++.fpu fpv5-sp-d16 ++vmul.f32 s12, s13, s14 ++vmla.f32 s0, s1, s2 +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/i386/dwarf4-line-1.d 2020-11-25 14:37:42.000000000 +0000 +@@ -0,0 +1,50 @@ ++#as: -gdwarf-4 ++#readelf: -wl ++#name: DWARF4 .debug_line 1 ++ ++Raw dump of debug contents of section \.z?debug_line: ++ ++ Offset: 0x0 ++ Length: .* ++ DWARF Version: 4 ++ Prologue Length: .* ++ Minimum Instruction Length: 1 ++ Maximum Ops per Instruction: 1 ++ Initial value of 'is_stmt': 1 ++ Line Base: -5 ++ Line Range: 14 ++ Opcode Base: 13 ++ ++ Opcodes: ++ Opcode 1 has 0 args ++ Opcode 2 has 1 arg ++ Opcode 3 has 1 arg ++ Opcode 4 has 1 arg ++ Opcode 5 has 1 arg ++ Opcode 6 has 0 args ++ Opcode 7 has 0 args ++ Opcode 8 has 0 args ++ Opcode 9 has 1 arg ++ Opcode 10 has 0 args ++ Opcode 11 has 0 args ++ Opcode 12 has 1 arg ++ ++ The Directory Table \(offset 0x.*\): ++ 1 .*/gas/testsuite/gas/i386 ++ ++ The File Name Table \(offset 0x.*\): ++ Entry Dir Time Size Name ++ 1 0 0 0 foo.c ++ 2 0 0 0 foo.h ++ ++ Line Number Statements: ++ \[0x.*\] Extended opcode 2: set Address to 0x0 ++ \[0x.*\] Advance Line by 81 to 82 ++ \[0x.*\] Copy ++ \[0x.*\] Set File Name to entry 2 in the File Name Table ++ \[0x.*\] Advance Line by -73 to 9 ++ \[0x.*\] Special opcode 19: advance Address by 1 to 0x1 and Line by 0 to 9 ++ \[0x.*\] Advance PC by 3 to 0x4 ++ \[0x.*\] Extended opcode 1: End of Sequence ++ ++ +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/i386/dwarf4-line-1.s 2020-11-25 14:37:42.000000000 +0000 +@@ -0,0 +1,14 @@ ++ .file "foo.c" ++ .text ++bar: ++#APP ++# 82 "foo.h" 1 ++ nop ++# 0 "" 2 ++#NO_APP ++ ret ++foo: ++ .file 1 "foo.c" ++ nop ++ .file 2 "foo.h" ++ ret +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/i386/dwarf5-line-1.d 2020-11-25 14:37:42.000000000 +0000 +@@ -0,0 +1,50 @@ ++#as: -gdwarf-5 ++#readelf: -wl ++#name: DWARF5 .debug_line 1 ++ ++Raw dump of debug contents of section \.z?debug_line: ++ ++ Offset: 0x0 ++ Length: .* ++ DWARF Version: 5 ++ Address size \(bytes\): .* ++ Segment selector \(bytes\): 0 ++ Prologue Length: .* ++ Minimum Instruction Length: 1 ++ Maximum Ops per Instruction: 1 ++ Initial value of 'is_stmt': 1 ++ Line Base: -5 ++ Line Range: 14 ++ Opcode Base: 13 ++ ++ Opcodes: ++ Opcode 1 has 0 args ++ Opcode 2 has 1 arg ++ Opcode 3 has 1 arg ++ Opcode 4 has 1 arg ++ Opcode 5 has 1 arg ++ Opcode 6 has 0 args ++ Opcode 7 has 0 args ++ Opcode 8 has 0 args ++ Opcode 9 has 1 arg ++ Opcode 10 has 0 args ++ Opcode 11 has 0 args ++ Opcode 12 has 1 arg ++ ++ The Directory Table \(offset 0x.*, lines 2, columns 1\): ++ Entry Name ++ 0 \(indirect line string, offset: 0x.*\): .*/gas/testsuite/gas/i386 ++ 1 \(indirect line string, offset: 0x.*\): .*/gas/testsuite/gas/i386 ++ ++ The File Name Table \(offset 0x.*, lines 2, columns 3\): ++ Entry Dir MD5 Name ++ 0 0 0xbbd69fc03ce253b2dbaab2522dd519ae \(indirect line string, offset: 0x.*\): core.c ++ 1 0 0x00000000000000000000000000000000 \(indirect line string, offset: 0x.*\): types.h ++ ++ Line Number Statements: ++ \[0x.*\] Extended opcode 2: set Address to 0x0 ++ \[0x.*\] Special opcode 8: advance Address by 0 to 0x0 and Line by 3 to 4 ++ \[0x.*\] Advance PC by 1 to 0x1 ++ \[0x.*\] Extended opcode 1: End of Sequence ++ ++ +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/i386/dwarf5-line-1.s 2020-11-25 14:37:42.000000000 +0000 +@@ -0,0 +1,6 @@ ++ .text ++ .global kretprobe_trampoline ++kretprobe_trampoline: ++ ret ++ .file 0 "core.c" md5 0xbbd69fc03ce253b2dbaab2522dd519ae ++ .file 1 "types.h" +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/i386/dwarf5-line-2.d 2020-11-25 14:37:42.000000000 +0000 +@@ -0,0 +1,49 @@ ++#as: -gdwarf-5 ++#readelf: -wl ++#name: DWARF5 .debug_line 2 ++ ++Raw dump of debug contents of section \.z?debug_line: ++ ++ Offset: 0x0 ++ Length: .* ++ DWARF Version: 5 ++ Address size \(bytes\): .* ++ Segment selector \(bytes\): 0 ++ Prologue Length: .* ++ Minimum Instruction Length: 1 ++ Maximum Ops per Instruction: 1 ++ Initial value of 'is_stmt': 1 ++ Line Base: -5 ++ Line Range: 14 ++ Opcode Base: 13 ++ ++ Opcodes: ++ Opcode 1 has 0 args ++ Opcode 2 has 1 arg ++ Opcode 3 has 1 arg ++ Opcode 4 has 1 arg ++ Opcode 5 has 1 arg ++ Opcode 6 has 0 args ++ Opcode 7 has 0 args ++ Opcode 8 has 0 args ++ Opcode 9 has 1 arg ++ Opcode 10 has 0 args ++ Opcode 11 has 0 args ++ Opcode 12 has 1 arg ++ ++ The Directory Table \(offset 0x.*, lines 2, columns 1\): ++ Entry Name ++ 0 \(indirect line string, offset: 0x.*\): .*/gas/testsuite/gas/i386 ++ 1 \(indirect line string, offset: 0x.*\): .*/gas/testsuite/gas/i386 ++ ++ The File Name Table \(offset 0x.*, lines 1, columns 3\): ++ Entry Dir MD5 Name ++ 0 0 0xbbd69fc03ce253b2dbaab2522dd519ae \(indirect line string, offset: 0x.*\): core.c ++ ++ Line Number Statements: ++ \[0x.*\] Extended opcode 2: set Address to 0x0 ++ \[0x.*\] Special opcode 8: advance Address by 0 to 0x0 and Line by 3 to 4 ++ \[0x.*\] Advance PC by 1 to 0x1 ++ \[0x.*\] Extended opcode 1: End of Sequence ++ ++ +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/i386/dwarf5-line-2.s 2020-11-25 14:37:42.000000000 +0000 +@@ -0,0 +1,5 @@ ++ .text ++ .global kretprobe_trampoline ++kretprobe_trampoline: ++ ret ++ .file 0 "core.c" md5 0xbbd69fc03ce253b2dbaab2522dd519ae +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/i386/dwarf5-line-3.d 2020-11-25 14:37:42.000000000 +0000 +@@ -0,0 +1,49 @@ ++#as: -g -gdwarf-5 ++#readelf: -wl ++#name: DWARF5 .debug_line 2 ++ ++Raw dump of debug contents of section \.z?debug_line: ++ ++ Offset: 0x0 ++ Length: .* ++ DWARF Version: 5 ++ Address size \(bytes\): .* ++ Segment selector \(bytes\): 0 ++ Prologue Length: .* ++ Minimum Instruction Length: 1 ++ Maximum Ops per Instruction: 1 ++ Initial value of 'is_stmt': 1 ++ Line Base: -5 ++ Line Range: 14 ++ Opcode Base: 13 ++ ++ Opcodes: ++ Opcode 1 has 0 args ++ Opcode 2 has 1 arg ++ Opcode 3 has 1 arg ++ Opcode 4 has 1 arg ++ Opcode 5 has 1 arg ++ Opcode 6 has 0 args ++ Opcode 7 has 0 args ++ Opcode 8 has 0 args ++ Opcode 9 has 1 arg ++ Opcode 10 has 0 args ++ Opcode 11 has 0 args ++ Opcode 12 has 1 arg ++ ++ The Directory Table \(offset 0x.*, lines 1, columns 1\): ++ Entry Name ++ 0 \(indirect line string, offset: 0x.*\): .* ++ ++ The File Name Table \(offset 0x.*, lines 2, columns 2\): ++ Entry Dir Name ++ 0 0 \(indirect line string, offset: 0x.*\): dwarf5-line-2.S ++ 1 0 \(indirect line string, offset: 0x.*\): dwarf5-line-2.S ++ ++ Line Number Statements: ++ \[0x.*\] Extended opcode 2: set Address to 0x0 ++ \[0x.*\] Special opcode 7: advance Address by 0 to 0x0 and Line by 2 to 3 ++ \[0x.*\] Advance PC by 1 to 0x1 ++ \[0x.*\] Extended opcode 1: End of Sequence ++ ++ +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/i386/dwarf5-line-3.s 2020-11-25 14:37:42.000000000 +0000 +@@ -0,0 +1,10 @@ ++# 1 "foo.S" ++# 1 "" ++# 1 "" ++# 31 "" ++# 1 "/usr/include/stdc-predef.h" 1 3 4 ++# 32 "" 2 ++# 1 "dwarf5-line-2.S" ++ .text ++lbasename: ++ .nop +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/i386/enqcmd-16bit.d 2020-11-25 14:37:42.000000000 +0000 +@@ -0,0 +1,21 @@ ++#as: -I${srcdir}/$subdir ++#objdump: -dw -Mi8086 ++#name: i386 16-bit ENQCMD[S] insns ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ <_start>: ++ +[a-f0-9]+: 67 0f 38 f9 01 movdiri %eax,\(%ecx\) ++ +[a-f0-9]+: 67 66 0f 38 f8 01 movdir64b \(%ecx\),%eax ++ +[a-f0-9]+: 66 0f 38 f8 04 movdir64b \(%si\),%ax ++ +[a-f0-9]+: 66 0f 38 f8 0e 00 00 movdir64b 0x0,%cx ++ +[a-f0-9]+: 66 0f 38 f8 0e 34 12 movdir64b 0x1234,%cx ++ +[a-f0-9]+: 67 0f 38 f9 01 movdiri %eax,\(%ecx\) ++ +[a-f0-9]+: 67 0f 38 f9 01 movdiri %eax,\(%ecx\) ++ +[a-f0-9]+: 67 66 0f 38 f8 01 movdir64b \(%ecx\),%eax ++ +[a-f0-9]+: 66 0f 38 f8 04 movdir64b \(%si\),%ax ++ +[a-f0-9]+: 66 0f 38 f8 0e 00 00 movdir64b 0x0,%cx ++ +[a-f0-9]+: 66 0f 38 f8 0e 34 12 movdir64b 0x1234,%cx ++#pass +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/i386/enqcmd-16bit.s 2020-11-25 14:37:42.000000000 +0000 +@@ -0,0 +1,4 @@ ++# Check ENQCMD[S] 16-bit instructions ++ ++ .code16 ++.include "movdir.s" +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/ppc/be.d 2020-11-25 14:37:47.000000000 +0000 +@@ -0,0 +1,17 @@ ++#objdump: -d -Mcom ++#as: -mcom -be ++#name: BE only instructions ++ ++.* ++ ++Disassembly of section \.text: ++ ++0+00 : ++.*: ba 8a 00 10 lmw r20,16\(r10\) ++.*: 7d 4b 0c aa lswi r10,r11,1 ++.*: 7d 8b 04 aa lswi r12,r11,32 ++.*: 7d 4b 64 2a lswx r10,r11,r12 ++.*: be 8a 00 10 stmw r20,16\(r10\) ++.*: 7d 4b 0d aa stswi r10,r11,1 ++.*: 7d 4b 05 aa stswi r10,r11,32 ++.*: 7d 4b 65 2a stswx r10,r11,r12 +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/ppc/be.s 2020-11-25 14:37:47.000000000 +0000 +@@ -0,0 +1,10 @@ ++ .text ++start: ++ lmw 20,16(10) ++ lswi 10,11,1 ++ lswi 12,11,32 ++ lswx 10,11,12 ++ stmw 20,16(10) ++ stswi 10,11,1 ++ stswi 10,11,32 ++ stswx 10,11,12 +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/ppc/le_error.d 2020-11-25 14:37:47.000000000 +0000 +@@ -0,0 +1,3 @@ ++#as: -mcom -le ++#source: be.s ++#error_output: le_error.l +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/ppc/le_error.l 2020-11-25 14:37:47.000000000 +0000 +@@ -0,0 +1,9 @@ ++.*Assembler messages: ++.*invalid when little-endian ++.*invalid when little-endian ++.*invalid when little-endian ++.*invalid when little-endian ++.*invalid when little-endian ++.*invalid when little-endian ++.*invalid when little-endian ++.*invalid when little-endian +--- /dev/null 2020-11-25 08:59:50.417841307 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/i386/movdir-16bit.s 2020-11-25 14:37:42.000000000 +0000 +@@ -0,0 +1,4 @@ ++# Check MOVDIR[I,64B] 16-bit instructions ++ ++ .code16 ++.include "movdir.s" diff --git a/patches/binutils/2.35/binutils-CVE-2019-1010204.patch b/patches/binutils/2.35/binutils-CVE-2019-1010204.patch new file mode 100644 index 00000000..56434b10 --- /dev/null +++ b/patches/binutils/2.35/binutils-CVE-2019-1010204.patch @@ -0,0 +1,15 @@ +--- binutils.orig/gold/fileread.cc 2019-08-06 14:22:08.669313110 +0100 ++++ binutils-2.32/gold/fileread.cc 2019-08-06 14:22:28.799177543 +0100 +@@ -381,6 +381,12 @@ File_read::do_read(off_t start, section_ + ssize_t bytes; + if (this->whole_file_view_ != NULL) + { ++ // See PR 23765 for an example of a testcase that triggers this error. ++ if (((ssize_t) start) < 0) ++ gold_fatal(_("%s: read failed, starting offset (%#llx) less than zero"), ++ this->filename().c_str(), ++ static_cast(start)); ++ + bytes = this->size_ - start; + if (static_cast(bytes) >= size) + { diff --git a/patches/binutils/2.35/binutils-CVE-2020-35448.patch b/patches/binutils/2.35/binutils-CVE-2020-35448.patch new file mode 100644 index 00000000..4fab54cc --- /dev/null +++ b/patches/binutils/2.35/binutils-CVE-2020-35448.patch @@ -0,0 +1,53 @@ +diff -rup binutils.orig/bfd/elf.c binutils-2.35/bfd/elf.c +--- binutils.orig/bfd/elf.c 2021-04-19 10:49:21.757290990 +0100 ++++ binutils-2.35/bfd/elf.c 2021-04-19 10:50:28.309839285 +0100 +@@ -12534,7 +12534,9 @@ _bfd_elf_slurp_secondary_reloc_section ( + Elf_Internal_Shdr * hdr = & elf_section_data (relsec)->this_hdr; + + if (hdr->sh_type == SHT_SECONDARY_RELOC +- && hdr->sh_info == (unsigned) elf_section_data (sec)->this_idx) ++ && hdr->sh_info == (unsigned) elf_section_data (sec)->this_idx ++ && (hdr->sh_entsize == ebd->s->sizeof_rel ++ || hdr->sh_entsize == ebd->s->sizeof_rela)) + { + bfd_byte * native_relocs; + bfd_byte * native_reloc; +diff -rup binutils.orig/bfd/elfcode.h binutils-2.35/bfd/elfcode.h +--- binutils.orig/bfd/elfcode.h 2021-04-19 10:49:21.767290922 +0100 ++++ binutils-2.35/bfd/elfcode.h 2021-04-19 10:52:22.196066303 +0100 +@@ -568,7 +568,7 @@ elf_object_p (bfd *abfd) + + /* If this is a relocatable file and there is no section header + table, then we're hosed. */ +- if (i_ehdrp->e_shoff == 0 && i_ehdrp->e_type == ET_REL) ++ if (i_ehdrp->e_shoff < sizeof (x_ehdr) && i_ehdrp->e_type == ET_REL) + goto got_wrong_format_error; + + /* As a simple sanity check, verify that what BFD thinks is the +@@ -578,7 +578,7 @@ elf_object_p (bfd *abfd) + goto got_wrong_format_error; + + /* Further sanity check. */ +- if (i_ehdrp->e_shoff == 0 && i_ehdrp->e_shnum != 0) ++ if (i_ehdrp->e_shoff < sizeof (x_ehdr) && i_ehdrp->e_shnum != 0) + goto got_wrong_format_error; + + ebd = get_elf_backend_data (abfd); +@@ -615,7 +615,7 @@ elf_object_p (bfd *abfd) + && ebd->elf_osabi != ELFOSABI_NONE) + goto got_wrong_format_error; + +- if (i_ehdrp->e_shoff != 0) ++ if (i_ehdrp->e_shoff >= sizeof (x_ehdr)) + { + file_ptr where = (file_ptr) i_ehdrp->e_shoff; + +@@ -807,7 +807,7 @@ elf_object_p (bfd *abfd) + } + } + +- if (i_ehdrp->e_shstrndx != 0 && i_ehdrp->e_shoff != 0) ++ if (i_ehdrp->e_shstrndx != 0 && i_ehdrp->e_shoff >= sizeof (x_ehdr)) + { + unsigned int num_sec; + diff --git a/patches/binutils/2.35/binutils-CVE-2021-20197.patch b/patches/binutils/2.35/binutils-CVE-2021-20197.patch new file mode 100644 index 00000000..207f6be7 --- /dev/null +++ b/patches/binutils/2.35/binutils-CVE-2021-20197.patch @@ -0,0 +1,1310 @@ +diff -rup binutils.orig/bfd/bfd-in2.h binutils-2.35.1/bfd/bfd-in2.h +--- binutils.orig/bfd/bfd-in2.h 2021-01-29 11:14:51.848568548 +0000 ++++ binutils-2.35.1/bfd/bfd-in2.h 2021-01-29 11:15:33.431322133 +0000 +@@ -583,6 +583,8 @@ bfd *bfd_openr (const char *filename, co + + bfd *bfd_fdopenr (const char *filename, const char *target, int fd); + ++bfd *bfd_fdopenw (const char *filename, const char *target, int fd); ++ + bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); + +diff -rup binutils.orig/bfd/opncls.c binutils-2.35.1/bfd/opncls.c +--- binutils.orig/bfd/opncls.c 2021-01-29 11:14:51.846568560 +0000 ++++ binutils-2.35.1/bfd/opncls.c 2021-01-29 11:15:33.431322133 +0000 +@@ -395,6 +395,39 @@ bfd_fdopenr (const char *filename, const + + /* + FUNCTION ++ bfd_fdopenw ++ ++SYNOPSIS ++ bfd *bfd_fdopenw (const char *filename, const char *target, int fd); ++ ++DESCRIPTION ++ <> is exactly like <> with the exception that ++ the resulting BFD is suitable for output. ++*/ ++ ++bfd * ++bfd_fdopenw (const char *filename, const char *target, int fd) ++{ ++ bfd *out = bfd_fdopenr (filename, target, fd); ++ ++ if (out != NULL) ++ { ++ if (!bfd_write_p (out)) ++ { ++ close (fd); ++ _bfd_delete_bfd (out); ++ out = NULL; ++ bfd_set_error (bfd_error_invalid_operation); ++ } ++ else ++ out->direction = write_direction; ++ } ++ ++ return out; ++} ++ ++/* ++FUNCTION + bfd_openstreamr + + SYNOPSIS +diff -rup binutils.orig/binutils/ar.c binutils-2.35.1/binutils/ar.c +--- binutils.orig/binutils/ar.c 2021-01-29 11:14:51.344571539 +0000 ++++ binutils-2.35.1/binutils/ar.c 2021-01-29 11:15:56.174187367 +0000 +@@ -25,6 +25,7 @@ + + #include "sysdep.h" + #include "bfd.h" ++#include "libbfd.h" + #include "libiberty.h" + #include "progress.h" + #include "getopt.h" +@@ -1195,20 +1196,26 @@ write_archive (bfd *iarch) + bfd *obfd; + char *old_name, *new_name; + bfd *contents_head = iarch->archive_next; ++ int ofd = -1; ++ struct stat target_stat; ++ bfd_boolean skip_stat = FALSE; + + old_name = (char *) xmalloc (strlen (bfd_get_filename (iarch)) + 1); + strcpy (old_name, bfd_get_filename (iarch)); +- new_name = make_tempname (old_name); ++ new_name = make_tempname (old_name, &ofd); + + if (new_name == NULL) + bfd_fatal (_("could not create temporary file whilst writing archive")); + + output_filename = new_name; + +- obfd = bfd_openw (new_name, bfd_get_target (iarch)); ++ obfd = bfd_fdopenw (new_name, bfd_get_target (iarch), ofd); + + if (obfd == NULL) +- bfd_fatal (old_name); ++ { ++ close (ofd); ++ bfd_fatal (old_name); ++ } + + output_bfd = obfd; + +@@ -1237,6 +1244,14 @@ write_archive (bfd *iarch) + if (!bfd_set_archive_head (obfd, contents_head)) + bfd_fatal (old_name); + ++#if !defined (_WIN32) || defined (__CYGWIN32__) ++ ofd = dup (ofd); ++ if (iarch == NULL || iarch->iostream == NULL) ++ skip_stat = TRUE; ++ else if (ofd == -1 || fstat (fileno (iarch->iostream), &target_stat) != 0) ++ bfd_fatal (old_name); ++#endif ++ + if (!bfd_close (obfd)) + bfd_fatal (old_name); + +@@ -1246,7 +1261,7 @@ write_archive (bfd *iarch) + /* We don't care if this fails; we might be creating the archive. */ + bfd_close (iarch); + +- if (smart_rename (new_name, old_name, 0) != 0) ++ if (smart_rename (new_name, old_name, ofd, skip_stat ? NULL : &target_stat, 0) != 0) + xexit (1); + free (old_name); + free (new_name); +diff -rup binutils.orig/binutils/arsup.c binutils-2.35.1/binutils/arsup.c +--- binutils.orig/binutils/arsup.c 2021-01-29 11:14:51.350571503 +0000 ++++ binutils-2.35.1/binutils/arsup.c 2021-01-29 11:15:56.174187367 +0000 +@@ -345,13 +345,25 @@ ar_save (void) + else + { + char *ofilename = xstrdup (bfd_get_filename (obfd)); ++ bfd_boolean skip_stat = FALSE; ++ struct stat target_stat; ++ int ofd = -1; + + if (deterministic > 0) + obfd->flags |= BFD_DETERMINISTIC_OUTPUT; + ++#if !defined (_WIN32) || defined (__CYGWIN32__) ++ /* It's OK to fail; at worst it will result in SMART_RENAME using a slow ++ copy fallback to write the output. */ ++ ofd = dup (fileno (obfd->iostream)); ++ if (lstat (real_name, &target_stat) != 0) ++ skip_stat = TRUE; ++#endif ++ + bfd_close (obfd); + +- smart_rename (ofilename, real_name, 0); ++ smart_rename (ofilename, real_name, ofd, ++ skip_stat ? NULL : &target_stat, 0); + obfd = 0; + free (ofilename); + } +diff -rup binutils.orig/binutils/bucomm.c binutils-2.35.1/binutils/bucomm.c +--- binutils.orig/binutils/bucomm.c 2021-01-29 11:14:51.422571073 +0000 ++++ binutils-2.35.1/binutils/bucomm.c 2021-01-29 11:15:33.431322133 +0000 +@@ -532,7 +532,7 @@ template_in_dir (const char *path) + as FILENAME. */ + + char * +-make_tempname (const char *filename) ++make_tempname (const char *filename, int *ofd) + { + char *tmpname = template_in_dir (filename); + int fd; +@@ -550,7 +550,7 @@ make_tempname (const char *filename) + free (tmpname); + return NULL; + } +- close (fd); ++ *ofd = fd; + return tmpname; + } + +diff -rup binutils.orig/binutils/bucomm.h binutils-2.35.1/binutils/bucomm.h +--- binutils.orig/binutils/bucomm.h 2021-01-29 11:14:51.350571503 +0000 ++++ binutils-2.35.1/binutils/bucomm.h 2021-01-29 11:15:56.174187367 +0000 +@@ -51,7 +51,7 @@ int display_info (void); + + void print_arelt_descr (FILE *, bfd *, bfd_boolean, bfd_boolean); + +-char *make_tempname (const char *); ++char *make_tempname (const char *, int *); + char *make_tempdir (const char *); + + bfd_vma parse_vma (const char *, const char *); +@@ -71,7 +71,8 @@ extern void print_version (const char *) + /* In rename.c. */ + extern void set_times (const char *, const struct stat *); + +-extern int smart_rename (const char *, const char *, int); ++extern int smart_rename (const char *, const char *, int, struct stat *, int); ++ + + /* In libiberty. */ + void *xmalloc (size_t); +diff -rup binutils.orig/binutils/objcopy.c binutils-2.35.1/binutils/objcopy.c +--- binutils.orig/binutils/objcopy.c 2021-01-29 11:14:51.342571551 +0000 ++++ binutils-2.35.1/binutils/objcopy.c 2021-01-29 11:15:56.175187361 +0000 +@@ -20,6 +20,7 @@ + + #include "sysdep.h" + #include "bfd.h" ++#include "libbfd.h" + #include "progress.h" + #include "getopt.h" + #include "libiberty.h" +@@ -3711,9 +3712,9 @@ set_long_section_mode (bfd *output_bfd, + /* The top-level control. */ + + static void +-copy_file (const char *input_filename, const char *output_filename, +- const char *input_target, const char *output_target, +- const bfd_arch_info_type *input_arch) ++copy_file (const char *input_filename, const char *output_filename, int ofd, ++ struct stat *in_stat, const char *input_target, ++ const char *output_target, const bfd_arch_info_type *input_arch) + { + bfd *ibfd; + char **obj_matching; +@@ -3732,7 +3733,7 @@ copy_file (const char *input_filename, c + /* To allow us to do "strip *" without dying on the first + non-object file, failures are nonfatal. */ + ibfd = bfd_openr (input_filename, input_target); +- if (ibfd == NULL) ++ if (ibfd == NULL || fstat (fileno (ibfd->iostream), in_stat) != 0) + { + bfd_nonfatal_message (input_filename, NULL, NULL, NULL); + status = 1; +@@ -3786,9 +3787,14 @@ copy_file (const char *input_filename, c + else + force_output_target = TRUE; + +- obfd = bfd_openw (output_filename, output_target); ++ if (ofd >= 0) ++ obfd = bfd_fdopenw (output_filename, output_target, ofd); ++ else ++ obfd = bfd_openw (output_filename, output_target); ++ + if (obfd == NULL) + { ++ close (ofd); + bfd_nonfatal_message (output_filename, NULL, NULL, NULL); + status = 1; + return; +@@ -3816,13 +3822,19 @@ copy_file (const char *input_filename, c + if (output_target == NULL) + output_target = bfd_get_target (ibfd); + +- obfd = bfd_openw (output_filename, output_target); ++ if (ofd >= 0) ++ obfd = bfd_fdopenw (output_filename, output_target, ofd); ++ else ++ obfd = bfd_openw (output_filename, output_target); ++ + if (obfd == NULL) + { ++ close (ofd); + bfd_nonfatal_message (output_filename, NULL, NULL, NULL); + status = 1; + return; + } ++ + /* This is a no-op on non-Coff targets. */ + set_long_section_mode (obfd, ibfd, long_section_names); + +@@ -4786,6 +4798,8 @@ strip_main (int argc, char *argv[]) + int hold_status = status; + struct stat statbuf; + char *tmpname; ++ int tmpfd = -1; ++ int copyfd = -1; + + if (get_file_size (argv[i]) < 1) + { +@@ -4793,18 +4807,18 @@ strip_main (int argc, char *argv[]) + continue; + } + +- if (preserve_dates) +- /* No need to check the return value of stat(). +- It has already been checked in get_file_size(). */ +- stat (argv[i], &statbuf); +- + if (output_file == NULL + || filename_cmp (argv[i], output_file) == 0) +- tmpname = make_tempname (argv[i]); ++ tmpname = make_tempname (argv[i], &tmpfd); + else + tmpname = output_file; + +- if (tmpname == NULL) ++ if (tmpname == NULL ++#if !defined (_WIN32) || defined (__CYGWIN32__) ++ /* Retain a copy of TMPFD since we will need it for SMART_RENAME. */ ++ || (tmpfd >= 0 && (copyfd = dup (tmpfd)) == -1) ++#endif ++ ) + { + bfd_nonfatal_message (argv[i], NULL, NULL, + _("could not create temporary file to hold stripped copy")); +@@ -4813,7 +4827,8 @@ strip_main (int argc, char *argv[]) + } + + status = 0; +- copy_file (argv[i], tmpname, input_target, output_target, NULL); ++ copy_file (argv[i], tmpname, tmpfd, &statbuf, input_target, ++ output_target, NULL); + if (status == 0) + { + if (preserve_dates) +@@ -4821,12 +4836,18 @@ strip_main (int argc, char *argv[]) + if (output_file != tmpname) + status = (smart_rename (tmpname, + output_file ? output_file : argv[i], +- preserve_dates) != 0); ++ copyfd, &statbuf, preserve_dates) != 0); + if (status == 0) + status = hold_status; + } + else +- unlink_if_ordinary (tmpname); ++ { ++#if !defined (_WIN32) || defined (__CYGWIN32__) ++ if (copyfd >= 0) ++ close (copyfd); ++#endif ++ unlink_if_ordinary (tmpname); ++ } + if (output_file != tmpname) + free (tmpname); + } +@@ -5033,7 +5054,8 @@ copy_main (int argc, char *argv[]) + bfd_boolean formats_info = FALSE; + bfd_boolean use_globalize = FALSE; + bfd_boolean use_keep_global = FALSE; +- int c; ++ int c, tmpfd = -1; ++ int copyfd = -1; + struct stat statbuf; + const bfd_arch_info_type *input_arch = NULL; + +@@ -5870,34 +5892,43 @@ copy_main (int argc, char *argv[]) + convert_efi_target (efi); + } + +- if (preserve_dates) +- if (stat (input_filename, & statbuf) < 0) +- fatal (_("warning: could not locate '%s'. System error message: %s"), +- input_filename, strerror (errno)); +- + /* If there is no destination file, or the source and destination files + are the same, then create a temp and rename the result into the input. */ + if (output_filename == NULL + || filename_cmp (input_filename, output_filename) == 0) +- tmpname = make_tempname (input_filename); ++ tmpname = make_tempname (input_filename, &tmpfd); + else + tmpname = output_filename; + +- if (tmpname == NULL) +- fatal (_("warning: could not create temporary file whilst copying '%s', (error: %s)"), +- input_filename, strerror (errno)); ++ if (tmpname == NULL ++#if !defined (_WIN32) || defined (__CYGWIN32__) ++ /* Retain a copy of TMPFD since we will need it for SMART_RENAME. */ ++ || (tmpfd >= 0 && (copyfd = dup (tmpfd)) == -1) ++#endif ++ ) ++ { ++ fatal (_("warning: could not create temporary file whilst copying '%s', (error: %s)"), ++ input_filename, strerror (errno)); ++ } + +- copy_file (input_filename, tmpname, input_target, output_target, input_arch); ++ copy_file (input_filename, tmpname, tmpfd, &statbuf, input_target, ++ output_target, input_arch); + if (status == 0) + { + if (preserve_dates) + set_times (tmpname, &statbuf); + if (tmpname != output_filename) +- status = (smart_rename (tmpname, input_filename, ++ status = (smart_rename (tmpname, input_filename, copyfd, &statbuf, + preserve_dates) != 0); + } + else +- unlink_if_ordinary (tmpname); ++ { ++#if !defined (_WIN32) || defined (__CYGWIN32__) ++ if (copyfd >= 0) ++ close (copyfd); ++#endif ++ unlink_if_ordinary (tmpname); ++ } + + if (tmpname != output_filename) + free (tmpname); +diff -rup binutils.orig/binutils/rename.c binutils-2.35.1/binutils/rename.c +--- binutils.orig/binutils/rename.c 2021-01-29 11:14:51.422571073 +0000 ++++ binutils-2.35.1/binutils/rename.c 2021-01-29 11:15:56.175187361 +0000 +@@ -131,17 +131,55 @@ set_times (const char *destination, cons + #endif + #endif + +-/* Rename FROM to TO, copying if TO is a link. +- Return 0 if ok, -1 if error. */ ++#if !defined (_WIN32) || defined (__CYGWIN32__) ++/* Try to preserve the permission bits and ownership of an existing file when ++ rename overwrites it. FD is the file being renamed and TARGET_STAT has the ++ status of the file that was overwritten. */ ++static void ++try_preserve_permissions (int fd, struct stat *target_stat) ++{ ++ struct stat from_stat; ++ int ret = 0; ++ ++ if (fstat (fd, &from_stat) != 0) ++ return; ++ ++ int from_mode = from_stat.st_mode & 0777; ++ int to_mode = target_stat->st_mode & 0777; ++ ++ /* Fix up permissions before we potentially lose ownership with fchown. ++ Clear the setxid bits because in case the fchown below fails then we don't ++ want to end up with a sxid file owned by the invoking user. If the user ++ hasn't changed or if fchown succeeded, we add back the sxid bits at the ++ end. */ ++ if (from_mode != to_mode) ++ fchmod (fd, to_mode); ++ ++ /* Fix up ownership, this will clear the setxid bits. */ ++ if (from_stat.st_uid != target_stat->st_uid ++ || from_stat.st_gid != target_stat->st_gid) ++ ret = fchown (fd, target_stat->st_uid, target_stat->st_gid); ++ ++ /* Fix up the sxid bits if either the fchown wasn't needed or it ++ succeeded. */ ++ if (ret == 0) ++ fchmod (fd, target_stat->st_mode & 07777); ++} ++#endif ++ ++/* Rename FROM to TO, copying if TO is either a link or is not a regular file. ++ FD is an open file descriptor pointing to FROM that we can use to safely fix ++ up permissions of the file after renaming. TARGET_STAT has the file status ++ that is used to fix up permissions and timestamps after rename. Return 0 if ++ ok, -1 if error and FD is closed before returning. */ + + int +-smart_rename (const char *from, const char *to, int preserve_dates ATTRIBUTE_UNUSED) ++smart_rename (const char *from, const char *to, int fd ATTRIBUTE_UNUSED, ++ struct stat *target_stat ATTRIBUTE_UNUSED, ++ int preserve_dates ATTRIBUTE_UNUSED) + { +- bfd_boolean exists; +- struct stat s; + int ret = 0; +- +- exists = lstat (to, &s) == 0; ++ bfd_boolean exists = target_stat != NULL; + + #if defined (_WIN32) && !defined (__CYGWIN32__) + /* Win32, unlike unix, will not erase `to' in `rename(from, to)' but +@@ -158,36 +196,35 @@ smart_rename (const char *from, const ch + unlink (from); + } + #else +- /* Use rename only if TO is not a symbolic link and has +- only one hard link, and we have permission to write to it. */ ++ /* Avoid a full copy and use rename if we can fix up permissions of the ++ file after renaming, i.e.: ++ ++ - TO is not a symbolic link ++ - TO is a regular file with only one hard link ++ - We have permission to write to TO ++ - FD is available to safely fix up permissions to be the same as the file ++ we overwrote with the rename. ++ ++ Note though that the actual file on disk that TARGET_STAT describes may ++ have changed and we're only trying to preserve the status we know about. ++ At no point do we try to interact with the new file changes, so there can ++ only be two outcomes, i.e. either the external file change survives ++ without knowledge of our change (if it happens after the rename syscall) ++ or our rename and permissions fixup survive without any knowledge of the ++ external change. */ + if (! exists +- || (!S_ISLNK (s.st_mode) +- && S_ISREG (s.st_mode) +- && (s.st_mode & S_IWUSR) +- && s.st_nlink == 1) ++ || (fd >= 0 ++ && !S_ISLNK (target_stat->st_mode) ++ && S_ISREG (target_stat->st_mode) ++ && (target_stat->st_mode & S_IWUSR) ++ && target_stat->st_nlink == 1) + ) + { + ret = rename (from, to); + if (ret == 0) + { + if (exists) +- { +- /* Try to preserve the permission bits and ownership of +- TO. First get the mode right except for the setuid +- bit. Then change the ownership. Then fix the setuid +- bit. We do the chmod before the chown because if the +- chown succeeds, and we are a normal user, we won't be +- able to do the chmod afterward. We don't bother to +- fix the setuid bit first because that might introduce +- a fleeting security problem, and because the chown +- will clear the setuid bit anyhow. We only fix the +- setuid bit if the chown succeeds, because we don't +- want to introduce an unexpected setuid file owned by +- the user running objcopy. */ +- chmod (to, s.st_mode & 0777); +- if (chown (to, s.st_uid, s.st_gid) >= 0) +- chmod (to, s.st_mode & 07777); +- } ++ try_preserve_permissions (fd, target_stat); + } + else + { +@@ -203,9 +240,11 @@ smart_rename (const char *from, const ch + non_fatal (_("unable to copy file '%s'; reason: %s"), to, strerror (errno)); + + if (preserve_dates) +- set_times (to, &s); ++ set_times (to, target_stat); + unlink (from); + } ++ if (fd >= 0) ++ close (fd); + #endif /* _WIN32 && !__CYGWIN32__ */ + + return ret; +diff -rup binutils.orig/binutils/ar.c binutils-2.35.1/binutils/ar.c +--- binutils.orig/binutils/ar.c 2021-02-02 13:01:42.257734944 +0000 ++++ binutils-2.35.1/binutils/ar.c 2021-02-02 13:11:13.340958352 +0000 +@@ -25,7 +25,6 @@ + + #include "sysdep.h" + #include "bfd.h" +-#include "libbfd.h" + #include "libiberty.h" + #include "progress.h" + #include "getopt.h" +@@ -1082,7 +1081,7 @@ open_output_file (bfd * abfd) + output_filename, base); + output_filename = base; + } +- ++ + if (output_dir) + { + size_t len = strlen (output_dir); +@@ -1099,7 +1098,7 @@ open_output_file (bfd * abfd) + + if (verbose) + printf ("x - %s\n", output_filename); +- ++ + FILE * ostream = fopen (output_filename, FOPEN_WB); + if (ostream == NULL) + { +@@ -1198,10 +1197,8 @@ write_archive (bfd *iarch) + bfd *contents_head = iarch->archive_next; + int ofd = -1; + struct stat target_stat; +- bfd_boolean skip_stat = FALSE; + +- old_name = (char *) xmalloc (strlen (bfd_get_filename (iarch)) + 1); +- strcpy (old_name, bfd_get_filename (iarch)); ++ old_name = xstrdup (bfd_get_filename (iarch)); + new_name = make_tempname (old_name, &ofd); + + if (new_name == NULL) +@@ -1246,11 +1243,9 @@ write_archive (bfd *iarch) + + #if !defined (_WIN32) || defined (__CYGWIN32__) + ofd = dup (ofd); +- if (iarch == NULL || iarch->iostream == NULL) +- skip_stat = TRUE; +- else if (ofd == -1 || fstat (fileno (iarch->iostream), &target_stat) != 0) +- bfd_fatal (old_name); + #endif ++ if (ofd == -1 || bfd_stat (iarch, &target_stat) != 0) ++ bfd_fatal (old_name); + + if (!bfd_close (obfd)) + bfd_fatal (old_name); +@@ -1261,7 +1256,7 @@ write_archive (bfd *iarch) + /* We don't care if this fails; we might be creating the archive. */ + bfd_close (iarch); + +- if (smart_rename (new_name, old_name, ofd, skip_stat ? NULL : &target_stat, 0) != 0) ++ if (smart_rename (new_name, old_name, ofd, &target_stat, 0) != 0) + xexit (1); + free (old_name); + free (new_name); +Only in binutils-2.35.1/binutils/: ar.c.orig +Only in binutils-2.35.1/binutils/: ar.c.rej +diff -rup binutils.orig/binutils/arsup.c binutils-2.35.1/binutils/arsup.c +--- binutils.orig/binutils/arsup.c 2021-02-02 13:01:42.208735269 +0000 ++++ binutils-2.35.1/binutils/arsup.c 2021-02-02 13:11:55.725678308 +0000 +@@ -42,6 +42,8 @@ extern int deterministic; + + static bfd *obfd; + static char *real_name; ++static char *temp_name; ++static int real_ofd; + static FILE *outfile; + + static void +@@ -149,27 +151,24 @@ maybequit (void) + void + ar_open (char *name, int t) + { +- char *tname; +- const char *bname = lbasename (name); +- real_name = name; +- +- /* Prepend tmp- to the beginning, to avoid file-name clashes after +- truncation on filesystems with limited namespaces (DOS). */ +- if (asprintf (&tname, "%.*stmp-%s", (int) (bname - name), name, bname) == -1) ++ real_name = xstrdup (name); ++ temp_name = make_tempname (real_name, &real_ofd); ++ ++ if (temp_name == NULL) + { +- fprintf (stderr, _("%s: Can't allocate memory for temp name (%s)\n"), ++ fprintf (stderr, _("%s: Can't open temporary file (%s)\n"), + program_name, strerror(errno)); + maybequit (); + return; + } + +- obfd = bfd_openw (tname, NULL); ++ obfd = bfd_fdopenw (temp_name, NULL, real_ofd); + + if (!obfd) + { + fprintf (stderr, + _("%s: Can't open output archive %s\n"), +- program_name, tname); ++ program_name, temp_name); + + maybequit (); + } +@@ -344,10 +343,9 @@ ar_save (void) + } + else + { +- char *ofilename = xstrdup (bfd_get_filename (obfd)); + bfd_boolean skip_stat = FALSE; + struct stat target_stat; +- int ofd = -1; ++ int ofd = real_ofd; + + if (deterministic > 0) + obfd->flags |= BFD_DETERMINISTIC_OUTPUT; +@@ -355,17 +353,18 @@ ar_save (void) + #if !defined (_WIN32) || defined (__CYGWIN32__) + /* It's OK to fail; at worst it will result in SMART_RENAME using a slow + copy fallback to write the output. */ +- ofd = dup (fileno (obfd->iostream)); +- if (lstat (real_name, &target_stat) != 0) +- skip_stat = TRUE; ++ ofd = dup (ofd); + #endif +- + bfd_close (obfd); + +- smart_rename (ofilename, real_name, ofd, ++ if (ofd == -1 || fstat (ofd, &target_stat) != 0) ++ skip_stat = TRUE; ++ ++ smart_rename (temp_name, real_name, ofd, + skip_stat ? NULL : &target_stat, 0); + obfd = 0; +- free (ofilename); ++ free (temp_name); ++ free (real_name); + } + } + +Only in binutils-2.35.1/binutils/: arsup.c.orig +Only in binutils-2.35.1/binutils/: arsup.c.rej +diff -rup binutils.orig/binutils/objcopy.c binutils-2.35.1/binutils/objcopy.c +--- binutils.orig/binutils/objcopy.c 2021-02-02 13:01:42.214735229 +0000 ++++ binutils-2.35.1/binutils/objcopy.c 2021-02-02 13:13:27.613071192 +0000 +@@ -20,7 +20,6 @@ + + #include "sysdep.h" + #include "bfd.h" +-#include "libbfd.h" + #include "progress.h" + #include "getopt.h" + #include "libiberty.h" +@@ -3733,7 +3732,7 @@ copy_file (const char *input_filename, c + /* To allow us to do "strip *" without dying on the first + non-object file, failures are nonfatal. */ + ibfd = bfd_openr (input_filename, input_target); +- if (ibfd == NULL || fstat (fileno (ibfd->iostream), in_stat) != 0) ++ if (ibfd == NULL || bfd_stat (ibfd, in_stat) != 0) + { + bfd_nonfatal_message (input_filename, NULL, NULL, NULL); + status = 1; +Only in binutils-2.35.1/binutils/: objcopy.c.orig +Only in binutils-2.35.1/binutils/: objcopy.c.rej +--- binutils.orig/binutils/arsup.c 2021-02-04 10:42:03.265729780 +0000 ++++ binutils-2.35.1/binutils/arsup.c 2021-02-04 10:45:48.439166658 +0000 +@@ -357,8 +357,21 @@ ar_save (void) + #endif + bfd_close (obfd); + +- if (ofd == -1 || fstat (ofd, &target_stat) != 0) +- skip_stat = TRUE; ++ if (lstat (real_name, &target_stat) != 0) ++ { ++ /* The temp file created in ar_open has mode 0600 as per mkstemp. ++ Create the real empty output file here so smart_rename will ++ update the mode according to the process umask. */ ++ obfd = bfd_openw (real_name, NULL); ++ if (obfd == NULL ++ || bfd_stat (obfd, &target_stat) != 0) ++ skip_stat = TRUE; ++ if (obfd != NULL) ++ { ++ bfd_set_format (obfd, bfd_archive); ++ bfd_close (obfd); ++ } ++ } + + smart_rename (temp_name, real_name, ofd, + skip_stat ? NULL : &target_stat, 0); +--- binutils.orig/binutils/rename.c 2021-02-08 11:02:58.767933783 +0000 ++++ binutils-2.35.1/binutils/rename.c 2021-02-08 11:20:37.539179363 +0000 +@@ -179,7 +179,10 @@ smart_rename (const char *from, const ch + int preserve_dates ATTRIBUTE_UNUSED) + { + int ret = 0; +- bfd_boolean exists = target_stat != NULL; ++ struct stat to_stat; ++ bfd_boolean exists; ++ ++ exists = lstat (to, &to_stat) == 0; + + #if defined (_WIN32) && !defined (__CYGWIN32__) + /* Win32, unlike unix, will not erase `to' in `rename(from, to)' but +@@ -214,16 +217,16 @@ smart_rename (const char *from, const ch + external change. */ + if (! exists + || (fd >= 0 +- && !S_ISLNK (target_stat->st_mode) +- && S_ISREG (target_stat->st_mode) +- && (target_stat->st_mode & S_IWUSR) +- && target_stat->st_nlink == 1) ++ && !S_ISLNK (to_stat.st_mode) ++ && S_ISREG (to_stat.st_mode) ++ && (to_stat.st_mode & S_IWUSR) ++ && to_stat.st_nlink == 1) + ) + { + ret = rename (from, to); + if (ret == 0) + { +- if (exists) ++ if (exists && target_stat != NULL) + try_preserve_permissions (fd, target_stat); + } + else +@@ -239,7 +242,7 @@ smart_rename (const char *from, const ch + if (ret != 0) + non_fatal (_("unable to copy file '%s'; reason: %s"), to, strerror (errno)); + +- if (preserve_dates) ++ if (preserve_dates && target_stat != NULL) + set_times (to, target_stat); + unlink (from); + } +diff -rup binutils.orig/binutils/ar.c binutils-2.35.1/binutils/ar.c +--- binutils.orig/binutils/ar.c 2021-03-11 12:38:18.183422774 +0000 ++++ binutils-2.35.1/binutils/ar.c 2021-03-11 12:45:09.279716067 +0000 +@@ -1195,22 +1195,21 @@ write_archive (bfd *iarch) + bfd *obfd; + char *old_name, *new_name; + bfd *contents_head = iarch->archive_next; +- int ofd = -1; +- struct stat target_stat; ++ int tmpfd = -1; + + old_name = xstrdup (bfd_get_filename (iarch)); +- new_name = make_tempname (old_name, &ofd); ++ new_name = make_tempname (old_name, &tmpfd); + + if (new_name == NULL) + bfd_fatal (_("could not create temporary file whilst writing archive")); + + output_filename = new_name; + +- obfd = bfd_fdopenw (new_name, bfd_get_target (iarch), ofd); ++ obfd = bfd_fdopenw (new_name, bfd_get_target (iarch), tmpfd); + + if (obfd == NULL) + { +- close (ofd); ++ close (tmpfd); + bfd_fatal (old_name); + } + +@@ -1241,12 +1240,7 @@ write_archive (bfd *iarch) + if (!bfd_set_archive_head (obfd, contents_head)) + bfd_fatal (old_name); + +-#if !defined (_WIN32) || defined (__CYGWIN32__) +- ofd = dup (ofd); +-#endif +- if (ofd == -1 || bfd_stat (iarch, &target_stat) != 0) +- bfd_fatal (old_name); +- ++ tmpfd = dup (tmpfd); + if (!bfd_close (obfd)) + bfd_fatal (old_name); + +@@ -1256,7 +1250,7 @@ write_archive (bfd *iarch) + /* We don't care if this fails; we might be creating the archive. */ + bfd_close (iarch); + +- if (smart_rename (new_name, old_name, ofd, &target_stat, 0) != 0) ++ if (smart_rename (new_name, old_name, tmpfd, NULL, FALSE) != 0) + xexit (1); + free (old_name); + free (new_name); +diff -rup binutils.orig/binutils/arsup.c binutils-2.35.1/binutils/arsup.c +--- binutils.orig/binutils/arsup.c 2021-03-11 12:38:18.182422781 +0000 ++++ binutils-2.35.1/binutils/arsup.c 2021-03-11 12:47:43.246702325 +0000 +@@ -43,7 +43,7 @@ extern int deterministic; + static bfd *obfd; + static char *real_name; + static char *temp_name; +-static int real_ofd; ++static int temp_fd; + static FILE *outfile; + + static void +@@ -152,7 +152,7 @@ void + ar_open (char *name, int t) + { + real_name = xstrdup (name); +- temp_name = make_tempname (real_name, &real_ofd); ++ temp_name = make_tempname (real_name, &temp_fd); + + if (temp_name == NULL) + { +@@ -162,7 +162,7 @@ ar_open (char *name, int t) + return; + } + +- obfd = bfd_fdopenw (temp_name, NULL, real_ofd); ++ obfd = bfd_fdopenw (temp_name, NULL, temp_fd); + + if (!obfd) + { +@@ -343,29 +343,20 @@ ar_save (void) + } + else + { +- bfd_boolean skip_stat = FALSE; + struct stat target_stat; +- int ofd = real_ofd; + + if (deterministic > 0) + obfd->flags |= BFD_DETERMINISTIC_OUTPUT; + +-#if !defined (_WIN32) || defined (__CYGWIN32__) +- /* It's OK to fail; at worst it will result in SMART_RENAME using a slow +- copy fallback to write the output. */ +- ofd = dup (ofd); +-#endif ++ temp_fd = dup (temp_fd); + bfd_close (obfd); + +- if (lstat (real_name, &target_stat) != 0) ++ if (stat (real_name, &target_stat) != 0) + { + /* The temp file created in ar_open has mode 0600 as per mkstemp. + Create the real empty output file here so smart_rename will + update the mode according to the process umask. */ + obfd = bfd_openw (real_name, NULL); +- if (obfd == NULL +- || bfd_stat (obfd, &target_stat) != 0) +- skip_stat = TRUE; + if (obfd != NULL) + { + bfd_set_format (obfd, bfd_archive); +@@ -373,9 +364,8 @@ ar_save (void) + } + } + +- smart_rename (temp_name, real_name, ofd, +- skip_stat ? NULL : &target_stat, 0); +- obfd = 0; ++ smart_rename (temp_name, real_name, temp_fd, NULL, FALSE); ++ obfd = NULL; + free (temp_name); + free (real_name); + } +diff -rup binutils.orig/binutils/bucomm.h binutils-2.35.1/binutils/bucomm.h +--- binutils.orig/binutils/bucomm.h 2021-03-11 12:38:18.183422774 +0000 ++++ binutils-2.35.1/binutils/bucomm.h 2021-03-11 12:42:22.320815334 +0000 +@@ -71,7 +71,8 @@ extern void print_version (const char *) + /* In rename.c. */ + extern void set_times (const char *, const struct stat *); + +-extern int smart_rename (const char *, const char *, int, struct stat *, int); ++extern int smart_rename (const char *, const char *, int, ++ struct stat *, bfd_boolean); + + + /* In libiberty. */ +diff -rup binutils.orig/binutils/objcopy.c binutils-2.35.1/binutils/objcopy.c +--- binutils.orig/binutils/objcopy.c 2021-03-11 12:38:18.181422787 +0000 ++++ binutils-2.35.1/binutils/objcopy.c 2021-03-11 12:51:09.486344417 +0000 +@@ -4802,12 +4802,7 @@ strip_main (int argc, char *argv[]) + else + tmpname = output_file; + +- if (tmpname == NULL +-#if !defined (_WIN32) || defined (__CYGWIN32__) +- /* Retain a copy of TMPFD since we will need it for SMART_RENAME. */ +- || (tmpfd >= 0 && (copyfd = dup (tmpfd)) == -1) +-#endif +- ) ++ if (tmpname == NULL) + { + bfd_nonfatal_message (argv[i], NULL, NULL, + _("could not create temporary file to hold stripped copy")); +@@ -4820,21 +4815,17 @@ strip_main (int argc, char *argv[]) + output_target, NULL); + if (status == 0) + { +- if (preserve_dates) +- set_times (tmpname, &statbuf); + if (output_file != tmpname) +- status = (smart_rename (tmpname, +- output_file ? output_file : argv[i], +- copyfd, &statbuf, preserve_dates) != 0); ++ status = smart_rename (tmpname, ++ output_file ? output_file : argv[i], ++ copyfd, &statbuf, preserve_dates) != 0; + if (status == 0) + status = hold_status; + } + else + { +-#if !defined (_WIN32) || defined (__CYGWIN32__) + if (copyfd >= 0) + close (copyfd); +-#endif + unlink_if_ordinary (tmpname); + } + if (output_file != tmpname) +@@ -5043,8 +5034,9 @@ copy_main (int argc, char *argv[]) + bfd_boolean formats_info = FALSE; + bfd_boolean use_globalize = FALSE; + bfd_boolean use_keep_global = FALSE; +- int c, tmpfd = -1; +- int copyfd = -1; ++ int c; ++ int tmpfd = -1; ++ int copyfd; + struct stat statbuf; + const bfd_arch_info_type *input_arch = NULL; + +@@ -5882,19 +5874,19 @@ copy_main (int argc, char *argv[]) + } + + /* If there is no destination file, or the source and destination files +- are the same, then create a temp and rename the result into the input. */ ++ are the same, then create a temp and copy the result into the input. */ ++ copyfd = -1; + if (output_filename == NULL + || filename_cmp (input_filename, output_filename) == 0) +- tmpname = make_tempname (input_filename, &tmpfd); ++ { ++ tmpname = make_tempname (input_filename, &tmpfd); ++ if (tmpfd >= 0) ++ copyfd = dup (tmpfd); ++ } + else + tmpname = output_filename; + +- if (tmpname == NULL +-#if !defined (_WIN32) || defined (__CYGWIN32__) +- /* Retain a copy of TMPFD since we will need it for SMART_RENAME. */ +- || (tmpfd >= 0 && (copyfd = dup (tmpfd)) == -1) +-#endif +- ) ++ if (tmpname == NULL) + { + fatal (_("warning: could not create temporary file whilst copying '%s', (error: %s)"), + input_filename, strerror (errno)); +@@ -5904,18 +5896,14 @@ copy_main (int argc, char *argv[]) + output_target, input_arch); + if (status == 0) + { +- if (preserve_dates) +- set_times (tmpname, &statbuf); + if (tmpname != output_filename) +- status = (smart_rename (tmpname, input_filename, copyfd, &statbuf, +- preserve_dates) != 0); ++ status = smart_rename (tmpname, input_filename, copyfd, ++ &statbuf, preserve_dates) != 0; + } + else + { +-#if !defined (_WIN32) || defined (__CYGWIN32__) + if (copyfd >= 0) + close (copyfd); +-#endif + unlink_if_ordinary (tmpname); + } + +diff -rup binutils.orig/binutils/rename.c binutils-2.35.1/binutils/rename.c +--- binutils.orig/binutils/rename.c 2021-03-11 12:38:18.183422774 +0000 ++++ binutils-2.35.1/binutils/rename.c 2021-03-11 12:41:41.824081969 +0000 +@@ -30,30 +30,25 @@ + #endif /* HAVE_UTIMES */ + #endif /* ! HAVE_GOOD_UTIME_H */ + +-#if ! defined (_WIN32) || defined (__CYGWIN32__) +-static int simple_copy (const char *, const char *); +- + /* The number of bytes to copy at once. */ + #define COPY_BUF 8192 + +-/* Copy file FROM to file TO, performing no translations. ++/* Copy file FROMFD to file TO, performing no translations. + Return 0 if ok, -1 if error. */ + + static int +-simple_copy (const char *from, const char *to) ++simple_copy (int fromfd, const char *to, ++ struct stat *target_stat ATTRIBUTE_UNUSED) + { +- int fromfd, tofd, nread; ++ int tofd, nread; + int saved; + char buf[COPY_BUF]; + +- fromfd = open (from, O_RDONLY | O_BINARY); +- if (fromfd < 0) ++ if (fromfd < 0 ++ || lseek (fromfd, 0, SEEK_SET) != 0) + return -1; +-#ifdef O_CREAT +- tofd = open (to, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0777); +-#else +- tofd = creat (to, 0777); +-#endif ++ ++ tofd = open (to, O_WRONLY | O_TRUNC | O_BINARY); + if (tofd < 0) + { + saved = errno; +@@ -61,6 +56,7 @@ simple_copy (const char *from, const cha + errno = saved; + return -1; + } ++ + while ((nread = read (fromfd, buf, sizeof buf)) > 0) + { + if (write (tofd, buf, nread) != nread) +@@ -72,7 +68,16 @@ simple_copy (const char *from, const cha + return -1; + } + } ++ + saved = errno; ++ ++#if !defined (_WIN32) || defined (__CYGWIN32__) ++ /* Writing to a setuid/setgid file may clear S_ISUID and S_ISGID. ++ Try to restore them, ignoring failure. */ ++ if (target_stat != NULL) ++ fchmod (tofd, target_stat->st_mode); ++#endif ++ + close (fromfd); + close (tofd); + if (nread < 0) +@@ -82,7 +87,6 @@ simple_copy (const char *from, const cha + } + return 0; + } +-#endif /* __CYGWIN32__ or not _WIN32 */ + + /* Set the times of the file DESTINATION to be the same as those in + STATBUF. */ +@@ -91,164 +95,52 @@ void + set_times (const char *destination, const struct stat *statbuf) + { + int result; +- +- { + #ifdef HAVE_GOOD_UTIME_H +- struct utimbuf tb; ++ struct utimbuf tb; + +- tb.actime = statbuf->st_atime; +- tb.modtime = statbuf->st_mtime; +- result = utime (destination, &tb); +-#else /* ! HAVE_GOOD_UTIME_H */ +-#ifndef HAVE_UTIMES +- long tb[2]; +- +- tb[0] = statbuf->st_atime; +- tb[1] = statbuf->st_mtime; +- result = utime (destination, tb); +-#else /* HAVE_UTIMES */ +- struct timeval tv[2]; +- +- tv[0].tv_sec = statbuf->st_atime; +- tv[0].tv_usec = 0; +- tv[1].tv_sec = statbuf->st_mtime; +- tv[1].tv_usec = 0; +- result = utimes (destination, tv); +-#endif /* HAVE_UTIMES */ +-#endif /* ! HAVE_GOOD_UTIME_H */ +- } +- +- if (result != 0) +- non_fatal (_("%s: cannot set time: %s"), destination, strerror (errno)); +-} +- +-#ifndef S_ISLNK +-#ifdef S_IFLNK +-#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) ++ tb.actime = statbuf->st_atime; ++ tb.modtime = statbuf->st_mtime; ++ result = utime (destination, &tb); ++#elif defined HAVE_UTIMES ++ struct timeval tv[2]; ++ ++ tv[0].tv_sec = statbuf->st_atime; ++ tv[0].tv_usec = 0; ++ tv[1].tv_sec = statbuf->st_mtime; ++ tv[1].tv_usec = 0; ++ result = utimes (destination, tv); + #else +-#define S_ISLNK(m) 0 +-#define lstat stat +-#endif +-#endif +- +-#if !defined (_WIN32) || defined (__CYGWIN32__) +-/* Try to preserve the permission bits and ownership of an existing file when +- rename overwrites it. FD is the file being renamed and TARGET_STAT has the +- status of the file that was overwritten. */ +-static void +-try_preserve_permissions (int fd, struct stat *target_stat) +-{ +- struct stat from_stat; +- int ret = 0; +- +- if (fstat (fd, &from_stat) != 0) +- return; ++ long tb[2]; + +- int from_mode = from_stat.st_mode & 0777; +- int to_mode = target_stat->st_mode & 0777; ++ tb[0] = statbuf->st_atime; ++ tb[1] = statbuf->st_mtime; ++ result = utime (destination, tb); ++#endif + +- /* Fix up permissions before we potentially lose ownership with fchown. +- Clear the setxid bits because in case the fchown below fails then we don't +- want to end up with a sxid file owned by the invoking user. If the user +- hasn't changed or if fchown succeeded, we add back the sxid bits at the +- end. */ +- if (from_mode != to_mode) +- fchmod (fd, to_mode); +- +- /* Fix up ownership, this will clear the setxid bits. */ +- if (from_stat.st_uid != target_stat->st_uid +- || from_stat.st_gid != target_stat->st_gid) +- ret = fchown (fd, target_stat->st_uid, target_stat->st_gid); +- +- /* Fix up the sxid bits if either the fchown wasn't needed or it +- succeeded. */ +- if (ret == 0) +- fchmod (fd, target_stat->st_mode & 07777); ++ if (result != 0) ++ non_fatal (_("%s: cannot set time: %s"), destination, strerror (errno)); + } +-#endif + +-/* Rename FROM to TO, copying if TO is either a link or is not a regular file. +- FD is an open file descriptor pointing to FROM that we can use to safely fix +- up permissions of the file after renaming. TARGET_STAT has the file status +- that is used to fix up permissions and timestamps after rename. Return 0 if +- ok, -1 if error and FD is closed before returning. */ ++/* Copy FROM to TO. TARGET_STAT has the file status that, if non-NULL, ++ is used to fix up timestamps. Return 0 if ok, -1 if error. ++ At one time this function renamed files, but file permissions are ++ tricky to update given the number of different schemes used by ++ various systems. So now we just copy. */ + + int +-smart_rename (const char *from, const char *to, int fd ATTRIBUTE_UNUSED, +- struct stat *target_stat ATTRIBUTE_UNUSED, +- int preserve_dates ATTRIBUTE_UNUSED) ++smart_rename (const char *from, const char *to, int fromfd, ++ struct stat *target_stat, bfd_boolean preserve_dates) + { +- int ret = 0; +- struct stat to_stat; +- bfd_boolean exists; +- +- exists = lstat (to, &to_stat) == 0; +- +-#if defined (_WIN32) && !defined (__CYGWIN32__) +- /* Win32, unlike unix, will not erase `to' in `rename(from, to)' but +- fail instead. Also, chown is not present. */ ++ int ret; + +- if (exists) +- remove (to); +- +- ret = rename (from, to); ++ ret = simple_copy (fromfd, to, target_stat); + if (ret != 0) +- { +- /* We have to clean up here. */ +- non_fatal (_("unable to rename '%s'; reason: %s"), to, strerror (errno)); +- unlink (from); +- } +-#else +- /* Avoid a full copy and use rename if we can fix up permissions of the +- file after renaming, i.e.: ++ non_fatal (_("unable to copy file '%s'; reason: %s"), ++ to, strerror (errno)); + +- - TO is not a symbolic link +- - TO is a regular file with only one hard link +- - We have permission to write to TO +- - FD is available to safely fix up permissions to be the same as the file +- we overwrote with the rename. +- +- Note though that the actual file on disk that TARGET_STAT describes may +- have changed and we're only trying to preserve the status we know about. +- At no point do we try to interact with the new file changes, so there can +- only be two outcomes, i.e. either the external file change survives +- without knowledge of our change (if it happens after the rename syscall) +- or our rename and permissions fixup survive without any knowledge of the +- external change. */ +- if (! exists +- || (fd >= 0 +- && !S_ISLNK (to_stat.st_mode) +- && S_ISREG (to_stat.st_mode) +- && (to_stat.st_mode & S_IWUSR) +- && to_stat.st_nlink == 1) +- ) +- { +- ret = rename (from, to); +- if (ret == 0) +- { +- if (exists && target_stat != NULL) +- try_preserve_permissions (fd, target_stat); +- } +- else +- { +- /* We have to clean up here. */ +- non_fatal (_("unable to rename '%s'; reason: %s"), to, strerror (errno)); +- unlink (from); +- } +- } +- else +- { +- ret = simple_copy (from, to); +- if (ret != 0) +- non_fatal (_("unable to copy file '%s'; reason: %s"), to, strerror (errno)); +- +- if (preserve_dates && target_stat != NULL) +- set_times (to, target_stat); +- unlink (from); +- } +- if (fd >= 0) +- close (fd); +-#endif /* _WIN32 && !__CYGWIN32__ */ ++ if (preserve_dates) ++ set_times (to, target_stat); ++ unlink (from); + + return ret; + } +diff -rup binutils.orig/binutils/objcopy.c binutils-2.35.1/binutils/objcopy.c +--- binutils.orig/binutils/objcopy.c 2021-03-11 13:21:44.780223078 +0000 ++++ binutils-2.35.1/binutils/objcopy.c 2021-03-11 13:23:01.041718818 +0000 +@@ -4798,7 +4798,11 @@ strip_main (int argc, char *argv[]) + + if (output_file == NULL + || filename_cmp (argv[i], output_file) == 0) +- tmpname = make_tempname (argv[i], &tmpfd); ++ { ++ tmpname = make_tempname (argv[i], &tmpfd); ++ if (tmpfd >= 0) ++ copyfd = dup (tmpfd); ++ } + else + tmpname = output_file; + diff --git a/patches/binutils/2.35/binutils-CVE-2021-20284.patch b/patches/binutils/2.35/binutils-CVE-2021-20284.patch new file mode 100644 index 00000000..8b4a519b --- /dev/null +++ b/patches/binutils/2.35/binutils-CVE-2021-20284.patch @@ -0,0 +1,58 @@ +diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.35.1/bfd/elf-bfd.h +--- binutils.orig/bfd/elf-bfd.h 2021-03-12 12:20:04.495125388 +0000 ++++ binutils-2.35.1/bfd/elf-bfd.h 2021-03-12 12:21:25.696583280 +0000 +@@ -1562,7 +1562,7 @@ struct elf_backend_data + const char *, unsigned int); + + /* Called when after loading the normal relocs for a section. */ +- bfd_boolean (*slurp_secondary_relocs) (bfd *, asection *, asymbol **); ++ bfd_boolean (*slurp_secondary_relocs) (bfd *, asection *, asymbol **, bfd_boolean); + + /* Called after writing the normal relocs for a section. */ + bfd_boolean (*write_secondary_relocs) (bfd *, asection *); +@@ -2909,7 +2909,7 @@ extern bfd_boolean is_debuginfo_file (bf + extern bfd_boolean _bfd_elf_init_secondary_reloc_section + (bfd *, Elf_Internal_Shdr *, const char *, unsigned int); + extern bfd_boolean _bfd_elf_slurp_secondary_reloc_section +- (bfd *, asection *, asymbol **); ++(bfd *, asection *, asymbol **, bfd_boolean); + extern bfd_boolean _bfd_elf_copy_special_section_fields + (const bfd *, bfd *, const Elf_Internal_Shdr *, Elf_Internal_Shdr *); + extern bfd_boolean _bfd_elf_write_secondary_reloc_section +diff -rup binutils.orig/bfd/elf.c binutils-2.35.1/bfd/elf.c +--- binutils.orig/bfd/elf.c 2021-03-12 12:20:04.496125381 +0000 ++++ binutils-2.35.1/bfd/elf.c 2021-03-12 12:20:46.032848074 +0000 +@@ -12513,7 +12513,8 @@ _bfd_elf_init_secondary_reloc_section (b + bfd_boolean + _bfd_elf_slurp_secondary_reloc_section (bfd * abfd, + asection * sec, +- asymbol ** symbols) ++ asymbol ** symbols, ++ bfd_boolean dynamic) + { + const struct elf_backend_data * const ebd = get_elf_backend_data (abfd); + asection * relsec; +@@ -12590,7 +12591,10 @@ _bfd_elf_slurp_secondary_reloc_section ( + continue; + } + +- symcount = bfd_get_symcount (abfd); ++ if (dynamic) ++ symcount = bfd_get_dynamic_symcount (abfd); ++ else ++ symcount = bfd_get_symcount (abfd); + + for (i = 0, internal_reloc = internal_relocs, + native_reloc = native_relocs; +diff -rup binutils.orig/bfd/elfcode.h binutils-2.35.1/bfd/elfcode.h +--- binutils.orig/bfd/elfcode.h 2021-03-12 12:20:04.533125134 +0000 ++++ binutils-2.35.1/bfd/elfcode.h 2021-03-12 12:21:59.568357132 +0000 +@@ -1591,7 +1591,7 @@ elf_slurp_reloc_table (bfd *abfd, + symbols, dynamic)) + return FALSE; + +- if (!bed->slurp_secondary_relocs (abfd, asect, symbols)) ++ if (!bed->slurp_secondary_relocs (abfd, asect, symbols, dynamic)) + return FALSE; + + asect->relocation = relents; diff --git a/patches/binutils/2.35/binutils-CVE-2021-3487.patch b/patches/binutils/2.35/binutils-CVE-2021-3487.patch new file mode 100644 index 00000000..6ba1244c --- /dev/null +++ b/patches/binutils/2.35/binutils-CVE-2021-3487.patch @@ -0,0 +1,34 @@ +--- binutils.orig/bfd/dwarf2.c 2021-04-09 16:59:18.345187116 +0100 ++++ binutils-2.35/bfd/dwarf2.c 2021-04-09 17:02:03.614064723 +0100 +@@ -539,6 +539,8 @@ read_section (bfd * abfd, + /* The section may have already been read. */ + if (contents == NULL) + { ++ ufile_ptr filesize; ++ + msec = bfd_get_section_by_name (abfd, section_name); + if (! msec) + { +@@ -554,10 +556,20 @@ read_section (bfd * abfd, + return FALSE; + } + +- *section_size = msec->rawsize ? msec->rawsize : msec->size; ++ amt = bfd_get_section_limit_octets (abfd, msec); ++ filesize = bfd_get_file_size (abfd); ++ if (amt >= filesize) ++ { ++ /* PR 26946 */ ++ _bfd_error_handler (_("DWARF error: section %s is larger than its filesize! (0x%lx vs 0x%lx)"), ++ section_name, (long) amt, (long) filesize); ++ bfd_set_error (bfd_error_bad_value); ++ return FALSE; ++ } ++ *section_size = amt; + /* Paranoia - alloc one extra so that we can make sure a string + section is NUL terminated. */ +- amt = *section_size + 1; ++ amt += 1; + if (amt == 0) + { + bfd_set_error (bfd_error_no_memory); diff --git a/patches/binutils/2.35/binutils-DWARF-5-line-number-parsing.patch b/patches/binutils/2.35/binutils-DWARF-5-line-number-parsing.patch new file mode 100644 index 00000000..15849f9c --- /dev/null +++ b/patches/binutils/2.35/binutils-DWARF-5-line-number-parsing.patch @@ -0,0 +1,24 @@ +--- binutils.orig/bfd/dwarf2.c 2021-01-25 11:26:26.761405305 +0000 ++++ binutils-2.35.1/bfd/dwarf2.c 2021-01-25 11:28:51.838572824 +0000 +@@ -3252,9 +3252,11 @@ read_rnglists (struct comp_unit *unit, s + low_pc = base_address; + low_pc += _bfd_safe_read_leb128 (abfd, rngs_ptr, &bytes_read, + FALSE, rngs_end); ++ rngs_ptr += bytes_read; + high_pc = base_address; + high_pc += _bfd_safe_read_leb128 (abfd, rngs_ptr, &bytes_read, + FALSE, rngs_end); ++ rngs_ptr += bytes_read; + break; + + case DW_RLE_start_end: +@@ -3274,9 +3276,6 @@ read_rnglists (struct comp_unit *unit, s + return FALSE; + } + +- if ((low_pc == 0 && high_pc == 0) || low_pc == high_pc) +- return FALSE; +- + if (!arange_add (unit, arange, low_pc, high_pc)) + return FALSE; + } diff --git a/patches/binutils/2.35/binutils-LTO-fix.patch b/patches/binutils/2.35/binutils-LTO-fix.patch new file mode 100644 index 00000000..d051ad50 --- /dev/null +++ b/patches/binutils/2.35/binutils-LTO-fix.patch @@ -0,0 +1,2148 @@ +diff -rup binutils.orig/bfd/Makefile.am binutils-2.35/bfd/Makefile.am +--- binutils.orig/bfd/Makefile.am 2020-07-30 08:41:25.057236290 +0100 ++++ binutils-2.35/bfd/Makefile.am 2020-07-30 09:05:24.474019185 +0100 +@@ -946,8 +946,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD + bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in + @echo "creating $@" + @bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ +- bfd_version_string="\"$(VERSION)-3.fc33\"" ;\ +- bfd_soversion="$(VERSION)-3.fc33" ;\ ++ bfd_version_string="\"$(VERSION)-4.fc33\"" ;\ ++ bfd_soversion="$(VERSION)-4.fc33" ;\ + bfd_version_package="\"$(PKGVERSION)\"" ;\ + report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ + . $(srcdir)/development.sh ;\ +diff -rup binutils.orig/bfd/Makefile.in binutils-2.35/bfd/Makefile.in +--- binutils.orig/bfd/Makefile.in 2020-07-30 08:41:25.043236381 +0100 ++++ binutils-2.35/bfd/Makefile.in 2020-07-30 09:05:24.476019172 +0100 +@@ -2058,8 +2058,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) + bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in + @echo "creating $@" + @bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ +- bfd_version_string="\"$(VERSION)-3.fc33\"" ;\ +- bfd_soversion="$(VERSION)-3.fc33" ;\ ++ bfd_version_string="\"$(VERSION)-4.fc33\"" ;\ ++ bfd_soversion="$(VERSION)-4.fc33" ;\ + bfd_version_package="\"$(PKGVERSION)\"" ;\ + report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ + . $(srcdir)/development.sh ;\ +diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.35/bfd/elf-bfd.h +--- binutils.orig/bfd/elf-bfd.h 2020-07-30 08:41:25.041236395 +0100 ++++ binutils-2.35/bfd/elf-bfd.h 2020-07-30 09:06:39.392533879 +0100 +@@ -224,6 +224,10 @@ struct elf_link_hash_entry + a strong defined symbol alias. U.ALIAS points to a list of aliases, + the definition having is_weakalias clear. */ + unsigned int is_weakalias : 1; ++ /* There is relocation against symbol in the object. NB: It is only ++ set and used by elf_link_add_object_symbols after all LTO IR symbols ++ have been read. */ ++ unsigned int has_reloc_after_lto_all_symbols_read : 1; + + /* String table index in .dynstr if this is a dynamic symbol. */ + unsigned long dynstr_index; +@@ -549,6 +553,16 @@ enum elf_target_os + is_nacl /* Native Client. */ + }; + ++/* Used by bfd_sym_from_r_symndx to cache a small number of local ++ symbols. */ ++#define LOCAL_SYM_CACHE_SIZE 32 ++struct sym_cache ++{ ++ bfd *abfd; ++ unsigned long indx[LOCAL_SYM_CACHE_SIZE]; ++ Elf_Internal_Sym sym[LOCAL_SYM_CACHE_SIZE]; ++}; ++ + /* ELF linker hash table. */ + + struct elf_link_hash_table +@@ -676,6 +690,9 @@ struct elf_link_hash_table + /* A linked list of dynamic BFD's loaded in the link. */ + struct elf_link_loaded_list *dyn_loaded; + ++ /* Small local sym cache. */ ++ struct sym_cache sym_cache; ++ + /* Short-cuts to get to dynamic linker sections. */ + asection *sgot; + asection *sgotplt; +@@ -717,16 +734,6 @@ struct elf_link_hash_table + /* Returns TRUE if the hash table is a struct elf_link_hash_table. */ + #define is_elf_hash_table(htab) \ + (((struct bfd_link_hash_table *) (htab))->type == bfd_link_elf_hash_table) +- +-/* Used by bfd_sym_from_r_symndx to cache a small number of local +- symbols. */ +-#define LOCAL_SYM_CACHE_SIZE 32 +-struct sym_cache +-{ +- bfd *abfd; +- unsigned long indx[LOCAL_SYM_CACHE_SIZE]; +- Elf_Internal_Sym sym[LOCAL_SYM_CACHE_SIZE]; +-}; + + /* Constant information held for an ELF backend. */ + +diff -rup binutils.orig/bfd/elf32-arm.c binutils-2.35/bfd/elf32-arm.c +--- binutils.orig/bfd/elf32-arm.c 2020-07-30 08:41:25.051236329 +0100 ++++ binutils-2.35/bfd/elf32-arm.c 2020-07-30 09:06:39.393533872 +0100 +@@ -3390,9 +3390,6 @@ struct elf32_arm_link_hash_table + bfd_vma offset; + } tls_ldm_got; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* For convenience in allocate_dynrelocs. */ + bfd * obfd; + +@@ -15316,7 +15313,7 @@ elf32_arm_check_relocs (bfd *abfd, struc + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -16871,7 +16868,8 @@ elf32_arm_size_dynamic_sections (bfd * o + s->size += 4; + } + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, symndx); ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, ibfd, ++ symndx); + if (isym == NULL) + return FALSE; + +diff -rup binutils.orig/bfd/elf32-bfin.c binutils-2.35/bfd/elf32-bfin.c +--- binutils.orig/bfd/elf32-bfin.c 2020-07-30 08:41:25.051236329 +0100 ++++ binutils-2.35/bfd/elf32-bfin.c 2020-07-30 09:06:39.394533866 +0100 +@@ -4791,16 +4791,6 @@ struct bfin_link_hash_entry + struct bfin_pcrel_relocs_copied *pcrel_relocs_copied; + }; + +-/* bfin ELF linker hash table. */ +- +-struct bfin_link_hash_table +-{ +- struct elf_link_hash_table root; +- +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +-}; +- + #define bfin_hash_entry(ent) ((struct bfin_link_hash_entry *) (ent)) + + static struct bfd_hash_entry * +@@ -4829,15 +4819,14 @@ bfin_link_hash_newfunc (struct bfd_hash_ + static struct bfd_link_hash_table * + bfin_link_hash_table_create (bfd * abfd) + { +- struct bfin_link_hash_table *ret; +- size_t amt = sizeof (struct bfin_link_hash_table); ++ struct elf_link_hash_table *ret; ++ size_t amt = sizeof (struct elf_link_hash_table); + + ret = bfd_zmalloc (amt); + if (ret == NULL) + return NULL; + +- if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, +- bfin_link_hash_newfunc, ++ if (!_bfd_elf_link_hash_table_init (ret, abfd, bfin_link_hash_newfunc, + sizeof (struct elf_link_hash_entry), + BFIN_ELF_DATA)) + { +@@ -4845,9 +4834,7 @@ bfin_link_hash_table_create (bfd * abfd) + return NULL; + } + +- ret->sym_cache.abfd = NULL; +- +- return &ret->root.root; ++ return &ret->root; + } + + /* The size in bytes of an entry in the procedure linkage table. */ +@@ -5418,10 +5405,6 @@ struct bfd_elf_special_section const elf + + #define bfd_elf32_bfd_is_local_label_name \ + bfin_is_local_label_name +-#define bfin_hash_table(p) \ +- ((struct bfin_link_hash_table *) (p)->hash) +- +- + + #define elf_backend_create_dynamic_sections \ + _bfd_elf_create_dynamic_sections +diff -rup binutils.orig/bfd/elf32-csky.c binutils-2.35/bfd/elf32-csky.c +--- binutils.orig/bfd/elf32-csky.c 2020-07-30 08:41:25.053236316 +0100 ++++ binutils-2.35/bfd/elf32-csky.c 2020-07-30 09:06:39.394533866 +0100 +@@ -1208,9 +1208,6 @@ struct csky_elf_link_hash_table + { + struct elf_link_hash_table elf; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Data for R_CKCORE_TLS_LDM32 relocations. */ + union + { +@@ -2477,7 +2474,7 @@ csky_elf_check_relocs (bfd * abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -2584,7 +2581,7 @@ csky_elf_check_relocs (bfd * abfd, + asection *s; + Elf_Internal_Sym *loc_isym; + +- loc_isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ loc_isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (loc_isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-hppa.c binutils-2.35/bfd/elf32-hppa.c +--- binutils.orig/bfd/elf32-hppa.c 2020-07-30 08:41:25.043236381 +0100 ++++ binutils-2.35/bfd/elf32-hppa.c 2020-07-30 09:06:39.394533866 +0100 +@@ -286,9 +286,6 @@ struct elf32_hppa_link_hash_table + /* Set if we need a .plt stub to support lazy dynamic linking. */ + unsigned int need_plt_stub:1; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Data for LDM relocations. */ + union + { +@@ -1465,7 +1462,7 @@ elf32_hppa_check_relocs (bfd *abfd, + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->etab.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -4038,7 +4035,7 @@ elf32_hppa_relocate_section (bfd *output + else + { + Elf_Internal_Sym *isym +- = bfd_sym_from_r_symndx (&htab->sym_cache, ++ = bfd_sym_from_r_symndx (&htab->etab.sym_cache, + input_bfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-i386.c binutils-2.35/bfd/elf32-i386.c +--- binutils.orig/bfd/elf32-i386.c 2020-07-30 08:41:25.055236303 +0100 ++++ binutils-2.35/bfd/elf32-i386.c 2020-07-30 09:06:39.395533860 +0100 +@@ -1158,7 +1158,7 @@ elf_i386_tls_transition (struct bfd_link + { + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + name = bfd_elf_sym_name (abfd, symtab_hdr, isym, NULL); + } +@@ -1251,7 +1251,7 @@ elf_i386_convert_load_reloc (bfd *abfd, + else + { + local_ref = TRUE; +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, abfd, + r_symndx); + abs_symbol = isym->st_shndx == SHN_ABS; + } +@@ -1529,7 +1529,7 @@ elf_i386_check_relocs (bfd *abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + goto error_return; +@@ -1859,7 +1859,7 @@ elf_i386_check_relocs (bfd *abfd, + void **vpp; + asection *s; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + goto error_return; +diff -rup binutils.orig/bfd/elf32-m32r.c binutils-2.35/bfd/elf32-m32r.c +--- binutils.orig/bfd/elf32-m32r.c 2020-07-30 08:41:25.045236368 +0100 ++++ binutils-2.35/bfd/elf32-m32r.c 2020-07-30 09:06:39.395533860 +0100 +@@ -1498,20 +1498,6 @@ struct elf_m32r_pcrel_relocs_copied + bfd_size_type count; + }; + +-/* m32r ELF linker hash table. */ +- +-struct elf_m32r_link_hash_table +-{ +- struct elf_link_hash_table root; +- +- /* Short-cuts to get to dynamic linker sections. */ +- asection *sdynbss; +- asection *srelbss; +- +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +-}; +- + /* Traverse an m32r ELF linker hash table. */ + + #define m32r_elf_link_hash_traverse(table, func, info) \ +@@ -1524,21 +1510,21 @@ struct elf_m32r_link_hash_table + + #define m32r_elf_hash_table(p) \ + (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \ +- == M32R_ELF_DATA ? ((struct elf_m32r_link_hash_table *) ((p)->hash)) : NULL) ++ == M32R_ELF_DATA ? ((struct elf_link_hash_table *) ((p)->hash)) : NULL) + + /* Create an m32r ELF linker hash table. */ + + static struct bfd_link_hash_table * + m32r_elf_link_hash_table_create (bfd *abfd) + { +- struct elf_m32r_link_hash_table *ret; +- size_t amt = sizeof (struct elf_m32r_link_hash_table); ++ struct elf_link_hash_table *ret; ++ size_t amt = sizeof (struct elf_link_hash_table); + + ret = bfd_zmalloc (amt); + if (ret == NULL) + return NULL; + +- if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, ++ if (!_bfd_elf_link_hash_table_init (ret, abfd, + _bfd_elf_link_hash_newfunc, + sizeof (struct elf_link_hash_entry), + M32R_ELF_DATA)) +@@ -1547,7 +1533,7 @@ m32r_elf_link_hash_table_create (bfd *ab + return NULL; + } + +- return &ret->root.root; ++ return &ret->root; + } + + /* Create dynamic sections when linking against a dynamic object. */ +@@ -1555,7 +1541,7 @@ m32r_elf_link_hash_table_create (bfd *ab + static bfd_boolean + m32r_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) + { +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + flagword flags, pltflags; + asection *s; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); +@@ -1578,7 +1564,7 @@ m32r_elf_create_dynamic_sections (bfd *a + pltflags |= SEC_READONLY; + + s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags); +- htab->root.splt = s; ++ htab->splt = s; + if (s == NULL + || !bfd_set_section_alignment (s, bed->plt_alignment)) + return FALSE; +@@ -1598,7 +1584,7 @@ m32r_elf_create_dynamic_sections (bfd *a + h = (struct elf_link_hash_entry *) bh; + h->def_regular = 1; + h->type = STT_OBJECT; +- htab->root.hplt = h; ++ htab->hplt = h; + + if (bfd_link_pic (info) + && ! bfd_elf_link_record_dynamic_symbol (info, h)) +@@ -1609,12 +1595,12 @@ m32r_elf_create_dynamic_sections (bfd *a + bed->default_use_rela_p + ? ".rela.plt" : ".rel.plt", + flags | SEC_READONLY); +- htab->root.srelplt = s; ++ htab->srelplt = s; + if (s == NULL + || !bfd_set_section_alignment (s, ptralign)) + return FALSE; + +- if (htab->root.sgot == NULL ++ if (htab->sgot == NULL + && !_bfd_elf_create_got_section (abfd, info)) + return FALSE; + +@@ -1669,7 +1655,7 @@ static bfd_boolean + m32r_elf_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) + { +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd *dynobj; + asection *s; + +@@ -1796,7 +1782,7 @@ static bfd_boolean + allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) + { + struct bfd_link_info *info; +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + struct elf_dyn_relocs *p; + + if (h->root.type == bfd_link_hash_indirect) +@@ -1807,7 +1793,7 @@ allocate_dynrelocs (struct elf_link_hash + if (htab == NULL) + return FALSE; + +- if (htab->root.dynamic_sections_created ++ if (htab->dynamic_sections_created + && h->plt.refcount > 0) + { + /* Make sure this symbol is output as a dynamic symbol. +@@ -1821,7 +1807,7 @@ allocate_dynrelocs (struct elf_link_hash + + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h)) + { +- asection *s = htab->root.splt; ++ asection *s = htab->splt; + + /* If this is the first .plt entry, make room for the special + first entry. */ +@@ -1847,10 +1833,10 @@ allocate_dynrelocs (struct elf_link_hash + + /* We also need to make an entry in the .got.plt section, which + will be placed in the .got section by the linker script. */ +- htab->root.sgotplt->size += 4; ++ htab->sgotplt->size += 4; + + /* We also need to make an entry in the .rel.plt section. */ +- htab->root.srelplt->size += sizeof (Elf32_External_Rela); ++ htab->srelplt->size += sizeof (Elf32_External_Rela); + } + else + { +@@ -1878,13 +1864,13 @@ allocate_dynrelocs (struct elf_link_hash + return FALSE; + } + +- s = htab->root.sgot; ++ s = htab->sgot; + + h->got.offset = s->size; + s->size += 4; +- dyn = htab->root.dynamic_sections_created; ++ dyn = htab->dynamic_sections_created; + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h)) +- htab->root.srelgot->size += sizeof (Elf32_External_Rela); ++ htab->srelgot->size += sizeof (Elf32_External_Rela); + } + else + h->got.offset = (bfd_vma) -1; +@@ -1944,7 +1930,7 @@ allocate_dynrelocs (struct elf_link_hash + if (!h->non_got_ref + && ((h->def_dynamic + && !h->def_regular) +- || (htab->root.dynamic_sections_created ++ || (htab->dynamic_sections_created + && (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined)))) + { +@@ -1984,7 +1970,7 @@ static bfd_boolean + m32r_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) + { +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd *dynobj; + asection *s; + bfd_boolean relocs; +@@ -1998,10 +1984,10 @@ m32r_elf_size_dynamic_sections (bfd *out + if (htab == NULL) + return FALSE; + +- dynobj = htab->root.dynobj; ++ dynobj = htab->dynobj; + BFD_ASSERT (dynobj != NULL); + +- if (htab->root.dynamic_sections_created) ++ if (htab->dynamic_sections_created) + { + /* Set the contents of the .interp section to the interpreter. */ + if (bfd_link_executable (info) && !info->nointerp) +@@ -2060,8 +2046,8 @@ m32r_elf_size_dynamic_sections (bfd *out + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + locsymcount = symtab_hdr->sh_info; + end_local_got = local_got + locsymcount; +- s = htab->root.sgot; +- srel = htab->root.srelgot; ++ s = htab->sgot; ++ srel = htab->srelgot; + for (; local_got < end_local_got; ++local_got) + { + if (*local_got > 0) +@@ -2078,7 +2064,7 @@ m32r_elf_size_dynamic_sections (bfd *out + + /* Allocate global sym .plt and .got entries, and space for global + sym dynamic relocs. */ +- elf_link_hash_traverse (&htab->root, allocate_dynrelocs, info); ++ elf_link_hash_traverse (htab, allocate_dynrelocs, info); + + /* We now have determined the sizes of the various dynamic sections. + Allocate memory for them. */ +@@ -2088,9 +2074,9 @@ m32r_elf_size_dynamic_sections (bfd *out + if ((s->flags & SEC_LINKER_CREATED) == 0) + continue; + +- if (s == htab->root.splt +- || s == htab->root.sgot +- || s == htab->root.sgotplt ++ if (s == htab->splt ++ || s == htab->sgot ++ || s == htab->sgotplt + || s == htab->sdynbss) + { + /* Strip this section if we don't need it; see the +@@ -2098,7 +2084,7 @@ m32r_elf_size_dynamic_sections (bfd *out + } + else if (CONST_STRNEQ (bfd_section_name (s), ".rela")) + { +- if (s->size != 0 && s != htab->root.srelplt) ++ if (s->size != 0 && s != htab->srelplt) + relocs = TRUE; + + /* We use the reloc_count field as a counter if we need +@@ -2188,7 +2174,7 @@ m32r_elf_relocate_section (bfd *output_b + Elf_Internal_Rela *rel, *relend; + /* Assume success. */ + bfd_boolean ret = TRUE; +- struct elf_m32r_link_hash_table *htab = m32r_elf_hash_table (info); ++ struct elf_link_hash_table *htab = m32r_elf_hash_table (info); + bfd_vma *local_got_offsets; + asection *sgot, *splt, *sreloc; + bfd_vma high_address = bfd_get_section_limit (input_bfd, input_section); +@@ -2198,8 +2184,8 @@ m32r_elf_relocate_section (bfd *output_b + + local_got_offsets = elf_local_got_offsets (input_bfd); + +- sgot = htab->root.sgot; +- splt = htab->root.splt; ++ sgot = htab->sgot; ++ splt = htab->splt; + sreloc = NULL; + + rel = relocs; +@@ -2295,7 +2281,7 @@ m32r_elf_relocate_section (bfd *output_b + bfd_boolean dyn; + sec = h->root.u.def.section; + +- dyn = htab->root.dynamic_sections_created; ++ dyn = htab->dynamic_sections_created; + sec = h->root.u.def.section; + if (r_type == R_M32R_GOTPC24 + || (r_type == R_M32R_GOTPC_HI_ULO +@@ -2516,7 +2502,7 @@ m32r_elf_relocate_section (bfd *output_b + off = h->got.offset; + BFD_ASSERT (off != (bfd_vma) -1); + +- dyn = htab->root.dynamic_sections_created; ++ dyn = htab->dynamic_sections_created; + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, + bfd_link_pic (info), + h) +@@ -2576,7 +2562,7 @@ m32r_elf_relocate_section (bfd *output_b + + /* We need to generate a R_M32R_RELATIVE reloc + for the dynamic linker. */ +- srelgot = htab->root.srelgot; ++ srelgot = htab->srelgot; + BFD_ASSERT (srelgot != NULL); + + outrel.r_offset = (sgot->output_section->vma +@@ -2892,7 +2878,7 @@ m32r_elf_finish_dynamic_symbol (bfd *out + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) + { +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd_byte *loc; + + #ifdef DEBUG_PIC +@@ -2918,9 +2904,9 @@ m32r_elf_finish_dynamic_symbol (bfd *out + + BFD_ASSERT (h->dynindx != -1); + +- splt = htab->root.splt; +- sgot = htab->root.sgotplt; +- srela = htab->root.srelplt; ++ splt = htab->splt; ++ sgot = htab->sgotplt; ++ srela = htab->srelplt; + BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL); + + /* Get the index in the procedure linkage table which +@@ -3014,8 +3000,8 @@ m32r_elf_finish_dynamic_symbol (bfd *out + /* This symbol has an entry in the global offset table. Set it + up. */ + +- sgot = htab->root.sgot; +- srela = htab->root.srelgot; ++ sgot = htab->sgot; ++ srela = htab->srelgot; + BFD_ASSERT (sgot != NULL && srela != NULL); + + rela.r_offset = (sgot->output_section->vma +@@ -3063,7 +3049,7 @@ m32r_elf_finish_dynamic_symbol (bfd *out + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak)); + +- s = bfd_get_linker_section (htab->root.dynobj, ".rela.bss"); ++ s = bfd_get_linker_section (htab->dynobj, ".rela.bss"); + BFD_ASSERT (s != NULL); + + rela.r_offset = (h->root.u.def.value +@@ -3078,7 +3064,7 @@ m32r_elf_finish_dynamic_symbol (bfd *out + } + + /* Mark some specially defined symbols as absolute. */ +- if (h == htab->root.hdynamic || h == htab->root.hgot) ++ if (h == htab->hdynamic || h == htab->hgot) + sym->st_shndx = SHN_ABS; + + return TRUE; +@@ -3091,7 +3077,7 @@ static bfd_boolean + m32r_elf_finish_dynamic_sections (bfd *output_bfd, + struct bfd_link_info *info) + { +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd *dynobj; + asection *sdyn; + asection *sgot; +@@ -3104,12 +3090,12 @@ m32r_elf_finish_dynamic_sections (bfd *o + if (htab == NULL) + return FALSE; + +- dynobj = htab->root.dynobj; ++ dynobj = htab->dynobj; + +- sgot = htab->root.sgotplt; ++ sgot = htab->sgotplt; + sdyn = bfd_get_linker_section (dynobj, ".dynamic"); + +- if (htab->root.dynamic_sections_created) ++ if (htab->dynamic_sections_created) + { + asection *splt; + Elf32_External_Dyn *dyncon, *dynconend; +@@ -3132,17 +3118,17 @@ m32r_elf_finish_dynamic_sections (bfd *o + break; + + case DT_PLTGOT: +- s = htab->root.sgotplt; ++ s = htab->sgotplt; + goto get_vma; + case DT_JMPREL: +- s = htab->root.srelplt; ++ s = htab->srelplt; + get_vma: + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_PLTRELSZ: +- s = htab->root.srelplt; ++ s = htab->srelplt; + dyn.d_un.d_val = s->size; + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; +@@ -3150,7 +3136,7 @@ m32r_elf_finish_dynamic_sections (bfd *o + } + + /* Fill in the first entry in the procedure linkage table. */ +- splt = htab->root.splt; ++ splt = htab->splt; + if (splt && splt->size > 0) + { + if (bfd_link_pic (info)) +@@ -3369,7 +3355,7 @@ m32r_elf_check_relocs (bfd *abfd, + struct elf_link_hash_entry **sym_hashes; + const Elf_Internal_Rela *rel; + const Elf_Internal_Rela *rel_end; +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd *dynobj; + asection *sreloc; + +@@ -3384,7 +3370,7 @@ m32r_elf_check_relocs (bfd *abfd, + if (htab == NULL) + return FALSE; + +- dynobj = htab->root.dynobj; ++ dynobj = htab->dynobj; + + rel_end = relocs + sec->reloc_count; + for (rel = relocs; rel < rel_end; rel++) +@@ -3406,7 +3392,7 @@ m32r_elf_check_relocs (bfd *abfd, + } + + /* Some relocs require a global offset table. */ +- if (htab->root.sgot == NULL) ++ if (htab->sgot == NULL) + { + switch (r_type) + { +@@ -3423,7 +3409,7 @@ m32r_elf_check_relocs (bfd *abfd, + case R_M32R_GOTPC_LO: + case R_M32R_GOT24: + if (dynobj == NULL) +- htab->root.dynobj = dynobj = abfd; ++ htab->dynobj = dynobj = abfd; + if (!_bfd_elf_create_got_section (dynobj, info)) + return FALSE; + break; +@@ -3540,7 +3526,7 @@ m32r_elf_check_relocs (bfd *abfd, + struct elf_dyn_relocs **head; + + if (dynobj == NULL) +- htab->root.dynobj = dynobj = abfd; ++ htab->dynobj = dynobj = abfd; + + /* When creating a shared object, we must copy these + relocs into the output file. We create a reloc +diff -rup binutils.orig/bfd/elf32-m68hc1x.h binutils-2.35/bfd/elf32-m68hc1x.h +--- binutils.orig/bfd/elf32-m68hc1x.h 2020-07-30 08:41:25.053236316 +0100 ++++ binutils-2.35/bfd/elf32-m68hc1x.h 2020-07-30 09:06:39.395533860 +0100 +@@ -120,9 +120,6 @@ struct m68hc11_elf_link_hash_table + int top_index; + asection **input_list; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + bfd_boolean (* size_one_stub) (struct bfd_hash_entry*, void*); + bfd_boolean (* build_one_stub) (struct bfd_hash_entry*, void*); + }; +diff -rup binutils.orig/bfd/elf32-m68k.c binutils-2.35/bfd/elf32-m68k.c +--- binutils.orig/bfd/elf32-m68k.c 2020-07-30 08:41:25.038236414 +0100 ++++ binutils-2.35/bfd/elf32-m68k.c 2020-07-30 09:06:39.395533860 +0100 +@@ -889,9 +889,6 @@ struct elf_m68k_link_hash_table + { + struct elf_link_hash_table root; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* The PLT format used by this link, or NULL if the format has not + yet been chosen. */ + const struct elf_m68k_plt_info *plt_info; +@@ -2836,7 +2833,7 @@ elf_m68k_check_relocs (bfd *abfd, + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&elf_m68k_hash_table (info)->sym_cache, ++ isym = bfd_sym_from_r_symndx (&elf_m68k_hash_table (info)->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-metag.c binutils-2.35/bfd/elf32-metag.c +--- binutils.orig/bfd/elf32-metag.c 2020-07-30 08:41:25.054236309 +0100 ++++ binutils-2.35/bfd/elf32-metag.c 2020-07-30 09:06:39.396533853 +0100 +@@ -823,9 +823,6 @@ struct elf_metag_link_hash_table + asection **input_list; + Elf_Internal_Sym **all_local_syms; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Data for LDM relocations. */ + union + { +@@ -2098,7 +2095,7 @@ elf_metag_check_relocs (bfd *abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->etab.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-microblaze.c binutils-2.35/bfd/elf32-microblaze.c +--- binutils.orig/bfd/elf32-microblaze.c 2020-07-30 08:41:25.042236388 +0100 ++++ binutils-2.35/bfd/elf32-microblaze.c 2020-07-30 09:06:39.396533853 +0100 +@@ -744,9 +744,6 @@ struct elf32_mb_link_hash_table + { + struct elf_link_hash_table elf; + +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_sec; +- + /* TLS Local Dynamic GOT Entry */ + union { + bfd_signed_vma refcount; +@@ -2523,7 +2520,7 @@ microblaze_elf_check_relocs (bfd * abfd, + Elf_Internal_Sym *isym; + void *vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_sec, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-nds32.c binutils-2.35/bfd/elf32-nds32.c +--- binutils.orig/bfd/elf32-nds32.c 2020-07-30 08:41:25.040236401 +0100 ++++ binutils-2.35/bfd/elf32-nds32.c 2020-07-30 09:06:39.397533847 +0100 +@@ -3696,8 +3696,6 @@ nds32_elf_link_hash_table_create (bfd *a + return NULL; + } + +- ret->sdynbss = NULL; +- ret->srelbss = NULL; + ret->sym_ld_script = NULL; + + return &ret->root.root; +@@ -3833,7 +3831,7 @@ nds32_elf_create_dynamic_sections (bfd * + initialize them at run time. The linker script puts the .dynbss + section into the .bss section of the final image. */ + s = bfd_make_section (abfd, ".dynbss"); +- htab->sdynbss = s; ++ htab->root.sdynbss = s; + if (s == NULL + || !bfd_set_section_flags (s, SEC_ALLOC | SEC_LINKER_CREATED)) + return FALSE; +@@ -3852,7 +3850,7 @@ nds32_elf_create_dynamic_sections (bfd * + { + s = bfd_make_section (abfd, (bed->default_use_rela_p + ? ".rela.bss" : ".rel.bss")); +- htab->srelbss = s; ++ htab->root.srelbss = s; + if (s == NULL + || !bfd_set_section_flags (s, flags | SEC_READONLY) + || !bfd_set_section_alignment (s, ptralign)) +@@ -3988,7 +3986,7 @@ nds32_elf_adjust_dynamic_symbol (struct + same memory location for the variable. */ + + htab = nds32_elf_hash_table (info); +- s = htab->sdynbss; ++ s = htab->root.sdynbss; + BFD_ASSERT (s != NULL); + + /* We must generate a R_NDS32_COPY reloc to tell the dynamic linker +@@ -3999,7 +3997,7 @@ nds32_elf_adjust_dynamic_symbol (struct + { + asection *srel; + +- srel = htab->srelbss; ++ srel = htab->root.srelbss; + BFD_ASSERT (srel != NULL); + srel->size += sizeof (Elf32_External_Rela); + h->needs_copy = 1; +@@ -7277,7 +7275,8 @@ nds32_elf_check_relocs (bfd *abfd, struc + void *vpp; + + Elf_Internal_Sym *isym; +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx); ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, ++ abfd, r_symndx); + if (isym == NULL) + return FALSE; + +diff -rup binutils.orig/bfd/elf32-nds32.h binutils-2.35/bfd/elf32-nds32.h +--- binutils.orig/bfd/elf32-nds32.h 2020-07-30 08:41:25.053236316 +0100 ++++ binutils-2.35/bfd/elf32-nds32.h 2020-07-30 09:06:39.397533847 +0100 +@@ -122,13 +122,6 @@ struct elf_nds32_link_hash_table + { + struct elf_link_hash_table root; + +- /* Short-cuts to get to dynamic linker sections. */ +- asection *sdynbss; +- asection *srelbss; +- +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_cache; +- + /* Target dependent options. */ + int relax_fp_as_gp; /* --mrelax-omit-fp. */ + int eliminate_gc_relocs; /* --meliminate-gc-relocs. */ +diff -rup binutils.orig/bfd/elf32-nios2.c binutils-2.35/bfd/elf32-nios2.c +--- binutils.orig/bfd/elf32-nios2.c 2020-07-30 08:41:25.049236342 +0100 ++++ binutils-2.35/bfd/elf32-nios2.c 2020-07-30 09:06:39.397533847 +0100 +@@ -1808,9 +1808,6 @@ struct elf32_nios2_link_hash_table + bfd_vma offset; + } tls_ldm_got; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + bfd_vma res_n_size; + }; + +@@ -4902,7 +4899,7 @@ nios2_elf32_check_relocs (bfd *abfd, str + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-or1k.c binutils-2.35/bfd/elf32-or1k.c +--- binutils.orig/bfd/elf32-or1k.c 2020-07-30 08:41:25.046236362 +0100 ++++ binutils-2.35/bfd/elf32-or1k.c 2020-07-30 09:06:39.397533847 +0100 +@@ -916,9 +916,6 @@ struct elf_or1k_link_hash_table + { + struct elf_link_hash_table root; + +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_sec; +- + bfd_boolean saw_plta; + }; + +@@ -2151,7 +2148,7 @@ or1k_elf_check_relocs (bfd *abfd, + Elf_Internal_Sym *isym; + void *vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_sec, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-ppc.c binutils-2.35/bfd/elf32-ppc.c +--- binutils.orig/bfd/elf32-ppc.c 2020-07-30 08:41:25.054236309 +0100 ++++ binutils-2.35/bfd/elf32-ppc.c 2020-07-30 09:06:39.398533840 +0100 +@@ -2212,9 +2212,6 @@ struct ppc_elf_link_hash_table + int plt_slot_size; + /* The size of the first PLT entry. */ + int plt_initial_entry_size; +- +- /* Small local sym cache. */ +- struct sym_cache sym_cache; + }; + + /* Rename some of the generic section flags to better document how they +@@ -2952,7 +2949,7 @@ ppc_elf_check_relocs (bfd *abfd, + ifunc = NULL; + if (h == NULL && htab->elf.target_os != is_vxworks) + { +- Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -3335,7 +3332,7 @@ ppc_elf_check_relocs (bfd *abfd, + asection *s; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -3495,7 +3492,7 @@ ppc_elf_check_relocs (bfd *abfd, + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-s390.c binutils-2.35/bfd/elf32-s390.c +--- binutils.orig/bfd/elf32-s390.c 2020-07-30 08:41:25.051236329 +0100 ++++ binutils-2.35/bfd/elf32-s390.c 2020-07-30 09:06:39.398533840 +0100 +@@ -746,9 +746,6 @@ struct elf_s390_link_hash_table + bfd_signed_vma refcount; + bfd_vma offset; + } tls_ldm_got; +- +- /* Small local sym cache. */ +- struct sym_cache sym_cache; + }; + + /* Get the s390 ELF linker hash table from a link_info structure. */ +@@ -930,7 +927,7 @@ elf_s390_check_relocs (bfd *abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -1281,7 +1278,7 @@ elf_s390_check_relocs (bfd *abfd, + asection *s; + void *vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -3722,7 +3719,7 @@ elf_s390_finish_dynamic_sections (bfd *o + if (local_plt[i].plt.offset != (bfd_vma) -1) + { + asection *sec = local_plt[i].sec; +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, i); ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, ibfd, i); + if (isym == NULL) + return FALSE; + +diff -rup binutils.orig/bfd/elf32-sh.c binutils-2.35/bfd/elf32-sh.c +--- binutils.orig/bfd/elf32-sh.c 2020-07-30 08:41:25.050236336 +0100 ++++ binutils-2.35/bfd/elf32-sh.c 2020-07-30 09:06:39.398533840 +0100 +@@ -2160,8 +2160,6 @@ struct elf_sh_link_hash_table + struct elf_link_hash_table root; + + /* Short-cuts to get to dynamic linker sections. */ +- asection *sdynbss; +- asection *srelbss; + asection *sfuncdesc; + asection *srelfuncdesc; + asection *srofixup; +@@ -2169,9 +2167,6 @@ struct elf_sh_link_hash_table + /* The (unloaded but important) VxWorks .rela.plt.unloaded section. */ + asection *srelplt2; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* A counter or offset to track a TLS got entry. */ + union + { +@@ -2439,7 +2434,7 @@ sh_elf_create_dynamic_sections (bfd *abf + section into the .bss section of the final image. */ + s = bfd_make_section_anyway_with_flags (abfd, ".dynbss", + SEC_ALLOC | SEC_LINKER_CREATED); +- htab->sdynbss = s; ++ htab->root.sdynbss = s; + if (s == NULL) + return FALSE; + +@@ -2460,7 +2455,7 @@ sh_elf_create_dynamic_sections (bfd *abf + (bed->default_use_rela_p + ? ".rela.bss" : ".rel.bss"), + flags | SEC_READONLY); +- htab->srelbss = s; ++ htab->root.srelbss = s; + if (s == NULL + || !bfd_set_section_alignment (s, ptralign)) + return FALSE; +@@ -2580,7 +2575,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd + both the dynamic object and the regular object will refer to the + same memory location for the variable. */ + +- s = htab->sdynbss; ++ s = htab->root.sdynbss; + BFD_ASSERT (s != NULL); + + /* We must generate a R_SH_COPY reloc to tell the dynamic linker to +@@ -2591,7 +2586,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd + { + asection *srel; + +- srel = htab->srelbss; ++ srel = htab->root.srelbss; + BFD_ASSERT (srel != NULL); + srel->size += sizeof (Elf32_External_Rela); + h->needs_copy = 1; +@@ -3151,7 +3146,7 @@ sh_elf_size_dynamic_sections (bfd *outpu + || s == htab->root.sgotplt + || s == htab->sfuncdesc + || s == htab->srofixup +- || s == htab->sdynbss) ++ || s == htab->root.sdynbss) + { + /* Strip this section if we don't need it; see the + comment below. */ +@@ -5679,7 +5674,7 @@ sh_elf_check_relocs (bfd *abfd, struct b + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-tic6x.c binutils-2.35/bfd/elf32-tic6x.c +--- binutils.orig/bfd/elf32-tic6x.c 2020-07-30 08:41:25.041236395 +0100 ++++ binutils-2.35/bfd/elf32-tic6x.c 2020-07-30 09:06:39.399533834 +0100 +@@ -46,9 +46,6 @@ struct elf32_tic6x_link_hash_table + /* C6X specific command line arguments. */ + struct elf32_tic6x_params params; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* The output BFD, for convenience. */ + bfd *obfd; + +@@ -2729,7 +2726,7 @@ elf32_tic6x_check_relocs (bfd *abfd, str + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-tilepro.c binutils-2.35/bfd/elf32-tilepro.c +--- binutils.orig/bfd/elf32-tilepro.c 2020-07-30 08:41:25.039236408 +0100 ++++ binutils-2.35/bfd/elf32-tilepro.c 2020-07-30 09:06:39.399533834 +0100 +@@ -727,19 +727,11 @@ tilepro_elf_mkobject (bfd *abfd) + #include "elf/common.h" + #include "elf/internal.h" + +-struct tilepro_elf_link_hash_table +-{ +- struct elf_link_hash_table elf; +- +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_cache; +-}; +- + /* Get the Tilepro ELF linker hash table from a link_info structure. */ + #define tilepro_elf_hash_table(p) \ + (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \ + == TILEPRO_ELF_DATA \ +- ? ((struct tilepro_elf_link_hash_table *) ((p)->hash)) : NULL) ++ ? ((struct elf_link_hash_table *) ((p)->hash)) : NULL) + + static reloc_howto_type * + tilepro_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, +@@ -1184,14 +1176,14 @@ link_hash_newfunc (struct bfd_hash_entry + static struct bfd_link_hash_table * + tilepro_elf_link_hash_table_create (bfd *abfd) + { +- struct tilepro_elf_link_hash_table *ret; +- size_t amt = sizeof (struct tilepro_elf_link_hash_table); ++ struct elf_link_hash_table *ret; ++ size_t amt = sizeof (struct elf_link_hash_table); + +- ret = (struct tilepro_elf_link_hash_table *) bfd_zmalloc (amt); ++ ret = (struct elf_link_hash_table *) bfd_zmalloc (amt); + if (ret == NULL) + return NULL; + +- if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc, ++ if (!_bfd_elf_link_hash_table_init (ret, abfd, link_hash_newfunc, + sizeof (struct tilepro_elf_link_hash_entry), + TILEPRO_ELF_DATA)) + { +@@ -1199,7 +1191,7 @@ tilepro_elf_link_hash_table_create (bfd + return NULL; + } + +- return &ret->elf.root; ++ return &ret->root; + } + + /* Create the .got section. */ +@@ -1402,7 +1394,7 @@ static bfd_boolean + tilepro_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, + asection *sec, const Elf_Internal_Rela *relocs) + { +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + const Elf_Internal_Rela *rel; +@@ -1423,8 +1415,8 @@ tilepro_elf_check_relocs (bfd *abfd, str + + BFD_ASSERT (is_tilepro_elf (abfd) || num_relocs == 0); + +- if (htab->elf.dynobj == NULL) +- htab->elf.dynobj = abfd; ++ if (htab->dynobj == NULL) ++ htab->dynobj = abfd; + + rel_end = relocs + num_relocs; + for (rel = relocs; rel < rel_end; rel++) +@@ -1569,9 +1561,9 @@ tilepro_elf_check_relocs (bfd *abfd, str + } + } + +- if (htab->elf.sgot == NULL) ++ if (htab->sgot == NULL) + { +- if (!tilepro_elf_create_got_section (htab->elf.dynobj, info)) ++ if (!tilepro_elf_create_got_section (htab->dynobj, info)) + return FALSE; + } + break; +@@ -1716,7 +1708,7 @@ tilepro_elf_check_relocs (bfd *abfd, str + if (sreloc == NULL) + { + sreloc = _bfd_elf_make_dynamic_reloc_section +- (sec, htab->elf.dynobj, 2, abfd, /*rela?*/ TRUE); ++ (sec, htab->dynobj, 2, abfd, /*rela?*/ TRUE); + + if (sreloc == NULL) + return FALSE; +@@ -1754,7 +1746,7 @@ tilepro_elf_check_relocs (bfd *abfd, str + { + size_t amt = sizeof *p; + p = ((struct elf_dyn_relocs *) +- bfd_alloc (htab->elf.dynobj, amt)); ++ bfd_alloc (htab->dynobj, amt)); + if (p == NULL) + return FALSE; + p->next = *head; +@@ -1850,14 +1842,14 @@ static bfd_boolean + tilepro_elf_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) + { +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + asection *s, *srel; + + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); + + /* Make sure we know what is going on here. */ +- BFD_ASSERT (htab->elf.dynobj != NULL ++ BFD_ASSERT (htab->dynobj != NULL + && (h->needs_plt + || h->is_weakalias + || (h->def_dynamic +@@ -1947,13 +1939,13 @@ tilepro_elf_adjust_dynamic_symbol (struc + .rel.bss section we are going to use. */ + if ((h->root.u.def.section->flags & SEC_READONLY) != 0) + { +- s = htab->elf.sdynrelro; +- srel = htab->elf.sreldynrelro; ++ s = htab->sdynrelro; ++ srel = htab->sreldynrelro; + } + else + { +- s = htab->elf.sdynbss; +- srel = htab->elf.srelbss; ++ s = htab->sdynbss; ++ srel = htab->srelbss; + } + if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0) + { +@@ -1971,7 +1963,7 @@ static bfd_boolean + allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) + { + struct bfd_link_info *info; +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + struct elf_dyn_relocs *p; + + if (h->root.type == bfd_link_hash_indirect) +@@ -1981,7 +1973,7 @@ allocate_dynrelocs (struct elf_link_hash + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); + +- if (htab->elf.dynamic_sections_created ++ if (htab->dynamic_sections_created + && h->plt.refcount > 0) + { + /* Make sure this symbol is output as a dynamic symbol. +@@ -1995,7 +1987,7 @@ allocate_dynrelocs (struct elf_link_hash + + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h)) + { +- asection *s = htab->elf.splt; ++ asection *s = htab->splt; + + /* Allocate room for the header. */ + if (s->size == 0) +@@ -2021,10 +2013,10 @@ allocate_dynrelocs (struct elf_link_hash + s->size += PLT_ENTRY_SIZE; + + /* We also need to make an entry in the .got.plt section. */ +- htab->elf.sgotplt->size += GOT_ENTRY_SIZE; ++ htab->sgotplt->size += GOT_ENTRY_SIZE; + + /* We also need to make an entry in the .rela.plt section. */ +- htab->elf.srelplt->size += TILEPRO_ELF_RELA_BYTES; ++ htab->srelplt->size += TILEPRO_ELF_RELA_BYTES; + } + else + { +@@ -2060,22 +2052,22 @@ allocate_dynrelocs (struct elf_link_hash + return FALSE; + } + +- s = htab->elf.sgot; ++ s = htab->sgot; + h->got.offset = s->size; + s->size += TILEPRO_BYTES_PER_WORD; + /* R_TILEPRO_IMM16_Xn_TLS_GD entries need 2 consecutive GOT slots. */ + if (tls_type == GOT_TLS_GD) + s->size += TILEPRO_BYTES_PER_WORD; +- dyn = htab->elf.dynamic_sections_created; ++ dyn = htab->dynamic_sections_created; + /* R_TILEPRO_IMM16_Xn_TLS_IE_xxx needs one dynamic relocation, + R_TILEPRO_IMM16_Xn_TLS_GD_xxx needs two if local symbol and two if + global. */ + if (tls_type == GOT_TLS_GD || tls_type == GOT_TLS_IE) +- htab->elf.srelgot->size += 2 * TILEPRO_ELF_RELA_BYTES; ++ htab->srelgot->size += 2 * TILEPRO_ELF_RELA_BYTES; + else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, + bfd_link_pic (info), + h)) +- htab->elf.srelgot->size += TILEPRO_ELF_RELA_BYTES; ++ htab->srelgot->size += TILEPRO_ELF_RELA_BYTES; + } + else + h->got.offset = (bfd_vma) -1; +@@ -2134,7 +2126,7 @@ allocate_dynrelocs (struct elf_link_hash + if (!h->non_got_ref + && ((h->def_dynamic + && !h->def_regular) +- || (htab->elf.dynamic_sections_created ++ || (htab->dynamic_sections_created + && (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined)))) + { +@@ -2195,14 +2187,14 @@ tilepro_elf_size_dynamic_sections (bfd * + { + (void)output_bfd; + +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd *dynobj; + asection *s; + bfd *ibfd; + + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); +- dynobj = htab->elf.dynobj; ++ dynobj = htab->dynobj; + BFD_ASSERT (dynobj != NULL); + + if (elf_hash_table (info)->dynamic_sections_created) +@@ -2268,8 +2260,8 @@ tilepro_elf_size_dynamic_sections (bfd * + locsymcount = symtab_hdr->sh_info; + end_local_got = local_got + locsymcount; + local_tls_type = _bfd_tilepro_elf_local_got_tls_type (ibfd); +- s = htab->elf.sgot; +- srel = htab->elf.srelgot; ++ s = htab->sgot; ++ srel = htab->srelgot; + for (; local_got < end_local_got; ++local_got, ++local_tls_type) + { + if (*local_got > 0) +@@ -2290,19 +2282,19 @@ tilepro_elf_size_dynamic_sections (bfd * + + /* Allocate global sym .plt and .got entries, and space for global + sym dynamic relocs. */ +- elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, info); ++ elf_link_hash_traverse (htab, allocate_dynrelocs, info); + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* If the .got section is more than 0x8000 bytes, we add + 0x8000 to the value of _GLOBAL_OFFSET_TABLE_, so that 16 + bit relocations have a greater chance of working. */ +- if (htab->elf.sgot->size >= 0x8000 ++ if (htab->sgot->size >= 0x8000 + && elf_hash_table (info)->hgot->root.u.def.value == 0) + elf_hash_table (info)->hgot->root.u.def.value = 0x8000; + } + +- if (htab->elf.sgotplt) ++ if (htab->sgotplt) + { + struct elf_link_hash_entry *got; + got = elf_link_hash_lookup (elf_hash_table (info), +@@ -2313,14 +2305,14 @@ tilepro_elf_size_dynamic_sections (bfd * + entries and there is no refeence to _GLOBAL_OFFSET_TABLE_. */ + if ((got == NULL + || !got->ref_regular_nonweak) +- && (htab->elf.sgotplt->size ++ && (htab->sgotplt->size + == GOTPLT_HEADER_SIZE) +- && (htab->elf.splt == NULL +- || htab->elf.splt->size == 0) +- && (htab->elf.sgot == NULL +- || (htab->elf.sgot->size ++ && (htab->splt == NULL ++ || htab->splt->size == 0) ++ && (htab->sgot == NULL ++ || (htab->sgot->size + == get_elf_backend_data (output_bfd)->got_header_size))) +- htab->elf.sgotplt->size = 0; ++ htab->sgotplt->size = 0; + } + + /* The check_relocs and adjust_dynamic_symbol entry points have +@@ -2331,11 +2323,11 @@ tilepro_elf_size_dynamic_sections (bfd * + if ((s->flags & SEC_LINKER_CREATED) == 0) + continue; + +- if (s == htab->elf.splt +- || s == htab->elf.sgot +- || s == htab->elf.sgotplt +- || s == htab->elf.sdynbss +- || s == htab->elf.sdynrelro) ++ if (s == htab->splt ++ || s == htab->sgot ++ || s == htab->sgotplt ++ || s == htab->sdynbss ++ || s == htab->sdynrelro) + { + /* Strip this section if we don't need it; see the + comment below. */ +@@ -2527,7 +2519,7 @@ tilepro_elf_relocate_section (bfd *outpu + Elf_Internal_Sym *local_syms, + asection **local_sections) + { +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + bfd_vma *local_got_offsets; +@@ -2758,7 +2750,7 @@ tilepro_elf_relocate_section (bfd *outpu + case R_TILEPRO_IMM16_X1_GOT_HA: + /* Relocation is to the entry for this symbol in the global + offset table. */ +- if (htab->elf.sgot == NULL) ++ if (htab->sgot == NULL) + abort (); + + if (h != NULL) +@@ -2792,7 +2784,7 @@ tilepro_elf_relocate_section (bfd *outpu + else + { + bfd_put_32 (output_bfd, relocation, +- htab->elf.sgot->contents + off); ++ htab->sgot->contents + off); + h->got.offset |= 1; + } + } +@@ -2820,11 +2812,11 @@ tilepro_elf_relocate_section (bfd *outpu + + /* We need to generate a R_TILEPRO_RELATIVE reloc + for the dynamic linker. */ +- s = htab->elf.srelgot; ++ s = htab->srelgot; + BFD_ASSERT (s != NULL); + +- outrel.r_offset = (htab->elf.sgot->output_section->vma +- + htab->elf.sgot->output_offset ++ outrel.r_offset = (htab->sgot->output_section->vma ++ + htab->sgot->output_offset + + off); + outrel.r_info = ELF32_R_INFO (0, R_TILEPRO_RELATIVE); + outrel.r_addend = relocation; +@@ -2833,7 +2825,7 @@ tilepro_elf_relocate_section (bfd *outpu + } + + bfd_put_32 (output_bfd, relocation, +- htab->elf.sgot->contents + off); ++ htab->sgot->contents + off); + local_got_offsets[r_symndx] |= 1; + } + } +@@ -2845,7 +2837,7 @@ tilepro_elf_relocate_section (bfd *outpu + procedure linkage table. */ + BFD_ASSERT (h != NULL); + +- if (h->plt.offset == (bfd_vma) -1 || htab->elf.splt == NULL) ++ if (h->plt.offset == (bfd_vma) -1 || htab->splt == NULL) + { + /* We didn't make a PLT entry for this symbol. This + happens when statically linking PIC code, or when +@@ -2853,8 +2845,8 @@ tilepro_elf_relocate_section (bfd *outpu + break; + } + +- relocation = (htab->elf.splt->output_section->vma +- + htab->elf.splt->output_offset ++ relocation = (htab->splt->output_section->vma ++ + htab->splt->output_offset + + h->plt.offset); + unresolved_reloc = FALSE; + break; +@@ -2993,7 +2985,7 @@ tilepro_elf_relocate_section (bfd *outpu + outrel.r_addend = relocation + rel->r_addend; + + if (is_plt) +- sec = htab->elf.splt; ++ sec = htab->splt; + + if (bfd_is_abs_section (sec)) + indx = 0; +@@ -3016,7 +3008,7 @@ tilepro_elf_relocate_section (bfd *outpu + + if (indx == 0) + { +- osec = htab->elf.text_index_section; ++ osec = htab->text_index_section; + indx = elf_section_data (osec)->dynindx; + } + +@@ -3142,7 +3134,7 @@ tilepro_elf_relocate_section (bfd *outpu + local_got_offsets[r_symndx] |= 1; + } + +- if (htab->elf.sgot == NULL) ++ if (htab->sgot == NULL) + abort (); + + if ((off & 1) != 0) +@@ -3153,13 +3145,13 @@ tilepro_elf_relocate_section (bfd *outpu + int indx = 0; + bfd_boolean need_relocs = FALSE; + +- if (htab->elf.srelgot == NULL) ++ if (htab->srelgot == NULL) + abort (); + + if (h != NULL) + { + bfd_boolean dyn; +- dyn = htab->elf.dynamic_sections_created; ++ dyn = htab->dynamic_sections_created; + + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, + bfd_link_pic (info), +@@ -3190,18 +3182,18 @@ tilepro_elf_relocate_section (bfd *outpu + case R_TILEPRO_IMM16_X0_TLS_IE_HA: + case R_TILEPRO_IMM16_X1_TLS_IE_HA: + if (need_relocs) { +- bfd_put_32 (output_bfd, 0, htab->elf.sgot->contents + off); +- outrel.r_offset = (htab->elf.sgot->output_section->vma +- + htab->elf.sgot->output_offset + off); ++ bfd_put_32 (output_bfd, 0, htab->sgot->contents + off); ++ outrel.r_offset = (htab->sgot->output_section->vma ++ + htab->sgot->output_offset + off); + outrel.r_addend = 0; + if (indx == 0) + outrel.r_addend = relocation - dtpoff_base (info); + outrel.r_info = ELF32_R_INFO (indx, R_TILEPRO_TLS_TPOFF32); +- tilepro_elf_append_rela_32 (output_bfd, htab->elf.srelgot, ++ tilepro_elf_append_rela_32 (output_bfd, htab->srelgot, + &outrel); + } else { + bfd_put_32 (output_bfd, tpoff (info, relocation), +- htab->elf.sgot->contents + off); ++ htab->sgot->contents + off); + } + break; + +@@ -3214,31 +3206,31 @@ tilepro_elf_relocate_section (bfd *outpu + case R_TILEPRO_IMM16_X0_TLS_GD_HA: + case R_TILEPRO_IMM16_X1_TLS_GD_HA: + if (need_relocs) { +- outrel.r_offset = (htab->elf.sgot->output_section->vma +- + htab->elf.sgot->output_offset + off); ++ outrel.r_offset = (htab->sgot->output_section->vma ++ + htab->sgot->output_offset + off); + outrel.r_addend = 0; + outrel.r_info = ELF32_R_INFO (indx, R_TILEPRO_TLS_DTPMOD32); +- bfd_put_32 (output_bfd, 0, htab->elf.sgot->contents + off); +- tilepro_elf_append_rela_32 (output_bfd, htab->elf.srelgot, ++ bfd_put_32 (output_bfd, 0, htab->sgot->contents + off); ++ tilepro_elf_append_rela_32 (output_bfd, htab->srelgot, + &outrel); + if (indx == 0) + { + BFD_ASSERT (! unresolved_reloc); + bfd_put_32 (output_bfd, + relocation - dtpoff_base (info), +- (htab->elf.sgot->contents + off + ++ (htab->sgot->contents + off + + TILEPRO_BYTES_PER_WORD)); + } + else + { + bfd_put_32 (output_bfd, 0, +- (htab->elf.sgot->contents + off + ++ (htab->sgot->contents + off + + TILEPRO_BYTES_PER_WORD)); + outrel.r_info = ELF32_R_INFO (indx, + R_TILEPRO_TLS_DTPOFF32); + outrel.r_offset += TILEPRO_BYTES_PER_WORD; + tilepro_elf_append_rela_32 (output_bfd, +- htab->elf.srelgot, &outrel); ++ htab->srelgot, &outrel); + } + } + +@@ -3249,9 +3241,9 @@ tilepro_elf_relocate_section (bfd *outpu + symbol binding locally. Mark it as belonging + to module 1, the executable. */ + bfd_put_32 (output_bfd, 1, +- htab->elf.sgot->contents + off ); ++ htab->sgot->contents + off ); + bfd_put_32 (output_bfd, relocation - dtpoff_base (info), +- htab->elf.sgot->contents + off + ++ htab->sgot->contents + off + + TILEPRO_BYTES_PER_WORD); + } + break; +@@ -3411,7 +3403,7 @@ tilepro_elf_finish_dynamic_symbol (bfd * + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) + { +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); +@@ -3431,9 +3423,9 @@ tilepro_elf_finish_dynamic_symbol (bfd * + + BFD_ASSERT (h->dynindx != -1); + +- splt = htab->elf.splt; +- srela = htab->elf.srelplt; +- sgotplt = htab->elf.sgotplt; ++ splt = htab->splt; ++ srela = htab->srelplt; ++ sgotplt = htab->sgotplt; + + if (splt == NULL || srela == NULL) + abort (); +@@ -3481,8 +3473,8 @@ tilepro_elf_finish_dynamic_symbol (bfd * + + /* This symbol has an entry in the GOT. Set it up. */ + +- sgot = htab->elf.sgot; +- srela = htab->elf.srelgot; ++ sgot = htab->sgot; ++ srela = htab->srelgot; + BFD_ASSERT (sgot != NULL && srela != NULL); + + rela.r_offset = (sgot->output_section->vma +@@ -3528,16 +3520,16 @@ tilepro_elf_finish_dynamic_symbol (bfd * + + h->root.u.def.section->output_offset); + rela.r_info = ELF32_R_INFO (h->dynindx, R_TILEPRO_COPY); + rela.r_addend = 0; +- if (h->root.u.def.section == htab->elf.sdynrelro) +- s = htab->elf.sreldynrelro; ++ if (h->root.u.def.section == htab->sdynrelro) ++ s = htab->sreldynrelro; + else +- s = htab->elf.srelbss; ++ s = htab->srelbss; + tilepro_elf_append_rela_32 (output_bfd, s, &rela); + } + + /* Mark some specially defined symbols as absolute. */ +- if (h == htab->elf.hdynamic +- || (h == htab->elf.hgot || h == htab->elf.hplt)) ++ if (h == htab->hdynamic ++ || (h == htab->hgot || h == htab->hplt)) + sym->st_shndx = SHN_ABS; + + return TRUE; +@@ -3551,7 +3543,7 @@ tilepro_finish_dyn (bfd *output_bfd, str + asection *splt ATTRIBUTE_UNUSED) + { + Elf32_External_Dyn *dyncon, *dynconend; +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); +@@ -3567,15 +3559,15 @@ tilepro_finish_dyn (bfd *output_bfd, str + switch (dyn.d_tag) + { + case DT_PLTGOT: +- s = htab->elf.sgotplt; ++ s = htab->sgotplt; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + break; + case DT_JMPREL: +- s = htab->elf.srelplt; ++ s = htab->srelplt; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + break; + case DT_PLTRELSZ: +- s = htab->elf.srelplt; ++ s = htab->srelplt; + dyn.d_un.d_val = s->size; + break; + default: +@@ -3593,11 +3585,11 @@ tilepro_elf_finish_dynamic_sections (bfd + { + bfd *dynobj; + asection *sdyn; +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); +- dynobj = htab->elf.dynobj; ++ dynobj = htab->dynobj; + + sdyn = bfd_get_linker_section (dynobj, ".dynamic"); + +@@ -3606,7 +3598,7 @@ tilepro_elf_finish_dynamic_sections (bfd + asection *splt; + bfd_boolean ret; + +- splt = htab->elf.splt; ++ splt = htab->splt; + BFD_ASSERT (splt != NULL && sdyn != NULL); + + ret = tilepro_finish_dyn (output_bfd, info, dynobj, sdyn, splt); +@@ -3627,42 +3619,42 @@ tilepro_elf_finish_dynamic_sections (bfd + = PLT_ENTRY_SIZE; + } + +- if (htab->elf.sgotplt) ++ if (htab->sgotplt) + { +- if (bfd_is_abs_section (htab->elf.sgotplt->output_section)) ++ if (bfd_is_abs_section (htab->sgotplt->output_section)) + { + _bfd_error_handler +- (_("discarded output section: `%pA'"), htab->elf.sgotplt); ++ (_("discarded output section: `%pA'"), htab->sgotplt); + return FALSE; + } + +- if (htab->elf.sgotplt->size > 0) ++ if (htab->sgotplt->size > 0) + { + /* Write the first two entries in .got.plt, needed for the dynamic + linker. */ + bfd_put_32 (output_bfd, (bfd_vma) -1, +- htab->elf.sgotplt->contents); ++ htab->sgotplt->contents); + bfd_put_32 (output_bfd, (bfd_vma) 0, +- htab->elf.sgotplt->contents + GOT_ENTRY_SIZE); ++ htab->sgotplt->contents + GOT_ENTRY_SIZE); + } + +- elf_section_data (htab->elf.sgotplt->output_section)->this_hdr.sh_entsize ++ elf_section_data (htab->sgotplt->output_section)->this_hdr.sh_entsize + = GOT_ENTRY_SIZE; + } + +- if (htab->elf.sgot) ++ if (htab->sgot) + { +- if (htab->elf.sgot->size > 0) ++ if (htab->sgot->size > 0) + { + /* Set the first entry in the global offset table to the address of + the dynamic section. */ + bfd_vma val = (sdyn ? + sdyn->output_section->vma + sdyn->output_offset : + 0); +- bfd_put_32 (output_bfd, val, htab->elf.sgot->contents); ++ bfd_put_32 (output_bfd, val, htab->sgot->contents); + } + +- elf_section_data (htab->elf.sgot->output_section)->this_hdr.sh_entsize ++ elf_section_data (htab->sgot->output_section)->this_hdr.sh_entsize + = GOT_ENTRY_SIZE; + } + +diff -rup binutils.orig/bfd/elf64-ppc.c binutils-2.35/bfd/elf64-ppc.c +--- binutils.orig/bfd/elf64-ppc.c 2020-07-30 08:41:25.038236414 +0100 ++++ binutils-2.35/bfd/elf64-ppc.c 2020-07-30 09:06:39.400533827 +0100 +@@ -3250,9 +3250,6 @@ struct ppc_link_hash_table + + /* Incremented every time we size stubs. */ + unsigned int stub_iteration; +- +- /* Small local sym cache. */ +- struct sym_cache sym_cache; + }; + + /* Rename some of the generic section flags to better document how they +@@ -4383,7 +4380,8 @@ ppc64_elf_before_check_relocs (bfd *ibfd + Elf_Internal_Sym *isym; + asection *s; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, r_symndx); ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, ibfd, ++ r_symndx); + if (isym == NULL) + { + if (elf_section_data (opd)->relocs != relocs) +@@ -4684,7 +4682,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc + } + else + { +- Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -4955,7 +4953,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc + { + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -5231,7 +5229,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf64-s390.c binutils-2.35/bfd/elf64-s390.c +--- binutils.orig/bfd/elf64-s390.c 2020-07-30 08:41:25.044236375 +0100 ++++ binutils-2.35/bfd/elf64-s390.c 2020-07-30 09:06:39.400533827 +0100 +@@ -663,9 +663,6 @@ struct elf_s390_link_hash_table + bfd_vma offset; + } tls_ldm_got; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Options passed from the linker. */ + struct s390_elf_params *params; + }; +@@ -852,7 +849,7 @@ elf_s390_check_relocs (bfd *abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -1216,7 +1213,7 @@ elf_s390_check_relocs (bfd *abfd, + asection *s; + void *vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -2258,7 +2255,7 @@ elf_s390_relocate_section (bfd *output_b + & 0xff00f000) == 0xe300c000 + && bfd_get_8 (input_bfd, + contents + rel->r_offset + 3) == 0x04)) +- && (isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ && (isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + input_bfd, r_symndx)) + && isym->st_shndx != SHN_ABS + && h != htab->elf.hdynamic +@@ -3572,7 +3569,7 @@ elf_s390_finish_dynamic_sections (bfd *o + if (local_plt[i].plt.offset != (bfd_vma) -1) + { + asection *sec = local_plt[i].sec; +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, i); ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, ibfd, i); + if (isym == NULL) + return FALSE; + +diff -rup binutils.orig/bfd/elf64-x86-64.c binutils-2.35/bfd/elf64-x86-64.c +--- binutils.orig/bfd/elf64-x86-64.c 2020-07-30 08:41:25.040236401 +0100 ++++ binutils-2.35/bfd/elf64-x86-64.c 2020-07-30 09:06:39.401533821 +0100 +@@ -1371,7 +1371,7 @@ elf_x86_64_tls_transition (struct bfd_li + { + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + name = bfd_elf_sym_name (abfd, symtab_hdr, isym, NULL); + } +@@ -1559,7 +1559,7 @@ elf_x86_64_convert_load_reloc (bfd *abfd + if (h == NULL) + { + Elf_Internal_Sym *isym +- = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx); ++ = bfd_sym_from_r_symndx (&htab->elf.sym_cache, abfd, r_symndx); + + /* Skip relocation against undefined symbols. */ + if (isym->st_shndx == SHN_UNDEF) +@@ -1907,7 +1907,7 @@ elf_x86_64_check_relocs (bfd *abfd, stru + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + goto error_return; +@@ -2308,7 +2308,7 @@ elf_x86_64_check_relocs (bfd *abfd, stru + asection *s; + void **vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + goto error_return; +diff -rup binutils.orig/bfd/elflink.c binutils-2.35/bfd/elflink.c +--- binutils.orig/bfd/elflink.c 2020-07-30 08:41:25.055236303 +0100 ++++ binutils-2.35/bfd/elflink.c 2020-07-30 09:06:39.401533821 +0100 +@@ -1228,6 +1228,17 @@ _bfd_elf_merge_symbol (bfd *abfd, + return TRUE; + } + ++ /* After all LTO IR symbols have been read, skip all undefined ++ symbols without relocation. */ ++ if (info->lto_all_symbols_read ++ && bfd_is_und_section (sec) ++ && (abfd->flags & DYNAMIC) == 0 ++ && !h->has_reloc_after_lto_all_symbols_read) ++ { ++ *skip = TRUE; ++ return TRUE; ++ } ++ + /* In cases involving weak versioned symbols, we may wind up trying + to merge a symbol with itself. Catch that here, to avoid the + confusion that results if we try to override a symbol with +@@ -4545,6 +4556,93 @@ elf_link_add_object_symbols (bfd *abfd, + (_("%pB: plugin needed to handle lto object"), abfd); + } + ++ /* Normally an undefined symbol is treated as a reference. Linker ++ will try to satisfy the reference. This feature is used to bring ++ a symbol definition into output without explicit relocation. If ++ there is no definition nor relocation, linker will remove undefined ++ symbol from symbol table in output (PR ld/4317). But GCC 10 LTO ++ may generate separate debug info files which contain undefined ++ symbols without relocations: ++ ++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96385 ++ ++ After all LTO IR symbols have been read, if there is a dinition in ++ LTO IR object, there is no relocation, and there is a definition ++ in a shared object, linker may resolve the undefined symbol to the ++ discarded section in LTO IR object. To avoid it, after all LTO IR ++ symbols have been read, skip undefined symbols without relocation. ++ */ ++ if (info->lto_all_symbols_read ++ && !bfd_link_relocatable (info) ++ && (abfd->flags & DYNAMIC) == 0 ++ && !just_syms ++ && extsymcount) ++ { ++ int r_sym_shift; ++ struct elf_link_hash_entry *h; ++ const char *name; ++ ++ if (bed->s->arch_size == 32) ++ r_sym_shift = 8; ++ else ++ r_sym_shift = 32; ++ ++ for (s = abfd->sections; s != NULL; s = s->next) ++ { ++ Elf_Internal_Rela *internal_relocs; ++ Elf_Internal_Rela *rel, *relend; ++ ++ /* Don't check relocations in excluded sections. */ ++ if ((s->flags & SEC_RELOC) == 0 ++ || s->reloc_count == 0 ++ || (s->flags & SEC_EXCLUDE) != 0 ++ || ((info->strip == strip_all ++ || info->strip == strip_debugger) ++ && (s->flags & SEC_DEBUGGING) != 0)) ++ continue; ++ ++ internal_relocs = _bfd_elf_link_read_relocs (abfd, s, NULL, ++ NULL, ++ info->keep_memory); ++ if (internal_relocs == NULL) ++ goto error_free_vers; ++ ++ rel = internal_relocs; ++ relend = rel + s->reloc_count; ++ for ( ; rel < relend; rel++) ++ { ++ unsigned long r_symndx = rel->r_info >> r_sym_shift; ++ ++ /* Skip local symbols. */ ++ if (r_symndx < extsymoff) ++ continue; ++ ++ isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, ++ r_symndx); ++ if (isym->st_shndx == SHN_UNDEF) ++ { ++ name = bfd_elf_string_from_elf_section (abfd, ++ hdr->sh_link, ++ isym->st_name); ++ h = ((struct elf_link_hash_entry *) ++ bfd_wrapped_link_hash_lookup (abfd, info, name, ++ TRUE, FALSE, ++ FALSE)); ++ if (h != NULL) ++ { ++ while (h->root.type == bfd_link_hash_indirect ++ || h->root.type == bfd_link_hash_warning) ++ h = (struct elf_link_hash_entry *) h->root.u.i.link; ++ h->has_reloc_after_lto_all_symbols_read = TRUE; ++ } ++ } ++ } ++ ++ if (elf_section_data (s)->relocs != internal_relocs) ++ free (internal_relocs); ++ } ++ } ++ + for (isym = isymbuf, isymend = isymbuf + extsymcount; + isym < isymend; + isym++, sym_hash++, ever = (ever != NULL ? ever + 1 : NULL)) +diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.35/bfd/elfnn-aarch64.c +--- binutils.orig/bfd/elfnn-aarch64.c 2020-07-30 08:41:25.046236362 +0100 ++++ binutils-2.35/bfd/elfnn-aarch64.c 2020-07-30 09:06:39.402533814 +0100 +@@ -2643,9 +2643,6 @@ struct elf_aarch64_link_hash_table + /* The bytes of the subsequent PLT entry. */ + const bfd_byte *plt_entry; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* For convenience in allocate_dynrelocs. */ + bfd *obfd; + +@@ -7611,7 +7608,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, s + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -7838,7 +7835,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, s + asection *s; + void **vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +Only in binutils-2.35/bfd: elfnn-aarch64.c.orig +diff -rup binutils.orig/bfd/elfnn-riscv.c binutils-2.35/bfd/elfnn-riscv.c +--- binutils.orig/bfd/elfnn-riscv.c 2020-07-30 08:41:25.039236408 +0100 ++++ binutils-2.35/bfd/elfnn-riscv.c 2020-07-30 09:06:39.402533814 +0100 +@@ -113,9 +113,6 @@ struct riscv_elf_link_hash_table + /* Short-cuts to get to dynamic linker sections. */ + asection *sdyntdata; + +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_cache; +- + /* The max alignment of output sections. */ + bfd_vma max_alignment; + }; +@@ -681,7 +678,7 @@ riscv_elf_check_relocs (bfd *abfd, struc + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elfxx-mips.c binutils-2.35/bfd/elfxx-mips.c +--- binutils.orig/bfd/elfxx-mips.c 2020-07-30 08:41:25.051236329 +0100 ++++ binutils-2.35/bfd/elfxx-mips.c 2020-07-30 09:06:39.403533808 +0100 +@@ -527,9 +527,6 @@ struct mips_elf_link_hash_table + returns null. */ + asection *(*add_stub_section) (const char *, asection *, asection *); + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Is the PLT header compressed? */ + unsigned int plt_header_is_comp : 1; + }; +@@ -4401,7 +4398,7 @@ mips_elf_resolve_got_page_ref (void **re + Elf_Internal_Sym *isym; + + /* Read in the symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ref->u.abfd, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, ref->u.abfd, + ref->symndx); + if (isym == NULL) + { +diff -rup binutils.orig/bfd/elfxx-sparc.c binutils-2.35/bfd/elfxx-sparc.c +--- binutils.orig/bfd/elfxx-sparc.c 2020-07-30 08:41:25.035236434 +0100 ++++ binutils-2.35/bfd/elfxx-sparc.c 2020-07-30 09:06:39.404533801 +0100 +@@ -1391,7 +1391,8 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx); ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, abfd, ++ r_symndx); + if (isym == NULL) + return FALSE; + +diff -rup binutils.orig/bfd/elfxx-sparc.h binutils-2.35/bfd/elfxx-sparc.h +--- binutils.orig/bfd/elfxx-sparc.h 2020-07-30 08:41:25.042236388 +0100 ++++ binutils-2.35/bfd/elfxx-sparc.h 2020-07-30 09:06:39.404533801 +0100 +@@ -55,9 +55,6 @@ struct _bfd_sparc_elf_link_hash_table + bfd_vma offset; + } tls_ldm_got; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Used by local STT_GNU_IFUNC symbols. */ + htab_t loc_hash_table; + void *loc_hash_memory; +diff -rup binutils.orig/bfd/elfxx-tilegx.c binutils-2.35/bfd/elfxx-tilegx.c +--- binutils.orig/bfd/elfxx-tilegx.c 2020-07-30 08:41:25.037236421 +0100 ++++ binutils-2.35/bfd/elfxx-tilegx.c 2020-07-30 09:06:39.404533801 +0100 +@@ -835,9 +835,6 @@ struct tilegx_elf_link_hash_table + /* Whether LE transition has been disabled for some of the + sections. */ + bfd_boolean disable_le_transition; +- +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_cache; + }; + + +@@ -1979,7 +1976,7 @@ tilegx_elf_check_relocs (bfd *abfd, stru + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elfxx-x86.h binutils-2.35/bfd/elfxx-x86.h +--- binutils.orig/bfd/elfxx-x86.h 2020-07-30 08:41:25.052236322 +0100 ++++ binutils-2.35/bfd/elfxx-x86.h 2020-07-30 09:06:39.404533801 +0100 +@@ -468,9 +468,6 @@ struct elf_x86_link_hash_table + /* The amount of space used by the jump slots in the GOT. */ + bfd_vma sgotplt_jump_table_size; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* _TLS_MODULE_BASE_ symbol. */ + struct bfd_link_hash_entry *tls_module_base; + +Only in binutils.orig: binutils-2.35 +diff -rup binutils.orig/gas/as.c binutils-2.35/gas/as.c +--- binutils.orig/gas/as.c 2020-07-30 08:41:25.034236441 +0100 ++++ binutils-2.35/gas/as.c 2020-07-30 09:05:24.370019859 +0100 +@@ -103,7 +103,7 @@ int verbose = 0; + int flag_dwarf_cie_version = -1; + + /* The maximum level of DWARF DEBUG information we should manufacture. */ +-unsigned int dwarf_level = 0; ++unsigned int dwarf_level = 4; + + #if defined OBJ_ELF || defined OBJ_MAYBE_ELF + int flag_use_elf_stt_common = DEFAULT_GENERATE_ELF_STT_COMMON; diff --git a/patches/binutils/2.35/binutils-SHF_LINK_ORDER.patch b/patches/binutils/2.35/binutils-SHF_LINK_ORDER.patch new file mode 100644 index 00000000..98a8a627 --- /dev/null +++ b/patches/binutils/2.35/binutils-SHF_LINK_ORDER.patch @@ -0,0 +1,223 @@ +diff -rup binutils.orig/bfd/bfd-in2.h binutils-2.35.1/bfd/bfd-in2.h +--- binutils.orig/bfd/bfd-in2.h 2021-01-04 13:18:10.234368481 +0000 ++++ binutils-2.35.1/bfd/bfd-in2.h 2021-01-04 13:18:20.596301287 +0000 +@@ -1177,6 +1177,9 @@ typedef struct bfd_section + struct bfd_symbol *symbol; + struct bfd_symbol **symbol_ptr_ptr; + ++ /* The matching section name pattern in linker script. */ ++ const char *pattern; ++ + /* Early in the link process, map_head and map_tail are used to build + a list of input sections attached to an output section. Later, + output sections use these fields for a list of bfd_link_order +@@ -1370,8 +1373,8 @@ discarded_section (const asection *sec) + /* target_index, used_by_bfd, constructor_chain, owner, */ \ + 0, NULL, NULL, NULL, \ + \ +- /* symbol, symbol_ptr_ptr, */ \ +- (struct bfd_symbol *) SYM, &SEC.symbol, \ ++ /* symbol, symbol_ptr_ptr, pattern, */ \ ++ (struct bfd_symbol *) SYM, &SEC.symbol, NULL, \ + \ + /* map_head, map_tail, already_assigned */ \ + { NULL }, { NULL }, NULL \ +diff -rup binutils.orig/bfd/elflink.c binutils-2.35.1/bfd/elflink.c +--- binutils.orig/bfd/elflink.c 2021-01-04 13:18:10.223368552 +0000 ++++ binutils-2.35.1/bfd/elflink.c 2021-01-04 13:18:20.599301268 +0000 +@@ -11662,8 +11662,21 @@ compare_link_order (const void *a, const + const struct bfd_link_order *blo = *(const struct bfd_link_order **) b; + asection *asec = elf_linked_to_section (alo->u.indirect.section); + asection *bsec = elf_linked_to_section (blo->u.indirect.section); +- bfd_vma apos = asec->output_section->lma + asec->output_offset; +- bfd_vma bpos = bsec->output_section->lma + bsec->output_offset; ++ bfd_vma apos, bpos; ++ ++ /* Check if any sections are unordered. */ ++ if (asec == NULL || bsec == NULL) ++ { ++ /* Place ordered sections before unordered sections. */ ++ if (bsec != NULL) ++ return 1; ++ else if (asec != NULL) ++ return -1; ++ return 0; ++ } ++ ++ apos = asec->output_section->lma + asec->output_offset; ++ bpos = bsec->output_section->lma + bsec->output_offset; + + if (apos < bpos) + return -1; +@@ -11698,14 +11711,14 @@ compare_link_order (const void *a, const + sections. Ideally we'd do this in the linker proper. */ + + static bfd_boolean +-elf_fixup_link_order (bfd *abfd, asection *o) ++elf_fixup_link_order (struct bfd_link_info *info, bfd *abfd, asection *o) + { + size_t seen_linkorder; + size_t seen_other; + size_t n; + struct bfd_link_order *p; + bfd *sub; +- struct bfd_link_order **sections; ++ struct bfd_link_order **sections, **indirect_sections; + asection *other_sec, *linkorder_sec; + bfd_vma offset; /* Octets. */ + +@@ -11736,7 +11749,9 @@ elf_fixup_link_order (bfd *abfd, asectio + else + seen_other++; + +- if (seen_other && seen_linkorder) ++ /* Allow mixed ordered and unordered input sections for ++ non-relocatable link. */ ++ if (bfd_link_relocatable (info) && seen_other && seen_linkorder) + { + if (other_sec && linkorder_sec) + _bfd_error_handler +@@ -11756,6 +11771,10 @@ elf_fixup_link_order (bfd *abfd, asectio + if (!seen_linkorder) + return TRUE; + ++ /* Non-relocatable output can have both ordered and unordered input ++ sections. */ ++ seen_linkorder += seen_other; ++ + sections = bfd_malloc (seen_linkorder * sizeof (*sections)); + if (sections == NULL) + return FALSE; +@@ -11764,22 +11783,51 @@ elf_fixup_link_order (bfd *abfd, asectio + for (p = o->map_head.link_order; p != NULL; p = p->next) + sections[seen_linkorder++] = p; + +- /* Sort the input sections in the order of their linked section. */ +- qsort (sections, seen_linkorder, sizeof (*sections), compare_link_order); ++ for (indirect_sections = sections, n = 0; n < seen_linkorder;) ++ { ++ /* Find the first bfd_indirect_link_order section. */ ++ if (indirect_sections[0]->type == bfd_indirect_link_order) ++ { ++ /* Count the consecutive bfd_indirect_link_order sections ++ with the same pattern. */ ++ size_t i, n_indirect; ++ const char *pattern ++ = indirect_sections[0]->u.indirect.section->pattern; ++ for (i = n + 1; i < seen_linkorder; i++) ++ if (sections[i]->type != bfd_indirect_link_order ++ || sections[i]->u.indirect.section->pattern != pattern) ++ break; ++ n_indirect = i - n; ++ /* Sort the bfd_indirect_link_order sections in the order of ++ their linked section. */ ++ qsort (indirect_sections, n_indirect, sizeof (*sections), ++ compare_link_order); ++ indirect_sections += n_indirect; ++ n += n_indirect; ++ } ++ else ++ { ++ indirect_sections++; ++ n++; ++ } ++ } + +- /* Change the offsets of the sections. */ ++ /* Change the offsets of the bfd_indirect_link_order sections. */ + offset = 0; + for (n = 0; n < seen_linkorder; n++) +- { +- bfd_vma mask; +- asection *s = sections[n]->u.indirect.section; +- unsigned int opb = bfd_octets_per_byte (abfd, s); +- +- mask = ~(bfd_vma) 0 << s->alignment_power * opb; +- offset = (offset + ~mask) & mask; +- sections[n]->offset = s->output_offset = offset / opb; +- offset += sections[n]->size; +- } ++ if (sections[n]->type == bfd_indirect_link_order) ++ { ++ bfd_vma mask; ++ asection *s = sections[n]->u.indirect.section; ++ unsigned int opb = bfd_octets_per_byte (abfd, s); ++ ++ mask = ~(bfd_vma) 0 << s->alignment_power * opb; ++ offset = (offset + ~mask) & mask; ++ sections[n]->offset = s->output_offset = offset / opb; ++ offset += sections[n]->size; ++ } ++ else ++ offset = sections[n]->offset + sections[n]->size; + + free (sections); + return TRUE; +@@ -12408,7 +12456,7 @@ bfd_elf_final_link (bfd *abfd, struct bf + /* Reorder SHF_LINK_ORDER sections. */ + for (o = abfd->sections; o != NULL; o = o->next) + { +- if (!elf_fixup_link_order (abfd, o)) ++ if (!elf_fixup_link_order (info, abfd, o)) + return FALSE; + } + +diff -rup binutils.orig/bfd/section.c binutils-2.35.1/bfd/section.c +--- binutils.orig/bfd/section.c 2021-01-04 13:18:10.233368487 +0000 ++++ binutils-2.35.1/bfd/section.c 2021-01-04 13:18:20.599301268 +0000 +@@ -541,6 +541,9 @@ CODE_FRAGMENT + . struct bfd_symbol *symbol; + . struct bfd_symbol **symbol_ptr_ptr; + . ++. {* The matching section name pattern in linker script. *} ++. const char *pattern; ++. + . {* Early in the link process, map_head and map_tail are used to build + . a list of input sections attached to an output section. Later, + . output sections use these fields for a list of bfd_link_order +@@ -734,8 +737,8 @@ CODE_FRAGMENT + . {* target_index, used_by_bfd, constructor_chain, owner, *} \ + . 0, NULL, NULL, NULL, \ + . \ +-. {* symbol, symbol_ptr_ptr, *} \ +-. (struct bfd_symbol *) SYM, &SEC.symbol, \ ++. {* symbol, symbol_ptr_ptr, pattern, *} \ ++. (struct bfd_symbol *) SYM, &SEC.symbol, NULL, \ + . \ + . {* map_head, map_tail, already_assigned *} \ + . { NULL }, { NULL }, NULL \ +diff -rup binutils.orig/gas/config/obj-elf.c binutils-2.35.1/gas/config/obj-elf.c +--- binutils.orig/gas/config/obj-elf.c 2021-01-04 13:18:09.942370375 +0000 ++++ binutils-2.35.1/gas/config/obj-elf.c 2021-01-04 13:18:20.599301268 +0000 +@@ -659,7 +659,9 @@ obj_elf_change_section (const char *name + } + } + +- if (old_sec == NULL && ((attr & ~(SHF_MASKOS | SHF_MASKPROC)) ++ if (old_sec == NULL && ((attr & ~(SHF_LINK_ORDER ++ | SHF_MASKOS ++ | SHF_MASKPROC)) + & ~ssect->attr) != 0) + { + /* As a GNU extension, we permit a .note section to be +diff -rup binutils.orig/ld/ldlang.c binutils-2.35.1/ld/ldlang.c +--- binutils.orig/ld/ldlang.c 2021-01-04 13:18:09.691372002 +0000 ++++ binutils-2.35.1/ld/ldlang.c 2021-01-04 13:18:20.600301261 +0000 +@@ -7421,7 +7421,7 @@ lang_reset_memory_regions (void) + + static void + gc_section_callback (lang_wild_statement_type *ptr, +- struct wildcard_list *sec ATTRIBUTE_UNUSED, ++ struct wildcard_list *sec, + asection *section, + struct flag_info *sflag_info ATTRIBUTE_UNUSED, + lang_input_statement_type *file ATTRIBUTE_UNUSED, +@@ -7431,6 +7431,8 @@ gc_section_callback (lang_wild_statement + should be as well. */ + if (ptr->keep_sections) + section->flags |= SEC_KEEP; ++ if (sec) ++ section->pattern = sec->spec.name; + } + + /* Iterate over sections marking them against GC. */ diff --git a/patches/binutils/2.35/binutils-aarch64-condbranch-relocs.patch b/patches/binutils/2.35/binutils-aarch64-condbranch-relocs.patch new file mode 100644 index 00000000..b12070fa --- /dev/null +++ b/patches/binutils/2.35/binutils-aarch64-condbranch-relocs.patch @@ -0,0 +1,93 @@ +diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.35/bfd/elfnn-aarch64.c +--- binutils.orig/bfd/elfnn-aarch64.c 2020-09-10 17:03:31.738458044 +0100 ++++ binutils-2.35/bfd/elfnn-aarch64.c 2020-09-10 17:04:03.643344898 +0100 +@@ -5445,7 +5445,6 @@ elfNN_aarch64_final_link_relocate (reloc + bfd_vma orig_value = value; + bfd_boolean resolved_to_zero; + bfd_boolean abs_symbol_p; +- bfd_boolean via_plt_p; + + globals = elf_aarch64_hash_table (info); + +@@ -5467,8 +5466,6 @@ elfNN_aarch64_final_link_relocate (reloc + : bfd_is_und_section (sym_sec)); + abs_symbol_p = h != NULL && bfd_is_abs_symbol (&h->root); + +- via_plt_p = (globals->root.splt != NULL && h != NULL +- && h->plt.offset != (bfd_vma) - 1); + + /* Since STT_GNU_IFUNC symbol must go through PLT, we handle + it here if it is defined in a non-shared object. */ +@@ -5805,23 +5802,12 @@ elfNN_aarch64_final_link_relocate (reloc + value += signed_addend; + break; + +- case BFD_RELOC_AARCH64_BRANCH19: +- case BFD_RELOC_AARCH64_TSTBR14: +- /* A conditional branch to an undefined weak symbol is converted to a +- branch to itself. */ +- if (weak_undef_p && !via_plt_p) +- { +- value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type, +- place, value, +- signed_addend, +- weak_undef_p); +- break; +- } +- /* Fall through. */ + case BFD_RELOC_AARCH64_CALL26: + case BFD_RELOC_AARCH64_JUMP26: + { + asection *splt = globals->root.splt; ++ bfd_boolean via_plt_p = ++ splt != NULL && h != NULL && h->plt.offset != (bfd_vma) - 1; + + /* A call to an undefined weak symbol is converted to a jump to + the next instruction unless a PLT entry will be created. +@@ -5902,6 +5888,23 @@ elfNN_aarch64_final_link_relocate (reloc + bfd_set_error (bfd_error_bad_value); + return bfd_reloc_notsupported; + } ++ value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type, ++ place, value, ++ signed_addend, ++ weak_undef_p); ++ break; ++ ++ case BFD_RELOC_AARCH64_BRANCH19: ++ case BFD_RELOC_AARCH64_TSTBR14: ++ if (h && h->root.type == bfd_link_hash_undefined) ++ { ++ _bfd_error_handler ++ /* xgettext:c-format */ ++ (_("%pB: conditional branch to undefined symbol `%s' " ++ "not allowed"), input_bfd, h->root.root.string); ++ bfd_set_error (bfd_error_bad_value); ++ return bfd_reloc_notsupported; ++ } + /* Fall through. */ + + case BFD_RELOC_AARCH64_16: +@@ -7967,8 +7970,6 @@ elfNN_aarch64_check_relocs (bfd *abfd, s + break; + } + +- case BFD_RELOC_AARCH64_BRANCH19: +- case BFD_RELOC_AARCH64_TSTBR14: + case BFD_RELOC_AARCH64_CALL26: + case BFD_RELOC_AARCH64_JUMP26: + /* If this is a local symbol then we resolve it +Only in binutils-2.35/bfd: elfnn-aarch64.c.orig +diff -rup binutils.orig/ld/testsuite/ld-aarch64/emit-relocs-560.d binutils-2.35/ld/testsuite/ld-aarch64/emit-relocs-560.d +--- binutils.orig/ld/testsuite/ld-aarch64/emit-relocs-560.d 2020-09-10 17:03:31.067460424 +0100 ++++ binutils-2.35/ld/testsuite/ld-aarch64/emit-relocs-560.d 2020-09-10 17:04:03.644344895 +0100 +@@ -1,8 +1,3 @@ + #source: emit-relocs-560.s + #ld: -shared +-#readelf: -r +- +-Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 2 entries: +- Offset Info Type Sym. Value Sym. Name \+ Addend +-[0-9a-f]+ 000100000402 R_AARCH64_JUMP_SL 0000000000000000 baz \+ 0 +-[0-9a-f]+ 000200000402 R_AARCH64_JUMP_SL 0000000000000000 bar \+ 0 ++#error: .*: conditional branch to undefined symbol `bar' not allowed diff --git a/patches/binutils/2.35/binutils-add-sym-cache-to-elf-link-hash.patch b/patches/binutils/2.35/binutils-add-sym-cache-to-elf-link-hash.patch new file mode 100644 index 00000000..85b2006e --- /dev/null +++ b/patches/binutils/2.35/binutils-add-sym-cache-to-elf-link-hash.patch @@ -0,0 +1,1981 @@ +diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.35/bfd/elf-bfd.h +--- binutils.orig/bfd/elf-bfd.h 2020-07-30 15:04:05.366466702 +0100 ++++ binutils-2.35/bfd/elf-bfd.h 2020-07-30 15:04:16.707393960 +0100 +@@ -549,6 +549,16 @@ enum elf_target_os + is_nacl /* Native Client. */ + }; + ++/* Used by bfd_sym_from_r_symndx to cache a small number of local ++ symbols. */ ++#define LOCAL_SYM_CACHE_SIZE 32 ++struct sym_cache ++{ ++ bfd *abfd; ++ unsigned long indx[LOCAL_SYM_CACHE_SIZE]; ++ Elf_Internal_Sym sym[LOCAL_SYM_CACHE_SIZE]; ++}; ++ + /* ELF linker hash table. */ + + struct elf_link_hash_table +@@ -676,6 +686,9 @@ struct elf_link_hash_table + /* A linked list of dynamic BFD's loaded in the link. */ + struct elf_link_loaded_list *dyn_loaded; + ++ /* Small local sym cache. */ ++ struct sym_cache sym_cache; ++ + /* Short-cuts to get to dynamic linker sections. */ + asection *sgot; + asection *sgotplt; +@@ -717,16 +730,6 @@ struct elf_link_hash_table + /* Returns TRUE if the hash table is a struct elf_link_hash_table. */ + #define is_elf_hash_table(htab) \ + (((struct bfd_link_hash_table *) (htab))->type == bfd_link_elf_hash_table) +- +-/* Used by bfd_sym_from_r_symndx to cache a small number of local +- symbols. */ +-#define LOCAL_SYM_CACHE_SIZE 32 +-struct sym_cache +-{ +- bfd *abfd; +- unsigned long indx[LOCAL_SYM_CACHE_SIZE]; +- Elf_Internal_Sym sym[LOCAL_SYM_CACHE_SIZE]; +-}; + + /* Constant information held for an ELF backend. */ + +diff -rup binutils.orig/bfd/elf32-arm.c binutils-2.35/bfd/elf32-arm.c +--- binutils.orig/bfd/elf32-arm.c 2020-07-30 15:04:05.376466638 +0100 ++++ binutils-2.35/bfd/elf32-arm.c 2020-07-30 15:04:16.708393953 +0100 +@@ -3390,9 +3390,6 @@ struct elf32_arm_link_hash_table + bfd_vma offset; + } tls_ldm_got; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* For convenience in allocate_dynrelocs. */ + bfd * obfd; + +@@ -15316,7 +15313,7 @@ elf32_arm_check_relocs (bfd *abfd, struc + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -16871,7 +16868,8 @@ elf32_arm_size_dynamic_sections (bfd * o + s->size += 4; + } + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, symndx); ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, ibfd, ++ symndx); + if (isym == NULL) + return FALSE; + +diff -rup binutils.orig/bfd/elf32-bfin.c binutils-2.35/bfd/elf32-bfin.c +--- binutils.orig/bfd/elf32-bfin.c 2020-07-30 15:04:05.377466632 +0100 ++++ binutils-2.35/bfd/elf32-bfin.c 2020-07-30 15:04:16.709393947 +0100 +@@ -4791,16 +4791,6 @@ struct bfin_link_hash_entry + struct bfin_pcrel_relocs_copied *pcrel_relocs_copied; + }; + +-/* bfin ELF linker hash table. */ +- +-struct bfin_link_hash_table +-{ +- struct elf_link_hash_table root; +- +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +-}; +- + #define bfin_hash_entry(ent) ((struct bfin_link_hash_entry *) (ent)) + + static struct bfd_hash_entry * +@@ -4829,15 +4819,14 @@ bfin_link_hash_newfunc (struct bfd_hash_ + static struct bfd_link_hash_table * + bfin_link_hash_table_create (bfd * abfd) + { +- struct bfin_link_hash_table *ret; +- size_t amt = sizeof (struct bfin_link_hash_table); ++ struct elf_link_hash_table *ret; ++ size_t amt = sizeof (struct elf_link_hash_table); + + ret = bfd_zmalloc (amt); + if (ret == NULL) + return NULL; + +- if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, +- bfin_link_hash_newfunc, ++ if (!_bfd_elf_link_hash_table_init (ret, abfd, bfin_link_hash_newfunc, + sizeof (struct elf_link_hash_entry), + BFIN_ELF_DATA)) + { +@@ -4845,9 +4834,7 @@ bfin_link_hash_table_create (bfd * abfd) + return NULL; + } + +- ret->sym_cache.abfd = NULL; +- +- return &ret->root.root; ++ return &ret->root; + } + + /* The size in bytes of an entry in the procedure linkage table. */ +@@ -5418,10 +5405,6 @@ struct bfd_elf_special_section const elf + + #define bfd_elf32_bfd_is_local_label_name \ + bfin_is_local_label_name +-#define bfin_hash_table(p) \ +- ((struct bfin_link_hash_table *) (p)->hash) +- +- + + #define elf_backend_create_dynamic_sections \ + _bfd_elf_create_dynamic_sections +diff -rup binutils.orig/bfd/elf32-csky.c binutils-2.35/bfd/elf32-csky.c +--- binutils.orig/bfd/elf32-csky.c 2020-07-30 15:04:05.378466625 +0100 ++++ binutils-2.35/bfd/elf32-csky.c 2020-07-30 15:04:16.709393947 +0100 +@@ -1208,9 +1208,6 @@ struct csky_elf_link_hash_table + { + struct elf_link_hash_table elf; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Data for R_CKCORE_TLS_LDM32 relocations. */ + union + { +@@ -2477,7 +2474,7 @@ csky_elf_check_relocs (bfd * abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -2584,7 +2581,7 @@ csky_elf_check_relocs (bfd * abfd, + asection *s; + Elf_Internal_Sym *loc_isym; + +- loc_isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ loc_isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (loc_isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-hppa.c binutils-2.35/bfd/elf32-hppa.c +--- binutils.orig/bfd/elf32-hppa.c 2020-07-30 15:04:05.368466689 +0100 ++++ binutils-2.35/bfd/elf32-hppa.c 2020-07-30 15:04:16.709393947 +0100 +@@ -286,9 +286,6 @@ struct elf32_hppa_link_hash_table + /* Set if we need a .plt stub to support lazy dynamic linking. */ + unsigned int need_plt_stub:1; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Data for LDM relocations. */ + union + { +@@ -1465,7 +1462,7 @@ elf32_hppa_check_relocs (bfd *abfd, + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->etab.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -4038,7 +4035,7 @@ elf32_hppa_relocate_section (bfd *output + else + { + Elf_Internal_Sym *isym +- = bfd_sym_from_r_symndx (&htab->sym_cache, ++ = bfd_sym_from_r_symndx (&htab->etab.sym_cache, + input_bfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-i386.c binutils-2.35/bfd/elf32-i386.c +--- binutils.orig/bfd/elf32-i386.c 2020-07-30 15:04:05.380466612 +0100 ++++ binutils-2.35/bfd/elf32-i386.c 2020-07-30 15:04:16.710393941 +0100 +@@ -1158,7 +1158,7 @@ elf_i386_tls_transition (struct bfd_link + { + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + name = bfd_elf_sym_name (abfd, symtab_hdr, isym, NULL); + } +@@ -1251,7 +1251,7 @@ elf_i386_convert_load_reloc (bfd *abfd, + else + { + local_ref = TRUE; +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, abfd, + r_symndx); + abs_symbol = isym->st_shndx == SHN_ABS; + } +@@ -1529,7 +1529,7 @@ elf_i386_check_relocs (bfd *abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + goto error_return; +@@ -1859,7 +1859,7 @@ elf_i386_check_relocs (bfd *abfd, + void **vpp; + asection *s; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + goto error_return; +diff -rup binutils.orig/bfd/elf32-m32r.c binutils-2.35/bfd/elf32-m32r.c +--- binutils.orig/bfd/elf32-m32r.c 2020-07-30 15:04:05.370466676 +0100 ++++ binutils-2.35/bfd/elf32-m32r.c 2020-07-30 15:04:16.710393941 +0100 +@@ -1498,20 +1498,6 @@ struct elf_m32r_pcrel_relocs_copied + bfd_size_type count; + }; + +-/* m32r ELF linker hash table. */ +- +-struct elf_m32r_link_hash_table +-{ +- struct elf_link_hash_table root; +- +- /* Short-cuts to get to dynamic linker sections. */ +- asection *sdynbss; +- asection *srelbss; +- +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +-}; +- + /* Traverse an m32r ELF linker hash table. */ + + #define m32r_elf_link_hash_traverse(table, func, info) \ +@@ -1524,21 +1510,21 @@ struct elf_m32r_link_hash_table + + #define m32r_elf_hash_table(p) \ + (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \ +- == M32R_ELF_DATA ? ((struct elf_m32r_link_hash_table *) ((p)->hash)) : NULL) ++ == M32R_ELF_DATA ? ((struct elf_link_hash_table *) ((p)->hash)) : NULL) + + /* Create an m32r ELF linker hash table. */ + + static struct bfd_link_hash_table * + m32r_elf_link_hash_table_create (bfd *abfd) + { +- struct elf_m32r_link_hash_table *ret; +- size_t amt = sizeof (struct elf_m32r_link_hash_table); ++ struct elf_link_hash_table *ret; ++ size_t amt = sizeof (struct elf_link_hash_table); + + ret = bfd_zmalloc (amt); + if (ret == NULL) + return NULL; + +- if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, ++ if (!_bfd_elf_link_hash_table_init (ret, abfd, + _bfd_elf_link_hash_newfunc, + sizeof (struct elf_link_hash_entry), + M32R_ELF_DATA)) +@@ -1547,7 +1533,7 @@ m32r_elf_link_hash_table_create (bfd *ab + return NULL; + } + +- return &ret->root.root; ++ return &ret->root; + } + + /* Create dynamic sections when linking against a dynamic object. */ +@@ -1555,7 +1541,7 @@ m32r_elf_link_hash_table_create (bfd *ab + static bfd_boolean + m32r_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) + { +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + flagword flags, pltflags; + asection *s; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); +@@ -1578,7 +1564,7 @@ m32r_elf_create_dynamic_sections (bfd *a + pltflags |= SEC_READONLY; + + s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags); +- htab->root.splt = s; ++ htab->splt = s; + if (s == NULL + || !bfd_set_section_alignment (s, bed->plt_alignment)) + return FALSE; +@@ -1598,7 +1584,7 @@ m32r_elf_create_dynamic_sections (bfd *a + h = (struct elf_link_hash_entry *) bh; + h->def_regular = 1; + h->type = STT_OBJECT; +- htab->root.hplt = h; ++ htab->hplt = h; + + if (bfd_link_pic (info) + && ! bfd_elf_link_record_dynamic_symbol (info, h)) +@@ -1609,12 +1595,12 @@ m32r_elf_create_dynamic_sections (bfd *a + bed->default_use_rela_p + ? ".rela.plt" : ".rel.plt", + flags | SEC_READONLY); +- htab->root.srelplt = s; ++ htab->srelplt = s; + if (s == NULL + || !bfd_set_section_alignment (s, ptralign)) + return FALSE; + +- if (htab->root.sgot == NULL ++ if (htab->sgot == NULL + && !_bfd_elf_create_got_section (abfd, info)) + return FALSE; + +@@ -1669,7 +1655,7 @@ static bfd_boolean + m32r_elf_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) + { +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd *dynobj; + asection *s; + +@@ -1796,7 +1782,7 @@ static bfd_boolean + allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) + { + struct bfd_link_info *info; +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + struct elf_dyn_relocs *p; + + if (h->root.type == bfd_link_hash_indirect) +@@ -1807,7 +1793,7 @@ allocate_dynrelocs (struct elf_link_hash + if (htab == NULL) + return FALSE; + +- if (htab->root.dynamic_sections_created ++ if (htab->dynamic_sections_created + && h->plt.refcount > 0) + { + /* Make sure this symbol is output as a dynamic symbol. +@@ -1821,7 +1807,7 @@ allocate_dynrelocs (struct elf_link_hash + + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h)) + { +- asection *s = htab->root.splt; ++ asection *s = htab->splt; + + /* If this is the first .plt entry, make room for the special + first entry. */ +@@ -1847,10 +1833,10 @@ allocate_dynrelocs (struct elf_link_hash + + /* We also need to make an entry in the .got.plt section, which + will be placed in the .got section by the linker script. */ +- htab->root.sgotplt->size += 4; ++ htab->sgotplt->size += 4; + + /* We also need to make an entry in the .rel.plt section. */ +- htab->root.srelplt->size += sizeof (Elf32_External_Rela); ++ htab->srelplt->size += sizeof (Elf32_External_Rela); + } + else + { +@@ -1878,13 +1864,13 @@ allocate_dynrelocs (struct elf_link_hash + return FALSE; + } + +- s = htab->root.sgot; ++ s = htab->sgot; + + h->got.offset = s->size; + s->size += 4; +- dyn = htab->root.dynamic_sections_created; ++ dyn = htab->dynamic_sections_created; + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h)) +- htab->root.srelgot->size += sizeof (Elf32_External_Rela); ++ htab->srelgot->size += sizeof (Elf32_External_Rela); + } + else + h->got.offset = (bfd_vma) -1; +@@ -1944,7 +1930,7 @@ allocate_dynrelocs (struct elf_link_hash + if (!h->non_got_ref + && ((h->def_dynamic + && !h->def_regular) +- || (htab->root.dynamic_sections_created ++ || (htab->dynamic_sections_created + && (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined)))) + { +@@ -1984,7 +1970,7 @@ static bfd_boolean + m32r_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) + { +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd *dynobj; + asection *s; + bfd_boolean relocs; +@@ -1998,10 +1984,10 @@ m32r_elf_size_dynamic_sections (bfd *out + if (htab == NULL) + return FALSE; + +- dynobj = htab->root.dynobj; ++ dynobj = htab->dynobj; + BFD_ASSERT (dynobj != NULL); + +- if (htab->root.dynamic_sections_created) ++ if (htab->dynamic_sections_created) + { + /* Set the contents of the .interp section to the interpreter. */ + if (bfd_link_executable (info) && !info->nointerp) +@@ -2060,8 +2046,8 @@ m32r_elf_size_dynamic_sections (bfd *out + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + locsymcount = symtab_hdr->sh_info; + end_local_got = local_got + locsymcount; +- s = htab->root.sgot; +- srel = htab->root.srelgot; ++ s = htab->sgot; ++ srel = htab->srelgot; + for (; local_got < end_local_got; ++local_got) + { + if (*local_got > 0) +@@ -2078,7 +2064,7 @@ m32r_elf_size_dynamic_sections (bfd *out + + /* Allocate global sym .plt and .got entries, and space for global + sym dynamic relocs. */ +- elf_link_hash_traverse (&htab->root, allocate_dynrelocs, info); ++ elf_link_hash_traverse (htab, allocate_dynrelocs, info); + + /* We now have determined the sizes of the various dynamic sections. + Allocate memory for them. */ +@@ -2088,9 +2074,9 @@ m32r_elf_size_dynamic_sections (bfd *out + if ((s->flags & SEC_LINKER_CREATED) == 0) + continue; + +- if (s == htab->root.splt +- || s == htab->root.sgot +- || s == htab->root.sgotplt ++ if (s == htab->splt ++ || s == htab->sgot ++ || s == htab->sgotplt + || s == htab->sdynbss) + { + /* Strip this section if we don't need it; see the +@@ -2098,7 +2084,7 @@ m32r_elf_size_dynamic_sections (bfd *out + } + else if (CONST_STRNEQ (bfd_section_name (s), ".rela")) + { +- if (s->size != 0 && s != htab->root.srelplt) ++ if (s->size != 0 && s != htab->srelplt) + relocs = TRUE; + + /* We use the reloc_count field as a counter if we need +@@ -2188,7 +2174,7 @@ m32r_elf_relocate_section (bfd *output_b + Elf_Internal_Rela *rel, *relend; + /* Assume success. */ + bfd_boolean ret = TRUE; +- struct elf_m32r_link_hash_table *htab = m32r_elf_hash_table (info); ++ struct elf_link_hash_table *htab = m32r_elf_hash_table (info); + bfd_vma *local_got_offsets; + asection *sgot, *splt, *sreloc; + bfd_vma high_address = bfd_get_section_limit (input_bfd, input_section); +@@ -2198,8 +2184,8 @@ m32r_elf_relocate_section (bfd *output_b + + local_got_offsets = elf_local_got_offsets (input_bfd); + +- sgot = htab->root.sgot; +- splt = htab->root.splt; ++ sgot = htab->sgot; ++ splt = htab->splt; + sreloc = NULL; + + rel = relocs; +@@ -2295,7 +2281,7 @@ m32r_elf_relocate_section (bfd *output_b + bfd_boolean dyn; + sec = h->root.u.def.section; + +- dyn = htab->root.dynamic_sections_created; ++ dyn = htab->dynamic_sections_created; + sec = h->root.u.def.section; + if (r_type == R_M32R_GOTPC24 + || (r_type == R_M32R_GOTPC_HI_ULO +@@ -2516,7 +2502,7 @@ m32r_elf_relocate_section (bfd *output_b + off = h->got.offset; + BFD_ASSERT (off != (bfd_vma) -1); + +- dyn = htab->root.dynamic_sections_created; ++ dyn = htab->dynamic_sections_created; + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, + bfd_link_pic (info), + h) +@@ -2576,7 +2562,7 @@ m32r_elf_relocate_section (bfd *output_b + + /* We need to generate a R_M32R_RELATIVE reloc + for the dynamic linker. */ +- srelgot = htab->root.srelgot; ++ srelgot = htab->srelgot; + BFD_ASSERT (srelgot != NULL); + + outrel.r_offset = (sgot->output_section->vma +@@ -2892,7 +2878,7 @@ m32r_elf_finish_dynamic_symbol (bfd *out + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) + { +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd_byte *loc; + + #ifdef DEBUG_PIC +@@ -2918,9 +2904,9 @@ m32r_elf_finish_dynamic_symbol (bfd *out + + BFD_ASSERT (h->dynindx != -1); + +- splt = htab->root.splt; +- sgot = htab->root.sgotplt; +- srela = htab->root.srelplt; ++ splt = htab->splt; ++ sgot = htab->sgotplt; ++ srela = htab->srelplt; + BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL); + + /* Get the index in the procedure linkage table which +@@ -3014,8 +3000,8 @@ m32r_elf_finish_dynamic_symbol (bfd *out + /* This symbol has an entry in the global offset table. Set it + up. */ + +- sgot = htab->root.sgot; +- srela = htab->root.srelgot; ++ sgot = htab->sgot; ++ srela = htab->srelgot; + BFD_ASSERT (sgot != NULL && srela != NULL); + + rela.r_offset = (sgot->output_section->vma +@@ -3063,7 +3049,7 @@ m32r_elf_finish_dynamic_symbol (bfd *out + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak)); + +- s = bfd_get_linker_section (htab->root.dynobj, ".rela.bss"); ++ s = bfd_get_linker_section (htab->dynobj, ".rela.bss"); + BFD_ASSERT (s != NULL); + + rela.r_offset = (h->root.u.def.value +@@ -3078,7 +3064,7 @@ m32r_elf_finish_dynamic_symbol (bfd *out + } + + /* Mark some specially defined symbols as absolute. */ +- if (h == htab->root.hdynamic || h == htab->root.hgot) ++ if (h == htab->hdynamic || h == htab->hgot) + sym->st_shndx = SHN_ABS; + + return TRUE; +@@ -3091,7 +3077,7 @@ static bfd_boolean + m32r_elf_finish_dynamic_sections (bfd *output_bfd, + struct bfd_link_info *info) + { +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd *dynobj; + asection *sdyn; + asection *sgot; +@@ -3104,12 +3090,12 @@ m32r_elf_finish_dynamic_sections (bfd *o + if (htab == NULL) + return FALSE; + +- dynobj = htab->root.dynobj; ++ dynobj = htab->dynobj; + +- sgot = htab->root.sgotplt; ++ sgot = htab->sgotplt; + sdyn = bfd_get_linker_section (dynobj, ".dynamic"); + +- if (htab->root.dynamic_sections_created) ++ if (htab->dynamic_sections_created) + { + asection *splt; + Elf32_External_Dyn *dyncon, *dynconend; +@@ -3132,17 +3118,17 @@ m32r_elf_finish_dynamic_sections (bfd *o + break; + + case DT_PLTGOT: +- s = htab->root.sgotplt; ++ s = htab->sgotplt; + goto get_vma; + case DT_JMPREL: +- s = htab->root.srelplt; ++ s = htab->srelplt; + get_vma: + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_PLTRELSZ: +- s = htab->root.srelplt; ++ s = htab->srelplt; + dyn.d_un.d_val = s->size; + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; +@@ -3150,7 +3136,7 @@ m32r_elf_finish_dynamic_sections (bfd *o + } + + /* Fill in the first entry in the procedure linkage table. */ +- splt = htab->root.splt; ++ splt = htab->splt; + if (splt && splt->size > 0) + { + if (bfd_link_pic (info)) +@@ -3369,7 +3355,7 @@ m32r_elf_check_relocs (bfd *abfd, + struct elf_link_hash_entry **sym_hashes; + const Elf_Internal_Rela *rel; + const Elf_Internal_Rela *rel_end; +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd *dynobj; + asection *sreloc; + +@@ -3384,7 +3370,7 @@ m32r_elf_check_relocs (bfd *abfd, + if (htab == NULL) + return FALSE; + +- dynobj = htab->root.dynobj; ++ dynobj = htab->dynobj; + + rel_end = relocs + sec->reloc_count; + for (rel = relocs; rel < rel_end; rel++) +@@ -3406,7 +3392,7 @@ m32r_elf_check_relocs (bfd *abfd, + } + + /* Some relocs require a global offset table. */ +- if (htab->root.sgot == NULL) ++ if (htab->sgot == NULL) + { + switch (r_type) + { +@@ -3423,7 +3409,7 @@ m32r_elf_check_relocs (bfd *abfd, + case R_M32R_GOTPC_LO: + case R_M32R_GOT24: + if (dynobj == NULL) +- htab->root.dynobj = dynobj = abfd; ++ htab->dynobj = dynobj = abfd; + if (!_bfd_elf_create_got_section (dynobj, info)) + return FALSE; + break; +@@ -3540,7 +3526,7 @@ m32r_elf_check_relocs (bfd *abfd, + struct elf_dyn_relocs **head; + + if (dynobj == NULL) +- htab->root.dynobj = dynobj = abfd; ++ htab->dynobj = dynobj = abfd; + + /* When creating a shared object, we must copy these + relocs into the output file. We create a reloc +diff -rup binutils.orig/bfd/elf32-m68hc1x.h binutils-2.35/bfd/elf32-m68hc1x.h +--- binutils.orig/bfd/elf32-m68hc1x.h 2020-07-30 15:04:05.378466625 +0100 ++++ binutils-2.35/bfd/elf32-m68hc1x.h 2020-07-30 15:04:16.710393941 +0100 +@@ -120,9 +120,6 @@ struct m68hc11_elf_link_hash_table + int top_index; + asection **input_list; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + bfd_boolean (* size_one_stub) (struct bfd_hash_entry*, void*); + bfd_boolean (* build_one_stub) (struct bfd_hash_entry*, void*); + }; +diff -rup binutils.orig/bfd/elf32-m68k.c binutils-2.35/bfd/elf32-m68k.c +--- binutils.orig/bfd/elf32-m68k.c 2020-07-30 15:04:05.363466721 +0100 ++++ binutils-2.35/bfd/elf32-m68k.c 2020-07-30 15:04:16.710393941 +0100 +@@ -889,9 +889,6 @@ struct elf_m68k_link_hash_table + { + struct elf_link_hash_table root; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* The PLT format used by this link, or NULL if the format has not + yet been chosen. */ + const struct elf_m68k_plt_info *plt_info; +@@ -2836,7 +2833,7 @@ elf_m68k_check_relocs (bfd *abfd, + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&elf_m68k_hash_table (info)->sym_cache, ++ isym = bfd_sym_from_r_symndx (&elf_m68k_hash_table (info)->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-metag.c binutils-2.35/bfd/elf32-metag.c +--- binutils.orig/bfd/elf32-metag.c 2020-07-30 15:04:05.379466619 +0100 ++++ binutils-2.35/bfd/elf32-metag.c 2020-07-30 15:04:16.711393934 +0100 +@@ -823,9 +823,6 @@ struct elf_metag_link_hash_table + asection **input_list; + Elf_Internal_Sym **all_local_syms; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Data for LDM relocations. */ + union + { +@@ -2098,7 +2095,7 @@ elf_metag_check_relocs (bfd *abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->etab.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-microblaze.c binutils-2.35/bfd/elf32-microblaze.c +--- binutils.orig/bfd/elf32-microblaze.c 2020-07-30 15:04:05.367466696 +0100 ++++ binutils-2.35/bfd/elf32-microblaze.c 2020-07-30 15:04:16.711393934 +0100 +@@ -744,9 +744,6 @@ struct elf32_mb_link_hash_table + { + struct elf_link_hash_table elf; + +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_sec; +- + /* TLS Local Dynamic GOT Entry */ + union { + bfd_signed_vma refcount; +@@ -2523,7 +2520,7 @@ microblaze_elf_check_relocs (bfd * abfd, + Elf_Internal_Sym *isym; + void *vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_sec, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-nds32.c binutils-2.35/bfd/elf32-nds32.c +--- binutils.orig/bfd/elf32-nds32.c 2020-07-30 15:04:05.365466709 +0100 ++++ binutils-2.35/bfd/elf32-nds32.c 2020-07-30 15:04:16.712393928 +0100 +@@ -3696,8 +3696,6 @@ nds32_elf_link_hash_table_create (bfd *a + return NULL; + } + +- ret->sdynbss = NULL; +- ret->srelbss = NULL; + ret->sym_ld_script = NULL; + + return &ret->root.root; +@@ -3833,7 +3831,7 @@ nds32_elf_create_dynamic_sections (bfd * + initialize them at run time. The linker script puts the .dynbss + section into the .bss section of the final image. */ + s = bfd_make_section (abfd, ".dynbss"); +- htab->sdynbss = s; ++ htab->root.sdynbss = s; + if (s == NULL + || !bfd_set_section_flags (s, SEC_ALLOC | SEC_LINKER_CREATED)) + return FALSE; +@@ -3852,7 +3850,7 @@ nds32_elf_create_dynamic_sections (bfd * + { + s = bfd_make_section (abfd, (bed->default_use_rela_p + ? ".rela.bss" : ".rel.bss")); +- htab->srelbss = s; ++ htab->root.srelbss = s; + if (s == NULL + || !bfd_set_section_flags (s, flags | SEC_READONLY) + || !bfd_set_section_alignment (s, ptralign)) +@@ -3988,7 +3986,7 @@ nds32_elf_adjust_dynamic_symbol (struct + same memory location for the variable. */ + + htab = nds32_elf_hash_table (info); +- s = htab->sdynbss; ++ s = htab->root.sdynbss; + BFD_ASSERT (s != NULL); + + /* We must generate a R_NDS32_COPY reloc to tell the dynamic linker +@@ -3999,7 +3997,7 @@ nds32_elf_adjust_dynamic_symbol (struct + { + asection *srel; + +- srel = htab->srelbss; ++ srel = htab->root.srelbss; + BFD_ASSERT (srel != NULL); + srel->size += sizeof (Elf32_External_Rela); + h->needs_copy = 1; +@@ -7277,7 +7275,8 @@ nds32_elf_check_relocs (bfd *abfd, struc + void *vpp; + + Elf_Internal_Sym *isym; +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx); ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, ++ abfd, r_symndx); + if (isym == NULL) + return FALSE; + +diff -rup binutils.orig/bfd/elf32-nds32.h binutils-2.35/bfd/elf32-nds32.h +--- binutils.orig/bfd/elf32-nds32.h 2020-07-30 15:04:05.378466625 +0100 ++++ binutils-2.35/bfd/elf32-nds32.h 2020-07-30 15:04:16.712393928 +0100 +@@ -122,13 +122,6 @@ struct elf_nds32_link_hash_table + { + struct elf_link_hash_table root; + +- /* Short-cuts to get to dynamic linker sections. */ +- asection *sdynbss; +- asection *srelbss; +- +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_cache; +- + /* Target dependent options. */ + int relax_fp_as_gp; /* --mrelax-omit-fp. */ + int eliminate_gc_relocs; /* --meliminate-gc-relocs. */ +diff -rup binutils.orig/bfd/elf32-nios2.c binutils-2.35/bfd/elf32-nios2.c +--- binutils.orig/bfd/elf32-nios2.c 2020-07-30 15:04:05.375466645 +0100 ++++ binutils-2.35/bfd/elf32-nios2.c 2020-07-30 15:04:16.712393928 +0100 +@@ -1808,9 +1808,6 @@ struct elf32_nios2_link_hash_table + bfd_vma offset; + } tls_ldm_got; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + bfd_vma res_n_size; + }; + +@@ -4902,7 +4899,7 @@ nios2_elf32_check_relocs (bfd *abfd, str + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-or1k.c binutils-2.35/bfd/elf32-or1k.c +--- binutils.orig/bfd/elf32-or1k.c 2020-07-30 15:04:05.371466670 +0100 ++++ binutils-2.35/bfd/elf32-or1k.c 2020-07-30 15:04:16.713393921 +0100 +@@ -916,9 +916,6 @@ struct elf_or1k_link_hash_table + { + struct elf_link_hash_table root; + +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_sec; +- + bfd_boolean saw_plta; + }; + +@@ -2151,7 +2148,7 @@ or1k_elf_check_relocs (bfd *abfd, + Elf_Internal_Sym *isym; + void *vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_sec, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-ppc.c binutils-2.35/bfd/elf32-ppc.c +--- binutils.orig/bfd/elf32-ppc.c 2020-07-30 15:04:05.359466747 +0100 ++++ binutils-2.35/bfd/elf32-ppc.c 2020-07-30 15:04:16.713393921 +0100 +@@ -2212,9 +2212,6 @@ struct ppc_elf_link_hash_table + int plt_slot_size; + /* The size of the first PLT entry. */ + int plt_initial_entry_size; +- +- /* Small local sym cache. */ +- struct sym_cache sym_cache; + }; + + /* Rename some of the generic section flags to better document how they +@@ -2952,7 +2949,7 @@ ppc_elf_check_relocs (bfd *abfd, + ifunc = NULL; + if (h == NULL && htab->elf.target_os != is_vxworks) + { +- Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -3335,7 +3332,7 @@ ppc_elf_check_relocs (bfd *abfd, + asection *s; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -3495,7 +3492,7 @@ ppc_elf_check_relocs (bfd *abfd, + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-s390.c binutils-2.35/bfd/elf32-s390.c +--- binutils.orig/bfd/elf32-s390.c 2020-07-30 15:04:05.376466638 +0100 ++++ binutils-2.35/bfd/elf32-s390.c 2020-07-30 15:04:16.714393915 +0100 +@@ -746,9 +746,6 @@ struct elf_s390_link_hash_table + bfd_signed_vma refcount; + bfd_vma offset; + } tls_ldm_got; +- +- /* Small local sym cache. */ +- struct sym_cache sym_cache; + }; + + /* Get the s390 ELF linker hash table from a link_info structure. */ +@@ -930,7 +927,7 @@ elf_s390_check_relocs (bfd *abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -1281,7 +1278,7 @@ elf_s390_check_relocs (bfd *abfd, + asection *s; + void *vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -3722,7 +3719,7 @@ elf_s390_finish_dynamic_sections (bfd *o + if (local_plt[i].plt.offset != (bfd_vma) -1) + { + asection *sec = local_plt[i].sec; +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, i); ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, ibfd, i); + if (isym == NULL) + return FALSE; + +diff -rup binutils.orig/bfd/elf32-sh.c binutils-2.35/bfd/elf32-sh.c +--- binutils.orig/bfd/elf32-sh.c 2020-07-30 15:04:05.376466638 +0100 ++++ binutils-2.35/bfd/elf32-sh.c 2020-07-30 15:04:16.714393915 +0100 +@@ -2160,8 +2160,6 @@ struct elf_sh_link_hash_table + struct elf_link_hash_table root; + + /* Short-cuts to get to dynamic linker sections. */ +- asection *sdynbss; +- asection *srelbss; + asection *sfuncdesc; + asection *srelfuncdesc; + asection *srofixup; +@@ -2169,9 +2167,6 @@ struct elf_sh_link_hash_table + /* The (unloaded but important) VxWorks .rela.plt.unloaded section. */ + asection *srelplt2; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* A counter or offset to track a TLS got entry. */ + union + { +@@ -2439,7 +2434,7 @@ sh_elf_create_dynamic_sections (bfd *abf + section into the .bss section of the final image. */ + s = bfd_make_section_anyway_with_flags (abfd, ".dynbss", + SEC_ALLOC | SEC_LINKER_CREATED); +- htab->sdynbss = s; ++ htab->root.sdynbss = s; + if (s == NULL) + return FALSE; + +@@ -2460,7 +2455,7 @@ sh_elf_create_dynamic_sections (bfd *abf + (bed->default_use_rela_p + ? ".rela.bss" : ".rel.bss"), + flags | SEC_READONLY); +- htab->srelbss = s; ++ htab->root.srelbss = s; + if (s == NULL + || !bfd_set_section_alignment (s, ptralign)) + return FALSE; +@@ -2580,7 +2575,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd + both the dynamic object and the regular object will refer to the + same memory location for the variable. */ + +- s = htab->sdynbss; ++ s = htab->root.sdynbss; + BFD_ASSERT (s != NULL); + + /* We must generate a R_SH_COPY reloc to tell the dynamic linker to +@@ -2591,7 +2586,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd + { + asection *srel; + +- srel = htab->srelbss; ++ srel = htab->root.srelbss; + BFD_ASSERT (srel != NULL); + srel->size += sizeof (Elf32_External_Rela); + h->needs_copy = 1; +@@ -3151,7 +3146,7 @@ sh_elf_size_dynamic_sections (bfd *outpu + || s == htab->root.sgotplt + || s == htab->sfuncdesc + || s == htab->srofixup +- || s == htab->sdynbss) ++ || s == htab->root.sdynbss) + { + /* Strip this section if we don't need it; see the + comment below. */ +@@ -5679,7 +5674,7 @@ sh_elf_check_relocs (bfd *abfd, struct b + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-tic6x.c binutils-2.35/bfd/elf32-tic6x.c +--- binutils.orig/bfd/elf32-tic6x.c 2020-07-30 15:04:05.366466702 +0100 ++++ binutils-2.35/bfd/elf32-tic6x.c 2020-07-30 15:04:16.714393915 +0100 +@@ -46,9 +46,6 @@ struct elf32_tic6x_link_hash_table + /* C6X specific command line arguments. */ + struct elf32_tic6x_params params; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* The output BFD, for convenience. */ + bfd *obfd; + +@@ -2729,7 +2726,7 @@ elf32_tic6x_check_relocs (bfd *abfd, str + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-tilepro.c binutils-2.35/bfd/elf32-tilepro.c +--- binutils.orig/bfd/elf32-tilepro.c 2020-07-30 15:04:05.364466715 +0100 ++++ binutils-2.35/bfd/elf32-tilepro.c 2020-07-30 15:04:16.715393908 +0100 +@@ -727,19 +727,11 @@ tilepro_elf_mkobject (bfd *abfd) + #include "elf/common.h" + #include "elf/internal.h" + +-struct tilepro_elf_link_hash_table +-{ +- struct elf_link_hash_table elf; +- +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_cache; +-}; +- + /* Get the Tilepro ELF linker hash table from a link_info structure. */ + #define tilepro_elf_hash_table(p) \ + (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \ + == TILEPRO_ELF_DATA \ +- ? ((struct tilepro_elf_link_hash_table *) ((p)->hash)) : NULL) ++ ? ((struct elf_link_hash_table *) ((p)->hash)) : NULL) + + static reloc_howto_type * + tilepro_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, +@@ -1184,14 +1176,14 @@ link_hash_newfunc (struct bfd_hash_entry + static struct bfd_link_hash_table * + tilepro_elf_link_hash_table_create (bfd *abfd) + { +- struct tilepro_elf_link_hash_table *ret; +- size_t amt = sizeof (struct tilepro_elf_link_hash_table); ++ struct elf_link_hash_table *ret; ++ size_t amt = sizeof (struct elf_link_hash_table); + +- ret = (struct tilepro_elf_link_hash_table *) bfd_zmalloc (amt); ++ ret = (struct elf_link_hash_table *) bfd_zmalloc (amt); + if (ret == NULL) + return NULL; + +- if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc, ++ if (!_bfd_elf_link_hash_table_init (ret, abfd, link_hash_newfunc, + sizeof (struct tilepro_elf_link_hash_entry), + TILEPRO_ELF_DATA)) + { +@@ -1199,7 +1191,7 @@ tilepro_elf_link_hash_table_create (bfd + return NULL; + } + +- return &ret->elf.root; ++ return &ret->root; + } + + /* Create the .got section. */ +@@ -1402,7 +1394,7 @@ static bfd_boolean + tilepro_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, + asection *sec, const Elf_Internal_Rela *relocs) + { +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + const Elf_Internal_Rela *rel; +@@ -1423,8 +1415,8 @@ tilepro_elf_check_relocs (bfd *abfd, str + + BFD_ASSERT (is_tilepro_elf (abfd) || num_relocs == 0); + +- if (htab->elf.dynobj == NULL) +- htab->elf.dynobj = abfd; ++ if (htab->dynobj == NULL) ++ htab->dynobj = abfd; + + rel_end = relocs + num_relocs; + for (rel = relocs; rel < rel_end; rel++) +@@ -1569,9 +1561,9 @@ tilepro_elf_check_relocs (bfd *abfd, str + } + } + +- if (htab->elf.sgot == NULL) ++ if (htab->sgot == NULL) + { +- if (!tilepro_elf_create_got_section (htab->elf.dynobj, info)) ++ if (!tilepro_elf_create_got_section (htab->dynobj, info)) + return FALSE; + } + break; +@@ -1716,7 +1708,7 @@ tilepro_elf_check_relocs (bfd *abfd, str + if (sreloc == NULL) + { + sreloc = _bfd_elf_make_dynamic_reloc_section +- (sec, htab->elf.dynobj, 2, abfd, /*rela?*/ TRUE); ++ (sec, htab->dynobj, 2, abfd, /*rela?*/ TRUE); + + if (sreloc == NULL) + return FALSE; +@@ -1754,7 +1746,7 @@ tilepro_elf_check_relocs (bfd *abfd, str + { + size_t amt = sizeof *p; + p = ((struct elf_dyn_relocs *) +- bfd_alloc (htab->elf.dynobj, amt)); ++ bfd_alloc (htab->dynobj, amt)); + if (p == NULL) + return FALSE; + p->next = *head; +@@ -1850,14 +1842,14 @@ static bfd_boolean + tilepro_elf_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) + { +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + asection *s, *srel; + + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); + + /* Make sure we know what is going on here. */ +- BFD_ASSERT (htab->elf.dynobj != NULL ++ BFD_ASSERT (htab->dynobj != NULL + && (h->needs_plt + || h->is_weakalias + || (h->def_dynamic +@@ -1947,13 +1939,13 @@ tilepro_elf_adjust_dynamic_symbol (struc + .rel.bss section we are going to use. */ + if ((h->root.u.def.section->flags & SEC_READONLY) != 0) + { +- s = htab->elf.sdynrelro; +- srel = htab->elf.sreldynrelro; ++ s = htab->sdynrelro; ++ srel = htab->sreldynrelro; + } + else + { +- s = htab->elf.sdynbss; +- srel = htab->elf.srelbss; ++ s = htab->sdynbss; ++ srel = htab->srelbss; + } + if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0) + { +@@ -1971,7 +1963,7 @@ static bfd_boolean + allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) + { + struct bfd_link_info *info; +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + struct elf_dyn_relocs *p; + + if (h->root.type == bfd_link_hash_indirect) +@@ -1981,7 +1973,7 @@ allocate_dynrelocs (struct elf_link_hash + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); + +- if (htab->elf.dynamic_sections_created ++ if (htab->dynamic_sections_created + && h->plt.refcount > 0) + { + /* Make sure this symbol is output as a dynamic symbol. +@@ -1995,7 +1987,7 @@ allocate_dynrelocs (struct elf_link_hash + + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h)) + { +- asection *s = htab->elf.splt; ++ asection *s = htab->splt; + + /* Allocate room for the header. */ + if (s->size == 0) +@@ -2021,10 +2013,10 @@ allocate_dynrelocs (struct elf_link_hash + s->size += PLT_ENTRY_SIZE; + + /* We also need to make an entry in the .got.plt section. */ +- htab->elf.sgotplt->size += GOT_ENTRY_SIZE; ++ htab->sgotplt->size += GOT_ENTRY_SIZE; + + /* We also need to make an entry in the .rela.plt section. */ +- htab->elf.srelplt->size += TILEPRO_ELF_RELA_BYTES; ++ htab->srelplt->size += TILEPRO_ELF_RELA_BYTES; + } + else + { +@@ -2060,22 +2052,22 @@ allocate_dynrelocs (struct elf_link_hash + return FALSE; + } + +- s = htab->elf.sgot; ++ s = htab->sgot; + h->got.offset = s->size; + s->size += TILEPRO_BYTES_PER_WORD; + /* R_TILEPRO_IMM16_Xn_TLS_GD entries need 2 consecutive GOT slots. */ + if (tls_type == GOT_TLS_GD) + s->size += TILEPRO_BYTES_PER_WORD; +- dyn = htab->elf.dynamic_sections_created; ++ dyn = htab->dynamic_sections_created; + /* R_TILEPRO_IMM16_Xn_TLS_IE_xxx needs one dynamic relocation, + R_TILEPRO_IMM16_Xn_TLS_GD_xxx needs two if local symbol and two if + global. */ + if (tls_type == GOT_TLS_GD || tls_type == GOT_TLS_IE) +- htab->elf.srelgot->size += 2 * TILEPRO_ELF_RELA_BYTES; ++ htab->srelgot->size += 2 * TILEPRO_ELF_RELA_BYTES; + else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, + bfd_link_pic (info), + h)) +- htab->elf.srelgot->size += TILEPRO_ELF_RELA_BYTES; ++ htab->srelgot->size += TILEPRO_ELF_RELA_BYTES; + } + else + h->got.offset = (bfd_vma) -1; +@@ -2134,7 +2126,7 @@ allocate_dynrelocs (struct elf_link_hash + if (!h->non_got_ref + && ((h->def_dynamic + && !h->def_regular) +- || (htab->elf.dynamic_sections_created ++ || (htab->dynamic_sections_created + && (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined)))) + { +@@ -2195,14 +2187,14 @@ tilepro_elf_size_dynamic_sections (bfd * + { + (void)output_bfd; + +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd *dynobj; + asection *s; + bfd *ibfd; + + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); +- dynobj = htab->elf.dynobj; ++ dynobj = htab->dynobj; + BFD_ASSERT (dynobj != NULL); + + if (elf_hash_table (info)->dynamic_sections_created) +@@ -2268,8 +2260,8 @@ tilepro_elf_size_dynamic_sections (bfd * + locsymcount = symtab_hdr->sh_info; + end_local_got = local_got + locsymcount; + local_tls_type = _bfd_tilepro_elf_local_got_tls_type (ibfd); +- s = htab->elf.sgot; +- srel = htab->elf.srelgot; ++ s = htab->sgot; ++ srel = htab->srelgot; + for (; local_got < end_local_got; ++local_got, ++local_tls_type) + { + if (*local_got > 0) +@@ -2290,19 +2282,19 @@ tilepro_elf_size_dynamic_sections (bfd * + + /* Allocate global sym .plt and .got entries, and space for global + sym dynamic relocs. */ +- elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, info); ++ elf_link_hash_traverse (htab, allocate_dynrelocs, info); + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* If the .got section is more than 0x8000 bytes, we add + 0x8000 to the value of _GLOBAL_OFFSET_TABLE_, so that 16 + bit relocations have a greater chance of working. */ +- if (htab->elf.sgot->size >= 0x8000 ++ if (htab->sgot->size >= 0x8000 + && elf_hash_table (info)->hgot->root.u.def.value == 0) + elf_hash_table (info)->hgot->root.u.def.value = 0x8000; + } + +- if (htab->elf.sgotplt) ++ if (htab->sgotplt) + { + struct elf_link_hash_entry *got; + got = elf_link_hash_lookup (elf_hash_table (info), +@@ -2313,14 +2305,14 @@ tilepro_elf_size_dynamic_sections (bfd * + entries and there is no refeence to _GLOBAL_OFFSET_TABLE_. */ + if ((got == NULL + || !got->ref_regular_nonweak) +- && (htab->elf.sgotplt->size ++ && (htab->sgotplt->size + == GOTPLT_HEADER_SIZE) +- && (htab->elf.splt == NULL +- || htab->elf.splt->size == 0) +- && (htab->elf.sgot == NULL +- || (htab->elf.sgot->size ++ && (htab->splt == NULL ++ || htab->splt->size == 0) ++ && (htab->sgot == NULL ++ || (htab->sgot->size + == get_elf_backend_data (output_bfd)->got_header_size))) +- htab->elf.sgotplt->size = 0; ++ htab->sgotplt->size = 0; + } + + /* The check_relocs and adjust_dynamic_symbol entry points have +@@ -2331,11 +2323,11 @@ tilepro_elf_size_dynamic_sections (bfd * + if ((s->flags & SEC_LINKER_CREATED) == 0) + continue; + +- if (s == htab->elf.splt +- || s == htab->elf.sgot +- || s == htab->elf.sgotplt +- || s == htab->elf.sdynbss +- || s == htab->elf.sdynrelro) ++ if (s == htab->splt ++ || s == htab->sgot ++ || s == htab->sgotplt ++ || s == htab->sdynbss ++ || s == htab->sdynrelro) + { + /* Strip this section if we don't need it; see the + comment below. */ +@@ -2527,7 +2519,7 @@ tilepro_elf_relocate_section (bfd *outpu + Elf_Internal_Sym *local_syms, + asection **local_sections) + { +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + bfd_vma *local_got_offsets; +@@ -2758,7 +2750,7 @@ tilepro_elf_relocate_section (bfd *outpu + case R_TILEPRO_IMM16_X1_GOT_HA: + /* Relocation is to the entry for this symbol in the global + offset table. */ +- if (htab->elf.sgot == NULL) ++ if (htab->sgot == NULL) + abort (); + + if (h != NULL) +@@ -2792,7 +2784,7 @@ tilepro_elf_relocate_section (bfd *outpu + else + { + bfd_put_32 (output_bfd, relocation, +- htab->elf.sgot->contents + off); ++ htab->sgot->contents + off); + h->got.offset |= 1; + } + } +@@ -2820,11 +2812,11 @@ tilepro_elf_relocate_section (bfd *outpu + + /* We need to generate a R_TILEPRO_RELATIVE reloc + for the dynamic linker. */ +- s = htab->elf.srelgot; ++ s = htab->srelgot; + BFD_ASSERT (s != NULL); + +- outrel.r_offset = (htab->elf.sgot->output_section->vma +- + htab->elf.sgot->output_offset ++ outrel.r_offset = (htab->sgot->output_section->vma ++ + htab->sgot->output_offset + + off); + outrel.r_info = ELF32_R_INFO (0, R_TILEPRO_RELATIVE); + outrel.r_addend = relocation; +@@ -2833,7 +2825,7 @@ tilepro_elf_relocate_section (bfd *outpu + } + + bfd_put_32 (output_bfd, relocation, +- htab->elf.sgot->contents + off); ++ htab->sgot->contents + off); + local_got_offsets[r_symndx] |= 1; + } + } +@@ -2845,7 +2837,7 @@ tilepro_elf_relocate_section (bfd *outpu + procedure linkage table. */ + BFD_ASSERT (h != NULL); + +- if (h->plt.offset == (bfd_vma) -1 || htab->elf.splt == NULL) ++ if (h->plt.offset == (bfd_vma) -1 || htab->splt == NULL) + { + /* We didn't make a PLT entry for this symbol. This + happens when statically linking PIC code, or when +@@ -2853,8 +2845,8 @@ tilepro_elf_relocate_section (bfd *outpu + break; + } + +- relocation = (htab->elf.splt->output_section->vma +- + htab->elf.splt->output_offset ++ relocation = (htab->splt->output_section->vma ++ + htab->splt->output_offset + + h->plt.offset); + unresolved_reloc = FALSE; + break; +@@ -2993,7 +2985,7 @@ tilepro_elf_relocate_section (bfd *outpu + outrel.r_addend = relocation + rel->r_addend; + + if (is_plt) +- sec = htab->elf.splt; ++ sec = htab->splt; + + if (bfd_is_abs_section (sec)) + indx = 0; +@@ -3016,7 +3008,7 @@ tilepro_elf_relocate_section (bfd *outpu + + if (indx == 0) + { +- osec = htab->elf.text_index_section; ++ osec = htab->text_index_section; + indx = elf_section_data (osec)->dynindx; + } + +@@ -3142,7 +3134,7 @@ tilepro_elf_relocate_section (bfd *outpu + local_got_offsets[r_symndx] |= 1; + } + +- if (htab->elf.sgot == NULL) ++ if (htab->sgot == NULL) + abort (); + + if ((off & 1) != 0) +@@ -3153,13 +3145,13 @@ tilepro_elf_relocate_section (bfd *outpu + int indx = 0; + bfd_boolean need_relocs = FALSE; + +- if (htab->elf.srelgot == NULL) ++ if (htab->srelgot == NULL) + abort (); + + if (h != NULL) + { + bfd_boolean dyn; +- dyn = htab->elf.dynamic_sections_created; ++ dyn = htab->dynamic_sections_created; + + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, + bfd_link_pic (info), +@@ -3190,18 +3182,18 @@ tilepro_elf_relocate_section (bfd *outpu + case R_TILEPRO_IMM16_X0_TLS_IE_HA: + case R_TILEPRO_IMM16_X1_TLS_IE_HA: + if (need_relocs) { +- bfd_put_32 (output_bfd, 0, htab->elf.sgot->contents + off); +- outrel.r_offset = (htab->elf.sgot->output_section->vma +- + htab->elf.sgot->output_offset + off); ++ bfd_put_32 (output_bfd, 0, htab->sgot->contents + off); ++ outrel.r_offset = (htab->sgot->output_section->vma ++ + htab->sgot->output_offset + off); + outrel.r_addend = 0; + if (indx == 0) + outrel.r_addend = relocation - dtpoff_base (info); + outrel.r_info = ELF32_R_INFO (indx, R_TILEPRO_TLS_TPOFF32); +- tilepro_elf_append_rela_32 (output_bfd, htab->elf.srelgot, ++ tilepro_elf_append_rela_32 (output_bfd, htab->srelgot, + &outrel); + } else { + bfd_put_32 (output_bfd, tpoff (info, relocation), +- htab->elf.sgot->contents + off); ++ htab->sgot->contents + off); + } + break; + +@@ -3214,31 +3206,31 @@ tilepro_elf_relocate_section (bfd *outpu + case R_TILEPRO_IMM16_X0_TLS_GD_HA: + case R_TILEPRO_IMM16_X1_TLS_GD_HA: + if (need_relocs) { +- outrel.r_offset = (htab->elf.sgot->output_section->vma +- + htab->elf.sgot->output_offset + off); ++ outrel.r_offset = (htab->sgot->output_section->vma ++ + htab->sgot->output_offset + off); + outrel.r_addend = 0; + outrel.r_info = ELF32_R_INFO (indx, R_TILEPRO_TLS_DTPMOD32); +- bfd_put_32 (output_bfd, 0, htab->elf.sgot->contents + off); +- tilepro_elf_append_rela_32 (output_bfd, htab->elf.srelgot, ++ bfd_put_32 (output_bfd, 0, htab->sgot->contents + off); ++ tilepro_elf_append_rela_32 (output_bfd, htab->srelgot, + &outrel); + if (indx == 0) + { + BFD_ASSERT (! unresolved_reloc); + bfd_put_32 (output_bfd, + relocation - dtpoff_base (info), +- (htab->elf.sgot->contents + off + ++ (htab->sgot->contents + off + + TILEPRO_BYTES_PER_WORD)); + } + else + { + bfd_put_32 (output_bfd, 0, +- (htab->elf.sgot->contents + off + ++ (htab->sgot->contents + off + + TILEPRO_BYTES_PER_WORD)); + outrel.r_info = ELF32_R_INFO (indx, + R_TILEPRO_TLS_DTPOFF32); + outrel.r_offset += TILEPRO_BYTES_PER_WORD; + tilepro_elf_append_rela_32 (output_bfd, +- htab->elf.srelgot, &outrel); ++ htab->srelgot, &outrel); + } + } + +@@ -3249,9 +3241,9 @@ tilepro_elf_relocate_section (bfd *outpu + symbol binding locally. Mark it as belonging + to module 1, the executable. */ + bfd_put_32 (output_bfd, 1, +- htab->elf.sgot->contents + off ); ++ htab->sgot->contents + off ); + bfd_put_32 (output_bfd, relocation - dtpoff_base (info), +- htab->elf.sgot->contents + off + ++ htab->sgot->contents + off + + TILEPRO_BYTES_PER_WORD); + } + break; +@@ -3411,7 +3403,7 @@ tilepro_elf_finish_dynamic_symbol (bfd * + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) + { +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); +@@ -3431,9 +3423,9 @@ tilepro_elf_finish_dynamic_symbol (bfd * + + BFD_ASSERT (h->dynindx != -1); + +- splt = htab->elf.splt; +- srela = htab->elf.srelplt; +- sgotplt = htab->elf.sgotplt; ++ splt = htab->splt; ++ srela = htab->srelplt; ++ sgotplt = htab->sgotplt; + + if (splt == NULL || srela == NULL) + abort (); +@@ -3481,8 +3473,8 @@ tilepro_elf_finish_dynamic_symbol (bfd * + + /* This symbol has an entry in the GOT. Set it up. */ + +- sgot = htab->elf.sgot; +- srela = htab->elf.srelgot; ++ sgot = htab->sgot; ++ srela = htab->srelgot; + BFD_ASSERT (sgot != NULL && srela != NULL); + + rela.r_offset = (sgot->output_section->vma +@@ -3528,16 +3520,16 @@ tilepro_elf_finish_dynamic_symbol (bfd * + + h->root.u.def.section->output_offset); + rela.r_info = ELF32_R_INFO (h->dynindx, R_TILEPRO_COPY); + rela.r_addend = 0; +- if (h->root.u.def.section == htab->elf.sdynrelro) +- s = htab->elf.sreldynrelro; ++ if (h->root.u.def.section == htab->sdynrelro) ++ s = htab->sreldynrelro; + else +- s = htab->elf.srelbss; ++ s = htab->srelbss; + tilepro_elf_append_rela_32 (output_bfd, s, &rela); + } + + /* Mark some specially defined symbols as absolute. */ +- if (h == htab->elf.hdynamic +- || (h == htab->elf.hgot || h == htab->elf.hplt)) ++ if (h == htab->hdynamic ++ || (h == htab->hgot || h == htab->hplt)) + sym->st_shndx = SHN_ABS; + + return TRUE; +@@ -3551,7 +3543,7 @@ tilepro_finish_dyn (bfd *output_bfd, str + asection *splt ATTRIBUTE_UNUSED) + { + Elf32_External_Dyn *dyncon, *dynconend; +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); +@@ -3567,15 +3559,15 @@ tilepro_finish_dyn (bfd *output_bfd, str + switch (dyn.d_tag) + { + case DT_PLTGOT: +- s = htab->elf.sgotplt; ++ s = htab->sgotplt; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + break; + case DT_JMPREL: +- s = htab->elf.srelplt; ++ s = htab->srelplt; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + break; + case DT_PLTRELSZ: +- s = htab->elf.srelplt; ++ s = htab->srelplt; + dyn.d_un.d_val = s->size; + break; + default: +@@ -3593,11 +3585,11 @@ tilepro_elf_finish_dynamic_sections (bfd + { + bfd *dynobj; + asection *sdyn; +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); +- dynobj = htab->elf.dynobj; ++ dynobj = htab->dynobj; + + sdyn = bfd_get_linker_section (dynobj, ".dynamic"); + +@@ -3606,7 +3598,7 @@ tilepro_elf_finish_dynamic_sections (bfd + asection *splt; + bfd_boolean ret; + +- splt = htab->elf.splt; ++ splt = htab->splt; + BFD_ASSERT (splt != NULL && sdyn != NULL); + + ret = tilepro_finish_dyn (output_bfd, info, dynobj, sdyn, splt); +@@ -3627,42 +3619,42 @@ tilepro_elf_finish_dynamic_sections (bfd + = PLT_ENTRY_SIZE; + } + +- if (htab->elf.sgotplt) ++ if (htab->sgotplt) + { +- if (bfd_is_abs_section (htab->elf.sgotplt->output_section)) ++ if (bfd_is_abs_section (htab->sgotplt->output_section)) + { + _bfd_error_handler +- (_("discarded output section: `%pA'"), htab->elf.sgotplt); ++ (_("discarded output section: `%pA'"), htab->sgotplt); + return FALSE; + } + +- if (htab->elf.sgotplt->size > 0) ++ if (htab->sgotplt->size > 0) + { + /* Write the first two entries in .got.plt, needed for the dynamic + linker. */ + bfd_put_32 (output_bfd, (bfd_vma) -1, +- htab->elf.sgotplt->contents); ++ htab->sgotplt->contents); + bfd_put_32 (output_bfd, (bfd_vma) 0, +- htab->elf.sgotplt->contents + GOT_ENTRY_SIZE); ++ htab->sgotplt->contents + GOT_ENTRY_SIZE); + } + +- elf_section_data (htab->elf.sgotplt->output_section)->this_hdr.sh_entsize ++ elf_section_data (htab->sgotplt->output_section)->this_hdr.sh_entsize + = GOT_ENTRY_SIZE; + } + +- if (htab->elf.sgot) ++ if (htab->sgot) + { +- if (htab->elf.sgot->size > 0) ++ if (htab->sgot->size > 0) + { + /* Set the first entry in the global offset table to the address of + the dynamic section. */ + bfd_vma val = (sdyn ? + sdyn->output_section->vma + sdyn->output_offset : + 0); +- bfd_put_32 (output_bfd, val, htab->elf.sgot->contents); ++ bfd_put_32 (output_bfd, val, htab->sgot->contents); + } + +- elf_section_data (htab->elf.sgot->output_section)->this_hdr.sh_entsize ++ elf_section_data (htab->sgot->output_section)->this_hdr.sh_entsize + = GOT_ENTRY_SIZE; + } + +diff -rup binutils.orig/bfd/elf64-ppc.c binutils-2.35/bfd/elf64-ppc.c +--- binutils.orig/bfd/elf64-ppc.c 2020-07-30 15:04:05.363466721 +0100 ++++ binutils-2.35/bfd/elf64-ppc.c 2020-07-30 15:04:16.716393902 +0100 +@@ -3250,9 +3250,6 @@ struct ppc_link_hash_table + + /* Incremented every time we size stubs. */ + unsigned int stub_iteration; +- +- /* Small local sym cache. */ +- struct sym_cache sym_cache; + }; + + /* Rename some of the generic section flags to better document how they +@@ -4383,7 +4380,8 @@ ppc64_elf_before_check_relocs (bfd *ibfd + Elf_Internal_Sym *isym; + asection *s; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, r_symndx); ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, ibfd, ++ r_symndx); + if (isym == NULL) + { + if (elf_section_data (opd)->relocs != relocs) +@@ -4684,7 +4682,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc + } + else + { +- Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -4955,7 +4953,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc + { + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -5231,7 +5229,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf64-s390.c binutils-2.35/bfd/elf64-s390.c +--- binutils.orig/bfd/elf64-s390.c 2020-07-30 15:04:05.369466683 +0100 ++++ binutils-2.35/bfd/elf64-s390.c 2020-07-30 15:04:16.716393902 +0100 +@@ -663,9 +663,6 @@ struct elf_s390_link_hash_table + bfd_vma offset; + } tls_ldm_got; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Options passed from the linker. */ + struct s390_elf_params *params; + }; +@@ -852,7 +849,7 @@ elf_s390_check_relocs (bfd *abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -1216,7 +1213,7 @@ elf_s390_check_relocs (bfd *abfd, + asection *s; + void *vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -2258,7 +2255,7 @@ elf_s390_relocate_section (bfd *output_b + & 0xff00f000) == 0xe300c000 + && bfd_get_8 (input_bfd, + contents + rel->r_offset + 3) == 0x04)) +- && (isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ && (isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + input_bfd, r_symndx)) + && isym->st_shndx != SHN_ABS + && h != htab->elf.hdynamic +@@ -3572,7 +3569,7 @@ elf_s390_finish_dynamic_sections (bfd *o + if (local_plt[i].plt.offset != (bfd_vma) -1) + { + asection *sec = local_plt[i].sec; +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, i); ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, ibfd, i); + if (isym == NULL) + return FALSE; + +diff -rup binutils.orig/bfd/elf64-x86-64.c binutils-2.35/bfd/elf64-x86-64.c +--- binutils.orig/bfd/elf64-x86-64.c 2020-07-30 15:04:05.365466709 +0100 ++++ binutils-2.35/bfd/elf64-x86-64.c 2020-07-30 15:04:16.717393895 +0100 +@@ -1371,7 +1371,7 @@ elf_x86_64_tls_transition (struct bfd_li + { + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + name = bfd_elf_sym_name (abfd, symtab_hdr, isym, NULL); + } +@@ -1559,7 +1559,7 @@ elf_x86_64_convert_load_reloc (bfd *abfd + if (h == NULL) + { + Elf_Internal_Sym *isym +- = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx); ++ = bfd_sym_from_r_symndx (&htab->elf.sym_cache, abfd, r_symndx); + + /* Skip relocation against undefined symbols. */ + if (isym->st_shndx == SHN_UNDEF) +@@ -1907,7 +1907,7 @@ elf_x86_64_check_relocs (bfd *abfd, stru + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + goto error_return; +@@ -2308,7 +2308,7 @@ elf_x86_64_check_relocs (bfd *abfd, stru + asection *s; + void **vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + goto error_return; +diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.35/bfd/elfnn-aarch64.c +--- binutils.orig/bfd/elfnn-aarch64.c 2020-07-30 15:04:05.371466670 +0100 ++++ binutils-2.35/bfd/elfnn-aarch64.c 2020-07-30 15:04:16.717393895 +0100 +@@ -2643,9 +2643,6 @@ struct elf_aarch64_link_hash_table + /* The bytes of the subsequent PLT entry. */ + const bfd_byte *plt_entry; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* For convenience in allocate_dynrelocs. */ + bfd *obfd; + +@@ -7611,7 +7608,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, s + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -7838,7 +7835,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, s + asection *s; + void **vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +Only in binutils-2.35/bfd: elfnn-aarch64.c.orig +diff -rup binutils.orig/bfd/elfnn-riscv.c binutils-2.35/bfd/elfnn-riscv.c +--- binutils.orig/bfd/elfnn-riscv.c 2020-07-30 15:04:05.365466709 +0100 ++++ binutils-2.35/bfd/elfnn-riscv.c 2020-07-30 15:04:16.718393889 +0100 +@@ -113,9 +113,6 @@ struct riscv_elf_link_hash_table + /* Short-cuts to get to dynamic linker sections. */ + asection *sdyntdata; + +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_cache; +- + /* The max alignment of output sections. */ + bfd_vma max_alignment; + }; +@@ -681,7 +678,7 @@ riscv_elf_check_relocs (bfd *abfd, struc + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elfxx-mips.c binutils-2.35/bfd/elfxx-mips.c +--- binutils.orig/bfd/elfxx-mips.c 2020-07-30 15:04:05.376466638 +0100 ++++ binutils-2.35/bfd/elfxx-mips.c 2020-07-30 15:04:16.719393882 +0100 +@@ -527,9 +527,6 @@ struct mips_elf_link_hash_table + returns null. */ + asection *(*add_stub_section) (const char *, asection *, asection *); + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Is the PLT header compressed? */ + unsigned int plt_header_is_comp : 1; + }; +@@ -4401,7 +4398,7 @@ mips_elf_resolve_got_page_ref (void **re + Elf_Internal_Sym *isym; + + /* Read in the symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ref->u.abfd, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, ref->u.abfd, + ref->symndx); + if (isym == NULL) + { +diff -rup binutils.orig/bfd/elfxx-sparc.c binutils-2.35/bfd/elfxx-sparc.c +--- binutils.orig/bfd/elfxx-sparc.c 2020-07-30 15:04:05.360466741 +0100 ++++ binutils-2.35/bfd/elfxx-sparc.c 2020-07-30 15:04:16.719393882 +0100 +@@ -1391,7 +1391,8 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx); ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, abfd, ++ r_symndx); + if (isym == NULL) + return FALSE; + +diff -rup binutils.orig/bfd/elfxx-sparc.h binutils-2.35/bfd/elfxx-sparc.h +--- binutils.orig/bfd/elfxx-sparc.h 2020-07-30 15:04:05.367466696 +0100 ++++ binutils-2.35/bfd/elfxx-sparc.h 2020-07-30 15:04:16.719393882 +0100 +@@ -55,9 +55,6 @@ struct _bfd_sparc_elf_link_hash_table + bfd_vma offset; + } tls_ldm_got; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Used by local STT_GNU_IFUNC symbols. */ + htab_t loc_hash_table; + void *loc_hash_memory; +diff -rup binutils.orig/bfd/elfxx-tilegx.c binutils-2.35/bfd/elfxx-tilegx.c +--- binutils.orig/bfd/elfxx-tilegx.c 2020-07-30 15:04:05.362466728 +0100 ++++ binutils-2.35/bfd/elfxx-tilegx.c 2020-07-30 15:04:16.719393882 +0100 +@@ -835,9 +835,6 @@ struct tilegx_elf_link_hash_table + /* Whether LE transition has been disabled for some of the + sections. */ + bfd_boolean disable_le_transition; +- +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_cache; + }; + + +@@ -1979,7 +1976,7 @@ tilegx_elf_check_relocs (bfd *abfd, stru + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elfxx-x86.h binutils-2.35/bfd/elfxx-x86.h +--- binutils.orig/bfd/elfxx-x86.h 2020-07-30 15:04:05.378466625 +0100 ++++ binutils-2.35/bfd/elfxx-x86.h 2020-07-30 15:04:16.720393876 +0100 +@@ -468,9 +468,6 @@ struct elf_x86_link_hash_table + /* The amount of space used by the jump slots in the GOT. */ + bfd_vma sgotplt_jump_table_size; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* _TLS_MODULE_BASE_ symbol. */ + struct bfd_link_hash_entry *tls_module_base; + diff --git a/patches/binutils/2.35/binutils-attach-to-group.patch b/patches/binutils/2.35/binutils-attach-to-group.patch new file mode 100644 index 00000000..21640112 --- /dev/null +++ b/patches/binutils/2.35/binutils-attach-to-group.patch @@ -0,0 +1,70 @@ +diff -rup binutils.orig/gas/config/obj-elf.c binutils-2.34/gas/config/obj-elf.c +--- binutils.orig/gas/config/obj-elf.c 2020-02-02 11:34:11.858321477 +0000 ++++ binutils-2.34/gas/config/obj-elf.c 2020-02-02 11:34:30.099247619 +0000 +@@ -78,9 +78,11 @@ static void obj_elf_gnu_attribute (int); + static void obj_elf_tls_common (int); + static void obj_elf_lcomm (int); + static void obj_elf_struct (int); ++static void obj_elf_attach_to_group (int); + + static const pseudo_typeS elf_pseudo_table[] = + { ++ {"attach_to_group", obj_elf_attach_to_group, 0}, + {"comm", obj_elf_common, 0}, + {"common", obj_elf_common, 1}, + {"ident", obj_elf_ident, 0}, +@@ -1003,6 +1005,27 @@ obj_elf_section_name (void) + return name; + } + ++static void ++obj_elf_attach_to_group (int dummy ATTRIBUTE_UNUSED) ++{ ++ const char * gname = obj_elf_section_name (); ++ ++ if (gname == NULL) ++ { ++ as_warn ("group name not parseable"); ++ return; ++ } ++ ++ if (elf_group_name (now_seg)) ++ { ++ as_warn ("already has a group"); ++ return; ++ } ++ ++ elf_group_name (now_seg) = xstrdup (gname); ++ elf_section_flags (now_seg) |= SHF_GROUP; ++} ++ + void + obj_elf_section (int push) + { +Only in binutils-2.34/gas/config: obj-elf.c.orig +diff -rup binutils.orig/gas/doc/as.texi binutils-2.34/gas/doc/as.texi +--- binutils.orig/gas/doc/as.texi 2020-02-02 11:34:11.850321509 +0000 ++++ binutils-2.34/gas/doc/as.texi 2020-02-02 11:35:11.359080560 +0000 +@@ -4359,6 +4359,7 @@ Some machine configurations provide addi + * Altmacro:: @code{.altmacro} + * Ascii:: @code{.ascii "@var{string}"}@dots{} + * Asciz:: @code{.asciz "@var{string}"}@dots{} ++* Attach_to_group:: @code{.attach_to_group @var{name}} + * Balign:: @code{.balign [@var{abs-expr}[, @var{abs-expr}]]} + * Bundle directives:: @code{.bundle_align_mode @var{abs-expr}}, etc + * Byte:: @code{.byte @var{expressions}} +@@ -4656,6 +4657,12 @@ trailing zero byte) into consecutive add + @code{.asciz} is just like @code{.ascii}, but each string is followed by + a zero byte. The ``z'' in @samp{.asciz} stands for ``zero''. + ++@node Attach_to_group ++@section @code{.attach_to_group @var{name}} ++Attaches the current section to the named group. This is like declaring ++the section with the @code{G} attribute, but can be done after the section ++has been created. ++ + @node Balign + @section @code{.balign[wl] [@var{abs-expr}[, @var{abs-expr}[, @var{abs-expr}]]]} + +Only in binutils-2.34/gas/doc: as.texi.orig +Only in binutils-2.34/gas/doc: as.texi.rej diff --git a/patches/binutils/2.35/binutils-config.patch b/patches/binutils/2.35/binutils-config.patch new file mode 100644 index 00000000..8456584f --- /dev/null +++ b/patches/binutils/2.35/binutils-config.patch @@ -0,0 +1,44 @@ +diff -Nrup a/libiberty/aclocal.m4 b/libiberty/aclocal.m4 +--- a/libiberty/aclocal.m4 2019-01-19 09:01:34.000000000 -0700 ++++ b/libiberty/aclocal.m4 2020-01-09 22:00:27.183312982 -0700 +@@ -147,7 +147,7 @@ if test $ac_cv_os_cray = yes; then + fi + + AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, +-[AC_TRY_RUN([find_stack_direction () ++[AC_TRY_RUN([__attribute__ ((noclone,noinline)) find_stack_direction () + { + static char *addr = 0; + auto char dummy; +diff --git a/config/intdiv0.m4 b/config/intdiv0.m4 +index 55dddcf1..ba906efc 100644 +--- a/config/intdiv0.m4 ++++ b/config/intdiv0.m4 +@@ -31,10 +31,10 @@ sigfpe_handler (sig) int sig; + exit (sig != SIGFPE); + } + +-int x = 1; +-int y = 0; +-int z; +-int nan; ++volatile int x = 1; ++volatile int y = 0; ++volatile int z; ++volatile int nan; + + int main () + { +diff --git a/libiberty/configure.ac b/libiberty/configure.ac +index f1ce7601..fc20d228 100644 +--- a/libiberty/configure.ac ++++ b/libiberty/configure.ac +@@ -661,7 +661,7 @@ if test -z "${setobjs}"; then + for v in $vars; do + AC_MSG_CHECKING([for $v]) + AC_CACHE_VAL(libiberty_cv_var_$v, +- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[int *p;]],[[extern int $v []; p = $v;]])], ++ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[__attribute__ ((used)) int *p;]],[[extern int $v []; p = $v;]])], + [eval "libiberty_cv_var_$v=yes"], + [eval "libiberty_cv_var_$v=no"])]) + if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then diff --git a/patches/binutils/2.35/binutils-do-not-link-with-static-libstdc++.patch b/patches/binutils/2.35/binutils-do-not-link-with-static-libstdc++.patch new file mode 100644 index 00000000..49d46c2e --- /dev/null +++ b/patches/binutils/2.35/binutils-do-not-link-with-static-libstdc++.patch @@ -0,0 +1,83 @@ +diff -rup binutils.orig/configure binutils-2.30/configure +--- binutils.orig/configure 2018-09-24 17:50:06.967172922 +0100 ++++ binutils-2.30/configure 2018-09-24 17:51:16.648624865 +0100 +@@ -4996,49 +4996,6 @@ if test -z "$LD"; then + fi + fi + +-# Check whether -static-libstdc++ -static-libgcc is supported. +-have_static_libs=no +-if test "$GCC" = yes; then +- saved_LDFLAGS="$LDFLAGS" +- +- LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc" +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether g++ accepts -static-libstdc++ -static-libgcc" >&5 +-$as_echo_n "checking whether g++ accepts -static-libstdc++ -static-libgcc... " >&6; } +- ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' +-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +- +- +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) +-#error -static-libstdc++ not implemented +-#endif +-int main() {} +-_ACEOF +-if ac_fn_cxx_try_link "$LINENO"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; }; have_static_libs=yes +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' +-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +-ac_compiler_gnu=$ac_cv_c_compiler_gnu +- +- +- LDFLAGS="$saved_LDFLAGS" +-fi +- +- + + + if test -n "$ac_tool_prefix"; then +diff -rup binutils.orig/configure.ac binutils-2.30/configure.ac +--- binutils.orig/configure.ac 2018-09-24 17:50:07.241170767 +0100 ++++ binutils-2.30/configure.ac 2018-09-24 17:50:29.908992486 +0100 +@@ -1288,26 +1288,6 @@ if test -z "$LD"; then + fi + fi + +-# Check whether -static-libstdc++ -static-libgcc is supported. +-have_static_libs=no +-if test "$GCC" = yes; then +- saved_LDFLAGS="$LDFLAGS" +- +- LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc" +- AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc]) +- AC_LANG_PUSH(C++) +- AC_LINK_IFELSE([AC_LANG_SOURCE([ +-#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) +-#error -static-libstdc++ not implemented +-#endif +-int main() {}])], +- [AC_MSG_RESULT([yes]); have_static_libs=yes], +- [AC_MSG_RESULT([no])]) +- AC_LANG_POP(C++) +- +- LDFLAGS="$saved_LDFLAGS" +-fi +- + ACX_PROG_GNAT + ACX_PROG_CMP_IGNORE_INITIAL + diff --git a/patches/binutils/2.35/binutils-duplicate-sections.patch b/patches/binutils/2.35/binutils-duplicate-sections.patch new file mode 100644 index 00000000..441bb2ee --- /dev/null +++ b/patches/binutils/2.35/binutils-duplicate-sections.patch @@ -0,0 +1,34 @@ +diff -rup binutils.orig/ld/ldlang.c binutils-2.35.1/ld/ldlang.c +--- binutils.orig/ld/ldlang.c 2021-01-04 15:20:32.901498036 +0000 ++++ binutils-2.35.1/ld/ldlang.c 2021-01-04 15:22:03.151916333 +0000 +@@ -1529,6 +1529,8 @@ lang_output_section_statement_lookup (co + + entry->s.output_section_statement.name = name; + entry->s.output_section_statement.constraint = constraint; ++ entry->s.output_section_statement.dup_output = (create == 2 ++ || constraint == SPECIAL); + return &entry->s.output_section_statement; + } + +@@ -2390,7 +2392,7 @@ init_os (lang_output_section_statement_t + if (strcmp (s->name, DISCARD_SECTION_NAME) == 0) + einfo (_("%F%P: illegal use of `%s' section\n"), DISCARD_SECTION_NAME); + +- if (s->constraint != SPECIAL) ++ if (!s->dup_output) + s->bfd_section = bfd_get_section_by_name (link_info.output_bfd, s->name); + if (s->bfd_section == NULL) + s->bfd_section = bfd_make_section_anyway_with_flags (link_info.output_bfd, +diff -rup binutils.orig/ld/ldlang.h binutils-2.35.1/ld/ldlang.h +--- binutils.orig/ld/ldlang.h 2021-01-04 15:20:32.627499830 +0000 ++++ binutils-2.35.1/ld/ldlang.h 2021-01-04 15:21:06.688277003 +0000 +@@ -173,6 +173,9 @@ typedef struct lang_output_section_state + unsigned int after_end : 1; + /* If this section uses the alignment of its input sections. */ + unsigned int align_lma_with_input : 1; ++ /* If script has duplicate output section statements of the same name ++ create duplicate output sections. */ ++ unsigned int dup_output : 1; + } lang_output_section_statement_type; + + typedef struct diff --git a/patches/binutils/2.35/binutils-dwarf-5-dir0.patch b/patches/binutils/2.35/binutils-dwarf-5-dir0.patch new file mode 100644 index 00000000..72c75926 --- /dev/null +++ b/patches/binutils/2.35/binutils-dwarf-5-dir0.patch @@ -0,0 +1,186 @@ +diff -rup binutils.orig/gas/dwarf2dbg.c binutils-2.35.2/gas/dwarf2dbg.c +--- binutils.orig/gas/dwarf2dbg.c 2021-08-09 17:50:48.324447191 +0100 ++++ binutils-2.35.2/gas/dwarf2dbg.c 2021-08-09 17:51:03.308359865 +0100 +@@ -616,7 +616,22 @@ get_directory_table_entry (const char * + if (can_use_zero) + { + if (dirs == NULL || dirs[0] == NULL) +- d = 0; ++ { ++ const char * pwd = getpwd (); ++ ++ if (dwarf_level >= 5 && strcmp (dirname, pwd) != 0) ++ { ++ /* In DWARF-5 the 0 entry in the directory table is expected to be ++ the same as the DW_AT_comp_dir (which is set to the current build ++ directory). Since we are about to create a directory entry that ++ is not the same, allocate the current directory first. ++ FIXME: Alternatively we could generate an error message here. */ ++ (void) get_directory_table_entry (pwd, strlen (pwd), TRUE); ++ d = 1; ++ } ++ else ++ d = 0; ++ } + } + else if (d == 0) + d = 1; +@@ -624,8 +639,8 @@ get_directory_table_entry (const char * + if (d >= dirs_allocated) + { + unsigned int old = dirs_allocated; +- +- dirs_allocated = d + 32; ++#define DIR_TABLE_INCREMENT 32 ++ dirs_allocated = d + DIR_TABLE_INCREMENT; + dirs = XRESIZEVEC (char *, dirs, dirs_allocated); + memset (dirs + old, 0, (dirs_allocated - old) * sizeof (char *)); + } +@@ -820,7 +835,7 @@ allocate_filename_to_slot (const char * + dirlen = strlen (dirname); + file = filename; + } +- ++ + d = get_directory_table_entry (dirname, dirlen, num == 0); + i = num; + +@@ -2062,7 +2077,12 @@ out_dir_and_file_list (segT line_seg, in + Otherwise use pwd as main file directory. */ + if (dirs_in_use > 0 && dirs != NULL && dirs[0] != NULL) + dir = remap_debug_filename (dirs[0]); +- else if (dirs_in_use > 1 && dirs != NULL && dirs[1] != NULL) ++ else if (dirs_in_use > 1 ++ && dirs != NULL ++ && dirs[1] != NULL ++ /* DWARF-5 directory tables expect dir[0] to be the same as ++ DW_AT_comp_dir, which is the same as pwd. */ ++ && dwarf_level < 5) + dir = remap_debug_filename (dirs[1]); + else + dir = remap_debug_filename (getpwd ()); +@@ -2165,8 +2185,8 @@ out_dir_and_file_list (segT line_seg, in + uses slot zero, but that is only set explicitly using a + .file 0 directive. If that isn't used, but file 1 is, + then use that as main file name. */ +- if (DWARF2_LINE_VERSION >= 5 && i == 0 && files_in_use >= 1) +- files[0].filename = files[1].filename; ++ if (DWARF2_LINE_VERSION >= 5 && i == 0 && files_in_use >= 1 && files[0].filename == NULL) ++ files[0].filename = files[1].filename; + else + files[i].filename = ""; + if (DWARF2_LINE_VERSION < 5 || i != 0) +Only in binutils-2.35.2/gas/: dwarf2dbg.c.orig +Only in binutils-2.35.2/gas/: dwarf2dbg.c.rej +diff -rup binutils.orig/gas/testsuite/gas/elf/dwarf-5-file0.d binutils-2.35.2/gas/testsuite/gas/elf/dwarf-5-file0.d +--- binutils.orig/gas/testsuite/gas/elf/dwarf-5-file0.d 2021-08-09 17:50:48.394446783 +0100 ++++ binutils-2.35.2/gas/testsuite/gas/elf/dwarf-5-file0.d 2021-08-09 17:53:36.567466668 +0100 +@@ -3,17 +3,18 @@ + #readelf: -wl + + #... +- The Directory Table \(offset 0x.*, lines 3, columns 1\): ++ The Directory Table \(offset 0x.*, lines 4, columns 1\): + Entry Name +- 0 \(indirect line string, offset: 0x.*\): master directory +- 1 \(indirect line string, offset: 0x.*\): secondary directory +- 2 \(indirect line string, offset: 0x.*\): /tmp ++#... ++ 1 \(indirect line string, offset: 0x.*\): master directory ++ 2 \(indirect line string, offset: 0x.*\): secondary directory ++ 3 \(indirect line string, offset: 0x.*\): /tmp + + The File Name Table \(offset 0x.*, lines 3, columns 3\): + Entry Dir MD5 Name +- 0 0 0x00000000000000000000000000000000 \(indirect line string, offset: 0x.*\): master source file +- 1 1 0x00000000000000000000000000000000 \(indirect line string, offset: 0x.*\): secondary source file +- 2 2 0x95828e8bc4f7404dbf7526fb7bd0f192 \(indirect line string, offset: 0x.*\): foo.c ++ 0 1 0x00000000000000000000000000000000 \(indirect line string, offset: 0x.*\): master source file ++ 1 2 0x00000000000000000000000000000000 \(indirect line string, offset: 0x.*\): secondary source file ++ 2 3 0x95828e8bc4f7404dbf7526fb7bd0f192 \(indirect line string, offset: 0x.*\): foo.c + #pass + + +Only in binutils-2.35.2/gas/testsuite/gas/elf: dwarf-5-file0.d.orig +Only in binutils-2.35.2/gas/testsuite/gas/elf: dwarf-5-file0.d.rej +diff -rup binutils.orig/gas/testsuite/gas/elf/elf.exp binutils-2.35.2/gas/testsuite/gas/elf/elf.exp +--- binutils.orig/gas/testsuite/gas/elf/elf.exp 2021-08-09 17:50:48.395446778 +0100 ++++ binutils-2.35.2/gas/testsuite/gas/elf/elf.exp 2021-08-09 17:51:03.308359865 +0100 +@@ -274,6 +274,7 @@ if { [is_elf_format] } then { + run_dump_test "dwarf2-18" $dump_opts + run_dump_test "dwarf2-19" $dump_opts + run_dump_test "dwarf-5-file0" $dump_opts ++ run_dump_test "dwarf-5-dir0" $dump_opts + run_dump_test "dwarf-4-cu" $dump_opts + run_dump_test "dwarf-5-cu" $dump_opts + run_dump_test "dwarf-5-nop-for-line-table" $dump_opts +Only in binutils-2.35.2/gas/testsuite/gas/elf: elf.exp.orig +diff -rup binutils.orig/gas/testsuite/gas/i386/dwarf5-line-1.d binutils-2.35.2/gas/testsuite/gas/i386/dwarf5-line-1.d +--- binutils.orig/gas/testsuite/gas/i386/dwarf5-line-1.d 2021-08-09 17:50:48.363446964 +0100 ++++ binutils-2.35.2/gas/testsuite/gas/i386/dwarf5-line-1.d 2021-08-09 17:51:03.308359865 +0100 +@@ -33,7 +33,7 @@ Raw dump of debug contents of section \. + + The Directory Table \(offset 0x.*, lines 2, columns 1\): + Entry Name +- 0 \(indirect line string, offset: 0x.*\): .*/gas/testsuite/gas/i386 ++ 0 \(indirect line string, offset: 0x.*\): .*/gas/testsuite + 1 \(indirect line string, offset: 0x.*\): .*/gas/testsuite/gas/i386 + + The File Name Table \(offset 0x.*, lines 2, columns 3\): +diff -rup binutils.orig/gas/testsuite/gas/i386/dwarf5-line-2.d binutils-2.35.2/gas/testsuite/gas/i386/dwarf5-line-2.d +--- binutils.orig/gas/testsuite/gas/i386/dwarf5-line-2.d 2021-08-09 17:50:48.365446953 +0100 ++++ binutils-2.35.2/gas/testsuite/gas/i386/dwarf5-line-2.d 2021-08-09 17:51:03.308359865 +0100 +@@ -33,7 +33,7 @@ Raw dump of debug contents of section \. + + The Directory Table \(offset 0x.*, lines 2, columns 1\): + Entry Name +- 0 \(indirect line string, offset: 0x.*\): .*/gas/testsuite/gas/i386 ++ 0 \(indirect line string, offset: 0x.*\): .*/gas/testsuite + 1 \(indirect line string, offset: 0x.*\): .*/gas/testsuite/gas/i386 + + The File Name Table \(offset 0x.*, lines 1, columns 3\): +--- /dev/null 2021-08-09 07:51:33.817495606 +0100 ++++ binutils-2.35.2/gas/testsuite/gas/elf/dwarf-5-dir0.s 2021-08-09 17:55:06.745941103 +0100 +@@ -0,0 +1,19 @@ ++ .section .debug_info,"",%progbits ++ .4byte 0x8a ++ .2byte 0x2 ++ .4byte .Ldebug_abbrev0 ++ .byte 0x4 ++ .uleb128 0x1 ++ ++ .file 0 "../not-the-build-directory/master-source-file.c" ++ .line 1 ++ .text ++ .octa 0x12345678901234567890123456789012 ++ ++ .file 1 "secondary directory/secondary source file" ++ .line 2 ++ .word 2 ++ ++ .file 2 "/tmp" "foo.c" md5 0x95828e8bc4f7404dbf7526fb7bd0f192 ++ .line 5 ++ .word 6 +--- /dev/null 2021-08-09 07:51:33.817495606 +0100 ++++ binutils-2.35.2/gas/testsuite/gas/elf/dwarf-5-dir0.d 2021-08-09 17:55:06.745941103 +0100 +@@ -0,0 +1,20 @@ ++#as: --gdwarf-5 ++#name: DWARF5 dir[0] ++#readelf: -wl ++ ++#... ++ The Directory Table \(offset 0x.*, lines 4, columns 1\): ++ Entry Name ++ 0 \(indirect line string, offset: 0x0\): .*/gas/testsuite ++ 1 \(indirect line string, offset: 0x.*\): ../not-the-build-directory ++ 2 \(indirect line string, offset: 0x.*\): secondary directory ++ 3 \(indirect line string, offset: 0x.*\): /tmp ++ ++ The File Name Table \(offset 0x.*, lines 3, columns 3\): ++ Entry Dir MD5 Name ++ 0 1 0x0 \(indirect line string, offset: 0x.*\): master-source-file.c ++ 1 2 0x0 \(indirect line string, offset: 0x.*\): secondary source file ++ 2 3 0x95828e8bc4f7404dbf7526fb7bd0f192 \(indirect line string, offset: 0x.*\): foo.c ++#pass ++ ++ diff --git a/patches/binutils/2.35/binutils-dwarf-DW_FORM_ref8.patch b/patches/binutils/2.35/binutils-dwarf-DW_FORM_ref8.patch new file mode 100644 index 00000000..ce6627f3 --- /dev/null +++ b/patches/binutils/2.35/binutils-dwarf-DW_FORM_ref8.patch @@ -0,0 +1,34 @@ +diff --git a/binutils/dwarf.c b/binutils/dwarf.c +index 5807744729..cf68ebaff7 100644 +--- a/binutils/dwarf.c ++++ b/binutils/dwarf.c +@@ -2025,6 +2025,21 @@ skip_attr_bytes (unsigned long form, + break; + + case DW_FORM_ref8: ++ { ++ dwarf_vma high_bits; ++ ++ SAFE_BYTE_GET64 (data, &high_bits, &uvalue, end); ++ data += 8; ++ if (sizeof (uvalue) > 4) ++ uvalue += high_bits << 32; ++ else if (high_bits != 0) ++ { ++ /* FIXME: What to do ? */ ++ return NULL; ++ } ++ break; ++ } ++ + case DW_FORM_data8: + case DW_FORM_ref_sig8: + data += 8; +@@ -2115,6 +2130,7 @@ get_type_abbrev_from_form (unsigned long form, + case DW_FORM_ref1: + case DW_FORM_ref2: + case DW_FORM_ref4: ++ case DW_FORM_ref8: + case DW_FORM_ref_udata: + if (uvalue + cu_offset > section->size) + { diff --git a/patches/binutils/2.35/binutils-dwarf-type-sign-2.patch b/patches/binutils/2.35/binutils-dwarf-type-sign-2.patch new file mode 100644 index 00000000..ce600d4c --- /dev/null +++ b/patches/binutils/2.35/binutils-dwarf-type-sign-2.patch @@ -0,0 +1,142 @@ +--- binutils.orig/binutils/dwarf.c 2020-11-03 17:10:15.182386267 +0000 ++++ binutils-2.35.1/binutils/dwarf.c 2020-11-03 17:14:38.660411672 +0000 +@@ -876,6 +876,7 @@ typedef struct abbrev_list + { + abbrev_entry * first_abbrev; + abbrev_entry * last_abbrev; ++ dwarf_vma abbrev_base; + dwarf_vma abbrev_offset; + struct abbrev_list * next; + unsigned char * start_of_next_abbrevs; +@@ -955,10 +956,11 @@ free_all_abbrevs (void) + } + + static abbrev_list * +-new_abbrev_list (dwarf_vma abbrev_offset) ++new_abbrev_list (dwarf_vma abbrev_base, dwarf_vma abbrev_offset) + { + abbrev_list * list = (abbrev_list *) xcalloc (sizeof * list, 1); + ++ list->abbrev_base = abbrev_base; + list->abbrev_offset = abbrev_offset; + + list->next = abbrev_lists; +@@ -968,12 +970,14 @@ new_abbrev_list (dwarf_vma abbrev_offset + } + + static abbrev_list * +-find_abbrev_list_by_abbrev_offset (dwarf_vma abbrev_offset) ++find_abbrev_list_by_abbrev_offset (dwarf_vma abbrev_base, ++ dwarf_vma abbrev_offset) + { + abbrev_list * list; + + for (list = abbrev_lists; list != NULL; list = list->next) +- if (list->abbrev_offset == abbrev_offset) ++ if (list->abbrev_base == abbrev_base ++ && list->abbrev_offset == abbrev_offset) + return list; + + return NULL; +@@ -2415,10 +2419,10 @@ read_and_display_attr_value (unsigned lo + case DW_FORM_ref_addr: + if (dwarf_version == 2) + SAFE_BYTE_GET_AND_INC (uvalue, data, pointer_size, end); +- else if (dwarf_version == 3 || dwarf_version == 4) ++ else if (dwarf_version > 2) + SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end); + else +- error (_("Internal error: DWARF version is not 2, 3 or 4.\n")); ++ error (_("Internal error: DW_FORM_ref_addr is not supported in DWARF version 1.\n")); + break; + + case DW_FORM_addr: +@@ -3455,6 +3459,8 @@ process_debug_info (struct dwarf_section + { + DWARF2_Internal_CompUnit compunit; + unsigned char * hdrptr; ++ dwarf_vma abbrev_base; ++ size_t abbrev_size; + dwarf_vma cu_offset; + unsigned int offset_size; + unsigned int initial_length_size; +@@ -3499,25 +3505,25 @@ process_debug_info (struct dwarf_section + + SAFE_BYTE_GET_AND_INC (compunit.cu_abbrev_offset, hdrptr, offset_size, end); + +- list = find_abbrev_list_by_abbrev_offset (compunit.cu_abbrev_offset); ++ if (this_set == NULL) ++ { ++ abbrev_base = 0; ++ abbrev_size = debug_displays [abbrev_sec].section.size; ++ } ++ else ++ { ++ abbrev_base = this_set->section_offsets [DW_SECT_ABBREV]; ++ abbrev_size = this_set->section_sizes [DW_SECT_ABBREV]; ++ } ++ ++ list = find_abbrev_list_by_abbrev_offset (abbrev_base, ++ compunit.cu_abbrev_offset); + if (list == NULL) + { +- dwarf_vma abbrev_base; +- size_t abbrev_size; + unsigned char * next; + +- if (this_set == NULL) +- { +- abbrev_base = 0; +- abbrev_size = debug_displays [abbrev_sec].section.size; +- } +- else +- { +- abbrev_base = this_set->section_offsets [DW_SECT_ABBREV]; +- abbrev_size = this_set->section_sizes [DW_SECT_ABBREV]; +- } +- +- list = new_abbrev_list (compunit.cu_abbrev_offset); ++ list = new_abbrev_list (abbrev_base, ++ compunit.cu_abbrev_offset); + next = process_abbrev_set + (((unsigned char *) debug_displays [abbrev_sec].section.start + + abbrev_base + compunit.cu_abbrev_offset), +@@ -3734,12 +3740,14 @@ process_debug_info (struct dwarf_section + (unsigned long) debug_displays [abbrev_sec].section.size); + else + { +- list = find_abbrev_list_by_abbrev_offset (compunit.cu_abbrev_offset); ++ list = find_abbrev_list_by_abbrev_offset (abbrev_base, ++ compunit.cu_abbrev_offset); + if (list == NULL) + { + unsigned char * next; + +- list = new_abbrev_list (compunit.cu_abbrev_offset); ++ list = new_abbrev_list (abbrev_base, ++ compunit.cu_abbrev_offset); + next = process_abbrev_set + (((unsigned char *) debug_displays [abbrev_sec].section.start + + abbrev_base + compunit.cu_abbrev_offset), +@@ -5304,7 +5312,7 @@ display_debug_lines_decoded (struct dwar + else + { + newFileName = (char *) xmalloc (fileNameLength + 1); +- strcpy (newFileName, fileName); ++ strncpy (newFileName, fileName, fileNameLength + 1); + } + + if (!do_wide || (fileNameLength <= MAX_FILENAME_LENGTH)) +@@ -6029,10 +6037,10 @@ display_debug_abbrev (struct dwarf_secti + dwarf_vma offset; + + offset = start - section->start; +- list = find_abbrev_list_by_abbrev_offset (offset); ++ list = find_abbrev_list_by_abbrev_offset (0, offset); + if (list == NULL) + { +- list = new_abbrev_list (offset); ++ list = new_abbrev_list (0, offset); + start = process_abbrev_set (start, end, list); + list->start_of_next_abbrevs = start; + } diff --git a/patches/binutils/2.35/binutils-dwarf-type-sign.patch b/patches/binutils/2.35/binutils-dwarf-type-sign.patch new file mode 100644 index 00000000..0c81b929 --- /dev/null +++ b/patches/binutils/2.35/binutils-dwarf-type-sign.patch @@ -0,0 +1,931 @@ +--- binutils.orig/binutils/dwarf.c 2020-10-21 14:15:47.101351869 +0100 ++++ binutils-2.35.1/binutils/dwarf.c 2020-10-21 14:17:44.608585923 +0100 +@@ -1868,7 +1868,7 @@ skip_attr_bytes (unsigned long + case DW_FORM_ref_addr: + if (dwarf_version == 2) + SAFE_BYTE_GET_AND_INC (uvalue, data, pointer_size, end); +- else if (dwarf_version == 3 || dwarf_version == 4) ++ else if (dwarf_version > 2) + SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end); + else + return NULL; +@@ -1920,6 +1920,7 @@ skip_attr_bytes (unsigned long + + case DW_FORM_ref8: + case DW_FORM_data8: ++ case DW_FORM_ref_sig8: + data += 8; + break; + +@@ -1934,6 +1935,7 @@ skip_attr_bytes (unsigned long + case DW_FORM_block: + case DW_FORM_exprloc: + READ_ULEB (uvalue, data, end); ++ data += uvalue; + break; + + case DW_FORM_block1: +@@ -1951,12 +1953,12 @@ skip_attr_bytes (unsigned long + data += 4 + uvalue; + break; + +- case DW_FORM_ref_sig8: +- data += 8; +- break; +- + case DW_FORM_indirect: +- /* FIXME: Handle this form. */ ++ READ_ULEB (form, data, end); ++ if (form == DW_FORM_implicit_const) ++ SKIP_ULEB (data, end); ++ return skip_attr_bytes (form, data, end, pointer_size, offset_size, dwarf_version, value_return); ++ + default: + return NULL; + } +@@ -1978,7 +1980,7 @@ get_type_signedness (unsigned char * + dwarf_vma offset_size, + int dwarf_version, + bfd_boolean * is_signed, +- bfd_boolean is_nested) ++ unsigned int nesting) + { + unsigned long abbrev_number; + abbrev_entry * entry; +@@ -1997,6 +1999,14 @@ get_type_signedness (unsigned char * + /* FIXME: Issue a warning ? */ + return; + ++#define MAX_NESTING 20 ++ if (nesting > MAX_NESTING) ++ { ++ /* FIXME: Warn - or is this expected ? ++ NB/ We need to avoid infinite recursion. */ ++ return; ++ } ++ + for (attr = entry->first_attr; + attr != NULL && attr->attribute; + attr = attr->next) +@@ -2019,16 +2029,12 @@ get_type_signedness (unsigned char * + #endif + case DW_AT_type: + /* Recurse. */ +- if (is_nested) +- { +- /* FIXME: Warn - or is this expected ? +- NB/ We need to avoid infinite recursion. */ +- return; +- } + if (uvalue >= (size_t) (end - start)) + return; +- get_type_signedness (start, start + uvalue, end, pointer_size, +- offset_size, dwarf_version, is_signed, TRUE); ++ /* We cannot correctly process DW_FORM_ref_addr at the moment. */ ++ if (attr->form != DW_FORM_ref_addr) ++ get_type_signedness (start, start + uvalue, end, pointer_size, ++ offset_size, dwarf_version, is_signed, nesting + 1); + break; + + case DW_AT_encoding: +@@ -2206,7 +2212,6 @@ read_and_display_attr_value (unsigned lo + SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end); + else + error (_("Internal error: DWARF version is not 2, 3 or 4.\n")); +- + break; + + case DW_FORM_addr: +@@ -2246,8 +2251,8 @@ read_and_display_attr_value (unsigned lo + uvalue = svalue; + break; + +- case DW_FORM_GNU_str_index: + case DW_FORM_ref_udata: ++ case DW_FORM_GNU_str_index: + case DW_FORM_udata: + case DW_FORM_GNU_addr_index: + READ_ULEB (uvalue, data, end); +@@ -2663,8 +2668,10 @@ read_and_display_attr_value (unsigned lo + { + bfd_boolean is_signed = FALSE; + +- get_type_signedness (start, start + uvalue, end, pointer_size, +- offset_size, dwarf_version, & is_signed, FALSE); ++ /* We cannot correctly process DW_FORM_ref_addr at the moment. */ ++ if (form != DW_FORM_ref_addr) ++ get_type_signedness (start, start + uvalue, end, pointer_size, ++ offset_size, dwarf_version, & is_signed, 0); + level_type_signed[level] = is_signed; + } + break; +diff -rup binutils.orig/binutils/dwarf.c binutils-2.35.1/binutils/dwarf.c +--- binutils.orig/binutils/dwarf.c 2020-10-27 16:24:29.489636820 +0000 ++++ binutils-2.35.1/binutils/dwarf.c 2020-10-27 16:24:44.507568083 +0000 +@@ -849,101 +849,204 @@ fetch_indexed_value (dwarf_vma offset, d + /* FIXME: There are better and more efficient ways to handle + these structures. For now though, I just want something that + is simple to implement. */ ++/* Records a single attribute in an abbrev. */ + typedef struct abbrev_attr + { +- unsigned long attribute; +- unsigned long form; +- bfd_signed_vma implicit_const; +- struct abbrev_attr *next; ++ unsigned long attribute; ++ unsigned long form; ++ bfd_signed_vma implicit_const; ++ struct abbrev_attr * next; + } + abbrev_attr; + ++/* Records a single abbrev. */ + typedef struct abbrev_entry + { +- unsigned long entry; +- unsigned long tag; +- int children; +- struct abbrev_attr *first_attr; +- struct abbrev_attr *last_attr; +- struct abbrev_entry *next; ++ unsigned long number; ++ unsigned long tag; ++ int children; ++ struct abbrev_attr * first_attr; ++ struct abbrev_attr * last_attr; ++ struct abbrev_entry * next; + } + abbrev_entry; + +-static abbrev_entry *first_abbrev = NULL; +-static abbrev_entry *last_abbrev = NULL; ++/* Records a set of abbreviations. */ ++typedef struct abbrev_list ++{ ++ abbrev_entry * first_abbrev; ++ abbrev_entry * last_abbrev; ++ dwarf_vma abbrev_offset; ++ struct abbrev_list * next; ++ unsigned char * start_of_next_abbrevs; ++} ++abbrev_list; ++ ++/* Records all the abbrevs found so far. */ ++static struct abbrev_list * abbrev_lists = NULL; ++ ++typedef struct abbrev_map ++{ ++ dwarf_vma start; ++ dwarf_vma end; ++ abbrev_list * list; ++} abbrev_map; ++ ++/* Maps between CU offsets and abbrev sets. */ ++static abbrev_map * cu_abbrev_map = NULL; ++static unsigned long num_abbrev_map_entries = 0; ++static unsigned long next_free_abbrev_map_entry = 0; ++ ++#define INITIAL_NUM_ABBREV_MAP_ENTRIES 8 ++#define ABBREV_MAP_ENTRIES_INCREMENT 8 ++ ++static void ++record_abbrev_list_for_cu (dwarf_vma start, dwarf_vma end, abbrev_list * list) ++{ ++ if (cu_abbrev_map == NULL) ++ { ++ num_abbrev_map_entries = INITIAL_NUM_ABBREV_MAP_ENTRIES; ++ cu_abbrev_map = xmalloc (num_abbrev_map_entries * sizeof (* cu_abbrev_map)); ++ } ++ else if (next_free_abbrev_map_entry == num_abbrev_map_entries) ++ { ++ num_abbrev_map_entries += ABBREV_MAP_ENTRIES_INCREMENT; ++ cu_abbrev_map = xrealloc (cu_abbrev_map, num_abbrev_map_entries * sizeof (* cu_abbrev_map)); ++ } ++ ++ cu_abbrev_map[next_free_abbrev_map_entry].start = start; ++ cu_abbrev_map[next_free_abbrev_map_entry].end = end; ++ cu_abbrev_map[next_free_abbrev_map_entry].list = list; ++ next_free_abbrev_map_entry ++; ++} + + static void +-free_abbrevs (void) ++free_all_abbrevs (void) + { +- abbrev_entry *abbrv; ++ abbrev_list * list; + +- for (abbrv = first_abbrev; abbrv;) ++ for (list = abbrev_lists; list != NULL;) + { +- abbrev_entry *next_abbrev = abbrv->next; +- abbrev_attr *attr; ++ abbrev_list * next = list->next; ++ abbrev_entry * abbrv; + +- for (attr = abbrv->first_attr; attr;) ++ for (abbrv = list->first_abbrev; abbrv != NULL;) + { +- abbrev_attr *next_attr = attr->next; ++ abbrev_entry * next_abbrev = abbrv->next; ++ abbrev_attr * attr; + +- free (attr); +- attr = next_attr; ++ for (attr = abbrv->first_attr; attr;) ++ { ++ abbrev_attr *next_attr = attr->next; ++ ++ free (attr); ++ attr = next_attr; ++ } ++ ++ free (abbrv); ++ abbrv = next_abbrev; + } + +- free (abbrv); +- abbrv = next_abbrev; ++ free (list); ++ list = next; + } + +- last_abbrev = first_abbrev = NULL; ++ abbrev_lists = NULL; ++} ++ ++static abbrev_list * ++new_abbrev_list (dwarf_vma abbrev_offset) ++{ ++ abbrev_list * list = (abbrev_list *) xcalloc (sizeof * list, 1); ++ ++ list->abbrev_offset = abbrev_offset; ++ ++ list->next = abbrev_lists; ++ abbrev_lists = list; ++ ++ return list; ++} ++ ++static abbrev_list * ++find_abbrev_list_by_abbrev_offset (dwarf_vma abbrev_offset) ++{ ++ abbrev_list * list; ++ ++ for (list = abbrev_lists; list != NULL; list = list->next) ++ if (list->abbrev_offset == abbrev_offset) ++ return list; ++ ++ return NULL; ++} ++ ++/* Find the abbreviation map for the CU that includes OFFSET. ++ OFFSET is an absolute offset from the start of the .debug_info section. */ ++/* FIXME: This function is going to slow down readelf & objdump. ++ Consider using a better algorithm to mitigate this effect. */ ++ ++static abbrev_map * ++find_abbrev_map_by_offset (dwarf_vma offset) ++{ ++ unsigned long i; ++ ++ for (i = 0; i < next_free_abbrev_map_entry; i++) ++ if (cu_abbrev_map[i].start <= offset ++ && cu_abbrev_map[i].end > offset) ++ return cu_abbrev_map + i; ++ ++ return NULL; + } + + static void +-add_abbrev (unsigned long number, unsigned long tag, int children) ++add_abbrev (unsigned long number, ++ unsigned long tag, ++ int children, ++ abbrev_list * list) + { +- abbrev_entry *entry; ++ abbrev_entry * entry; + +- entry = (abbrev_entry *) malloc (sizeof (*entry)); +- if (entry == NULL) +- /* ugg */ +- return; ++ entry = (abbrev_entry *) xmalloc (sizeof (*entry)); + +- entry->entry = number; ++ entry->number = number; + entry->tag = tag; + entry->children = children; + entry->first_attr = NULL; + entry->last_attr = NULL; + entry->next = NULL; + +- if (first_abbrev == NULL) +- first_abbrev = entry; ++ assert (list != NULL); ++ ++ if (list->first_abbrev == NULL) ++ list->first_abbrev = entry; + else +- last_abbrev->next = entry; ++ list->last_abbrev->next = entry; + +- last_abbrev = entry; ++ list->last_abbrev = entry; + } + + static void +-add_abbrev_attr (unsigned long attribute, unsigned long form, +- bfd_signed_vma implicit_const) ++add_abbrev_attr (unsigned long attribute, ++ unsigned long form, ++ bfd_signed_vma implicit_const, ++ abbrev_list * list) + { + abbrev_attr *attr; + +- attr = (abbrev_attr *) malloc (sizeof (*attr)); +- if (attr == NULL) +- /* ugg */ +- return; ++ attr = (abbrev_attr *) xmalloc (sizeof (*attr)); + + attr->attribute = attribute; + attr->form = form; + attr->implicit_const = implicit_const; + attr->next = NULL; + +- if (last_abbrev->first_attr == NULL) +- last_abbrev->first_attr = attr; ++ assert (list != NULL && list->last_abbrev != NULL); ++ ++ if (list->last_abbrev->first_attr == NULL) ++ list->last_abbrev->first_attr = attr; + else +- last_abbrev->last_attr->next = attr; ++ list->last_abbrev->last_attr->next = attr; + +- last_abbrev->last_attr = attr; ++ list->last_abbrev->last_attr = attr; + } + + /* Processes the (partial) contents of a .debug_abbrev section. +@@ -952,11 +1055,10 @@ add_abbrev_attr (unsigned long attribute + an abbreviation set was found. */ + + static unsigned char * +-process_abbrev_section (unsigned char *start, unsigned char *end) ++process_abbrev_set (unsigned char * start, ++ const unsigned char * end, ++ abbrev_list * list) + { +- if (first_abbrev != NULL) +- return NULL; +- + while (start < end) + { + unsigned long entry; +@@ -966,7 +1068,7 @@ process_abbrev_section (unsigned char *s + + READ_ULEB (entry, start, end); + +- /* A single zero is supposed to end the section according ++ /* A single zero is supposed to end the set according + to the standard. If there's more, then signal that to + the caller. */ + if (start == end) +@@ -980,7 +1082,7 @@ process_abbrev_section (unsigned char *s + + children = *start++; + +- add_abbrev (entry, tag, children); ++ add_abbrev (entry, tag, children, list); + + do + { +@@ -1003,7 +1105,7 @@ process_abbrev_section (unsigned char *s + break; + } + +- add_abbrev_attr (attribute, form, implicit_const); ++ add_abbrev_attr (attribute, form, implicit_const, list); + } + while (attribute != 0); + } +@@ -1969,36 +2071,123 @@ skip_attr_bytes (unsigned long + return data; + } + +-/* Return IS_SIGNED set to TRUE if the type at +- DATA can be determined to be a signed type. */ ++/* Given form FORM with value UVALUE, locate and return the abbreviation ++ associated with it. */ ++ ++static abbrev_entry * ++get_type_abbrev_from_form (unsigned long form, ++ unsigned long uvalue, ++ dwarf_vma cu_offset, ++ const struct dwarf_section * section, ++ unsigned long * abbrev_num_return, ++ unsigned char ** data_return, ++ unsigned long * cu_offset_return) ++{ ++ unsigned long abbrev_number; ++ abbrev_map * map; ++ abbrev_entry * entry; ++ unsigned char * data; ++ ++ if (abbrev_num_return != NULL) ++ * abbrev_num_return = 0; ++ if (data_return != NULL) ++ * data_return = NULL; ++ ++ switch (form) ++ { ++ case DW_FORM_GNU_ref_alt: ++ /* FIXME: We are unable to handle this form at the moment. */ ++ return NULL; ++ ++ case DW_FORM_ref_addr: ++ if (uvalue >= section->size) ++ { ++ warn (_("Unable to resolve ref_addr form: uvalue %lx > section size %lx (%s)\n"), ++ uvalue, (long) section->size, section->name); ++ return NULL; ++ } ++ break; ++ ++ case DW_FORM_ref1: ++ case DW_FORM_ref2: ++ case DW_FORM_ref4: ++ case DW_FORM_ref_udata: ++ if (uvalue + cu_offset > section->size) ++ { ++ warn (_("Unable to resolve ref form: uvalue %lx + cu_offset %lx > section size %lx\n"), ++ uvalue, (long) cu_offset, (long) section->size); ++ return NULL; ++ } ++ uvalue += cu_offset; ++ break; ++ ++ /* FIXME: Are there other DW_FORMs that can be used by types ? */ ++ ++ default: ++ warn (_("Unexpected form %lx encountered whilst finding abbreviation for type\n"), form); ++ return NULL; ++ } ++ ++ data = (unsigned char *) section->start + uvalue; ++ map = find_abbrev_map_by_offset (uvalue); ++ ++ if (map == NULL) ++ { ++ warn (_("Unable to find abbreviations for CU offset %#lx\n"), uvalue); ++ return NULL; ++ } ++ if (map->list == NULL) ++ { ++ warn (_("Empty abbreviation list encountered for CU offset %lx\n"), uvalue); ++ return NULL; ++ } ++ ++ if (cu_offset_return != NULL) ++ { ++ if (form == DW_FORM_ref_addr) ++ * cu_offset_return = map->start; ++ else ++ * cu_offset_return = cu_offset; ++ } ++ ++ READ_ULEB (abbrev_number, data, section->start + section->size); ++ ++ for (entry = map->list->first_abbrev; entry != NULL; entry = entry->next) ++ if (entry->number == abbrev_number) ++ break; ++ ++ if (abbrev_num_return != NULL) ++ * abbrev_num_return = abbrev_number; ++ ++ if (data_return != NULL) ++ * data_return = data; ++ ++ if (entry == NULL) ++ warn (_("Unable to find entry for abbreviation %lu\n"), abbrev_number); ++ ++ return entry; ++} ++ ++/* Return IS_SIGNED set to TRUE if the type using abbreviation ENTRY ++ can be determined to be a signed type. The data for ENTRY can be ++ found starting at DATA. */ + + static void +-get_type_signedness (unsigned char * start, ++get_type_signedness (abbrev_entry * entry, ++ const struct dwarf_section * section, + unsigned char * data, + unsigned const char * end, ++ dwarf_vma cu_offset, + dwarf_vma pointer_size, + dwarf_vma offset_size, + int dwarf_version, + bfd_boolean * is_signed, + unsigned int nesting) + { +- unsigned long abbrev_number; +- abbrev_entry * entry; + abbrev_attr * attr; + + * is_signed = FALSE; + +- READ_ULEB (abbrev_number, data, end); +- +- for (entry = first_abbrev; +- entry != NULL && entry->entry != abbrev_number; +- entry = entry->next) +- continue; +- +- if (entry == NULL) +- /* FIXME: Issue a warning ? */ +- return; +- + #define MAX_NESTING 20 + if (nesting > MAX_NESTING) + { +@@ -2011,6 +2200,7 @@ get_type_signedness (unsigned char * + attr != NULL && attr->attribute; + attr = attr->next) + { ++ unsigned char * orig_data = data; + dwarf_vma uvalue = 0; + + data = skip_attr_bytes (attr->form, data, end, pointer_size, +@@ -2020,21 +2210,38 @@ get_type_signedness (unsigned char * + + switch (attr->attribute) + { +-#if 0 /* FIXME: It would be nice to print the name of the type, +- but this would mean updating a lot of binutils tests. */ ++ case DW_AT_linkage_name: + case DW_AT_name: +- if (attr->form == DW_FORM_strp) +- printf ("%s", fetch_indirect_string (uvalue)); ++ if (do_wide) ++ { ++ if (attr->form == DW_FORM_strp) ++ printf (", %s", fetch_indirect_string (uvalue)); ++ else if (attr->form == DW_FORM_string) ++ printf (", %s", orig_data); ++ } + break; +-#endif ++ + case DW_AT_type: + /* Recurse. */ +- if (uvalue >= (size_t) (end - start)) +- return; +- /* We cannot correctly process DW_FORM_ref_addr at the moment. */ +- if (attr->form != DW_FORM_ref_addr) +- get_type_signedness (start, start + uvalue, end, pointer_size, +- offset_size, dwarf_version, is_signed, nesting + 1); ++ { ++ abbrev_entry * type_abbrev; ++ unsigned char * type_data; ++ unsigned long type_cu_offset; ++ ++ type_abbrev = get_type_abbrev_from_form (attr->form, ++ uvalue, ++ cu_offset, ++ section, ++ NULL /* abbrev num return */, ++ & type_data, ++ & type_cu_offset); ++ if (type_abbrev == NULL) ++ break; ++ ++ get_type_signedness (type_abbrev, section, type_data, end, type_cu_offset, ++ pointer_size, offset_size, dwarf_version, ++ is_signed, nesting + 1); ++ } + break; + + case DW_AT_encoding: +@@ -2276,12 +2483,12 @@ read_and_display_attr_value (unsigned lo + { + case DW_FORM_ref_addr: + if (!do_loc) +- printf ("%c<0x%s>", delimiter, dwarf_vmatoa ("x",uvalue)); ++ printf ("%c<0x%s>", delimiter, dwarf_vmatoa ("x", uvalue)); + break; + + case DW_FORM_GNU_ref_alt: + if (!do_loc) +- printf ("%c", delimiter, dwarf_vmatoa ("x",uvalue)); ++ printf ("%c", delimiter, dwarf_vmatoa ("x", uvalue)); + /* FIXME: Follow the reference... */ + break; + +@@ -2667,11 +2874,18 @@ read_and_display_attr_value (unsigned lo + && uvalue < (size_t) (end - start)) + { + bfd_boolean is_signed = FALSE; +- +- /* We cannot correctly process DW_FORM_ref_addr at the moment. */ +- if (form != DW_FORM_ref_addr) +- get_type_signedness (start, start + uvalue, end, pointer_size, +- offset_size, dwarf_version, & is_signed, 0); ++ abbrev_entry * type_abbrev; ++ unsigned char * type_data; ++ unsigned long type_cu_offset; ++ ++ type_abbrev = get_type_abbrev_from_form (form, uvalue, cu_offset, ++ section, NULL, & type_data, & type_cu_offset); ++ if (type_abbrev != NULL) ++ { ++ get_type_signedness (type_abbrev, section, type_data, end, type_cu_offset, ++ pointer_size, offset_size, dwarf_version, ++ & is_signed, 0); ++ } + level_type_signed[level] = is_signed; + } + break; +@@ -2993,40 +3207,22 @@ read_and_display_attr_value (unsigned lo + + case DW_AT_import: + { +- if (form == DW_FORM_ref_sig8 +- || form == DW_FORM_GNU_ref_alt) +- break; +- +- if (form == DW_FORM_ref1 +- || form == DW_FORM_ref2 +- || form == DW_FORM_ref4 +- || form == DW_FORM_ref_udata) +- uvalue += cu_offset; ++ unsigned long abbrev_number; ++ abbrev_entry *entry; + +- if (uvalue >= section->size) +- warn (_("Offset %s used as value for DW_AT_import attribute of DIE at offset 0x%lx is too big.\n"), +- dwarf_vmatoa ("x", uvalue), +- (unsigned long) (orig_data - section->start)); ++ entry = get_type_abbrev_from_form (form, uvalue, cu_offset, ++ section, & abbrev_number, NULL, NULL); ++ if (entry == NULL) ++ { ++ if (form != DW_FORM_GNU_ref_alt) ++ warn (_("Offset %s used as value for DW_AT_import attribute of DIE at offset 0x%lx is too big.\n"), ++ dwarf_vmatoa ("x", uvalue), ++ (unsigned long) (orig_data - section->start)); ++ } + else + { +- unsigned long abbrev_number; +- abbrev_entry *entry; +- unsigned char *p = section->start + uvalue; +- +- READ_ULEB (abbrev_number, p, end); +- + printf (_("\t[Abbrev Number: %ld"), abbrev_number); +- /* Don't look up abbrev for DW_FORM_ref_addr, as it very often will +- use different abbrev table, and we don't track .debug_info chunks +- yet. */ +- if (form != DW_FORM_ref_addr) +- { +- for (entry = first_abbrev; entry != NULL; entry = entry->next) +- if (entry->entry == abbrev_number) +- break; +- if (entry != NULL) +- printf (" (%s)", get_TAG_name (entry->tag)); +- } ++ printf (" (%s)", get_TAG_name (entry->tag)); + printf ("]"); + } + } +@@ -3245,8 +3441,98 @@ process_debug_info (struct dwarf_section + + if (!do_loc && dwarf_start_die == 0) + introduce (section, FALSE); ++ ++ free_all_abbrevs (); ++ free (cu_abbrev_map); ++ cu_abbrev_map = NULL; ++ next_free_abbrev_map_entry = 0; + +- for (section_begin = start, unit = 0; start < end; unit++) ++ /* In order to be able to resolve DW_FORM_ref_attr forms we need ++ to load *all* of the abbrevs for all CUs in this .debug_info ++ section. This does effectively mean that we (partially) read ++ every CU header twice. */ ++ for (section_begin = start; start < end;) ++ { ++ DWARF2_Internal_CompUnit compunit; ++ unsigned char * hdrptr; ++ dwarf_vma cu_offset; ++ unsigned int offset_size; ++ unsigned int initial_length_size; ++ struct cu_tu_set * this_set; ++ abbrev_list * list; ++ ++ hdrptr = start; ++ ++ SAFE_BYTE_GET_AND_INC (compunit.cu_length, hdrptr, 4, end); ++ ++ if (compunit.cu_length == 0xffffffff) ++ { ++ SAFE_BYTE_GET_AND_INC (compunit.cu_length, hdrptr, 8, end); ++ offset_size = 8; ++ initial_length_size = 12; ++ } ++ else ++ { ++ offset_size = 4; ++ initial_length_size = 4; ++ } ++ ++ SAFE_BYTE_GET_AND_INC (compunit.cu_version, hdrptr, 2, end); ++ ++ cu_offset = start - section_begin; ++ ++ this_set = find_cu_tu_set_v2 (cu_offset, do_types); ++ ++ if (compunit.cu_version < 5) ++ { ++ compunit.cu_unit_type = DW_UT_compile; ++ /* Initialize it due to a false compiler warning. */ ++ compunit.cu_pointer_size = -1; ++ } ++ else ++ { ++ SAFE_BYTE_GET_AND_INC (compunit.cu_unit_type, hdrptr, 1, end); ++ do_types = (compunit.cu_unit_type == DW_UT_type); ++ ++ SAFE_BYTE_GET_AND_INC (compunit.cu_pointer_size, hdrptr, 1, end); ++ } ++ ++ SAFE_BYTE_GET_AND_INC (compunit.cu_abbrev_offset, hdrptr, offset_size, end); ++ ++ list = find_abbrev_list_by_abbrev_offset (compunit.cu_abbrev_offset); ++ if (list == NULL) ++ { ++ dwarf_vma abbrev_base; ++ size_t abbrev_size; ++ unsigned char * next; ++ ++ if (this_set == NULL) ++ { ++ abbrev_base = 0; ++ abbrev_size = debug_displays [abbrev_sec].section.size; ++ } ++ else ++ { ++ abbrev_base = this_set->section_offsets [DW_SECT_ABBREV]; ++ abbrev_size = this_set->section_sizes [DW_SECT_ABBREV]; ++ } ++ ++ list = new_abbrev_list (compunit.cu_abbrev_offset); ++ next = process_abbrev_set ++ (((unsigned char *) debug_displays [abbrev_sec].section.start ++ + abbrev_base + compunit.cu_abbrev_offset), ++ ((unsigned char *) debug_displays [abbrev_sec].section.start ++ + abbrev_base + abbrev_size), ++ list); ++ list->start_of_next_abbrevs = next; ++ } ++ ++ start = section_begin + cu_offset + compunit.cu_length ++ + initial_length_size; ++ record_abbrev_list_for_cu (cu_offset, start - section_begin, list); ++ } ++ ++ for (start = section_begin, unit = 0; start < end; unit++) + { + DWARF2_Internal_CompUnit compunit; + unsigned char *hdrptr; +@@ -3262,6 +3548,7 @@ process_debug_info (struct dwarf_section + struct cu_tu_set *this_set; + dwarf_vma abbrev_base; + size_t abbrev_size; ++ abbrev_list * list = NULL; + + hdrptr = start; + +@@ -3434,8 +3721,6 @@ process_debug_info (struct dwarf_section + continue; + } + +- free_abbrevs (); +- + /* Process the abbrevs used by this compilation unit. */ + if (compunit.cu_abbrev_offset >= abbrev_size) + warn (_("Debug info is corrupted, abbrev offset (%lx) is larger than abbrev section size (%lx)\n"), +@@ -3448,11 +3733,22 @@ process_debug_info (struct dwarf_section + (unsigned long) abbrev_base + abbrev_size, + (unsigned long) debug_displays [abbrev_sec].section.size); + else +- process_abbrev_section +- (((unsigned char *) debug_displays [abbrev_sec].section.start +- + abbrev_base + compunit.cu_abbrev_offset), +- ((unsigned char *) debug_displays [abbrev_sec].section.start +- + abbrev_base + abbrev_size)); ++ { ++ list = find_abbrev_list_by_abbrev_offset (compunit.cu_abbrev_offset); ++ if (list == NULL) ++ { ++ unsigned char * next; ++ ++ list = new_abbrev_list (compunit.cu_abbrev_offset); ++ next = process_abbrev_set ++ (((unsigned char *) debug_displays [abbrev_sec].section.start ++ + abbrev_base + compunit.cu_abbrev_offset), ++ ((unsigned char *) debug_displays [abbrev_sec].section.start ++ + abbrev_base + abbrev_size), ++ list); ++ list->start_of_next_abbrevs = next; ++ } ++ } + + level = 0; + last_level = level; +@@ -3532,11 +3828,13 @@ process_debug_info (struct dwarf_section + + /* Scan through the abbreviation list until we reach the + correct entry. */ +- for (entry = first_abbrev; +- entry && entry->entry != abbrev_number; +- entry = entry->next) ++ if (list == NULL) + continue; + ++ for (entry = list->first_abbrev; entry != NULL; entry = entry->next) ++ if (entry->number == abbrev_number) ++ break; ++ + if (entry == NULL) + { + if (!do_loc && do_printing) +@@ -5721,30 +6019,37 @@ display_debug_abbrev (struct dwarf_secti + { + abbrev_entry *entry; + unsigned char *start = section->start; +- unsigned char *end = start + section->size; ++ const unsigned char *end = start + section->size; + + introduce (section, FALSE); + + do + { +- unsigned char *last; +- +- free_abbrevs (); ++ abbrev_list * list; ++ dwarf_vma offset; + +- last = start; +- start = process_abbrev_section (start, end); ++ offset = start - section->start; ++ list = find_abbrev_list_by_abbrev_offset (offset); ++ if (list == NULL) ++ { ++ list = new_abbrev_list (offset); ++ start = process_abbrev_set (start, end, list); ++ list->start_of_next_abbrevs = start; ++ } ++ else ++ start = list->start_of_next_abbrevs; + +- if (first_abbrev == NULL) ++ if (list->first_abbrev == NULL) + continue; + +- printf (_(" Number TAG (0x%lx)\n"), (long) (last - section->start)); ++ printf (_(" Number TAG (0x%lx)\n"), (long) offset); + +- for (entry = first_abbrev; entry; entry = entry->next) ++ for (entry = list->first_abbrev; entry; entry = entry->next) + { + abbrev_attr *attr; + + printf (" %ld %s [%s]\n", +- entry->entry, ++ entry->number, + get_TAG_name (entry->tag), + entry->children ? _("has children") : _("no children")); + +@@ -10776,8 +11081,12 @@ free_debug_memory (void) + { + unsigned int i; + +- free_abbrevs (); ++ free_all_abbrevs (); + ++ free (cu_abbrev_map); ++ cu_abbrev_map = NULL; ++ next_free_abbrev_map_entry = 0; ++ + for (i = 0; i < max; i++) + free_debug_section ((enum dwarf_section_display_enum) i); + +Only in binutils-2.35.1/binutils: dwarf.c.orig diff --git a/patches/binutils/2.35/binutils-elf-add-objects.patch b/patches/binutils/2.35/binutils-elf-add-objects.patch new file mode 100644 index 00000000..fbe73bb6 --- /dev/null +++ b/patches/binutils/2.35/binutils-elf-add-objects.patch @@ -0,0 +1,36 @@ +--- binutils.orig/bfd/elflink.c 2020-07-31 10:45:48.747912761 +0100 ++++ binutils-2.35/bfd/elflink.c 2020-07-31 10:47:26.336262770 +0100 +@@ -505,6 +505,16 @@ bfd_elf_link_record_dynamic_symbol (stru + const char *name; + size_t indx; + ++ if (h->root.type == bfd_link_hash_defined ++ || h->root.type == bfd_link_hash_defweak) ++ { ++ /* An IR symbol should not be made dynamic. */ ++ if (h->root.u.def.section != NULL ++ && h->root.u.def.section->owner != NULL ++ && (h->root.u.def.section->owner->flags & BFD_PLUGIN) != 0) ++ return TRUE; ++ } ++ + /* XXX: The ABI draft says the linker must turn hidden and + internal symbols into STB_LOCAL symbols when producing the + DSO. However, if ld.so honors st_other in the dynamic table, +@@ -5199,15 +5209,11 @@ elf_link_add_object_symbols (bfd *abfd, + break; + } + +- /* 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 +- && (old_bfd == NULL +- || (old_bfd->flags & BFD_PLUGIN) == 0)) ++ && h->ref_regular_nonweak) + || (h->ref_dynamic_nonweak + && (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0 + && !on_needed_list (elf_dt_name (abfd), diff --git a/patches/binutils/binutils-export-demangle.h.patch b/patches/binutils/2.35/binutils-export-demangle.h.patch similarity index 100% rename from patches/binutils/binutils-export-demangle.h.patch rename to patches/binutils/2.35/binutils-export-demangle.h.patch diff --git a/patches/binutils/2.35/binutils-extend-s390-arch14-support.patch b/patches/binutils/2.35/binutils-extend-s390-arch14-support.patch new file mode 100644 index 00000000..0db6ac58 --- /dev/null +++ b/patches/binutils/2.35/binutils-extend-s390-arch14-support.patch @@ -0,0 +1,657 @@ +Only in binutils-2.35.1/gas: ChangeLog.orig +Only in binutils-2.35.1/gas: ChangeLog.rej +Only in binutils-2.35.1/gas/config: tc-s390.c.rej +diff -rup binutils.orig/gas/doc/c-s390.texi binutils-2.35.1/gas/doc/c-s390.texi +--- binutils.orig/gas/doc/c-s390.texi 2021-03-25 14:35:40.951633346 +0000 ++++ binutils-2.35.1/gas/doc/c-s390.texi 2021-03-25 14:39:39.910468584 +0000 +@@ -313,7 +313,7 @@ field. The notation changes as follows: + @cindex instruction formats, s390 + @cindex s390 instruction formats + +-The Principles of Operation manuals lists 26 instruction formats where ++The Principles of Operation manuals lists 35 instruction formats where + some of the formats have multiple variants. For the @samp{.insn} + pseudo directive the assembler recognizes some of the formats. + Typically, the most general variant of the instruction format is used +@@ -545,6 +545,54 @@ with the @samp{.insn} pseudo directive: + 0 8 12 16 20 32 36 47 + @end verbatim + ++@item VRV format: V1,D2(V2,B2),M3 ++@verbatim +++--------+----+----+----+-------------+----+------------+ ++| OpCode | V1 | V2 | B2 | D2 | M3 | Opcode | +++--------+----+----+----+-------------+----+------------+ ++0 8 12 16 20 32 36 47 ++@end verbatim ++ ++@item VRI format: V1,V2,I3,M4,M5 ++@verbatim +++--------+----+----+-------------+----+----+------------+ ++| OpCode | V1 | V2 | I3 | M5 | M4 | Opcode | +++--------+----+----+-------------+----+----+------------+ ++0 8 12 16 28 32 36 47 ++@end verbatim ++ ++@item VRX format: V1,D2(R2,B2),M3 ++@verbatim +++--------+----+----+----+-------------+----+------------+ ++| OpCode | V1 | R2 | B2 | D2 | M3 | Opcode | +++--------+----+----+----+-------------+----+------------+ ++0 8 12 16 20 32 36 47 ++@end verbatim ++ ++@item VRS format: R1,V3,D2(B2),M4 ++@verbatim +++--------+----+----+----+-------------+----+------------+ ++| OpCode | R1 | V3 | B2 | D2 | M4 | Opcode | +++--------+----+----+----+-------------+----+------------+ ++0 8 12 16 20 32 36 47 ++@end verbatim ++ ++@item VRR format: V1,V2,V3,M4,M5,M6 ++@verbatim +++--------+----+----+----+---+----+----+----+------------+ ++| OpCode | V1 | V2 | V3 |///| M6 | M5 | M4 | Opcode | +++--------+----+----+----+---+----+----+----+------------+ ++0 8 12 16 24 28 32 36 47 ++@end verbatim ++ ++@item VSI format: V1,D2(B2),I3 ++@verbatim +++--------+---------+----+-------------+----+------------+ ++| OpCode | I3 | B2 | D2 | V1 | Opcode | +++--------+---------+----+-------------+----+------------+ ++0 8 16 20 32 36 47 ++@end verbatim ++ + @end table + + For the complete list of all instruction format variants see the +Only in binutils-2.35.1/gas/doc: c-s390.texi.orig +Only in binutils-2.35.1/gas/doc: c-s390.texi.rej +diff -rup binutils.orig/gas/testsuite/gas/s390/esa-g5.d binutils-2.35.1/gas/testsuite/gas/s390/esa-g5.d +--- binutils.orig/gas/testsuite/gas/s390/esa-g5.d 2021-03-25 14:35:41.038632922 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/esa-g5.d 2021-03-25 14:39:56.533387550 +0000 +@@ -78,10 +78,14 @@ Disassembly of section .text: + .*: 07 29 [ ]*bhr %r9 + .*: 07 f9 [ ]*br %r9 + .*: a7 95 00 00 [ ]*bras %r9,e2 +-.*: a7 64 00 00 [ ]*jlh e6 +-.*: a7 66 00 00 [ ]*brct %r6,ea +-.*: 84 69 00 00 [ ]*brxh %r6,%r9,ee +-.*: 85 69 00 00 [ ]*brxle %r6,%r9,f2 ++.*: a7 65 00 00 [ ]*bras %r6,e6 ++.*: a7 64 00 00 [ ]*jlh ea ++.*: a7 66 00 00 [ ]*brct %r6,ee ++.*: a7 66 00 00 [ ]*brct %r6,f2 ++.*: 84 69 00 00 [ ]*brxh %r6,%r9,f6 ++.*: 84 69 00 00 [ ]*brxh %r6,%r9,fa ++.*: 85 69 00 00 [ ]*brxle %r6,%r9,fe ++.*: 85 69 00 00 [ ]*brxle %r6,%r9,102 + .*: b2 5a 00 69 [ ]*bsa %r6,%r9 + .*: b2 58 00 69 [ ]*bsg %r6,%r9 + .*: 0b 69 [ ]*bsm %r6,%r9 +@@ -180,27 +184,49 @@ Disassembly of section .text: + .*: b2 21 00 69 [ ]*ipte %r6,%r9 + .*: b2 29 00 69 [ ]*iske %r6,%r9 + .*: b2 23 00 69 [ ]*ivsk %r6,%r9 +-.*: a7 f4 00 00 [ ]*j 278 +-.*: a7 84 00 00 [ ]*je 27c +-.*: a7 24 00 00 [ ]*jh 280 +-.*: a7 a4 00 00 [ ]*jhe 284 +-.*: a7 44 00 00 [ ]*jl 288 +-.*: a7 c4 00 00 [ ]*jle 28c +-.*: a7 64 00 00 [ ]*jlh 290 +-.*: a7 44 00 00 [ ]*jl 294 +-.*: a7 74 00 00 [ ]*jne 298 +-.*: a7 d4 00 00 [ ]*jnh 29c +-.*: a7 54 00 00 [ ]*jnhe 2a0 +-.*: a7 b4 00 00 [ ]*jnl 2a4 +-.*: a7 34 00 00 [ ]*jnle 2a8 +-.*: a7 94 00 00 [ ]*jnlh 2ac +-.*: a7 b4 00 00 [ ]*jnl 2b0 +-.*: a7 e4 00 00 [ ]*jno 2b4 +-.*: a7 d4 00 00 [ ]*jnh 2b8 +-.*: a7 74 00 00 [ ]*jne 2bc +-.*: a7 14 00 00 [ ]*jo 2c0 +-.*: a7 24 00 00 [ ]*jh 2c4 +-.*: a7 84 00 00 [ ]*je 2c8 ++.*: a7 f4 00 00 [ ]*j 288 ++.*: a7 84 00 00 [ ]*je 28c ++.*: a7 24 00 00 [ ]*jh 290 ++.*: a7 a4 00 00 [ ]*jhe 294 ++.*: a7 44 00 00 [ ]*jl 298 ++.*: a7 c4 00 00 [ ]*jle 29c ++.*: a7 64 00 00 [ ]*jlh 2a0 ++.*: a7 44 00 00 [ ]*jl 2a4 ++.*: a7 74 00 00 [ ]*jne 2a8 ++.*: a7 d4 00 00 [ ]*jnh 2ac ++.*: a7 54 00 00 [ ]*jnhe 2b0 ++.*: a7 b4 00 00 [ ]*jnl 2b4 ++.*: a7 34 00 00 [ ]*jnle 2b8 ++.*: a7 94 00 00 [ ]*jnlh 2bc ++.*: a7 b4 00 00 [ ]*jnl 2c0 ++.*: a7 e4 00 00 [ ]*jno 2c4 ++.*: a7 d4 00 00 [ ]*jnh 2c8 ++.*: a7 74 00 00 [ ]*jne 2cc ++.*: a7 14 00 00 [ ]*jo 2d0 ++.*: a7 24 00 00 [ ]*jh 2d4 ++.*: a7 84 00 00 [ ]*je 2d8 ++.*: a7 04 00 00 [ ]*jnop 2dc ++.*: a7 14 00 00 [ ]*jo 2e0 ++.*: a7 24 00 00 [ ]*jh 2e4 ++.*: a7 24 00 00 [ ]*jh 2e8 ++.*: a7 34 00 00 [ ]*jnle 2ec ++.*: a7 44 00 00 [ ]*jl 2f0 ++.*: a7 44 00 00 [ ]*jl 2f4 ++.*: a7 54 00 00 [ ]*jnhe 2f8 ++.*: a7 64 00 00 [ ]*jlh 2fc ++.*: a7 74 00 00 [ ]*jne 300 ++.*: a7 74 00 00 [ ]*jne 304 ++.*: a7 84 00 00 [ ]*je 308 ++.*: a7 84 00 00 [ ]*je 30c ++.*: a7 94 00 00 [ ]*jnlh 310 ++.*: a7 a4 00 00 [ ]*jhe 314 ++.*: a7 b4 00 00 [ ]*jnl 318 ++.*: a7 b4 00 00 [ ]*jnl 31c ++.*: a7 c4 00 00 [ ]*jle 320 ++.*: a7 d4 00 00 [ ]*jnh 324 ++.*: a7 d4 00 00 [ ]*jnh 328 ++.*: a7 e4 00 00 [ ]*jno 32c ++.*: a7 f4 00 00 [ ]*j 330 + .*: ed 65 af ff 00 18 [ ]*kdb %f6,4095\(%r5,%r10\) + .*: b3 18 00 69 [ ]*kdbr %f6,%f9 + .*: ed 65 af ff 00 08 [ ]*keb %f6,4095\(%r5,%r10\) +@@ -483,4 +509,4 @@ Disassembly of section .text: + .*: f8 58 5f ff af ff [ ]*zap 4095\(6,%r5\),4095\(9,%r10\) + .*: b2 21 b0 69 [ ]*ipte %r6,%r9,%r11 + .*: b2 21 bd 69 [ ]*ipte %r6,%r9,%r11,13 +-.*: 07 07 [ ]*nopr %r7 ++.*: 07 07 [ ]*nopr %r7 +diff -rup binutils.orig/gas/testsuite/gas/s390/esa-g5.s binutils-2.35.1/gas/testsuite/gas/s390/esa-g5.s +--- binutils.orig/gas/testsuite/gas/s390/esa-g5.s 2021-03-25 14:35:41.038632922 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/esa-g5.s 2021-03-25 14:39:56.534387545 +0000 +@@ -72,10 +72,14 @@ foo: + bpr %r9 + br %r9 + bras %r9,. ++ jas %r6,. + brc 6,. + brct 6,. ++ jct %r6,. + brxh %r6,%r9,. ++ jxh %r6,%r9,. + brxle %r6,%r9,. ++ jxle %r6,%r9,. + bsa %r6,%r9 + bsg %r6,%r9 + bsm %r6,%r9 +@@ -195,6 +199,28 @@ foo: + jo . + jp . + jz . ++ jnop . ++ bro . ++ brh . ++ brp . ++ brnle . ++ brl . ++ brm . ++ brnhe . ++ brlh . ++ brne . ++ brnz . ++ bre . ++ brz . ++ brnlh . ++ brhe . ++ brnl . ++ brnm . ++ brle . ++ brnh . ++ brnp . ++ brno . ++ bru . + kdb %f6,4095(%r5,%r10) + kdbr %f6,%f9 + keb %f6,4095(%r5,%r10) +diff -rup binutils.orig/gas/testsuite/gas/s390/esa-z900.d binutils-2.35.1/gas/testsuite/gas/s390/esa-z900.d +--- binutils.orig/gas/testsuite/gas/s390/esa-z900.d 2021-03-25 14:35:41.038632922 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/esa-z900.d 2021-03-25 14:39:56.534387545 +0000 +@@ -6,29 +6,52 @@ + Disassembly of section .text: + + .* : +-.*: c0 f4 00 00 00 00 [ ]*jg 0 \ +-.*: c0 14 00 00 00 00 [ ]*jgo 6 \ +-.*: c0 24 00 00 00 00 [ ]*jgh c \ +-.*: c0 24 00 00 00 00 [ ]*jgh 12 \ +-.*: c0 34 00 00 00 00 [ ]*jgnle 18 \ +-.*: c0 44 00 00 00 00 [ ]*jgl 1e \ +-.*: c0 44 00 00 00 00 [ ]*jgl 24 \ +-.*: c0 54 00 00 00 00 [ ]*jgnhe 2a \ +-.*: c0 64 00 00 00 00 [ ]*jglh 30 \ +-.*: c0 74 00 00 00 00 [ ]*jgne 36 \ +-.*: c0 74 00 00 00 00 [ ]*jgne 3c \ +-.*: c0 84 00 00 00 00 [ ]*jge 42 \ +-.*: c0 84 00 00 00 00 [ ]*jge 48 \ +-.*: c0 94 00 00 00 00 [ ]*jgnlh 4e \ +-.*: c0 a4 00 00 00 00 [ ]*jghe 54 \ +-.*: c0 b4 00 00 00 00 [ ]*jgnl 5a \ +-.*: c0 b4 00 00 00 00 [ ]*jgnl 60 \ +-.*: c0 c4 00 00 00 00 [ ]*jgle 66 \ +-.*: c0 d4 00 00 00 00 [ ]*jgnh 6c \ +-.*: c0 d4 00 00 00 00 [ ]*jgnh 72 \ +-.*: c0 e4 00 00 00 00 [ ]*jgno 78 \ +-.*: c0 f4 00 00 00 00 [ ]*jg 7e \ +-.*: c0 65 00 00 00 00 [ ]*brasl %r6,84 \ ++.*: c0 f4 00 00 00 00 [ ]*jg 0 ++.*: c0 04 00 00 00 00 [ ]*jgnop 6 ++.*: c0 14 00 00 00 00 [ ]*jgo c ++.*: c0 24 00 00 00 00 [ ]*jgh 12 ++.*: c0 24 00 00 00 00 [ ]*jgh 18 ++.*: c0 34 00 00 00 00 [ ]*jgnle 1e ++.*: c0 44 00 00 00 00 [ ]*jgl 24 ++.*: c0 44 00 00 00 00 [ ]*jgl 2a ++.*: c0 54 00 00 00 00 [ ]*jgnhe 30 ++.*: c0 64 00 00 00 00 [ ]*jglh 36 ++.*: c0 74 00 00 00 00 [ ]*jgne 3c ++.*: c0 74 00 00 00 00 [ ]*jgne 42 ++.*: c0 84 00 00 00 00 [ ]*jge 48 ++.*: c0 84 00 00 00 00 [ ]*jge 4e ++.*: c0 94 00 00 00 00 [ ]*jgnlh 54 ++.*: c0 a4 00 00 00 00 [ ]*jghe 5a ++.*: c0 b4 00 00 00 00 [ ]*jgnl 60 ++.*: c0 b4 00 00 00 00 [ ]*jgnl 66 ++.*: c0 c4 00 00 00 00 [ ]*jgle 6c ++.*: c0 d4 00 00 00 00 [ ]*jgnh 72 ++.*: c0 d4 00 00 00 00 [ ]*jgnh 78 ++.*: c0 e4 00 00 00 00 [ ]*jgno 7e ++.*: c0 f4 00 00 00 00 [ ]*jg 84 ++.*: c0 14 00 00 00 00 [ ]*jgo 8a ++.*: c0 24 00 00 00 00 [ ]*jgh 90 ++.*: c0 24 00 00 00 00 [ ]*jgh 96 ++.*: c0 34 00 00 00 00 [ ]*jgnle 9c ++.*: c0 44 00 00 00 00 [ ]*jgl a2 ++.*: c0 44 00 00 00 00 [ ]*jgl a8 ++.*: c0 54 00 00 00 00 [ ]*jgnhe ae ++.*: c0 64 00 00 00 00 [ ]*jglh b4 ++.*: c0 74 00 00 00 00 [ ]*jgne ba ++.*: c0 74 00 00 00 00 [ ]*jgne c0 ++.*: c0 84 00 00 00 00 [ ]*jge c6 ++.*: c0 84 00 00 00 00 [ ]*jge cc ++.*: c0 94 00 00 00 00 [ ]*jgnlh d2 ++.*: c0 a4 00 00 00 00 [ ]*jghe d8 ++.*: c0 b4 00 00 00 00 [ ]*jgnl de ++.*: c0 b4 00 00 00 00 [ ]*jgnl e4 ++.*: c0 c4 00 00 00 00 [ ]*jgle ea ++.*: c0 d4 00 00 00 00 [ ]*jgnh f0 ++.*: c0 d4 00 00 00 00 [ ]*jgnh f6 ++.*: c0 e4 00 00 00 00 [ ]*jgno fc ++.*: c0 f4 00 00 00 00 [ ]*jg 102 ++.*: c0 65 00 00 00 00 [ ]*brasl %r6,108 ++.*: c0 65 00 00 00 00 [ ]*brasl %r6,10e + .*: 01 0b [ ]*tam + .*: 01 0c [ ]*sam24 + .*: 01 0d [ ]*sam31 +@@ -39,7 +62,7 @@ Disassembly of section .text: + .*: b9 97 00 69 [ ]*dlr %r6,%r9 + .*: b9 98 00 69 [ ]*alcr %r6,%r9 + .*: b9 99 00 69 [ ]*slbr %r6,%r9 +-.*: c0 60 00 00 00 00 [ ]*larl %r6,ac \ ++.*: c0 60 00 00 00 00 [ ]*larl %r6,136 + .*: e3 65 af ff 00 1e [ ]*lrv %r6,4095\(%r5,%r10\) + .*: e3 65 af ff 00 1f [ ]*lrvh %r6,4095\(%r5,%r10\) + .*: e3 65 af ff 00 3e [ ]*strv %r6,4095\(%r5,%r10\) +@@ -49,3 +72,4 @@ Disassembly of section .text: + .*: e3 65 af ff 00 98 [ ]*alc %r6,4095\(%r5,%r10\) + .*: e3 65 af ff 00 99 [ ]*slb %r6,4095\(%r5,%r10\) + .*: eb 69 5f ff 00 1d [ ]*rll %r6,%r9,4095\(%r5\) ++.*: 07 07 [ ]*nopr %r7 +diff -rup binutils.orig/gas/testsuite/gas/s390/esa-z900.s binutils-2.35.1/gas/testsuite/gas/s390/esa-z900.s +--- binutils.orig/gas/testsuite/gas/s390/esa-z900.s 2021-03-25 14:35:41.037632927 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/esa-z900.s 2021-03-25 14:39:56.534387545 +0000 +@@ -1,6 +1,7 @@ + .text + foo: + brcl 15,. ++ jgnop . + jgo . + jgh . + jgp . +@@ -22,7 +23,29 @@ foo: + jgnp . + jgno . + jg . ++ brol . ++ brhl . ++ brpl . ++ brnlel . ++ brll . ++ brml . ++ brnhel . ++ brlhl . ++ brnel . ++ brnzl . ++ brel . ++ brzl . ++ brnlhl . ++ brhel . ++ brnll . ++ brnml . ++ brlel . ++ brnhl . ++ brnpl . ++ brnol . ++ brul . + brasl %r6,. ++ jasl %r6,. + tam + sam24 + sam31 +Only in binutils-2.35.1/gas/testsuite/gas/s390: s390.exp.rej +Only in binutils-2.35.1/gas/testsuite/gas/s390: zarch-arch14.d +Only in binutils-2.35.1/gas/testsuite/gas/s390: zarch-arch14.s +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z10.d binutils-2.35.1/gas/testsuite/gas/s390/zarch-z10.d +--- binutils.orig/gas/testsuite/gas/s390/zarch-z10.d 2021-03-25 14:35:41.038632922 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-z10.d 2021-03-25 14:39:49.766420543 +0000 +@@ -362,11 +362,13 @@ Disassembly of section .text: + .*: ec 67 d2 dc e6 54 [ ]*rnsbg %r6,%r7,210,220,230 + .*: ec 67 d2 dc e6 57 [ ]*rxsbg %r6,%r7,210,220,230 + .*: ec 67 d2 dc e6 56 [ ]*rosbg %r6,%r7,210,220,230 +-.*: ec 67 d2 dc e6 55 [ ]*risbg %r6,%r7,210,220,230 +-.*: c4 6f 00 00 00 00 [ ]*strl %r6,7f6 +-.*: c4 6b 00 00 00 00 [ ]*stgrl %r6,7fc +-.*: c4 67 00 00 00 00 [ ]*sthrl %r6,802 +-.*: c6 60 00 00 00 00 [ ]*exrl %r6,808 ++.*: ec 67 d2 14 e6 55 [ ]*risbg %r6,%r7,210,20,230 ++.*: ec 67 d2 bc e6 55 [ ]*risbgz %r6,%r7,210,60,230 ++.*: ec 67 d2 94 e6 55 [ ]*risbgz %r6,%r7,210,20,230 ++.*: c4 6f 00 00 00 00 [ ]*strl %r6,802 ++.*: c4 6b 00 00 00 00 [ ]*stgrl %r6,808 ++.*: c4 67 00 00 00 00 [ ]*sthrl %r6,80e ++.*: c6 60 00 00 00 00 [ ]*exrl %r6,814 + .*: af ee 6d 05 [ ]*mc 3333\(%r6\),238 + .*: b9 a2 00 60 [ ]*ptf %r6 + .*: b9 af 00 67 [ ]*pfmf %r6,%r7 +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z10.s binutils-2.35.1/gas/testsuite/gas/s390/zarch-z10.s +--- binutils.orig/gas/testsuite/gas/s390/zarch-z10.s 2021-03-25 14:35:41.038632922 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-z10.s 2021-03-25 14:39:49.766420543 +0000 +@@ -356,7 +356,9 @@ foo: + rnsbg %r6,%r7,210,220,230 + rxsbg %r6,%r7,210,220,230 + rosbg %r6,%r7,210,220,230 +- risbg %r6,%r7,210,220,230 ++ risbg %r6,%r7,210,20,230 ++ risbg %r6,%r7,210,188,230 ++ risbgz %r6,%r7,210,20,230 + strl %r6,. + stgrl %r6,. + sthrl %r6,. +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z900.d binutils-2.35.1/gas/testsuite/gas/s390/zarch-z900.d +--- binutils.orig/gas/testsuite/gas/s390/zarch-z900.d 2021-03-25 14:35:41.037632927 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-z900.d 2021-03-25 14:39:56.534387545 +0000 +@@ -20,8 +20,11 @@ Disassembly of section .text: + .*: e3 95 af ff 00 46 [ ]*bctg %r9,4095\(%r5,%r10\) + .*: b9 46 00 96 [ ]*bctgr %r9,%r6 + .*: a7 97 00 00 [ ]*brctg %r9,40 \ +-.*: ec 96 00 00 00 44 [ ]*brxhg %r9,%r6,44 +-.*: ec 96 00 00 00 45 [ ]*brxlg %r9,%r6,4a ++.*: a7 67 00 00 [ ]*brctg %r6,44 ++.*: ec 96 00 00 00 44 [ ]*brxhg %r9,%r6,48 ++.*: ec 69 00 00 00 44 [ ]*brxhg %r6,%r9,4e ++.*: ec 96 00 00 00 45 [ ]*brxlg %r9,%r6,54 ++.*: ec 69 00 00 00 45 [ ]*brxlg %r6,%r9,5a + .*: eb 96 5f ff 00 44 [ ]*bxhg %r9,%r6,4095\(%r5\) + .*: eb 96 5f ff 00 45 [ ]*bxleg %r9,%r6,4095\(%r5\) + .*: b3 a5 00 96 [ ]*cdgbr %f9,%r6 +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z900.s binutils-2.35.1/gas/testsuite/gas/s390/zarch-z900.s +--- binutils.orig/gas/testsuite/gas/s390/zarch-z900.s 2021-03-25 14:35:41.038632922 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-z900.s 2021-03-25 14:39:56.534387545 +0000 +@@ -14,8 +14,11 @@ foo: + bctg %r9,4095(%r5,%r10) + bctgr %r9,%r6 + brctg %r9,. ++ jctg %r6,. + brxhg %r9,%r6,. ++ jxhg %r6,%r9,. + brxlg %r9,%r6,. ++ jxleg %r6,%r9,. + bxhg %r9,%r6,4095(%r5) + bxleg %r9,%r6,4095(%r5) + cdgbr %f9,%r6 +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.d binutils-2.35.1/gas/testsuite/gas/s390/zarch-zEC12.d +--- binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.d 2021-03-25 14:35:41.037632927 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-zEC12.d 2021-03-25 14:39:49.766420543 +0000 +@@ -47,6 +47,8 @@ Disassembly of section .text: + .*: eb 6c 7a 4d fe 2b [ ]*clgtnh %r6,-5555\(%r7\) + .*: eb 6c 7a 4d fe 2b [ ]*clgtnh %r6,-5555\(%r7\) + .*: ec 67 0c 0d 0e 59 [ ]*risbgn %r6,%r7,12,13,14 ++.*: ec 67 0c bc 0e 59 [ ]*risbgnz %r6,%r7,12,60,14 ++.*: ec 67 0c 94 0e 59 [ ]*risbgnz %r6,%r7,12,20,14 + .*: ed 0f 8f a0 6d aa [ ]*cdzt %f6,4000\(16,%r8\),13 + .*: ed 21 8f a0 4d ab [ ]*cxzt %f4,4000\(34,%r8\),13 + .*: ed 0f 8f a0 6d a8 [ ]*czdt %f6,4000\(16,%r8\),13 +@@ -54,16 +56,16 @@ Disassembly of section .text: + .*: b2 e8 c0 56 [ ]*ppa %r5,%r6,12 + .*: b9 8f 60 59 [ ]*crdte %r5,%r6,%r9 + .*: b9 8f 61 59 [ ]*crdte %r5,%r6,%r9,1 +-.*: c5 a0 0c 00 00 0c [ ]*bprp 10,12a ,12a +-.*: c5 a0 00 00 00 00 [ ]*bprp 10,118 ,118 +-[ ]*119: R_390_PLT12DBL bar\+0x1 +-[ ]*11b: R_390_PLT24DBL bar\+0x3 +-.*: c7 a0 00 00 00 00 [ ]*bpp 10,11e ,0 +-[ ]*122: R_390_PLT16DBL bar\+0x4 +-.*: c7 a0 00 00 00 00 [ ]*bpp 10,124 ,0 +-[ ]*128: R_390_PC16DBL baz\+0x4 ++.*: c5 a0 0c 00 00 0c [ ]*bprp 10,136 ,136 ++.*: c5 a0 00 00 00 00 [ ]*bprp 10,124 ,124 ++[ ]*125: R_390_PLT12DBL bar\+0x1 ++[ ]*127: R_390_PLT24DBL bar\+0x3 ++.*: c7 a0 00 00 00 00 [ ]*bpp 10,12a ,0 ++[ ]*12e: R_390_PLT16DBL bar\+0x4 ++.*: c7 a0 00 00 00 00 [ ]*bpp 10,130 ,0 ++[ ]*134: R_390_PC16DBL baz\+0x4 + + +-000000000000012a : ++0000000000000136 : + + .*: 07 07 [ ]*nopr %r7 +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.s binutils-2.35.1/gas/testsuite/gas/s390/zarch-zEC12.s +--- binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.s 2021-03-25 14:35:41.038632922 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-zEC12.s 2021-03-25 14:39:49.766420543 +0000 +@@ -44,6 +44,9 @@ foo: + clgtnh %r6,-5555(%r7) + + risbgn %r6,%r7,12,13,14 ++ risbgn %r6,%r7,12,188,14 ++ risbgnz %r6,%r7,12,20,14 ++ + cdzt %f6,4000(16,%r8),13 + cxzt %f4,4000(34,%r8),13 + czdt %f6,4000(16,%r8),13 +Only in binutils-2.35.1/include: ChangeLog.orig +Only in binutils-2.35.1/include: ChangeLog.rej +Only in binutils-2.35.1/include/opcode: s390.h.rej +Only in binutils-2.35.1/ld: ChangeLog.orig +Only in binutils-2.35.1/ld: ChangeLog.rej +diff -rup binutils.orig/ld/testsuite/ld-s390/tlsbin_64.dd binutils-2.35.1/ld/testsuite/ld-s390/tlsbin_64.dd +--- binutils.orig/ld/testsuite/ld-s390/tlsbin_64.dd 2021-03-25 14:35:40.826633955 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-s390/tlsbin_64.dd 2021-03-25 14:39:56.534387545 +0000 +@@ -87,26 +87,26 @@ Disassembly of section .text: + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) + # GD -> LE with global variable defined in executable + +[0-9a-f]+: e3 20 d0 10 00 04 lg %r2,16\(%r13\) +- +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ ++ +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) + # GD -> LE with local variable defined in executable + +[0-9a-f]+: e3 20 d0 18 00 04 lg %r2,24\(%r13\) +- +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ ++ +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) + # GD -> LE with hidden variable defined in executable + +[0-9a-f]+: e3 20 d0 20 00 04 lg %r2,32\(%r13\) +- +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ ++ +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) + # LD -> LE + +[0-9a-f]+: e3 20 d0 28 00 04 lg %r2,40\(%r13\) +- +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ ++ +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ + +[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\) + +[0-9a-f]+: e3 40 d0 30 00 04 lg %r4,48\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) + +[0-9a-f]+: e3 40 d0 38 00 04 lg %r4,56\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) + +[0-9a-f]+: e3 20 d0 40 00 04 lg %r2,64\(%r13\) +- +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ ++ +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ + +[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\) + +[0-9a-f]+: e3 40 d0 48 00 04 lg %r4,72\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) +Only in binutils-2.35.1/opcodes: ChangeLog.orig +Only in binutils-2.35.1/opcodes: ChangeLog.rej +Only in binutils-2.35.1/opcodes: s390-mkopc.c.rej +diff -rup binutils.orig/opcodes/s390-opc.c binutils-2.35.1/opcodes/s390-opc.c +--- binutils.orig/opcodes/s390-opc.c 2021-03-25 14:35:40.719634477 +0000 ++++ binutils-2.35.1/opcodes/s390-opc.c 2021-03-25 14:39:49.766420543 +0000 +@@ -218,32 +218,34 @@ const struct s390_operand s390_operands[ + { 8, 8, 0 }, + #define U8_16 68 /* 8 bit unsigned value starting at 16 */ + { 8, 16, 0 }, +-#define U8_24 69 /* 8 bit unsigned value starting at 24 */ ++#define U6_26 69 /* 6 bit unsigned value starting at 26 */ ++ { 6, 26, 0 }, ++#define U8_24 70 /* 8 bit unsigned value starting at 24 */ + { 8, 24, 0 }, +-#define U8_28 70 /* 8 bit unsigned value starting at 28 */ ++#define U8_28 71 /* 8 bit unsigned value starting at 28 */ + { 8, 28, 0 }, +-#define U8_32 71 /* 8 bit unsigned value starting at 32 */ ++#define U8_32 72 /* 8 bit unsigned value starting at 32 */ + { 8, 32, 0 }, +-#define U12_16 72 /* 12 bit unsigned value starting at 16 */ ++#define U12_16 73 /* 12 bit unsigned value starting at 16 */ + { 12, 16, 0 }, +-#define U16_16 73 /* 16 bit unsigned value starting at 16 */ ++#define U16_16 74 /* 16 bit unsigned value starting at 16 */ + { 16, 16, 0 }, +-#define U16_32 74 /* 16 bit unsigned value starting at 32 */ ++#define U16_32 75 /* 16 bit unsigned value starting at 32 */ + { 16, 32, 0 }, +-#define U32_16 75 /* 32 bit unsigned value starting at 16 */ ++#define U32_16 76 /* 32 bit unsigned value starting at 16 */ + { 32, 16, 0 }, + + /* PC-relative address operands. */ + +-#define J12_12 76 /* 12 bit PC relative offset at 12 */ ++#define J12_12 77 /* 12 bit PC relative offset at 12 */ + { 12, 12, S390_OPERAND_PCREL }, +-#define J16_16 77 /* 16 bit PC relative offset at 16 */ ++#define J16_16 78 /* 16 bit PC relative offset at 16 */ + { 16, 16, S390_OPERAND_PCREL }, +-#define J16_32 78 /* 16 bit PC relative offset at 32 */ ++#define J16_32 79 /* 16 bit PC relative offset at 32 */ + { 16, 32, S390_OPERAND_PCREL }, +-#define J24_24 79 /* 24 bit PC relative offset at 24 */ ++#define J24_24 80 /* 24 bit PC relative offset at 24 */ + { 24, 24, S390_OPERAND_PCREL }, +-#define J32_16 80 /* 32 bit PC relative offset at 16 */ ++#define J32_16 81 /* 32 bit PC relative offset at 16 */ + { 32, 16, S390_OPERAND_PCREL }, + + }; +@@ -313,6 +315,7 @@ const struct s390_operand s390_operands[ + #define INSTR_RIE_R0U0 6, { R_8,U16_16,0,0,0,0 } /* e.g. clfitne */ + #define INSTR_RIE_RUI0 6, { R_8,I16_16,U4_12,0,0,0 } /* e.g. lochi */ + #define INSTR_RIE_RRUUU 6, { R_8,R_12,U8_16,U8_24,U8_32,0 } /* e.g. rnsbg */ ++#define INSTR_RIE_RRUUU2 6, { R_8,R_12,U8_16,U6_26,U8_32,0 } /* e.g. rnsbg */ + #define INSTR_RIL_0P 6, { J32_16,0,0,0,0 } /* e.g. jg */ + #define INSTR_RIL_RP 6, { R_8,J32_16,0,0,0,0 } /* e.g. brasl */ + #define INSTR_RIL_UP 6, { U4_8,J32_16,0,0,0,0 } /* e.g. brcl */ +@@ -534,6 +537,7 @@ const struct s390_operand s390_operands[ + #define MASK_RIE_R0U0 { 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff } + #define MASK_RIE_RUI0 { 0xff, 0x00, 0x00, 0x00, 0xff, 0xff } + #define MASK_RIE_RRUUU { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff } ++#define MASK_RIE_RRUUU2 { 0xff, 0x00, 0x00, 0xc0, 0x00, 0xff } + #define MASK_RIL_0P { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } + #define MASK_RIL_RP { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 } + #define MASK_RIL_UP { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 } +diff -rup binutils.orig/opcodes/s390-opc.txt binutils-2.35.1/opcodes/s390-opc.txt +--- binutils.orig/opcodes/s390-opc.txt 2021-03-25 14:35:40.728634433 +0000 ++++ binutils-2.35.1/opcodes/s390-opc.txt 2021-03-25 14:39:56.534387545 +0000 +@@ -246,10 +246,14 @@ d7 xc SS_L0RDRD "exclusive OR" g5 esa,za + f8 zap SS_LLRDRD "zero and add" g5 esa,zarch + a70a ahi RI_RI "add halfword immediate" g5 esa,zarch + 84 brxh RSI_RRP "branch relative on index high" g5 esa,zarch ++84 jxh RSI_RRP "branch relative on index high" g5 esa,zarch + 85 brxle RSI_RRP "branch relative on index low or equal" g5 esa,zarch ++85 jxle RSI_RRP "branch relative on index low or equal" g5 esa,zarch + a705 bras RI_RP "branch relative and save" g5 esa,zarch ++a705 jas RI_RP "branch relative and save" g5 esa,zarch + a704 brc RI_UP "branch relative on condition" g5 esa,zarch + a706 brct RI_RP "branch relative on count" g5 esa,zarch ++a706 jct RI_RP "branch relative on count" g5 esa,zarch + b241 cksm RRE_RR "checksum" g5 esa,zarch + a70e chi RI_RI "compare halfword immediate" g5 esa,zarch + a9 clcle RS_RRRD "compare logical long extended" g5 esa,zarch +@@ -268,8 +272,11 @@ a701 tml RI_RU "test under mask low" g5 + 4700 nop RX_0RRD "no operation" g5 esa,zarch optparm + 4700 b*8 RX_0RRD "conditional branch" g5 esa,zarch + 47f0 b RX_0RRD "unconditional branch" g5 esa,zarch ++a704 jnop RI_0P "nop jump" g5 esa,zarch + a704 j*8 RI_0P "conditional jump" g5 esa,zarch ++a704 br*8 RI_0P "conditional jump" g5 esa,zarch + a7f4 j RI_0P "unconditional jump" g5 esa,zarch ++a7f4 bru RI_0P "unconditional jump" g5 esa,zarch + b34a axbr RRE_FEFE "add extended bfp" g5 esa,zarch + b31a adbr RRE_FF "add long bfp" g5 esa,zarch + ed000000001a adb RXE_FRRD "add long bfp" g5 esa,zarch +@@ -437,7 +444,9 @@ e3000000001b slgf RXE_RRRD "subtract log + e3000000000c msg RXE_RRRD "multiply single 64" z900 zarch + e3000000001c msgf RXE_RRRD "multiply single 64<32" z900 zarch + ec0000000044 brxhg RIE_RRP "branch relative on index high 64" z900 zarch ++ec0000000044 jxhg RIE_RRP "branch relative on index high 64" z900 zarch + ec0000000045 brxlg RIE_RRP "branch relative on index low or equal 64" z900 zarch ++ec0000000045 jxleg RIE_RRP "branch relative on index low or equal 64" z900 zarch + eb0000000044 bxhg RSE_RRRD "branch on index high 64" z900 zarch + eb0000000045 bxleg RSE_RRRD "branch on index low or equal 64" z900 zarch + eb000000000c srlg RSE_RRRD "shift right single logical 64" z900 zarch +@@ -462,10 +471,15 @@ eb0000000080 icmh RSE_RURD "insert chara + a702 tmhh RI_RU "test under mask high high" z900 zarch + a703 tmhl RI_RU "test under mask high low" z900 zarch + c004 brcl RIL_UP "branch relative on condition long" z900 esa,zarch ++c004 jgnop RIL_0P "nop jump long" z900 esa,zarch + c004 jg*8 RIL_0P "conditional jump long" z900 esa,zarch ++c004 br*8l RIL_0P "conditional jump long" z900 esa,zarch + c0f4 jg RIL_0P "unconditional jump long" z900 esa,zarch ++c0f4 brul RIL_0P "unconditional jump long" z900 esa,zarch + c005 brasl RIL_RP "branch relative and save long" z900 esa,zarch ++c005 jasl RIL_RP "branch relative and save long" z900 esa,zarch + a707 brctg RI_RP "branch relative on count 64" z900 zarch ++a707 jctg RI_RP "branch relative on count 64" z900 zarch + a709 lghi RI_RI "load halfword immediate 64" z900 zarch + a70b aghi RI_RI "add halfword immediate 64" z900 zarch + a70d mghi RI_RI "multiply halfword immediate 64" z900 zarch +@@ -956,6 +970,7 @@ ec0000000054 rnsbg RIE_RRUUU "rotate the + ec0000000057 rxsbg RIE_RRUUU "rotate then exclusive or selected bits" z10 zarch + ec0000000056 rosbg RIE_RRUUU "rotate then or selected bits" z10 zarch + ec0000000055 risbg RIE_RRUUU "rotate then insert selected bits" z10 zarch ++ec0000800055 risbgz RIE_RRUUU2 "rotate then insert selected bits and zero remaining bits" z10 zarch + c40f strl RIL_RP "store relative long (32)" z10 zarch + c40b stgrl RIL_RP "store relative long (64)" z10 zarch + c407 sthrl RIL_RP "store halfword relative long" z10 zarch +@@ -1139,6 +1154,7 @@ eb0000000023 clt$12 RSY_R0RD "compare lo + eb000000002b clgt RSY_RURD "compare logical and trap 64 bit reg-mem" zEC12 zarch + eb000000002b clgt$12 RSY_R0RD "compare logical and trap 64 bit reg-mem" zEC12 zarch + ec0000000059 risbgn RIE_RRUUU "rotate then insert selected bits nocc" zEC12 zarch ++ec0000800059 risbgnz RIE_RRUUU2 "rotate then insert selected bits and zero remaining bits nocc" zEC12 zarch + ed00000000aa cdzt RSL_LRDFU "convert from zoned long" zEC12 zarch + ed00000000ab cxzt RSL_LRDFEU "convert from zoned extended" zEC12 zarch + ed00000000a8 czdt RSL_LRDFU "convert to zoned long" zEC12 zarch +Only in binutils-2.35.1/opcodes: s390-opc.txt.orig +Only in binutils-2.35.1/opcodes: s390-opc.txt.rej diff --git a/patches/binutils/2.35/binutils-fix-testsuite-failures.patch b/patches/binutils/2.35/binutils-fix-testsuite-failures.patch new file mode 100644 index 00000000..c2b19a5e --- /dev/null +++ b/patches/binutils/2.35/binutils-fix-testsuite-failures.patch @@ -0,0 +1,330 @@ +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 13:33:21.979627285 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 13:40:26.911199033 +0000 +@@ -34,5 +34,6 @@ hook called: claim_file tmpdir/libtext.a + hook called: all symbols read. + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-13.d binutils-2.32/ld/testsuite/ld-plugin/plugin-13.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-13.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-13.d 2019-02-15 13:41:30.189692800 +0000 +@@ -23,5 +23,3 @@ hook called: claim_file tmpdir/main.o \[ + hook called: claim_file .*/ld/testsuite/ld-plugin/func.c \[@0/.* CLAIMED + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... +-.*main.c.*: undefined reference to `\.?func' +-#... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-14.d binutils-2.32/ld/testsuite/ld-plugin/plugin-14.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-14.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-14.d 2019-02-15 13:42:03.598430960 +0000 +@@ -27,7 +27,6 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-15.d binutils-2.32/ld/testsuite/ld-plugin/plugin-15.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-15.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-15.d 2019-02-15 13:42:28.014239600 +0000 +@@ -28,7 +28,6 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-16.d binutils-2.32/ld/testsuite/ld-plugin/plugin-16.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-16.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-16.d 2019-02-15 13:43:21.309821910 +0000 +@@ -30,9 +30,8 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-17.d binutils-2.32/ld/testsuite/ld-plugin/plugin-17.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-17.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-17.d 2019-02-15 13:43:54.925558451 +0000 +@@ -31,7 +31,8 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-20.d binutils-2.32/ld/testsuite/ld-plugin/plugin-20.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-20.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-20.d 2019-02-15 13:49:20.091010016 +0000 +@@ -2,6 +2,5 @@ hook called: all symbols read. + Input: func.c \(tmpdir/libfunc.a\) + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-21.d binutils-2.32/ld/testsuite/ld-plugin/plugin-21.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-21.d 2019-02-15 13:33:21.978627293 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-21.d 2019-02-15 13:49:34.506897033 +0000 +@@ -2,6 +2,5 @@ hook called: all symbols read. + Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\) + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-22.d binutils-2.32/ld/testsuite/ld-plugin/plugin-22.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-22.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-22.d 2019-02-15 13:50:00.409694022 +0000 +@@ -2,6 +2,5 @@ Claimed: tmpdir/libfunc.a \[@.* + hook called: all symbols read. + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-23.d binutils-2.32/ld/testsuite/ld-plugin/plugin-23.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-23.d 2019-02-15 13:33:21.979627285 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-23.d 2019-02-15 13:50:14.938580156 +0000 +@@ -2,6 +2,5 @@ Claimed: .*/ld/testsuite/ld-plugin/func. + hook called: all symbols read. + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-24.d binutils-2.32/ld/testsuite/ld-plugin/plugin-24.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-24.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-24.d 2019-02-15 13:49:46.346804240 +0000 +@@ -2,4 +2,5 @@ hook called: all symbols read. + Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\) + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* ++#... + hook called: cleanup. +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-25.d binutils-2.32/ld/testsuite/ld-plugin/plugin-25.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-25.d 2019-02-15 13:33:21.978627293 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-25.d 2019-02-15 13:50:29.322467422 +0000 +@@ -2,4 +2,5 @@ Claimed: .*/ld/testsuite/ld-plugin/func. + hook called: all symbols read. + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* ++#... + hook called: cleanup. +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 13:45:05.343006557 +0000 +@@ -1 +1,3 @@ + .*: error: Error ++#... ++ +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-29.d binutils-2.32/ld/testsuite/ld-plugin/plugin-29.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-29.d 2019-02-15 13:33:21.978627293 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-29.d 2019-02-15 13:45:22.764870016 +0000 +@@ -1 +1,2 @@ + .*: warning: Warning ++#... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-30.d binutils-2.32/ld/testsuite/ld-plugin/plugin-30.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-30.d 2019-02-15 13:33:21.976627309 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-30.d 2019-02-15 13:48:57.067190464 +0000 +@@ -24,3 +24,4 @@ hook called: claim_file tmpdir/main.o \[ + hook called: claim_file tmpdir/func.o \[@0/.* not claimed + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + hook called: claim_file tmpdir/libempty.a \[@.* not claimed ++#pass +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-6.d binutils-2.32/ld/testsuite/ld-plugin/plugin-6.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-6.d 2019-02-15 13:33:21.979627285 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-6.d 2019-02-15 13:37:14.672749977 +0000 +@@ -27,7 +27,6 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-7.d binutils-2.32/ld/testsuite/ld-plugin/plugin-7.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-7.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-7.d 2019-02-15 13:37:58.000400421 +0000 +@@ -28,7 +28,6 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 13:38:34.096109209 +0000 +@@ -32,7 +32,6 @@ hook called: claim_file tmpdir/text.o \[ + hook called: all symbols read. + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-9.d binutils-2.32/ld/testsuite/ld-plugin/plugin-9.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-9.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-9.d 2019-02-15 13:39:52.655475403 +0000 +@@ -31,7 +31,8 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/pr20070.d binutils-2.32/ld/testsuite/ld-plugin/pr20070.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/pr20070.d 2019-02-15 13:33:21.976627309 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/pr20070.d 2019-02-15 13:50:56.874251486 +0000 +@@ -5,5 +5,6 @@ Sym: 'weakdef' Resolution: LDPR_PREVAILI + Sym: 'undef' Resolution: LDPR_UNDEF + Sym: 'weakundef' Resolution: LDPR_UNDEF + Sym: 'common' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-srec/srec.exp binutils-2.32/ld/testsuite/ld-srec/srec.exp +--- binutils-2.32.orig/ld/testsuite/ld-srec/srec.exp 2019-02-15 13:33:21.938627615 +0000 ++++ binutils-2.32/ld/testsuite/ld-srec/srec.exp 2019-02-15 13:53:58.744814006 +0000 +@@ -21,6 +21,8 @@ + + # Get the offset from an S-record line to the start of the data. + ++return ++ + proc srec_off { l } { + if [string match "S1*" $l] { + return 8 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 14:10:59.038709514 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 14:13:53.532300721 +0000 +@@ -32,7 +32,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/libtext.a \[@.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-11.d binutils-2.32/ld/testsuite/ld-plugin/plugin-11.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-11.d 2019-02-15 14:10:59.041709490 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-11.d 2019-02-15 14:14:50.061844322 +0000 +@@ -35,8 +35,9 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-18.d binutils-2.32/ld/testsuite/ld-plugin/plugin-18.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-18.d 2019-02-15 14:10:58.942710289 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-18.d 2019-02-15 14:15:20.030602369 +0000 +@@ -32,7 +32,8 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/libtext.a \[@.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-19.d binutils-2.32/ld/testsuite/ld-plugin/plugin-19.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-19.d 2019-02-15 14:10:59.024709627 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-19.d 2019-02-15 14:15:54.926320633 +0000 +@@ -35,8 +35,9 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 14:10:58.998709837 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 14:12:19.856057024 +0000 +@@ -1,3 +1,2 @@ + .*: error: Error + #... +- +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 14:10:59.074709224 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 14:11:48.144313048 +0000 +@@ -30,7 +30,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-elfvers/vers24.rd binutils-2.30/ld/testsuite/ld-elfvers/vers24.rd +--- binutils.orig/ld/testsuite/ld-elfvers/vers24.rd 2018-09-05 09:45:44.013108697 +0100 ++++ binutils-2.30/ld/testsuite/ld-elfvers/vers24.rd 2018-09-05 12:06:17.287425232 +0100 +@@ -7,9 +7,9 @@ Symbol table '.dynsym' contains [0-9]+ e + # And ensure the dynamic symbol table contains at least x@VERS.0 + # and foo@@VERS.0 symbols + #... +- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0 ++ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.* + #... +- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0 ++ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.* + #... + Symbol table '.symtab' contains [0-9]+ entries: + #pass +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin.exp binutils-2.30/ld/testsuite/ld-plugin/plugin.exp +--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2018-09-05 09:45:44.023108605 +0100 ++++ binutils-2.30/ld/testsuite/ld-plugin/plugin.exp 2018-09-05 11:18:53.997202105 +0100 +@@ -118,6 +118,12 @@ if { $can_compile && !$failed_compile } + } + } + ++# I do not know why, but the underscore prefix test is going ++# wrong on ppc64le targets. So override it here. ++if { [istarget powerpc*-*-linux*] || [istarget x86_64*-*-linux*] } { ++ set _ "" ++} ++ + set testobjfiles "tmpdir/main.o tmpdir/func.o tmpdir/text.o" + set testobjfiles_notext "tmpdir/main.o tmpdir/func.o" + set testsrcfiles "tmpdir/main.o $srcdir/$subdir/func.c tmpdir/text.o" diff --git a/patches/binutils/2.35/binutils-gas-Use-the-directory-name-in-.file-0.patch b/patches/binutils/2.35/binutils-gas-Use-the-directory-name-in-.file-0.patch new file mode 100644 index 00000000..e3e75269 --- /dev/null +++ b/patches/binutils/2.35/binutils-gas-Use-the-directory-name-in-.file-0.patch @@ -0,0 +1,292 @@ +diff --git a/gas/testsuite/gas/elf/dwarf-5-file0-2.d b/gas/testsuite/gas/elf/dwarf-5-file0-2.d +new file mode 100644 +index 00000000000..4b3ed29f4c9 +--- /dev/null ++++ b/gas/testsuite/gas/elf/dwarf-5-file0-2.d +@@ -0,0 +1,15 @@ ++#as: --gdwarf-5 ++#name: DWARF5 .file 0 dir file ++#readelf: -wl ++ ++#... ++ The Directory Table \(offset 0x.*, lines 1, columns 1\): ++ Entry Name ++#... ++ 0 \(indirect line string, offset: 0x.*\): /example ++ ++ The File Name Table \(offset 0x.*, lines 2, columns 2\): ++ Entry Dir Name ++ 0 0 \(indirect line string, offset: 0x.*\): test.c ++ 1 0 \(indirect line string, offset: 0x.*\): test.c ++#pass +diff --git a/gas/testsuite/gas/elf/dwarf-5-file0-2.s b/gas/testsuite/gas/elf/dwarf-5-file0-2.s +new file mode 100644 +index 00000000000..135a03bf493 +--- /dev/null ++++ b/gas/testsuite/gas/elf/dwarf-5-file0-2.s +@@ -0,0 +1,111 @@ ++ .file "test.c" ++ .text ++.Ltext0: ++ .file 0 "/example" "test.c" ++ .globl x ++ .section .bss ++ .balign 4 ++ .type x, @object ++ .size x, 4 ++x: ++ .zero 4 ++ .text ++.Letext0: ++ .file 1 "test.c" ++ .section .debug_info,"",%progbits ++.Ldebug_info0: ++ .long 0x32 ++ .2byte 0x5 ++ .byte 0x1 ++ .byte 0x4 ++ .long .Ldebug_abbrev0 ++ .uleb128 0x1 ++ .long .LASF2 ++ .byte 0x1d ++ .long .LASF0 ++ .long .LASF1 ++ .long .Ldebug_line0 ++ .uleb128 0x2 ++ .string "x" ++ .byte 0x1 ++ .byte 0x1 ++ .byte 0x5 ++ .long 0x2e ++ .uleb128 0x5 ++ .byte 0x3 ++ .long x ++ .uleb128 0x3 ++ .byte 0x4 ++ .byte 0x5 ++ .string "int" ++ .byte 0 ++ .section .debug_abbrev,"",%progbits ++.Ldebug_abbrev0: ++ .uleb128 0x1 ++ .uleb128 0x11 ++ .byte 0x1 ++ .uleb128 0x25 ++ .uleb128 0xe ++ .uleb128 0x13 ++ .uleb128 0xb ++ .uleb128 0x3 ++ .uleb128 0x1f ++ .uleb128 0x1b ++ .uleb128 0x1f ++ .uleb128 0x10 ++ .uleb128 0x17 ++ .byte 0 ++ .byte 0 ++ .uleb128 0x2 ++ .uleb128 0x34 ++ .byte 0 ++ .uleb128 0x3 ++ .uleb128 0x8 ++ .uleb128 0x3a ++ .uleb128 0xb ++ .uleb128 0x3b ++ .uleb128 0xb ++ .uleb128 0x39 ++ .uleb128 0xb ++ .uleb128 0x49 ++ .uleb128 0x13 ++ .uleb128 0x3f ++ .uleb128 0x19 ++ .uleb128 0x2 ++ .uleb128 0x18 ++ .byte 0 ++ .byte 0 ++ .uleb128 0x3 ++ .uleb128 0x24 ++ .byte 0 ++ .uleb128 0xb ++ .uleb128 0xb ++ .uleb128 0x3e ++ .uleb128 0xb ++ .uleb128 0x3 ++ .uleb128 0x8 ++ .byte 0 ++ .byte 0 ++ .byte 0 ++ .section .debug_aranges,"",%progbits ++ .long 0x14 ++ .2byte 0x2 ++ .long .Ldebug_info0 ++ .byte 0x4 ++ .byte 0 ++ .2byte 0 ++ .2byte 0 ++ .long 0 ++ .long 0 ++ .section .debug_line,"",%progbits ++.Ldebug_line0: ++ .section .debug_str,"MS",%progbits,1 ++.LASF2: ++ .string "GNU C17 11.2.1 -g" ++ .section .debug_line_str,"MS",%progbits,1 ++.LASF1: ++ .string "/example" ++.LASF0: ++ .string "test.c" ++ .ident "GCC: (GNU) 11.2.1" ++ .section .note.GNU-stack,"",%progbits +diff --git a/gas/testsuite/gas/elf/dwarf-5-file0-2.s b/gas/testsuite/gas/elf/dwarf-5-file0-2.s +index 135a03bf493..bab4a16b56b 100644 +--- a/gas/testsuite/gas/elf/dwarf-5-file0-2.s ++++ b/gas/testsuite/gas/elf/dwarf-5-file0-2.s +@@ -5,7 +5,7 @@ + .globl x + .section .bss + .balign 4 +- .type x, @object ++ .type x, %object + .size x, 4 + x: + .zero 4 +@@ -14,30 +14,30 @@ x: + .file 1 "test.c" + .section .debug_info,"",%progbits + .Ldebug_info0: +- .long 0x32 ++ .4byte 0x32 + .2byte 0x5 + .byte 0x1 + .byte 0x4 +- .long .Ldebug_abbrev0 ++ .4byte .Ldebug_abbrev0 + .uleb128 0x1 +- .long .LASF2 ++ .4byte .LASF2 + .byte 0x1d +- .long .LASF0 +- .long .LASF1 +- .long .Ldebug_line0 ++ .4byte .LASF0 ++ .4byte .LASF1 ++ .4byte .Ldebug_line0 + .uleb128 0x2 +- .string "x" ++ .asciz "x" + .byte 0x1 + .byte 0x1 + .byte 0x5 +- .long 0x2e ++ .4byte 0x2e + .uleb128 0x5 + .byte 0x3 +- .long x ++ .4byte x + .uleb128 0x3 + .byte 0x4 + .byte 0x5 +- .string "int" ++ .asciz "int" + .byte 0 + .section .debug_abbrev,"",%progbits + .Ldebug_abbrev0: +@@ -88,24 +88,24 @@ x: + .byte 0 + .byte 0 + .section .debug_aranges,"",%progbits +- .long 0x14 ++ .4byte 0x14 + .2byte 0x2 +- .long .Ldebug_info0 ++ .4byte .Ldebug_info0 + .byte 0x4 + .byte 0 + .2byte 0 + .2byte 0 +- .long 0 +- .long 0 ++ .4byte 0 ++ .4byte 0 + .section .debug_line,"",%progbits + .Ldebug_line0: + .section .debug_str,"MS",%progbits,1 + .LASF2: +- .string "GNU C17 11.2.1 -g" ++ .asciz "GNU C17 11.2.1 -g" + .section .debug_line_str,"MS",%progbits,1 + .LASF1: +- .string "/example" ++ .asciz "/example" + .LASF0: +- .string "test.c" ++ .asciz "test.c" + .ident "GCC: (GNU) 11.2.1" + .section .note.GNU-stack,"",%progbits +diff -rup binutils.orig/gas/dwarf2dbg.c binutils-2.35.2/gas/dwarf2dbg.c +--- binutils.orig/gas/dwarf2dbg.c 2021-11-08 14:59:19.759524743 +0000 ++++ binutils-2.35.2/gas/dwarf2dbg.c 2021-11-08 15:00:55.179909708 +0000 +@@ -588,6 +588,7 @@ get_basename (const char * pathname) + + static unsigned int + get_directory_table_entry (const char * dirname, ++ const char * file0_dirname, + size_t dirlen, + bfd_boolean can_use_zero) + { +@@ -617,7 +618,7 @@ get_directory_table_entry (const char * + { + if (dirs == NULL || dirs[0] == NULL) + { +- const char * pwd = getpwd (); ++ const char * pwd = file0_dirname ? file0_dirname : getpwd (); + + if (dwarf_level >= 5 && strcmp (dirname, pwd) != 0) + { +@@ -626,7 +627,7 @@ get_directory_table_entry (const char * + directory). Since we are about to create a directory entry that + is not the same, allocate the current directory first. + FIXME: Alternatively we could generate an error message here. */ +- (void) get_directory_table_entry (pwd, strlen (pwd), TRUE); ++ (void) get_directory_table_entry (pwd, NULL, strlen (pwd), TRUE); + d = 1; + } + else +@@ -722,7 +723,7 @@ allocate_filenum (const char * pathname) + file = get_basename (pathname); + dir_len = file - pathname; + +- dir = get_directory_table_entry (pathname, dir_len, FALSE); ++ dir = get_directory_table_entry (pathname, NULL, dir_len, FALSE); + + /* Do not use slot-0. That is specifically reserved for use by + the '.file 0 "name"' directive. */ +@@ -762,6 +763,7 @@ allocate_filename_to_slot (const char * + const char *file; + size_t dirlen; + unsigned int i, d; ++ const char *file0_dirname = dirname; + + /* Short circuit the common case of adding the same pathname + as last time. */ +@@ -836,7 +838,8 @@ allocate_filename_to_slot (const char * + file = filename; + } + +- d = get_directory_table_entry (dirname, dirlen, num == 0); ++ d = get_directory_table_entry (dirname, file0_dirname, dirlen, ++ num == 0); + i = num; + + if (! assign_file_to_slot (i, file, d)) +diff -rup binutils.orig/gas/testsuite/gas/elf/elf.exp binutils-2.35.2/gas/testsuite/gas/elf/elf.exp +--- binutils.orig/gas/testsuite/gas/elf/elf.exp 2021-11-08 14:59:19.856524118 +0000 ++++ binutils-2.35.2/gas/testsuite/gas/elf/elf.exp 2021-11-08 14:59:36.225418609 +0000 +@@ -274,6 +274,7 @@ if { [is_elf_format] } then { + run_dump_test "dwarf2-18" $dump_opts + run_dump_test "dwarf2-19" $dump_opts + run_dump_test "dwarf-5-file0" $dump_opts ++ run_dump_test "dwarf-5-file0-2" $dump_opts + run_dump_test "dwarf-5-dir0" $dump_opts + run_dump_test "dwarf-4-cu" $dump_opts + run_dump_test "dwarf-5-cu" $dump_opts + diff --git a/patches/binutils/2.35/binutils-gas-auto-dwarf-5.patch b/patches/binutils/2.35/binutils-gas-auto-dwarf-5.patch new file mode 100644 index 00000000..526b44f6 --- /dev/null +++ b/patches/binutils/2.35/binutils-gas-auto-dwarf-5.patch @@ -0,0 +1,47 @@ +--- binutils.orig/gas/dwarf2dbg.c 2021-01-18 15:02:20.322260068 +0000 ++++ binutils-2.35.1/gas/dwarf2dbg.c 2021-01-18 15:04:20.078481127 +0000 +@@ -537,7 +537,11 @@ dwarf2_gen_line_info (addressT ofs, stru + if (loc->line == 0) + return; + if (loc->filenum == 0 && DWARF2_LINE_VERSION < 5) +- return; ++ { ++ dwarf_level = 5; ++ if (DWARF2_LINE_VERSION < 5) ++ return; ++ } + + /* Don't emit sequences of line symbols for the same line when the + symbols apply to assembler code. It is necessary to emit +@@ -1030,9 +1034,13 @@ dwarf2_directive_filename (void) + + if ((offsetT) num < 1 && DWARF2_LINE_VERSION < 5) + { +- as_bad (_("file number less than one")); +- ignore_rest_of_line (); +- return NULL; ++ dwarf_level = 5; ++ if (DWARF2_LINE_VERSION < 5) ++ { ++ as_bad (_("file number less than one")); ++ ignore_rest_of_line (); ++ return NULL; ++ } + } + + /* FIXME: Should we allow ".file \n" as an expression meaning +@@ -1129,8 +1137,12 @@ dwarf2_directive_loc (int dummy ATTRIBUT + { + if (filenum != 0 || DWARF2_LINE_VERSION < 5) + { +- as_bad (_("file number less than one")); +- return; ++ dwarf_level = 5; ++ if (DWARF2_LINE_VERSION < 5) ++ { ++ as_bad (_("file number less than one")); ++ return; ++ } + } + } + diff --git a/patches/binutils/2.35/binutils-gas-multibyte-warnings.patch b/patches/binutils/2.35/binutils-gas-multibyte-warnings.patch new file mode 100644 index 00000000..62ff235f --- /dev/null +++ b/patches/binutils/2.35/binutils-gas-multibyte-warnings.patch @@ -0,0 +1,375 @@ +diff -rupN binutils.orig/gas/NEWS binutils-2.35.2/gas/NEWS +--- binutils.orig/gas/NEWS 2021-11-19 13:45:07.404537791 +0000 ++++ binutils-2.35.2/gas/NEWS 2021-11-19 13:46:06.334144249 +0000 +@@ -1,5 +1,13 @@ + -*- text -*- + ++* The --multibyte-handling=[allow|warn|warn-sym-only] option tells the ++ assembler what to when it encoutners multibyte characters in the input. The ++ default is to allow them. Setting the option to "warn" will generate a ++ warning message whenever any multibyte character is encountered. Using the ++ option to "warn-sym-only" will make the assembler generate a warning whenever a ++ symbol is defined containing multibyte characters. (References to undefined ++ symbols will not generate warnings). ++ + * Add {disp16} pseudo prefix to x86 assembler. + + Changes in 2.35: +diff -rupN binutils.orig/gas/app.c binutils-2.35.2/gas/app.c +--- binutils.orig/gas/app.c 2021-11-19 13:45:07.403537798 +0000 ++++ binutils-2.35.2/gas/app.c 2021-11-19 13:45:34.611356099 +0000 +@@ -352,6 +352,55 @@ process_escape (int ch) + } + } + ++#define MULTIBYTE_WARN_COUNT_LIMIT 10 ++static unsigned int multibyte_warn_count = 0; ++ ++bfd_boolean ++scan_for_multibyte_characters (const unsigned char * start, ++ const unsigned char * end, ++ bfd_boolean warn) ++{ ++ if (end <= start) ++ return FALSE; ++ ++ if (warn && multibyte_warn_count > MULTIBYTE_WARN_COUNT_LIMIT) ++ return FALSE; ++ ++ bfd_boolean found = FALSE; ++ ++ while (start < end) ++ { ++ unsigned char c; ++ ++ if ((c = * start++) <= 0x7f) ++ continue; ++ ++ if (!warn) ++ return TRUE; ++ ++ found = TRUE; ++ ++ const char * filename; ++ unsigned int lineno; ++ ++ filename = as_where (& lineno); ++ if (filename == NULL) ++ as_warn (_("multibyte character (%#x) encountered in input"), c); ++ else if (lineno == 0) ++ as_warn (_("multibyte character (%#x) encountered in %s"), c, filename); ++ else ++ as_warn (_("multibyte character (%#x) encountered in %s at or near line %u"), c, filename, lineno); ++ ++ if (++ multibyte_warn_count == MULTIBYTE_WARN_COUNT_LIMIT) ++ { ++ as_warn (_("further multibyte character warnings suppressed")); ++ break; ++ } ++ } ++ ++ return found; ++} ++ + /* This function is called to process input characters. The GET + parameter is used to retrieve more input characters. GET should + set its parameter to point to a buffer, and return the length of +@@ -470,6 +519,11 @@ do_scrub_chars (size_t (*get) (char *, s + return 0; + from = input_buffer; + fromend = from + fromlen; ++ ++ if (multibyte_handling == multibyte_warn) ++ (void) scan_for_multibyte_characters ((const unsigned char *) from, ++ (const unsigned char* ) fromend, ++ TRUE /* Generate warnings. */); + } + + while (1) +diff -rupN binutils.orig/gas/as.c binutils-2.35.2/gas/as.c +--- binutils.orig/gas/as.c 2021-11-19 13:45:07.404537791 +0000 ++++ binutils-2.35.2/gas/as.c 2021-11-19 13:45:34.613356085 +0000 +@@ -482,7 +482,7 @@ parse_args (int * pargc, char *** pargv) + OPTION_DEBUG_PREFIX_MAP, + OPTION_DEFSYM, + OPTION_LISTING_LHS_WIDTH, +- OPTION_LISTING_LHS_WIDTH2, ++ OPTION_LISTING_LHS_WIDTH2, /* = STD_BASE + 10 */ + OPTION_LISTING_RHS_WIDTH, + OPTION_LISTING_CONT_LINES, + OPTION_DEPFILE, +@@ -492,7 +492,7 @@ parse_args (int * pargc, char *** pargv) + OPTION_GDWARF_3, + OPTION_GDWARF_4, + OPTION_GDWARF_5, +- OPTION_GDWARF_SECTIONS, ++ OPTION_GDWARF_SECTIONS, /* = STD_BASE + 20 */ + OPTION_GDWARF_CIE_VERSION, + OPTION_STRIP_LOCAL_ABSOLUTE, + OPTION_TRADITIONAL_FORMAT, +@@ -502,7 +502,7 @@ parse_args (int * pargc, char *** pargv) + OPTION_NOEXECSTACK, + OPTION_SIZE_CHECK, + OPTION_ELF_STT_COMMON, +- OPTION_ELF_BUILD_NOTES, ++ OPTION_ELF_BUILD_NOTES, /* = STD_BASE + 30 */ + OPTION_SECTNAME_SUBST, + OPTION_ALTERNATE, + OPTION_AL, +@@ -511,7 +511,8 @@ parse_args (int * pargc, char *** pargv) + OPTION_WARN_FATAL, + OPTION_COMPRESS_DEBUG, + OPTION_NOCOMPRESS_DEBUG, +- OPTION_NO_PAD_SECTIONS /* = STD_BASE + 40 */ ++ OPTION_NO_PAD_SECTIONS, ++ OPTION_MULTIBYTE_HANDLING /* = STD_BASE + 40 */ + /* When you add options here, check that they do + not collide with OPTION_MD_BASE. See as.h. */ + }; +@@ -589,6 +590,7 @@ parse_args (int * pargc, char *** pargv) + ,{"target-help", no_argument, NULL, OPTION_TARGET_HELP} + ,{"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT} + ,{"warn", no_argument, NULL, OPTION_WARN} ++ ,{"multibyte-handling", required_argument, NULL, OPTION_MULTIBYTE_HANDLING} + }; + + /* Construct the option lists from the standard list and the target +@@ -691,6 +693,19 @@ parse_args (int * pargc, char *** pargv) + flag_traditional_format = 1; + break; + ++ case OPTION_MULTIBYTE_HANDLING: ++ if (strcmp (optarg, "allow") == 0) ++ multibyte_handling = multibyte_allow; ++ else if (strcmp (optarg, "warn") == 0) ++ multibyte_handling = multibyte_warn; ++ else if (strcmp (optarg, "warn-sym-only") == 0) ++ multibyte_handling = multibyte_warn_syms; ++ else if (strcmp (optarg, "warn_sym_only") == 0) ++ multibyte_handling = multibyte_warn_syms; ++ else ++ as_fatal (_("unexpected argument to --multibyte-input-option: '%s'"), optarg); ++ break; ++ + case OPTION_VERSION: + /* This output is intended to follow the GNU standards document. */ + printf (_("GNU assembler %s\n"), BFD_VERSION_STRING); +diff -rupN binutils.orig/gas/as.h binutils-2.35.2/gas/as.h +--- binutils.orig/gas/as.h 2021-11-19 13:45:07.136539581 +0000 ++++ binutils-2.35.2/gas/as.h 2021-11-19 13:45:34.613356085 +0000 +@@ -388,6 +388,14 @@ COMMON int linkrelax; + + COMMON int do_not_pad_sections_to_alignment; + ++enum multibyte_input_handling ++{ ++ multibyte_allow = 0, ++ multibyte_warn, ++ multibyte_warn_syms ++}; ++COMMON enum multibyte_input_handling multibyte_handling; ++ + /* TRUE if we should produce a listing. */ + extern int listing; + +@@ -495,6 +503,7 @@ void input_scrub_insert_file (char *); + char * input_scrub_new_file (const char *); + char * input_scrub_next_buffer (char **bufp); + size_t do_scrub_chars (size_t (*get) (char *, size_t), char *, size_t); ++bfd_boolean scan_for_multibyte_characters (const unsigned char *, const unsigned char *, bfd_boolean); + int gen_to_words (LITTLENUM_TYPE *, int, long); + int had_err (void); + int ignore_input (void); +diff -rupN binutils.orig/gas/doc/as.texi binutils-2.35.2/gas/doc/as.texi +--- binutils.orig/gas/doc/as.texi 2021-11-19 13:45:07.141539547 +0000 ++++ binutils-2.35.2/gas/doc/as.texi 2021-11-19 13:45:34.617356059 +0000 +@@ -246,6 +246,7 @@ gcc(1), ld(1), and the Info entries for + [@b{--sectname-subst}] [@b{--size-check=[error|warning]}] + [@b{--elf-stt-common=[no|yes]}] + [@b{--generate-missing-build-notes=[no|yes]}] ++ [@b{--multibyte-handling=[allow|warn|warn-sym-only]}] + [@b{--target-help}] [@var{target-options}] + [@b{--}|@var{files} @dots{}] + @c +@@ -866,6 +867,18 @@ Set the maximum width of an input source + Set the maximum number of lines printed in a listing for a single line of input + to @var{number} + 1. + ++@item --multibyte-handling=allow ++@itemx --multibyte-handling=warn ++@itemx --multibyte-handling=warn-sym-only ++Controls how the assembler handles multibyte characters in the input. The ++default (which can be restored by using the @option{allow} argument) is to ++allow such characters without complaint. Using the @option{warn} argument will ++make the assembler generate a warning message whenever any multibyte character ++is encountered. Using the @option{warn-sym-only} argument will only cause a ++warning to be generated when a symbol is defined with a name that contains ++multibyte characters. (References to undefined symbols will not generate a ++warning). ++ + @item --no-pad-sections + Stop the assembler for padding the ends of output sections to the alignment + of that section. The default is to pad the sections, but this can waste space +@@ -2954,9 +2967,11 @@ are noted in @ref{Machine Dependencies}. + @end ifset + No symbol may begin with a digit. Case is significant. + There is no length limit; all characters are significant. Multibyte characters +-are supported. Symbols are delimited by characters not in that set, or by the +-beginning of a file (since the source program must end with a newline, the end +-of a file is not a possible symbol delimiter). @xref{Symbols}. ++are supported, but note that the setting of the ++@option{--multibyte-handling} option might prevent their use. Symbols ++are delimited by characters not in that set, or by the beginning of a file ++(since the source program must end with a newline, the end of a file is not a ++possible symbol delimiter). @xref{Symbols}. + + Symbol names may also be enclosed in double quote @code{"} characters. In such + cases any characters are allowed, except for the NUL character. If a double +@@ -3846,11 +3861,18 @@ than @code{Foo}. + Symbol names do not start with a digit. An exception to this rule is made for + Local Labels. See below. + +-Multibyte characters are supported. To generate a symbol name containing ++Multibyte characters are supported, but note that the setting of the ++@option{multibyte-handling} option might prevent their use. ++To generate a symbol name containing + multibyte characters enclose it within double quotes and use escape codes. cf + @xref{Strings}. Generating a multibyte symbol name from a label is not + currently supported. + ++Since multibyte symbol names are unusual, and could possibly be used ++maliciously, @command{@value{AS}} provides a command line option ++(@option{--multibyte-handling=warn-sym-only}) which can be used to generate a ++warning message whenever a symbol name containing multibyte characters is defined. ++ + Each symbol has exactly one name. Each name in an assembly language program + refers to exactly one symbol. You may use that symbol name any number of times + in a program. +diff -rupN binutils.orig/gas/input-scrub.c binutils-2.35.2/gas/input-scrub.c +--- binutils.orig/gas/input-scrub.c 2021-11-19 13:45:07.138539567 +0000 ++++ binutils-2.35.2/gas/input-scrub.c 2021-11-19 13:45:34.618356052 +0000 +@@ -377,6 +377,11 @@ input_scrub_next_buffer (char **bufp) + ++p; + } + ++ if (multibyte_handling == multibyte_warn) ++ (void) scan_for_multibyte_characters ((const unsigned char *) p, ++ (const unsigned char *) limit, ++ TRUE /* Generate warnings */); ++ + /* We found a newline in the newly read chars. */ + partial_where = p; + partial_size = limit - p; +diff -rupN binutils.orig/gas/symbols.c binutils-2.35.2/gas/symbols.c +--- binutils.orig/gas/symbols.c 2021-11-19 13:45:07.404537791 +0000 ++++ binutils-2.35.2/gas/symbols.c 2021-11-19 13:50:21.853437801 +0000 +@@ -73,6 +73,10 @@ struct symbol_flags + before. It is cleared as soon as any direct reference to the + symbol is present. */ + unsigned int sy_weakrefd : 1; ++ ++ /* Set when a warning about the symbol containing multibyte characters ++ is generated. */ ++ unsigned int multibyte_warned : 1; + }; + + /* The information we keep for a symbol. Note that the symbol table +@@ -282,6 +286,18 @@ symbol_create (const char *name, /* It i + as_fatal ("bfd_make_empty_symbol: %s", bfd_errmsg (bfd_get_error ())); + S_SET_NAME (symbolP, preserved_copy_of_name); + ++ if (multibyte_handling == multibyte_warn_syms ++ && ! symbolP->sy_flags.sy_local_symbol ++ && segment != undefined_section ++ && ! symbolP->sy_flags.multibyte_warned ++ && scan_for_multibyte_characters ((const unsigned char *) name, ++ (const unsigned char *) name + strlen (name), ++ FALSE /* Do not warn. */)) ++ { ++ as_warn (_("symbol '%s' contains multibyte characters"), name); ++ symbolP->sy_flags.multibyte_warned = 1; ++ } ++ + S_SET_SEGMENT (symbolP, segment); + S_SET_VALUE (symbolP, valu); + symbol_clear_list_pointers (symbolP); +@@ -2421,7 +2437,21 @@ S_SET_SEGMENT (symbolS *s, segT seg) + abort (); + } + else +- s->bsym->section = seg; ++ { ++ if (multibyte_handling == multibyte_warn_syms ++ && ! s->sy_flags.sy_local_symbol ++ && seg != undefined_section ++ && ! s->sy_flags.multibyte_warned ++ && scan_for_multibyte_characters ((const unsigned char *) S_GET_NAME (s), ++ (const unsigned char *) S_GET_NAME (s) + strlen (S_GET_NAME (s)), ++ FALSE)) ++ { ++ as_warn (_("symbol '%s' contains multibyte characters"), S_GET_NAME (s)); ++ s->sy_flags.multibyte_warned = 1; ++ } ++ ++ s->bsym->section = seg; ++ } + } + + void +diff -rupN binutils.orig/gas/testsuite/gas/all/gas.exp binutils-2.35.2/gas/testsuite/gas/all/gas.exp +--- binutils.orig/gas/testsuite/gas/all/gas.exp 2021-11-19 13:45:07.400537818 +0000 ++++ binutils-2.35.2/gas/testsuite/gas/all/gas.exp 2021-11-19 13:51:08.664125186 +0000 +@@ -470,3 +470,5 @@ run_dump_test "fill-1" + gas_test "pr23938.s" "" "" ".xstabs" + + run_dump_test "nop" ++run_dump_test "multibyte1" ++run_dump_test "multibyte2" +diff -rupN binutils.orig/testsuite/gas/all/multibyte.s binutils-2.35.2/testsuite/gas/all/multibyte.s +--- binutils.orig/testsuite/gas/all/multibyte.s 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/testsuite/gas/all/multibyte.s 2021-11-19 13:45:35.284351604 +0000 +@@ -0,0 +1,8 @@ ++ .text ++ .globl he‮oll‬ ++he‮oll‬: ++ .nop ++ ++ .globl hello ++hello: ++ .nop +diff -rupN binutils.orig/testsuite/gas/all/multibyte1.d binutils-2.35.2/testsuite/gas/all/multibyte1.d +--- binutils.orig/testsuite/gas/all/multibyte1.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/testsuite/gas/all/multibyte1.d 2021-11-19 13:45:35.284351604 +0000 +@@ -0,0 +1,3 @@ ++#source: multibyte.s ++#as: --multibyte-handling=warn ++#warning_output: multibyte1.l +diff -rupN binutils.orig/testsuite/gas/all/multibyte1.l binutils-2.35.2/testsuite/gas/all/multibyte1.l +--- binutils.orig/testsuite/gas/all/multibyte1.l 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/testsuite/gas/all/multibyte1.l 2021-11-19 13:45:35.284351604 +0000 +@@ -0,0 +1,12 @@ ++[^:]*: Assembler messages: ++[^:]*: Warning: multibyte character \(0xe2\) encountered in .*multibyte.s ++[^:]*: Warning: multibyte character \(0x80\) encountered in .*multibyte.s ++[^:]*: Warning: multibyte character \(0xae\) encountered in .*multibyte.s ++[^:]*: Warning: multibyte character \(0xe2\) encountered in .*multibyte.s ++[^:]*: Warning: multibyte character \(0x80\) encountered in .*multibyte.s ++[^:]*: Warning: multibyte character \(0xac\) encountered in .*multibyte.s ++[^:]*: Warning: multibyte character \(0xe2\) encountered in .*multibyte.s ++[^:]*: Warning: multibyte character \(0x80\) encountered in .*multibyte.s ++[^:]*: Warning: multibyte character \(0xae\) encountered in .*multibyte.s ++[^:]*: Warning: multibyte character \(0xe2\) encountered in .*multibyte.s ++[^:]*: Warning: further multibyte character warnings suppressed +diff -rupN binutils.orig/testsuite/gas/all/multibyte2.d binutils-2.35.2/testsuite/gas/all/multibyte2.d +--- binutils.orig/testsuite/gas/all/multibyte2.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/testsuite/gas/all/multibyte2.d 2021-11-19 13:45:35.284351604 +0000 +@@ -0,0 +1,3 @@ ++#source: multibyte.s ++#as: --multibyte-handling=warn-sym-only ++#warning_output: multibyte2.l +diff -rupN binutils.orig/testsuite/gas/all/multibyte2.l binutils-2.35.2/testsuite/gas/all/multibyte2.l +--- binutils.orig/testsuite/gas/all/multibyte2.l 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/testsuite/gas/all/multibyte2.l 2021-11-19 13:45:35.284351604 +0000 +@@ -0,0 +1,2 @@ ++[^:]*: Assembler messages: ++[^:]*:3: Warning: symbol '.*' contains multibyte characters diff --git a/patches/binutils/2.35/binutils-gcc-10-fixes.patch b/patches/binutils/2.35/binutils-gcc-10-fixes.patch new file mode 100644 index 00000000..4233279f --- /dev/null +++ b/patches/binutils/2.35/binutils-gcc-10-fixes.patch @@ -0,0 +1,180 @@ +diff -rup binutils.orig/gold/gdb-index.cc binutils-2.34.0/gold/gdb-index.cc +--- binutils.orig/gold/gdb-index.cc 2020-07-24 09:12:29.241306445 +0100 ++++ binutils-2.34.0/gold/gdb-index.cc 2020-07-24 09:15:48.332095898 +0100 +@@ -817,7 +817,7 @@ Gdb_index_info_reader::get_qualified_nam + void + Gdb_index_info_reader::record_cu_ranges(Dwarf_die* die) + { +- unsigned int shndx; ++ unsigned int shndx = 0; + unsigned int shndx2; + + off_t ranges_offset = die->ref_attribute(elfcpp::DW_AT_ranges, &shndx); +diff -rup binutils.orig/gold/layout.cc binutils-2.34.0/gold/layout.cc +--- binutils.orig/gold/layout.cc 2020-07-24 09:12:29.243306433 +0100 ++++ binutils-2.34.0/gold/layout.cc 2020-07-24 09:15:11.464320064 +0100 +@@ -1986,7 +1986,7 @@ Layout::attach_allocated_section_to_segm + seg_flags |= os->extra_segment_flags(); + + // Check for --section-start. +- uint64_t addr; ++ uint64_t addr = 0; + bool is_address_set = parameters->options().section_start(os->name(), &addr); + + // In general the only thing we really care about for PT_LOAD +diff -rup binutils.orig/binutils/dlltool.c binutils-2.34.0/binutils/dlltool.c +--- binutils.orig/binutils/dlltool.c 2020-07-24 09:12:28.974308069 +0100 ++++ binutils-2.34.0/binutils/dlltool.c 2020-07-24 12:09:37.527121295 +0100 +@@ -1305,7 +1305,7 @@ run (const char *what, char *args) + int pid, wait_status; + int i; + const char **argv; +- char *errmsg_fmt, *errmsg_arg; ++ char *errmsg_fmt = "", *errmsg_arg = ""; + char *temp_base = choose_temp_base (); + + inform (_("run: %s %s"), what, args); +diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c +--- binutils.orig/gas/config/tc-arm.c 2020-07-24 09:12:32.368287432 +0100 ++++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 12:14:19.842360634 +0100 +@@ -28416,9 +28416,12 @@ md_apply_fix (fixS * fixP, + perform relaxation. */ + if (value == -2) + { +- newval = md_chars_to_number (buf, THUMB_SIZE); +- newval = 0xbf00; /* NOP encoding T1 */ +- md_number_to_chars (buf, newval, THUMB_SIZE); ++ if (fixP->fx_done || !seg->use_rela_p) ++ { ++ newval = md_chars_to_number (buf, THUMB_SIZE); ++ newval = 0xbf00; /* NOP encoding T1 */ ++ md_number_to_chars (buf, newval, THUMB_SIZE); ++ } + } + else + { +@@ -28631,17 +28634,14 @@ md_apply_fix (fixS * fixP, + case BFD_RELOC_ARM_GOTFUNCDESC: + case BFD_RELOC_ARM_GOTOFFFUNCDESC: + case BFD_RELOC_ARM_FUNCDESC: +- if (arm_fdpic) +- { +- if (fixP->fx_done || !seg->use_rela_p) +- md_number_to_chars (buf, 0, 4); +- } +- else ++ if (!arm_fdpic) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _("Relocation supported only in FDPIC mode")); +- } +- break; ++ break; ++ } ++ value = 0; ++ /* Fall through. */ + #endif + + case BFD_RELOC_RVA: +diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c +--- binutils.orig/gas/config/tc-arm.c 2020-07-24 12:16:02.099719884 +0100 ++++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 12:34:17.690858328 +0100 +@@ -28641,7 +28641,7 @@ md_apply_fix (fixS * fixP, + break; + } + value = 0; +- /* Fall through. */ ++ goto fred; + #endif + + case BFD_RELOC_RVA: +@@ -28653,6 +28653,7 @@ md_apply_fix (fixS * fixP, + #ifdef TE_PE + case BFD_RELOC_32_SECREL: + #endif ++ fred: + if (fixP->fx_done || !seg->use_rela_p) + #ifdef TE_WINCE + /* For WinCE we only do this for pcrel fixups. */ +diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c +--- binutils.orig/gas/config/tc-arm.c 2020-07-24 13:28:26.926553452 +0100 ++++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 13:31:57.835215763 +0100 +@@ -28416,12 +28416,8 @@ md_apply_fix (fixS * fixP, + perform relaxation. */ + if (value == -2) + { +- if (fixP->fx_done || !seg->use_rela_p) +- { +- newval = md_chars_to_number (buf, THUMB_SIZE); +- newval = 0xbf00; /* NOP encoding T1 */ +- md_number_to_chars (buf, newval, THUMB_SIZE); +- } ++ newval = 0xbf00; /* NOP encoding T1 */ ++ goto jim; + } + else + { +@@ -28432,6 +28428,7 @@ md_apply_fix (fixS * fixP, + { + newval = md_chars_to_number (buf, THUMB_SIZE); + newval |= ((value & 0x3e) << 2) | ((value & 0x40) << 3); ++ jim: + md_number_to_chars (buf, newval, THUMB_SIZE); + } + } +diff -rup binutils.orig/binutils/mclex.c binutils-2.34.0/binutils/mclex.c +--- binutils.orig/binutils/mclex.c 2020-07-24 13:28:26.297557441 +0100 ++++ binutils-2.34.0/binutils/mclex.c 2020-07-24 14:46:53.587940149 +0100 +@@ -207,7 +207,7 @@ enum_severity (int e) + static void + mc_add_keyword_ascii (const char *sz, int rid, const char *grp, rc_uint_type nv, const char *sv) + { +- unichar *usz, *usv = NULL; ++ unichar *usz = NULL, *usv = NULL; + rc_uint_type usz_len; + + unicode_from_codepage (&usz_len, &usz, sz, CP_ACP); +diff -rup binutils.orig/binutils/windmc.c binutils-2.34.0/binutils/windmc.c +--- binutils.orig/binutils/windmc.c 2020-07-24 13:28:26.279557556 +0100 ++++ binutils-2.34.0/binutils/windmc.c 2020-07-24 14:48:05.460477478 +0100 +@@ -338,7 +338,7 @@ mc_add_node_lang (mc_node *root, const m + static char * + convert_unicode_to_ACP (const unichar *usz) + { +- char *s; ++ char *s = NULL; + rc_uint_type l; + + if (! usz) +@@ -607,10 +607,10 @@ mc_generate_bin_item (mc_node_lang *n, r + else + { + rc_uint_type txt_len, l; +- char *cvt_txt; ++ char *cvt_txt = NULL; + + codepage_from_unicode( &l, n->message, &cvt_txt, n->lang->lang_info.wincp); +- if (! cvt_txt) ++ if (cvt_txt == NULL) + fatal ("Failed to convert message to language codepage.\n"); + txt_len = strlen (cvt_txt); + if (mcset_automatic_null_termination && txt_len > 0) +@@ -1107,7 +1107,7 @@ main (int argc, char **argv) + + /* Load the input file and do code page transformations to UTF16. */ + { +- unichar *u; ++ unichar *u = NULL; + rc_uint_type ul; + char *buff; + bfd_size_type flen; +--- binutils.orig/binutils/srconv.c 2020-07-24 15:37:25.847459208 +0100 ++++ binutils-2.34.0/binutils/srconv.c 2020-07-24 15:39:12.853773423 +0100 +@@ -316,6 +316,7 @@ wr_hd (struct coff_ofile *p) + struct IT_hd hd; + + hd.spare1 = 0; ++ hd.spare2 = 0; + if (bfd_get_file_flags (abfd) & EXEC_P) + hd.mt = MTYPE_ABS_LM; + else diff --git a/patches/binutils/2.35/binutils-gold-gnu-properties.patch b/patches/binutils/2.35/binutils-gold-gnu-properties.patch new file mode 100644 index 00000000..3af9cc27 --- /dev/null +++ b/patches/binutils/2.35/binutils-gold-gnu-properties.patch @@ -0,0 +1,181 @@ +diff -rup binutils.orig/gold/testsuite/gnu_property_a.S binutils-2.35/gold/testsuite/gnu_property_a.S +--- binutils.orig/gold/testsuite/gnu_property_a.S 2021-01-18 14:01:41.228809868 +0000 ++++ binutils-2.35/gold/testsuite/gnu_property_a.S 2021-01-18 14:01:52.542736705 +0000 +@@ -1,8 +1,8 @@ + #define NT_GNU_PROPERTY_TYPE_0 5 + + #define GNU_PROPERTY_STACK_SIZE 1 +-#define GNU_PROPERTY_X86_ISA_1_USED 0xc0000000 +-#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0000001 ++#define GNU_PROPERTY_X86_ISA_1_USED 0xc0010002 ++#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0008002 + #define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002 + + #if __SIZEOF_PTRDIFF_T__ == 8 +diff -rup binutils.orig/gold/testsuite/gnu_property_b.S binutils-2.35/gold/testsuite/gnu_property_b.S +--- binutils.orig/gold/testsuite/gnu_property_b.S 2021-01-18 14:01:41.233809836 +0000 ++++ binutils-2.35/gold/testsuite/gnu_property_b.S 2021-01-18 14:01:52.542736705 +0000 +@@ -2,8 +2,8 @@ + + #define GNU_PROPERTY_STACK_SIZE 1 + #define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2 +-#define GNU_PROPERTY_X86_ISA_1_USED 0xc0000000 +-#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0000001 ++#define GNU_PROPERTY_X86_ISA_1_USED 0xc0010002 ++#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0008002 + #define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002 + + #if __SIZEOF_PTRDIFF_T__ == 8 +diff -rup binutils.orig/gold/testsuite/gnu_property_c.S binutils-2.35/gold/testsuite/gnu_property_c.S +--- binutils.orig/gold/testsuite/gnu_property_c.S 2021-01-18 14:01:41.232809843 +0000 ++++ binutils-2.35/gold/testsuite/gnu_property_c.S 2021-01-18 14:01:52.542736705 +0000 +@@ -2,8 +2,8 @@ + + #define GNU_PROPERTY_STACK_SIZE 1 + #define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2 +-#define GNU_PROPERTY_X86_ISA_1_USED 0xc0000000 +-#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0000001 ++#define GNU_PROPERTY_X86_ISA_1_USED 0xc0010002 ++#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0008002 + #define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002 + + #if __SIZEOF_PTRDIFF_T__ == 8 +diff -rup binutils.orig/gold/testsuite/gnu_property_test.sh binutils-2.35/gold/testsuite/gnu_property_test.sh +--- binutils.orig/gold/testsuite/gnu_property_test.sh 2021-01-18 14:01:41.236809817 +0000 ++++ binutils-2.35/gold/testsuite/gnu_property_test.sh 2021-01-18 14:01:52.543736699 +0000 +@@ -57,8 +57,8 @@ check_count gnu_property_test.stdout "GN + + check gnu_property_test.stdout "stack size: 0x111100" + check gnu_property_test.stdout "no copy on protected" +-check gnu_property_test.stdout "x86 ISA used: i486, SSE2, SSE4_2, AVX512CD" +-check gnu_property_test.stdout "x86 ISA needed: i486, SSE2, SSE4_2, AVX512CD" ++check gnu_property_test.stdout "x86 ISA used: x86-64-v2, , , " ++check gnu_property_test.stdout "x86 ISA needed: x86-64-v2, , , " + check gnu_property_test.stdout "x86 feature: IBT" + + exit 0 +diff -rup binutils.orig/gold/x86_64.cc binutils-2.35/gold/x86_64.cc +--- binutils.orig/gold/x86_64.cc 2021-01-18 14:01:41.225809888 +0000 ++++ binutils-2.35/gold/x86_64.cc 2021-01-18 14:01:52.543736699 +0000 +@@ -706,8 +706,9 @@ class Target_x86_64 : public Sized_targe + rela_irelative_(NULL), copy_relocs_(elfcpp::R_X86_64_COPY), + got_mod_index_offset_(-1U), tlsdesc_reloc_info_(), + tls_base_symbol_defined_(false), isa_1_used_(0), isa_1_needed_(0), +- feature_1_(0), object_isa_1_used_(0), object_feature_1_(0), +- seen_first_object_(false) ++ feature_1_(0), feature_2_used_(0), feature_2_needed_(0), ++ object_isa_1_used_(0), object_feature_1_(0), ++ object_feature_2_used_(0), seen_first_object_(false) + { } + + // Hook for a new output section. +@@ -1382,6 +1383,8 @@ class Target_x86_64 : public Sized_targe + uint32_t isa_1_used_; + uint32_t isa_1_needed_; + uint32_t feature_1_; ++ uint32_t feature_2_used_; ++ uint32_t feature_2_needed_; + // Target-specific properties from the current object. + // These bits get ORed into ISA_1_USED_ after all properties for the object + // have been processed. But if either is all zeroes (as when the property +@@ -1391,6 +1394,7 @@ class Target_x86_64 : public Sized_targe + // These bits get ANDed into FEATURE_1_ after all properties for the object + // have been processed. + uint32_t object_feature_1_; ++ uint32_t object_feature_2_used_; + // Whether we have seen our first object, for use in initializing FEATURE_1_. + bool seen_first_object_; + }; +@@ -1594,9 +1598,15 @@ Target_x86_64::record_gnu_property + + switch (pr_type) + { ++ case elfcpp::GNU_PROPERTY_X86_COMPAT_ISA_1_USED: ++ case elfcpp::GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED: ++ case elfcpp::GNU_PROPERTY_X86_COMPAT_2_ISA_1_USED: ++ case elfcpp::GNU_PROPERTY_X86_COMPAT_2_ISA_1_NEEDED: + case elfcpp::GNU_PROPERTY_X86_ISA_1_USED: + case elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED: + case elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND: ++ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED: ++ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED: + if (pr_datasz != 4) + { + gold_warning(_("%s: corrupt .note.gnu.property section " +@@ -1625,6 +1635,12 @@ Target_x86_64::record_gnu_property + // If we see multiple feature props in one object, OR them together. + this->object_feature_1_ |= val; + break; ++ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED: ++ this->object_feature_2_used_ |= val; ++ break; ++ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED: ++ this->feature_2_needed_ |= val; ++ break; + } + } + +@@ -1642,15 +1658,23 @@ Target_x86_64::merge_gnu_propertie + else if (this->isa_1_used_ != 0) + this->isa_1_used_ |= this->object_isa_1_used_; + this->feature_1_ &= this->object_feature_1_; ++ // If any object is missing the FEATURE_2_USED property, we must ++ // omit it from the output file. ++ if (this->object_feature_2_used_ == 0) ++ this->feature_2_used_ = 0; ++ else if (this->feature_2_used_ != 0) ++ this->feature_2_used_ |= this->object_feature_2_used_; + } + else + { + this->isa_1_used_ = this->object_isa_1_used_; + this->feature_1_ = this->object_feature_1_; ++ this->feature_2_used_ = this->object_feature_2_used_; + this->seen_first_object_ = true; + } + this->object_isa_1_used_ = 0; + this->object_feature_1_ = 0; ++ this->object_feature_2_used_ = 0; + } + + static inline void +@@ -1676,6 +1700,12 @@ Target_x86_64::do_finalize_gnu_pro + if (this->feature_1_ != 0) + add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND, + this->feature_1_); ++ if (this->feature_2_used_ != 0) ++ add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED, ++ this->feature_2_used_); ++ if (this->feature_2_needed_ != 0) ++ add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED, ++ this->feature_2_needed_); + } + + // Write the first three reserved words of the .got.plt section. +--- binutils.orig/elfcpp/elfcpp.h 2021-01-18 14:01:40.778812778 +0000 ++++ binutils-2.35/elfcpp/elfcpp.h 2021-01-18 14:50:05.144035077 +0000 +@@ -1009,9 +1009,21 @@ enum + GNU_PROPERTY_STACK_SIZE = 1, + GNU_PROPERTY_NO_COPY_ON_PROTECTED = 2, + GNU_PROPERTY_LOPROC = 0xc0000000, +- GNU_PROPERTY_X86_ISA_1_USED = 0xc0000000, +- GNU_PROPERTY_X86_ISA_1_NEEDED = 0xc0000001, +- GNU_PROPERTY_X86_FEATURE_1_AND = 0xc0000002, ++ GNU_PROPERTY_X86_COMPAT_ISA_1_USED = 0xc0000000, ++ GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED = 0xc0000001, ++ GNU_PROPERTY_X86_UINT32_AND_LO = 0xc0000002, ++ GNU_PROPERTY_X86_UINT32_AND_HI = 0xc0007fff, ++ GNU_PROPERTY_X86_UINT32_OR_LO = 0xc0008000, ++ GNU_PROPERTY_X86_UINT32_OR_HI = 0xc000ffff, ++ GNU_PROPERTY_X86_UINT32_OR_AND_LO = 0xc0010000, ++ GNU_PROPERTY_X86_UINT32_OR_AND_HI = 0xc0017fff, ++ GNU_PROPERTY_X86_COMPAT_2_ISA_1_NEEDED = GNU_PROPERTY_X86_UINT32_OR_LO + 0, ++ GNU_PROPERTY_X86_COMPAT_2_ISA_1_USED = GNU_PROPERTY_X86_UINT32_OR_AND_LO + 0, ++ GNU_PROPERTY_X86_FEATURE_1_AND = GNU_PROPERTY_X86_UINT32_AND_LO + 0, ++ GNU_PROPERTY_X86_ISA_1_NEEDED = GNU_PROPERTY_X86_UINT32_OR_LO + 2, ++ GNU_PROPERTY_X86_FEATURE_2_NEEDED = GNU_PROPERTY_X86_UINT32_OR_LO + 1, ++ GNU_PROPERTY_X86_ISA_1_USED = GNU_PROPERTY_X86_UINT32_OR_AND_LO + 2, ++ GNU_PROPERTY_X86_FEATURE_2_USED = GNU_PROPERTY_X86_UINT32_OR_AND_LO + 1, + GNU_PROPERTY_HIPROC = 0xdfffffff, + GNU_PROPERTY_LOUSER = 0xe0000000, + GNU_PROPERTY_HIUSER = 0xffffffff diff --git a/patches/binutils/2.35/binutils-gold-mismatched-section-flags.patch b/patches/binutils/2.35/binutils-gold-mismatched-section-flags.patch new file mode 100644 index 00000000..63dba2b4 --- /dev/null +++ b/patches/binutils/2.35/binutils-gold-mismatched-section-flags.patch @@ -0,0 +1,19 @@ +diff -rup binutils.orig/gold/layout.cc binutils-2.32/gold/layout.cc +--- binutils.orig/gold/layout.cc 2019-06-24 14:37:36.013086899 +0100 ++++ binutils-2.32/gold/layout.cc 2019-06-24 14:41:40.054517479 +0100 +@@ -868,6 +868,7 @@ Layout::get_output_section(const char* n + && (same_name->flags() & elfcpp::SHF_TLS) == 0) + os = same_name; + } ++#if 0 /* BZ 1722715, PR 17556. */ + else if ((flags & elfcpp::SHF_TLS) == 0) + { + elfcpp::Elf_Xword zero_flags = 0; +@@ -878,6 +879,7 @@ Layout::get_output_section(const char* n + if (p != this->section_name_map_.end()) + os = p->second; + } ++#endif + } + + if (os == NULL) diff --git a/patches/binutils/binutils-gold-warn-unsupported.patch b/patches/binutils/2.35/binutils-gold-warn-unsupported.patch similarity index 100% rename from patches/binutils/binutils-gold-warn-unsupported.patch rename to patches/binutils/2.35/binutils-gold-warn-unsupported.patch diff --git a/patches/binutils/2.35/binutils-ld-DWARF-5-sections.patch b/patches/binutils/2.35/binutils-ld-DWARF-5-sections.patch new file mode 100644 index 00000000..60d42248 --- /dev/null +++ b/patches/binutils/2.35/binutils-ld-DWARF-5-sections.patch @@ -0,0 +1,60 @@ +--- binutils.orig/ld/scripttempl/DWARF.sc 2021-02-01 10:29:33.596729908 +0000 ++++ binutils-2.35.1/ld/scripttempl/DWARF.sc 2021-02-01 10:30:00.454552083 +0000 +@@ -1,4 +1,4 @@ +-# Copyright (C) 2014-2020 Free Software Foundation, Inc. ++# Copyright (C) 2014-2021 Free Software Foundation, Inc. + # + # Copying and distribution of this file, with or without modification, + # are permitted in any medium without royalty provided the copyright +@@ -9,19 +9,19 @@ cat <root.table.entsize; + if (h->root.type == bfd_link_hash_warning) +- entsize += htab->root.table.entsize; ++ { ++ entsize += htab->root.table.entsize; ++ h = (struct elf_link_hash_entry *) h->root.u.i.link; ++ } ++ if (h->root.type == bfd_link_hash_common) ++ entsize += sizeof (*h->root.u.c.p); + } + } + +@@ -4521,14 +4526,20 @@ elf_link_add_object_symbols (bfd *abfd, + + for (p = htab->root.table.table[i]; p != NULL; p = p->next) + { +- memcpy (old_ent, p, htab->root.table.entsize); +- old_ent = (char *) old_ent + htab->root.table.entsize; + h = (struct elf_link_hash_entry *) p; ++ memcpy (old_ent, h, htab->root.table.entsize); ++ old_ent = (char *) old_ent + htab->root.table.entsize; + if (h->root.type == bfd_link_hash_warning) + { +- memcpy (old_ent, h->root.u.i.link, htab->root.table.entsize); ++ h = (struct elf_link_hash_entry *) h->root.u.i.link; ++ memcpy (old_ent, h, htab->root.table.entsize); + old_ent = (char *) old_ent + htab->root.table.entsize; + } ++ if (h->root.type == bfd_link_hash_common) ++ { ++ memcpy (old_ent, h->root.u.c.p, sizeof (*h->root.u.c.p)); ++ old_ent = (char *) old_ent + sizeof (*h->root.u.c.p); ++ } + } + } + } +@@ -4899,7 +4910,8 @@ elf_link_add_object_symbols (bfd *abfd, + } + + if (! (_bfd_generic_link_add_one_symbol +- (info, abfd, name, flags, sec, value, NULL, FALSE, bed->collect, ++ (info, abfd, name, flags, sec, value, ++ NULL, FALSE, bed->collect, + (struct bfd_link_hash_entry **) sym_hash))) + goto error_free_vers; + +@@ -4970,11 +4982,10 @@ elf_link_add_object_symbols (bfd *abfd, + object and a shared object. */ + bfd_boolean dynsym = FALSE; + +- /* Plugin symbols aren't normal. Don't set def_regular or +- ref_regular for them, or make them dynamic. */ ++ /* Plugin symbols aren't normal. Don't set def/ref flags. */ + if ((abfd->flags & BFD_PLUGIN) != 0) + ; +- else if (! dynamic) ++ else if (!dynamic) + { + if (! definition) + { +@@ -4991,14 +5002,6 @@ elf_link_add_object_symbols (bfd *abfd, + h->ref_dynamic = 1; + } + } +- +- /* If the indirect symbol has been forced local, don't +- make the real symbol dynamic. */ +- if ((h == hi || !hi->forced_local) +- && (bfd_link_dll (info) +- || h->def_dynamic +- || h->ref_dynamic)) +- dynsym = TRUE; + } + else + { +@@ -5012,14 +5015,25 @@ elf_link_add_object_symbols (bfd *abfd, + h->def_dynamic = 1; + hi->def_dynamic = 1; + } ++ } + +- /* If the indirect symbol has been forced local, don't +- make the real symbol dynamic. */ +- if ((h == hi || !hi->forced_local) +- && (h->def_regular +- || h->ref_regular +- || (h->is_weakalias +- && weakdef (h)->dynindx != -1))) ++ /* If an indirect symbol has been forced local, don't ++ make the real symbol dynamic. */ ++ if (h != hi && hi->forced_local) ++ ; ++ else if (!dynamic) ++ { ++ if (bfd_link_dll (info) ++ || h->def_dynamic ++ || h->ref_dynamic) ++ dynsym = TRUE; ++ } ++ else ++ { ++ if (h->def_regular ++ || h->ref_regular ++ || (h->is_weakalias ++ && weakdef (h)->dynindx != -1)) + dynsym = TRUE; + } + +@@ -5214,6 +5228,9 @@ elf_link_add_object_symbols (bfd *abfd, + && definition + && ((dynsym + && h->ref_regular_nonweak) ++ || (old_bfd != NULL ++ && (old_bfd->flags & BFD_PLUGIN) != 0 ++ && bind != STB_WEAK) + || (h->ref_dynamic_nonweak + && (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0 + && !on_needed_list (elf_dt_name (abfd), +@@ -5338,49 +5355,31 @@ elf_link_add_object_symbols (bfd *abfd, + { + struct bfd_hash_entry *p; + struct elf_link_hash_entry *h; +- bfd_size_type size; +- unsigned int alignment_power; + unsigned int non_ir_ref_dynamic; + + for (p = htab->root.table.table[i]; p != NULL; p = p->next) + { +- 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; +- +- /* Preserve the maximum alignment and size for common +- symbols even if this dynamic lib isn't on DT_NEEDED +- since it can still be loaded at run time by another +- dynamic lib. */ +- if (h->root.type == bfd_link_hash_common) +- { +- size = h->root.u.c.size; +- alignment_power = h->root.u.c.p->alignment_power; +- } +- else +- { +- size = 0; +- alignment_power = 0; +- } + /* Preserve non_ir_ref_dynamic so that this symbol + will be exported when the dynamic lib becomes needed + in the second pass. */ ++ 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; + non_ir_ref_dynamic = h->root.non_ir_ref_dynamic; +- memcpy (p, old_ent, htab->root.table.entsize); +- old_ent = (char *) old_ent + htab->root.table.entsize; ++ + h = (struct elf_link_hash_entry *) p; ++ memcpy (h, old_ent, htab->root.table.entsize); ++ old_ent = (char *) old_ent + htab->root.table.entsize; + if (h->root.type == bfd_link_hash_warning) + { +- memcpy (h->root.u.i.link, old_ent, htab->root.table.entsize); +- old_ent = (char *) old_ent + htab->root.table.entsize; + h = (struct elf_link_hash_entry *) h->root.u.i.link; ++ memcpy (h, old_ent, htab->root.table.entsize); ++ old_ent = (char *) old_ent + htab->root.table.entsize; + } + if (h->root.type == bfd_link_hash_common) + { +- if (size > h->root.u.c.size) +- h->root.u.c.size = size; +- if (alignment_power > h->root.u.c.p->alignment_power) +- h->root.u.c.p->alignment_power = alignment_power; ++ memcpy (h->root.u.c.p, old_ent, sizeof (*h->root.u.c.p)); ++ old_ent = (char *) old_ent + sizeof (*h->root.u.c.p); + } + h->root.non_ir_ref_dynamic = non_ir_ref_dynamic; + } diff --git a/patches/binutils/2.35/binutils-ppc-annobin-disassembly.patch b/patches/binutils/2.35/binutils-ppc-annobin-disassembly.patch new file mode 100644 index 00000000..dd054a6e --- /dev/null +++ b/patches/binutils/2.35/binutils-ppc-annobin-disassembly.patch @@ -0,0 +1,39 @@ +--- binutils.orig/opcodes/ppc-dis.c 2020-09-11 10:55:56.243724026 +0100 ++++ binutils-2.35/opcodes/ppc-dis.c 2020-09-11 10:57:51.363934217 +0100 +@@ -399,12 +399,36 @@ static unsigned short vle_opcd_indices[V + #define SPE2_OPCD_SEGS (1 + SPE2_XOP_TO_SEG (SPE2_XOP (-1))) + static unsigned short spe2_opcd_indices[SPE2_OPCD_SEGS + 1]; + ++static bfd_boolean ++ppc_symbol_is_valid (asymbol *sym, ++ struct disassemble_info *info ATTRIBUTE_UNUSED) ++{ ++ elf_symbol_type * est; ++ ++ if (sym == NULL) ++ return FALSE; ++ ++ est = elf_symbol_from (NULL, sym); ++ ++ /* Ignore ELF hidden, local, no-type symbols. ++ These are generated by annobin. */ ++ if (est != NULL ++ && ELF_ST_VISIBILITY (est->internal_elf_sym.st_other) == STV_HIDDEN ++ && ELF_ST_BIND (est->internal_elf_sym.st_info) == STB_LOCAL ++ && ELF_ST_TYPE (est->internal_elf_sym.st_info) == STT_NOTYPE) ++ return FALSE; ++ ++ return TRUE; ++} ++ + /* Calculate opcode table indices to speed up disassembly, + and init dialect. */ + + void + disassemble_init_powerpc (struct disassemble_info *info) + { ++ info->symbol_is_valid = ppc_symbol_is_valid; ++ + if (powerpc_opcd_indices[PPC_OPCD_SEGS] == 0) + { + unsigned seg, idx, op; diff --git a/patches/binutils/2.35/binutils-ppc64le-note-merge.patch b/patches/binutils/2.35/binutils-ppc64le-note-merge.patch new file mode 100644 index 00000000..95f64015 --- /dev/null +++ b/patches/binutils/2.35/binutils-ppc64le-note-merge.patch @@ -0,0 +1,42 @@ +--- binutils.orig/binutils/objcopy.c 2021-02-18 11:35:48.062479490 +0000 ++++ binutils-2.30/binutils/objcopy.c 2021-02-18 11:36:52.207071148 +0000 +@@ -2224,6 +2224,11 @@ merge_gnu_build_notes (bfd * ab + goto done; + } + ++ if (start > end) ++ /* This can happen with PPC64LE binaries where empty notes are ++ encoded as start = end + 4. */ ++ start = end; ++ + if (is_open_note (pnote)) + { + if (start) +--- binutils.orig/binutils/objcopy.c 2021-02-22 10:44:20.107263089 +0000 ++++ binutils-2.35.1/binutils/objcopy.c 2021-02-22 16:07:12.134344229 +0000 +@@ -2243,23 +2243,8 @@ merge_gnu_build_notes (bfd * ab + break; + + case 8: +- if (! is_64bit (abfd)) +- { +- start = bfd_get_32 (abfd, pnote->note.descdata); +- end = bfd_get_32 (abfd, pnote->note.descdata + 4); +- } +- else +- { +- start = bfd_get_64 (abfd, pnote->note.descdata); +- /* FIXME: For version 1 and 2 notes we should try to +- calculate the end address by finding a symbol whose +- value is START, and then adding in its size. +- +- For now though, since v1 and v2 was not intended to +- handle gaps, we chose an artificially large end +- address. */ +- end = (bfd_vma) -1; +- } ++ start = bfd_get_32 (abfd, pnote->note.descdata); ++ end = bfd_get_32 (abfd, pnote->note.descdata + 4); + break; + + case 16: diff --git a/patches/binutils/2.35/binutils-readelf-no-warn-gaps.patch b/patches/binutils/2.35/binutils-readelf-no-warn-gaps.patch new file mode 100644 index 00000000..2bcd0c62 --- /dev/null +++ b/patches/binutils/2.35/binutils-readelf-no-warn-gaps.patch @@ -0,0 +1,19 @@ +--- binutils.orig/binutils/readelf.c 2021-02-22 10:44:20.142262864 +0000 ++++ binutils-2.35.1/binutils/readelf.c 2021-02-22 10:45:25.646842120 +0000 +@@ -19285,6 +19285,7 @@ print_gnu_build_attribute_description (E + + if (is_open_attr) + { ++#if 0 /* Suppressed because these gaps are no longer significant. */ + /* FIXME: Need to properly allow for section alignment. + 16 is just the alignment used on x86_64. */ + if (global_end > 0 +@@ -19295,7 +19296,7 @@ print_gnu_build_attribute_description (E + && same_section (filedata, start, global_end)) + warn (_("Gap in build notes detected from %#lx to %#lx\n"), + global_end + 1, start - 1); +- ++#endif + printf (_(" Applies to region from %#lx"), start); + global_offset = start; + diff --git a/patches/binutils/2.35/binutils-readelf-other-sym-info.patch b/patches/binutils/2.35/binutils-readelf-other-sym-info.patch new file mode 100644 index 00000000..72913bac --- /dev/null +++ b/patches/binutils/2.35/binutils-readelf-other-sym-info.patch @@ -0,0 +1,35 @@ +--- binutils.orig/binutils/readelf.c 2020-07-24 15:08:30.317597020 +0100 ++++ binutils-2.35/binutils/readelf.c 2020-07-24 15:09:39.029155552 +0100 +@@ -12069,11 +12069,13 @@ print_dynamic_symbol (Filedata *filedata + unsigned int vis = ELF_ST_VISIBILITY (psym->st_other); + + printf (" %-7s", get_symbol_visibility (vis)); ++#if 0 + /* Check to see if any other bits in the st_other field are set. + Note - displaying this information disrupts the layout of the + table being generated, but for the moment this case is very rare. */ + if (psym->st_other ^ vis) + printf (" [%s] ", get_symbol_other (filedata, psym->st_other ^ vis)); ++#endif + } + printf (" %4s ", get_symbol_index_type (filedata, psym->st_shndx)); + +@@ -12112,7 +12114,17 @@ print_dynamic_symbol (Filedata *filedata + version_string); + } + +- putchar ('\n'); ++#if 1 ++ { ++ unsigned int vis = ELF_ST_VISIBILITY (psym->st_other); ++ ++ /* Check to see if any other bits in the st_other field are set. */ ++ if (psym->st_other ^ vis) ++ printf (" \t[%s]", get_symbol_other (filedata, psym->st_other ^ vis)); ++ } ++#endif ++ ++ putchar ('\n'); + + if (ELF_ST_BIND (psym->st_info) == STB_LOCAL + && section != NULL diff --git a/patches/binutils/2.35/binutils-recursive-debuglink-following.patch b/patches/binutils/2.35/binutils-recursive-debuglink-following.patch new file mode 100644 index 00000000..b230bcf6 --- /dev/null +++ b/patches/binutils/2.35/binutils-recursive-debuglink-following.patch @@ -0,0 +1,109 @@ +--- binutils.orig/binutils/dwarf.c 2020-10-15 12:13:21.960799738 +0100 ++++ binutils-2.35.1/binutils/dwarf.c 2020-10-15 13:02:39.454692627 +0100 +@@ -10427,7 +10427,7 @@ load_separate_debug_info (const char * + { + warn (_("Corrupt debuglink section: %s\n"), + xlink->name ? xlink->name : xlink->uncompressed_name); +- return FALSE; ++ return NULL; + } + + /* Attempt to locate the separate file. +@@ -10587,7 +10587,7 @@ load_separate_debug_info (const char * + { + warn (_("failed to open separate debug file: %s\n"), debug_filename); + free (debug_filename); +- return FALSE; ++ return NULL; + } + + /* FIXME: We do not check to see if there are any other separate debug info +@@ -10632,6 +10632,52 @@ load_dwo_file (const char * main_filenam + return separate_handle; + } + ++/* Load a debuglink section and/or a debugaltlink section, if either are present. ++ Recursively check the loaded files for more of these sections. ++ FIXME: Should also check for DWO_* entries in the newlu loaded files. */ ++ ++static void ++check_for_and_load_links (void * file, const char * filename) ++{ ++ void * handle = NULL; ++ ++ if (load_debug_section (gnu_debugaltlink, file)) ++ { ++ Build_id_data build_id_data; ++ ++ handle = load_separate_debug_info (filename, ++ & debug_displays[gnu_debugaltlink].section, ++ parse_gnu_debugaltlink, ++ check_gnu_debugaltlink, ++ & build_id_data, ++ file); ++ if (handle) ++ { ++ assert (handle == first_separate_info->handle); ++ check_for_and_load_links (first_separate_info->handle, ++ first_separate_info->filename); ++ } ++ } ++ ++ if (load_debug_section (gnu_debuglink, file)) ++ { ++ unsigned long crc32; ++ ++ handle = load_separate_debug_info (filename, ++ & debug_displays[gnu_debuglink].section, ++ parse_gnu_debuglink, ++ check_gnu_debuglink, ++ & crc32, ++ file); ++ if (handle) ++ { ++ assert (handle == first_separate_info->handle); ++ check_for_and_load_links (first_separate_info->handle, ++ first_separate_info->filename); ++ } ++ } ++} ++ + /* Load the separate debug info file(s) attached to FILE, if any exist. + Returns TRUE if any were found, FALSE otherwise. + If TRUE is returned then the linked list starting at first_separate_info +@@ -10707,34 +10753,10 @@ load_separate_debug_files (void * file, + return FALSE; + + /* FIXME: We do not check for the presence of both link sections in the same file. */ +- /* FIXME: We do not check the separate debug info file to see if it too contains debuglinks. */ + /* FIXME: We do not check for the presence of multiple, same-name debuglink sections. */ + /* FIXME: We do not check for the presence of a dwo link as well as a debuglink. */ + +- if (load_debug_section (gnu_debugaltlink, file)) +- { +- Build_id_data * build_id_data; +- +- load_separate_debug_info (filename, +- & debug_displays[gnu_debugaltlink].section, +- parse_gnu_debugaltlink, +- check_gnu_debugaltlink, +- & build_id_data, +- file); +- } +- +- if (load_debug_section (gnu_debuglink, file)) +- { +- unsigned long crc32; +- +- load_separate_debug_info (filename, +- & debug_displays[gnu_debuglink].section, +- parse_gnu_debuglink, +- check_gnu_debuglink, +- & crc32, +- file); +- } +- ++ check_for_and_load_links (file, filename); + if (first_separate_info != NULL) + return TRUE; + diff --git a/patches/binutils/2.35/binutils-s390-arch14-insns.patch b/patches/binutils/2.35/binutils-s390-arch14-insns.patch new file mode 100644 index 00000000..f0b41741 --- /dev/null +++ b/patches/binutils/2.35/binutils-s390-arch14-insns.patch @@ -0,0 +1,109 @@ +diff -rup binutils.orig/gas/config/tc-s390.c binutils-2.35.1/gas/config/tc-s390.c +--- binutils.orig/gas/config/tc-s390.c 2021-02-19 11:44:24.240877612 +0000 ++++ binutils-2.35.1/gas/config/tc-s390.c 2021-02-19 11:46:05.222554434 +0000 +@@ -292,6 +292,8 @@ s390_parse_cpu (const char * arg + { STRING_COMMA_LEN ("z14"), STRING_COMMA_LEN ("arch12"), + S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX }, + { STRING_COMMA_LEN ("z15"), STRING_COMMA_LEN ("arch13"), ++ S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX }, ++ { STRING_COMMA_LEN (""), STRING_COMMA_LEN ("arch14"), + S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX } + }; + static struct +diff -rup binutils.orig/gas/doc/c-s390.texi binutils-2.35.1/gas/doc/c-s390.texi +--- binutils.orig/gas/doc/c-s390.texi 2021-02-19 11:44:24.236877625 +0000 ++++ binutils-2.35.1/gas/doc/c-s390.texi 2021-02-19 11:46:05.223554431 +0000 +@@ -18,7 +18,7 @@ and eleven chip levels. The architecture + Architecture (ESA) and the newer z/Architecture mode. The chip levels + are g5 (or arch3), g6, z900 (or arch5), z990 (or arch6), z9-109, z9-ec + (or arch7), z10 (or arch8), z196 (or arch9), zEC12 (or arch10), z13 +-(or arch11), z14 (or arch12), and z15 (or arch13). ++(or arch11), z14 (or arch12), z15 (or arch13), or arch14. + + @menu + * s390 Options:: Command-line Options. +@@ -70,8 +70,9 @@ are recognized: + @code{z196} (or @code{arch9}), + @code{zEC12} (or @code{arch10}), + @code{z13} (or @code{arch11}), +-@code{z14} (or @code{arch12}), and +-@code{z15} (or @code{arch13}). ++@code{z14} (or @code{arch12}), ++@code{z15} (or @code{arch13}), and ++@code{arch14}. + + Assembling an instruction that is not supported on the target + processor results in an error message. +diff -rup binutils.orig/gas/testsuite/gas/s390/s390.exp binutils-2.35.1/gas/testsuite/gas/s390/s390.exp +--- binutils.orig/gas/testsuite/gas/s390/s390.exp 2021-02-19 11:44:24.338877299 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/s390.exp 2021-02-19 11:46:05.223554431 +0000 +@@ -31,6 +31,7 @@ if [expr [istarget "s390-*-*"] || [ista + run_dump_test "zarch-z13" "{as -m64} {as -march=z13}" + run_dump_test "zarch-arch12" "{as -m64} {as -march=arch12}" + run_dump_test "zarch-arch13" "{as -m64} {as -march=arch13}" ++ run_dump_test "zarch-arch14" "{as -m64} {as -march=arch14}" + run_dump_test "zarch-reloc" "{as -m64}" + run_dump_test "zarch-operands" "{as -m64} {as -march=z9-109}" + run_dump_test "zarch-machine" "{as -m64} {as -march=z900}" +Only in binutils-2.35.1/gas/testsuite/gas/s390: zarch-arch14.d +Only in binutils-2.35.1/gas/testsuite/gas/s390: zarch-arch14.s +diff -rup binutils.orig/include/opcode/s390.h binutils-2.35.1/include/opcode/s390.h +--- binutils.orig/include/opcode/s390.h 2021-02-19 11:44:23.926878617 +0000 ++++ binutils-2.35.1/include/opcode/s390.h 2021-02-19 11:46:05.223554431 +0000 +@@ -44,6 +44,7 @@ enum s390_opcode_cpu_val + S390_OPCODE_Z13, + S390_OPCODE_ARCH12, + S390_OPCODE_ARCH13, ++ S390_OPCODE_ARCH14, + S390_OPCODE_MAXCPU + }; + +diff -rup binutils.orig/opcodes/s390-mkopc.c binutils-2.35.1/opcodes/s390-mkopc.c +--- binutils.orig/opcodes/s390-mkopc.c 2021-02-19 11:44:23.947878550 +0000 ++++ binutils-2.35.1/opcodes/s390-mkopc.c 2021-02-19 11:46:05.223554431 +0000 +@@ -380,6 +380,8 @@ main (void) + else if (strcmp (cpu_string, "z15") == 0 + || strcmp (cpu_string, "arch13") == 0) + min_cpu = S390_OPCODE_ARCH13; ++ else if (strcmp (cpu_string, "arch14") == 0) ++ min_cpu = S390_OPCODE_ARCH14; + else { + fprintf (stderr, "Couldn't parse cpu string %s\n", cpu_string); + exit (1); +Only in binutils-2.35.1/opcodes: s390-mkopc.c.orig +diff -rup binutils.orig/opcodes/s390-opc.txt binutils-2.35.1/opcodes/s390-opc.txt +--- binutils.orig/opcodes/s390-opc.txt 2021-02-19 11:44:23.943878563 +0000 ++++ binutils-2.35.1/opcodes/s390-opc.txt 2021-02-19 11:46:05.224554428 +0000 +@@ -2000,3 +2000,31 @@ e60000000052 vcvbg VRR_RV0UU "vector con + # Message Security Assist Extension 9 + + b93a kdsa RRE_RR "compute digital signature authentication" arch13 zarch ++ ++ ++# arch14 instructions ++ ++e60000000074 vschp VRR_VVV0U0U " " arch14 zarch ++e60000002074 vschsp VRR_VVV0U0 " " arch14 zarch ++e60000003074 vschdp VRR_VVV0U0 " " arch14 zarch ++e60000004074 vschxp VRR_VVV0U0 " " arch14 zarch ++e6000000007c vscshp VRR_VVV " " arch14 zarch ++e6000000007d vcsph VRR_VVV0U0 " " arch14 zarch ++e60000000051 vclzdp VRR_VV0U2 " " arch14 zarch ++e60000000070 vpkzr VRI_VVV0UU2 " " arch14 zarch ++e60000000072 vsrpr VRI_VVV0UU2 " " arch14 zarch ++e60000000054 vupkzh VRR_VV0U2 " " arch14 zarch ++e6000000005c vupkzl VRR_VV0U2 " " arch14 zarch ++ ++b93b nnpa RRE_00 " " arch14 zarch ++e60000000056 vclfnh VRR_VV0UU2 " " arch14 zarch ++e6000000005e vclfnl VRR_VV0UU2 " " arch14 zarch ++e60000000075 vcrnf VRR_VVV0UU " " arch14 zarch ++e6000000005d vcfn VRR_VV0UU2 " " arch14 zarch ++e60000000055 vcnf VRR_VV0UU2 " " arch14 zarch ++ ++b98B rdp RRF_RURR2 " " arch14 zarch optparm ++ ++eb0000000071 lpswey SIY_URD " " arch14 zarch ++b200 lbear S_RD " " arch14 zarch ++b201 stbear S_RD " " arch14 zarch +Only in binutils-2.35.1/opcodes: s390-opc.txt.orig diff --git a/patches/binutils/2.35/binutils-s390-build.patch b/patches/binutils/2.35/binutils-s390-build.patch new file mode 100644 index 00000000..cdb6a5d1 --- /dev/null +++ b/patches/binutils/2.35/binutils-s390-build.patch @@ -0,0 +1,772 @@ +diff -rup binutils.orig/libctf/ctf-create.c binutils-2.34.0/libctf/ctf-create.c +--- binutils.orig/libctf/ctf-create.c 2020-06-16 12:06:28.466468753 +0100 ++++ binutils-2.34.0/libctf/ctf-create.c 2020-06-16 12:16:19.744482839 +0100 +@@ -871,7 +871,8 @@ ctf_add_encoded (ctf_file_t *fp, uint32_ + + if ((type = ctf_add_generic (fp, flag, name, kind, &dtd)) == CTF_ERR) + return CTF_ERR; /* errno is set for us. */ +- ++ if (dtd == NULL) ++ return CTF_ERR; + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (kind, flag, 0); + dtd->dtd_data.ctt_size = clp2 (P2ROUNDUP (ep->cte_bits, CHAR_BIT) + / CHAR_BIT); +@@ -896,6 +897,8 @@ ctf_add_reftype (ctf_file_t *fp, uint32_ + + if ((type = ctf_add_generic (fp, flag, NULL, kind, &dtd)) == CTF_ERR) + return CTF_ERR; /* errno is set for us. */ ++ if (dtd == NULL) ++ return CTF_ERR; + + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (kind, flag, 0); + dtd->dtd_data.ctt_type = (uint32_t) ref; +@@ -958,6 +961,8 @@ ctf_add_slice (ctf_file_t *fp, uint32_t + + if ((type = ctf_add_generic (fp, flag, NULL, CTF_K_SLICE, &dtd)) == CTF_ERR) + return CTF_ERR; /* errno is set for us. */ ++ if (dtd == NULL) ++ return CTF_ERR; + + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_SLICE, flag, 0); + dtd->dtd_data.ctt_size = clp2 (P2ROUNDUP (ep->cte_bits, CHAR_BIT) +@@ -1008,6 +1013,8 @@ ctf_add_array (ctf_file_t *fp, uint32_t + + if ((type = ctf_add_generic (fp, flag, NULL, CTF_K_ARRAY, &dtd)) == CTF_ERR) + return CTF_ERR; /* errno is set for us. */ ++ if (dtd == NULL) ++ return CTF_ERR; + + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_ARRAY, flag, 0); + dtd->dtd_data.ctt_size = 0; +@@ -1075,6 +1082,8 @@ ctf_add_function (ctf_file_t *fp, uint32 + free (vdat); + return CTF_ERR; /* errno is set for us. */ + } ++ if (dtd == NULL) ++ return CTF_ERR; + + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_FUNCTION, flag, vlen); + dtd->dtd_data.ctt_type = (uint32_t) ctc->ctc_return; +@@ -1104,6 +1113,8 @@ ctf_add_struct_sized (ctf_file_t *fp, ui + else if ((type = ctf_add_generic (fp, flag, name, CTF_K_STRUCT, + &dtd)) == CTF_ERR) + return CTF_ERR; /* errno is set for us. */ ++ if (dtd == NULL) ++ return CTF_ERR; + + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_STRUCT, flag, 0); + +@@ -1141,6 +1152,8 @@ ctf_add_union_sized (ctf_file_t *fp, uin + else if ((type = ctf_add_generic (fp, flag, name, CTF_K_UNION, + &dtd)) == CTF_ERR) + return CTF_ERR; /* errno is set for us */ ++ if (dtd == NULL) ++ return CTF_ERR; + + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_UNION, flag, 0); + +@@ -1177,6 +1190,8 @@ ctf_add_enum (ctf_file_t *fp, uint32_t f + else if ((type = ctf_add_generic (fp, flag, name, CTF_K_ENUM, + &dtd)) == CTF_ERR) + return CTF_ERR; /* errno is set for us. */ ++ if (dtd == NULL) ++ return CTF_ERR; + + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_ENUM, flag, 0); + dtd->dtd_data.ctt_size = fp->ctf_dmodel->ctd_int; +diff -rup binutils.orig/libctf/ctf-types.c binutils-2.34.0/libctf/ctf-types.c +--- binutils.orig/libctf/ctf-types.c 2020-06-16 12:06:28.466468753 +0100 ++++ binutils-2.34.0/libctf/ctf-types.c 2020-06-16 12:10:58.033563365 +0100 +@@ -748,7 +748,7 @@ ctf_type_encoding (ctf_file_t *fp, ctf_i + case CTF_K_SLICE: + { + const ctf_slice_t *slice; +- ctf_encoding_t underlying_en; ++ ctf_encoding_t underlying_en = {0}; + slice = &dtd->dtd_u.dtu_slice; + + data = ctf_type_encoding (fp, slice->cts_type, &underlying_en); +diff -rup binutils.orig/opcodes/s390-mkopc.c binutils-2.34.0/opcodes/s390-mkopc.c +--- binutils.orig/opcodes/s390-mkopc.c 2020-06-16 12:06:28.447468816 +0100 ++++ binutils-2.34.0/opcodes/s390-mkopc.c 2020-06-16 12:17:10.783311417 +0100 +@@ -168,7 +168,7 @@ insertExpandedMnemonic (char *opcode, ch + int mask_start, i = 0, tag_found = 0, reading_number = 0; + int number_p = 0, suffix_p = 0, prefix_p = 0; + const struct s390_cond_ext_format *ext_table; +- int ext_table_length; ++ int ext_table_length = 0; + + if (!(tag = strpbrk (mnemonic, "*$"))) + { +Only in binutils.orig/libctf: .#ctf-create.c +diff -rup binutils.orig/libctf/ctf-create.c binutils-2.34.0/libctf/ctf-create.c +--- binutils.orig/libctf/ctf-create.c 2020-06-16 14:49:06.080801319 +0100 ++++ binutils-2.34.0/libctf/ctf-create.c 2020-06-16 14:49:08.046794113 +0100 +@@ -798,6 +798,7 @@ ctf_add_generic (ctf_file_t *fp, uint32_ + { + ctf_dtdef_t *dtd; + ctf_id_t type; ++ *rp = NULL; + + if (flag != CTF_ADD_NONROOT && flag != CTF_ADD_ROOT) + return (ctf_set_errno (fp, EINVAL)); +diff -rup binutils.orig/opcodes/fr30-ibld.c binutils-2.34.0/opcodes/fr30-ibld.c +--- binutils.orig/opcodes/fr30-ibld.c 2020-06-16 14:49:06.074801341 +0100 ++++ binutils-2.34.0/opcodes/fr30-ibld.c 2020-06-16 16:43:31.428324833 +0100 +@@ -810,7 +810,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_DIR10 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 16, total_length, pc, & value); + value = ((value) << (2)); + fields->f_dir10 = value; +@@ -821,7 +821,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_DIR9 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 16, total_length, pc, & value); + value = ((value) << (1)); + fields->f_dir9 = value; +@@ -829,7 +829,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_DISP10 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_disp10 = value; +@@ -840,7 +840,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_DISP9 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_disp9 = value; +@@ -865,7 +865,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_LABEL12 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_rel12 = value; +@@ -873,7 +873,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_LABEL9 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_rel9 = value; +@@ -881,7 +881,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_M4 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 16, total_length, pc, & value); + value = ((value) | (-16)); + fields->f_m4 = value; +@@ -911,7 +911,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_U10 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 16, total_length, pc, & value); + value = ((value) << (2)); + fields->f_u10 = value; +@@ -928,7 +928,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_UDISP6 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 16, total_length, pc, & value); + value = ((value) << (2)); + fields->f_udisp6 = value; + +diff -rup binutils.orig/opcodes/fr30-ibld.c binutils-2.34.0/opcodes/fr30-ibld.c +--- binutils.orig/opcodes/fr30-ibld.c 2020-06-16 17:10:22.540563440 +0100 ++++ binutils-2.34.0/opcodes/fr30-ibld.c 2020-06-16 17:10:48.966468906 +0100 +@@ -903,7 +903,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_S10 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_s10 = value; +Only in binutils-2.34.0/opcodes: fr30-ibld.c~ +--- binutils.orig/opcodes/m32c-ibld.c 2020-06-16 17:10:22.531563472 +0100 ++++ binutils-2.34.0/opcodes/m32c-ibld.c 2020-06-16 17:25:48.612258094 +0100 +@@ -1805,7 +1805,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_BIT32RNPREFIXED : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value); + value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2)))); + fields->f_dst32_rn_prefixed_QI = value; +@@ -1813,7 +1813,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_BIT32RNUNPREFIXED : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value); + value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2)))); + fields->f_dst32_rn_unprefixed_QI = value; +@@ -1824,7 +1824,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_BITBASE16_16_U16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_16_u16 = value; +@@ -1860,7 +1860,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed); + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_16_s16 = value; +@@ -1887,7 +1887,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed); + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_16_u16 = value; +@@ -1903,7 +1903,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed); + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_16_u16 = value; +@@ -1971,7 +1971,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8); + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_32_u16 = value; +@@ -1996,7 +1996,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_16_S16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_16_s16 = value; +@@ -2007,7 +2007,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_16_U16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_16_u16 = value; +@@ -2016,7 +2016,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + case M32C_OPERAND_DSP_16_U20 : + { + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_16_u16 = value; +@@ -2032,7 +2032,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + case M32C_OPERAND_DSP_16_U24 : + { + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_16_u16 = value; +@@ -2078,7 +2078,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8); + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_32_u16 = value; +@@ -2094,7 +2094,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8); + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_32_u16 = value; +@@ -2110,7 +2110,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_32_S16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_32_s16 = value; +@@ -2121,7 +2121,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_32_U16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_32_u16 = value; +@@ -2129,7 +2129,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_32_U20 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 24, 32, total_length, pc, & value); + value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680)))); + fields->f_dsp_32_u24 = value; +@@ -2137,7 +2137,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_32_U24 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 24, 32, total_length, pc, & value); + value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680)))); + fields->f_dsp_32_u24 = value; +@@ -2148,7 +2148,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_40_S16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_40_s16 = value; +@@ -2159,7 +2159,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_40_U16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_40_u16 = value; +@@ -2167,7 +2167,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_40_U20 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 20, 32, total_length, pc, & value); + value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (983040)))); + fields->f_dsp_40_u20 = value; +@@ -2175,7 +2175,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_40_U24 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 24, 32, total_length, pc, & value); + value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680)))); + fields->f_dsp_40_u24 = value; +@@ -2186,7 +2186,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_48_S16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_48_s16 = value; +@@ -2197,7 +2197,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_48_U16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_48_u16 = value; +@@ -2206,7 +2206,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + case M32C_OPERAND_DSP_48_U20 : + { + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_48_u16 = value; +@@ -2222,7 +2222,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + case M32C_OPERAND_DSP_48_U24 : + { + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_48_u16 = value; +@@ -2240,7 +2240,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_8_S24 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (16))) & (255))) | (((value) & (65280))))) | (((((value) & (255))) << (16))))) ^ (8388608))) - (8388608)); + fields->f_dsp_8_s24 = value; +@@ -2251,7 +2251,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_8_U16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_8_u16 = value; +@@ -2259,7 +2259,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_8_U24 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 24, 32, total_length, pc, & value); + value = ((((((USI) (value) >> (16))) | (((value) & (65280))))) | (((((value) & (255))) << (16)))); + fields->f_dsp_8_u24 = value; +@@ -2343,7 +2343,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DST32RNPREFIXEDHI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value); + value = ((((value) + (2))) % (4)); + fields->f_dst32_rn_prefixed_HI = value; +@@ -2351,7 +2351,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DST32RNPREFIXEDQI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value); + value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2)))); + fields->f_dst32_rn_prefixed_QI = value; +@@ -2359,7 +2359,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DST32RNPREFIXEDSI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value); + value = ((value) - (2)); + fields->f_dst32_rn_prefixed_SI = value; +@@ -2367,7 +2367,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DST32RNUNPREFIXEDHI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value); + value = ((((value) + (2))) % (4)); + fields->f_dst32_rn_unprefixed_HI = value; +@@ -2375,7 +2375,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DST32RNUNPREFIXEDQI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value); + value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2)))); + fields->f_dst32_rn_unprefixed_QI = value; +@@ -2383,7 +2383,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DST32RNUNPREFIXEDSI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value); + value = ((value) - (2)); + fields->f_dst32_rn_unprefixed_SI = value; +@@ -2402,7 +2402,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_IMM_16_HI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_16_s16 = value; +@@ -2414,14 +2414,14 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + case M32C_OPERAND_IMM_16_SI : + { + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_16_u16 = value; + } + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_32_u16 = value; +@@ -2454,7 +2454,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8); + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 24, 32, total_length, pc, & value); + value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680)))); + fields->f_dsp_32_u24 = value; +@@ -2467,7 +2467,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_IMM_32_HI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_32_s16 = value; +@@ -2486,7 +2486,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_IMM_40_HI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_40_s16 = value; +@@ -2498,7 +2498,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + case M32C_OPERAND_IMM_40_SI : + { + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 24, 32, total_length, pc, & value); + value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680)))); + fields->f_dsp_40_u24 = value; +@@ -2513,7 +2513,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_IMM_48_HI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_48_s16 = value; +@@ -2525,14 +2525,14 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + case M32C_OPERAND_IMM_48_SI : + { + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_48_u16 = value; + } + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 64, 0, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_64_u16 = value; +@@ -2567,7 +2567,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_IMM_8_HI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_8_s16 = value; +@@ -2593,7 +2593,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_IMM1_S : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 2, 1, 32, total_length, pc, & value); + value = ((value) + (1)); + fields->f_imm1_S = value; +@@ -2612,7 +2612,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_LAB_16_8 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_lab_16_8 = value; +@@ -2620,7 +2620,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_LAB_24_8 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_lab_24_8 = value; +@@ -2628,7 +2628,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_LAB_32_8 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_lab_32_8 = value; +@@ -2636,7 +2636,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_LAB_40_8 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_lab_40_8 = value; +@@ -2644,7 +2644,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_LAB_5_3 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_lab_5_3 = value; +@@ -2652,7 +2652,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_LAB_8_16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) | (((((value) & (255))) << (8))))) ^ (32768))) - (32768))) + (((pc) + (1)))); + fields->f_lab_8_16 = value; +@@ -2660,7 +2660,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_LAB_8_24 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (16))) | (((value) & (65280))))) | (((((value) & (255))) << (16)))); + fields->f_lab_8_24 = value; +@@ -2668,7 +2668,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_LAB_8_8 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_lab_8_8 = value; +@@ -2757,7 +2757,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_SRC32RNPREFIXEDHI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 2, 32, total_length, pc, & value); + value = ((((value) + (2))) % (4)); + fields->f_src32_rn_prefixed_HI = value; +@@ -2765,7 +2765,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_SRC32RNPREFIXEDQI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 2, 32, total_length, pc, & value); + value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2)))); + fields->f_src32_rn_prefixed_QI = value; +@@ -2773,7 +2773,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_SRC32RNPREFIXEDSI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 2, 32, total_length, pc, & value); + value = ((value) - (2)); + fields->f_src32_rn_prefixed_SI = value; +@@ -2781,7 +2781,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_SRC32RNUNPREFIXEDHI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & value); + value = ((((value) + (2))) % (4)); + fields->f_src32_rn_unprefixed_HI = value; +@@ -2789,7 +2789,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_SRC32RNUNPREFIXEDQI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & value); + value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2)))); + fields->f_src32_rn_unprefixed_QI = value; +@@ -2797,7 +2797,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_SRC32RNUNPREFIXEDSI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & value); + value = ((value) - (2)); + fields->f_src32_rn_unprefixed_SI = value; +--- binutils.orig/binutils/srconv.c 2020-06-16 17:10:22.251564474 +0100 ++++ binutils-2.34.0/binutils/srconv.c 2020-06-16 20:07:51.670025912 +0100 +@@ -492,6 +492,8 @@ wr_rl (struct coff_ofile *ptr ATTRIBUTE_ + rl.addr = r->offset; + rl.bitloc = 0; + rl.flen = 32; /* SH Specific. */ ++ rl.dunno = 0; ++ rl.symn = 0; + + /* What sort of reloc ? Look in the section to find out. */ + ref = r->symbol; +--- binutils.orig/libctf/ctf-create.c 2020-07-24 15:33:26.100996335 +0100 ++++ binutils-2.35/libctf/ctf-create.c 2020-07-24 15:33:29.042977475 +0100 +@@ -1257,6 +1257,8 @@ ctf_add_forward (ctf_file_t *fp, uint32_ + + if ((type = ctf_add_generic (fp, flag, name, kind, &dtd)) == CTF_ERR) + return CTF_ERR; /* errno is set for us. */ ++ if (dtd == NULL) ++ return CTF_ERR; + + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_FORWARD, flag, 0); + dtd->dtd_data.ctt_type = kind; diff --git a/patches/binutils/2.35/binutils-special-sections-in-groups.patch b/patches/binutils/2.35/binutils-special-sections-in-groups.patch new file mode 100644 index 00000000..7de5a93f --- /dev/null +++ b/patches/binutils/2.35/binutils-special-sections-in-groups.patch @@ -0,0 +1,27 @@ +--- binutils.orig/bfd/elf.c 2018-10-19 11:42:10.107277490 +0100 ++++ binutils-2.31.1/bfd/elf.c 2018-10-19 11:44:33.607105801 +0100 +@@ -830,7 +830,13 @@ setup_group (bfd *abfd, Elf_Internal_Shd + } + } + +- if (elf_group_name (newsect) == NULL) ++ if (elf_group_name (newsect) == NULL ++ /* OS specific sections might be in a group (eg ARM's ARM_EXIDX section) ++ but they will not have been added to the group because they do not ++ have contents that the ELF code in the BFD library knows how to ++ process. This is OK though - we rely upon the target backends to ++ handle these sections for us. */ ++ && hdr->sh_type < SHT_LOOS) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: no group info for section '%pA'"), +@@ -936,7 +942,8 @@ _bfd_elf_setup_sections (bfd *abfd) + else if (idx->shdr->bfd_section) + elf_sec_group (idx->shdr->bfd_section) = shdr->bfd_section; + else if (idx->shdr->sh_type != SHT_RELA +- && idx->shdr->sh_type != SHT_REL) ++ && idx->shdr->sh_type != SHT_REL ++ && idx->shdr->sh_type < SHT_LOOS) + { + /* There are some unknown sections in the group. */ + _bfd_error_handler diff --git a/patches/binutils/2.35/binutils-strip-merge.patch b/patches/binutils/2.35/binutils-strip-merge.patch new file mode 100644 index 00000000..24536857 --- /dev/null +++ b/patches/binutils/2.35/binutils-strip-merge.patch @@ -0,0 +1,19 @@ +--- binutils.orig/binutils/objcopy.c 2020-10-06 14:53:19.264943750 +0100 ++++ binutils-2.35.1/binutils/objcopy.c 2020-10-06 14:53:47.002761889 +0100 +@@ -3313,14 +3313,12 @@ copy_object (bfd *ibfd, bfd *obfd, const + /* It is likely that output sections are in the same order + as the input sections, but do not assume that this is + the case. */ +- if (strcmp (bfd_section_name (merged->sec), +- bfd_section_name (osec)) != 0) ++ if (merged->sec->output_section != osec) + { + for (merged = merged_note_sections; + merged != NULL; + merged = merged->next) +- if (strcmp (bfd_section_name (merged->sec), +- bfd_section_name (osec)) == 0) ++ if (merged->sec->output_section == osec) + break; + + if (merged == NULL) diff --git a/patches/binutils/2.35/binutils-testsuite-failures.patch b/patches/binutils/2.35/binutils-testsuite-failures.patch new file mode 100644 index 00000000..6d5ab069 --- /dev/null +++ b/patches/binutils/2.35/binutils-testsuite-failures.patch @@ -0,0 +1,1207 @@ +diff -rup binutils.orig/ld/testsuite/ld-plugin/lto.exp binutils-2.35.1/ld/testsuite/ld-plugin/lto.exp +--- binutils.orig/ld/testsuite/ld-plugin/lto.exp 2021-01-25 13:10:09.919340409 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/lto.exp 2021-01-25 13:45:30.991238686 +0000 +@@ -319,21 +319,6 @@ set lto_link_elf_tests [list \ + [list "PR ld/13244" \ + "-shared -O2 -fPIC -flto -fuse-linker-plugin -nostdlib" "-O2 -fno-early-inlining -flto" \ + {pr13244.c} {{"readelf" {-s --wide} "pr13244.d"}} "pr13244.so" "c"] \ +- [list "Build libpr15146a.a" \ +- "$plug_opt" "-flto -O2" \ +- {pr15146a.c} {} "lib15146a.a"] \ +- [list "Build pr15146b.so" \ +- "-shared" "-O2 -fpic" \ +- {pr15146b.c} {} "pr15146b.so" "c"] \ +- [list "Build pr15146c.so" \ +- "-shared -Wl,--no-as-needed tmpdir/pr15146b.so" "-O2 -fpic" \ +- {pr15146c.c} {} "pr15146c.so" "c"] \ +- [list "PR ld/15146 (1)" \ +- "-O2 -flto -fuse-linker-plugin -Wl,-rpath-link,. -Wl,--no-copy-dt-needed-entries -Wl,--no-as-needed tmpdir/pr15146a.o tmpdir/pr15146c.so" "" \ +- {dummy.c} {{"readelf" {-d} "pr15146.d"}} "pr15146a.exe"] \ +- [list "Build libpr15146d.a" \ +- "$plug_opt" "-flto -O2" \ +- {pr15146d.c} {} "lib15146d.a"] \ + [list "Build libpr16746a.a" \ + "" "" \ + {pr16746a.c pr16746b.c} {} "lib15146a.a"] \ +@@ -602,13 +587,6 @@ run_cc_link_tests $lto_compile_elf_tests + # Restrict these to ELF targets that support shared libs and PIC. + if { [is_elf_format] && [check_lto_shared_available] } { + run_cc_link_tests $lto_link_elf_tests +- set testname "PR ld/15146 (2)" +- set exec_output [run_host_cmd "$CC" "-O2 -flto -fuse-linker-plugin -Wl,-rpath-link,. -Wl,--no-copy-dt-needed-entries -Wl,--no-as-needed tmpdir/pr15146d.o tmpdir/pr15146c.so"] +- if { [ regexp "undefined reference to symbol '\\.?xxx'" $exec_output ] } { +- pass $testname +- } { +- fail $testname +- } + set testname "PR ld/16746 (3)" + set exec_output [run_host_cmd "$CC" "-O2 -flto -fuse-linker-plugin tmpdir/pr16746b.o tmpdir/pr16746d.o"] + if { [ regexp "warning: \\.?foobar" $exec_output ] && ![ regexp "symbol from plugin" $exec_output ] } { +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-10.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-10.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-10.d 2021-01-25 13:10:09.918340415 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-10.d 2021-01-25 14:23:58.847765488 +0000 +@@ -32,7 +32,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/libtext.a \[@.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-11.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-11.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-11.d 2021-01-25 13:10:09.922340387 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-11.d 2021-01-25 14:23:53.518803590 +0000 +@@ -35,9 +35,9 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?text' Resolution: LDPR_PREVAILING_DE.* + #... + hook called: cleanup. + #... +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-16.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-16.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-16.d 2021-01-25 13:10:09.921340394 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-16.d 2021-01-25 14:24:11.182677282 +0000 +@@ -30,7 +30,7 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-17.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-17.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-17.d 2021-01-25 13:10:09.919340409 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-17.d 2021-01-25 14:24:05.502717894 +0000 +@@ -31,7 +31,7 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-18.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-18.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-18.d 2021-01-25 13:10:09.920340401 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-18.d 2021-01-25 14:23:47.294848091 +0000 +@@ -32,7 +32,7 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/libtext.a \[@.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-19.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-19.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-19.d 2021-01-25 13:10:09.918340415 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-19.d 2021-01-25 14:23:38.270912619 +0000 +@@ -35,9 +35,9 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?text' Resolution: LDPR_PREVAILING_DE.* + #... + hook called: cleanup. + #... +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-8.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-8.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-8.d 2021-01-25 13:10:09.920340401 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-8.d 2021-01-25 14:24:20.558610232 +0000 +@@ -30,7 +30,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-9.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-9.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-9.d 2021-01-25 13:10:09.922340387 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-9.d 2021-01-25 14:24:15.919643406 +0000 +@@ -31,7 +31,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-elf/shared.exp binutils-2.35.1/ld/testsuite/ld-elf/shared.exp +--- binutils.orig/ld/testsuite/ld-elf/shared.exp 2021-01-25 13:10:09.984339946 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/shared.exp 2021-01-25 15:16:59.161012214 +0000 +@@ -681,13 +681,13 @@ set build_tests { + "-r -nostdlib" "" + {pr11138-2.c} {} "libpr11138-2.o"} + {"Build pr13250-1.so" +- "-shared" "-fPIC -fcommon" ++ "-shared" "-fPIC" + {pr13250-1.c} {} "libpr13250-1.so"} + {"Build pr13250-2.so with libpr13250-1.so" +- "-shared -Wl,--no-as-needed tmpdir/libpr13250-1.so" "-fPIC -fcommon" ++ "-shared -Wl,--no-as-needed tmpdir/libpr13250-1.so" "-fPIC" + {pr13250-2.c} {} "libpr13250-2.so"} + {"Build libpr13250-3.o" +- "-r -nostdlib" "-fcommon" ++ "-r -nostdlib" "-fPIC" + {pr13250-3.c} {} "libpr13250-3.o"} + {"Build libpr14323-2.so" + "-shared" "-fPIC -fcommon" +@@ -968,9 +968,6 @@ set run_tests [list \ + [list "Run with libpr11138-1.so pr11138-2.c" \ + "-Wl,--no-as-needed,--version-script=pr11138-2.map tmpdir/libpr11138-1.so tmpdir/pr11138-2.o" "" \ + {dummy.c} "pr11138b" "pr11138.out" ] \ +- [list "Run with pr13250-3.c, libpr13250-1.so and libpr13250-2.so" \ +- "-Wl,--as-needed tmpdir/pr13250-3.o tmpdir/libpr13250-1.so tmpdir/libpr13250-2.so" "-fcommon" \ +- {dummy.c} "pr13250" "pass.out" ] \ + [list "Run with pr14323-1.c pr14323-2.so" \ + "-Wl,--no-as-needed tmpdir/libpr14323-2.so" "" \ + {pr14323-1.c} "pr14323" "pass.out" ] \ +--- binutils.orig/ld/testsuite/ld-elf/compress.exp 2021-01-25 13:10:09.986339932 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/compress.exp 2021-01-25 15:22:33.286619802 +0000 +@@ -87,7 +87,7 @@ set build_tests { + set run_tests { + {"Run normal with libfoo.so with compressed debug sections" + "tmpdir/begin.o tmpdir/libfoo.so tmpdir/end.o" "" +- {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections"} ++ {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections -fno-lto"} + {"Run normal with libfoozlib.so with compressed debug sections with zlib-gabi" + "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o" "" + {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi"} +diff -rup binutils.orig/ld/testsuite/ld-elf/compress.exp binutils-2.35.1/ld/testsuite/ld-elf/compress.exp +--- binutils.orig/ld/testsuite/ld-elf/compress.exp 2021-01-25 16:01:54.985710205 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/compress.exp 2021-01-25 16:14:50.481150777 +0000 +@@ -90,25 +90,25 @@ set run_tests { + {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections -fno-lto"} + {"Run normal with libfoozlib.so with compressed debug sections with zlib-gabi" + "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o" "" +- {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi"} ++ {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi -fno-lto"} + {"Run zlibnormal with libzlibfoo.so with zlib compressed debug sections" + "tmpdir/begin.o tmpdir/libzlibfoo.so tmpdir/end.o -Wl,--compress-debug-sections=zlib" "" +- {main.c} "zlibnormal" "normal.out" "-Wa,--compress-debug-sections=zlib"} ++ {main.c} "zlibnormal" "normal.out" "-Wa,--compress-debug-sections=zlib -fno-lto"} + {"Run zlibnormal with libfoozlib.so with zlib compressed debug sections" + "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o -Wl,--compress-debug-sections=zlib" "" +- {main.c} "zlibnormal" "normal.out" "-Wa,--compress-debug-sections=zlib"} ++ {main.c} "zlibnormal" "normal.out" "-Wa,--compress-debug-sections=zlib -fno-lto"} + {"Run gnunormal with libgnufoo.so with zlib-gnu compressed debug sections" + "tmpdir/gnubegin.o tmpdir/libgnufoo.so tmpdir/end.o -Wl,--compress-debug-sections=zlib-gnu" "" +- {main.c} "gnunormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gnu"} ++ {main.c} "gnunormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gnu -fno-lto"} + {"Run gnunormal with libfoozlib.so with zlib-gnu compressed debug sections" + "tmpdir/gnubegin.o tmpdir/libfoozlib.so tmpdir/end.o -Wl,--compress-debug-sections=zlib-gnu" "" +- {main.c} "gnunormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gnu"} ++ {main.c} "gnunormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gnu -fno-lto"} + {"Run gabinormal with libgabifoo.so with zlib-gabi compressed debug sections" + "tmpdir/zlibbegin.o tmpdir/libgabifoo.so tmpdir/gabiend.o -Wl,--compress-debug-sections=zlib-gabi" "" +- {main.c} "gabinormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi"} ++ {main.c} "gabinormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi -fno-lto"} + {"Run gabinormal with libfoozlib.so with zlib-gabi compressed debug sections" + "tmpdir/zlibbegin.o tmpdir/libfoozlib.so tmpdir/gabiend.o -Wl,--compress-debug-sections=zlib-gabi" "" +- {main.c} "gabinormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi"} ++ {main.c} "gabinormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi -fno-lto"} + } + + run_cc_link_tests $build_tests +diff -rup binutils.orig/ld/testsuite/ld-elf/dwarf.exp binutils-2.35.1/ld/testsuite/ld-elf/dwarf.exp +--- binutils.orig/ld/testsuite/ld-elf/dwarf.exp 2021-01-25 16:01:54.982710227 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/dwarf.exp 2021-01-25 16:19:59.198936623 +0000 +@@ -53,7 +53,7 @@ set build_tests { + "" "-fno-toplevel-reorder" + {dwarf2a.c dwarf2b.c} {{error_output "dwarf2.err"}} "dwarf2.x"} + {"Handle no DWARF information" +- "" "-g0" ++ "" "-g0 -fno-lto" + {dwarf3.c} {{error_output "dwarf3.err"}} "dwarf3.x"} + } + +diff -rup binutils.orig/ld/testsuite/ld-elf/dwarf2b.c binutils-2.35.1/ld/testsuite/ld-elf/dwarf2b.c +--- binutils.orig/ld/testsuite/ld-elf/dwarf2b.c 2021-01-25 16:01:54.980710241 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/dwarf2b.c 2021-01-25 16:18:11.598708346 +0000 +@@ -1,5 +1,5 @@ +-int global_var = 4; +-int other_var = 2; ++extern int global_var; ++extern int other_var; + + extern int function (void); + +diff -rup binutils.orig/ld/testsuite/ld-elf/indirect.exp binutils-2.35.1/ld/testsuite/ld-elf/indirect.exp +--- binutils.orig/ld/testsuite/ld-elf/indirect.exp 2021-01-25 16:01:54.983710220 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/indirect.exp 2021-01-25 16:28:09.254420519 +0000 +@@ -140,52 +140,52 @@ set run_tests { + "-Wl,--no-as-needed tmpdir/libindirect3c.so tmpdir/indirect3b.o tmpdir/indirect3a.o" "" + {dummy.c} "indirect3d" "indirect3.out"} + {"Run with libindirect4c.so 1" +- "-Wl,--no-as-needed tmpdir/indirect4a.o tmpdir/indirect4b.o tmpdir/libindirect4c.so" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/indirect4a.o tmpdir/indirect4b.o tmpdir/libindirect4c.so" "" + {dummy.c} "indirect4a" "indirect4.out"} + {"Run with libindirect4c.so 2" +- "-Wl,--no-as-needed tmpdir/indirect4a.o tmpdir/libindirect4c.so tmpdir/indirect4b.o" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/indirect4a.o tmpdir/libindirect4c.so tmpdir/indirect4b.o" "" + {dummy.c} "indirect4b" "indirect4.out"} + {"Run with libindirect4c.so 3" +- "-Wl,--no-as-needed tmpdir/indirect4b.o tmpdir/libindirect4c.so tmpdir/indirect4a.o" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/indirect4b.o tmpdir/libindirect4c.so tmpdir/indirect4a.o" "" + {dummy.c} "indirect4c" "indirect4.out"} + {"Run with libindirect4c.so 4" +- "-Wl,--no-as-needed tmpdir/libindirect4c.so tmpdir/indirect4b.o tmpdir/indirect4a.o" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/libindirect4c.so tmpdir/indirect4b.o tmpdir/indirect4a.o" "" + {dummy.c} "indirect4d" "indirect4.out"} + {"Run indirect5 1" +- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libindirect5.so" "" ++ "$NOPIE_LDFLAGS -fno-lto -Wl,--no-as-needed tmpdir/libindirect5.so" "" + {indirect5a.c} "indirect5a" "indirect5.out" "$NOPIE_CFLAGS"} + {"Run indirect5 2" +- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" "" ++ "$NOPIE_LDFLAGS -fno-lto -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" "" + {dummy.c} "indirect5b" "indirect5.out" "$NOPIE_CFLAGS"} + {"Run indirect6 1" +- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libindirect5.so" "" ++ "$NOPIE_LDFLAGS -fno-lto -Wl,--no-as-needed tmpdir/libindirect5.so" "" + {indirect6a.c} "indirect6a" "indirect5.out" "$NOPIE_CFLAGS"} + {"Run indirect6 2" +- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/indirect6a.o tmpdir/libindirect5.so" "" ++ "$NOPIE_LDFLAGS -fno-lto -Wl,--no-as-needed tmpdir/indirect6a.o tmpdir/libindirect5.so" "" + {dummy.c} "indirect6b" "indirect5.out" "$NOPIE_CFLAGS"} + {"Run with libpr18720c.so 1" +- "-Wl,--no-as-needed tmpdir/pr18720a.o tmpdir/pr18720b.o tmpdir/libpr18720c.so" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/pr18720a.o tmpdir/pr18720b.o tmpdir/libpr18720c.so" "" + {check-ptr-eq.c} "pr18720a" "pr18720.out"} + {"Run with libpr18720c.so 2" +- "-Wl,--no-as-needed tmpdir/pr18720a.o tmpdir/libpr18720c.so tmpdir/pr18720b.o" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/pr18720a.o tmpdir/libpr18720c.so tmpdir/pr18720b.o" "" + {check-ptr-eq.c} "pr18720b" "pr18720.out"} + {"Run with libpr18720c.so 3" +- "-Wl,--no-as-needed tmpdir/pr18720b.o tmpdir/libpr18720c.so tmpdir/pr18720a.o" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/pr18720b.o tmpdir/libpr18720c.so tmpdir/pr18720a.o" "" + {check-ptr-eq.c} "pr18720c" "pr18720.out"} + {"Run with libpr18720c.so 4" +- "-Wl,--no-as-needed tmpdir/libpr18720c.so tmpdir/pr18720b.o tmpdir/pr18720a.o" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/libpr18720c.so tmpdir/pr18720b.o tmpdir/pr18720a.o" "" + {check-ptr-eq.c} "pr18720d" "pr18720.out"} + {"Run with libpr18720c.so 5" +- "-Wl,--no-as-needed tmpdir/libpr18720c.so tmpdir/pr18720b1.o tmpdir/pr18720a.o" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/libpr18720c.so tmpdir/pr18720b1.o tmpdir/pr18720a.o" "" + {check-ptr-eq.c} "pr18720d" "pr18720.out"} + {"Run with libpr19553b.so" +- "-Wl,--no-as-needed tmpdir/libpr19553b.so tmpdir/libpr19553d.so -Wl,-rpath-link,." "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/libpr19553b.so tmpdir/libpr19553d.so -Wl,-rpath-link,." "" + {pr19553a.c} "pr19553b" "pr19553b.out"} + {"Run with libpr19553c.so" +- "-Wl,--no-as-needed tmpdir/libpr19553c.so tmpdir/libpr19553b.so tmpdir/libpr19553d.so" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/libpr19553c.so tmpdir/libpr19553b.so tmpdir/libpr19553d.so" "" + {pr19553a.c} "pr19553c" "pr19553c.out"} + {"Run with libpr19553d.so" +- "-Wl,--no-as-needed tmpdir/libpr19553d.so tmpdir/libpr19553b.so -Wl,-rpath-link,." "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/libpr19553d.so tmpdir/libpr19553b.so -Wl,-rpath-link,." "" + {pr19553a.c} "pr19553d" "pr19553d.out"} + } + +diff -rup binutils.orig/ld/testsuite/ld-elf/zlibbegin.rS binutils-2.35.1/ld/testsuite/ld-elf/zlibbegin.rS +--- binutils.orig/ld/testsuite/ld-elf/zlibbegin.rS 2021-01-25 16:01:54.983710220 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/zlibbegin.rS 2021-01-25 16:08:44.466775873 +0000 +@@ -1,3 +1,3 @@ + #... +- +\[[ 0-9]+\] .debug_.* +(PROGBITS|MIPS_DWARF) +0+ +[0-9a-f]+ +[0-9a-f]+ [0-9a-f]+ +G?C +0 +0 +1 ++ +\[[ 0-9]+\] .debug_.* +(PROGBITS|MIPS_DWARF) +0+ +[0-9a-f]+ +[0-9a-f]+ [0-9a-f]+ +G?? +0 +0 +1 + #pass +diff -rup binutils.orig/ld/testsuite/config/default.exp binutils-2.35.1/ld/testsuite/config/default.exp +--- binutils.orig/ld/testsuite/config/default.exp 2021-01-25 17:04:32.771699986 +0000 ++++ binutils-2.35.1/ld/testsuite/config/default.exp 2021-01-25 17:21:31.269352523 +0000 +@@ -83,13 +83,13 @@ if {![info exists CC]} { + set CC [find_gcc] + } + if {![info exists CFLAGS]} { +- set CFLAGS "-g -O2" ++ set CFLAGS "-g -O2 -fno-lto" + } + if {![info exists CXX]} { + set CXX [find_g++] + } + if {![info exists CXXFLAGS]} { +- set CXXFLAGS "" ++ set CXXFLAGS "-fno-lto" + } + + # This allows us to run the linker testsuite with clang as the compilation +diff -rup binutils.orig/ld/testsuite/ld-elf/compress.exp binutils-2.35.1/ld/testsuite/ld-elf/compress.exp +--- binutils.orig/ld/testsuite/ld-elf/compress.exp 2021-01-25 17:04:32.839699496 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/compress.exp 2021-01-25 17:06:40.106781907 +0000 +@@ -92,22 +92,22 @@ set run_tests { + "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o" "" + {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi -fno-lto"} + {"Run zlibnormal with libzlibfoo.so with zlib compressed debug sections" +- "tmpdir/begin.o tmpdir/libzlibfoo.so tmpdir/end.o -Wl,--compress-debug-sections=zlib" "" ++ "tmpdir/begin.o tmpdir/libzlibfoo.so tmpdir/end.o -fno-lto -Wl,--compress-debug-sections=zlib" "" + {main.c} "zlibnormal" "normal.out" "-Wa,--compress-debug-sections=zlib -fno-lto"} + {"Run zlibnormal with libfoozlib.so with zlib compressed debug sections" +- "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o -Wl,--compress-debug-sections=zlib" "" ++ "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o -fno-lto -Wl,--compress-debug-sections=zlib" "" + {main.c} "zlibnormal" "normal.out" "-Wa,--compress-debug-sections=zlib -fno-lto"} + {"Run gnunormal with libgnufoo.so with zlib-gnu compressed debug sections" +- "tmpdir/gnubegin.o tmpdir/libgnufoo.so tmpdir/end.o -Wl,--compress-debug-sections=zlib-gnu" "" ++ "tmpdir/gnubegin.o tmpdir/libgnufoo.so tmpdir/end.o -fno-lto -Wl,--compress-debug-sections=zlib-gnu" "" + {main.c} "gnunormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gnu -fno-lto"} + {"Run gnunormal with libfoozlib.so with zlib-gnu compressed debug sections" +- "tmpdir/gnubegin.o tmpdir/libfoozlib.so tmpdir/end.o -Wl,--compress-debug-sections=zlib-gnu" "" ++ "tmpdir/gnubegin.o tmpdir/libfoozlib.so tmpdir/end.o -fno-lto -Wl,--compress-debug-sections=zlib-gnu" "" + {main.c} "gnunormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gnu -fno-lto"} + {"Run gabinormal with libgabifoo.so with zlib-gabi compressed debug sections" +- "tmpdir/zlibbegin.o tmpdir/libgabifoo.so tmpdir/gabiend.o -Wl,--compress-debug-sections=zlib-gabi" "" ++ "tmpdir/zlibbegin.o tmpdir/libgabifoo.so tmpdir/gabiend.o -fno-lto -Wl,--compress-debug-sections=zlib-gabi" "" + {main.c} "gabinormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi -fno-lto"} + {"Run gabinormal with libfoozlib.so with zlib-gabi compressed debug sections" +- "tmpdir/zlibbegin.o tmpdir/libfoozlib.so tmpdir/gabiend.o -Wl,--compress-debug-sections=zlib-gabi" "" ++ "tmpdir/zlibbegin.o tmpdir/libfoozlib.so tmpdir/gabiend.o -fno-lto -Wl,--compress-debug-sections=zlib-gabi" "" + {main.c} "gabinormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi -fno-lto"} + } + +diff -rup binutils.orig/ld/testsuite/ld-elf/dwarf2b.c binutils-2.35.1/ld/testsuite/ld-elf/dwarf2b.c +--- binutils.orig/ld/testsuite/ld-elf/dwarf2b.c 2021-01-25 17:04:32.834699532 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/dwarf2b.c 2021-01-25 17:08:19.131067948 +0000 +@@ -1,5 +1,5 @@ +-extern int global_var; +-extern int other_var; ++int global_var = 4; ++int other_var = 2; + + extern int function (void); + +diff -rup binutils.orig/ld/testsuite/ld-elf/elf.exp binutils-2.35.1/ld/testsuite/ld-elf/elf.exp +--- binutils.orig/ld/testsuite/ld-elf/elf.exp 2021-01-25 17:04:32.840699489 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/elf.exp 2021-01-25 17:10:23.738169538 +0000 +@@ -245,7 +245,7 @@ if [check_gc_sections_available] { + + set array_tests { + {"preinit array" "" "" +- {preinit.c} "preinit" "preinit.out"} ++ {preinit.c} "preinit" "preinit.out" "-fno-lto"} + {"init array" "" "" + {init.c} "init" "init.out"} + {"fini array" "" "" +diff -rup binutils.orig/ld/testsuite/ld-elf/indirect.exp binutils-2.35.1/ld/testsuite/ld-elf/indirect.exp +--- binutils.orig/ld/testsuite/ld-elf/indirect.exp 2021-01-25 17:04:32.832699546 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/indirect.exp 2021-01-25 17:13:05.304004657 +0000 +@@ -65,8 +65,8 @@ if { ![ld_compile $CC $srcdir/$subdir/in + || ![ld_compile $CC $srcdir/$subdir/indirect3b.c tmpdir/indirect3b.o] + || ![ld_compile $CC $srcdir/$subdir/indirect4a.c tmpdir/indirect4a.o] + || ![ld_compile $CC $srcdir/$subdir/indirect4b.c tmpdir/indirect4b.o] +- || ![ld_compile "$CC -O2 -fPIC -I../bfd" $srcdir/$subdir/pr18720a.c tmpdir/pr18720a.o] +- || ![ld_compile $CC $srcdir/$subdir/pr18720b.c tmpdir/pr18720b.o] ++ || ![ld_compile "$CC -O2 -fPIC -I../bfd -fno-lto" $srcdir/$subdir/pr18720a.c tmpdir/pr18720a.o] ++ || ![ld_compile "$CC -fno-lto" $srcdir/$subdir/pr18720b.c tmpdir/pr18720b.o] + || ![ld_compile "$CC -fPIC" $srcdir/$subdir/pr19553d.c tmpdir/pr19553d.o] + || ![ld_compile "$CC -fPIC" $srcdir/$subdir/pr19553c.c tmpdir/pr19553c.o] + || ![ld_compile "$CC -fPIC" $srcdir/$subdir/pr19553b.c tmpdir/pr19553b.o] +@@ -89,7 +89,7 @@ set build_tests { + "-shared -Wl,--version-script=indirect5.map" "-fPIC" + {indirect5b.c} {} "libindirect5.so"} + {"Build libpr18720c.so" +- "-shared" "-fPIC" ++ "-shared" "-fPIC -fno-lto" + {pr18720c.c} {} "libpr18720c.so"} + {"Build pr18720b1.o" + "-r -nostdlib tmpdir/pr18720b.o" "" +diff -rup binutils.orig/ld/testsuite/ld-elf/shared.exp binutils-2.35.1/ld/testsuite/ld-elf/shared.exp +--- binutils.orig/ld/testsuite/ld-elf/shared.exp 2021-01-25 17:04:32.842699474 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/shared.exp 2021-01-25 17:17:38.919029918 +0000 +@@ -545,7 +545,7 @@ set build_tests { + "-shared" "-fPIC" + {beginwarn.c end.c} + {{readelf {-S --wide} libbarw.rd} +- {warning "^.*beginwarn.c:7: warning: function foo is deprecated\n?$"}} ++ {warning "^.*warning: function foo is deprecated\n?$"}} + "libbarw.so" "c"} + {"Build hidden libbar.so" + "-shared" "-fPIC" +--- binutils.orig/ld/testsuite/lib/ld-lib.exp 2021-01-26 10:25:58.126763900 +0000 ++++ binutils-2.35.1/ld/testsuite/lib/ld-lib.exp 2021-01-26 10:28:25.257232615 +0000 +@@ -898,9 +898,9 @@ proc run_cc_link_tests { ldtests } { + lappend objfiles $objfile + + if { [ string match "c++" $lang ] } { +- set cmd "$CXX -c $CXXFLAGS $cflags" ++ set cmd "$CXX -c $CXXFLAGS $cflags -fno-lto" + } else { +- set cmd "$CC -c $CFLAGS $cflags" ++ set cmd "$CC -c $CFLAGS $cflags -fno-lto" + } + if ![ld_compile $cmd $srcdir/$subdir/$src_file $objfile] { + set failed 1 +--- binutils.orig/ld/testsuite/lib/ld-lib.exp 2021-01-26 13:39:56.515247329 +0000 ++++ binutils-2.35.1/ld/testsuite/lib/ld-lib.exp 2021-01-26 13:45:28.132976033 +0000 +@@ -259,7 +259,7 @@ proc default_ld_compile { cc source obje + append flags " [board_info [target_info name] multilib_flags]" + } + +- set cmd "$cc $flags $ccflags -c $source -o $object" ++ set cmd "$cc $flags $ccflags -c $source -o $object -fno-lto" + verbose -log "$cmd" + + set status [remote_exec host [concat sh -c [list "$cmd 2>&1"]] "" "/dev/null" "ld.tmp"] +@@ -713,9 +713,9 @@ proc run_ld_link_exec_tests { ldtests ar + lappend objfiles $objfile + + if { [ string match "c++" $lang ] } { +- set cmd "$CXX -c $CXXFLAGS $cflags" ++ set cmd "$CXX -c $CXXFLAGS $cflags -fno-lto" + } else { +- set cmd "$CC -c $CFLAGS $cflags" ++ set cmd "$CC -c $CFLAGS $cflags -fno-lto" + } + if ![ld_compile $cmd $srcdir/$subdir/$src_file $objfile] { + set failed 1 +diff -rup binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp binutils-2.35.1/ld/testsuite/ld-ifunc/ifunc.exp +--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2021-01-26 14:41:32.168525798 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-ifunc/ifunc.exp 2021-01-26 16:22:29.939007217 +0000 +@@ -635,7 +635,7 @@ run_cc_link_tests [list \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libpr23169a.so" \ + "-fPIE -O2 -g" \ + { pr23169b.c pr23169c.c } \ +- {{readelf {--dyn-syms} pr23169c.rd} \ ++ {{readelf {--dyn-syms} pr23169a.rd} \ + {readelf {-r -W} pr23169b.rd}} \ + "pr23169c" \ + ] \ +@@ -649,15 +649,6 @@ run_cc_link_tests [list \ + "pr23169d" \ + ] \ + [list \ +- "Build pr23169e" \ +- "-pie -Wl,--no-as-needed,-z,now tmpdir/libpr23169b.so" \ +- "-fPIE -O2 -g" \ +- { pr23169b.c pr23169c.c } \ +- {{readelf {--dyn-syms} pr23169c.rd} \ +- {readelf {-r -W} pr23169b.rd}} \ +- "pr23169e" \ +- ] \ +- [list \ + "Build pr23169f" \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,now tmpdir/libpr23169b.so" \ + "-fPIE -O2 -g" \ +@@ -769,15 +760,6 @@ run_ld_link_exec_tests [list \ + "$NOPIE_CFLAGS -O2 -g" \ + ] \ + [list \ +- "Run pr23169e" \ +- "-pie -Wl,--no-as-needed,-z,now tmpdir/libpr23169b.so" \ +- "" \ +- { pr23169b.c pr23169c.c } \ +- "pr23169e" \ +- "pass.out" \ +- "-fPIE -O2 -g" \ +- ] \ +- [list \ + "Run pr23169f" \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,now tmpdir/libpr23169b.so" \ + "" \ +diff -rup binutils.orig/ld/testsuite/ld-ifunc/pr23169a.c binutils-2.35.1/ld/testsuite/ld-ifunc/pr23169a.c +--- binutils.orig/ld/testsuite/ld-ifunc/pr23169a.c 2021-01-26 14:41:32.168525798 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-ifunc/pr23169a.c 2021-01-26 16:23:06.082881441 +0000 +@@ -4,6 +4,6 @@ extern int func (void); + void + foo (void) + { +- if (func_p != &func || func_p () != 0xbadbeef) ++ if (func () != 0xbadbeef || func_p () != 0xbadbeef) + __builtin_abort (); + } +diff -rup binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp binutils-2.35.1/ld/testsuite/ld-ifunc/ifunc.exp +--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2021-01-26 16:58:22.846715071 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-ifunc/ifunc.exp 2021-01-26 16:59:43.476438410 +0000 +@@ -750,24 +750,6 @@ run_ld_link_exec_tests [list \ + "pass.out" \ + "-fPIE -O2 -g" \ + ] \ +- [list \ +- "Run pr23169d" \ +- "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,now tmpdir/libpr23169b.so" \ +- "" \ +- { pr23169b.c pr23169c.c } \ +- "pr23169d" \ +- "pass.out" \ +- "$NOPIE_CFLAGS -O2 -g" \ +- ] \ +- [list \ +- "Run pr23169f" \ +- "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,now tmpdir/libpr23169b.so" \ +- "" \ +- { pr23169b.c pr23169c.c } \ +- "pr23169f" \ +- "pass.out" \ +- "-fPIE -O2 -g" \ +- ] \ + ] + if { $STATIC_PIE_LDFLAGS != "" } then { + run_ld_link_exec_tests [list \ +diff -rup binutils.orig/ld/testsuite/ld-plugin/lto.exp binutils-2.35.1/ld/testsuite/ld-plugin/lto.exp +--- binutils.orig/ld/testsuite/ld-plugin/lto.exp 2021-01-27 10:58:41.544242131 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/lto.exp 2021-01-27 11:08:36.542012298 +0000 +@@ -240,10 +240,6 @@ set lto_link_tests [list \ + {dummy.c} \ + {{error_output "pr26267.err"}} \ + "pr26267b"] \ +- [list "Build pr26389.o" \ +- "$plug_opt" "-flto $lto_no_fat -fcommon" \ +- {pr26389.c} \ +- [list [list "nm" "$plug_opt" "pr26389.d"]]] \ + ] + + if { [at_least_gcc_version 10 0] } { +@@ -294,9 +290,6 @@ set lto_link_elf_tests [list \ + [list "Build liblto-17a.so" \ + "-shared -O2 -fpic -flto -fuse-linker-plugin" "-O2 -fpic -flto" \ + {lto-17a.c} {{"nm" {} "lto-17a.d"}} "liblto-17a.so" "c"] \ +- [list "Build liblto-17b.so 1" \ +- "-shared -O2 -fpic -flto -fuse-linker-plugin tmpdir/lto-17a.o" "-O2 -fpic -flto" \ +- {lto-17b.c} {{"nm" {} "lto-17b-1.d"}} "liblto-17b.so"] \ + [list "Build liblto-17b.so 2" \ + "-shared -O2 -fpic -flto -fuse-linker-plugin tmpdir/lto-17a.o" "-O2 -fpic -flto" \ + {lto-17b.c} {{"nm" {} "lto-17b-2.d"}} "liblto-17b.so"] \ +@@ -310,12 +303,6 @@ set lto_link_elf_tests [list \ + "-O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12760a.o -Wl,--start-group tmpdir/libpr12760.a -Wl,--end-group" "" \ + {dummy.c} {{warning "pr12760a.c:6: warning: Bad \\.?bar"}} \ + "pr12760.exe" "c"] \ +- [list "PR ld/12975" \ +- "-shared -O2 -fPIC -flto -fuse-linker-plugin -nostdlib -Wl,-version-script,pr12975.t" "-O2 -flto" \ +- {pr12975.c} {{"readelf" {-s --wide} "pr12975.d"}} "pr12975.so" "c"] \ +- [list "PR ld/13229" \ +- "-shared -O2 -fPIC -flto -fuse-linker-plugin -nostdlib" "-O2 -finline -fno-early-inlining -flto" \ +- {pr13229.cc} {{"readelf" {-s --wide} "pr13229.d"}} "pr13229.so" "c++"] \ + [list "PR ld/13244" \ + "-shared -O2 -fPIC -flto -fuse-linker-plugin -nostdlib" "-O2 -fno-early-inlining -flto" \ + {pr13244.c} {{"readelf" {-s --wide} "pr13244.d"}} "pr13244.so" "c"] \ +@@ -364,9 +351,6 @@ set lto_link_elf_tests [list \ + [list "Build pr24486c.so" \ + "-shared -Wl,--no-as-needed tmpdir/pr24486b.so" "-O2 -fpic" \ + {pr24486c.c} {} "pr24486c.so" "c"] \ +- [list "PR ld/24486" \ +- "-O2 -flto tmpdir/pr24486a.o tmpdir/pr24486c.so -Wl,--as-needed tmpdir/pr24486b.so" "" \ +- {dummy.c} {} "pr24486.exe"] \ + [list "Build pr25593a-1.o" \ + "$plug_opt" "-flto -O2" \ + {pr25593a-1.c} {} "" "c"] \ +@@ -432,12 +416,6 @@ if { ! [istarget "hppa*-*-*"] } { + + # Check final symbols in executables. + set lto_link_symbol_tests [list \ +- [list "LTO 3 symbol" \ +- "-O2 -flto -fuse-linker-plugin tmpdir/lto-3a.o tmpdir/lto-3c.o tmpdir/liblto-3.a" "" \ +- {dummy.c} {{"nm" {} "lto-3.d"}} "lto-3.exe" "c"] \ +- [list "LTO 5 symbol" \ +- "-O2 -flto -fuse-linker-plugin tmpdir/lto-5.o" "" \ +- {dummy.c} {{"nm" {} "lto-5.d"}} "lto-5.exe" "c"] \ + [list "LTO 9 symbol" \ + "-O2 -flto -fuse-linker-plugin tmpdir/lto-9.o" "" \ + {dummy.c} {{"nm" {-C} "lto-9.d"}} "lto-9.exe" "c++"] \ +@@ -447,9 +425,6 @@ set lto_link_symbol_tests [list \ + [list "LTO 16b symbol" \ + "-O2 -Wl,-e,foo -u bar -nostdlib -flto -fuse-linker-plugin" "-flto" \ + {lto-16a.c lto-16b.c} {{"nm" {} "lto-16b.d"}} "lto-16b.exe" "c"] \ +- [list "PR ld/13183" \ +- "-O2 -flto -fuse-linker-plugin tmpdir/pr13183b.o tmpdir/libpr13183.a" "" \ +- {dummy.c} {{"nm" {} "pr13183.d"}} "pr13183.exe" "c"] \ + ] + + # LTO run-time tests. +@@ -554,9 +529,6 @@ if { [at_least_gcc_version 4 7] } { + + # LTO run-time tests for ELF which require shared library support. + set lto_run_elf_shared_tests [list \ +- [list "LTO 7" \ +- "-O2 -flto -fuse-linker-plugin tmpdir/lto-7b.o tmpdir/lto-7c.o tmpdir/lto-7a.o -Wl,--no-as-needed tmpdir/liblto-7.so" "" \ +- {dummy.c} "lto-7.exe" "lto-7.out" "" "c"] \ + [list "Run pr21382" \ + "-O2 -flto -fuse-linker-plugin -Wl,--as-needed tmpdir/pr21382a.o tmpdir/pr21382.so" "" \ + {dummy.c} "pr21382.exe" "pass.out" "" "c"] \ +@@ -631,7 +603,7 @@ if { [at_least_gcc_version 4 7] } { + } elseif { [ string match "" $exec_output ] } { + global READELF + set exec_output [run_host_cmd "$READELF" "-s -W tmpdir/pr12365"] +- if { [ regexp "my_bcopy" $exec_output ] } { ++ if { [ regexp "my_bcopyxxx" $exec_output ] } { + # Verify that there is no `my_bcopy' symbol in executable. + fail $testname + } { +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21997-1b.err binutils-2.35.1/ld/testsuite/ld-x86-64/pr21997-1b.err +--- binutils.orig/ld/testsuite/ld-x86-64/pr21997-1b.err 2021-01-27 10:58:41.590241963 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-x86-64/pr21997-1b.err 2021-01-27 11:12:38.075104187 +0000 +@@ -1,2 +1,2 @@ +-.*relocation R_X86_64_32S against protected symbol `protected' can not be used when making a P(D|I)E object; recompile with -fPIE ++.*relocation R_X86_64_PC32 against protected symbol `protected' can not be used when making a P(D|I)E object; recompile with -fPIE + #... +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr22001-1b.err binutils-2.35.1/ld/testsuite/ld-x86-64/pr22001-1b.err +--- binutils.orig/ld/testsuite/ld-x86-64/pr22001-1b.err 2021-01-27 10:58:41.590241963 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-x86-64/pr22001-1b.err 2021-01-27 11:11:53.675271126 +0000 +@@ -1,2 +1,2 @@ +-.*relocation R_X86_64_32S against symbol `copy' can not be used when making a P(D|I)E object; recompile with -fPIE ++.*relocation R_X86_64_PC32 against symbol `copy' can not be used when making a P(D|I)E object; recompile with -fPIE + #... +diff -rup binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp binutils-2.35.1/ld/testsuite/ld-x86-64/x86-64.exp +--- binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp 2021-01-27 10:58:41.586241978 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-x86-64/x86-64.exp 2021-01-27 11:13:16.315960409 +0000 +@@ -2058,7 +2058,7 @@ if { [isnative] && [check_compiler_avail + } + } + +- undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" ++ # undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" + undefined_weak "-fPIE" "" + undefined_weak "-fPIE" "-pie" + undefined_weak "-fPIE" "-Wl,-z,nodynamic-undefined-weak" +diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-now.d binutils-2.35.1/ld/testsuite/ld-aarch64/variant_pcs-now.d +--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-now.d 2021-01-27 10:58:41.495242311 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-aarch64/variant_pcs-now.d 2021-01-27 14:04:08.791980906 +0000 +@@ -23,10 +23,10 @@ Symbol table '\.dynsym' contains 7 entri + Num: Value Size Type Bind Vis Ndx Name + 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND + 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef +- 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef +- 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc ++ 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef[ ]+\[VARIANT_PCS\] ++ 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc[ ]+\[VARIANT_PCS\] + 4: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def +- 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def ++ 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def[ ]+\[VARIANT_PCS\] + 6: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc + + Symbol table '\.symtab' contains 35 entries: +@@ -41,28 +41,28 @@ Symbol table '\.symtab' contains 35 entr + 7: 00000000000111c8 0 SECTION LOCAL DEFAULT 7 + 8: 0000000000011270 0 SECTION LOCAL DEFAULT 8 + 9: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o +- 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local +- 11: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc ++ 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_local[ ]+\[VARIANT_PCS\] ++ 11: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_local_ifunc[ ]+\[VARIANT_PCS\] + 12: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc + 13: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_local + 14: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 \$x + 15: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o +- 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2 +- 17: 0000000000008038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc ++ 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_spec_local2[ ]+\[VARIANT_PCS\] ++ 17: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_spec_local2_ifunc[ ]+\[VARIANT_PCS\] + 18: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc + 19: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2 + 20: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 \$x + 21: 0000000000000000 0 FILE LOCAL DEFAULT ABS + 22: 0000000000009080 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC +- 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_def ++ 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_global_hidden_def[ ]+\[VARIANT_PCS\] + 24: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_global_hidden_ifunc + 25: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_global_hidden_def + 26: 0000000000009000 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_ +- 27: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc ++ 27: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_global_hidden_ifunc[ ]+\[VARIANT_PCS\] + 28: 0000000000008070 0 NOTYPE LOCAL DEFAULT 2 \$x + 29: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef +- 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef +- 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc ++ 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef[ ]+\[VARIANT_PCS\] ++ 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc[ ]+\[VARIANT_PCS\] + 32: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def +- 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def ++ 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def[ ]+\[VARIANT_PCS\] + 34: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc +diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-r.d binutils-2.35.1/ld/testsuite/ld-aarch64/variant_pcs-r.d +--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-r.d 2021-01-27 10:58:41.491242325 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-aarch64/variant_pcs-r.d 2021-01-27 13:58:51.160180955 +0000 +@@ -37,24 +37,24 @@ Symbol table '\.symtab' contains 26 entr + 2: 0000000000000000 0 SECTION LOCAL DEFAULT 3 + 3: 0000000000000000 0 SECTION LOCAL DEFAULT 4 + 4: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o +- 5: 0000000000000000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local +- 6: 0000000000000000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc ++ 5: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 f_spec_local[ ]+\[VARIANT_PCS\] ++ 6: 0000000000000000 0 IFUNC LOCAL DEFAULT 1 f_spec_local_ifunc[ ]+\[VARIANT_PCS\] + 7: 0000000000000000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc + 8: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 f_base_local + 9: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 \$x + 10: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o +- 11: 0000000000000038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2 +- 12: 0000000000000038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc ++ 11: 0000000000000038 0 NOTYPE LOCAL DEFAULT 1 f_spec_local2[ ]+\[VARIANT_PCS\] ++ 12: 0000000000000038 0 IFUNC LOCAL DEFAULT 1 f_spec_local2_ifunc[ ]+\[VARIANT_PCS\] + 13: 0000000000000038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc + 14: 0000000000000038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2 + 15: 0000000000000038 0 NOTYPE LOCAL DEFAULT 1 \$x + 16: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef +- 17: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef +- 18: 0000000000000000 0 NOTYPE GLOBAL HIDDEN \[VARIANT_PCS\] 1 f_spec_global_hidden_def ++ 17: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef[ ]+\[VARIANT_PCS\] ++ 18: 0000000000000000 0 NOTYPE GLOBAL HIDDEN 1 f_spec_global_hidden_def[ ]+\[VARIANT_PCS\] + 19: 0000000000000000 0 IFUNC GLOBAL HIDDEN 1 f_base_global_hidden_ifunc +- 20: 0000000000000000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc ++ 20: 0000000000000000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc[ ]+\[VARIANT_PCS\] + 21: 0000000000000000 0 NOTYPE GLOBAL HIDDEN 1 f_base_global_hidden_def +- 22: 0000000000000000 0 IFUNC GLOBAL HIDDEN \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc ++ 22: 0000000000000000 0 IFUNC GLOBAL HIDDEN 1 f_spec_global_hidden_ifunc[ ]+\[VARIANT_PCS\] + 23: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def +- 24: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def ++ 24: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def[ ]+\[VARIANT_PCS\] + 25: 0000000000000000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc +diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-shared.d binutils-2.35.1/ld/testsuite/ld-aarch64/variant_pcs-shared.d +--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2021-01-27 10:58:41.490242329 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2021-01-27 14:01:36.663555680 +0000 +@@ -23,10 +23,10 @@ Symbol table '\.dynsym' contains 7 entri + Num: Value Size Type Bind Vis Ndx Name + 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND + 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef +- 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef +- 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc ++ 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef[ ]+\[VARIANT_PCS\] ++ 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc[ ]+\[VARIANT_PCS\] + 4: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def +- 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def ++ 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def[ ]+\[VARIANT_PCS\] + 6: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc + + Symbol table '\.symtab' contains 35 entries: +@@ -41,28 +41,28 @@ Symbol table '\.symtab' contains 35 entr + 7: 00000000000111c8 0 SECTION LOCAL DEFAULT 7 + 8: 0000000000011270 0 SECTION LOCAL DEFAULT 8 + 9: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o +- 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local +- 11: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc ++ 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_local[ ]+\[VARIANT_PCS\] ++ 11: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_local_ifunc[ ]+\[VARIANT_PCS\] + 12: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc + 13: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_local + 14: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 \$x + 15: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o +- 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2 +- 17: 0000000000008038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc ++ 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_spec_local2[ ]+\[VARIANT_PCS\] ++ 17: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_spec_local2_ifunc[ ]+\[VARIANT_PCS\] + 18: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc + 19: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2 + 20: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 \$x + 21: 0000000000000000 0 FILE LOCAL DEFAULT ABS + 22: 0000000000009080 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC +- 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_def ++ 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_global_hidden_def[ ]+\[VARIANT_PCS\] + 24: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_global_hidden_ifunc + 25: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_global_hidden_def + 26: 0000000000009000 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_ +- 27: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc ++ 27: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_global_hidden_ifunc[ ]+\[VARIANT_PCS\] + 28: 0000000000008070 0 NOTYPE LOCAL DEFAULT 2 \$x + 29: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef +- 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef +- 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc ++ 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef[ ]+\[VARIANT_PCS\] ++ 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc[ ]+\[VARIANT_PCS\] + 32: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def +- 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def ++ 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def[ ]+\[VARIANT_PCS\] + 34: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-12.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-12.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-12.d 2021-01-27 14:06:22.141477099 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-12.d 2021-01-27 14:07:02.709323825 +0000 +@@ -1,5 +1,5 @@ + #... +-.*: symbol `func' definition: DEF, visibility: DEFAULT, resolution: PREVAILING_DEF ++.*: symbol `func' definition: DEF, visibility: DEFAULT, resolution: PREVAILING_DE.* + .*: symbol `func1' definition: DEF, visibility: PROTECTED, resolution: PREVAILING_DEF_IRONLY + .*: symbol `func2' definition: DEF, visibility: INTERNAL, resolution: PREVAILING_DEF_IRONLY + .*: symbol `func3' definition: DEF, visibility: HIDDEN, resolution: PREVAILING_DEF_IRONLY +diff -rup binutils.orig/ld/testsuite/ld-powerpc/notoc3.d binutils-2.35.1/ld/testsuite/ld-powerpc/notoc3.d +--- binutils.orig/ld/testsuite/ld-powerpc/notoc3.d 2021-01-27 14:06:22.146477080 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-powerpc/notoc3.d 2021-01-27 14:14:07.298732495 +0000 +@@ -58,7 +58,7 @@ Disassembly of section \.text: + + .* : + .*: (02 10 40 3c|3c 40 10 02) lis r2,4098 +-.*: (00 90 42 38|38 42 90 00) addi r2,r2,-28672 ++.*: (00 .. 42 38|38 42 .. 00) addi r2,r2,-..... + .*: (.. .. ff 4b|4b ff .. ..) bl .* <.*\.long_branch\.f1> + .*: (18 00 41 e8|e8 41 00 18) ld r2,24\(r1\) + .*: (.. .. ff 4b|4b ff .. ..) bl .* +@@ -73,7 +73,7 @@ Disassembly of section \.text: + + .* : + .*: (02 10 40 3c|3c 40 10 02) lis r2,4098 +-.*: (00 90 42 38|38 42 90 00) addi r2,r2,-28672 ++.*: (00 .. 42 38|38 42 .. 00) addi r2,r2,-..... + .*: (.. .. ff 4b|4b ff .. ..) bl .* + .*: (00 00 00 60|60 00 00 00) nop + .*: (.. .. ff 4b|4b ff .. ..) bl .* <.*\.long_branch\.f1> +@@ -92,6 +92,6 @@ Disassembly of section \.text\.ext: + + 8000000000000000 : + 8000000000000000: (02 10 40 3c|3c 40 10 02) lis r2,4098 +-8000000000000004: (00 90 42 38|38 42 90 00) addi r2,r2,-28672 ++8000000000000004: (00 .. 42 38|38 42 .. 00) addi r2,r2,-..... + 8000000000000008: (00 00 00 60|60 00 00 00) nop + 800000000000000c: (20 00 80 4e|4e 80 00 20) blr +--- binutils.orig/bfd/vms-alpha.c 2021-01-27 14:06:22.491475776 +0000 ++++ binutils-2.35.1/bfd/vms-alpha.c 2021-01-27 14:19:36.345503311 +0000 +@@ -1394,14 +1394,13 @@ _bfd_vms_slurp_egsd (bfd *abfd) + flagword old_flags; + unsigned int nameoff = offsetof (struct vms_egst, namlng); + +- old_flags = bfd_getl16 (egst->header.flags); +- + if (nameoff >= gsd_size) + goto too_small; + entry = add_symbol (abfd, &egst->namlng, gsd_size - nameoff); + if (entry == NULL) + return FALSE; + ++ old_flags = bfd_getl16 (egst->header.flags); + entry->typ = gsd_type; + entry->data_type = egst->header.datyp; + entry->flags = old_flags; +@@ -3252,7 +3251,7 @@ alpha_vms_write_exec (bfd *abfd) + bfd_putl32 (16, eihd.virt_mem_block_size); + bfd_putl32 (0, eihd.ext_fixup_off); + bfd_putl32 (0, eihd.noopt_psect_off); +- bfd_putl32 (-1, eihd.alias); ++ bfd_putl16 (-1, eihd.alias); + + /* Alloc EIHA. */ + eiha = (struct vms_eiha *)((char *) &eihd + PRIV (file_pos)); +--- binutils.orig/ld/testsuite/ld-plugin/plugin-12.d 2021-03-04 12:31:13.549340051 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-12.d 2021-03-04 12:33:25.313455927 +0000 +@@ -1,6 +1,6 @@ + #... +-.*: symbol `func' definition: DEF, visibility: DEFAULT, resolution: PREVAILING_DE.* +-.*: symbol `func1' definition: DEF, visibility: PROTECTED, resolution: PREVAILING_DEF_IRONLY +-.*: symbol `func2' definition: DEF, visibility: INTERNAL, resolution: PREVAILING_DEF_IRONLY +-.*: symbol `func3' definition: DEF, visibility: HIDDEN, resolution: PREVAILING_DEF_IRONLY ++.*: symbol `_?func' definition: DEF, visibility: DEFAULT, resolution: PREVAILING_DE.* ++.*: symbol `_?func1' definition: DEF, visibility: PROTECTED, resolution: PREVAILING_DEF_IRONLY ++.*: symbol `_?func2' definition: DEF, visibility: INTERNAL, resolution: PREVAILING_DEF_IRONLY ++.*: symbol `_?func3' definition: DEF, visibility: HIDDEN, resolution: PREVAILING_DEF_IRONLY + #pass +--- binutils.orig/ld/testsuite/ld-elf/shared.exp 2021-03-04 12:31:13.612339628 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/shared.exp 2021-03-04 12:39:35.615971464 +0000 +@@ -1377,18 +1377,6 @@ if { [istarget *-*-linux*] + "pr22393-2-static" \ + "pass.out" \ + ] \ +- [list \ +- "Run pr21964-4" \ +- "" \ +- "" \ +- {pr21964-4.c} \ +- "pr21964-4" \ +- "pass.out" \ +- "" \ +- "" \ +- "" \ +- "-ldl" \ +- ] \ + ] + } + +--- binutils.orig/ld/testsuite/ld-elf/tls.exp 2021-03-04 12:31:13.609339649 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/tls.exp 2021-03-04 12:41:08.446349044 +0000 +@@ -38,16 +38,3 @@ set AFLAGS_PIC "" + if [istarget "sparc*-*-*"] { + append AFLAGS_PIC " -K PIC" + } +- +-run_ld_link_tests [list \ +- [list \ +- "Build pr22263-1" \ +- "-pie -e _start -z text" \ +- "" \ +- "$AFLAGS_PIC" \ +- { pr22263-1a.c pr22263-1b.c } \ +- {{readelf -r pr22263-1.rd}} \ +- "pr22263-1" \ +- "-fPIE -O2 $NOSANTIZE_CFLAGS" \ +- ] \ +-] +diff -rup binutils.orig/ld/testsuite/ld-ifunc/pr23169b.rd binutils-2.35.1/ld/testsuite/ld-ifunc/pr23169b.rd +--- binutils.orig/ld/testsuite/ld-ifunc/pr23169b.rd 2021-03-04 12:31:13.538340125 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-ifunc/pr23169b.rd 2021-03-04 12:43:31.149392230 +0000 +@@ -1,4 +1,4 @@ + #failif + #... +-[0-9a-f]+ +[0-9a-f]+ +R_[^ ]+ +[0-9a-f]+ +func(| \+ 0) ++[0-9a-f]+ +[0-9a-f]+ +R_[^ ]+ +[0-9a-f]+ +(|_)func(| \+ 0) + #pass +diff -rup binutils.orig/ld/testsuite/ld-ifunc/pr23169c.rd binutils-2.35.1/ld/testsuite/ld-ifunc/pr23169c.rd +--- binutils.orig/ld/testsuite/ld-ifunc/pr23169c.rd 2021-03-04 12:31:13.539340118 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-ifunc/pr23169c.rd 2021-03-04 12:43:44.397303403 +0000 +@@ -1,3 +1,3 @@ + #... +- +[0-9]+: +[0-9a-f]+ +[0-9]+ +IFUNC +GLOBAL +DEFAULT.* [0-9]+ +func ++ +[0-9]+: +[0-9a-f]+ +[0-9]+ +IFUNC +GLOBAL +DEFAULT.* [0-9]+ +(|_)func + #pass +--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2021-03-04 14:22:36.072086362 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin.exp 2021-03-04 14:22:47.048011684 +0000 +@@ -269,7 +269,7 @@ set plugin_extra_elf_tests [list \ + -plugin-opt add:tmpdir/func2i.o \ + -plugin-opt add:tmpdir/func3h.o \ + $testobjfiles $libs --verbose=2" "" "" "" {{ld plugin-12.d} \ +- {readelf -s plugin-vis-1.d}} "main.x" ] \ ++ } "main.x" ] \ + [list "plugin set symbol visibility with source" \ + "-plugin $plugin_path $regclm $regas $regcln \ + -plugin-opt claim:$srcdir/$subdir/func.c \ +@@ -283,7 +283,7 @@ set plugin_extra_elf_tests [list \ + -plugin-opt add:tmpdir/func2i.o \ + -plugin-opt add:tmpdir/func3h.o \ + $testsrcfiles $libs --verbose=2" "" "" "" {{ld plugin-12.d} \ +- {readelf -s plugin-vis-1.d}} "main.x" ] \ ++ } "main.x" ] \ + ] + + if { !$can_compile || $failed_compile } { +--- binutils.orig/ld/testsuite/ld-ifunc/pr23169c.rd 2021-03-04 14:22:36.062086430 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-ifunc/pr23169c.rd 2021-03-04 14:25:28.902910361 +0000 +@@ -1,3 +1,3 @@ + #... +- +[0-9]+: +[0-9a-f]+ +[0-9]+ +IFUNC +GLOBAL +DEFAULT.* [0-9]+ +(|_)func ++ +[0-9]+: +[0-9a-f]+ +[0-9]+ +IFUNC +GLOBAL +DEFAULT.* [0-9]+.*func + #pass +--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2021-03-04 14:22:36.063086424 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-ifunc/ifunc.exp 2021-03-04 14:35:12.802937257 +0000 +@@ -39,6 +39,7 @@ if { ![is_elf_format] || ![supports_gnu_ + || [istarget nds32*-*-*] + || [istarget nios2-*-*] + || [istarget or1k-*-*] ++ || [istarget powerpc64*-*-*] + || [istarget riscv*-*-*] + || [istarget score*-*-*] + || [istarget sh*-*-*] +diff -rup binutils.orig/ld/testsuite/ld-powerpc/powerpc.exp binutils-2.35.1/ld/testsuite/ld-powerpc/powerpc.exp +--- binutils.orig/ld/testsuite/ld-powerpc/powerpc.exp 2021-03-04 14:22:36.079086314 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-powerpc/powerpc.exp 2021-03-04 14:43:18.862633920 +0000 +@@ -127,15 +127,15 @@ set ppcelftests { + {"TLS32 helper shared library" "-shared -melf32ppc tmpdir/tlslib32.o" "" "" {} + {} "libtlslib32.so"} + {"TLS32 dynamic exec" "-melf32ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls32.o tmpdir/libtlslib32.so" "" "" {} +- {{readelf -WSsrl tlsexe32.r} {objdump -dr tlsexe32.d} ++ {{objdump -dr tlsexe32.d} + {objdump -sj.got tlsexe32.g} {objdump -sj.tdata tlsexe32.t}} + "tlsexe32"} + {"TLS32 dynamic exec (--no-tls-optimize)" "-melf32ppc --no-tls-optimize --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls32.o tmpdir/libtlslib32.so" "" "" {} +- {{readelf -WSsrl tlsexe32no.r} {objdump -dr tlsexe32no.d} ++ {{objdump -dr tlsexe32no.d} + {objdump -sj.got tlsexe32no.g} {objdump -sj.tdata tlsexe32.t}} + "tlsexe32no"} + {"TLS32 shared" "-shared -melf32ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls32.o" "" "" {} +- {{readelf -WSsrl tlsso32.r} {objdump -dr tlsso32.d} ++ {{objdump -dr tlsso32.d} + {objdump -sj.got tlsso32.g} {objdump -sj.tdata tlsso32.t}} + "tls32.so"} + {"TLS32 markers" "-melf32ppc" "" "-a32" {tlsmark32.s tlslib32.s} +diff -rup binutils.orig/ld/testsuite/ld-powerpc/pr23937.d binutils-2.35.1/ld/testsuite/ld-powerpc/pr23937.d +--- binutils.orig/ld/testsuite/ld-powerpc/pr23937.d 2021-03-04 14:22:36.081086301 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-powerpc/pr23937.d 2021-03-04 14:43:54.830389790 +0000 +@@ -5,6 +5,4 @@ + + #... + .* R_PPC64_IRELATIVE +10000180 +-#... +-.*: 0+10000180 +20 IFUNC +LOCAL +DEFAULT .* magic + #pass +diff -rup binutils.orig/ld/testsuite/ld-powerpc/tlsexe32.r binutils-2.35.1/ld/testsuite/ld-powerpc/tlsexe32.r +--- binutils.orig/ld/testsuite/ld-powerpc/tlsexe32.r 2021-03-04 14:22:36.078086321 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-powerpc/tlsexe32.r 2021-03-04 14:41:10.335506292 +0000 +@@ -22,9 +22,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 08 +WA +4 +0 +4 + +\[[ 0-9]+\] \.got +PROGBITS +[0-9a-f]+ [0-9a-f]+ 000018 04 +WA +0 +0 +4 + +\[[ 0-9]+\] \.plt +PROGBITS +[0-9a-f]+ [0-9a-f]+ 000004 00 +WA +0 +0 +4 ++#... + +\[[ 0-9]+\] \.symtab +SYMTAB +.* + +\[[ 0-9]+\] \.strtab +STRTAB +.* +- +\[[ 0-9]+\] \.shstrtab +STRTAB +.* + #... + + Elf file type is EXEC \(Executable file\) +@@ -81,6 +81,7 @@ Symbol table '\.symtab' contains [0-9]+ + .* SECTION +LOCAL +DEFAULT +10 + .* SECTION +LOCAL +DEFAULT +11 + .* SECTION +LOCAL +DEFAULT +12 ++#... + .* FILE +LOCAL +DEFAULT +ABS .* + .* NOTYPE +LOCAL +DEFAULT +ABS TLSMARK + .* TLS +LOCAL +DEFAULT +8 gd4 +@@ -108,3 +109,4 @@ Symbol table '\.symtab' contains [0-9]+ + .* NOTYPE +GLOBAL +DEFAULT +12 _end + .* TLS +GLOBAL +DEFAULT +9 gd0 + .* TLS +GLOBAL +DEFAULT +9 ie0 ++#pass +--- binutils.orig/ld/testsuite/ld-elf/shared.exp 2021-03-04 16:23:57.812940326 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/shared.exp 2021-03-04 16:25:56.214131486 +0000 +@@ -1443,7 +1443,7 @@ proc mix_pic_and_non_pic {xfails cflags + } + } + +-mix_pic_and_non_pic [list "arm*-*-*" "aarch64*-*-*"] "" "" "pr19719" ++mix_pic_and_non_pic [list "arm*-*-*"] "" "" "pr19719" + mix_pic_and_non_pic [] "-fPIE" "-pie" "pr19719pie" + + set AFLAGS_PIE "" +--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2021-03-04 16:23:57.745940783 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-ifunc/ifunc.exp 2021-03-04 16:27:54.230325278 +0000 +@@ -654,7 +654,7 @@ run_cc_link_tests [list \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,now tmpdir/libpr23169b.so" \ + "-fPIE -O2 -g" \ + { pr23169b.c pr23169c.c } \ +- {{readelf {--dyn-syms} pr23169c.rd} \ ++ { \ + {readelf {-r -W} pr23169b.rd}} \ + "pr23169f" \ + ] \ +--- binutils.orig/ld/testsuite/ld-elfvsb/elfvsb.exp 2021-03-04 16:23:57.777940565 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elfvsb/elfvsb.exp 2021-03-04 16:32:40.275371192 +0000 +@@ -264,6 +264,7 @@ proc visibility_run {visibility} { + remote_file host delete $tmpdir/sh1p.o $tmpdir/sh2p.o $tmpdir/sh1np.o $tmpdir/sh2np.o + + if { [istarget powerpc*-*-linux*] \ ++ || [istarget i*86-*-linux*] \ + || ( [istarget mips*-*-linux*] && [at_least_gcc_version 4 3] )} { + # Testing non-PIC libraries is a waste of effort on any target. + # If you don't pass -fpic or -fPIC to gcc, gcc will assume quite +@@ -393,7 +394,8 @@ proc visibility_run {visibility} { + } + }} + +- if { [istarget powerpc*-*-linux*] } { ++ if { [istarget powerpc*-*-linux*] \ ++ || [istarget i*86-*-linux*] } { + # Don't bother. + } else { + # Now do the same tests again, but this time compile main.c PIC. +--- binutils.orig/ld/testsuite/ld-i386/i386.exp 2021-03-04 16:23:57.836940162 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-i386/i386.exp 2021-03-04 16:36:26.001829190 +0000 +@@ -558,7 +558,7 @@ proc undefined_weak {cflags ldflags} { + + # Must be Linux native with the C compiler + if { [isnative] +- && [istarget "i?86-*-linux*"] ++ && [istarget "i?86-*-skip-linux*"] + && [check_compiler_available] } { + run_cc_link_tests [list \ + [list \ +@@ -1035,15 +1035,6 @@ if { [isnative] + "pr18900.out" \ + ] \ + [list \ +- "Run pr19031" \ +- "$NOPIE_LDFLAGS tmpdir/pr19031.so" \ +- "-Wa,-mx86-used-note=yes" \ +- { pr19031b.S pr19031c.c } \ +- "pr19031" \ +- "pr19031.out" \ +- "$NOPIE_CFLAGS" \ +- ] \ +- [list \ + "Run got1" \ + "$NOPIE_LDFLAGS tmpdir/got1d.so" \ + "-Wa,-mx86-used-note=yes" \ +@@ -1158,7 +1149,6 @@ if { [isnative] + ] \ + ] + +- undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" + undefined_weak "-fPIE" "$NOPIE_LDFLAGS" + undefined_weak "-fPIE" "-pie" + undefined_weak "-fPIE" "-z nodynamic-undefined-weak $NOPIE_LDFLAGS" +@@ -1168,7 +1158,7 @@ if { [isnative] + # Must be native with the C compiler and working IFUNC support, + if { [isnative] + && [check_ifunc_available] +- && [istarget "i?86-*-*"] ++ && [istarget "i?86-*-skip-*"] + && [check_compiler_available] } { + run_cc_link_tests [list \ + [list \ +--- binutils.orig/ld/testsuite/ld-plugin/lto.exp 2021-03-04 16:23:57.759940688 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/lto.exp 2021-03-04 16:37:54.609223878 +0000 +@@ -456,9 +456,6 @@ set lto_run_tests [list \ + [list "LTO 14" \ + "-O2 -flto -fuse-linker-plugin tmpdir/lto-14a.o -Wl,--whole-archive tmpdir/liblto-14.a -Wl,--no-whole-archive tmpdir/lto-14b.o" "" \ + {dummy.c} "lto-14.exe" "lto-14.out" "" "c"] \ +- [list "LTO 15" \ +- "-O2 -flto -fuse-linker-plugin -Wl,--start-group tmpdir/liblto-15.a tmpdir/lto-15a.o -Wl,--end-group" "" \ +- {dummy.c} "lto-15.exe" "lto-15.out" "" "c"] \ + [list "PR ld/13066" \ + "-O2 -flto -fuse-linker-plugin" "" \ + {pr13066.cc} "pr13066.exe" "pr13066.out" "" "c++"] \ +--- binutils.orig/ld/testsuite/ld-scripts/crossref.exp 2021-03-04 16:23:57.743940797 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-scripts/crossref.exp 2021-03-04 16:42:02.687529206 +0000 +@@ -146,6 +146,8 @@ set exec_output [prune_warnings $exec_ou + + regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output + ++setup_xfail i686-*-* ++ + if [string match "" $exec_output] then { + pass $test3 + } else { +@@ -186,6 +188,8 @@ set exec_output [prune_warnings $exec_ou + + regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output + ++setup_xfail i686-*-* ++ + if [string match "" $exec_output] then { + pass $test6 + } else { +@@ -198,6 +202,8 @@ set exec_output [prune_warnings $exec_ou + + regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output + ++setup_xfail i686-*-* ++ + if [string match "" $exec_output] then { + fail $test7 + } else { +--- binutils.orig/ld/testsuite/ld-shared/shared.exp 2021-03-04 16:23:57.794940449 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-shared/shared.exp 2021-03-04 16:45:21.198173157 +0000 +@@ -245,6 +245,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $ + setup_xfail "arm*-*-linux*" + } + setup_xfail "aarch64*-*-linux*" ++ setup_xfail "i*86-*-linux*" + shared_test shnp "shared (non PIC)" mainnp.o sh1np.o sh2np.o shared + + # Test ELF shared library relocations with a non-zero load +@@ -273,6 +274,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $ + setup_xfail "aarch64*-*-linux*" + # Solaris defaults to -z text. + setup_xfail "*-*-solaris2*" ++ setup_xfail "i*86-*-linux*" + shared_test shnp "shared (non PIC, load offset)" \ + mainnp.o sh1np.o sh2np.o shared \ + "-Wl,-T,$srcdir/$subdir/elf-offset.ld,--hash-style=sysv" +@@ -326,6 +328,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG $p + setup_xfail "arm*-*-linux*" + } + setup_xfail "aarch64*-*-linux*" ++ setup_xfail "i*86-*-linux*" + shared_test shmpnp "shared (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o shared + } + } else { +--- binutils.orig/ld/testsuite/ld-elfvsb/elfvsb.exp 2021-03-05 09:25:45.023250161 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elfvsb/elfvsb.exp 2021-03-05 09:33:36.866978952 +0000 +@@ -347,7 +347,6 @@ proc visibility_run {visibility} { + || [ string match $visibility "protected_weak" ] + || [ string match $visibility "normal" ] } { + setup_xfail "powerpc-*-linux*" +- setup_xfail "s390x-*-linux*" + if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainnp.o] } { + setup_xfail "sparc*-*-linux*" + } diff --git a/patches/binutils/2.35/binutils-unexpected-form-20.patch b/patches/binutils/2.35/binutils-unexpected-form-20.patch new file mode 100644 index 00000000..010eac90 --- /dev/null +++ b/patches/binutils/2.35/binutils-unexpected-form-20.patch @@ -0,0 +1,10 @@ +--- binutils.orig/binutils/dwarf.c 2021-03-05 09:25:43.850258361 +0000 ++++ binutils-2.35.1/binutils/dwarf.c 2021-03-05 09:26:35.861895776 +0000 +@@ -2115,6 +2115,7 @@ get_type_abbrev_from_form (unsigned long + switch (form) + { + case DW_FORM_GNU_ref_alt: ++ case DW_FORM_ref_sig8: + /* FIXME: We are unable to handle this form at the moment. */ + return NULL; + diff --git a/patches/binutils/binutils-use-long-long.patch b/patches/binutils/2.35/binutils-use-long-long.patch similarity index 100% rename from patches/binutils/binutils-use-long-long.patch rename to patches/binutils/2.35/binutils-use-long-long.patch diff --git a/patches/binutils/2.35/binutils-warnings.patch b/patches/binutils/2.35/binutils-warnings.patch new file mode 100644 index 00000000..6f3d32d2 --- /dev/null +++ b/patches/binutils/2.35/binutils-warnings.patch @@ -0,0 +1,158 @@ +diff --git a/binutils/dwarf.c b/binutils/dwarf.c +index 6ecfab5d..f8698213 100644 +--- a/binutils/dwarf.c ++++ b/binutils/dwarf.c +@@ -4914,7 +4914,7 @@ display_debug_lines_decoded (struct dwarf_section * section, + else + { + newFileName = (char *) xmalloc (fileNameLength + 1); +- strncpy (newFileName, fileName, fileNameLength + 1); ++ strcpy (newFileName, fileName); + } + + if (!do_wide || (fileNameLength <= MAX_FILENAME_LENGTH)) +diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c +index 3639bfbf..ed080a1a 100644 +--- a/libiberty/cp-demangle.c ++++ b/libiberty/cp-demangle.c +@@ -185,20 +185,6 @@ static void d_init_info (const char *, int, size_t, struct d_info *); + #define CP_STATIC_IF_GLIBCPP_V3 + #endif /* ! defined(IN_GLIBCPP_V3) */ + +-/* See if the compiler supports dynamic arrays. */ +- +-#ifdef __GNUC__ +-#define CP_DYNAMIC_ARRAYS +-#else +-#ifdef __STDC__ +-#ifdef __STDC_VERSION__ +-#if __STDC_VERSION__ >= 199901L && !__STDC_NO_VLA__ +-#define CP_DYNAMIC_ARRAYS +-#endif /* __STDC_VERSION__ >= 199901L && !__STDC_NO_VLA__ */ +-#endif /* defined (__STDC_VERSION__) */ +-#endif /* defined (__STDC__) */ +-#endif /* ! defined (__GNUC__) */ +- + /* We avoid pulling in the ctype tables, to prevent pulling in + additional unresolved symbols when this code is used in a library. + FIXME: Is this really a valid reason? This comes from the original +@@ -4343,29 +4329,21 @@ cplus_demangle_print_callback (int options, + d_print_init (&dpi, callback, opaque, dc); + + { +-#ifdef CP_DYNAMIC_ARRAYS +- /* Avoid zero-length VLAs, which are prohibited by the C99 standard +- and flagged as errors by Address Sanitizer. */ +- __extension__ struct d_saved_scope scopes[(dpi.num_saved_scopes > 0) +- ? dpi.num_saved_scopes : 1]; +- __extension__ struct d_print_template temps[(dpi.num_copy_templates > 0) +- ? dpi.num_copy_templates : 1]; +- +- dpi.saved_scopes = scopes; +- dpi.copy_templates = temps; +-#else +- dpi.saved_scopes = alloca (dpi.num_saved_scopes +- * sizeof (*dpi.saved_scopes)); +- dpi.copy_templates = alloca (dpi.num_copy_templates +- * sizeof (*dpi.copy_templates)); +-#endif +- ++ dpi.saved_scopes ++ = (struct d_saved_scope *) xmalloc (dpi.num_saved_scopes ++ * sizeof (*dpi.saved_scopes)); ++ dpi.copy_templates ++ = (struct d_print_template *) xmalloc (dpi.num_copy_templates ++ * sizeof (*dpi.copy_templates)); + d_print_comp (&dpi, options, dc); + } + + d_print_flush (&dpi); + +- return ! d_print_saw_error (&dpi); ++ int retval = ! d_print_saw_error (&dpi); ++ free (dpi.saved_scopes); ++ free (dpi.copy_templates); ++ return retval; + } + + /* Turn components into a human readable string. OPTIONS is the +@@ -6307,16 +6285,12 @@ d_demangle_callback (const char *mangled, int options, + } + + { +-#ifdef CP_DYNAMIC_ARRAYS +- __extension__ struct demangle_component comps[di.num_comps]; +- __extension__ struct demangle_component *subs[di.num_subs]; +- +- di.comps = comps; +- di.subs = subs; +-#else +- di.comps = alloca (di.num_comps * sizeof (*di.comps)); +- di.subs = alloca (di.num_subs * sizeof (*di.subs)); +-#endif ++ di.comps ++ = (struct demangle_component *) xmalloc (di.num_comps ++ * sizeof (*di.comps)); ++ di.subs ++ = (struct demangle_component **) xmalloc (di.num_subs ++ * sizeof (*di.subs)); + + switch (type) + { +@@ -6357,6 +6331,8 @@ d_demangle_callback (const char *mangled, int options, + : 0; + } + ++ free (di.comps); ++ free (di.subs); + return status; + } + +@@ -6588,16 +6564,12 @@ is_ctor_or_dtor (const char *mangled, + cplus_demangle_init_info (mangled, DMGL_GNU_V3, strlen (mangled), &di); + + { +-#ifdef CP_DYNAMIC_ARRAYS +- __extension__ struct demangle_component comps[di.num_comps]; +- __extension__ struct demangle_component *subs[di.num_subs]; +- +- di.comps = comps; +- di.subs = subs; +-#else +- di.comps = alloca (di.num_comps * sizeof (*di.comps)); +- di.subs = alloca (di.num_subs * sizeof (*di.subs)); +-#endif ++ di.comps ++ = (struct demangle_component *) xmalloc (di.num_comps ++ * sizeof (*di.comps)); ++ di.subs ++ = (struct demangle_component **) xmalloc (di.num_subs ++ * sizeof (*di.subs)); + + dc = cplus_demangle_mangled_name (&di, 1); + +@@ -6640,6 +6612,8 @@ is_ctor_or_dtor (const char *mangled, + } + } + ++ free (di.comps); ++ free (di.subs); + return ret; + } + +diff --git a/libiberty/make-relative-prefix.c b/libiberty/make-relative-prefix.c +index e3f9f920..5dbe6f89 100644 +--- a/libiberty/make-relative-prefix.c ++++ b/libiberty/make-relative-prefix.c +@@ -259,10 +259,7 @@ make_relative_prefix_1 (const char *progname, const char *bin_prefix, + #ifdef HAVE_HOST_EXECUTABLE_SUFFIX + len += strlen (HOST_EXECUTABLE_SUFFIX); + #endif +- if (len < MAX_ALLOCA_SIZE) +- nstore = (char *) alloca (len); +- else +- alloc_ptr = nstore = (char *) malloc (len); ++ alloc_ptr = nstore = (char *) malloc (len); + + startp = endp = temp; + while (1) diff --git a/patches/binutils/2.35/binutils.unicode.patch b/patches/binutils/2.35/binutils.unicode.patch new file mode 100644 index 00000000..cedf1b9a --- /dev/null +++ b/patches/binutils/2.35/binutils.unicode.patch @@ -0,0 +1,37455 @@ +diff -rupN binutils.orig/binutils/NEWS binutils-2.35.2/binutils/NEWS +--- binutils.orig/binutils/NEWS 2021-11-09 16:53:12.817128280 +0000 ++++ binutils-2.35.2/binutils/NEWS 2021-11-09 16:54:28.144628198 +0000 +@@ -1,5 +1,14 @@ + -*- text -*- + ++* Tools which display symbols or strings (readelf, strings, nm, objdump) ++ have a new command line option which controls how unicode characters are ++ handled. By default they are treated as normal for the tool. Using ++ --unicode=locale will display them according to the current locale. ++ Using --unicode=hex will display them as hex byte values, whilst ++ --unicode=escape will display them as escape sequences. In addition ++ using --unicode=highlight will display them as unicode escape sequences ++ highlighted in red (if supported by the output device). ++ + Changes in 2.35: + + * Changed readelf's display of symbol names when wide mode is not enabled. +diff -rupN binutils.orig/binutils/NEWS.orig binutils-2.35.2/binutils/NEWS.orig +--- binutils.orig/binutils/NEWS.orig 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/NEWS.orig 2021-11-09 16:53:39.651950098 +0000 +@@ -0,0 +1,740 @@ ++-*- text -*- ++ ++Changes in 2.35: ++ ++* Changed readelf's display of symbol names when wide mode is not enabled. ++ If the name is too long it will be truncated and the last five characters ++ replaced with "[...]". The old behaviour of displaying 5 more characters but ++ not indicating that truncation has happened can be restored by the use of the ++ -T or --silent-truncation options. ++ ++* X86 NaCl target support is removed. ++ ++* The readelf tool now has a -L or --lint or --enable-checks option which turns ++ on warning messages about possible problems with the file(s) being examined. ++ These checks include things like zero-sized sections, which are allowed by ++ the ELF standard but which nevertheless might be of concern if the user ++ was expecting them to actually contain something. ++ ++Changes in 2.34: ++ ++* Binutils now supports debuginfod, an HTTP server for distributing ++ ELF/DWARF debugging information as well as source code. When built with ++ debuginfod, readelf and objdump can automatically query debuginfod ++ servers for separate debug files when they otherwise cannot be found. ++ To build binutils with debuginfod, pass --with-debuginfod to configure. ++ This requires libdebuginfod, the debuginfod client library. debuginfod ++ is distributed with elfutils, starting with version 0.178. For more ++ information see https://sourceware.org/elfutils. ++ ++* Add --output option to the "ar" program. This option can be used to specify ++ the output directory when extracting members from an archive. ++ ++* Add --keep-section option to objcopy and strip. This option keeps the ++ specified section from being removed. ++ ++ * Add visualization of jumps inside a function by drawing an ascii character ++ graph between the address and the disassembler column. Enabled via the ++ --visualize-jumps command line option for objdump. Currently supported by ++ the x86, x86_64, and ARM targets. The output looks something like this: ++ ++ c6: | | \----------> be 00 00 00 00 mov $0x0,%esi ++ cb: | | /----> 48 8b 3d 00 00 00 00 mov 0x0(%rip),%rdi # d2 ++ d2: | | | 31 c0 xor %eax,%eax ++ d4: | | | /-- e8 00 00 00 00 callq d9 ++ d9: | | | \-> bf 02 00 00 00 mov $0x2,%edi ++ de: | +-----------|----- e8 00 00 00 00 callq e3 ++ e3: | \-----------|----> 48 89 da mov %rbx,%rdx ++ e6: | | be 00 00 00 00 mov $0x0,%esi ++ eb: | \----- eb de jmp cb ++ ed: \-------------------> 48 8b 16 mov (%rsi),%rdx ++ ++ Additional arguments to the --visualize-jumps option add colors to the ++ output. ++ ++Changes in 2.33: ++ ++* Add --source-comment[=] option to objdump which if present, ++ provides a prefix to source code lines displayed in a disassembly. ++ ++* Add --set-section-alignment = option to objcopy to allow ++ the changing of section alignments. ++ ++* Add --verilog-data-width option to objcopy for verilog targets to control ++ width of data elements in verilog hex format. ++ ++* Add support for the Armv8.1-M Mainline and M-profile Vector Extension (MVE) ++ instructions. ++ ++* The separate debug info file options of readelf (--debug-dump=links ++ and --debug-dump=follow) and objdump (--dwarf=links and ++ --dwarf=follow-links) will now display and/or follow multiple links if ++ more than one are present in a file. (This usually happens when gcc's ++ -gsplit-dwarf option is used). ++ ++ In addition objdump's --dwarf=follow-links now also affects its other ++ display options, so that for example, when combined with --syms it will ++ cause the symbol tables in any linked debug info files to also be ++ displayed. In addition when combined with --disassemble the --dwarf= ++ follow-links option will ensure that any symbol tables in the linked ++ files are read and used when disassembling code in the main file. ++ ++ * Add support for dumping types encoded in the Compact Type Format ++ to objdump and readelf. ++ ++Changes in 2.32: ++ ++* The addr2line, c++filt, nm and objdump tools now have a limit on the ++ maximum amount of recursion that is allowed whilst demangling strings. ++ The value for this limit is defined by the DEMANGLE_RECRUSE_LIMIT ++ constant declared in the include/demangle.h header file. At the time ++ of writing this constant has the value of 2048. ++ ++ The --no-recurse-limit option can be used to remove the limit, restoring ++ the behaviour of earlier versions of these tools. This may be needed in ++ order to dmangle truly complicated names, but it also leaves the tools ++ vulnerable to stack exhaustion from maliciously constructed mangled names. ++ ++* Objdump's --disassemble option can now take a parameter, specifying the ++ starting symbol for disassembly. Disassembly will continue from this ++ symbol up to the next symbol or the end of the function. ++ ++* The MIPS port now supports the Loongson 2K1000 processor which implements ++ the MIPS64r2 ISA, the Loongson-mmi ASE, Loongson-cam ASE, Loongson-ext ASE, ++ Loongson-ext2 ASE and MSA ASE instructions. Add -march=gs264e option for ++ Loongson 2K1000 processor. ++ ++* The MIPS port now supports the Loongson 3A2000/3A3000 processor which ++ implements the MIPS64r2 ISA, the Loongson-mmi ASE, Loongson-cam ASE, ++ Loongson-ext ASE and Loongson-ext2 ASE instructions. Add -march=gs464e ++ option for Loongson 3A2000/3A3000 processor. ++ ++* The MIPS port now supports the Loongson 3A1000 processor, aka Loongson3a, ++ which implements the MIPS64r2 ISA, the Loongson-mmi ASE, Loongson-cam ASE ++ and Loongson-ext ASE instructions. Add -march=gs464 option for Loongson ++ 3A1000 processor, The -march=loongson3a is an alias of -march=gs464 for ++ compatibility. ++ ++* The size tool now has a new output format '--format=GNU' or '-G'. The ++ results are displayed in a similar manor to the default berkeley layout, ++ except read-only data is counted in the data column, not the text column. ++ Additionally the total is only included once. ++ ++Changes in 2.31: ++ ++* Add support for disassembling netronome Flow Processor (NFP) firmware files. ++ ++* The AArch64 port now supports showing disassembly notes which are emitted ++ when inconsistencies are found with the instruction that may result in the ++ instruction being invalid. These can be turned on with the option -M notes ++ to objdump. ++ ++* The AArch64 port now emits warnings when a combination of an instruction and ++ a named register could be invalid. ++ ++* Added O modifier to ar to display member offsets inside an archive ++ ++Changes in 2.30: ++ ++* Add --debug-dump=links option to readelf and --dwarf=links option to objdump ++ which displays the contents of any .gnu_debuglink or .gnu_debugaltlink ++ sections. ++ ++ Add a --debug-dump=follow-links option to readelf and a --dwarf=follow-links ++ option to objdump which causes indirect links into separate debug info files ++ to be followed when dumping other DWARF sections. ++ ++Changes in 2.29: ++ ++* The MIPS port now supports microMIPS eXtended Physical Addressing (XPA) ++ instructions for assembly and disassembly. ++ ++* The MIPS port now supports the microMIPS Release 5 ISA for assembly and ++ disassembly. ++ ++* The MIPS port now supports the Imagination interAptiv MR2 processor, ++ which implements the MIPS32r3 ISA, the MIPS16e2 ASE as well as a couple ++ of implementation-specific regular MIPS and MIPS16e2 ASE instructions. ++ ++* The SPARC port now supports the SPARC M8 processor, which implements the ++ Oracle SPARC Architecture 2017. ++ ++* The MIPS port now supports the MIPS16e2 ASE for assembly and disassembly. ++ ++* Add support for ELF SHF_GNU_MBIND and PT_GNU_MBIND_XXX. ++ ++* Add support for the wasm32 ELF conversion of the WebAssembly file format. ++ ++* Add --inlines option to objdump, which extends the --line-numbers option ++ so that inlined functions will display their nesting information. ++ ++* Add --merge-notes options to objcopy to reduce the size of notes in ++ a binary file by merging and deleting redundant notes. ++ ++* Add support for locating separate debug info files using the build-id ++ method, where the separate file has a name based upon the build-id of ++ the original file. ++ ++Changes in 2.28: ++ ++* This version of binutils fixes a problem with PowerPC VLE 16A and 16D ++ relocations which were functionally swapped, for example, ++ R_PPC_VLE_HA16A performed like R_PPC_VLE_HA16D while R_PPC_VLE_HA16D ++ performed like R_PPC_VLE_HA16A. This could have been fixed by ++ renumbering relocations, which would keep object files created by an ++ older version of gas compatible with a newer ld. However, that would ++ require an ABI update, affecting other assemblers and linkers that ++ create and process the relocations correctly. It is recommended that ++ all VLE object files be recompiled, but ld can modify the relocations ++ if --vle-reloc-fixup is passed to ld. If the new ld command-line ++ option is not used, ld will ld warn on finding relocations inconsistent ++ with the instructions being relocated. ++ ++* The nm program has a new command-line option (--with-version-strings) ++ which will display a symbol's version information, if any, after the ++ symbol's name. ++ ++* The ARC port of objdump now accepts a -M option to specify the extra ++ instruction class(es) that should be disassembled. ++ ++* The --remove-section option for objcopy and strip now accepts section ++ patterns starting with an exclamation point to indicate a non-matching ++ section. A non-matching section is removed from the set of sections ++ matched by an earlier --remove-section pattern. ++ ++* The --only-section option for objcopy now accepts section patterns ++ starting with an exclamation point to indicate a non-matching section. ++ A non-matching section is removed from the set of sections matched by ++ an earlier --only-section pattern. ++ ++* New --remove-relocations=SECTIONPATTERN option for objcopy and strip. ++ This option can be used to remove sections containing relocations. ++ The SECTIONPATTERN is the section to which the relocations apply, not ++ the relocation section itself. ++ ++Changes in 2.27: ++ ++* Add a configure option, --enable-64-bit-archive, to force use of a ++ 64-bit format when creating an archive symbol index. ++ ++* Add --elf-stt-common= option to objcopy for ELF targets to control ++ whether to convert common symbols to the STT_COMMON type. ++ ++Changes in 2.26: ++ ++* Add option to objcopy to insert new symbols into a file: ++ --add-symbol =[
:][,] ++ ++* Add support for the ARC EM/HS, and ARC600/700 architectures. ++ ++* Extend objcopy --compress-debug-sections option to support ++ --compress-debug-sections=[none|zlib|zlib-gnu|zlib-gabi] for ELF ++ targets. ++ ++* Add --update-section option to objcopy. ++ ++* Add --output-separator option to strings. ++ ++Changes in 2.25: ++ ++* Add --data option to strings to only print strings in loadable, initialized ++ data sections. Change the default behaviour to be --all, but add a new ++ configure time option of --disable-default-strings-all to restore the old ++ default behaviour. ++ ++* Add --include-all-whitespace to strings. ++ ++* Add --dump-section option to objcopy. ++ ++* Add support for the Andes NDS32. ++ ++Changes in 2.24: ++ ++* Objcopy now supports wildcard characters in command-line options that take ++ section names. ++ ++* Add support for Altera Nios II. ++ ++Changes in 2.23: ++ ++* Add support for the VLE extension to the PowerPC architecture. ++ ++* Add support for x64 Windows target of the delayed-load-library. ++ ++* Add support for the Renesas RL78 architecture. ++ ++Changes in 2.22: ++ ++* Add support for displaying the contents of .debug.macro sections. ++ ++* Add --preprocessor-arg option to windres to specify additional options ++ passed to preprocessor. ++ ++* Add --dwarf-start and --dwarf-end to readelf and objdump. These are used by ++ the new Emacs mode, see dwarf-mode.el. ++ ++* Add support for the Tilera TILEPro and TILE-Gx architectures. ++ ++changes in 2.21: ++ ++* Add --interleave-width option to objcopy to allowing copying a range of ++ bytes from the input to the output with the --interleave option. ++ ++* Add support for the TMS320C6000 (TI C6X) processor family. ++ ++* Readelf can now display ARM unwind tables (.ARM.exidx / .ARM.extab) using ++ the -u / --unwind option. ++ ++* Add --dyn-syms to readelf to dump dynamic symbol table. ++ ++* A new tool - elfedit - has been added to directly manipulate ELF format ++ binaries. ++ ++* Add to dlltool .def file feature of aliasing PE internal symbol name by ++ '== ' option. ++ ++* Add a new command-line option -a / --addresses to addr2line to display the ++ address before function name or source filename. ++ ++* Add a new command-line option -p / --pretty-print to addr2line to have ++ a more human readable output. ++ ++* The hppa/som targets can now be compiled on any host. ++ ++Changes in 2.20: ++ ++* Add support for delay importing to dlltool. Use the --output-delaylib ++ switch to create a delay-import library. The resulting app will load the dll ++ as soon as the first function is called. It will link to __delayLoadHelper2() ++ from the static delayimp library, which will import LoadLibraryA and ++ GetProcAddress from kernel32. ++ ++* Add a new command-line option, --insn-width=WIDTH, to objdump to specify ++ number of bytes to be displayed on a single line when disassembling ++ instructions. ++ ++* Readelf can now display the relocated contents of a section as a sequence ++ of bytes via the --relocated-dump= command-line option. ++ ++* The gprof program has been given a new command-line option: ++ --external-symbols-table= which reads in symbols from a specified ++ file. ++ ++* The plugin target has been added to bfd. It can load the same shared objects ++ used by gold and uses them to provide basic support for new file formats. ++ ++* The verilog memory hex dump file format is now supported as an output format ++ for objcopy. ++ ++* Add --file-alignment, --heap, --image-base, --section-alignment, ++ --stack and --subsystem command-line options to objcopy, which will ++ set PE optional header. ++ ++* Option --dwarf/-W of objdump is now as flexible as readelf --debug-dump/-w. ++ ++* --as-needed now links in a dynamic library if it satisfies undefined ++ symbols in regular objects, or in other dynamic libraries. In the ++ latter case the library is not linked if it is found in a DT_NEEDED ++ entry of one of the libraries already linked. ++ ++* Added --prefix=PREFIX and --prefix-strip=LEVEL switches to objdump to ++ add absolute paths for -S. ++ ++* Add new option --use-nul-prefixed-import-tables to dlltool to allow fall- ++ back to old import table generation with null element prefix. ++ ++* Added --identify-strict switch to cause --identify to ++ report an error when the import library is associated with ++ multiple DLLs. ++ ++* Added --identify option to dlltool, which determines the ++ name of the DLL associated with the specified . ++ ++* Support for PowerPC booke64 instructions has been removed. The assembler no ++ longer accepts -mbooke32 or -mbooke64 and the disassembler no longer accepts ++ -Mbooke32 or -Mbooke64. Instead, -mbooke and -Mbooke should be used. ++ ++Changes in 2.19: ++ ++* Added -wL switch to dump decoded contents of .debug_line. ++ ++* Added support for "thin" archives which contain pathnames pointing to ++ object files rather than the files themselves and which contain a ++ flattened symbol index for all objects, and archives, which have been ++ added to the archive. ++ ++* Added -F switch to objdump to include file offsets in the disassembly. ++ ++* Added -c switch to readelf to allow string dumps of archive symbol index. ++ ++* Support for SSE5 has been added to the i386 port. ++ ++* Added -p switch to readelf to allow string dumps of sections. ++ ++Changes in 2.18: ++ ++* Resolved 37 coding problems in bfd including static array overruns, null ++ pointer dereferences and use of a malloc buffer after it has been freed, as ++ revealed by static analysis donated by Coverity, Inc. (http://scan.coverity.com). ++ ++* The binutils sources are now released under version 3 of the GNU General ++ Public License. ++ ++* A new tool "windmc" has been added for some targets. This is a message ++ compiler which attempts to be compatible with the MS version. ++ ++* Add codepage support to the windres tool. It now supports many new ++ resource types (e.g. MANIFEST, TOOLBAR, etc). The output generation ++ for binary files is done now via bfd itself. The endianess problems ++ for different hosts are solved. Dumps of .res files can now be ++ re-compiled by windres without lossing resources or compilation errors. ++ Some problems on dialog resource translations are corrected. ++ ++* Add --extract-symbol command-line option to objcopy, which will ++ strip everything out of an ordinary object file or executable except ++ for its symbol table. Files containing just symbols can be useful ++ to some OSes. ++ ++Changes in 2.17: ++ ++* Add "-x NAME" to readelf in addition to "-x NUMBER". ++ ++* Add -i and -t switches to cxxfilt. -i disables the display of implementation ++ specific extra demangling information (if any) and -t disables the demangling ++ of types. ++ ++* Add support for the "@" syntax to the command lines of all tools, so ++ that extra switches can be read from . ++ ++* Add "-W/--dwarf" to objdump to display the contents of the DWARF ++ debug sections. ++ ++* Add "-t/--section-details" to readelf to display section details. ++ "-N/--full-section-name" is deprecated. ++ ++* powerpc-linux ld now supports a variant form of PLT and GOT for the security ++ conscious. This form will automatically be chosen when ld detects that all ++ code in regular object files was generated by gcc -msecure-plt. The old PLT ++ and GOT may be forced by a new ld option, --bss-plt. ++ ++* Add "-i/--inlines" to addr2line to print enclosing scope information ++ for inlined function chains, back to first non-inlined function. ++ ++* Add "-N/--full-section-name" to readelf to display full section name. ++ ++* Add "-M entry:" switch to objdump to specify a function entry address ++ when disassembling VAX binaries. ++ ++* Add "--globalize-symbol " and "--globalize-symbols " switches ++ to objcopy to convert local symbols into global symbols. ++ ++* gprof now allows input files to have histogram records for ++ several memory ranges, provided those ranges are disjoint. ++ ++Changes in 2.16: ++ ++* Add "-g/--section-groups" to readelf to display section groups. ++ ++* objcopy recognizes two new options --strip-unneeded-symbol and ++ --strip-unneeded-symbols, namely for use together with the wildcard ++ matching the original --strip-symbol/--strip-symbols provided, but ++ retaining any symbols matching but needed by relocations. ++ ++* readelf can now display address ranges from .debug_range sections. This ++ happens automatically when a DW_AT_range attribute is encountered. The ++ command-line switch --debug-dump=Ranges (or -wR) can also be used to display ++ the contents of the .debug_range section. ++ ++* nm and objdump now have a switch "--special-syms" to enable the displaying of ++ symbols which the target considers to be special. By default these symbols ++ are no longer displayed. Currently the only special symbols are the Mapping ++ symbols used by the ARM port to mark transitions between text and data and ++ between ARM and THUMB code. ++ ++* dlltool has a switch "--ext-prefix-alias " to generate additional ++ import and export symbols with prepended to them. ++ ++Changes in 2.15: ++ ++* objcopy for MIPS targets now accepts "-M no-aliases" as an option to the ++ disassembler to print the "raw" mips instruction mnemonic instead of some ++ pseudo instruction name. I.E. print "daddu" or "or" instead of "move", ++ "sll" instead of "nop", etc. ++ ++* objcopy and strip can now take wildcard patterns in symbol names specified on ++ the command line provided that the --wildcard switch is used to enable them. ++ ++* readelf can now parse archives. ++ ++* objdump now accepts --debugging-tags to print the debug information in a ++ format compatible with ctags tool. ++ ++* objcopy and strip now accept --only-keep-debug to create a file containing ++ those sections that would be stripped out by --strip-debug. The idea is that ++ this can be used in conjunction with the --add-gnu-debuglink switch to create ++ a two part program distribution - one a stripped executable and the other the ++ debugging info. ++ ++* objcopy now accepts --add-gnu-debuglink= to insert a .gnu_debuglink ++ section into a (presumably stripped) executable. This allows the debug ++ information for the file to be held in a separate file. ++ ++* BFD marks the sections .comment and .note as 'n' in the BSD/POSIX ++ single-character representation. This can be checked by running nm ++ with the -a switch. ++ ++Changes in 2.14: ++ ++* Added --info switch to objcopy and strip. ++ ++* Support for Vitesse IQ2000 added by Red Hat. ++ ++* Added 'S' encoding to strings to allow the display of 8-bit characters. ++ ++* Added --prefix-symbols=, --prefix-sections= and ++ --prefix-alloc-sections= to objcopy. ++ ++* readelf can handle the extensions to the DWARF2 spec used by the Unified ++ Parallel C compiler. ++ ++* BFD no longer declares a "boolean" type, to avoid clashes with other ++ headers that declare the same. Users of BFD should replace boolean, ++ false and true, with int, 0 and 1, or define their own boolean type. ++ ++* Support for IP2K added by Denis Chertykov. ++ ++Changes in 2.13: ++ ++* Support for the Fujitsu FRV architecture added by Red Hat. Models for FR400 ++ and FR500 included. ++ ++Changes in version 2.12: ++ ++* Support for Don Knuth's MMIX, by Hans-Peter Nilsson. ++ ++* size: Add --totals to display summary of sizes (Berkeley format only). ++ ++* readelf: Add --wide option to not break section header or segment listing ++ lines to fit into 80 columns. ++ ++* strings: Add --encoding to display wide character strings. By Markus Kuhn. ++ ++* objcopy: Add --rename-section to change section names. ++ ++* readelf: Support added for DWARF 2.1 extensions. Support added for ++ displaying the contents of .debug.macinfo sections. ++ ++* New command-line switches added to objcopy to allow symbols to be kept as ++ global symbols, and also to specify files containing lists of such symbols. ++ by Honda Hiroki. ++ ++* Support for OpenRISC by Johan Rydberg. ++ ++* New command-line switch to objcopy --alt-machine-code which creates a binary ++ with an alternate machine code if one is defined in the architecture ++ description. Only supported for ELF targets. By Alexandre Oliva. ++ ++* New command-line switch to objcopy -B (or --binary-architecture) which sets ++ the architecture of the output file to the given argument. This option only ++ makes sense, if the input target is binary. Otherwise it is ignored. ++ By Stefan Geuken. ++ ++* Support for PDP-11 by Lars Brinkhoff. ++ ++Changes in binutils 2.11: ++ ++* Add support for ARM v5t and v5te architectures and Intel's XScale ARM ++ extenstions. ++ ++* Add --srec-len and --srec-forceS3 command-line switch to objcopy. ++ By Luciano Gemme. ++ ++* Support for the MIPS32, by Anders Norlander. ++ ++* Support for the i860, by Jason Eckhardt. ++ ++* Support for CRIS (Axis Communications ETRAX series). ++ ++Changes in binutils 2.10: ++ ++* Support for 64-bit ELF on HPPA. ++ ++* New command-line switch to objdump --file-start-context which shows the ++ entire file contents up to the source line first encountered for a given ++ file. ++ ++* New command-line switch to objdump -M (or --disassembler-options) which takes ++ a parameter which can then be interpreted on a per-target basis by the ++ disassembler. Used by ARM targets to select register name sets, ISA, APCS or ++ raw verions. ++ ++* objdump support for -mi386:intel which causes disassembly to be displayed ++ with intel syntax. ++ ++* New program: readelf. This displays the contents of ELF format files, ++ regardless of target machine. ++ ++* objcopy now takes --change-section-lma, --change-section-vma, and ++ --change-section-address options. The old --adjust-section-vma option is ++ equivalent to --change-section-address. The other --adjust-* options are now ++ renamed to --change-*, although --adjust-* continues to work. ++ ++* objcopy has a --redefine-sym option that lets you rename symbols. ++ ++* objcopy now takes a -j/--only-section option to copy only the specified ++ sections. ++ ++* dlltool now supports the IMPORTS command. ++ ++* dlltool now takes --export-all-symbols, --no-export-all-symbols, ++ --exclude-symbols, and --no-default-excludes options. ++ ++Changes in binutils 2.9: ++ ++* Added windres program, which can be used to manipulate resources in WIN32 ++ files as used on Windows 95 and Windows NT. ++ ++* The objcopy --gap-fill and --pad-to options operate on the LMA rather than ++ the VMA of the sections. ++ ++* Added S modifier to ar to not build a symbol table. ++ ++Changes in binutils 2.8: ++ ++* The objdump disassembly format has been changed, and hopefully improved. Use ++ the new --prefix-addresses option to get the old format. There are also new ++ --disassemble-zeroes and --no-show-raw-insn options which affect disassembler ++ output. ++ ++* Formats may now be specified as configuration triplets. For example, ++ objdump -b i386-pc-linux. The triplets are not passed through config.sub, ++ so they must be in canonical form. ++ ++* Added new addr2line program. This uses the debugging information to convert ++ an address into a file name and line number within a program. ++ ++* Added --change-leading-char argument to objcopy. ++ ++* Added --weaken argument to objcopy. ++ ++* objdump --dynamic-reloc now works on ELF executables and shared libraries. ++ ++* Added --adjust-vma option to objdump. ++ ++* Added -C/--demangle option to objdump. ++ ++* Added -p/--preserve-dates option to strip and objcopy. ++ ++Changes in binutils 2.7: ++ ++* Added --enable-shared and --enable-commonbfdlib options to configure. ++ ++* Added --debugging argument to objdump and objcopy. ++ ++* Added --defined-only argument to nm. ++ ++* Added --remove-leading-char argument to objcopy. ++ ++* The objdump --line-numbers option is now meaningful with --reloc. ++ ++* Added --line-numbers option to nm. ++ ++* Added --endian/-EB/-EL option to objdump. ++ ++* Added support for Alpha OpenVMS/AXP. ++ ++Changes in binutils 2.6: ++ ++* Added -N/--strip-symbol and -K/--keep-symbol arguments to strip and objcopy. ++ ++* Added several arguments to objcopy to provide some control over how the new ++ file is laid out in memory. Also added binary output format to BFD to permit ++ generating plain binary files. ++ ++* Added --start-address and --stop-address options to objdump. ++ ++* ar and ranlib now work on AIX. The tools are now built by default on AIX. ++ ++Changes in binutils 2.5: ++ ++* Changed objdump -dr to dump the relocs interspersed with the assembly ++ listing, for a more useful listing of relocatable files. ++ ++* Changed objdump -d/--disassemble to only disassemble SEC_CODE sections. ++ Added -D/--disassemble-all option to disassemble all sections. ++ ++* Added --size-sort option to nm. ++ ++* strip and objcopy should now be able to handle dynamically linked ELF ++ executables. ++ ++Changes in binutils 2.4: ++ ++* Support for HP-PA (by Jeff Law), i386 Mach (by David Mackenzie), RS/6000 and ++ PowerPC (except ar and ranlib; by Ian Taylor). ++ ++* Support for Irix 5. ++ ++* Programs `strip' and `objcopy' will not attempt to write dynamically linked ++ ELF output files, since BFD currently can't create them properly. ++ ++Changes in binutils 2.3: ++ ++* A new --stabs argument has been added to objdump to dump stabs sections in ++ ELF and COFF files. ++ ++* A new program, nlmconv, has been added. It can convert object files into ++ Novell NetWare Loadable Modules. ++ ++* The strings program has been added. ++ ++Changes in binutils 2.2: ++ ++* The 'copy' program has been renamed to 'objcopy', for consistency with ++ 'objdump', and because 'copy' might more plausibly be used as a synonym for ++ 'cp'. ++ ++* The new stand-alone program c++filt is a filter that converts encoded ++ (mangled) C++ assembly-level identifiers to user-level names. (Note: This ++ may get moved to the gcc distribution.) ++ ++* nm -o on an archive now prefixes each line with the archive name, matching ++ the output from BSD nm. ++ ++* ar (and ld) can now read (but not write) BSD4.4-style archives. ++ ++* New support for H8500, Z8000, and the Hitach SH. ++ ++* Dis-assembler interface changed to allow sharing with gdb. ++ ++* There is new Elf code, but it is not yet ready for general use. ++ ++* There is the beginnings of a test suite. ++ ++Changes in binutils 2.1: ++ ++* There is now support for writing ECOFF files, so ld and the other utilities ++ should work on Risc/Ultrix and Irix. Please let us know how well this works. ++ ++* ar now automatically creates a symbol table (a __.SYMDEF member, in the BSD ++ version), if there are any object files in the archive. So running ranlib is ++ now redundant (unless the non-standard q command is used). This is required ++ for Posix.2 conformance. ++ ++* The archive-reading code now reads both BSD-style and SYSV-style archives ++ independently of the selected target format. This is to encourage people to ++ switch to SYSV-format, which has a number of advantages. ++ ++* The strip and copy programs now have options to remove debug-symbols only ++ and/or local symbols only. They now also support long options. ++ ++ ++Copyright (C) 2012-2020 Free Software Foundation, Inc. ++ ++Copying and distribution of this file, with or without modification, ++are permitted in any medium without royalty provided the copyright ++notice and this notice are preserved. ++ ++Local variables: ++fill-column: 79 ++End: +diff -rupN binutils.orig/binutils/NEWS.rej binutils-2.35.2/binutils/NEWS.rej +--- binutils.orig/binutils/NEWS.rej 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/NEWS.rej 2021-11-09 16:53:39.651950098 +0000 +@@ -0,0 +1,17 @@ ++--- binutils/NEWS 2021-11-09 12:34:21.664802928 +0000 +++++ binutils/NEWS 2021-11-09 12:38:05.757327773 +0000 ++@@ -1,5 +1,14 @@ ++ -*- text -*- ++ +++* Tools which display symbols or strings (readelf, strings, nm, objdump) +++ have a new command line option which controls how unicode characters are +++ handled. By default they are treated as normal for the tool. Using +++ --unicode=locale will display them according to the current locale. +++ Using --unicode=hex will display them as hex byte values, whilst +++ --unicode=escape will display them as escape sequences. In addition +++ using --unicode=highlight will display them as unicode escape sequences +++ highlighted in red (if supported by the output device). +++ ++ Changes in 2.37: ++ ++ * The readelf tool has a new command line option which can be used to specify +diff -rupN binutils.orig/binutils/doc/binutils.texi binutils-2.35.2/binutils/doc/binutils.texi +--- binutils.orig/binutils/doc/binutils.texi 2021-11-09 16:53:12.818128274 +0000 ++++ binutils-2.35.2/binutils/doc/binutils.texi 2021-11-09 16:56:07.215970736 +0000 +@@ -791,6 +791,7 @@ nm [@option{-A}|@option{-o}|@option{--pr + [@option{-P}|@option{--portability}] [@option{-p}|@option{--no-sort}] + [@option{-r}|@option{--reverse-sort}] [@option{-S}|@option{--print-size}] + [@option{-s}|@option{--print-armap}] [@option{-t} @var{radix}|@option{--radix=}@var{radix}] ++ [@option{-U} @var{method}] [@option{--unicode=}@var{method}] + [@option{-u}|@option{--undefined-only}] [@option{-V}|@option{--version}] + [@option{-X 32_64}] [@option{--defined-only}] [@option{--no-demangle}] + [@option{--plugin} @var{name}] +@@ -1081,6 +1082,21 @@ Use @var{radix} as the radix for printin + @cindex undefined symbols + Display only undefined symbols (those external to each object file). + ++@item -U @var{[d|i|l|e|x|h]} ++@itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]} ++Controls the display of UTF-8 encoded mulibyte characters in strings. ++The default (@option{--unicode=default}) is to give them no special ++treatment. The @option{--unicode=locale} option displays the sequence ++in the current locale, which may or may not support them. The options ++@option{--unicode=hex} and @option{--unicode=invalid} display them as ++hex byte sequences enclosed by either angle brackets or curly braces. ++ ++The @option{--unicode=escape} option displays them as escape sequences ++(@var{\uxxxx}) and the @option{--unicode=highlight} option displays ++them as escape sequences highlighted in red (if supported by the ++output device). The colouring is intended to draw attention to the ++presence of unicode sequences where they might not be expected. ++ + @item -V + @itemx --version + Show the version number of @command{nm} and exit. +@@ -2174,6 +2190,7 @@ objdump [@option{-a}|@option{--archive-h + [@option{--prefix-strip=}@var{level}] + [@option{--insn-width=}@var{width}] + [@option{--visualize-jumps[=color|=extended-color|=off]} ++ [@option{-U} @var{method}] [@option{--unicode=}@var{method}] + [@option{-V}|@option{--version}] + [@option{-H}|@option{--help}] + @var{objfile}@dots{} +@@ -2841,6 +2858,21 @@ When displaying symbols include those wh + special in some way and which would not normally be of interest to the + user. + ++@item -U @var{[d|i|l|e|x|h]} ++@itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]} ++Controls the display of UTF-8 encoded mulibyte characters in strings. ++The default (@option{--unicode=default}) is to give them no special ++treatment. The @option{--unicode=locale} option displays the sequence ++in the current locale, which may or may not support them. The options ++@option{--unicode=hex} and @option{--unicode=invalid} display them as ++hex byte sequences enclosed by either angle brackets or curly braces. ++ ++The @option{--unicode=escape} option displays them as escape sequences ++(@var{\uxxxx}) and the @option{--unicode=highlight} option displays ++them as escape sequences highlighted in red (if supported by the ++output device). The colouring is intended to draw attention to the ++presence of unicode sequences where they might not be expected. ++ + @item -V + @itemx --version + Print the version number of @command{objdump} and exit. +@@ -3117,6 +3149,7 @@ strings [@option{-afovV}] [@option{-}@va + [@option{-n} @var{min-len}] [@option{--bytes=}@var{min-len}] + [@option{-t} @var{radix}] [@option{--radix=}@var{radix}] + [@option{-e} @var{encoding}] [@option{--encoding=}@var{encoding}] ++ [@option{-U} @var{method}] [@option{--unicode=}@var{method}] + [@option{-}] [@option{--all}] [@option{--print-file-name}] + [@option{-T} @var{bfdname}] [@option{--target=}@var{bfdname}] + [@option{-w}] [@option{--include-all-whitespace}] +@@ -3208,6 +3241,28 @@ single-8-bit-byte characters, @samp{b} = + littleendian. Useful for finding wide character strings. (@samp{l} + and @samp{b} apply to, for example, Unicode UTF-16/UCS-2 encodings). + ++@item -U @var{[d|i|l|e|x|h]} ++@itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]} ++Controls the display of UTF-8 encoded mulibyte characters in strings. ++The default (@option{--unicode=default}) is to give them no special ++treatment, and instead rely upon the setting of the ++@option{--encoding} option. The other values for this option ++automatically enable @option{--encoding=S}. ++ ++The @option{--unicode=invalid} option treats them as non-graphic ++characters and hence not part of a valid string. All the remaining ++options treat them as valid string characters. ++ ++The @option{--unicode=locale} option displays them in the current ++locale, which may or may not support UTF-8 encoding. The ++@option{--unicode=hex} option displays them as hex byte sequences ++enclosed between @var{<>} characters. The @option{--unicode=escape} ++option displays them as escape sequences (@var{\uxxxx}) and the ++@option{--unicode=highlight} option displays them as escape sequences ++highlighted in red (if supported by the output device). The colouring ++is intended to draw attention to the presence of unicode sequences ++where they might not be expected. ++ + @item -T @var{bfdname} + @itemx --target=@var{bfdname} + @cindex object code format +@@ -4725,6 +4780,7 @@ readelf [@option{-a}|@option{--all}] + [@option{-v}|@option{--version}] + [@option{-W}|@option{--wide}] + [@option{-T}|@option{--silent-truncation}] ++ [@option{-U} @var{method}|@option{--unicode=}@var{method}] + [@option{-H}|@option{--help}] + @var{elffile}@dots{} + @c man end +@@ -4815,6 +4871,28 @@ Displays the entries in dynamic symbol t + has one. The output format is the same as the format used by the + @option{--syms} option. + ++@item -U @var{[d|i|l|e|x|h]} ++@itemx --unicode=[default|invalid|locale|escape|hex|highlight] ++Controls the display of non-ASCII characters in identifier names. ++The default (@option{--unicode=locale} or @option{--unicode=default}) is ++to treat them as multibyte characters and display them in the current ++locale. All other versions of this option treat the bytes as UTF-8 ++encoded values and attempt to interpret them. If they cannot be ++interpreted or if the @option{--unicode=invalid} option is used then ++they are displayed as a sequence of hex bytes, encloses in curly ++parethesis characters. ++ ++Using the @option{--unicode=escape} option will display the characters ++as as unicode escape sequences (@var{\uxxxx}). Using the ++@option{--unicode=hex} will display the characters as hex byte ++sequences enclosed between angle brackets. ++ ++Using the @option{--unicode=highlight} will display the characters as ++unicode escape sequences but it will also highlighted them in red, ++assuming that colouring is supported by the output device. The ++colouring is intended to draw attention to the presence of unicode ++sequences when they might not be expected. ++ + @item -e + @itemx --headers + Display all the headers in the file. Equivalent to @option{-h -l -S}. +diff -rupN binutils.orig/binutils/doc/binutils.texi.orig binutils-2.35.2/binutils/doc/binutils.texi.orig +--- binutils.orig/binutils/doc/binutils.texi.orig 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/doc/binutils.texi.orig 2021-01-30 08:38:03.000000000 +0000 +@@ -0,0 +1,5480 @@ ++\input texinfo @c -*- Texinfo -*- ++@setfilename binutils.info ++@settitle @sc{gnu} Binary Utilities ++@finalout ++@synindex ky cp ++ ++@c man begin INCLUDE ++@include bfdver.texi ++@c man end ++ ++@copying ++@c man begin COPYRIGHT ++Copyright @copyright{} 1991-2020 Free Software Foundation, Inc. ++ ++Permission is granted to copy, distribute and/or modify this document ++under the terms of the GNU Free Documentation License, Version 1.3 ++or any later version published by the Free Software Foundation; ++with no Invariant Sections, with no Front-Cover Texts, and with no ++Back-Cover Texts. A copy of the license is included in the ++section entitled ``GNU Free Documentation License''. ++ ++@c man end ++@end copying ++ ++@dircategory Software development ++@direntry ++* Binutils: (binutils). The GNU binary utilities. ++@end direntry ++ ++@dircategory Individual utilities ++@direntry ++* addr2line: (binutils)addr2line. Convert addresses to file and line. ++* ar: (binutils)ar. Create, modify, and extract from archives. ++* c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols. ++* cxxfilt: (binutils)c++filt. MS-DOS name for c++filt. ++* dlltool: (binutils)dlltool. Create files needed to build and use DLLs. ++* nm: (binutils)nm. List symbols from object files. ++* objcopy: (binutils)objcopy. Copy and translate object files. ++* objdump: (binutils)objdump. Display information from object files. ++* ranlib: (binutils)ranlib. Generate index to archive contents. ++* readelf: (binutils)readelf. Display the contents of ELF format files. ++* size: (binutils)size. List section sizes and total size. ++* strings: (binutils)strings. List printable strings from files. ++* strip: (binutils)strip. Discard symbols. ++* elfedit: (binutils)elfedit. Update ELF header and property of ELF files. ++* windmc: (binutils)windmc. Generator for Windows message resources. ++* windres: (binutils)windres. Manipulate Windows resources. ++@end direntry ++ ++@titlepage ++@title The @sc{gnu} Binary Utilities ++@ifset VERSION_PACKAGE ++@subtitle @value{VERSION_PACKAGE} ++@end ifset ++@subtitle Version @value{VERSION} ++@sp 1 ++@subtitle @value{UPDATED} ++@author Roland H. Pesch ++@author Jeffrey M. Osier ++@author Cygnus Support ++@page ++ ++@tex ++{\parskip=0pt \hfill Cygnus Support\par \hfill ++Texinfo \texinfoversion\par } ++@end tex ++ ++@vskip 0pt plus 1filll ++@insertcopying ++@end titlepage ++@contents ++ ++@node Top ++@top Introduction ++ ++@cindex version ++This brief manual contains documentation for the @sc{gnu} binary ++utilities ++@ifset VERSION_PACKAGE ++@value{VERSION_PACKAGE} ++@end ifset ++version @value{VERSION}: ++ ++@iftex ++@table @code ++@item ar ++Create, modify, and extract from archives ++ ++@item nm ++List symbols from object files ++ ++@item objcopy ++Copy and translate object files ++ ++@item objdump ++Display information from object files ++ ++@item ranlib ++Generate index to archive contents ++ ++@item readelf ++Display the contents of ELF format files. ++ ++@item size ++List file section sizes and total size ++ ++@item strings ++List printable strings from files ++ ++@item strip ++Discard symbols ++ ++@item elfedit ++Update the ELF header and program property of ELF files. ++ ++@item c++filt ++Demangle encoded C++ symbols (on MS-DOS, this program is named ++@code{cxxfilt}) ++ ++@item addr2line ++Convert addresses into file names and line numbers ++ ++@item windres ++Manipulate Windows resources ++ ++@item windmc ++Generator for Windows message resources ++ ++@item dlltool ++Create the files needed to build and use Dynamic Link Libraries ++@end table ++@end iftex ++ ++This document is distributed under the terms of the GNU Free ++Documentation License version 1.3. A copy of the license is included ++in the section entitled ``GNU Free Documentation License''. ++ ++@menu ++* ar:: Create, modify, and extract from archives ++* nm:: List symbols from object files ++* objcopy:: Copy and translate object files ++* objdump:: Display information from object files ++* ranlib:: Generate index to archive contents ++* size:: List section sizes and total size ++* strings:: List printable strings from files ++* strip:: Discard symbols ++* c++filt:: Filter to demangle encoded C++ symbols ++* cxxfilt: c++filt. MS-DOS name for c++filt ++* addr2line:: Convert addresses to file and line ++* windmc:: Generator for Windows message resources ++* windres:: Manipulate Windows resources ++* dlltool:: Create files needed to build and use DLLs ++* readelf:: Display the contents of ELF format files ++* elfedit:: Update ELF header and property of ELF files ++* Common Options:: Command-line options for all utilities ++* Selecting the Target System:: How these utilities determine the target ++* debuginfod:: Using binutils with debuginfod ++* Reporting Bugs:: Reporting Bugs ++* GNU Free Documentation License:: GNU Free Documentation License ++* Binutils Index:: Binutils Index ++@end menu ++ ++@node ar ++@chapter ar ++ ++@kindex ar ++@cindex archives ++@cindex collections of files ++ ++@c man title ar create, modify, and extract from archives ++ ++@smallexample ++ar [-]@var{p}[@var{mod}] [@option{--plugin} @var{name}] [@option{--target} @var{bfdname}] [@option{--output} @var{dirname}] [@var{relpos}] [@var{count}] @var{archive} [@var{member}@dots{}] ++ar -M [ }), and continues executing even after ++errors. If you redirect standard input to a script file, no prompts are ++issued, and @command{ar} abandons execution (with a nonzero exit code) ++on any error. ++ ++The @command{ar} command language is @emph{not} designed to be equivalent ++to the command-line options; in fact, it provides somewhat less control ++over archives. The only purpose of the command language is to ease the ++transition to @sc{gnu} @command{ar} for developers who already have scripts ++written for the MRI ``librarian'' program. ++ ++The syntax for the @command{ar} command language is straightforward: ++@itemize @bullet ++@item ++commands are recognized in upper or lower case; for example, @code{LIST} ++is the same as @code{list}. In the following descriptions, commands are ++shown in upper case for clarity. ++ ++@item ++a single command may appear on each line; it is the first word on the ++line. ++ ++@item ++empty lines are allowed, and have no effect. ++ ++@item ++comments are allowed; text after either of the characters @samp{*} ++or @samp{;} is ignored. ++ ++@item ++Whenever you use a list of names as part of the argument to an @command{ar} ++command, you can separate the individual names with either commas or ++blanks. Commas are shown in the explanations below, for clarity. ++ ++@item ++@samp{+} is used as a line continuation character; if @samp{+} appears ++at the end of a line, the text on the following line is considered part ++of the current command. ++@end itemize ++ ++Here are the commands you can use in @command{ar} scripts, or when using ++@command{ar} interactively. Three of them have special significance: ++ ++@code{OPEN} or @code{CREATE} specify a @dfn{current archive}, which is ++a temporary file required for most of the other commands. ++ ++@code{SAVE} commits the changes so far specified by the script. Prior ++to @code{SAVE}, commands affect only the temporary copy of the current ++archive. ++ ++@table @code ++@item ADDLIB @var{archive} ++@itemx ADDLIB @var{archive} (@var{module}, @var{module}, @dots{} @var{module}) ++Add all the contents of @var{archive} (or, if specified, each named ++@var{module} from @var{archive}) to the current archive. ++ ++Requires prior use of @code{OPEN} or @code{CREATE}. ++ ++@item ADDMOD @var{member}, @var{member}, @dots{} @var{member} ++@c FIXME! w/Replacement?? If so, like "ar r @var{archive} @var{names}" ++@c else like "ar q..." ++Add each named @var{member} as a module in the current archive. ++ ++Requires prior use of @code{OPEN} or @code{CREATE}. ++ ++@item CLEAR ++Discard the contents of the current archive, canceling the effect of ++any operations since the last @code{SAVE}. May be executed (with no ++effect) even if no current archive is specified. ++ ++@item CREATE @var{archive} ++Creates an archive, and makes it the current archive (required for many ++other commands). The new archive is created with a temporary name; it ++is not actually saved as @var{archive} until you use @code{SAVE}. ++You can overwrite existing archives; similarly, the contents of any ++existing file named @var{archive} will not be destroyed until @code{SAVE}. ++ ++@item DELETE @var{module}, @var{module}, @dots{} @var{module} ++Delete each listed @var{module} from the current archive; equivalent to ++@samp{ar -d @var{archive} @var{module} @dots{} @var{module}}. ++ ++Requires prior use of @code{OPEN} or @code{CREATE}. ++ ++@item DIRECTORY @var{archive} (@var{module}, @dots{} @var{module}) ++@itemx DIRECTORY @var{archive} (@var{module}, @dots{} @var{module}) @var{outputfile} ++List each named @var{module} present in @var{archive}. The separate ++command @code{VERBOSE} specifies the form of the output: when verbose ++output is off, output is like that of @samp{ar -t @var{archive} ++@var{module}@dots{}}. When verbose output is on, the listing is like ++@samp{ar -tv @var{archive} @var{module}@dots{}}. ++ ++Output normally goes to the standard output stream; however, if you ++specify @var{outputfile} as a final argument, @command{ar} directs the ++output to that file. ++ ++@item END ++Exit from @command{ar}, with a @code{0} exit code to indicate successful ++completion. This command does not save the output file; if you have ++changed the current archive since the last @code{SAVE} command, those ++changes are lost. ++ ++@item EXTRACT @var{module}, @var{module}, @dots{} @var{module} ++Extract each named @var{module} from the current archive, writing them ++into the current directory as separate files. Equivalent to @samp{ar -x ++@var{archive} @var{module}@dots{}}. ++ ++Requires prior use of @code{OPEN} or @code{CREATE}. ++ ++@ignore ++@c FIXME Tokens but no commands??? ++@item FULLDIR ++ ++@item HELP ++@end ignore ++ ++@item LIST ++Display full contents of the current archive, in ``verbose'' style ++regardless of the state of @code{VERBOSE}. The effect is like @samp{ar ++tv @var{archive}}. (This single command is a @sc{gnu} @command{ar} ++enhancement, rather than present for MRI compatibility.) ++ ++Requires prior use of @code{OPEN} or @code{CREATE}. ++ ++@item OPEN @var{archive} ++Opens an existing archive for use as the current archive (required for ++many other commands). Any changes as the result of subsequent commands ++will not actually affect @var{archive} until you next use @code{SAVE}. ++ ++@item REPLACE @var{module}, @var{module}, @dots{} @var{module} ++In the current archive, replace each existing @var{module} (named in ++the @code{REPLACE} arguments) from files in the current working directory. ++To execute this command without errors, both the file, and the module in ++the current archive, must exist. ++ ++Requires prior use of @code{OPEN} or @code{CREATE}. ++ ++@item VERBOSE ++Toggle an internal flag governing the output from @code{DIRECTORY}. ++When the flag is on, @code{DIRECTORY} output matches output from ++@samp{ar -tv }@dots{}. ++ ++@item SAVE ++Commit your changes to the current archive, and actually save it as a ++file with the name specified in the last @code{CREATE} or @code{OPEN} ++command. ++ ++Requires prior use of @code{OPEN} or @code{CREATE}. ++ ++@end table ++ ++@iftex ++@node ld ++@chapter ld ++@cindex linker ++@kindex ld ++The @sc{gnu} linker @command{ld} is now described in a separate manual. ++@xref{Top,, Overview,, Using LD: the @sc{gnu} linker}. ++@end iftex ++ ++@node nm ++@chapter nm ++@cindex symbols ++@kindex nm ++ ++@c man title nm list symbols from object files ++ ++@smallexample ++@c man begin SYNOPSIS nm ++nm [@option{-A}|@option{-o}|@option{--print-file-name}] [@option{-a}|@option{--debug-syms}] ++ [@option{-B}|@option{--format=bsd}] [@option{-C}|@option{--demangle}[=@var{style}]] ++ [@option{-D}|@option{--dynamic}] [@option{-f}@var{format}|@option{--format=}@var{format}] ++ [@option{-g}|@option{--extern-only}] [@option{-h}|@option{--help}] ++ [@option{-l}|@option{--line-numbers}] [@option{--inlines}] ++ [@option{-n}|@option{-v}|@option{--numeric-sort}] ++ [@option{-P}|@option{--portability}] [@option{-p}|@option{--no-sort}] ++ [@option{-r}|@option{--reverse-sort}] [@option{-S}|@option{--print-size}] ++ [@option{-s}|@option{--print-armap}] [@option{-t} @var{radix}|@option{--radix=}@var{radix}] ++ [@option{-u}|@option{--undefined-only}] [@option{-V}|@option{--version}] ++ [@option{-X 32_64}] [@option{--defined-only}] [@option{--no-demangle}] ++ [@option{--plugin} @var{name}] ++ [@option{--no-recurse-limit}|@option{--recurse-limit}]] ++ [@option{--size-sort}] [@option{--special-syms}] ++ [@option{--synthetic}] [@option{--target=}@var{bfdname}] ++ [@var{objfile}@dots{}] ++@c man end ++@end smallexample ++ ++@c man begin DESCRIPTION nm ++@sc{gnu} @command{nm} lists the symbols from object files @var{objfile}@dots{}. ++If no object files are listed as arguments, @command{nm} assumes the file ++@file{a.out}. ++ ++For each symbol, @command{nm} shows: ++ ++@itemize @bullet ++@item ++The symbol value, in the radix selected by options (see below), or ++hexadecimal by default. ++ ++@item ++The symbol type. At least the following types are used; others are, as ++well, depending on the object file format. If lowercase, the symbol is ++usually local; if uppercase, the symbol is global (external). There ++are however a few lowercase symbols that are shown for special global ++symbols (@code{u}, @code{v} and @code{w}). ++ ++@c Some more detail on exactly what these symbol types are used for ++@c would be nice. ++@table @code ++@item A ++The symbol's value is absolute, and will not be changed by further ++linking. ++ ++@item B ++@itemx b ++The symbol is in the BSS data section. This section typically ++contains zero-initialized or uninitialized data, although the exact ++behavior is system dependent. ++ ++@item C ++The symbol is common. Common symbols are uninitialized data. When ++linking, multiple common symbols may appear with the same name. If the ++symbol is defined anywhere, the common symbols are treated as undefined ++references. ++@ifclear man ++For more details on common symbols, see the discussion of ++--warn-common in @ref{Options,,Linker options,ld.info,The GNU linker}. ++@end ifclear ++ ++@item D ++@itemx d ++The symbol is in the initialized data section. ++ ++@item G ++@itemx g ++The symbol is in an initialized data section for small objects. Some ++object file formats permit more efficient access to small data objects, ++such as a global int variable as opposed to a large global array. ++ ++@item i ++For PE format files this indicates that the symbol is in a section ++specific to the implementation of DLLs. For ELF format files this ++indicates that the symbol is an indirect function. This is a GNU ++extension to the standard set of ELF symbol types. It indicates a ++symbol which if referenced by a relocation does not evaluate to its ++address, but instead must be invoked at runtime. The runtime ++execution will then return the value to be used in the relocation. ++ ++@item I ++The symbol is an indirect reference to another symbol. ++ ++@item N ++The symbol is a debugging symbol. ++ ++@item n ++The symbol is in the read-only data section. ++ ++@item p ++The symbol is in a stack unwind section. ++ ++@item R ++@itemx r ++The symbol is in a read only data section. ++ ++@item S ++@itemx s ++The symbol is in an uninitialized or zero-initialized data section ++for small objects. ++ ++@item T ++@itemx t ++The symbol is in the text (code) section. ++ ++@item U ++The symbol is undefined. ++ ++@item u ++The symbol is a unique global symbol. This is a GNU extension to the ++standard set of ELF symbol bindings. For such a symbol the dynamic linker ++will make sure that in the entire process there is just one symbol with ++this name and type in use. ++ ++@item V ++@itemx v ++The symbol is a weak object. When a weak defined symbol is linked with ++a normal defined symbol, the normal defined symbol is used with no error. ++When a weak undefined symbol is linked and the symbol is not defined, ++the value of the weak symbol becomes zero with no error. On some ++systems, uppercase indicates that a default value has been specified. ++ ++@item W ++@itemx w ++The symbol is a weak symbol that has not been specifically tagged as a ++weak object symbol. When a weak defined symbol is linked with a normal ++defined symbol, the normal defined symbol is used with no error. ++When a weak undefined symbol is linked and the symbol is not defined, ++the value of the symbol is determined in a system-specific manner without ++error. On some systems, uppercase indicates that a default value has been ++specified. ++ ++@item - ++The symbol is a stabs symbol in an a.out object file. In this case, the ++next values printed are the stabs other field, the stabs desc field, and ++the stab type. Stabs symbols are used to hold debugging information. ++ ++@item ? ++The symbol type is unknown, or object file format specific. ++@end table ++ ++@item ++The symbol name. If a symbol has version information associated with it, ++then the version information is displayed as well. If the versioned ++symbol is undefined or hidden from linker, the version string is displayed ++as a suffix to the symbol name, preceded by an @@ character. For example ++@samp{foo@@VER_1}. If the version is the default version to be used when ++resolving unversioned references to the symbol, then it is displayed as a ++suffix preceded by two @@ characters. For example @samp{foo@@@@VER_2}. ++@end itemize ++ ++@c man end ++ ++@c man begin OPTIONS nm ++The long and short forms of options, shown here as alternatives, are ++equivalent. ++ ++@table @env ++@item -A ++@itemx -o ++@itemx --print-file-name ++@cindex input file name ++@cindex file name ++@cindex source file name ++Precede each symbol by the name of the input file (or archive member) ++in which it was found, rather than identifying the input file once only, ++before all of its symbols. ++ ++@item -a ++@itemx --debug-syms ++@cindex debugging symbols ++Display all symbols, even debugger-only symbols; normally these are not ++listed. ++ ++@item -B ++@cindex @command{nm} format ++@cindex @command{nm} compatibility ++The same as @option{--format=bsd} (for compatibility with the MIPS @command{nm}). ++ ++@item -C ++@itemx --demangle[=@var{style}] ++@cindex demangling in nm ++Decode (@dfn{demangle}) low-level symbol names into user-level names. ++Besides removing any initial underscore prepended by the system, this ++makes C++ function names readable. Different compilers have different ++mangling styles. The optional demangling style argument can be used to ++choose an appropriate demangling style for your compiler. @xref{c++filt}, ++for more information on demangling. ++ ++@item --no-demangle ++Do not demangle low-level symbol names. This is the default. ++ ++@item --recurse-limit ++@itemx --no-recurse-limit ++@itemx --recursion-limit ++@itemx --no-recursion-limit ++Enables or disables a limit on the amount of recursion performed ++whilst demangling strings. Since the name mangling formats allow for ++an inifinite level of recursion it is possible to create strings whose ++decoding will exhaust the amount of stack space available on the host ++machine, triggering a memory fault. The limit tries to prevent this ++from happening by restricting recursion to 2048 levels of nesting. ++ ++The default is for this limit to be enabled, but disabling it may be ++necessary in order to demangle truly complicated names. Note however ++that if the recursion limit is disabled then stack exhaustion is ++possible and any bug reports about such an event will be rejected. ++ ++@item -D ++@itemx --dynamic ++@cindex dynamic symbols ++Display the dynamic symbols rather than the normal symbols. This is ++only meaningful for dynamic objects, such as certain types of shared ++libraries. ++ ++@item -f @var{format} ++@itemx --format=@var{format} ++@cindex @command{nm} format ++@cindex @command{nm} compatibility ++Use the output format @var{format}, which can be @code{bsd}, ++@code{sysv}, or @code{posix}. The default is @code{bsd}. ++Only the first character of @var{format} is significant; it can be ++either upper or lower case. ++ ++@item -g ++@itemx --extern-only ++@cindex external symbols ++Display only external symbols. ++ ++@item -h ++@itemx --help ++Show a summary of the options to @command{nm} and exit. ++ ++@item -l ++@itemx --line-numbers ++@cindex symbol line numbers ++For each symbol, use debugging information to try to find a filename and ++line number. For a defined symbol, look for the line number of the ++address of the symbol. For an undefined symbol, look for the line ++number of a relocation entry which refers to the symbol. If line number ++information can be found, print it after the other symbol information. ++ ++@item --inlines ++@cindex objdump inlines ++When option @option{-l} is active, if the address belongs to a ++function that was inlined, then this option causes the source ++information for all enclosing scopes back to the first non-inlined ++function to be printed as well. For example, if @code{main} inlines ++@code{callee1} which inlines @code{callee2}, and address is from ++@code{callee2}, the source information for @code{callee1} and @code{main} ++will also be printed. ++ ++@item -n ++@itemx -v ++@itemx --numeric-sort ++Sort symbols numerically by their addresses, rather than alphabetically ++by their names. ++ ++@item -p ++@itemx --no-sort ++@cindex sorting symbols ++Do not bother to sort the symbols in any order; print them in the order ++encountered. ++ ++@item -P ++@itemx --portability ++Use the POSIX.2 standard output format instead of the default format. ++Equivalent to @samp{-f posix}. ++ ++@item -r ++@itemx --reverse-sort ++Reverse the order of the sort (whether numeric or alphabetic); let the ++last come first. ++ ++@item -S ++@itemx --print-size ++Print both value and size of defined symbols for the @code{bsd} output style. ++This option has no effect for object formats that do not record symbol ++sizes, unless @samp{--size-sort} is also used in which case a ++calculated size is displayed. ++ ++@item -s ++@itemx --print-armap ++@cindex symbol index, listing ++When listing symbols from archive members, include the index: a mapping ++(stored in the archive by @command{ar} or @command{ranlib}) of which modules ++contain definitions for which names. ++ ++@item -t @var{radix} ++@itemx --radix=@var{radix} ++Use @var{radix} as the radix for printing the symbol values. It must be ++@samp{d} for decimal, @samp{o} for octal, or @samp{x} for hexadecimal. ++ ++@item -u ++@itemx --undefined-only ++@cindex external symbols ++@cindex undefined symbols ++Display only undefined symbols (those external to each object file). ++ ++@item -V ++@itemx --version ++Show the version number of @command{nm} and exit. ++ ++@item -X ++This option is ignored for compatibility with the AIX version of ++@command{nm}. It takes one parameter which must be the string ++@option{32_64}. The default mode of AIX @command{nm} corresponds ++to @option{-X 32}, which is not supported by @sc{gnu} @command{nm}. ++ ++@item --defined-only ++@cindex external symbols ++@cindex undefined symbols ++Display only defined symbols for each object file. ++ ++@item --plugin @var{name} ++@cindex plugins ++Load the plugin called @var{name} to add support for extra target ++types. This option is only available if the toolchain has been built ++with plugin support enabled. ++ ++If @option{--plugin} is not provided, but plugin support has been ++enabled then @command{nm} iterates over the files in ++@file{$@{libdir@}/bfd-plugins} in alphabetic order and the first ++plugin that claims the object in question is used. ++ ++Please note that this plugin search directory is @emph{not} the one ++used by @command{ld}'s @option{-plugin} option. In order to make ++@command{nm} use the linker plugin it must be copied into the ++@file{$@{libdir@}/bfd-plugins} directory. For GCC based compilations ++the linker plugin is called @file{liblto_plugin.so.0.0.0}. For Clang ++based compilations it is called @file{LLVMgold.so}. The GCC plugin ++is always backwards compatible with earlier versions, so it is ++sufficient to just copy the newest one. ++ ++@item --size-sort ++Sort symbols by size. For ELF objects symbol sizes are read from the ++ELF, for other object types the symbol sizes are computed as the ++difference between the value of the symbol and the value of the symbol ++with the next higher value. If the @code{bsd} output format is used ++the size of the symbol is printed, rather than the value, and ++@samp{-S} must be used in order both size and value to be printed. ++ ++@item --special-syms ++Display symbols which have a target-specific special meaning. These ++symbols are usually used by the target for some special processing and ++are not normally helpful when included in the normal symbol lists. ++For example for ARM targets this option would skip the mapping symbols ++used to mark transitions between ARM code, THUMB code and data. ++ ++@item --synthetic ++Include synthetic symbols in the output. These are special symbols ++created by the linker for various purposes. They are not shown by ++default since they are not part of the binary's original source code. ++ ++@item --target=@var{bfdname} ++@cindex object code format ++Specify an object code format other than your system's default format. ++@xref{Target Selection}, for more information. ++ ++@end table ++ ++@c man end ++ ++@ignore ++@c man begin SEEALSO nm ++ar(1), objdump(1), ranlib(1), and the Info entries for @file{binutils}. ++@c man end ++@end ignore ++ ++@node objcopy ++@chapter objcopy ++ ++@c man title objcopy copy and translate object files ++ ++@smallexample ++@c man begin SYNOPSIS objcopy ++objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}] ++ [@option{-I} @var{bfdname}|@option{--input-target=}@var{bfdname}] ++ [@option{-O} @var{bfdname}|@option{--output-target=}@var{bfdname}] ++ [@option{-B} @var{bfdarch}|@option{--binary-architecture=}@var{bfdarch}] ++ [@option{-S}|@option{--strip-all}] ++ [@option{-g}|@option{--strip-debug}] ++ [@option{--strip-unneeded}] ++ [@option{-K} @var{symbolname}|@option{--keep-symbol=}@var{symbolname}] ++ [@option{-N} @var{symbolname}|@option{--strip-symbol=}@var{symbolname}] ++ [@option{--strip-unneeded-symbol=}@var{symbolname}] ++ [@option{-G} @var{symbolname}|@option{--keep-global-symbol=}@var{symbolname}] ++ [@option{--localize-hidden}] ++ [@option{-L} @var{symbolname}|@option{--localize-symbol=}@var{symbolname}] ++ [@option{--globalize-symbol=}@var{symbolname}] ++ [@option{--globalize-symbols=}@var{filename}] ++ [@option{-W} @var{symbolname}|@option{--weaken-symbol=}@var{symbolname}] ++ [@option{-w}|@option{--wildcard}] ++ [@option{-x}|@option{--discard-all}] ++ [@option{-X}|@option{--discard-locals}] ++ [@option{-b} @var{byte}|@option{--byte=}@var{byte}] ++ [@option{-i} [@var{breadth}]|@option{--interleave}[=@var{breadth}]] ++ [@option{--interleave-width=}@var{width}] ++ [@option{-j} @var{sectionpattern}|@option{--only-section=}@var{sectionpattern}] ++ [@option{-R} @var{sectionpattern}|@option{--remove-section=}@var{sectionpattern}] ++ [@option{--keep-section=}@var{sectionpattern}] ++ [@option{--remove-relocations=}@var{sectionpattern}] ++ [@option{-p}|@option{--preserve-dates}] ++ [@option{-D}|@option{--enable-deterministic-archives}] ++ [@option{-U}|@option{--disable-deterministic-archives}] ++ [@option{--debugging}] ++ [@option{--gap-fill=}@var{val}] ++ [@option{--pad-to=}@var{address}] ++ [@option{--set-start=}@var{val}] ++ [@option{--adjust-start=}@var{incr}] ++ [@option{--change-addresses=}@var{incr}] ++ [@option{--change-section-address} @var{sectionpattern}@{=,+,-@}@var{val}] ++ [@option{--change-section-lma} @var{sectionpattern}@{=,+,-@}@var{val}] ++ [@option{--change-section-vma} @var{sectionpattern}@{=,+,-@}@var{val}] ++ [@option{--change-warnings}] [@option{--no-change-warnings}] ++ [@option{--set-section-flags} @var{sectionpattern}=@var{flags}] ++ [@option{--set-section-alignment} @var{sectionpattern}=@var{align}] ++ [@option{--add-section} @var{sectionname}=@var{filename}] ++ [@option{--dump-section} @var{sectionname}=@var{filename}] ++ [@option{--update-section} @var{sectionname}=@var{filename}] ++ [@option{--rename-section} @var{oldname}=@var{newname}[,@var{flags}]] ++ [@option{--long-section-names} @{enable,disable,keep@}] ++ [@option{--change-leading-char}] [@option{--remove-leading-char}] ++ [@option{--reverse-bytes=}@var{num}] ++ [@option{--srec-len=}@var{ival}] [@option{--srec-forceS3}] ++ [@option{--redefine-sym} @var{old}=@var{new}] ++ [@option{--redefine-syms=}@var{filename}] ++ [@option{--weaken}] ++ [@option{--keep-symbols=}@var{filename}] ++ [@option{--strip-symbols=}@var{filename}] ++ [@option{--strip-unneeded-symbols=}@var{filename}] ++ [@option{--keep-global-symbols=}@var{filename}] ++ [@option{--localize-symbols=}@var{filename}] ++ [@option{--weaken-symbols=}@var{filename}] ++ [@option{--add-symbol} @var{name}=[@var{section}:]@var{value}[,@var{flags}]] ++ [@option{--alt-machine-code=}@var{index}] ++ [@option{--prefix-symbols=}@var{string}] ++ [@option{--prefix-sections=}@var{string}] ++ [@option{--prefix-alloc-sections=}@var{string}] ++ [@option{--add-gnu-debuglink=}@var{path-to-file}] ++ [@option{--keep-file-symbols}] ++ [@option{--only-keep-debug}] ++ [@option{--strip-dwo}] ++ [@option{--extract-dwo}] ++ [@option{--extract-symbol}] ++ [@option{--writable-text}] ++ [@option{--readonly-text}] ++ [@option{--pure}] ++ [@option{--impure}] ++ [@option{--file-alignment=}@var{num}] ++ [@option{--heap=}@var{size}] ++ [@option{--image-base=}@var{address}] ++ [@option{--section-alignment=}@var{num}] ++ [@option{--stack=}@var{size}] ++ [@option{--subsystem=}@var{which}:@var{major}.@var{minor}] ++ [@option{--compress-debug-sections}] ++ [@option{--decompress-debug-sections}] ++ [@option{--elf-stt-common=@var{val}}] ++ [@option{--merge-notes}] ++ [@option{--no-merge-notes}] ++ [@option{--verilog-data-width=@var{val}}] ++ [@option{-v}|@option{--verbose}] ++ [@option{-V}|@option{--version}] ++ [@option{--help}] [@option{--info}] ++ @var{infile} [@var{outfile}] ++@c man end ++@end smallexample ++ ++@c man begin DESCRIPTION objcopy ++The @sc{gnu} @command{objcopy} utility copies the contents of an object ++file to another. @command{objcopy} uses the @sc{gnu} @sc{bfd} Library to ++read and write the object files. It can write the destination object ++file in a format different from that of the source object file. The ++exact behavior of @command{objcopy} is controlled by command-line options. ++Note that @command{objcopy} should be able to copy a fully linked file ++between any two formats. However, copying a relocatable object file ++between any two formats may not work as expected. ++ ++@command{objcopy} creates temporary files to do its translations and ++deletes them afterward. @command{objcopy} uses @sc{bfd} to do all its ++translation work; it has access to all the formats described in @sc{bfd} ++and thus is able to recognize most formats without being told ++explicitly. @xref{BFD,,BFD,ld.info,Using LD}. ++ ++@command{objcopy} can be used to generate S-records by using an output ++target of @samp{srec} (e.g., use @samp{-O srec}). ++ ++@command{objcopy} can be used to generate a raw binary file by using an ++output target of @samp{binary} (e.g., use @option{-O binary}). When ++@command{objcopy} generates a raw binary file, it will essentially produce ++a memory dump of the contents of the input object file. All symbols and ++relocation information will be discarded. The memory dump will start at ++the load address of the lowest section copied into the output file. ++ ++When generating an S-record or a raw binary file, it may be helpful to ++use @option{-S} to remove sections containing debugging information. In ++some cases @option{-R} will be useful to remove sections which contain ++information that is not needed by the binary file. ++ ++Note---@command{objcopy} is not able to change the endianness of its input ++files. If the input format has an endianness (some formats do not), ++@command{objcopy} can only copy the inputs into file formats that have the ++same endianness or which have no endianness (e.g., @samp{srec}). ++(However, see the @option{--reverse-bytes} option.) ++ ++@c man end ++ ++@c man begin OPTIONS objcopy ++ ++@table @env ++@item @var{infile} ++@itemx @var{outfile} ++The input and output files, respectively. ++If you do not specify @var{outfile}, @command{objcopy} creates a ++temporary file and destructively renames the result with ++the name of @var{infile}. ++ ++@item -I @var{bfdname} ++@itemx --input-target=@var{bfdname} ++Consider the source file's object format to be @var{bfdname}, rather than ++attempting to deduce it. @xref{Target Selection}, for more information. ++ ++@item -O @var{bfdname} ++@itemx --output-target=@var{bfdname} ++Write the output file using the object format @var{bfdname}. ++@xref{Target Selection}, for more information. ++ ++@item -F @var{bfdname} ++@itemx --target=@var{bfdname} ++Use @var{bfdname} as the object format for both the input and the output ++file; i.e., simply transfer data from source to destination with no ++translation. @xref{Target Selection}, for more information. ++ ++@item -B @var{bfdarch} ++@itemx --binary-architecture=@var{bfdarch} ++Useful when transforming a architecture-less input file into an object file. ++In this case the output architecture can be set to @var{bfdarch}. This ++option will be ignored if the input file has a known @var{bfdarch}. You ++can access this binary data inside a program by referencing the special ++symbols that are created by the conversion process. These symbols are ++called _binary_@var{objfile}_start, _binary_@var{objfile}_end and ++_binary_@var{objfile}_size. e.g. you can transform a picture file into ++an object file and then access it in your code using these symbols. ++ ++@item -j @var{sectionpattern} ++@itemx --only-section=@var{sectionpattern} ++Copy only the indicated sections from the input file to the output file. ++This option may be given more than once. Note that using this option ++inappropriately may make the output file unusable. Wildcard ++characters are accepted in @var{sectionpattern}. ++ ++If the first character of @var{sectionpattern} is the exclamation ++point (!) then matching sections will not be copied, even if earlier ++use of @option{--only-section} on the same command line would ++otherwise copy it. For example: ++ ++@smallexample ++ --only-section=.text.* --only-section=!.text.foo ++@end smallexample ++ ++will copy all sectinos maching '.text.*' but not the section ++'.text.foo'. ++ ++@item -R @var{sectionpattern} ++@itemx --remove-section=@var{sectionpattern} ++Remove any section matching @var{sectionpattern} from the output file. ++This option may be given more than once. Note that using this option ++inappropriately may make the output file unusable. Wildcard ++characters are accepted in @var{sectionpattern}. Using both the ++@option{-j} and @option{-R} options together results in undefined ++behaviour. ++ ++If the first character of @var{sectionpattern} is the exclamation ++point (!) then matching sections will not be removed even if an ++earlier use of @option{--remove-section} on the same command line ++would otherwise remove it. For example: ++ ++@smallexample ++ --remove-section=.text.* --remove-section=!.text.foo ++@end smallexample ++ ++will remove all sections matching the pattern '.text.*', but will not ++remove the section '.text.foo'. ++ ++@item --keep-section=@var{sectionpattern} ++When removing sections from the output file, keep sections that match ++@var{sectionpattern}. ++ ++@item --remove-relocations=@var{sectionpattern} ++Remove non-dynamic relocations from the output file for any section ++matching @var{sectionpattern}. This option may be given more than ++once. Note that using this option inappropriately may make the output ++file unusable, and attempting to remove a dynamic relocation section ++such as @samp{.rela.plt} from an executable or shared library with ++@option{--remove-relocations=.plt} will not work. Wildcard characters ++are accepted in @var{sectionpattern}. ++For example: ++ ++@smallexample ++ --remove-relocations=.text.* ++@end smallexample ++ ++will remove the relocations for all sections matching the pattern ++'.text.*'. ++ ++If the first character of @var{sectionpattern} is the exclamation ++point (!) then matching sections will not have their relocation ++removed even if an earlier use of @option{--remove-relocations} on the ++same command line would otherwise cause the relocations to be removed. ++For example: ++ ++@smallexample ++ --remove-relocations=.text.* --remove-relocations=!.text.foo ++@end smallexample ++ ++will remove all relocations for sections matching the pattern ++'.text.*', but will not remove relocations for the section ++'.text.foo'. ++ ++@item -S ++@itemx --strip-all ++Do not copy relocation and symbol information from the source file. ++ ++@item -g ++@itemx --strip-debug ++Do not copy debugging symbols or sections from the source file. ++ ++@item --strip-unneeded ++Strip all symbols that are not needed for relocation processing. ++ ++@item -K @var{symbolname} ++@itemx --keep-symbol=@var{symbolname} ++When stripping symbols, keep symbol @var{symbolname} even if it would ++normally be stripped. This option may be given more than once. ++ ++@item -N @var{symbolname} ++@itemx --strip-symbol=@var{symbolname} ++Do not copy symbol @var{symbolname} from the source file. This option ++may be given more than once. ++ ++@item --strip-unneeded-symbol=@var{symbolname} ++Do not copy symbol @var{symbolname} from the source file unless it is needed ++by a relocation. This option may be given more than once. ++ ++@item -G @var{symbolname} ++@itemx --keep-global-symbol=@var{symbolname} ++Keep only symbol @var{symbolname} global. Make all other symbols local ++to the file, so that they are not visible externally. This option may ++be given more than once. Note: this option cannot be used in ++conjunction with the @option{--globalize-symbol} or ++@option{--globalize-symbols} options. ++ ++@item --localize-hidden ++In an ELF object, mark all symbols that have hidden or internal visibility ++as local. This option applies on top of symbol-specific localization options ++such as @option{-L}. ++ ++@item -L @var{symbolname} ++@itemx --localize-symbol=@var{symbolname} ++Convert a global or weak symbol called @var{symbolname} into a local ++symbol, so that it is not visible externally. This option may be ++given more than once. Note - unique symbols are not converted. ++ ++@item -W @var{symbolname} ++@itemx --weaken-symbol=@var{symbolname} ++Make symbol @var{symbolname} weak. This option may be given more than once. ++ ++@item --globalize-symbol=@var{symbolname} ++Give symbol @var{symbolname} global scoping so that it is visible ++outside of the file in which it is defined. This option may be given ++more than once. Note: this option cannot be used in conjunction with ++the @option{-G} or @option{--keep-global-symbol} options. ++ ++@item -w ++@itemx --wildcard ++Permit regular expressions in @var{symbolname}s used in other command ++line options. The question mark (?), asterisk (*), backslash (\) and ++square brackets ([]) operators can be used anywhere in the symbol ++name. If the first character of the symbol name is the exclamation ++point (!) then the sense of the switch is reversed for that symbol. ++For example: ++ ++@smallexample ++ -w -W !foo -W fo* ++@end smallexample ++ ++would cause objcopy to weaken all symbols that start with ``fo'' ++except for the symbol ``foo''. ++ ++@item -x ++@itemx --discard-all ++Do not copy non-global symbols from the source file. ++@c FIXME any reason to prefer "non-global" to "local" here? ++ ++@item -X ++@itemx --discard-locals ++Do not copy compiler-generated local symbols. ++(These usually start with @samp{L} or @samp{.}.) ++ ++@item -b @var{byte} ++@itemx --byte=@var{byte} ++If interleaving has been enabled via the @option{--interleave} option ++then start the range of bytes to keep at the @var{byte}th byte. ++@var{byte} can be in the range from 0 to @var{breadth}-1, where ++@var{breadth} is the value given by the @option{--interleave} option. ++ ++@item -i [@var{breadth}] ++@itemx --interleave[=@var{breadth}] ++Only copy a range out of every @var{breadth} bytes. (Header data is ++not affected). Select which byte in the range begins the copy with ++the @option{--byte} option. Select the width of the range with the ++@option{--interleave-width} option. ++ ++This option is useful for creating files to program @sc{rom}. It is ++typically used with an @code{srec} output target. Note that ++@command{objcopy} will complain if you do not specify the ++@option{--byte} option as well. ++ ++The default interleave breadth is 4, so with @option{--byte} set to 0, ++@command{objcopy} would copy the first byte out of every four bytes ++from the input to the output. ++ ++@item --interleave-width=@var{width} ++When used with the @option{--interleave} option, copy @var{width} ++bytes at a time. The start of the range of bytes to be copied is set ++by the @option{--byte} option, and the extent of the range is set with ++the @option{--interleave} option. ++ ++The default value for this option is 1. The value of @var{width} plus ++the @var{byte} value set by the @option{--byte} option must not exceed ++the interleave breadth set by the @option{--interleave} option. ++ ++This option can be used to create images for two 16-bit flashes interleaved ++in a 32-bit bus by passing @option{-b 0 -i 4 --interleave-width=2} ++and @option{-b 2 -i 4 --interleave-width=2} to two @command{objcopy} ++commands. If the input was '12345678' then the outputs would be ++'1256' and '3478' respectively. ++ ++@item -p ++@itemx --preserve-dates ++Set the access and modification dates of the output file to be the same ++as those of the input file. ++ ++@item -D ++@itemx --enable-deterministic-archives ++@cindex deterministic archives ++@kindex --enable-deterministic-archives ++Operate in @emph{deterministic} mode. When copying archive members ++and writing the archive index, use zero for UIDs, GIDs, timestamps, ++and use consistent file modes for all files. ++ ++If @file{binutils} was configured with ++@option{--enable-deterministic-archives}, then this mode is on by default. ++It can be disabled with the @samp{-U} option, below. ++ ++@item -U ++@itemx --disable-deterministic-archives ++@cindex deterministic archives ++@kindex --enable-deterministic-archives ++Do @emph{not} operate in @emph{deterministic} mode. This is the ++inverse of the @option{-D} option, above: when copying archive members ++and writing the archive index, use their actual UID, GID, timestamp, ++and file mode values. ++ ++This is the default unless @file{binutils} was configured with ++@option{--enable-deterministic-archives}. ++ ++@item --debugging ++Convert debugging information, if possible. This is not the default ++because only certain debugging formats are supported, and the ++conversion process can be time consuming. ++ ++@item --gap-fill @var{val} ++Fill gaps between sections with @var{val}. This operation applies to ++the @emph{load address} (LMA) of the sections. It is done by increasing ++the size of the section with the lower address, and filling in the extra ++space created with @var{val}. ++ ++@item --pad-to @var{address} ++Pad the output file up to the load address @var{address}. This is ++done by increasing the size of the last section. The extra space is ++filled in with the value specified by @option{--gap-fill} (default zero). ++ ++@item --set-start @var{val} ++Set the start address (also known as the entry address) of the new ++file to @var{val}. Not all object file formats support setting the ++start address. ++ ++@item --change-start @var{incr} ++@itemx --adjust-start @var{incr} ++@cindex changing start address ++Change the start address (also known as the entry address) by adding ++@var{incr}. Not all object file formats support setting the start ++address. ++ ++@item --change-addresses @var{incr} ++@itemx --adjust-vma @var{incr} ++@cindex changing object addresses ++Change the VMA and LMA addresses of all sections, as well as the start ++address, by adding @var{incr}. Some object file formats do not permit ++section addresses to be changed arbitrarily. Note that this does not ++relocate the sections; if the program expects sections to be loaded at a ++certain address, and this option is used to change the sections such ++that they are loaded at a different address, the program may fail. ++ ++@item --change-section-address @var{sectionpattern}@{=,+,-@}@var{val} ++@itemx --adjust-section-vma @var{sectionpattern}@{=,+,-@}@var{val} ++@cindex changing section address ++Set or change both the VMA address and the LMA address of any section ++matching @var{sectionpattern}. If @samp{=} is used, the section ++address is set to @var{val}. Otherwise, @var{val} is added to or ++subtracted from the section address. See the comments under ++@option{--change-addresses}, above. If @var{sectionpattern} does not ++match any sections in the input file, a warning will be issued, unless ++@option{--no-change-warnings} is used. ++ ++@item --change-section-lma @var{sectionpattern}@{=,+,-@}@var{val} ++@cindex changing section LMA ++Set or change the LMA address of any sections matching ++@var{sectionpattern}. The LMA address is the address where the ++section will be loaded into memory at program load time. Normally ++this is the same as the VMA address, which is the address of the ++section at program run time, but on some systems, especially those ++where a program is held in ROM, the two can be different. If @samp{=} ++is used, the section address is set to @var{val}. Otherwise, ++@var{val} is added to or subtracted from the section address. See the ++comments under @option{--change-addresses}, above. If ++@var{sectionpattern} does not match any sections in the input file, a ++warning will be issued, unless @option{--no-change-warnings} is used. ++ ++@item --change-section-vma @var{sectionpattern}@{=,+,-@}@var{val} ++@cindex changing section VMA ++Set or change the VMA address of any section matching ++@var{sectionpattern}. The VMA address is the address where the ++section will be located once the program has started executing. ++Normally this is the same as the LMA address, which is the address ++where the section will be loaded into memory, but on some systems, ++especially those where a program is held in ROM, the two can be ++different. If @samp{=} is used, the section address is set to ++@var{val}. Otherwise, @var{val} is added to or subtracted from the ++section address. See the comments under @option{--change-addresses}, ++above. If @var{sectionpattern} does not match any sections in the ++input file, a warning will be issued, unless ++@option{--no-change-warnings} is used. ++ ++@item --change-warnings ++@itemx --adjust-warnings ++If @option{--change-section-address} or @option{--change-section-lma} or ++@option{--change-section-vma} is used, and the section pattern does not ++match any sections, issue a warning. This is the default. ++ ++@item --no-change-warnings ++@itemx --no-adjust-warnings ++Do not issue a warning if @option{--change-section-address} or ++@option{--adjust-section-lma} or @option{--adjust-section-vma} is used, even ++if the section pattern does not match any sections. ++ ++@item --set-section-flags @var{sectionpattern}=@var{flags} ++Set the flags for any sections matching @var{sectionpattern}. The ++@var{flags} argument is a comma separated string of flag names. The ++recognized names are @samp{alloc}, @samp{contents}, @samp{load}, ++@samp{noload}, @samp{readonly}, @samp{code}, @samp{data}, @samp{rom}, ++@samp{exclude}, @samp{share}, and @samp{debug}. You can set the ++@samp{contents} flag for a section which does not have contents, but it ++is not meaningful to clear the @samp{contents} flag of a section which ++does have contents--just remove the section instead. Not all flags are ++meaningful for all object file formats. In particular the ++@samp{share} flag is only meaningful for COFF format files and not for ++ELF format files. ++ ++@item --set-section-alignment @var{sectionpattern}=@var{align} ++Set the alignment for any sections matching @var{sectionpattern}. ++@var{align} specifies the alignment in bytes and must be a power of ++two, i.e. 1, 2, 4, 8@dots{}. ++ ++@item --add-section @var{sectionname}=@var{filename} ++Add a new section named @var{sectionname} while copying the file. The ++contents of the new section are taken from the file @var{filename}. The ++size of the section will be the size of the file. This option only ++works on file formats which can support sections with arbitrary names. ++Note - it may be necessary to use the @option{--set-section-flags} ++option to set the attributes of the newly created section. ++ ++@item --dump-section @var{sectionname}=@var{filename} ++Place the contents of section named @var{sectionname} into the file ++@var{filename}, overwriting any contents that may have been there ++previously. This option is the inverse of @option{--add-section}. ++This option is similar to the @option{--only-section} option except ++that it does not create a formatted file, it just dumps the contents ++as raw binary data, without applying any relocations. The option can ++be specified more than once. ++ ++@item --update-section @var{sectionname}=@var{filename} ++Replace the existing contents of a section named @var{sectionname} ++with the contents of file @var{filename}. The size of the section ++will be adjusted to the size of the file. The section flags for ++@var{sectionname} will be unchanged. For ELF format files the section ++to segment mapping will also remain unchanged, something which is not ++possible using @option{--remove-section} followed by ++@option{--add-section}. The option can be specified more than once. ++ ++Note - it is possible to use @option{--rename-section} and ++@option{--update-section} to both update and rename a section from one ++command line. In this case, pass the original section name to ++@option{--update-section}, and the original and new section names to ++@option{--rename-section}. ++ ++@item --add-symbol @var{name}=[@var{section}:]@var{value}[,@var{flags}] ++Add a new symbol named @var{name} while copying the file. This option may be ++specified multiple times. If the @var{section} is given, the symbol will be ++associated with and relative to that section, otherwise it will be an ABS ++symbol. Specifying an undefined section will result in a fatal error. There ++is no check for the value, it will be taken as specified. Symbol flags can ++be specified and not all flags will be meaningful for all object file ++formats. By default, the symbol will be global. The special flag ++'before=@var{othersym}' will insert the new symbol in front of the specified ++@var{othersym}, otherwise the symbol(s) will be added at the end of the ++symbol table in the order they appear. ++ ++@item --rename-section @var{oldname}=@var{newname}[,@var{flags}] ++Rename a section from @var{oldname} to @var{newname}, optionally ++changing the section's flags to @var{flags} in the process. This has ++the advantage over using a linker script to perform the rename in that ++the output stays as an object file and does not become a linked ++executable. This option accepts the same set of flags as the ++@option{--sect-section-flags} option. ++ ++This option is particularly helpful when the input format is binary, ++since this will always create a section called .data. If for example, ++you wanted instead to create a section called .rodata containing binary ++data you could use the following command line to achieve it: ++ ++@smallexample ++ objcopy -I binary -O -B \ ++ --rename-section .data=.rodata,alloc,load,readonly,data,contents \ ++ ++@end smallexample ++ ++@item --long-section-names @{enable,disable,keep@} ++Controls the handling of long section names when processing @code{COFF} ++and @code{PE-COFF} object formats. The default behaviour, @samp{keep}, ++is to preserve long section names if any are present in the input file. ++The @samp{enable} and @samp{disable} options forcibly enable or disable ++the use of long section names in the output object; when @samp{disable} ++is in effect, any long section names in the input object will be truncated. ++The @samp{enable} option will only emit long section names if any are ++present in the inputs; this is mostly the same as @samp{keep}, but it ++is left undefined whether the @samp{enable} option might force the ++creation of an empty string table in the output file. ++ ++@item --change-leading-char ++Some object file formats use special characters at the start of ++symbols. The most common such character is underscore, which compilers ++often add before every symbol. This option tells @command{objcopy} to ++change the leading character of every symbol when it converts between ++object file formats. If the object file formats use the same leading ++character, this option has no effect. Otherwise, it will add a ++character, or remove a character, or change a character, as ++appropriate. ++ ++@item --remove-leading-char ++If the first character of a global symbol is a special symbol leading ++character used by the object file format, remove the character. The ++most common symbol leading character is underscore. This option will ++remove a leading underscore from all global symbols. This can be useful ++if you want to link together objects of different file formats with ++different conventions for symbol names. This is different from ++@option{--change-leading-char} because it always changes the symbol name ++when appropriate, regardless of the object file format of the output ++file. ++ ++@item --reverse-bytes=@var{num} ++Reverse the bytes in a section with output contents. A section length must ++be evenly divisible by the value given in order for the swap to be able to ++take place. Reversing takes place before the interleaving is performed. ++ ++This option is used typically in generating ROM images for problematic ++target systems. For example, on some target boards, the 32-bit words ++fetched from 8-bit ROMs are re-assembled in little-endian byte order ++regardless of the CPU byte order. Depending on the programming model, the ++endianness of the ROM may need to be modified. ++ ++Consider a simple file with a section containing the following eight ++bytes: @code{12345678}. ++ ++Using @samp{--reverse-bytes=2} for the above example, the bytes in the ++output file would be ordered @code{21436587}. ++ ++Using @samp{--reverse-bytes=4} for the above example, the bytes in the ++output file would be ordered @code{43218765}. ++ ++By using @samp{--reverse-bytes=2} for the above example, followed by ++@samp{--reverse-bytes=4} on the output file, the bytes in the second ++output file would be ordered @code{34127856}. ++ ++@item --srec-len=@var{ival} ++Meaningful only for srec output. Set the maximum length of the Srecords ++being produced to @var{ival}. This length covers both address, data and ++crc fields. ++ ++@item --srec-forceS3 ++Meaningful only for srec output. Avoid generation of S1/S2 records, ++creating S3-only record format. ++ ++@item --redefine-sym @var{old}=@var{new} ++Change the name of a symbol @var{old}, to @var{new}. This can be useful ++when one is trying link two things together for which you have no ++source, and there are name collisions. ++ ++@item --redefine-syms=@var{filename} ++Apply @option{--redefine-sym} to each symbol pair "@var{old} @var{new}" ++listed in the file @var{filename}. @var{filename} is simply a flat file, ++with one symbol pair per line. Line comments may be introduced by the hash ++character. This option may be given more than once. ++ ++@item --weaken ++Change all global symbols in the file to be weak. This can be useful ++when building an object which will be linked against other objects using ++the @option{-R} option to the linker. This option is only effective when ++using an object file format which supports weak symbols. ++ ++@item --keep-symbols=@var{filename} ++Apply @option{--keep-symbol} option to each symbol listed in the file ++@var{filename}. @var{filename} is simply a flat file, with one symbol ++name per line. Line comments may be introduced by the hash character. ++This option may be given more than once. ++ ++@item --strip-symbols=@var{filename} ++Apply @option{--strip-symbol} option to each symbol listed in the file ++@var{filename}. @var{filename} is simply a flat file, with one symbol ++name per line. Line comments may be introduced by the hash character. ++This option may be given more than once. ++ ++@item --strip-unneeded-symbols=@var{filename} ++Apply @option{--strip-unneeded-symbol} option to each symbol listed in ++the file @var{filename}. @var{filename} is simply a flat file, with one ++symbol name per line. Line comments may be introduced by the hash ++character. This option may be given more than once. ++ ++@item --keep-global-symbols=@var{filename} ++Apply @option{--keep-global-symbol} option to each symbol listed in the ++file @var{filename}. @var{filename} is simply a flat file, with one ++symbol name per line. Line comments may be introduced by the hash ++character. This option may be given more than once. ++ ++@item --localize-symbols=@var{filename} ++Apply @option{--localize-symbol} option to each symbol listed in the file ++@var{filename}. @var{filename} is simply a flat file, with one symbol ++name per line. Line comments may be introduced by the hash character. ++This option may be given more than once. ++ ++@item --globalize-symbols=@var{filename} ++Apply @option{--globalize-symbol} option to each symbol listed in the file ++@var{filename}. @var{filename} is simply a flat file, with one symbol ++name per line. Line comments may be introduced by the hash character. ++This option may be given more than once. Note: this option cannot be ++used in conjunction with the @option{-G} or @option{--keep-global-symbol} ++options. ++ ++@item --weaken-symbols=@var{filename} ++Apply @option{--weaken-symbol} option to each symbol listed in the file ++@var{filename}. @var{filename} is simply a flat file, with one symbol ++name per line. Line comments may be introduced by the hash character. ++This option may be given more than once. ++ ++@item --alt-machine-code=@var{index} ++If the output architecture has alternate machine codes, use the ++@var{index}th code instead of the default one. This is useful in case ++a machine is assigned an official code and the tool-chain adopts the ++new code, but other applications still depend on the original code ++being used. For ELF based architectures if the @var{index} ++alternative does not exist then the value is treated as an absolute ++number to be stored in the e_machine field of the ELF header. ++ ++@item --writable-text ++Mark the output text as writable. This option isn't meaningful for all ++object file formats. ++ ++@item --readonly-text ++Make the output text write protected. This option isn't meaningful for all ++object file formats. ++ ++@item --pure ++Mark the output file as demand paged. This option isn't meaningful for all ++object file formats. ++ ++@item --impure ++Mark the output file as impure. This option isn't meaningful for all ++object file formats. ++ ++@item --prefix-symbols=@var{string} ++Prefix all symbols in the output file with @var{string}. ++ ++@item --prefix-sections=@var{string} ++Prefix all section names in the output file with @var{string}. ++ ++@item --prefix-alloc-sections=@var{string} ++Prefix all the names of all allocated sections in the output file with ++@var{string}. ++ ++@item --add-gnu-debuglink=@var{path-to-file} ++Creates a .gnu_debuglink section which contains a reference to ++@var{path-to-file} and adds it to the output file. Note: the file at ++@var{path-to-file} must exist. Part of the process of adding the ++.gnu_debuglink section involves embedding a checksum of the contents ++of the debug info file into the section. ++ ++If the debug info file is built in one location but it is going to be ++installed at a later time into a different location then do not use ++the path to the installed location. The @option{--add-gnu-debuglink} ++option will fail because the installed file does not exist yet. ++Instead put the debug info file in the current directory and use the ++@option{--add-gnu-debuglink} option without any directory components, ++like this: ++ ++@smallexample ++ objcopy --add-gnu-debuglink=foo.debug ++@end smallexample ++ ++At debug time the debugger will attempt to look for the separate debug ++info file in a set of known locations. The exact set of these ++locations varies depending upon the distribution being used, but it ++typically includes: ++ ++@table @code ++ ++@item * The same directory as the executable. ++ ++@item * A sub-directory of the directory containing the executable ++called .debug ++ ++@item * A global debug directory such as /usr/lib/debug. ++@end table ++ ++As long as the debug info file has been installed into one of these ++locations before the debugger is run everything should work ++correctly. ++ ++@item --keep-file-symbols ++When stripping a file, perhaps with @option{--strip-debug} or ++@option{--strip-unneeded}, retain any symbols specifying source file names, ++which would otherwise get stripped. ++ ++@item --only-keep-debug ++Strip a file, removing contents of any sections that would not be ++stripped by @option{--strip-debug} and leaving the debugging sections ++intact. In ELF files, this preserves all note sections in the output. ++ ++Note - the section headers of the stripped sections are preserved, ++including their sizes, but the contents of the section are discarded. ++The section headers are preserved so that other tools can match up the ++debuginfo file with the real executable, even if that executable has ++been relocated to a different address space. ++ ++The intention is that this option will be used in conjunction with ++@option{--add-gnu-debuglink} to create a two part executable. One a ++stripped binary which will occupy less space in RAM and in a ++distribution and the second a debugging information file which is only ++needed if debugging abilities are required. The suggested procedure ++to create these files is as follows: ++ ++@enumerate ++@item Link the executable as normal. Assuming that it is called ++@code{foo} then... ++@item Run @code{objcopy --only-keep-debug foo foo.dbg} to ++create a file containing the debugging info. ++@item Run @code{objcopy --strip-debug foo} to create a ++stripped executable. ++@item Run @code{objcopy --add-gnu-debuglink=foo.dbg foo} ++to add a link to the debugging info into the stripped executable. ++@end enumerate ++ ++Note---the choice of @code{.dbg} as an extension for the debug info ++file is arbitrary. Also the @code{--only-keep-debug} step is ++optional. You could instead do this: ++ ++@enumerate ++@item Link the executable as normal. ++@item Copy @code{foo} to @code{foo.full} ++@item Run @code{objcopy --strip-debug foo} ++@item Run @code{objcopy --add-gnu-debuglink=foo.full foo} ++@end enumerate ++ ++i.e., the file pointed to by the @option{--add-gnu-debuglink} can be the ++full executable. It does not have to be a file created by the ++@option{--only-keep-debug} switch. ++ ++Note---this switch is only intended for use on fully linked files. It ++does not make sense to use it on object files where the debugging ++information may be incomplete. Besides the gnu_debuglink feature ++currently only supports the presence of one filename containing ++debugging information, not multiple filenames on a one-per-object-file ++basis. ++ ++@item --strip-dwo ++Remove the contents of all DWARF .dwo sections, leaving the ++remaining debugging sections and all symbols intact. ++This option is intended for use by the compiler as part of ++the @option{-gsplit-dwarf} option, which splits debug information ++between the .o file and a separate .dwo file. The compiler ++generates all debug information in the same file, then uses ++the @option{--extract-dwo} option to copy the .dwo sections to ++the .dwo file, then the @option{--strip-dwo} option to remove ++those sections from the original .o file. ++ ++@item --extract-dwo ++Extract the contents of all DWARF .dwo sections. See the ++@option{--strip-dwo} option for more information. ++ ++@item --file-alignment @var{num} ++Specify the file alignment. Sections in the file will always begin at ++file offsets which are multiples of this number. This defaults to ++512. ++[This option is specific to PE targets.] ++ ++@item --heap @var{reserve} ++@itemx --heap @var{reserve},@var{commit} ++Specify the number of bytes of memory to reserve (and optionally commit) ++to be used as heap for this program. ++[This option is specific to PE targets.] ++ ++@item --image-base @var{value} ++Use @var{value} as the base address of your program or dll. This is ++the lowest memory location that will be used when your program or dll ++is loaded. To reduce the need to relocate and improve performance of ++your dlls, each should have a unique base address and not overlap any ++other dlls. The default is 0x400000 for executables, and 0x10000000 ++for dlls. ++[This option is specific to PE targets.] ++ ++@item --section-alignment @var{num} ++Sets the section alignment field in the PE header. Sections in memory ++will always begin at addresses which are a multiple of this number. ++Defaults to 0x1000. ++[This option is specific to PE targets.] ++ ++@item --stack @var{reserve} ++@itemx --stack @var{reserve},@var{commit} ++Specify the number of bytes of memory to reserve (and optionally commit) ++to be used as stack for this program. ++[This option is specific to PE targets.] ++ ++@item --subsystem @var{which} ++@itemx --subsystem @var{which}:@var{major} ++@itemx --subsystem @var{which}:@var{major}.@var{minor} ++Specifies the subsystem under which your program will execute. The ++legal values for @var{which} are @code{native}, @code{windows}, ++@code{console}, @code{posix}, @code{efi-app}, @code{efi-bsd}, ++@code{efi-rtd}, @code{sal-rtd}, and @code{xbox}. You may optionally set ++the subsystem version also. Numeric values are also accepted for ++@var{which}. ++[This option is specific to PE targets.] ++ ++@item --extract-symbol ++Keep the file's section flags and symbols but remove all section data. ++Specifically, the option: ++ ++@itemize ++@item removes the contents of all sections; ++@item sets the size of every section to zero; and ++@item sets the file's start address to zero. ++@end itemize ++ ++This option is used to build a @file{.sym} file for a VxWorks kernel. ++It can also be a useful way of reducing the size of a @option{--just-symbols} ++linker input file. ++ ++@item --compress-debug-sections ++Compress DWARF debug sections using zlib with SHF_COMPRESSED from the ++ELF ABI. Note - if compression would actually make a section ++@emph{larger}, then it is not compressed. ++ ++@item --compress-debug-sections=none ++@itemx --compress-debug-sections=zlib ++@itemx --compress-debug-sections=zlib-gnu ++@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{--decompress-debug-sections}. ++@option{--compress-debug-sections=zlib} and ++@option{--compress-debug-sections=zlib-gabi} are equivalent to ++@option{--compress-debug-sections}. ++@option{--compress-debug-sections=zlib-gnu} compresses DWARF debug ++sections using zlib. The debug sections are renamed to begin with ++@samp{.zdebug} instead of @samp{.debug}. Note - if compression would ++actually make a section @emph{larger}, then it is not compressed nor ++renamed. ++ ++@item --decompress-debug-sections ++Decompress DWARF debug sections using zlib. The original section ++names of the compressed sections are restored. ++ ++@item --elf-stt-common=yes ++@itemx --elf-stt-common=no ++For ELF files, these options control whether common symbols should be ++converted to the @code{STT_COMMON} or @code{STT_OBJECT} type. ++@option{--elf-stt-common=yes} converts common symbol type to ++@code{STT_COMMON}. @option{--elf-stt-common=no} converts common symbol ++type to @code{STT_OBJECT}. ++ ++@item --merge-notes ++@itemx --no-merge-notes ++For ELF files, attempt (or do not attempt) to reduce the size of any ++SHT_NOTE type sections by removing duplicate notes. ++ ++@item -V ++@itemx --version ++Show the version number of @command{objcopy}. ++ ++@item --verilog-data-width=@var{bytes} ++For Verilog output, this options controls the number of bytes ++converted for each output data element. The input target controls the ++endianness of the conversion. ++ ++@item -v ++@itemx --verbose ++Verbose output: list all object files modified. In the case of ++archives, @samp{objcopy -V} lists all members of the archive. ++ ++@item --help ++Show a summary of the options to @command{objcopy}. ++ ++@item --info ++Display a list showing all architectures and object formats available. ++@end table ++ ++@c man end ++ ++@ignore ++@c man begin SEEALSO objcopy ++ld(1), objdump(1), and the Info entries for @file{binutils}. ++@c man end ++@end ignore ++ ++@node objdump ++@chapter objdump ++ ++@cindex object file information ++@kindex objdump ++ ++@c man title objdump display information from object files ++ ++@smallexample ++@c man begin SYNOPSIS objdump ++objdump [@option{-a}|@option{--archive-headers}] ++ [@option{-b} @var{bfdname}|@option{--target=@var{bfdname}}] ++ [@option{-C}|@option{--demangle}[=@var{style}] ] ++ [@option{-d}|@option{--disassemble}[=@var{symbol}]] ++ [@option{-D}|@option{--disassemble-all}] ++ [@option{-z}|@option{--disassemble-zeroes}] ++ [@option{-EB}|@option{-EL}|@option{--endian=}@{big | little @}] ++ [@option{-f}|@option{--file-headers}] ++ [@option{-F}|@option{--file-offsets}] ++ [@option{--file-start-context}] ++ [@option{-g}|@option{--debugging}] ++ [@option{-e}|@option{--debugging-tags}] ++ [@option{-h}|@option{--section-headers}|@option{--headers}] ++ [@option{-i}|@option{--info}] ++ [@option{-j} @var{section}|@option{--section=}@var{section}] ++ [@option{-l}|@option{--line-numbers}] ++ [@option{-S}|@option{--source}] ++ [@option{--source-comment}[=@var{text}]] ++ [@option{-m} @var{machine}|@option{--architecture=}@var{machine}] ++ [@option{-M} @var{options}|@option{--disassembler-options=}@var{options}] ++ [@option{-p}|@option{--private-headers}] ++ [@option{-P} @var{options}|@option{--private=}@var{options}] ++ [@option{-r}|@option{--reloc}] ++ [@option{-R}|@option{--dynamic-reloc}] ++ [@option{-s}|@option{--full-contents}] ++ [@option{-W[lLiaprmfFsoORtUuTgAckK]}| ++ @option{--dwarf}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow-links]] ++ [@option{--ctf=}@var{section}] ++ [@option{-G}|@option{--stabs}] ++ [@option{-t}|@option{--syms}] ++ [@option{-T}|@option{--dynamic-syms}] ++ [@option{-x}|@option{--all-headers}] ++ [@option{-w}|@option{--wide}] ++ [@option{--start-address=}@var{address}] ++ [@option{--stop-address=}@var{address}] ++ [@option{--no-addresses}] ++ [@option{--prefix-addresses}] ++ [@option{--[no-]show-raw-insn}] ++ [@option{--adjust-vma=}@var{offset}] ++ [@option{--dwarf-depth=@var{n}}] ++ [@option{--dwarf-start=@var{n}}] ++ [@option{--ctf-parent=}@var{section}] ++ [@option{--no-recurse-limit}|@option{--recurse-limit}] ++ [@option{--special-syms}] ++ [@option{--prefix=}@var{prefix}] ++ [@option{--prefix-strip=}@var{level}] ++ [@option{--insn-width=}@var{width}] ++ [@option{--visualize-jumps[=color|=extended-color|=off]} ++ [@option{-V}|@option{--version}] ++ [@option{-H}|@option{--help}] ++ @var{objfile}@dots{} ++@c man end ++@end smallexample ++ ++@c man begin DESCRIPTION objdump ++ ++@command{objdump} displays information about one or more object files. ++The options control what particular information to display. This ++information is mostly useful to programmers who are working on the ++compilation tools, as opposed to programmers who just want their ++program to compile and work. ++ ++@var{objfile}@dots{} are the object files to be examined. When you ++specify archives, @command{objdump} shows information on each of the member ++object files. ++ ++@c man end ++ ++@c man begin OPTIONS objdump ++ ++The long and short forms of options, shown here as alternatives, are ++equivalent. At least one option from the list ++@option{-a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-P,-r,-R,-s,-S,-t,-T,-V,-x} must be given. ++ ++@table @env ++@item -a ++@itemx --archive-header ++@cindex archive headers ++If any of the @var{objfile} files are archives, display the archive ++header information (in a format similar to @samp{ls -l}). Besides the ++information you could list with @samp{ar tv}, @samp{objdump -a} shows ++the object file format of each archive member. ++ ++@item --adjust-vma=@var{offset} ++@cindex section addresses in objdump ++@cindex VMA in objdump ++When dumping information, first add @var{offset} to all the section ++addresses. This is useful if the section addresses do not correspond to ++the symbol table, which can happen when putting sections at particular ++addresses when using a format which can not represent section addresses, ++such as a.out. ++ ++@item -b @var{bfdname} ++@itemx --target=@var{bfdname} ++@cindex object code format ++Specify that the object-code format for the object files is ++@var{bfdname}. This option may not be necessary; @var{objdump} can ++automatically recognize many formats. ++ ++For example, ++@example ++objdump -b oasys -m vax -h fu.o ++@end example ++@noindent ++displays summary information from the section headers (@option{-h}) of ++@file{fu.o}, which is explicitly identified (@option{-m}) as a VAX object ++file in the format produced by Oasys compilers. You can list the ++formats available with the @option{-i} option. ++@xref{Target Selection}, for more information. ++ ++@item -C ++@itemx --demangle[=@var{style}] ++@cindex demangling in objdump ++Decode (@dfn{demangle}) low-level symbol names into user-level names. ++Besides removing any initial underscore prepended by the system, this ++makes C++ function names readable. Different compilers have different ++mangling styles. The optional demangling style argument can be used to ++choose an appropriate demangling style for your compiler. @xref{c++filt}, ++for more information on demangling. ++ ++@item --recurse-limit ++@itemx --no-recurse-limit ++@itemx --recursion-limit ++@itemx --no-recursion-limit ++Enables or disables a limit on the amount of recursion performed ++whilst demangling strings. Since the name mangling formats allow for ++an inifinite level of recursion it is possible to create strings whose ++decoding will exhaust the amount of stack space available on the host ++machine, triggering a memory fault. The limit tries to prevent this ++from happening by restricting recursion to 2048 levels of nesting. ++ ++The default is for this limit to be enabled, but disabling it may be ++necessary in order to demangle truly complicated names. Note however ++that if the recursion limit is disabled then stack exhaustion is ++possible and any bug reports about such an event will be rejected. ++ ++@item -g ++@itemx --debugging ++Display debugging information. This attempts to parse STABS ++debugging format information stored in the file and print it out using ++a C like syntax. If no STABS debugging was found this option ++falls back on the @option{-W} option to print any DWARF information in ++the file. ++ ++@item -e ++@itemx --debugging-tags ++Like @option{-g}, but the information is generated in a format compatible ++with ctags tool. ++ ++@item -d ++@itemx --disassemble ++@itemx --disassemble=@var{symbol} ++@cindex disassembling object code ++@cindex machine instructions ++Display the assembler mnemonics for the machine instructions from the ++input file. This option only disassembles those sections which are ++expected to contain instructions. If the optional @var{symbol} ++argument is given, then display the assembler mnemonics starting at ++@var{symbol}. If @var{symbol} is a function name then disassembly ++will stop at the end of the function, otherwise it will stop when the ++next symbol is encountered. If there are no matches for @var{symbol} ++then nothing will be displayed. ++ ++Note if the @option{--dwarf=follow-links} option has also been enabled ++then any symbol tables in linked debug info files will be read in and ++used when disassembling. ++ ++@item -D ++@itemx --disassemble-all ++Like @option{-d}, but disassemble the contents of all sections, not just ++those expected to contain instructions. ++ ++This option also has a subtle effect on the disassembly of ++instructions in code sections. When option @option{-d} is in effect ++objdump will assume that any symbols present in a code section occur ++on the boundary between instructions and it will refuse to disassemble ++across such a boundary. When option @option{-D} is in effect however ++this assumption is supressed. This means that it is possible for the ++output of @option{-d} and @option{-D} to differ if, for example, data ++is stored in code sections. ++ ++If the target is an ARM architecture this switch also has the effect ++of forcing the disassembler to decode pieces of data found in code ++sections as if they were instructions. ++ ++Note if the @option{--dwarf=follow-links} option has also been enabled ++then any symbol tables in linked debug info files will be read in and ++used when disassembling. ++ ++@item --no-addresses ++When disassembling, don't print addresses on each line or for symbols ++and relocation offsets. In combination with @option{--no-show-raw-insn} ++this may be useful for comparing compiler output. ++ ++@item --prefix-addresses ++When disassembling, print the complete address on each line. This is ++the older disassembly format. ++ ++@item -EB ++@itemx -EL ++@itemx --endian=@{big|little@} ++@cindex endianness ++@cindex disassembly endianness ++Specify the endianness of the object files. This only affects ++disassembly. This can be useful when disassembling a file format which ++does not describe endianness information, such as S-records. ++ ++@item -f ++@itemx --file-headers ++@cindex object file header ++Display summary information from the overall header of ++each of the @var{objfile} files. ++ ++@item -F ++@itemx --file-offsets ++@cindex object file offsets ++When disassembling sections, whenever a symbol is displayed, also ++display the file offset of the region of data that is about to be ++dumped. If zeroes are being skipped, then when disassembly resumes, ++tell the user how many zeroes were skipped and the file offset of the ++location from where the disassembly resumes. When dumping sections, ++display the file offset of the location from where the dump starts. ++ ++@item --file-start-context ++@cindex source code context ++Specify that when displaying interlisted source code/disassembly ++(assumes @option{-S}) from a file that has not yet been displayed, extend the ++context to the start of the file. ++ ++@item -h ++@itemx --section-headers ++@itemx --headers ++@cindex section headers ++Display summary information from the section headers of the ++object file. ++ ++File segments may be relocated to nonstandard addresses, for example by ++using the @option{-Ttext}, @option{-Tdata}, or @option{-Tbss} options to ++@command{ld}. However, some object file formats, such as a.out, do not ++store the starting address of the file segments. In those situations, ++although @command{ld} relocates the sections correctly, using @samp{objdump ++-h} to list the file section headers cannot show the correct addresses. ++Instead, it shows the usual addresses, which are implicit for the ++target. ++ ++Note, in some cases it is possible for a section to have both the ++READONLY and the NOREAD attributes set. In such cases the NOREAD ++attribute takes precedence, but @command{objdump} will report both ++since the exact setting of the flag bits might be important. ++ ++@item -H ++@itemx --help ++Print a summary of the options to @command{objdump} and exit. ++ ++@item -i ++@itemx --info ++@cindex architectures available ++@cindex object formats available ++Display a list showing all architectures and object formats available ++for specification with @option{-b} or @option{-m}. ++ ++@item -j @var{name} ++@itemx --section=@var{name} ++@cindex section information ++Display information only for section @var{name}. ++ ++@item -l ++@itemx --line-numbers ++@cindex source filenames for object files ++Label the display (using debugging information) with the filename and ++source line numbers corresponding to the object code or relocs shown. ++Only useful with @option{-d}, @option{-D}, or @option{-r}. ++ ++@item -m @var{machine} ++@itemx --architecture=@var{machine} ++@cindex architecture ++@cindex disassembly architecture ++Specify the architecture to use when disassembling object files. This ++can be useful when disassembling object files which do not describe ++architecture information, such as S-records. You can list the available ++architectures with the @option{-i} option. ++ ++If the target is an ARM architecture then this switch has an ++additional effect. It restricts the disassembly to only those ++instructions supported by the architecture specified by @var{machine}. ++If it is necessary to use this switch because the input file does not ++contain any architecture information, but it is also desired to ++disassemble all the instructions use @option{-marm}. ++ ++@item -M @var{options} ++@itemx --disassembler-options=@var{options} ++Pass target specific information to the disassembler. Only supported on ++some targets. If it is necessary to specify more than one ++disassembler option then multiple @option{-M} options can be used or ++can be placed together into a comma separated list. ++ ++For ARC, @option{dsp} controls the printing of DSP instructions, ++@option{spfp} selects the printing of FPX single precision FP ++instructions, @option{dpfp} selects the printing of FPX double ++precision FP instructions, @option{quarkse_em} selects the printing of ++special QuarkSE-EM instructions, @option{fpuda} selects the printing ++of double precision assist instructions, @option{fpus} selects the ++printing of FPU single precision FP instructions, while @option{fpud} ++selects the printing of FPU double precision FP instructions. ++Additionally, one can choose to have all the immediates printed in ++hexadecimal using @option{hex}. By default, the short immediates are ++printed using the decimal representation, while the long immediate ++values are printed as hexadecimal. ++ ++@option{cpu=...} allows to enforce a particular ISA when disassembling ++instructions, overriding the @option{-m} value or whatever is in the ELF file. ++This might be useful to select ARC EM or HS ISA, because architecture is same ++for those and disassembler relies on private ELF header data to decide if code ++is for EM or HS. This option might be specified multiple times - only the ++latest value will be used. Valid values are same as for the assembler ++@option{-mcpu=...} option. ++ ++If the target is an ARM architecture then this switch can be used to ++select which register name set is used during disassembler. Specifying ++@option{-M reg-names-std} (the default) will select the register names as ++used in ARM's instruction set documentation, but with register 13 called ++'sp', register 14 called 'lr' and register 15 called 'pc'. Specifying ++@option{-M reg-names-apcs} will select the name set used by the ARM ++Procedure Call Standard, whilst specifying @option{-M reg-names-raw} will ++just use @samp{r} followed by the register number. ++ ++There are also two variants on the APCS register naming scheme enabled ++by @option{-M reg-names-atpcs} and @option{-M reg-names-special-atpcs} which ++use the ARM/Thumb Procedure Call Standard naming conventions. (Either ++with the normal register names or the special register names). ++ ++This option can also be used for ARM architectures to force the ++disassembler to interpret all instructions as Thumb instructions by ++using the switch @option{--disassembler-options=force-thumb}. This can be ++useful when attempting to disassemble thumb code produced by other ++compilers. ++ ++For AArch64 targets this switch can be used to set whether instructions are ++disassembled as the most general instruction using the @option{-M no-aliases} ++option or whether instruction notes should be generated as comments in the ++disasssembly using @option{-M notes}. ++ ++For the x86, some of the options duplicate functions of the @option{-m} ++switch, but allow finer grained control. ++@table @code ++@item x86-64 ++@itemx i386 ++@itemx i8086 ++Select disassembly for the given architecture. ++ ++@item intel ++@itemx att ++Select between intel syntax mode and AT&T syntax mode. ++ ++@item amd64 ++@itemx intel64 ++Select between AMD64 ISA and Intel64 ISA. ++ ++@item intel-mnemonic ++@itemx att-mnemonic ++Select between intel mnemonic mode and AT&T mnemonic mode. ++Note: @code{intel-mnemonic} implies @code{intel} and ++@code{att-mnemonic} implies @code{att}. ++ ++@item addr64 ++@itemx addr32 ++@itemx addr16 ++@itemx data32 ++@itemx data16 ++Specify the default address size and operand size. These five options ++will be overridden if @code{x86-64}, @code{i386} or @code{i8086} ++appear later in the option string. ++ ++@item suffix ++When in AT&T mode and also for a limited set of instructions when in Intel ++mode, instructs the disassembler to print a mnemonic suffix even when the ++suffix could be inferred by the operands or, for certain instructions, the ++execution mode's defaults. ++@end table ++ ++For PowerPC, the @option{-M} argument @option{raw} selects ++disasssembly of hardware insns rather than aliases. For example, you ++will see @code{rlwinm} rather than @code{clrlwi}, and @code{addi} ++rather than @code{li}. All of the @option{-m} arguments for ++@command{gas} that select a CPU are supported. These are: ++@option{403}, @option{405}, @option{440}, @option{464}, @option{476}, ++@option{601}, @option{603}, @option{604}, @option{620}, @option{7400}, ++@option{7410}, @option{7450}, @option{7455}, @option{750cl}, ++@option{821}, @option{850}, @option{860}, @option{a2}, @option{booke}, ++@option{booke32}, @option{cell}, @option{com}, @option{e200z4}, ++@option{e300}, @option{e500}, @option{e500mc}, @option{e500mc64}, ++@option{e500x2}, @option{e5500}, @option{e6500}, @option{efs}, ++@option{power4}, @option{power5}, @option{power6}, @option{power7}, ++@option{power8}, @option{power9}, @option{power10}, @option{ppc}, ++@option{ppc32}, @option{ppc64}, @option{ppc64bridge}, @option{ppcps}, ++@option{pwr}, @option{pwr2}, @option{pwr4}, @option{pwr5}, @option{pwr5x}, ++@option{pwr6}, @option{pwr7}, @option{pwr8}, @option{pwr9}, @option{pwr10}, ++@option{pwrx}, @option{titan}, and @option{vle}. ++@option{32} and @option{64} modify the default or a prior CPU ++selection, disabling and enabling 64-bit insns respectively. In ++addition, @option{altivec}, @option{any}, @option{htm}, @option{vsx}, ++and @option{spe} add capabilities to a previous @emph{or later} CPU ++selection. @option{any} will disassemble any opcode known to ++binutils, but in cases where an opcode has two different meanings or ++different arguments, you may not see the disassembly you expect. ++If you disassemble without giving a CPU selection, a default will be ++chosen from information gleaned by BFD from the object files headers, ++but the result again may not be as you expect. ++ ++For MIPS, this option controls the printing of instruction mnemonic ++names and register names in disassembled instructions. Multiple ++selections from the following may be specified as a comma separated ++string, and invalid options are ignored: ++ ++@table @code ++@item no-aliases ++Print the 'raw' instruction mnemonic instead of some pseudo ++instruction mnemonic. I.e., print 'daddu' or 'or' instead of 'move', ++'sll' instead of 'nop', etc. ++ ++@item msa ++Disassemble MSA instructions. ++ ++@item virt ++Disassemble the virtualization ASE instructions. ++ ++@item xpa ++Disassemble the eXtended Physical Address (XPA) ASE instructions. ++ ++@item gpr-names=@var{ABI} ++Print GPR (general-purpose register) names as appropriate ++for the specified ABI. By default, GPR names are selected according to ++the ABI of the binary being disassembled. ++ ++@item fpr-names=@var{ABI} ++Print FPR (floating-point register) names as ++appropriate for the specified ABI. By default, FPR numbers are printed ++rather than names. ++ ++@item cp0-names=@var{ARCH} ++Print CP0 (system control coprocessor; coprocessor 0) register names ++as appropriate for the CPU or architecture specified by ++@var{ARCH}. By default, CP0 register names are selected according to ++the architecture and CPU of the binary being disassembled. ++ ++@item hwr-names=@var{ARCH} ++Print HWR (hardware register, used by the @code{rdhwr} instruction) names ++as appropriate for the CPU or architecture specified by ++@var{ARCH}. By default, HWR names are selected according to ++the architecture and CPU of the binary being disassembled. ++ ++@item reg-names=@var{ABI} ++Print GPR and FPR names as appropriate for the selected ABI. ++ ++@item reg-names=@var{ARCH} ++Print CPU-specific register names (CP0 register and HWR names) ++as appropriate for the selected CPU or architecture. ++@end table ++ ++For any of the options listed above, @var{ABI} or ++@var{ARCH} may be specified as @samp{numeric} to have numbers printed ++rather than names, for the selected types of registers. ++You can list the available values of @var{ABI} and @var{ARCH} using ++the @option{--help} option. ++ ++For VAX, you can specify function entry addresses with @option{-M ++entry:0xf00ba}. You can use this multiple times to properly ++disassemble VAX binary files that don't contain symbol tables (like ++ROM dumps). In these cases, the function entry mask would otherwise ++be decoded as VAX instructions, which would probably lead the rest ++of the function being wrongly disassembled. ++ ++@item -p ++@itemx --private-headers ++Print information that is specific to the object file format. The exact ++information printed depends upon the object file format. For some ++object file formats, no additional information is printed. ++ ++@item -P @var{options} ++@itemx --private=@var{options} ++Print information that is specific to the object file format. The ++argument @var{options} is a comma separated list that depends on the ++format (the lists of options is displayed with the help). ++ ++For XCOFF, the available options are: ++@table @code ++@item header ++@item aout ++@item sections ++@item syms ++@item relocs ++@item lineno, ++@item loader ++@item except ++@item typchk ++@item traceback ++@item toc ++@item ldinfo ++@end table ++ ++Not all object formats support this option. In particular the ELF ++format does not use it. ++ ++@item -r ++@itemx --reloc ++@cindex relocation entries, in object file ++Print the relocation entries of the file. If used with @option{-d} or ++@option{-D}, the relocations are printed interspersed with the ++disassembly. ++ ++@item -R ++@itemx --dynamic-reloc ++@cindex dynamic relocation entries, in object file ++Print the dynamic relocation entries of the file. This is only ++meaningful for dynamic objects, such as certain types of shared ++libraries. As for @option{-r}, if used with @option{-d} or ++@option{-D}, the relocations are printed interspersed with the ++disassembly. ++ ++@item -s ++@itemx --full-contents ++@cindex sections, full contents ++@cindex object file sections ++Display the full contents of any sections requested. By default all ++non-empty sections are displayed. ++ ++@item -S ++@itemx --source ++@cindex source disassembly ++@cindex disassembly, with source ++Display source code intermixed with disassembly, if possible. Implies ++@option{-d}. ++ ++@item --source-comment[=@var{txt}] ++@cindex source disassembly ++@cindex disassembly, with source ++Like the @option{-S} option, but all source code lines are displayed ++with a prefix of @var{txt}. Typically @var{txt} will be a comment ++string which can be used to distinguish the assembler code from the ++source code. If @var{txt} is not provided then a default string of ++@var{``# ``} (hash followed by a space), will be used. ++ ++@item --prefix=@var{prefix} ++@cindex Add prefix to absolute paths ++Specify @var{prefix} to add to the absolute paths when used with ++@option{-S}. ++ ++@item --prefix-strip=@var{level} ++@cindex Strip absolute paths ++Indicate how many initial directory names to strip off the hardwired ++absolute paths. It has no effect without @option{--prefix=}@var{prefix}. ++ ++@item --show-raw-insn ++When disassembling instructions, print the instruction in hex as well as ++in symbolic form. This is the default except when ++@option{--prefix-addresses} is used. ++ ++@item --no-show-raw-insn ++When disassembling instructions, do not print the instruction bytes. ++This is the default when @option{--prefix-addresses} is used. ++ ++@item --insn-width=@var{width} ++@cindex Instruction width ++Display @var{width} bytes on a single line when disassembling ++instructions. ++ ++@item --visualize-jumps[=color|=extended-color|=off] ++Visualize jumps that stay inside a function by drawing ASCII art between ++the start and target addresses. The optional @option{=color} argument ++adds color to the output using simple terminal colors. Alternatively ++the @option{=extended-color} argument will add color using 8bit ++colors, but these might not work on all terminals. ++ ++If it is necessary to disable the @option{visualize-jumps} option ++after it has previously been enabled then use ++@option{visualize-jumps=off}. ++ ++@item -W[lLiaprmfFsoORtUuTgAckK] ++@itemx --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow-links] ++@include debug.options.texi ++ ++@item --dwarf-check ++Enable additional checks for consistency of Dwarf information. ++ ++@include ctf.options.texi ++ ++@item -G ++@itemx --stabs ++@cindex stab ++@cindex .stab ++@cindex debug symbols ++@cindex ELF object file format ++Display the full contents of any sections requested. Display the ++contents of the .stab and .stab.index and .stab.excl sections from an ++ELF file. This is only useful on systems (such as Solaris 2.0) in which ++@code{.stab} debugging symbol-table entries are carried in an ELF ++section. In most other file formats, debugging symbol-table entries are ++interleaved with linkage symbols, and are visible in the @option{--syms} ++output. ++ ++@item --start-address=@var{address} ++@cindex start-address ++Start displaying data at the specified address. This affects the output ++of the @option{-d}, @option{-r} and @option{-s} options. ++ ++@item --stop-address=@var{address} ++@cindex stop-address ++Stop displaying data at the specified address. This affects the output ++of the @option{-d}, @option{-r} and @option{-s} options. ++ ++@item -t ++@itemx --syms ++@cindex symbol table entries, printing ++Print the symbol table entries of the file. ++This is similar to the information provided by the @samp{nm} program, ++although the display format is different. The format of the output ++depends upon the format of the file being dumped, but there are two main ++types. One looks like this: ++ ++@smallexample ++[ 4](sec 3)(fl 0x00)(ty 0)(scl 3) (nx 1) 0x00000000 .bss ++[ 6](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 fred ++@end smallexample ++ ++where the number inside the square brackets is the number of the entry ++in the symbol table, the @var{sec} number is the section number, the ++@var{fl} value are the symbol's flag bits, the @var{ty} number is the ++symbol's type, the @var{scl} number is the symbol's storage class and ++the @var{nx} value is the number of auxilary entries associated with ++the symbol. The last two fields are the symbol's value and its name. ++ ++The other common output format, usually seen with ELF based files, ++looks like this: ++ ++@smallexample ++00000000 l d .bss 00000000 .bss ++00000000 g .text 00000000 fred ++@end smallexample ++ ++Here the first number is the symbol's value (sometimes refered to as ++its address). The next field is actually a set of characters and ++spaces indicating the flag bits that are set on the symbol. These ++characters are described below. Next is the section with which the ++symbol is associated or @emph{*ABS*} if the section is absolute (ie ++not connected with any section), or @emph{*UND*} if the section is ++referenced in the file being dumped, but not defined there. ++ ++After the section name comes another field, a number, which for common ++symbols is the alignment and for other symbol is the size. Finally ++the symbol's name is displayed. ++ ++The flag characters are divided into 7 groups as follows: ++@table @code ++@item l ++@itemx g ++@itemx u ++@itemx ! ++The symbol is a local (l), global (g), unique global (u), neither ++global nor local (a space) or both global and local (!). A ++symbol can be neither local or global for a variety of reasons, e.g., ++because it is used for debugging, but it is probably an indication of ++a bug if it is ever both local and global. Unique global symbols are ++a GNU extension to the standard set of ELF symbol bindings. For such ++a symbol the dynamic linker will make sure that in the entire process ++there is just one symbol with this name and type in use. ++ ++@item w ++The symbol is weak (w) or strong (a space). ++ ++@item C ++The symbol denotes a constructor (C) or an ordinary symbol (a space). ++ ++@item W ++The symbol is a warning (W) or a normal symbol (a space). A warning ++symbol's name is a message to be displayed if the symbol following the ++warning symbol is ever referenced. ++ ++@item I ++@item i ++The symbol is an indirect reference to another symbol (I), a function ++to be evaluated during reloc processing (i) or a normal symbol (a ++space). ++ ++@item d ++@itemx D ++The symbol is a debugging symbol (d) or a dynamic symbol (D) or a ++normal symbol (a space). ++ ++@item F ++@item f ++@item O ++The symbol is the name of a function (F) or a file (f) or an object ++(O) or just a normal symbol (a space). ++@end table ++ ++@item -T ++@itemx --dynamic-syms ++@cindex dynamic symbol table entries, printing ++Print the dynamic symbol table entries of the file. This is only ++meaningful for dynamic objects, such as certain types of shared ++libraries. This is similar to the information provided by the @samp{nm} ++program when given the @option{-D} (@option{--dynamic}) option. ++ ++The output format is similar to that produced by the @option{--syms} ++option, except that an extra field is inserted before the symbol's ++name, giving the version information associated with the symbol. ++If the version is the default version to be used when resolving ++unversioned references to the symbol then it's displayed as is, ++otherwise it's put into parentheses. ++ ++@item --special-syms ++When displaying symbols include those which the target considers to be ++special in some way and which would not normally be of interest to the ++user. ++ ++@item -V ++@itemx --version ++Print the version number of @command{objdump} and exit. ++ ++@item -x ++@itemx --all-headers ++@cindex all header information, object file ++@cindex header information, all ++Display all available header information, including the symbol table and ++relocation entries. Using @option{-x} is equivalent to specifying all of ++@option{-a -f -h -p -r -t}. ++ ++@item -w ++@itemx --wide ++@cindex wide output, printing ++Format some lines for output devices that have more than 80 columns. ++Also do not truncate symbol names when they are displayed. ++ ++@item -z ++@itemx --disassemble-zeroes ++Normally the disassembly output will skip blocks of zeroes. This ++option directs the disassembler to disassemble those blocks, just like ++any other data. ++@end table ++ ++@c man end ++ ++@ignore ++@c man begin SEEALSO objdump ++nm(1), readelf(1), and the Info entries for @file{binutils}. ++@c man end ++@end ignore ++ ++@node ranlib ++@chapter ranlib ++ ++@kindex ranlib ++@cindex archive contents ++@cindex symbol index ++ ++@c man title ranlib generate an index to an archive ++ ++@smallexample ++@c man begin SYNOPSIS ranlib ++ranlib [@option{--plugin} @var{name}] [@option{-DhHvVt}] @var{archive} ++@c man end ++@end smallexample ++ ++@c man begin DESCRIPTION ranlib ++ ++@command{ranlib} generates an index to the contents of an archive and ++stores it in the archive. The index lists each symbol defined by a ++member of an archive that is a relocatable object file. ++ ++You may use @samp{nm -s} or @samp{nm --print-armap} to list this index. ++ ++An archive with such an index speeds up linking to the library and ++allows routines in the library to call each other without regard to ++their placement in the archive. ++ ++The @sc{gnu} @command{ranlib} program is another form of @sc{gnu} @command{ar}; running ++@command{ranlib} is completely equivalent to executing @samp{ar -s}. ++@xref{ar}. ++ ++@c man end ++ ++@c man begin OPTIONS ranlib ++ ++@table @env ++@item -h ++@itemx -H ++@itemx --help ++Show usage information for @command{ranlib}. ++ ++@item -v ++@itemx -V ++@itemx --version ++Show the version number of @command{ranlib}. ++ ++@item -D ++@cindex deterministic archives ++@kindex --enable-deterministic-archives ++Operate in @emph{deterministic} mode. The symbol map archive member's ++header will show zero for the UID, GID, and timestamp. When this ++option is used, multiple runs will produce identical output files. ++ ++If @file{binutils} was configured with ++@option{--enable-deterministic-archives}, then this mode is on by ++default. It can be disabled with the @samp{-U} option, described ++below. ++ ++@item -t ++Update the timestamp of the symbol map of an archive. ++ ++@item -U ++@cindex deterministic archives ++@kindex --enable-deterministic-archives ++Do @emph{not} operate in @emph{deterministic} mode. This is the ++inverse of the @samp{-D} option, above: the archive index will get ++actual UID, GID, timestamp, and file mode values. ++ ++If @file{binutils} was configured @emph{without} ++@option{--enable-deterministic-archives}, then this mode is on by ++default. ++ ++@end table ++ ++@c man end ++ ++@ignore ++@c man begin SEEALSO ranlib ++ar(1), nm(1), and the Info entries for @file{binutils}. ++@c man end ++@end ignore ++ ++@node size ++@chapter size ++ ++@kindex size ++@cindex section sizes ++ ++@c man title size list section sizes and total size of binary files ++ ++@smallexample ++@c man begin SYNOPSIS size ++size [@option{-A}|@option{-B}|@option{-G}|@option{--format=}@var{compatibility}] ++ [@option{--help}] ++ [@option{-d}|@option{-o}|@option{-x}|@option{--radix=}@var{number}] ++ [@option{--common}] ++ [@option{-t}|@option{--totals}] ++ [@option{--target=}@var{bfdname}] [@option{-V}|@option{--version}] ++ [@var{objfile}@dots{}] ++@c man end ++@end smallexample ++ ++@c man begin DESCRIPTION size ++ ++The @sc{gnu} @command{size} utility lists the section sizes and the total ++size for each of the binary files @var{objfile} on its argument list. ++By default, one line of output is generated for each file or each ++module if the file is an archive. ++ ++@var{objfile}@dots{} are the files to be examined. If none are ++specified, the file @code{a.out} will be used instead. ++ ++@c man end ++ ++@c man begin OPTIONS size ++ ++The command-line options have the following meanings: ++ ++@table @env ++@item -A ++@itemx -B ++@itemx -G ++@itemx --format=@var{compatibility} ++@cindex @command{size} display format ++Using one of these options, you can choose whether the output from @sc{gnu} ++@command{size} resembles output from System V @command{size} (using @option{-A}, ++or @option{--format=sysv}), or Berkeley @command{size} (using @option{-B}, or ++@option{--format=berkeley}). The default is the one-line format similar to ++Berkeley's. Alternatively, you can choose the GNU format output ++(using @option{-G}, or @option{--format=gnu}), this is similar to ++Berkeley's output format, but sizes are counted differently. ++@c Bonus for doc-source readers: you can also say --format=strange (or ++@c anything else that starts with 's') for sysv, and --format=boring (or ++@c anything else that starts with 'b') for Berkeley. ++ ++Here is an example of the Berkeley (default) format of output from ++@command{size}: ++@smallexample ++$ size --format=Berkeley ranlib size ++ text data bss dec hex filename ++ 294880 81920 11592 388392 5ed28 ranlib ++ 294880 81920 11888 388688 5ee50 size ++@end smallexample ++ ++The Berkeley style output counts read only data in the @code{text} ++column, not in the @code{data} column, the @code{dec} and @code{hex} ++columns both display the sum of the @code{text}, @code{data}, and ++@code{bss} columns in decimal and hexadecimal respectively. ++ ++The GNU format counts read only data in the @code{data} column, not ++the @code{text} column, and only displays the sum of the @code{text}, ++@code{data}, and @code{bss} columns once, in the @code{total} column. ++The @option{--radix} option can be used to change the number base for ++all columns. Here is the same data displayed with GNU conventions: ++ ++@smallexample ++$ size --format=GNU ranlib size ++ text data bss total filename ++ 279880 96920 11592 388392 ranlib ++ 279880 96920 11888 388688 size ++@end smallexample ++ ++@noindent ++This is the same data, but displayed closer to System V conventions: ++ ++@smallexample ++$ size --format=SysV ranlib size ++ranlib : ++section size addr ++.text 294880 8192 ++.data 81920 303104 ++.bss 11592 385024 ++Total 388392 ++ ++ ++size : ++section size addr ++.text 294880 8192 ++.data 81920 303104 ++.bss 11888 385024 ++Total 388688 ++@end smallexample ++ ++@item --help ++Show a summary of acceptable arguments and options. ++ ++@item -d ++@itemx -o ++@itemx -x ++@itemx --radix=@var{number} ++@cindex @command{size} number format ++@cindex radix for section sizes ++Using one of these options, you can control whether the size of each ++section is given in decimal (@option{-d}, or @option{--radix=10}); octal ++(@option{-o}, or @option{--radix=8}); or hexadecimal (@option{-x}, or ++@option{--radix=16}). In @option{--radix=@var{number}}, only the three ++values (8, 10, 16) are supported. The total size is always given in two ++radices; decimal and hexadecimal for @option{-d} or @option{-x} output, or ++octal and hexadecimal if you're using @option{-o}. ++ ++@item --common ++Print total size of common symbols in each file. When using Berkeley ++or GNU format these are included in the bss size. ++ ++@item -t ++@itemx --totals ++Show totals of all objects listed (Berkeley or GNU format mode only). ++ ++@item --target=@var{bfdname} ++@cindex object code format ++Specify that the object-code format for @var{objfile} is ++@var{bfdname}. This option may not be necessary; @command{size} can ++automatically recognize many formats. ++@xref{Target Selection}, for more information. ++ ++@item -V ++@itemx --version ++Display the version number of @command{size}. ++@end table ++ ++@c man end ++ ++@ignore ++@c man begin SEEALSO size ++ar(1), objdump(1), readelf(1), and the Info entries for @file{binutils}. ++@c man end ++@end ignore ++ ++@node strings ++@chapter strings ++@kindex strings ++@cindex listings strings ++@cindex printing strings ++@cindex strings, printing ++ ++@c man title strings print the sequences of printable characters in files ++ ++@smallexample ++@c man begin SYNOPSIS strings ++strings [@option{-afovV}] [@option{-}@var{min-len}] ++ [@option{-n} @var{min-len}] [@option{--bytes=}@var{min-len}] ++ [@option{-t} @var{radix}] [@option{--radix=}@var{radix}] ++ [@option{-e} @var{encoding}] [@option{--encoding=}@var{encoding}] ++ [@option{-}] [@option{--all}] [@option{--print-file-name}] ++ [@option{-T} @var{bfdname}] [@option{--target=}@var{bfdname}] ++ [@option{-w}] [@option{--include-all-whitespace}] ++ [@option{-s}] [@option{--output-separator}@var{sep_string}] ++ [@option{--help}] [@option{--version}] @var{file}@dots{} ++@c man end ++@end smallexample ++ ++@c man begin DESCRIPTION strings ++ ++For each @var{file} given, @sc{gnu} @command{strings} prints the ++printable character sequences that are at least 4 characters long (or ++the number given with the options below) and are followed by an ++unprintable character. ++ ++Depending upon how the strings program was configured it will default ++to either displaying all the printable sequences that it can find in ++each file, or only those sequences that are in loadable, initialized ++data sections. If the file type is unrecognizable, or if strings is ++reading from stdin then it will always display all of the printable ++sequences that it can find. ++ ++For backwards compatibility any file that occurs after a command-line ++option of just @option{-} will also be scanned in full, regardless of ++the presence of any @option{-d} option. ++ ++@command{strings} is mainly useful for determining the contents of ++non-text files. ++ ++@c man end ++ ++@c man begin OPTIONS strings ++ ++@table @env ++@item -a ++@itemx --all ++@itemx - ++Scan the whole file, regardless of what sections it contains or ++whether those sections are loaded or initialized. Normally this is ++the default behaviour, but strings can be configured so that the ++@option{-d} is the default instead. ++ ++The @option{-} option is position dependent and forces strings to ++perform full scans of any file that is mentioned after the @option{-} ++on the command line, even if the @option{-d} option has been ++specified. ++ ++@item -d ++@itemx --data ++Only print strings from initialized, loaded data sections in the ++file. This may reduce the amount of garbage in the output, but it ++also exposes the strings program to any security flaws that may be ++present in the BFD library used to scan and load sections. Strings ++can be configured so that this option is the default behaviour. In ++such cases the @option{-a} option can be used to avoid using the BFD ++library and instead just print all of the strings found in the file. ++ ++@item -f ++@itemx --print-file-name ++Print the name of the file before each string. ++ ++@item --help ++Print a summary of the program usage on the standard output and exit. ++ ++@item -@var{min-len} ++@itemx -n @var{min-len} ++@itemx --bytes=@var{min-len} ++Print sequences of characters that are at least @var{min-len} characters ++long, instead of the default 4. ++ ++@item -o ++Like @samp{-t o}. Some other versions of @command{strings} have @option{-o} ++act like @samp{-t d} instead. Since we can not be compatible with both ++ways, we simply chose one. ++ ++@item -t @var{radix} ++@itemx --radix=@var{radix} ++Print the offset within the file before each string. The single ++character argument specifies the radix of the offset---@samp{o} for ++octal, @samp{x} for hexadecimal, or @samp{d} for decimal. ++ ++@item -e @var{encoding} ++@itemx --encoding=@var{encoding} ++Select the character encoding of the strings that are to be found. ++Possible values for @var{encoding} are: @samp{s} = single-7-bit-byte ++characters (ASCII, ISO 8859, etc., default), @samp{S} = ++single-8-bit-byte characters, @samp{b} = 16-bit bigendian, @samp{l} = ++16-bit littleendian, @samp{B} = 32-bit bigendian, @samp{L} = 32-bit ++littleendian. Useful for finding wide character strings. (@samp{l} ++and @samp{b} apply to, for example, Unicode UTF-16/UCS-2 encodings). ++ ++@item -T @var{bfdname} ++@itemx --target=@var{bfdname} ++@cindex object code format ++Specify an object code format other than your system's default format. ++@xref{Target Selection}, for more information. ++ ++@item -v ++@itemx -V ++@itemx --version ++Print the program version number on the standard output and exit. ++ ++@item -w ++@itemx --include-all-whitespace ++By default tab and space characters are included in the strings that ++are displayed, but other whitespace characters, such a newlines and ++carriage returns, are not. The @option{-w} option changes this so ++that all whitespace characters are considered to be part of a string. ++ ++@item -s ++@itemx --output-separator ++By default, output strings are delimited by a new-line. This option ++allows you to supply any string to be used as the output record ++separator. Useful with --include-all-whitespace where strings ++may contain new-lines internally. ++@end table ++ ++@c man end ++ ++@ignore ++@c man begin SEEALSO strings ++ar(1), nm(1), objdump(1), ranlib(1), readelf(1) ++and the Info entries for @file{binutils}. ++@c man end ++@end ignore ++ ++@node strip ++@chapter strip ++ ++@kindex strip ++@cindex removing symbols ++@cindex discarding symbols ++@cindex symbols, discarding ++ ++@c man title strip discard symbols and other data from object files ++ ++@smallexample ++@c man begin SYNOPSIS strip ++strip [@option{-F} @var{bfdname} |@option{--target=}@var{bfdname}] ++ [@option{-I} @var{bfdname} |@option{--input-target=}@var{bfdname}] ++ [@option{-O} @var{bfdname} |@option{--output-target=}@var{bfdname}] ++ [@option{-s}|@option{--strip-all}] ++ [@option{-S}|@option{-g}|@option{-d}|@option{--strip-debug}] ++ [@option{--strip-dwo}] ++ [@option{-K} @var{symbolname}|@option{--keep-symbol=}@var{symbolname}] ++ [@option{-M}|@option{--merge-notes}][@option{--no-merge-notes}] ++ [@option{-N} @var{symbolname} |@option{--strip-symbol=}@var{symbolname}] ++ [@option{-w}|@option{--wildcard}] ++ [@option{-x}|@option{--discard-all}] [@option{-X} |@option{--discard-locals}] ++ [@option{-R} @var{sectionname} |@option{--remove-section=}@var{sectionname}] ++ [@option{--keep-section=}@var{sectionpattern}] ++ [@option{--remove-relocations=}@var{sectionpattern}] ++ [@option{-o} @var{file}] [@option{-p}|@option{--preserve-dates}] ++ [@option{-D}|@option{--enable-deterministic-archives}] ++ [@option{-U}|@option{--disable-deterministic-archives}] ++ [@option{--keep-file-symbols}] ++ [@option{--only-keep-debug}] ++ [@option{-v} |@option{--verbose}] [@option{-V}|@option{--version}] ++ [@option{--help}] [@option{--info}] ++ @var{objfile}@dots{} ++@c man end ++@end smallexample ++ ++@c man begin DESCRIPTION strip ++ ++@sc{gnu} @command{strip} discards all symbols from object files ++@var{objfile}. The list of object files may include archives. ++At least one object file must be given. ++ ++@command{strip} modifies the files named in its argument, ++rather than writing modified copies under different names. ++ ++@c man end ++ ++@c man begin OPTIONS strip ++ ++@table @env ++@item -F @var{bfdname} ++@itemx --target=@var{bfdname} ++Treat the original @var{objfile} as a file with the object ++code format @var{bfdname}, and rewrite it in the same format. ++@xref{Target Selection}, for more information. ++ ++@item --help ++Show a summary of the options to @command{strip} and exit. ++ ++@item --info ++Display a list showing all architectures and object formats available. ++ ++@item -I @var{bfdname} ++@itemx --input-target=@var{bfdname} ++Treat the original @var{objfile} as a file with the object ++code format @var{bfdname}. ++@xref{Target Selection}, for more information. ++ ++@item -O @var{bfdname} ++@itemx --output-target=@var{bfdname} ++Replace @var{objfile} with a file in the output format @var{bfdname}. ++@xref{Target Selection}, for more information. ++ ++@item -R @var{sectionname} ++@itemx --remove-section=@var{sectionname} ++Remove any section named @var{sectionname} from the output file, in ++addition to whatever sections would otherwise be removed. This ++option may be given more than once. Note that using this option ++inappropriately may make the output file unusable. The wildcard ++character @samp{*} may be given at the end of @var{sectionname}. If ++so, then any section starting with @var{sectionname} will be removed. ++ ++If the first character of @var{sectionpattern} is the exclamation ++point (!) then matching sections will not be removed even if an ++earlier use of @option{--remove-section} on the same command line ++would otherwise remove it. For example: ++ ++@smallexample ++ --remove-section=.text.* --remove-section=!.text.foo ++@end smallexample ++ ++will remove all sections matching the pattern '.text.*', but will not ++remove the section '.text.foo'. ++ ++@item --keep-section=@var{sectionpattern} ++When removing sections from the output file, keep sections that match ++@var{sectionpattern}. ++ ++@item --remove-relocations=@var{sectionpattern} ++Remove relocations from the output file for any section matching ++@var{sectionpattern}. This option may be given more than once. Note ++that using this option inappropriately may make the output file ++unusable. Wildcard characters are accepted in @var{sectionpattern}. ++For example: ++ ++@smallexample ++ --remove-relocations=.text.* ++@end smallexample ++ ++will remove the relocations for all sections matching the patter ++'.text.*'. ++ ++If the first character of @var{sectionpattern} is the exclamation ++point (!) then matching sections will not have their relocation ++removed even if an earlier use of @option{--remove-relocations} on the ++same command line would otherwise cause the relocations to be removed. ++For example: ++ ++@smallexample ++ --remove-relocations=.text.* --remove-relocations=!.text.foo ++@end smallexample ++ ++will remove all relocations for sections matching the pattern ++'.text.*', but will not remove relocations for the section ++'.text.foo'. ++ ++@item -s ++@itemx --strip-all ++Remove all symbols. ++ ++@item -g ++@itemx -S ++@itemx -d ++@itemx --strip-debug ++Remove debugging symbols only. ++ ++@item --strip-dwo ++Remove the contents of all DWARF .dwo sections, leaving the ++remaining debugging sections and all symbols intact. ++See the description of this option in the @command{objcopy} section ++for more information. ++ ++@item --strip-unneeded ++Remove all symbols that are not needed for relocation processing. ++ ++@item -K @var{symbolname} ++@itemx --keep-symbol=@var{symbolname} ++When stripping symbols, keep symbol @var{symbolname} even if it would ++normally be stripped. This option may be given more than once. ++ ++@item -M ++@itemx --merge-notes ++@itemx --no-merge-notes ++For ELF files, attempt (or do not attempt) to reduce the size of any ++SHT_NOTE type sections by removing duplicate notes. The default is to ++attempt this reduction unless stripping debug or DWO information. ++ ++@item -N @var{symbolname} ++@itemx --strip-symbol=@var{symbolname} ++Remove symbol @var{symbolname} from the source file. This option may be ++given more than once, and may be combined with strip options other than ++@option{-K}. ++ ++@item -o @var{file} ++Put the stripped output in @var{file}, rather than replacing the ++existing file. When this argument is used, only one @var{objfile} ++argument may be specified. ++ ++@item -p ++@itemx --preserve-dates ++Preserve the access and modification dates of the file. ++ ++@item -D ++@itemx --enable-deterministic-archives ++@cindex deterministic archives ++@kindex --enable-deterministic-archives ++Operate in @emph{deterministic} mode. When copying archive members ++and writing the archive index, use zero for UIDs, GIDs, timestamps, ++and use consistent file modes for all files. ++ ++If @file{binutils} was configured with ++@option{--enable-deterministic-archives}, then this mode is on by default. ++It can be disabled with the @samp{-U} option, below. ++ ++@item -U ++@itemx --disable-deterministic-archives ++@cindex deterministic archives ++@kindex --enable-deterministic-archives ++Do @emph{not} operate in @emph{deterministic} mode. This is the ++inverse of the @option{-D} option, above: when copying archive members ++and writing the archive index, use their actual UID, GID, timestamp, ++and file mode values. ++ ++This is the default unless @file{binutils} was configured with ++@option{--enable-deterministic-archives}. ++ ++@item -w ++@itemx --wildcard ++Permit regular expressions in @var{symbolname}s used in other command ++line options. The question mark (?), asterisk (*), backslash (\) and ++square brackets ([]) operators can be used anywhere in the symbol ++name. If the first character of the symbol name is the exclamation ++point (!) then the sense of the switch is reversed for that symbol. ++For example: ++ ++@smallexample ++ -w -K !foo -K fo* ++@end smallexample ++ ++would cause strip to only keep symbols that start with the letters ++``fo'', but to discard the symbol ``foo''. ++ ++@item -x ++@itemx --discard-all ++Remove non-global symbols. ++ ++@item -X ++@itemx --discard-locals ++Remove compiler-generated local symbols. ++(These usually start with @samp{L} or @samp{.}.) ++ ++@item --keep-file-symbols ++When stripping a file, perhaps with @option{--strip-debug} or ++@option{--strip-unneeded}, retain any symbols specifying source file names, ++which would otherwise get stripped. ++ ++@item --only-keep-debug ++Strip a file, emptying the contents of any sections that would not be ++stripped by @option{--strip-debug} and leaving the debugging sections ++intact. In ELF files, this preserves all the note sections in the ++output as well. ++ ++Note - the section headers of the stripped sections are preserved, ++including their sizes, but the contents of the section are discarded. ++The section headers are preserved so that other tools can match up the ++debuginfo file with the real executable, even if that executable has ++been relocated to a different address space. ++ ++The intention is that this option will be used in conjunction with ++@option{--add-gnu-debuglink} to create a two part executable. One a ++stripped binary which will occupy less space in RAM and in a ++distribution and the second a debugging information file which is only ++needed if debugging abilities are required. The suggested procedure ++to create these files is as follows: ++ ++@enumerate ++@item Link the executable as normal. Assuming that it is called ++@code{foo} then... ++@item Run @code{objcopy --only-keep-debug foo foo.dbg} to ++create a file containing the debugging info. ++@item Run @code{objcopy --strip-debug foo} to create a ++stripped executable. ++@item Run @code{objcopy --add-gnu-debuglink=foo.dbg foo} ++to add a link to the debugging info into the stripped executable. ++@end enumerate ++ ++Note---the choice of @code{.dbg} as an extension for the debug info ++file is arbitrary. Also the @code{--only-keep-debug} step is ++optional. You could instead do this: ++ ++@enumerate ++@item Link the executable as normal. ++@item Copy @code{foo} to @code{foo.full} ++@item Run @code{strip --strip-debug foo} ++@item Run @code{objcopy --add-gnu-debuglink=foo.full foo} ++@end enumerate ++ ++i.e., the file pointed to by the @option{--add-gnu-debuglink} can be the ++full executable. It does not have to be a file created by the ++@option{--only-keep-debug} switch. ++ ++Note---this switch is only intended for use on fully linked files. It ++does not make sense to use it on object files where the debugging ++information may be incomplete. Besides the gnu_debuglink feature ++currently only supports the presence of one filename containing ++debugging information, not multiple filenames on a one-per-object-file ++basis. ++ ++@item -V ++@itemx --version ++Show the version number for @command{strip}. ++ ++@item -v ++@itemx --verbose ++Verbose output: list all object files modified. In the case of ++archives, @samp{strip -v} lists all members of the archive. ++@end table ++ ++@c man end ++ ++@ignore ++@c man begin SEEALSO strip ++the Info entries for @file{binutils}. ++@c man end ++@end ignore ++ ++@node c++filt, addr2line, strip, Top ++@chapter c++filt ++ ++@kindex c++filt ++@cindex demangling C++ symbols ++ ++@c man title cxxfilt demangle C++ and Java symbols ++ ++@smallexample ++@c man begin SYNOPSIS cxxfilt ++c++filt [@option{-_}|@option{--strip-underscore}] ++ [@option{-n}|@option{--no-strip-underscore}] ++ [@option{-p}|@option{--no-params}] ++ [@option{-t}|@option{--types}] ++ [@option{-i}|@option{--no-verbose}] ++ [@option{-r}|@option{--no-recurse-limit}] ++ [@option{-R}|@option{--recurse-limit}] ++ [@option{-s} @var{format}|@option{--format=}@var{format}] ++ [@option{--help}] [@option{--version}] [@var{symbol}@dots{}] ++@c man end ++@end smallexample ++ ++@c man begin DESCRIPTION cxxfilt ++ ++@kindex cxxfilt ++The C++ and Java languages provide function overloading, which means ++that you can write many functions with the same name, providing that ++each function takes parameters of different types. In order to be ++able to distinguish these similarly named functions C++ and Java ++encode them into a low-level assembler name which uniquely identifies ++each different version. This process is known as @dfn{mangling}. The ++@command{c++filt} ++@footnote{MS-DOS does not allow @kbd{+} characters in file names, so on ++MS-DOS this program is named @command{CXXFILT}.} ++program does the inverse mapping: it decodes (@dfn{demangles}) low-level ++names into user-level names so that they can be read. ++ ++Every alphanumeric word (consisting of letters, digits, underscores, ++dollars, or periods) seen in the input is a potential mangled name. ++If the name decodes into a C++ name, the C++ name replaces the ++low-level name in the output, otherwise the original word is output. ++In this way you can pass an entire assembler source file, containing ++mangled names, through @command{c++filt} and see the same source file ++containing demangled names. ++ ++You can also use @command{c++filt} to decipher individual symbols by ++passing them on the command line: ++ ++@example ++c++filt @var{symbol} ++@end example ++ ++If no @var{symbol} arguments are given, @command{c++filt} reads symbol ++names from the standard input instead. All the results are printed on ++the standard output. The difference between reading names from the ++command line versus reading names from the standard input is that ++command-line arguments are expected to be just mangled names and no ++checking is performed to separate them from surrounding text. Thus ++for example: ++ ++@smallexample ++c++filt -n _Z1fv ++@end smallexample ++ ++will work and demangle the name to ``f()'' whereas: ++ ++@smallexample ++c++filt -n _Z1fv, ++@end smallexample ++ ++will not work. (Note the extra comma at the end of the mangled ++name which makes it invalid). This command however will work: ++ ++@smallexample ++echo _Z1fv, | c++filt -n ++@end smallexample ++ ++and will display ``f(),'', i.e., the demangled name followed by a ++trailing comma. This behaviour is because when the names are read ++from the standard input it is expected that they might be part of an ++assembler source file where there might be extra, extraneous ++characters trailing after a mangled name. For example: ++ ++@smallexample ++ .type _Z1fv, @@function ++@end smallexample ++ ++@c man end ++ ++@c man begin OPTIONS cxxfilt ++ ++@table @env ++@item -_ ++@itemx --strip-underscore ++On some systems, both the C and C++ compilers put an underscore in front ++of every name. For example, the C name @code{foo} gets the low-level ++name @code{_foo}. This option removes the initial underscore. Whether ++@command{c++filt} removes the underscore by default is target dependent. ++ ++@item -n ++@itemx --no-strip-underscore ++Do not remove the initial underscore. ++ ++@item -p ++@itemx --no-params ++When demangling the name of a function, do not display the types of ++the function's parameters. ++ ++@item -t ++@itemx --types ++Attempt to demangle types as well as function names. This is disabled ++by default since mangled types are normally only used internally in ++the compiler, and they can be confused with non-mangled names. For example, ++a function called ``a'' treated as a mangled type name would be ++demangled to ``signed char''. ++ ++@item -i ++@itemx --no-verbose ++Do not include implementation details (if any) in the demangled ++output. ++ ++@item -r ++@itemx -R ++@itemx --recurse-limit ++@itemx --no-recurse-limit ++@itemx --recursion-limit ++@itemx --no-recursion-limit ++Enables or disables a limit on the amount of recursion performed ++whilst demangling strings. Since the name mangling formats allow for ++an inifinite level of recursion it is possible to create strings whose ++decoding will exhaust the amount of stack space available on the host ++machine, triggering a memory fault. The limit tries to prevent this ++from happening by restricting recursion to 2048 levels of nesting. ++ ++The default is for this limit to be enabled, but disabling it may be ++necessary in order to demangle truly complicated names. Note however ++that if the recursion limit is disabled then stack exhaustion is ++possible and any bug reports about such an event will be rejected. ++ ++The @option{-r} option is a synonym for the ++@option{--no-recurse-limit} option. The @option{-R} option is a ++synonym for the @option{--recurse-limit} option. ++ ++@item -s @var{format} ++@itemx --format=@var{format} ++@command{c++filt} can decode various methods of mangling, used by ++different compilers. The argument to this option selects which ++method it uses: ++ ++@table @code ++@item auto ++Automatic selection based on executable (the default method) ++@item gnu ++the one used by the @sc{gnu} C++ compiler (g++) ++@item lucid ++the one used by the Lucid compiler (lcc) ++@item arm ++the one specified by the C++ Annotated Reference Manual ++@item hp ++the one used by the HP compiler (aCC) ++@item edg ++the one used by the EDG compiler ++@item gnu-v3 ++the one used by the @sc{gnu} C++ compiler (g++) with the V3 ABI. ++@item java ++the one used by the @sc{gnu} Java compiler (gcj) ++@item gnat ++the one used by the @sc{gnu} Ada compiler (GNAT). ++@end table ++ ++@item --help ++Print a summary of the options to @command{c++filt} and exit. ++ ++@item --version ++Print the version number of @command{c++filt} and exit. ++@end table ++ ++@c man end ++ ++@ignore ++@c man begin SEEALSO cxxfilt ++the Info entries for @file{binutils}. ++@c man end ++@end ignore ++ ++@quotation ++@emph{Warning:} @command{c++filt} is a new utility, and the details of its ++user interface are subject to change in future releases. In particular, ++a command-line option may be required in the future to decode a name ++passed as an argument on the command line; in other words, ++ ++@example ++c++filt @var{symbol} ++@end example ++ ++@noindent ++may in a future release become ++ ++@example ++c++filt @var{option} @var{symbol} ++@end example ++@end quotation ++ ++@node addr2line ++@chapter addr2line ++ ++@kindex addr2line ++@cindex address to file name and line number ++ ++@c man title addr2line convert addresses into file names and line numbers ++ ++@smallexample ++@c man begin SYNOPSIS addr2line ++addr2line [@option{-a}|@option{--addresses}] ++ [@option{-b} @var{bfdname}|@option{--target=}@var{bfdname}] ++ [@option{-C}|@option{--demangle}[=@var{style}]] ++ [@option{-r}|@option{--no-recurse-limit}] ++ [@option{-R}|@option{--recurse-limit}] ++ [@option{-e} @var{filename}|@option{--exe=}@var{filename}] ++ [@option{-f}|@option{--functions}] [@option{-s}|@option{--basename}] ++ [@option{-i}|@option{--inlines}] ++ [@option{-p}|@option{--pretty-print}] ++ [@option{-j}|@option{--section=}@var{name}] ++ [@option{-H}|@option{--help}] [@option{-V}|@option{--version}] ++ [addr addr @dots{}] ++@c man end ++@end smallexample ++ ++@c man begin DESCRIPTION addr2line ++ ++@command{addr2line} translates addresses into file names and line numbers. ++Given an address in an executable or an offset in a section of a relocatable ++object, it uses the debugging information to figure out which file name and ++line number are associated with it. ++ ++The executable or relocatable object to use is specified with the @option{-e} ++option. The default is the file @file{a.out}. The section in the relocatable ++object to use is specified with the @option{-j} option. ++ ++@command{addr2line} has two modes of operation. ++ ++In the first, hexadecimal addresses are specified on the command line, ++and @command{addr2line} displays the file name and line number for each ++address. ++ ++In the second, @command{addr2line} reads hexadecimal addresses from ++standard input, and prints the file name and line number for each ++address on standard output. In this mode, @command{addr2line} may be used ++in a pipe to convert dynamically chosen addresses. ++ ++The format of the output is @samp{FILENAME:LINENO}. By default ++each input address generates one line of output. ++ ++Two options can generate additional lines before each ++@samp{FILENAME:LINENO} line (in that order). ++ ++If the @option{-a} option is used then a line with the input address ++is displayed. ++ ++If the @option{-f} option is used, then a line with the ++@samp{FUNCTIONNAME} is displayed. This is the name of the function ++containing the address. ++ ++One option can generate additional lines after the ++@samp{FILENAME:LINENO} line. ++ ++If the @option{-i} option is used and the code at the given address is ++present there because of inlining by the compiler then additional ++lines are displayed afterwards. One or two extra lines (if the ++@option{-f} option is used) are displayed for each inlined function. ++ ++Alternatively if the @option{-p} option is used then each input ++address generates a single, long, output line containing the address, ++the function name, the file name and the line number. If the ++@option{-i} option has also been used then any inlined functions will ++be displayed in the same manner, but on separate lines, and prefixed ++by the text @samp{(inlined by)}. ++ ++If the file name or function name can not be determined, ++@command{addr2line} will print two question marks in their place. If the ++line number can not be determined, @command{addr2line} will print 0. ++ ++@c man end ++ ++@c man begin OPTIONS addr2line ++ ++The long and short forms of options, shown here as alternatives, are ++equivalent. ++ ++@table @env ++@item -a ++@itemx --addresses ++Display the address before the function name, file and line number ++information. The address is printed with a @samp{0x} prefix to easily ++identify it. ++ ++@item -b @var{bfdname} ++@itemx --target=@var{bfdname} ++@cindex object code format ++Specify that the object-code format for the object files is ++@var{bfdname}. ++ ++@item -C ++@itemx --demangle[=@var{style}] ++@cindex demangling in objdump ++Decode (@dfn{demangle}) low-level symbol names into user-level names. ++Besides removing any initial underscore prepended by the system, this ++makes C++ function names readable. Different compilers have different ++mangling styles. The optional demangling style argument can be used to ++choose an appropriate demangling style for your compiler. @xref{c++filt}, ++for more information on demangling. ++ ++@item -e @var{filename} ++@itemx --exe=@var{filename} ++Specify the name of the executable for which addresses should be ++translated. The default file is @file{a.out}. ++ ++@item -f ++@itemx --functions ++Display function names as well as file and line number information. ++ ++@item -s ++@itemx --basenames ++Display only the base of each file name. ++ ++@item -i ++@itemx --inlines ++If the address belongs to a function that was inlined, the source ++information for all enclosing scopes back to the first non-inlined ++function will also be printed. For example, if @code{main} inlines ++@code{callee1} which inlines @code{callee2}, and address is from ++@code{callee2}, the source information for @code{callee1} and @code{main} ++will also be printed. ++ ++@item -j ++@itemx --section ++Read offsets relative to the specified section instead of absolute addresses. ++ ++@item -p ++@itemx --pretty-print ++Make the output more human friendly: each location are printed on one line. ++If option @option{-i} is specified, lines for all enclosing scopes are ++prefixed with @samp{(inlined by)}. ++ ++@item -r ++@itemx -R ++@itemx --recurse-limit ++@itemx --no-recurse-limit ++@itemx --recursion-limit ++@itemx --no-recursion-limit ++Enables or disables a limit on the amount of recursion performed ++whilst demangling strings. Since the name mangling formats allow for ++an inifinite level of recursion it is possible to create strings whose ++decoding will exhaust the amount of stack space available on the host ++machine, triggering a memory fault. The limit tries to prevent this ++from happening by restricting recursion to 2048 levels of nesting. ++ ++The default is for this limit to be enabled, but disabling it may be ++necessary in order to demangle truly complicated names. Note however ++that if the recursion limit is disabled then stack exhaustion is ++possible and any bug reports about such an event will be rejected. ++ ++The @option{-r} option is a synonym for the ++@option{--no-recurse-limit} option. The @option{-R} option is a ++synonym for the @option{--recurse-limit} option. ++ ++Note this option is only effective if the @option{-C} or ++@option{--demangle} option has been enabled. ++ ++@end table ++ ++@c man end ++ ++@ignore ++@c man begin SEEALSO addr2line ++Info entries for @file{binutils}. ++@c man end ++@end ignore ++ ++@node windmc ++@chapter windmc ++ ++@command{windmc} may be used to generator Windows message resources. ++ ++@quotation ++@emph{Warning:} @command{windmc} is not always built as part of the binary ++utilities, since it is only useful for Windows targets. ++@end quotation ++ ++@c man title windmc generates Windows message resources ++ ++@smallexample ++@c man begin SYNOPSIS windmc ++windmc [options] input-file ++@c man end ++@end smallexample ++ ++@c man begin DESCRIPTION windmc ++ ++@command{windmc} reads message definitions from an input file (.mc) and ++translate them into a set of output files. The output files may be of ++four kinds: ++ ++@table @code ++@item h ++A C header file containing the message definitions. ++ ++@item rc ++A resource file compilable by the @command{windres} tool. ++ ++@item bin ++One or more binary files containing the resource data for a specific ++message language. ++ ++@item dbg ++A C include file that maps message id's to their symbolic name. ++@end table ++ ++The exact description of these different formats is available in ++documentation from Microsoft. ++ ++When @command{windmc} converts from the @code{mc} format to the @code{bin} ++format, @code{rc}, @code{h}, and optional @code{dbg} it is acting like the ++Windows Message Compiler. ++ ++@c man end ++ ++@c man begin OPTIONS windmc ++ ++@table @env ++@item -a ++@itemx --ascii_in ++Specifies that the input file specified is ASCII. This is the default ++behaviour. ++ ++@item -A ++@itemx --ascii_out ++Specifies that messages in the output @code{bin} files should be in ASCII ++format. ++ ++@item -b ++@itemx --binprefix ++Specifies that @code{bin} filenames should have to be prefixed by the ++basename of the source file. ++ ++@item -c ++@itemx --customflag ++Sets the customer bit in all message id's. ++ ++@item -C @var{codepage} ++@itemx --codepage_in @var{codepage} ++Sets the default codepage to be used to convert input file to UTF16. The ++default is ocdepage 1252. ++ ++@item -d ++@itemx --decimal_values ++Outputs the constants in the header file in decimal. Default is using ++hexadecimal output. ++ ++@item -e @var{ext} ++@itemx --extension @var{ext} ++The extension for the header file. The default is .h extension. ++ ++@item -F @var{target} ++@itemx --target @var{target} ++Specify the BFD format to use for a bin file as output. This ++is a BFD target name; you can use the @option{--help} option to see a list ++of supported targets. Normally @command{windmc} will use the default ++format, which is the first one listed by the @option{--help} option. ++@ifclear man ++@ref{Target Selection}. ++@end ifclear ++ ++@item -h @var{path} ++@itemx --headerdir @var{path} ++The target directory of the generated header file. The default is the ++current directory. ++ ++@item -H ++@itemx --help ++Displays a list of command-line options and then exits. ++ ++@item -m @var{characters} ++@itemx --maxlength @var{characters} ++Instructs @command{windmc} to generate a warning if the length ++of any message exceeds the number specified. ++ ++@item -n ++@itemx --nullterminate ++Terminate message text in @code{bin} files by zero. By default they are ++terminated by CR/LF. ++ ++@item -o ++@itemx --hresult_use ++Not yet implemented. Instructs @code{windmc} to generate an OLE2 header ++file, using HRESULT definitions. Status codes are used if the flag is not ++specified. ++ ++@item -O @var{codepage} ++@itemx --codepage_out @var{codepage} ++Sets the default codepage to be used to output text files. The default ++is ocdepage 1252. ++ ++@item -r @var{path} ++@itemx --rcdir @var{path} ++The target directory for the generated @code{rc} script and the generated ++@code{bin} files that the resource compiler script includes. The default ++is the current directory. ++ ++@item -u ++@itemx --unicode_in ++Specifies that the input file is UTF16. ++ ++@item -U ++@itemx --unicode_out ++Specifies that messages in the output @code{bin} file should be in UTF16 ++format. This is the default behaviour. ++ ++@item -v ++@item --verbose ++Enable verbose mode. ++ ++@item -V ++@item --version ++Prints the version number for @command{windmc}. ++ ++@item -x @var{path} ++@itemx --xdgb @var{path} ++The path of the @code{dbg} C include file that maps message id's to the ++symbolic name. No such file is generated without specifying the switch. ++@end table ++ ++@c man end ++ ++@ignore ++@c man begin SEEALSO windmc ++the Info entries for @file{binutils}. ++@c man end ++@end ignore ++ ++@node windres ++@chapter windres ++ ++@command{windres} may be used to manipulate Windows resources. ++ ++@quotation ++@emph{Warning:} @command{windres} is not always built as part of the binary ++utilities, since it is only useful for Windows targets. ++@end quotation ++ ++@c man title windres manipulate Windows resources ++ ++@smallexample ++@c man begin SYNOPSIS windres ++windres [options] [input-file] [output-file] ++@c man end ++@end smallexample ++ ++@c man begin DESCRIPTION windres ++ ++@command{windres} reads resources from an input file and copies them into ++an output file. Either file may be in one of three formats: ++ ++@table @code ++@item rc ++A text format read by the Resource Compiler. ++ ++@item res ++A binary format generated by the Resource Compiler. ++ ++@item coff ++A COFF object or executable. ++@end table ++ ++The exact description of these different formats is available in ++documentation from Microsoft. ++ ++When @command{windres} converts from the @code{rc} format to the @code{res} ++format, it is acting like the Windows Resource Compiler. When ++@command{windres} converts from the @code{res} format to the @code{coff} ++format, it is acting like the Windows @code{CVTRES} program. ++ ++When @command{windres} generates an @code{rc} file, the output is similar ++but not identical to the format expected for the input. When an input ++@code{rc} file refers to an external filename, an output @code{rc} file ++will instead include the file contents. ++ ++If the input or output format is not specified, @command{windres} will ++guess based on the file name, or, for the input file, the file contents. ++A file with an extension of @file{.rc} will be treated as an @code{rc} ++file, a file with an extension of @file{.res} will be treated as a ++@code{res} file, and a file with an extension of @file{.o} or ++@file{.exe} will be treated as a @code{coff} file. ++ ++If no output file is specified, @command{windres} will print the resources ++in @code{rc} format to standard output. ++ ++The normal use is for you to write an @code{rc} file, use @command{windres} ++to convert it to a COFF object file, and then link the COFF file into ++your application. This will make the resources described in the ++@code{rc} file available to Windows. ++ ++@c man end ++ ++@c man begin OPTIONS windres ++ ++@table @env ++@item -i @var{filename} ++@itemx --input @var{filename} ++The name of the input file. If this option is not used, then ++@command{windres} will use the first non-option argument as the input file ++name. If there are no non-option arguments, then @command{windres} will ++read from standard input. @command{windres} can not read a COFF file from ++standard input. ++ ++@item -o @var{filename} ++@itemx --output @var{filename} ++The name of the output file. If this option is not used, then ++@command{windres} will use the first non-option argument, after any used ++for the input file name, as the output file name. If there is no ++non-option argument, then @command{windres} will write to standard output. ++@command{windres} can not write a COFF file to standard output. Note, ++for compatibility with @command{rc} the option @option{-fo} is also ++accepted, but its use is not recommended. ++ ++@item -J @var{format} ++@itemx --input-format @var{format} ++The input format to read. @var{format} may be @samp{res}, @samp{rc}, or ++@samp{coff}. If no input format is specified, @command{windres} will ++guess, as described above. ++ ++@item -O @var{format} ++@itemx --output-format @var{format} ++The output format to generate. @var{format} may be @samp{res}, ++@samp{rc}, or @samp{coff}. If no output format is specified, ++@command{windres} will guess, as described above. ++ ++@item -F @var{target} ++@itemx --target @var{target} ++Specify the BFD format to use for a COFF file as input or output. This ++is a BFD target name; you can use the @option{--help} option to see a list ++of supported targets. Normally @command{windres} will use the default ++format, which is the first one listed by the @option{--help} option. ++@ifclear man ++@ref{Target Selection}. ++@end ifclear ++ ++@item --preprocessor @var{program} ++When @command{windres} reads an @code{rc} file, it runs it through the C ++preprocessor first. This option may be used to specify the preprocessor ++to use, including any leading arguments. The default preprocessor ++argument is @code{gcc -E -xc-header -DRC_INVOKED}. ++ ++@item --preprocessor-arg @var{option} ++When @command{windres} reads an @code{rc} file, it runs it through ++the C preprocessor first. This option may be used to specify additional ++text to be passed to preprocessor on its command line. ++This option can be used multiple times to add multiple options to the ++preprocessor command line. ++ ++@item -I @var{directory} ++@itemx --include-dir @var{directory} ++Specify an include directory to use when reading an @code{rc} file. ++@command{windres} will pass this to the preprocessor as an @option{-I} ++option. @command{windres} will also search this directory when looking for ++files named in the @code{rc} file. If the argument passed to this command ++matches any of the supported @var{formats} (as described in the @option{-J} ++option), it will issue a deprecation warning, and behave just like the ++@option{-J} option. New programs should not use this behaviour. If a ++directory happens to match a @var{format}, simple prefix it with @samp{./} ++to disable the backward compatibility. ++ ++@item -D @var{target} ++@itemx --define @var{sym}[=@var{val}] ++Specify a @option{-D} option to pass to the preprocessor when reading an ++@code{rc} file. ++ ++@item -U @var{target} ++@itemx --undefine @var{sym} ++Specify a @option{-U} option to pass to the preprocessor when reading an ++@code{rc} file. ++ ++@item -r ++Ignored for compatibility with rc. ++ ++@item -v ++Enable verbose mode. This tells you what the preprocessor is if you ++didn't specify one. ++ ++@item -c @var{val} ++@item --codepage @var{val} ++Specify the default codepage to use when reading an @code{rc} file. ++@var{val} should be a hexadecimal prefixed by @samp{0x} or decimal ++codepage code. The valid range is from zero up to 0xffff, but the ++validity of the codepage is host and configuration dependent. ++ ++@item -l @var{val} ++@item --language @var{val} ++Specify the default language to use when reading an @code{rc} file. ++@var{val} should be a hexadecimal language code. The low eight bits are ++the language, and the high eight bits are the sublanguage. ++ ++@item --use-temp-file ++Use a temporary file to instead of using popen to read the output of ++the preprocessor. Use this option if the popen implementation is buggy ++on the host (eg., certain non-English language versions of Windows 95 and ++Windows 98 are known to have buggy popen where the output will instead ++go the console). ++ ++@item --no-use-temp-file ++Use popen, not a temporary file, to read the output of the preprocessor. ++This is the default behaviour. ++ ++@item -h ++@item --help ++Prints a usage summary. ++ ++@item -V ++@item --version ++Prints the version number for @command{windres}. ++ ++@item --yydebug ++If @command{windres} is compiled with @code{YYDEBUG} defined as @code{1}, ++this will turn on parser debugging. ++@end table ++ ++@c man end ++ ++@ignore ++@c man begin SEEALSO windres ++the Info entries for @file{binutils}. ++@c man end ++@end ignore ++ ++@node dlltool ++@chapter dlltool ++@cindex DLL ++@kindex dlltool ++ ++@command{dlltool} is used to create the files needed to create dynamic ++link libraries (DLLs) on systems which understand PE format image ++files such as Windows. A DLL contains an export table which contains ++information that the runtime loader needs to resolve references from a ++referencing program. ++ ++The export table is generated by this program by reading in a ++@file{.def} file or scanning the @file{.a} and @file{.o} files which ++will be in the DLL. A @file{.o} file can contain information in ++special @samp{.drectve} sections with export information. ++ ++@quotation ++@emph{Note:} @command{dlltool} is not always built as part of the ++binary utilities, since it is only useful for those targets which ++support DLLs. ++@end quotation ++ ++@c man title dlltool create files needed to build and use DLLs ++ ++@smallexample ++@c man begin SYNOPSIS dlltool ++dlltool [@option{-d}|@option{--input-def} @var{def-file-name}] ++ [@option{-b}|@option{--base-file} @var{base-file-name}] ++ [@option{-e}|@option{--output-exp} @var{exports-file-name}] ++ [@option{-z}|@option{--output-def} @var{def-file-name}] ++ [@option{-l}|@option{--output-lib} @var{library-file-name}] ++ [@option{-y}|@option{--output-delaylib} @var{library-file-name}] ++ [@option{--export-all-symbols}] [@option{--no-export-all-symbols}] ++ [@option{--exclude-symbols} @var{list}] ++ [@option{--no-default-excludes}] ++ [@option{-S}|@option{--as} @var{path-to-assembler}] [@option{-f}|@option{--as-flags} @var{options}] ++ [@option{-D}|@option{--dllname} @var{name}] [@option{-m}|@option{--machine} @var{machine}] ++ [@option{-a}|@option{--add-indirect}] ++ [@option{-U}|@option{--add-underscore}] [@option{--add-stdcall-underscore}] ++ [@option{-k}|@option{--kill-at}] [@option{-A}|@option{--add-stdcall-alias}] ++ [@option{-p}|@option{--ext-prefix-alias} @var{prefix}] ++ [@option{-x}|@option{--no-idata4}] [@option{-c}|@option{--no-idata5}] ++ [@option{--use-nul-prefixed-import-tables}] ++ [@option{-I}|@option{--identify} @var{library-file-name}] [@option{--identify-strict}] ++ [@option{-i}|@option{--interwork}] ++ [@option{-n}|@option{--nodelete}] [@option{-t}|@option{--temp-prefix} @var{prefix}] ++ [@option{-v}|@option{--verbose}] ++ [@option{-h}|@option{--help}] [@option{-V}|@option{--version}] ++ [@option{--no-leading-underscore}] [@option{--leading-underscore}] ++ [object-file @dots{}] ++@c man end ++@end smallexample ++ ++@c man begin DESCRIPTION dlltool ++ ++@command{dlltool} reads its inputs, which can come from the @option{-d} and ++@option{-b} options as well as object files specified on the command ++line. It then processes these inputs and if the @option{-e} option has ++been specified it creates a exports file. If the @option{-l} option ++has been specified it creates a library file and if the @option{-z} option ++has been specified it creates a def file. Any or all of the @option{-e}, ++@option{-l} and @option{-z} options can be present in one invocation of ++dlltool. ++ ++When creating a DLL, along with the source for the DLL, it is necessary ++to have three other files. @command{dlltool} can help with the creation of ++these files. ++ ++The first file is a @file{.def} file which specifies which functions are ++exported from the DLL, which functions the DLL imports, and so on. This ++is a text file and can be created by hand, or @command{dlltool} can be used ++to create it using the @option{-z} option. In this case @command{dlltool} ++will scan the object files specified on its command line looking for ++those functions which have been specially marked as being exported and ++put entries for them in the @file{.def} file it creates. ++ ++In order to mark a function as being exported from a DLL, it needs to ++have an @option{-export:} entry in the @samp{.drectve} ++section of the object file. This can be done in C by using the ++asm() operator: ++ ++@smallexample ++ asm (".section .drectve"); ++ asm (".ascii \"-export:my_func\""); ++ ++ int my_func (void) @{ @dots{} @} ++@end smallexample ++ ++The second file needed for DLL creation is an exports file. This file ++is linked with the object files that make up the body of the DLL and it ++handles the interface between the DLL and the outside world. This is a ++binary file and it can be created by giving the @option{-e} option to ++@command{dlltool} when it is creating or reading in a @file{.def} file. ++ ++The third file needed for DLL creation is the library file that programs ++will link with in order to access the functions in the DLL (an `import ++library'). This file can be created by giving the @option{-l} option to ++dlltool when it is creating or reading in a @file{.def} file. ++ ++If the @option{-y} option is specified, dlltool generates a delay-import ++library that can be used instead of the normal import library to allow ++a program to link to the dll only as soon as an imported function is ++called for the first time. The resulting executable will need to be ++linked to the static delayimp library containing __delayLoadHelper2(), ++which in turn will import LoadLibraryA and GetProcAddress from kernel32. ++ ++@command{dlltool} builds the library file by hand, but it builds the ++exports file by creating temporary files containing assembler statements ++and then assembling these. The @option{-S} command-line option can be ++used to specify the path to the assembler that dlltool will use, ++and the @option{-f} option can be used to pass specific flags to that ++assembler. The @option{-n} can be used to prevent dlltool from deleting ++these temporary assembler files when it is done, and if @option{-n} is ++specified twice then this will prevent dlltool from deleting the ++temporary object files it used to build the library. ++ ++Here is an example of creating a DLL from a source file @samp{dll.c} and ++also creating a program (from an object file called @samp{program.o}) ++that uses that DLL: ++ ++@smallexample ++ gcc -c dll.c ++ dlltool -e exports.o -l dll.lib dll.o ++ gcc dll.o exports.o -o dll.dll ++ gcc program.o dll.lib -o program ++@end smallexample ++ ++ ++@command{dlltool} may also be used to query an existing import library ++to determine the name of the DLL to which it is associated. See the ++description of the @option{-I} or @option{--identify} option. ++ ++@c man end ++ ++@c man begin OPTIONS dlltool ++ ++The command-line options have the following meanings: ++ ++@table @env ++ ++@item -d @var{filename} ++@itemx --input-def @var{filename} ++@cindex input .def file ++Specifies the name of a @file{.def} file to be read in and processed. ++ ++@item -b @var{filename} ++@itemx --base-file @var{filename} ++@cindex base files ++Specifies the name of a base file to be read in and processed. The ++contents of this file will be added to the relocation section in the ++exports file generated by dlltool. ++ ++@item -e @var{filename} ++@itemx --output-exp @var{filename} ++Specifies the name of the export file to be created by dlltool. ++ ++@item -z @var{filename} ++@itemx --output-def @var{filename} ++Specifies the name of the @file{.def} file to be created by dlltool. ++ ++@item -l @var{filename} ++@itemx --output-lib @var{filename} ++Specifies the name of the library file to be created by dlltool. ++ ++@item -y @var{filename} ++@itemx --output-delaylib @var{filename} ++Specifies the name of the delay-import library file to be created by dlltool. ++ ++@item --export-all-symbols ++Treat all global and weak defined symbols found in the input object ++files as symbols to be exported. There is a small list of symbols which ++are not exported by default; see the @option{--no-default-excludes} ++option. You may add to the list of symbols to not export by using the ++@option{--exclude-symbols} option. ++ ++@item --no-export-all-symbols ++Only export symbols explicitly listed in an input @file{.def} file or in ++@samp{.drectve} sections in the input object files. This is the default ++behaviour. The @samp{.drectve} sections are created by @samp{dllexport} ++attributes in the source code. ++ ++@item --exclude-symbols @var{list} ++Do not export the symbols in @var{list}. This is a list of symbol names ++separated by comma or colon characters. The symbol names should not ++contain a leading underscore. This is only meaningful when ++@option{--export-all-symbols} is used. ++ ++@item --no-default-excludes ++When @option{--export-all-symbols} is used, it will by default avoid ++exporting certain special symbols. The current list of symbols to avoid ++exporting is @samp{DllMain@@12}, @samp{DllEntryPoint@@0}, ++@samp{impure_ptr}. You may use the @option{--no-default-excludes} option ++to go ahead and export these special symbols. This is only meaningful ++when @option{--export-all-symbols} is used. ++ ++@item -S @var{path} ++@itemx --as @var{path} ++Specifies the path, including the filename, of the assembler to be used ++to create the exports file. ++ ++@item -f @var{options} ++@itemx --as-flags @var{options} ++Specifies any specific command-line options to be passed to the ++assembler when building the exports file. This option will work even if ++the @option{-S} option is not used. This option only takes one argument, ++and if it occurs more than once on the command line, then later ++occurrences will override earlier occurrences. So if it is necessary to ++pass multiple options to the assembler they should be enclosed in ++double quotes. ++ ++@item -D @var{name} ++@itemx --dll-name @var{name} ++Specifies the name to be stored in the @file{.def} file as the name of ++the DLL when the @option{-e} option is used. If this option is not ++present, then the filename given to the @option{-e} option will be ++used as the name of the DLL. ++ ++@item -m @var{machine} ++@itemx -machine @var{machine} ++Specifies the type of machine for which the library file should be ++built. @command{dlltool} has a built in default type, depending upon how ++it was created, but this option can be used to override that. This is ++normally only useful when creating DLLs for an ARM processor, when the ++contents of the DLL are actually encode using Thumb instructions. ++ ++@item -a ++@itemx --add-indirect ++Specifies that when @command{dlltool} is creating the exports file it ++should add a section which allows the exported functions to be ++referenced without using the import library. Whatever the hell that ++means! ++ ++@item -U ++@itemx --add-underscore ++Specifies that when @command{dlltool} is creating the exports file it ++should prepend an underscore to the names of @emph{all} exported symbols. ++ ++@item --no-leading-underscore ++@item --leading-underscore ++Specifies whether standard symbol should be forced to be prefixed, or ++not. ++ ++@item --add-stdcall-underscore ++Specifies that when @command{dlltool} is creating the exports file it ++should prepend an underscore to the names of exported @emph{stdcall} ++functions. Variable names and non-stdcall function names are not modified. ++This option is useful when creating GNU-compatible import libs for third ++party DLLs that were built with MS-Windows tools. ++ ++@item -k ++@itemx --kill-at ++Specifies that @samp{@@} suffixes should be omitted from the names ++of stdcall functions that will be imported from the DLL. This is ++useful when creating an import library for a DLL which exports stdcall ++functions but without the usual @samp{@@} symbol name suffix. ++ ++This does not change the naming of symbols provided by the import library ++to programs linked against it, but only the entries in the import table ++(ie the .idata section). ++ ++@item -A ++@itemx --add-stdcall-alias ++Specifies that when @command{dlltool} is creating the exports file it ++should add aliases for stdcall symbols without @samp{@@ } ++in addition to the symbols with @samp{@@ }. ++ ++@item -p ++@itemx --ext-prefix-alias @var{prefix} ++Causes @command{dlltool} to create external aliases for all DLL ++imports with the specified prefix. The aliases are created for both ++external and import symbols with no leading underscore. ++ ++@item -x ++@itemx --no-idata4 ++Specifies that when @command{dlltool} is creating the exports and library ++files it should omit the @code{.idata4} section. This is for compatibility ++with certain operating systems. ++ ++@item --use-nul-prefixed-import-tables ++Specifies that when @command{dlltool} is creating the exports and library ++files it should prefix the @code{.idata4} and @code{.idata5} by zero an ++element. This emulates old gnu import library generation of ++@code{dlltool}. By default this option is turned off. ++ ++@item -c ++@itemx --no-idata5 ++Specifies that when @command{dlltool} is creating the exports and library ++files it should omit the @code{.idata5} section. This is for compatibility ++with certain operating systems. ++ ++@item -I @var{filename} ++@itemx --identify @var{filename} ++Specifies that @command{dlltool} should inspect the import library ++indicated by @var{filename} and report, on @code{stdout}, the name(s) ++of the associated DLL(s). This can be performed in addition to any ++other operations indicated by the other options and arguments. ++@command{dlltool} fails if the import library does not exist or is not ++actually an import library. See also @option{--identify-strict}. ++ ++@item --identify-strict ++Modifies the behavior of the @option{--identify} option, such ++that an error is reported if @var{filename} is associated with ++more than one DLL. ++ ++@item -i ++@itemx --interwork ++Specifies that @command{dlltool} should mark the objects in the library ++file and exports file that it produces as supporting interworking ++between ARM and Thumb code. ++ ++@item -n ++@itemx --nodelete ++Makes @command{dlltool} preserve the temporary assembler files it used to ++create the exports file. If this option is repeated then dlltool will ++also preserve the temporary object files it uses to create the library ++file. ++ ++@item -t @var{prefix} ++@itemx --temp-prefix @var{prefix} ++Makes @command{dlltool} use @var{prefix} when constructing the names of ++temporary assembler and object files. By default, the temp file prefix ++is generated from the pid. ++ ++@item -v ++@itemx --verbose ++Make dlltool describe what it is doing. ++ ++@item -h ++@itemx --help ++Displays a list of command-line options and then exits. ++ ++@item -V ++@itemx --version ++Displays dlltool's version number and then exits. ++ ++@end table ++ ++@c man end ++ ++@menu ++* def file format:: The format of the dlltool @file{.def} file ++@end menu ++ ++@node def file format ++@section The format of the @command{dlltool} @file{.def} file ++ ++A @file{.def} file contains any number of the following commands: ++ ++@table @asis ++ ++@item @code{NAME} @var{name} @code{[ ,} @var{base} @code{]} ++The result is going to be named @var{name}@code{.exe}. ++ ++@item @code{LIBRARY} @var{name} @code{[ ,} @var{base} @code{]} ++The result is going to be named @var{name}@code{.dll}. ++Note: If you want to use LIBRARY as name then you need to quote. Otherwise ++this will fail due a necessary hack for libtool (see PR binutils/13710 for more ++details). ++ ++@item @code{EXPORTS ( ( (} @var{name1} @code{[ = } @var{name2} @code{] ) | ( } @var{name1} @code{=} @var{module-name} @code{.} @var{external-name} @code{) ) [ == } @var{its_name} @code{]} ++@item @code{[} @var{integer} @code{] [ NONAME ] [ CONSTANT ] [ DATA ] [ PRIVATE ] ) *} ++Declares @var{name1} as an exported symbol from the DLL, with optional ++ordinal number @var{integer}, or declares @var{name1} as an alias ++(forward) of the function @var{external-name} in the DLL. ++If @var{its_name} is specified, this name is used as string in export table. ++@var{module-name}. ++Note: The @code{EXPORTS} has to be the last command in .def file, as keywords ++are treated - beside @code{LIBRARY} - as simple name-identifiers. ++If you want to use LIBRARY as name then you need to quote it. ++ ++@item @code{IMPORTS ( (} @var{internal-name} @code{=} @var{module-name} @code{.} @var{integer} @code{) | [} @var{internal-name} @code{= ]} @var{module-name} @code{.} @var{external-name} @code{) [ == ) @var{its_name} @code{]} *} ++Declares that @var{external-name} or the exported function whose ++ordinal number is @var{integer} is to be imported from the file ++@var{module-name}. If @var{internal-name} is specified then this is ++the name that the imported function will be referred to in the body of ++the DLL. ++If @var{its_name} is specified, this name is used as string in import table. ++Note: The @code{IMPORTS} has to be the last command in .def file, as keywords ++are treated - beside @code{LIBRARY} - as simple name-identifiers. ++If you want to use LIBRARY as name then you need to quote it. ++ ++@item @code{DESCRIPTION} @var{string} ++Puts @var{string} into the output @file{.exp} file in the ++@code{.rdata} section. ++ ++@item @code{STACKSIZE} @var{number-reserve} @code{[, } @var{number-commit} @code{]} ++@item @code{HEAPSIZE} @var{number-reserve} @code{[, } @var{number-commit} @code{]} ++Generates @code{--stack} or @code{--heap} ++@var{number-reserve},@var{number-commit} in the output @code{.drectve} ++section. The linker will see this and act upon it. ++ ++@item @code{CODE} @var{attr} @code{+} ++@item @code{DATA} @var{attr} @code{+} ++@item @code{SECTIONS (} @var{section-name} @var{attr}@code{ + ) *} ++Generates @code{--attr} @var{section-name} @var{attr} in the output ++@code{.drectve} section, where @var{attr} is one of @code{READ}, ++@code{WRITE}, @code{EXECUTE} or @code{SHARED}. The linker will see ++this and act upon it. ++ ++@end table ++ ++@ignore ++@c man begin SEEALSO dlltool ++The Info pages for @file{binutils}. ++@c man end ++@end ignore ++ ++@node readelf ++@chapter readelf ++ ++@cindex ELF file information ++@kindex readelf ++ ++@c man title readelf display information about ELF files ++ ++@smallexample ++@c man begin SYNOPSIS readelf ++readelf [@option{-a}|@option{--all}] ++ [@option{-h}|@option{--file-header}] ++ [@option{-l}|@option{--program-headers}|@option{--segments}] ++ [@option{-S}|@option{--section-headers}|@option{--sections}] ++ [@option{-g}|@option{--section-groups}] ++ [@option{-t}|@option{--section-details}] ++ [@option{-e}|@option{--headers}] ++ [@option{-s}|@option{--syms}|@option{--symbols}] ++ [@option{--dyn-syms}] ++ [@option{-n}|@option{--notes}] ++ [@option{-r}|@option{--relocs}] ++ [@option{-u}|@option{--unwind}] ++ [@option{-d}|@option{--dynamic}] ++ [@option{-V}|@option{--version-info}] ++ [@option{-A}|@option{--arch-specific}] ++ [@option{-D}|@option{--use-dynamic}] ++ [@option{-L}|@option{--lint}|@option{--enable-checks}] ++ [@option{-x} |@option{--hex-dump=}] ++ [@option{-p} |@option{--string-dump=}] ++ [@option{-R} |@option{--relocated-dump=}] ++ [@option{-z}|@option{--decompress}] ++ [@option{-c}|@option{--archive-index}] ++ [@option{-w[lLiaprmfFsoORtUuTgAckK]}| ++ @option{--debug-dump}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow-links]] ++ [@option{--dwarf-depth=@var{n}}] ++ [@option{--dwarf-start=@var{n}}] ++ [@option{--ctf=}@var{section}] ++ [@option{--ctf-parent=}@var{section}] ++ [@option{--ctf-symbols=}@var{section}] ++ [@option{--ctf-strings=}@var{section}] ++ [@option{-I}|@option{--histogram}] ++ [@option{-v}|@option{--version}] ++ [@option{-W}|@option{--wide}] ++ [@option{-T}|@option{--silent-truncation}] ++ [@option{-H}|@option{--help}] ++ @var{elffile}@dots{} ++@c man end ++@end smallexample ++ ++@c man begin DESCRIPTION readelf ++ ++@command{readelf} displays information about one or more ELF format object ++files. The options control what particular information to display. ++ ++@var{elffile}@dots{} are the object files to be examined. 32-bit and ++64-bit ELF files are supported, as are archives containing ELF files. ++ ++This program performs a similar function to @command{objdump} but it ++goes into more detail and it exists independently of the @sc{bfd} ++library, so if there is a bug in @sc{bfd} then readelf will not be ++affected. ++ ++@c man end ++ ++@c man begin OPTIONS readelf ++ ++The long and short forms of options, shown here as alternatives, are ++equivalent. At least one option besides @samp{-v} or @samp{-H} must be ++given. ++ ++@table @env ++@item -a ++@itemx --all ++Equivalent to specifying @option{--file-header}, ++@option{--program-headers}, @option{--sections}, @option{--symbols}, ++@option{--relocs}, @option{--dynamic}, @option{--notes}, ++@option{--version-info}, @option{--arch-specific}, @option{--unwind}, ++@option{--section-groups} and @option{--histogram}. ++ ++Note - this option does not enable @option{--use-dynamic} itself, so ++if that option is not present on the command line then dynamic symbols ++and dynamic relocs will not be displayed. ++ ++@item -h ++@itemx --file-header ++@cindex ELF file header information ++Displays the information contained in the ELF header at the start of the ++file. ++ ++@item -l ++@itemx --program-headers ++@itemx --segments ++@cindex ELF program header information ++@cindex ELF segment information ++Displays the information contained in the file's segment headers, if it ++has any. ++ ++@item -S ++@itemx --sections ++@itemx --section-headers ++@cindex ELF section information ++Displays the information contained in the file's section headers, if it ++has any. ++ ++@item -g ++@itemx --section-groups ++@cindex ELF section group information ++Displays the information contained in the file's section groups, if it ++has any. ++ ++@item -t ++@itemx --section-details ++@cindex ELF section information ++Displays the detailed section information. Implies @option{-S}. ++ ++@item -s ++@itemx --symbols ++@itemx --syms ++@cindex ELF symbol table information ++Displays the entries in symbol table section of the file, if it has one. ++If a symbol has version information associated with it then this is ++displayed as well. The version string is displayed as a suffix to the ++symbol name, preceeded by an @@ character. For example ++@samp{foo@@VER_1}. If the version is the default version to be used ++when resolving unversioned references to the symbol then it is ++displayed as a suffix preceeded by two @@ characters. For example ++@samp{foo@@@@VER_2}. ++ ++@item --dyn-syms ++@cindex ELF dynamic symbol table information ++Displays the entries in dynamic symbol table section of the file, if it ++has one. The output format is the same as the format used by the ++@option{--syms} option. ++ ++@item -e ++@itemx --headers ++Display all the headers in the file. Equivalent to @option{-h -l -S}. ++ ++@item -n ++@itemx --notes ++@cindex ELF notes ++Displays the contents of the NOTE segments and/or sections, if any. ++ ++@item -r ++@itemx --relocs ++@cindex ELF reloc information ++Displays the contents of the file's relocation section, if it has one. ++ ++@item -u ++@itemx --unwind ++@cindex unwind information ++Displays the contents of the file's unwind section, if it has one. Only ++the unwind sections for IA64 ELF files, as well as ARM unwind tables ++(@code{.ARM.exidx} / @code{.ARM.extab}) are currently supported. If ++support is not yet implemented for your architecture you could try ++dumping the contents of the @var{.eh_frames} section using the ++@option{--debug-dump=frames} or @option{--debug-dump=frames-interp} ++options. ++ ++@item -d ++@itemx --dynamic ++@cindex ELF dynamic section information ++Displays the contents of the file's dynamic section, if it has one. ++ ++@item -V ++@itemx --version-info ++@cindex ELF version sections information ++Displays the contents of the version sections in the file, it they ++exist. ++ ++@item -A ++@itemx --arch-specific ++Displays architecture-specific information in the file, if there ++is any. ++ ++@item -D ++@itemx --use-dynamic ++When displaying symbols, this option makes @command{readelf} use the ++symbol hash tables in the file's dynamic section, rather than the ++symbol table sections. ++ ++When displaying relocations, this option makes @command{readelf} ++display the dynamic relocations rather than the static relocations. ++ ++@item -L ++@itemx --lint ++@itemx --enable-checks ++Displays warning messages about possible problems with the file(s) ++being examined. If used on its own then all of the contents of the ++file(s) will be examined. If used with one of the dumping options ++then the warning messages will only be produced for the things being ++displayed. ++ ++@item -x ++@itemx --hex-dump= ++Displays the contents of the indicated section as a hexadecimal bytes. ++A number identifies a particular section by index in the section table; ++any other string identifies all sections with that name in the object file. ++ ++@item -R ++@itemx --relocated-dump= ++Displays the contents of the indicated section as a hexadecimal ++bytes. A number identifies a particular section by index in the ++section table; any other string identifies all sections with that name ++in the object file. The contents of the section will be relocated ++before they are displayed. ++ ++@item -p ++@itemx --string-dump= ++Displays the contents of the indicated section as printable strings. ++A number identifies a particular section by index in the section table; ++any other string identifies all sections with that name in the object file. ++ ++@item -z ++@itemx --decompress ++Requests that the section(s) being dumped by @option{x}, @option{R} or ++@option{p} options are decompressed before being displayed. If the ++section(s) are not compressed then they are displayed as is. ++ ++@item -c ++@itemx --archive-index ++@cindex Archive file symbol index information ++Displays the file symbol index information contained in the header part ++of binary archives. Performs the same function as the @option{t} ++command to @command{ar}, but without using the BFD library. @xref{ar}. ++ ++@item -w[lLiaprmfFsOoRtUuTgAckK] ++@itemx --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow-links] ++@include debug.options.texi ++ ++@include ctf.options.texi ++@item --ctf-symbols=@var{section} ++@item --ctf-strings=@var{section} ++Specify the name of another section from which the CTF file can inherit ++strings and symbols. By default, the @code{.symtab} and its linked ++string table are used. ++ ++If either of @option{--ctf-symbols} or @option{--ctf-strings} is specified, the ++other must be specified as well. ++ ++@item -I ++@itemx --histogram ++Display a histogram of bucket list lengths when displaying the contents ++of the symbol tables. ++ ++@item -v ++@itemx --version ++Display the version number of readelf. ++ ++@item -W ++@itemx --wide ++Don't break output lines to fit into 80 columns. By default ++@command{readelf} breaks section header and segment listing lines for ++64-bit ELF files, so that they fit into 80 columns. This option causes ++@command{readelf} to print each section header resp. each segment one a ++single line, which is far more readable on terminals wider than 80 columns. ++ ++@item -T ++@itemx --silent-truncation ++Normally when readelf is displaying a symbol name, and it has to ++truncate the name to fit into an 80 column display, it will add a ++suffix of @code{[...]} to the name. This command line option ++disables this behaviour, allowing 5 more characters of the name to be ++displayed and restoring the old behaviour of readelf (prior to release ++2.35). ++ ++@item -H ++@itemx --help ++Display the command-line options understood by @command{readelf}. ++ ++@end table ++ ++@c man end ++ ++@ignore ++@c man begin SEEALSO readelf ++objdump(1), and the Info entries for @file{binutils}. ++@c man end ++@end ignore ++ ++@node elfedit ++@chapter elfedit ++ ++@cindex Update ELF header ++@kindex elfedit ++ ++@c man title elfedit update ELF header and program property of ELF files ++ ++@smallexample ++@c man begin SYNOPSIS elfedit ++elfedit [@option{--input-mach=}@var{machine}] ++ [@option{--input-type=}@var{type}] ++ [@option{--input-osabi=}@var{osabi}] ++ @option{--output-mach=}@var{machine} ++ @option{--output-type=}@var{type} ++ @option{--output-osabi=}@var{osabi} ++ @option{--enable-x86-feature=}@var{feature} ++ @option{--disable-x86-feature=}@var{feature} ++ [@option{-v}|@option{--version}] ++ [@option{-h}|@option{--help}] ++ @var{elffile}@dots{} ++@c man end ++@end smallexample ++ ++@c man begin DESCRIPTION elfedit ++ ++@command{elfedit} updates the ELF header and program property of ELF ++files which have the matching ELF machine and file types. The options ++control how and which fields in the ELF header and program property ++should be updated. ++ ++@var{elffile}@dots{} are the ELF files to be updated. 32-bit and ++64-bit ELF files are supported, as are archives containing ELF files. ++@c man end ++ ++@c man begin OPTIONS elfedit ++ ++The long and short forms of options, shown here as alternatives, are ++equivalent. At least one of the @option{--output-mach}, ++@option{--output-type}, @option{--output-osabi}, ++@option{--enable-x86-feature} and @option{--disable-x86-feature} ++options must be given. ++ ++@table @env ++ ++@item --input-mach=@var{machine} ++Set the matching input ELF machine type to @var{machine}. If ++@option{--input-mach} isn't specified, it will match any ELF ++machine types. ++ ++The supported ELF machine types are, @var{i386}, @var{IAMCU}, @var{L1OM}, ++@var{K1OM} and @var{x86-64}. ++ ++@item --output-mach=@var{machine} ++Change the ELF machine type in the ELF header to @var{machine}. The ++supported ELF machine types are the same as @option{--input-mach}. ++ ++@item --input-type=@var{type} ++Set the matching input ELF file type to @var{type}. If ++@option{--input-type} isn't specified, it will match any ELF file types. ++ ++The supported ELF file types are, @var{rel}, @var{exec} and @var{dyn}. ++ ++@item --output-type=@var{type} ++Change the ELF file type in the ELF header to @var{type}. The ++supported ELF types are the same as @option{--input-type}. ++ ++@item --input-osabi=@var{osabi} ++Set the matching input ELF file OSABI to @var{osabi}. If ++@option{--input-osabi} isn't specified, it will match any ELF OSABIs. ++ ++The supported ELF OSABIs are, @var{none}, @var{HPUX}, @var{NetBSD}, ++@var{GNU}, @var{Linux} (alias for @var{GNU}), ++@var{Solaris}, @var{AIX}, @var{Irix}, ++@var{FreeBSD}, @var{TRU64}, @var{Modesto}, @var{OpenBSD}, @var{OpenVMS}, ++@var{NSK}, @var{AROS} and @var{FenixOS}. ++ ++@item --output-osabi=@var{osabi} ++Change the ELF OSABI in the ELF header to @var{osabi}. The ++supported ELF OSABI are the same as @option{--input-osabi}. ++ ++@item --enable-x86-feature=@var{feature} ++Set the @var{feature} bit in program property in @var{exec} or @var{dyn} ++ELF files with machine types of @var{i386} or @var{x86-64}. The ++supported features are, @var{ibt} and @var{shstk}. ++ ++@item --disable-x86-feature=@var{feature} ++Clear the @var{feature} bit in program property in @var{exec} or ++@var{dyn} ELF files with machine types of @var{i386} or @var{x86-64}. ++The supported features are the same as @option{--enable-x86-feature}. ++ ++Note: @option{--enable-x86-feature} and @option{--disable-x86-feature} ++are available only on hosts with @samp{mmap} support. ++ ++@item -v ++@itemx --version ++Display the version number of @command{elfedit}. ++ ++@item -h ++@itemx --help ++Display the command-line options understood by @command{elfedit}. ++ ++@end table ++ ++@c man end ++ ++@ignore ++@c man begin SEEALSO elfedit ++readelf(1), and the Info entries for @file{binutils}. ++@c man end ++@end ignore ++ ++@node Common Options ++@chapter Common Options ++ ++The following command-line options are supported by all of the ++programs described in this manual. ++ ++@c man begin OPTIONS ++@table @env ++@include at-file.texi ++@c man end ++ ++@item --help ++Display the command-line options supported by the program. ++ ++@item --version ++Display the version number of the program. ++ ++@c man begin OPTIONS ++@end table ++@c man end ++ ++@node Selecting the Target System ++@chapter Selecting the Target System ++ ++You can specify two aspects of the target system to the @sc{gnu} ++binary file utilities, each in several ways: ++ ++@itemize @bullet ++@item ++the target ++ ++@item ++the architecture ++@end itemize ++ ++In the following summaries, the lists of ways to specify values are in ++order of decreasing precedence. The ways listed first override those ++listed later. ++ ++The commands to list valid values only list the values for which the ++programs you are running were configured. If they were configured with ++@option{--enable-targets=all}, the commands list most of the available ++values, but a few are left out; not all targets can be configured in at ++once because some of them can only be configured @dfn{native} (on hosts ++with the same type as the target system). ++ ++@menu ++* Target Selection:: ++* Architecture Selection:: ++@end menu ++ ++@node Target Selection ++@section Target Selection ++ ++A @dfn{target} is an object file format. A given target may be ++supported for multiple architectures (@pxref{Architecture Selection}). ++A target selection may also have variations for different operating ++systems or architectures. ++ ++The command to list valid target values is @samp{objdump -i} ++(the first column of output contains the relevant information). ++ ++Some sample values are: @samp{a.out-hp300bsd}, @samp{ecoff-littlemips}, ++@samp{a.out-sunos-big}. ++ ++You can also specify a target using a configuration triplet. This is ++the same sort of name that is passed to @file{configure} to specify a ++target. When you use a configuration triplet as an argument, it must be ++fully canonicalized. You can see the canonical version of a triplet by ++running the shell script @file{config.sub} which is included with the ++sources. ++ ++Some sample configuration triplets are: @samp{m68k-hp-bsd}, ++@samp{mips-dec-ultrix}, @samp{sparc-sun-sunos}. ++ ++@subheading @command{objdump} Target ++ ++Ways to specify: ++ ++@enumerate ++@item ++command-line option: @option{-b} or @option{--target} ++ ++@item ++environment variable @code{GNUTARGET} ++ ++@item ++deduced from the input file ++@end enumerate ++ ++@subheading @command{objcopy} and @command{strip} Input Target ++ ++Ways to specify: ++ ++@enumerate ++@item ++command-line options: @option{-I} or @option{--input-target}, or @option{-F} or @option{--target} ++ ++@item ++environment variable @code{GNUTARGET} ++ ++@item ++deduced from the input file ++@end enumerate ++ ++@subheading @command{objcopy} and @command{strip} Output Target ++ ++Ways to specify: ++ ++@enumerate ++@item ++command-line options: @option{-O} or @option{--output-target}, or @option{-F} or @option{--target} ++ ++@item ++the input target (see ``@command{objcopy} and @command{strip} Input Target'' above) ++ ++@item ++environment variable @code{GNUTARGET} ++ ++@item ++deduced from the input file ++@end enumerate ++ ++@subheading @command{nm}, @command{size}, and @command{strings} Target ++ ++Ways to specify: ++ ++@enumerate ++@item ++command-line option: @option{--target} ++ ++@item ++environment variable @code{GNUTARGET} ++ ++@item ++deduced from the input file ++@end enumerate ++ ++@node Architecture Selection ++@section Architecture Selection ++ ++An @dfn{architecture} is a type of @sc{cpu} on which an object file is ++to run. Its name may contain a colon, separating the name of the ++processor family from the name of the particular @sc{cpu}. ++ ++The command to list valid architecture values is @samp{objdump -i} (the ++second column contains the relevant information). ++ ++Sample values: @samp{m68k:68020}, @samp{mips:3000}, @samp{sparc}. ++ ++@subheading @command{objdump} Architecture ++ ++Ways to specify: ++ ++@enumerate ++@item ++command-line option: @option{-m} or @option{--architecture} ++ ++@item ++deduced from the input file ++@end enumerate ++ ++@subheading @command{objcopy}, @command{nm}, @command{size}, @command{strings} Architecture ++ ++Ways to specify: ++ ++@enumerate ++@item ++deduced from the input file ++@end enumerate ++ ++@node debuginfod ++@chapter debuginfod ++@cindex separate debug files ++ ++debuginfod is a web service that indexes ELF/DWARF debugging resources ++by build-id and serves them over HTTP. ++ ++Binutils can be built with the debuginfod client library ++@code{libdebuginfod} using the @option{--with-debuginfod} configure option. ++This option is enabled by default if @code{libdebuginfod} is installed ++and found at configure time. This allows @command{objdump} and ++@command{readelf} to automatically query debuginfod servers for ++separate debug files when the files are otherwise not found. ++ ++debuginfod is packaged with elfutils, starting with version 0.178. ++You can get the latest version from `https://sourceware.org/elfutils/'. ++ ++@node Reporting Bugs ++@chapter Reporting Bugs ++@cindex bugs ++@cindex reporting bugs ++ ++Your bug reports play an essential role in making the binary utilities ++reliable. ++ ++Reporting a bug may help you by bringing a solution to your problem, or ++it may not. But in any case the principal function of a bug report is ++to help the entire community by making the next version of the binary ++utilities work better. Bug reports are your contribution to their ++maintenance. ++ ++In order for a bug report to serve its purpose, you must include the ++information that enables us to fix the bug. ++ ++@menu ++* Bug Criteria:: Have you found a bug? ++* Bug Reporting:: How to report bugs ++@end menu ++ ++@node Bug Criteria ++@section Have You Found a Bug? ++@cindex bug criteria ++ ++If you are not sure whether you have found a bug, here are some guidelines: ++ ++@itemize @bullet ++@cindex fatal signal ++@cindex crash ++@item ++If a binary utility gets a fatal signal, for any input whatever, that is ++a bug. Reliable utilities never crash. ++ ++@cindex error on valid input ++@item ++If a binary utility produces an error message for valid input, that is a ++bug. ++ ++@item ++If you are an experienced user of binary utilities, your suggestions for ++improvement are welcome in any case. ++@end itemize ++ ++@node Bug Reporting ++@section How to Report Bugs ++@cindex bug reports ++@cindex bugs, reporting ++ ++A number of companies and individuals offer support for @sc{gnu} ++products. If you obtained the binary utilities from a support ++organization, we recommend you contact that organization first. ++ ++You can find contact information for many support companies and ++individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs ++distribution. ++ ++@ifset BUGURL ++In any event, we also recommend that you send bug reports for the binary ++utilities to @value{BUGURL}. ++@end ifset ++ ++The fundamental principle of reporting bugs usefully is this: ++@strong{report all the facts}. If you are not sure whether to state a ++fact or leave it out, state it! ++ ++Often people omit facts because they think they know what causes the ++problem and assume that some details do not matter. Thus, you might ++assume that the name of a file you use in an example does not matter. ++Well, probably it does not, but one cannot be sure. Perhaps the bug is ++a stray memory reference which happens to fetch from the location where ++that pathname is stored in memory; perhaps, if the pathname were ++different, the contents of that location would fool the utility into ++doing the right thing despite the bug. Play it safe and give a ++specific, complete example. That is the easiest thing for you to do, ++and the most helpful. ++ ++Keep in mind that the purpose of a bug report is to enable us to fix the bug if ++it is new to us. Therefore, always write your bug reports on the assumption ++that the bug has not been reported previously. ++ ++Sometimes people give a few sketchy facts and ask, ``Does this ring a ++bell?'' This cannot help us fix a bug, so it is basically useless. We ++respond by asking for enough details to enable us to investigate. ++You might as well expedite matters by sending them to begin with. ++ ++To enable us to fix the bug, you should include all these things: ++ ++@itemize @bullet ++@item ++The version of the utility. Each utility announces it if you start it ++with the @option{--version} argument. ++ ++Without this, we will not know whether there is any point in looking for ++the bug in the current version of the binary utilities. ++ ++@item ++Any patches you may have applied to the source, including any patches ++made to the @code{BFD} library. ++ ++@item ++The type of machine you are using, and the operating system name and ++version number. ++ ++@item ++What compiler (and its version) was used to compile the utilities---e.g. ++``@code{gcc-2.7}''. ++ ++@item ++The command arguments you gave the utility to observe the bug. To ++guarantee you will not omit something important, list them all. A copy ++of the Makefile (or the output from make) is sufficient. ++ ++If we were to try to guess the arguments, we would probably guess wrong ++and then we might not encounter the bug. ++ ++@item ++A complete input file, or set of input files, that will reproduce the ++bug. If the utility is reading an object file or files, then it is ++generally most helpful to send the actual object files. ++ ++If the source files were produced exclusively using @sc{gnu} programs ++(e.g., @command{gcc}, @command{gas}, and/or the @sc{gnu} @command{ld}), then it ++may be OK to send the source files rather than the object files. In ++this case, be sure to say exactly what version of @command{gcc}, or ++whatever, was used to produce the object files. Also say how ++@command{gcc}, or whatever, was configured. ++ ++@item ++A description of what behavior you observe that you believe is ++incorrect. For example, ``It gets a fatal signal.'' ++ ++Of course, if the bug is that the utility gets a fatal signal, then we ++will certainly notice it. But if the bug is incorrect output, we might ++not notice unless it is glaringly wrong. You might as well not give us ++a chance to make a mistake. ++ ++Even if the problem you experience is a fatal signal, you should still ++say so explicitly. Suppose something strange is going on, such as your ++copy of the utility is out of sync, or you have encountered a bug in ++the C library on your system. (This has happened!) Your copy might ++crash and ours would not. If you told us to expect a crash, then when ++ours fails to crash, we would know that the bug was not happening for ++us. If you had not told us to expect a crash, then we would not be able ++to draw any conclusion from our observations. ++ ++@item ++If you wish to suggest changes to the source, send us context diffs, as ++generated by @command{diff} with the @option{-u}, @option{-c}, or @option{-p} ++option. Always send diffs from the old file to the new file. If you ++wish to discuss something in the @command{ld} source, refer to it by ++context, not by line number. ++ ++The line numbers in our development sources will not match those in your ++sources. Your line numbers would convey no useful information to us. ++@end itemize ++ ++Here are some things that are not necessary: ++ ++@itemize @bullet ++@item ++A description of the envelope of the bug. ++ ++Often people who encounter a bug spend a lot of time investigating ++which changes to the input file will make the bug go away and which ++changes will not affect it. ++ ++This is often time consuming and not very useful, because the way we ++will find the bug is by running a single example under the debugger ++with breakpoints, not by pure deduction from a series of examples. ++We recommend that you save your time for something else. ++ ++Of course, if you can find a simpler example to report @emph{instead} ++of the original one, that is a convenience for us. Errors in the ++output will be easier to spot, running under the debugger will take ++less time, and so on. ++ ++However, simplification is not vital; if you do not want to do this, ++report the bug anyway and send us the entire test case you used. ++ ++@item ++A patch for the bug. ++ ++A patch for the bug does help us if it is a good one. But do not omit ++the necessary information, such as the test case, on the assumption that ++a patch is all we need. We might see problems with your patch and decide ++to fix the problem another way, or we might not understand it at all. ++ ++Sometimes with programs as complicated as the binary utilities it is ++very hard to construct an example that will make the program follow a ++certain path through the code. If you do not send us the example, we ++will not be able to construct one, so we will not be able to verify that ++the bug is fixed. ++ ++And if we cannot understand what bug you are trying to fix, or why your ++patch should be an improvement, we will not install it. A test case will ++help us to understand. ++ ++@item ++A guess about what the bug is or what it depends on. ++ ++Such guesses are usually wrong. Even we cannot guess right about such ++things without first using the debugger to find the facts. ++@end itemize ++ ++@node GNU Free Documentation License ++@appendix GNU Free Documentation License ++ ++@include fdl.texi ++ ++@node Binutils Index ++@unnumbered Binutils Index ++ ++@printindex cp ++ ++@bye +diff -rupN binutils.orig/binutils/doc/binutils.texi.rej binutils-2.35.2/binutils/doc/binutils.texi.rej +--- binutils.orig/binutils/doc/binutils.texi.rej 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/doc/binutils.texi.rej 2021-11-09 16:53:47.883895439 +0000 +@@ -0,0 +1,18 @@ ++--- binutils/doc/binutils.texi 2021-11-09 12:34:21.665802922 +0000 +++++ binutils/doc/binutils.texi 2021-11-09 12:34:46.290643870 +0000 ++@@ -812,6 +812,7 @@ nm [@option{-A}|@option{-o}|@option{--pr ++ [@option{-s}|@option{--print-armap}] ++ [@option{-t} @var{radix}|@option{--radix=}@var{radix}] ++ [@option{-u}|@option{--undefined-only}] +++ [@option{-U} @var{method}] [@option{--unicode=}@var{method}] ++ [@option{-V}|@option{--version}] ++ [@option{-X 32_64}] ++ [@option{--defined-only}] ++@@ -4850,6 +4905,7 @@ readelf [@option{-a}|@option{--all}] ++ [@option{--demangle@var{=style}}|@option{--no-demangle}] ++ [@option{--quiet}] ++ [@option{--recurse-limit}|@option{--no-recurse-limit}] +++ [@option{-U} @var{method}|@option{--unicode=}@var{method}] ++ [@option{-n}|@option{--notes}] ++ [@option{-r}|@option{--relocs}] ++ [@option{-u}|@option{--unwind}] +diff -rupN binutils.orig/binutils/nm.c binutils-2.35.2/binutils/nm.c +--- binutils.orig/binutils/nm.c 2021-11-09 16:53:12.814128300 +0000 ++++ binutils-2.35.2/binutils/nm.c 2021-11-09 16:57:07.535570448 +0000 +@@ -38,6 +38,11 @@ + #include "bucomm.h" + #include "plugin-api.h" + #include "plugin.h" ++#include "safe-ctype.h" ++ ++#ifndef streq ++#define streq(a,b) (strcmp ((a),(b)) == 0) ++#endif + + /* When sorting by size, we use this structure to hold the size and a + pointer to the minisymbol. */ +@@ -185,6 +190,18 @@ static const char *plugin_target = NULL; + static bfd *lineno_cache_bfd; + static bfd *lineno_cache_rel_bfd; + ++typedef enum unicode_display_type ++{ ++ unicode_default = 0, ++ unicode_locale, ++ unicode_escape, ++ unicode_hex, ++ unicode_highlight, ++ unicode_invalid ++} unicode_display_type; ++ ++static unicode_display_type unicode_display = unicode_default; ++ + enum long_option_values + { + OPTION_TARGET = 200, +@@ -225,6 +242,7 @@ static struct option long_options[] = + {"target", required_argument, 0, OPTION_TARGET}, + {"defined-only", no_argument, &defined_only, 1}, + {"undefined-only", no_argument, &undefined_only, 1}, ++ {"unicode", required_argument, NULL, 'U'}, + {"version", no_argument, &show_version, 1}, + {"with-symbol-versions", no_argument, NULL, + OPTION_WITH_SYMBOL_VERSIONS}, +@@ -275,6 +293,8 @@ usage (FILE *stream, int status) + -t, --radix=RADIX Use RADIX for printing symbol values\n\ + --target=BFDNAME Specify the target object format as BFDNAME\n\ + -u, --undefined-only Display only undefined symbols\n\ ++ -U {d|s|i|x|e|h} Specify how to treat UTF-8 encoded unicode characters\n\ ++ --unicode={default|show|invalid|hex|escape|highlight}\n\ + --with-symbol-versions Display version strings after symbol names\n\ + -X 32_64 (ignored)\n\ + @FILE Read options from FILE\n\ +@@ -390,6 +410,187 @@ get_coff_symbol_type (const struct inter + return bufp; + } + ++/* Convert a potential UTF-8 encoded sequence in IN into characters in OUT. ++ The conversion format is controlled by the unicode_display variable. ++ Returns the number of characters added to OUT. ++ Returns the number of bytes consumed from IN in CONSUMED. ++ Always consumes at least one byte and displays at least one character. */ ++ ++static unsigned int ++display_utf8 (const unsigned char * in, char * out, unsigned int * consumed) ++{ ++ char * orig_out = out; ++ unsigned int nchars = 0; ++ unsigned int j; ++ ++ if (unicode_display == unicode_default) ++ goto invalid; ++ ++ if (in[0] < 0xc0) ++ goto invalid; ++ ++ if ((in[1] & 0xc0) != 0x80) ++ goto invalid; ++ ++ if ((in[0] & 0x20) == 0) ++ { ++ nchars = 2; ++ goto valid; ++ } ++ ++ if ((in[2] & 0xc0) != 0x80) ++ goto invalid; ++ ++ if ((in[0] & 0x10) == 0) ++ { ++ nchars = 3; ++ goto valid; ++ } ++ ++ if ((in[3] & 0xc0) != 0x80) ++ goto invalid; ++ ++ nchars = 4; ++ ++ valid: ++ switch (unicode_display) ++ { ++ case unicode_locale: ++ /* Copy the bytes into the output buffer as is. */ ++ memcpy (out, in, nchars); ++ out += nchars; ++ break; ++ ++ case unicode_invalid: ++ case unicode_hex: ++ out += sprintf (out, "%c", unicode_display == unicode_hex ? '<' : '{'); ++ out += sprintf (out, "0x"); ++ for (j = 0; j < nchars; j++) ++ out += sprintf (out, "%02x", in [j]); ++ out += sprintf (out, "%c", unicode_display == unicode_hex ? '>' : '}'); ++ break; ++ ++ case unicode_highlight: ++ if (isatty (1)) ++ out += sprintf (out, "\x1B[31;47m"); /* Red. */ ++ /* Fall through. */ ++ case unicode_escape: ++ switch (nchars) ++ { ++ case 2: ++ out += sprintf (out, "\\u%02x%02x", ++ ((in[0] & 0x1c) >> 2), ++ ((in[0] & 0x03) << 6) | (in[1] & 0x3f)); ++ break; ++ ++ case 3: ++ out += sprintf (out, "\\u%02x%02x", ++ ((in[0] & 0x0f) << 4) | ((in[1] & 0x3c) >> 2), ++ ((in[1] & 0x03) << 6) | ((in[2] & 0x3f))); ++ break; ++ ++ case 4: ++ out += sprintf (out, "\\u%02x%02x%02x", ++ ((in[0] & 0x07) << 6) | ((in[1] & 0x3c) >> 2), ++ ((in[1] & 0x03) << 6) | ((in[2] & 0x3c) >> 2), ++ ((in[2] & 0x03) << 6) | ((in[3] & 0x3f))); ++ break; ++ default: ++ /* URG. */ ++ break; ++ } ++ ++ if (unicode_display == unicode_highlight && isatty (1)) ++ out += sprintf (out, "\033[0m"); /* Default colour. */ ++ break; ++ ++ default: ++ /* URG */ ++ break; ++ } ++ ++ * consumed = nchars; ++ return out - orig_out; ++ ++ invalid: ++ /* Not a valid UTF-8 sequence. */ ++ *out = *in; ++ * consumed = 1; ++ return 1; ++} ++ ++/* Convert any UTF-8 encoded characters in NAME into the form specified by ++ unicode_display. Also converts control characters. Returns a static ++ buffer if conversion was necessary. ++ Code stolen from objdump.c:sanitize_string(). */ ++ ++static const char * ++convert_utf8 (const char * in) ++{ ++ static char * buffer = NULL; ++ static size_t buffer_len = 0; ++ const char * original = in; ++ char * out; ++ ++ /* Paranoia. */ ++ if (in == NULL) ++ return ""; ++ ++ /* See if any conversion is necessary. ++ In the majority of cases it will not be needed. */ ++ do ++ { ++ unsigned char c = *in++; ++ ++ if (c == 0) ++ return original; ++ ++ if (ISCNTRL (c)) ++ break; ++ ++ if (unicode_display != unicode_default && c >= 0xc0) ++ break; ++ } ++ while (1); ++ ++ /* Copy the input, translating as needed. */ ++ in = original; ++ if (buffer_len < (strlen (in) * 9)) ++ { ++ free ((void *) buffer); ++ buffer_len = strlen (in) * 9; ++ buffer = xmalloc (buffer_len + 1); ++ } ++ ++ out = buffer; ++ do ++ { ++ unsigned char c = *in++; ++ ++ if (c == 0) ++ break; ++ ++ if (ISCNTRL (c)) ++ { ++ *out++ = '^'; ++ *out++ = c + 0x40; ++ } ++ else if (unicode_display != unicode_default && c >= 0xc0) ++ { ++ unsigned int num_consumed; ++ ++ out += display_utf8 ((const unsigned char *)(in - 1), out, & num_consumed); ++ in += num_consumed - 1; ++ } ++ else ++ *out++ = c; ++ } ++ while (1); ++ ++ *out = 0; ++ return buffer; ++} ++ + /* Print symbol name NAME, read from ABFD, with printf format FORM, + demangling it if requested. */ + +@@ -408,6 +609,11 @@ print_symname (const char *form, struct + name = alloc; + } + ++ if (unicode_display != unicode_default) ++ { ++ name = convert_utf8 (name); ++ } ++ + if (info != NULL && info->elfinfo) + { + const char *version_string; +@@ -1716,7 +1922,7 @@ main (int argc, char **argv) + fatal (_("fatal error: libbfd ABI mismatch")); + set_default_bfd_target (); + +- while ((c = getopt_long (argc, argv, "aABCDef:gHhlnopPrSst:uvVvX:", ++ while ((c = getopt_long (argc, argv, "aABCDef:gHhlnopPrSst:U:uvVvX:", + long_options, (int *) 0)) != EOF) + { + switch (c) +@@ -1806,6 +2012,24 @@ main (int argc, char **argv) + case 'u': + undefined_only = 1; + break; ++ ++ case 'U': ++ if (streq (optarg, "default") || streq (optarg, "d")) ++ unicode_display = unicode_default; ++ else if (streq (optarg, "locale") || streq (optarg, "l")) ++ unicode_display = unicode_locale; ++ else if (streq (optarg, "escape") || streq (optarg, "e")) ++ unicode_display = unicode_escape; ++ else if (streq (optarg, "invalid") || streq (optarg, "i")) ++ unicode_display = unicode_invalid; ++ else if (streq (optarg, "hex") || streq (optarg, "x")) ++ unicode_display = unicode_hex; ++ else if (streq (optarg, "highlight") || streq (optarg, "h")) ++ unicode_display = unicode_highlight; ++ else ++ fatal (_("invalid argument to -U/--unicode: %s"), optarg); ++ break; ++ + case 'V': + show_version = 1; + break; +diff -rupN binutils.orig/binutils/nm.c.orig binutils-2.35.2/binutils/nm.c.orig +--- binutils.orig/binutils/nm.c.orig 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/nm.c.orig 2021-01-30 08:38:03.000000000 +0000 +@@ -0,0 +1,1875 @@ ++/* nm.c -- Describe symbol table of a rel file. ++ Copyright (C) 1991-2020 Free Software Foundation, Inc. ++ ++ This file is part of GNU Binutils. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA ++ 02110-1301, USA. */ ++ ++#include "sysdep.h" ++#include "bfd.h" ++#include "progress.h" ++#include "getopt.h" ++#include "aout/stab_gnu.h" ++#include "aout/ranlib.h" ++#include "demangle.h" ++#include "libiberty.h" ++#include "elf-bfd.h" ++#include "elf/common.h" ++#define DO_NOT_DEFINE_AOUTHDR ++#define DO_NOT_DEFINE_FILHDR ++#define DO_NOT_DEFINE_LINENO ++#define DO_NOT_DEFINE_SCNHDR ++#include "coff/external.h" ++#include "coff/internal.h" ++#include "libcoff.h" ++#include "bucomm.h" ++#include "plugin-api.h" ++#include "plugin.h" ++ ++/* When sorting by size, we use this structure to hold the size and a ++ pointer to the minisymbol. */ ++ ++struct size_sym ++{ ++ const void *minisym; ++ bfd_vma size; ++}; ++ ++/* When fetching relocs, we use this structure to pass information to ++ get_relocs. */ ++ ++struct get_relocs_info ++{ ++ asection **secs; ++ arelent ***relocs; ++ long *relcount; ++ asymbol **syms; ++}; ++ ++struct extended_symbol_info ++{ ++ symbol_info *sinfo; ++ bfd_vma ssize; ++ elf_symbol_type *elfinfo; ++ coff_symbol_type *coffinfo; ++ /* FIXME: We should add more fields for Type, Line, Section. */ ++}; ++#define SYM_VALUE(sym) (sym->sinfo->value) ++#define SYM_TYPE(sym) (sym->sinfo->type) ++#define SYM_STAB_NAME(sym) (sym->sinfo->stab_name) ++#define SYM_STAB_DESC(sym) (sym->sinfo->stab_desc) ++#define SYM_STAB_OTHER(sym) (sym->sinfo->stab_other) ++#define SYM_SIZE(sym) \ ++ (sym->elfinfo ? sym->elfinfo->internal_elf_sym.st_size: sym->ssize) ++ ++/* The output formatting functions. */ ++static void print_object_filename_bsd (const char *); ++static void print_object_filename_sysv (const char *); ++static void print_object_filename_posix (const char *); ++static void print_archive_filename_bsd (const char *); ++static void print_archive_filename_sysv (const char *); ++static void print_archive_filename_posix (const char *); ++static void print_archive_member_bsd (const char *, const char *); ++static void print_archive_member_sysv (const char *, const char *); ++static void print_archive_member_posix (const char *, const char *); ++static void print_symbol_filename_bsd (bfd *, bfd *); ++static void print_symbol_filename_sysv (bfd *, bfd *); ++static void print_symbol_filename_posix (bfd *, bfd *); ++static void print_value (bfd *, bfd_vma); ++static void print_symbol_info_bsd (struct extended_symbol_info *, bfd *); ++static void print_symbol_info_sysv (struct extended_symbol_info *, bfd *); ++static void print_symbol_info_posix (struct extended_symbol_info *, bfd *); ++ ++/* Support for different output formats. */ ++struct output_fns ++ { ++ /* Print the name of an object file given on the command line. */ ++ void (*print_object_filename) (const char *); ++ ++ /* Print the name of an archive file given on the command line. */ ++ void (*print_archive_filename) (const char *); ++ ++ /* Print the name of an archive member file. */ ++ void (*print_archive_member) (const char *, const char *); ++ ++ /* Print the name of the file (and archive, if there is one) ++ containing a symbol. */ ++ void (*print_symbol_filename) (bfd *, bfd *); ++ ++ /* Print a line of information about a symbol. */ ++ void (*print_symbol_info) (struct extended_symbol_info *, bfd *); ++ }; ++ ++static struct output_fns formats[] = ++{ ++ {print_object_filename_bsd, ++ print_archive_filename_bsd, ++ print_archive_member_bsd, ++ print_symbol_filename_bsd, ++ print_symbol_info_bsd}, ++ {print_object_filename_sysv, ++ print_archive_filename_sysv, ++ print_archive_member_sysv, ++ print_symbol_filename_sysv, ++ print_symbol_info_sysv}, ++ {print_object_filename_posix, ++ print_archive_filename_posix, ++ print_archive_member_posix, ++ print_symbol_filename_posix, ++ print_symbol_info_posix} ++}; ++ ++/* Indices in `formats'. */ ++#define FORMAT_BSD 0 ++#define FORMAT_SYSV 1 ++#define FORMAT_POSIX 2 ++#define FORMAT_DEFAULT FORMAT_BSD ++ ++/* The output format to use. */ ++static struct output_fns *format = &formats[FORMAT_DEFAULT]; ++static unsigned int print_format = FORMAT_DEFAULT; ++static const char *print_format_string = NULL; ++ ++/* Command options. */ ++ ++static int do_demangle = 0; /* Pretty print C++ symbol names. */ ++static int external_only = 0; /* Print external symbols only. */ ++static int defined_only = 0; /* Print defined symbols only. */ ++static int no_sort = 0; /* Don't sort; print syms in order found. */ ++static int print_debug_syms = 0;/* Print debugger-only symbols too. */ ++static int print_armap = 0; /* Describe __.SYMDEF data in archive files. */ ++static int print_size = 0; /* Print size of defined symbols. */ ++static int reverse_sort = 0; /* Sort in downward(alpha or numeric) order. */ ++static int sort_numerically = 0;/* Sort in numeric rather than alpha order. */ ++static int sort_by_size = 0; /* Sort by size of symbol. */ ++static int undefined_only = 0; /* Print undefined symbols only. */ ++static int dynamic = 0; /* Print dynamic symbols. */ ++static int show_version = 0; /* Show the version number. */ ++static int show_synthetic = 0; /* Display synthesized symbols too. */ ++static int line_numbers = 0; /* Print line numbers for symbols. */ ++static int allow_special_symbols = 0; /* Allow special symbols. */ ++ ++static int demangle_flags = DMGL_ANSI | DMGL_PARAMS; ++ ++/* When to print the names of files. Not mutually exclusive in SYSV format. */ ++static int filename_per_file = 0; /* Once per file, on its own line. */ ++static int filename_per_symbol = 0; /* Once per symbol, at start of line. */ ++ ++static int print_width = 0; ++static int print_radix = 16; ++/* Print formats for printing stab info. */ ++static char other_format[] = "%02x"; ++static char desc_format[] = "%04x"; ++ ++static char *target = NULL; ++#if BFD_SUPPORTS_PLUGINS ++static const char *plugin_target = "plugin"; ++#else ++static const char *plugin_target = NULL; ++#endif ++ ++/* Used to cache the line numbers for a BFD. */ ++static bfd *lineno_cache_bfd; ++static bfd *lineno_cache_rel_bfd; ++ ++enum long_option_values ++{ ++ OPTION_TARGET = 200, ++ OPTION_PLUGIN, ++ OPTION_SIZE_SORT, ++ OPTION_RECURSE_LIMIT, ++ OPTION_NO_RECURSE_LIMIT, ++ OPTION_WITH_SYMBOL_VERSIONS ++}; ++ ++static struct option long_options[] = ++{ ++ {"debug-syms", no_argument, &print_debug_syms, 1}, ++ {"demangle", optional_argument, 0, 'C'}, ++ {"dynamic", no_argument, &dynamic, 1}, ++ {"extern-only", no_argument, &external_only, 1}, ++ {"format", required_argument, 0, 'f'}, ++ {"help", no_argument, 0, 'h'}, ++ {"line-numbers", no_argument, 0, 'l'}, ++ {"no-cplus", no_argument, &do_demangle, 0}, /* Linux compatibility. */ ++ {"no-demangle", no_argument, &do_demangle, 0}, ++ {"no-recurse-limit", no_argument, NULL, OPTION_NO_RECURSE_LIMIT}, ++ {"no-recursion-limit", no_argument, NULL, OPTION_NO_RECURSE_LIMIT}, ++ {"no-sort", no_argument, 0, 'p'}, ++ {"numeric-sort", no_argument, 0, 'n'}, ++ {"plugin", required_argument, 0, OPTION_PLUGIN}, ++ {"portability", no_argument, 0, 'P'}, ++ {"print-armap", no_argument, &print_armap, 1}, ++ {"print-file-name", no_argument, 0, 'o'}, ++ {"print-size", no_argument, 0, 'S'}, ++ {"radix", required_argument, 0, 't'}, ++ {"recurse-limit", no_argument, NULL, OPTION_RECURSE_LIMIT}, ++ {"recursion-limit", no_argument, NULL, OPTION_RECURSE_LIMIT}, ++ {"reverse-sort", no_argument, &reverse_sort, 1}, ++ {"size-sort", no_argument, 0, OPTION_SIZE_SORT}, ++ {"special-syms", no_argument, &allow_special_symbols, 1}, ++ {"synthetic", no_argument, &show_synthetic, 1}, ++ {"target", required_argument, 0, OPTION_TARGET}, ++ {"defined-only", no_argument, &defined_only, 1}, ++ {"undefined-only", no_argument, &undefined_only, 1}, ++ {"version", no_argument, &show_version, 1}, ++ {"with-symbol-versions", no_argument, NULL, ++ OPTION_WITH_SYMBOL_VERSIONS}, ++ {0, no_argument, 0, 0} ++}; ++ ++/* Some error-reporting functions. */ ++ ++ATTRIBUTE_NORETURN static void ++usage (FILE *stream, int status) ++{ ++ fprintf (stream, _("Usage: %s [option(s)] [file(s)]\n"), program_name); ++ fprintf (stream, _(" List symbols in [file(s)] (a.out by default).\n")); ++ fprintf (stream, _(" The options are:\n\ ++ -a, --debug-syms Display debugger-only symbols\n\ ++ -A, --print-file-name Print name of the input file before every symbol\n\ ++ -B Same as --format=bsd\n\ ++ -C, --demangle[=STYLE] Decode low-level symbol names into user-level names\n\ ++ The STYLE, if specified, can be `auto' (the default),\n\ ++ `gnu', `lucid', `arm', `hp', `edg', `gnu-v3', `java'\n\ ++ or `gnat'\n\ ++ --no-demangle Do not demangle low-level symbol names\n\ ++ --recurse-limit Enable a demangling recursion limit. This is the default.\n\ ++ --no-recurse-limit Disable a demangling recursion limit.\n\ ++ -D, --dynamic Display dynamic symbols instead of normal symbols\n\ ++ --defined-only Display only defined symbols\n\ ++ -e (ignored)\n\ ++ -f, --format=FORMAT Use the output format FORMAT. FORMAT can be `bsd',\n\ ++ `sysv' or `posix'. The default is `bsd'\n\ ++ -g, --extern-only Display only external symbols\n\ ++ -l, --line-numbers Use debugging information to find a filename and\n\ ++ line number for each symbol\n\ ++ -n, --numeric-sort Sort symbols numerically by address\n\ ++ -o Same as -A\n\ ++ -p, --no-sort Do not sort the symbols\n\ ++ -P, --portability Same as --format=posix\n\ ++ -r, --reverse-sort Reverse the sense of the sort\n")); ++#if BFD_SUPPORTS_PLUGINS ++ fprintf (stream, _("\ ++ --plugin NAME Load the specified plugin\n")); ++#endif ++ fprintf (stream, _("\ ++ -S, --print-size Print size of defined symbols\n\ ++ -s, --print-armap Include index for symbols from archive members\n\ ++ --size-sort Sort symbols by size\n\ ++ --special-syms Include special symbols in the output\n\ ++ --synthetic Display synthetic symbols as well\n\ ++ -t, --radix=RADIX Use RADIX for printing symbol values\n\ ++ --target=BFDNAME Specify the target object format as BFDNAME\n\ ++ -u, --undefined-only Display only undefined symbols\n\ ++ --with-symbol-versions Display version strings after symbol names\n\ ++ -X 32_64 (ignored)\n\ ++ @FILE Read options from FILE\n\ ++ -h, --help Display this information\n\ ++ -V, --version Display this program's version number\n\ ++\n")); ++ list_supported_targets (program_name, stream); ++ if (REPORT_BUGS_TO[0] && status == 0) ++ fprintf (stream, _("Report bugs to %s.\n"), REPORT_BUGS_TO); ++ exit (status); ++} ++ ++/* Set the radix for the symbol value and size according to RADIX. */ ++ ++static void ++set_print_radix (char *radix) ++{ ++ switch (*radix) ++ { ++ case 'x': print_radix = 16; break; ++ case 'd': print_radix = 10; break; ++ case 'o': print_radix = 8; break; ++ ++ default: ++ fatal (_("%s: invalid radix"), radix); ++ } ++ ++ other_format[3] = desc_format[3] = *radix; ++} ++ ++static void ++set_output_format (char *f) ++{ ++ int i; ++ ++ switch (*f) ++ { ++ case 'b': ++ case 'B': ++ i = FORMAT_BSD; ++ break; ++ case 'p': ++ case 'P': ++ i = FORMAT_POSIX; ++ break; ++ case 's': ++ case 'S': ++ i = FORMAT_SYSV; ++ break; ++ default: ++ fatal (_("%s: invalid output format"), f); ++ } ++ format = &formats[i]; ++ print_format = i; ++} ++ ++static const char * ++get_elf_symbol_type (unsigned int type) ++{ ++ static char *bufp; ++ int n; ++ ++ switch (type) ++ { ++ case STT_NOTYPE: return "NOTYPE"; ++ case STT_OBJECT: return "OBJECT"; ++ case STT_FUNC: return "FUNC"; ++ case STT_SECTION: return "SECTION"; ++ case STT_FILE: return "FILE"; ++ case STT_COMMON: return "COMMON"; ++ case STT_TLS: return "TLS"; ++ } ++ ++ free (bufp); ++ if (type >= STT_LOPROC && type <= STT_HIPROC) ++ n = asprintf (&bufp, _(": %d"), type); ++ else if (type >= STT_LOOS && type <= STT_HIOS) ++ n = asprintf (&bufp, _(": %d"), type); ++ else ++ n = asprintf (&bufp, _(": %d"), type); ++ if (n < 0) ++ fatal ("%s", xstrerror (errno)); ++ return bufp; ++} ++ ++static const char * ++get_coff_symbol_type (const struct internal_syment *sym) ++{ ++ static char *bufp; ++ int n; ++ ++ switch (sym->n_sclass) ++ { ++ case C_BLOCK: return "Block"; ++ case C_FILE: return "File"; ++ case C_LINE: return "Line"; ++ } ++ ++ if (!sym->n_type) ++ return "None"; ++ ++ switch (DTYPE(sym->n_type)) ++ { ++ case DT_FCN: return "Function"; ++ case DT_PTR: return "Pointer"; ++ case DT_ARY: return "Array"; ++ } ++ ++ free (bufp); ++ n = asprintf (&bufp, _(": %d/%d"), sym->n_sclass, sym->n_type); ++ if (n < 0) ++ fatal ("%s", xstrerror (errno)); ++ return bufp; ++} ++ ++/* Print symbol name NAME, read from ABFD, with printf format FORM, ++ demangling it if requested. */ ++ ++static void ++print_symname (const char *form, struct extended_symbol_info *info, ++ const char *name, bfd *abfd) ++{ ++ char *alloc = NULL; ++ ++ if (name == NULL) ++ name = info->sinfo->name; ++ if (do_demangle && *name) ++ { ++ alloc = bfd_demangle (abfd, name, demangle_flags); ++ if (alloc != NULL) ++ name = alloc; ++ } ++ ++ if (info != NULL && info->elfinfo) ++ { ++ const char *version_string; ++ bfd_boolean hidden; ++ ++ version_string ++ = bfd_get_symbol_version_string (abfd, &info->elfinfo->symbol, ++ FALSE, &hidden); ++ if (version_string && version_string[0]) ++ { ++ const char *at = "@@"; ++ if (hidden || bfd_is_und_section (info->elfinfo->symbol.section)) ++ at = "@"; ++ alloc = reconcat (alloc, name, at, version_string, NULL); ++ if (alloc != NULL) ++ name = alloc; ++ } ++ } ++ printf (form, name); ++ free (alloc); ++} ++ ++static void ++print_symdef_entry (bfd *abfd) ++{ ++ symindex idx = BFD_NO_MORE_SYMBOLS; ++ carsym *thesym; ++ bfd_boolean everprinted = FALSE; ++ ++ for (idx = bfd_get_next_mapent (abfd, idx, &thesym); ++ idx != BFD_NO_MORE_SYMBOLS; ++ idx = bfd_get_next_mapent (abfd, idx, &thesym)) ++ { ++ bfd *elt; ++ if (!everprinted) ++ { ++ printf (_("\nArchive index:\n")); ++ everprinted = TRUE; ++ } ++ elt = bfd_get_elt_at_index (abfd, idx); ++ if (elt == NULL) ++ bfd_fatal ("bfd_get_elt_at_index"); ++ if (thesym->name != (char *) NULL) ++ { ++ print_symname ("%s", NULL, thesym->name, abfd); ++ printf (" in %s\n", bfd_get_filename (elt)); ++ } ++ } ++} ++ ++ ++/* True when we can report missing plugin error. */ ++bfd_boolean report_plugin_err = TRUE; ++ ++/* Choose which symbol entries to print; ++ compact them downward to get rid of the rest. ++ Return the number of symbols to be printed. */ ++ ++static long ++filter_symbols (bfd *abfd, bfd_boolean is_dynamic, void *minisyms, ++ long symcount, unsigned int size) ++{ ++ bfd_byte *from, *fromend, *to; ++ asymbol *store; ++ ++ store = bfd_make_empty_symbol (abfd); ++ if (store == NULL) ++ bfd_fatal (bfd_get_filename (abfd)); ++ ++ from = (bfd_byte *) minisyms; ++ fromend = from + symcount * size; ++ to = (bfd_byte *) minisyms; ++ ++ for (; from < fromend; from += size) ++ { ++ int keep = 0; ++ asymbol *sym; ++ ++ PROGRESS (1); ++ ++ sym = bfd_minisymbol_to_symbol (abfd, is_dynamic, (const void *) from, store); ++ if (sym == NULL) ++ bfd_fatal (bfd_get_filename (abfd)); ++ ++ if (sym->name[0] == '_' ++ && sym->name[1] == '_' ++ && strcmp (sym->name + (sym->name[2] == '_'), "__gnu_lto_slim") == 0 ++ && report_plugin_err) ++ { ++ report_plugin_err = FALSE; ++ non_fatal (_("%s: plugin needed to handle lto object"), ++ bfd_get_filename (abfd)); ++ } ++ ++ if (undefined_only) ++ keep = bfd_is_und_section (sym->section); ++ else if (external_only) ++ /* PR binutls/12753: Unique symbols are global too. */ ++ keep = ((sym->flags & (BSF_GLOBAL ++ | BSF_WEAK ++ | BSF_GNU_UNIQUE)) != 0 ++ || bfd_is_und_section (sym->section) ++ || bfd_is_com_section (sym->section)); ++ else ++ keep = 1; ++ ++ if (keep ++ && ! print_debug_syms ++ && (sym->flags & BSF_DEBUGGING) != 0) ++ keep = 0; ++ ++ if (keep ++ && sort_by_size ++ && (bfd_is_abs_section (sym->section) ++ || bfd_is_und_section (sym->section))) ++ keep = 0; ++ ++ if (keep ++ && defined_only) ++ { ++ if (bfd_is_und_section (sym->section)) ++ keep = 0; ++ } ++ ++ if (keep ++ && bfd_is_target_special_symbol (abfd, sym) ++ && ! allow_special_symbols) ++ keep = 0; ++ ++ if (keep) ++ { ++ if (to != from) ++ memcpy (to, from, size); ++ to += size; ++ } ++ } ++ ++ return (to - (bfd_byte *) minisyms) / size; ++} ++ ++/* These globals are used to pass information into the sorting ++ routines. */ ++static bfd *sort_bfd; ++static bfd_boolean sort_dynamic; ++static asymbol *sort_x; ++static asymbol *sort_y; ++ ++/* Symbol-sorting predicates */ ++#define valueof(x) ((x)->section->vma + (x)->value) ++ ++/* Numeric sorts. Undefined symbols are always considered "less than" ++ defined symbols with zero values. Common symbols are not treated ++ specially -- i.e., their sizes are used as their "values". */ ++ ++static int ++non_numeric_forward (const void *P_x, const void *P_y) ++{ ++ asymbol *x, *y; ++ const char *xn, *yn; ++ ++ x = bfd_minisymbol_to_symbol (sort_bfd, sort_dynamic, P_x, sort_x); ++ y = bfd_minisymbol_to_symbol (sort_bfd, sort_dynamic, P_y, sort_y); ++ if (x == NULL || y == NULL) ++ bfd_fatal (bfd_get_filename (sort_bfd)); ++ ++ xn = bfd_asymbol_name (x); ++ yn = bfd_asymbol_name (y); ++ ++ if (yn == NULL) ++ return xn != NULL; ++ if (xn == NULL) ++ return -1; ++ ++#ifdef HAVE_STRCOLL ++ /* Solaris 2.5 has a bug in strcoll. ++ strcoll returns invalid values when confronted with empty strings. */ ++ if (*yn == '\0') ++ return *xn != '\0'; ++ if (*xn == '\0') ++ return -1; ++ ++ return strcoll (xn, yn); ++#else ++ return strcmp (xn, yn); ++#endif ++} ++ ++static int ++non_numeric_reverse (const void *x, const void *y) ++{ ++ return - non_numeric_forward (x, y); ++} ++ ++static int ++numeric_forward (const void *P_x, const void *P_y) ++{ ++ asymbol *x, *y; ++ asection *xs, *ys; ++ ++ x = bfd_minisymbol_to_symbol (sort_bfd, sort_dynamic, P_x, sort_x); ++ y = bfd_minisymbol_to_symbol (sort_bfd, sort_dynamic, P_y, sort_y); ++ if (x == NULL || y == NULL) ++ bfd_fatal (bfd_get_filename (sort_bfd)); ++ ++ xs = bfd_asymbol_section (x); ++ ys = bfd_asymbol_section (y); ++ ++ if (bfd_is_und_section (xs)) ++ { ++ if (! bfd_is_und_section (ys)) ++ return -1; ++ } ++ else if (bfd_is_und_section (ys)) ++ return 1; ++ else if (valueof (x) != valueof (y)) ++ return valueof (x) < valueof (y) ? -1 : 1; ++ ++ return non_numeric_forward (P_x, P_y); ++} ++ ++static int ++numeric_reverse (const void *x, const void *y) ++{ ++ return - numeric_forward (x, y); ++} ++ ++static int (*(sorters[2][2])) (const void *, const void *) = ++{ ++ { non_numeric_forward, non_numeric_reverse }, ++ { numeric_forward, numeric_reverse } ++}; ++ ++/* This sort routine is used by sort_symbols_by_size. It is similar ++ to numeric_forward, but when symbols have the same value it sorts ++ by section VMA. This simplifies the sort_symbols_by_size code ++ which handles symbols at the end of sections. Also, this routine ++ tries to sort file names before other symbols with the same value. ++ That will make the file name have a zero size, which will make ++ sort_symbols_by_size choose the non file name symbol, leading to ++ more meaningful output. For similar reasons, this code sorts ++ gnu_compiled_* and gcc2_compiled before other symbols with the same ++ value. */ ++ ++static int ++size_forward1 (const void *P_x, const void *P_y) ++{ ++ asymbol *x, *y; ++ asection *xs, *ys; ++ const char *xn, *yn; ++ size_t xnl, ynl; ++ int xf, yf; ++ ++ x = bfd_minisymbol_to_symbol (sort_bfd, sort_dynamic, P_x, sort_x); ++ y = bfd_minisymbol_to_symbol (sort_bfd, sort_dynamic, P_y, sort_y); ++ if (x == NULL || y == NULL) ++ bfd_fatal (bfd_get_filename (sort_bfd)); ++ ++ xs = bfd_asymbol_section (x); ++ ys = bfd_asymbol_section (y); ++ ++ if (bfd_is_und_section (xs)) ++ abort (); ++ if (bfd_is_und_section (ys)) ++ abort (); ++ ++ if (valueof (x) != valueof (y)) ++ return valueof (x) < valueof (y) ? -1 : 1; ++ ++ if (xs->vma != ys->vma) ++ return xs->vma < ys->vma ? -1 : 1; ++ ++ xn = bfd_asymbol_name (x); ++ yn = bfd_asymbol_name (y); ++ xnl = strlen (xn); ++ ynl = strlen (yn); ++ ++ /* The symbols gnu_compiled and gcc2_compiled convey even less ++ information than the file name, so sort them out first. */ ++ ++ xf = (strstr (xn, "gnu_compiled") != NULL ++ || strstr (xn, "gcc2_compiled") != NULL); ++ yf = (strstr (yn, "gnu_compiled") != NULL ++ || strstr (yn, "gcc2_compiled") != NULL); ++ ++ if (xf && ! yf) ++ return -1; ++ if (! xf && yf) ++ return 1; ++ ++ /* We use a heuristic for the file name. It may not work on non ++ Unix systems, but it doesn't really matter; the only difference ++ is precisely which symbol names get printed. */ ++ ++#define file_symbol(s, sn, snl) \ ++ (((s)->flags & BSF_FILE) != 0 \ ++ || ((snl) > 2 \ ++ && (sn)[(snl) - 2] == '.' \ ++ && ((sn)[(snl) - 1] == 'o' \ ++ || (sn)[(snl) - 1] == 'a'))) ++ ++ xf = file_symbol (x, xn, xnl); ++ yf = file_symbol (y, yn, ynl); ++ ++ if (xf && ! yf) ++ return -1; ++ if (! xf && yf) ++ return 1; ++ ++ return non_numeric_forward (P_x, P_y); ++} ++ ++/* This sort routine is used by sort_symbols_by_size. It is sorting ++ an array of size_sym structures into size order. */ ++ ++static int ++size_forward2 (const void *P_x, const void *P_y) ++{ ++ const struct size_sym *x = (const struct size_sym *) P_x; ++ const struct size_sym *y = (const struct size_sym *) P_y; ++ ++ if (x->size < y->size) ++ return reverse_sort ? 1 : -1; ++ else if (x->size > y->size) ++ return reverse_sort ? -1 : 1; ++ else ++ return sorters[0][reverse_sort] (x->minisym, y->minisym); ++} ++ ++/* Sort the symbols by size. ELF provides a size but for other formats ++ we have to make a guess by assuming that the difference between the ++ address of a symbol and the address of the next higher symbol is the ++ size. */ ++ ++static long ++sort_symbols_by_size (bfd *abfd, bfd_boolean is_dynamic, void *minisyms, ++ long symcount, unsigned int size, ++ struct size_sym **symsizesp) ++{ ++ struct size_sym *symsizes; ++ bfd_byte *from, *fromend; ++ asymbol *sym = NULL; ++ asymbol *store_sym, *store_next; ++ ++ qsort (minisyms, symcount, size, size_forward1); ++ ++ /* We are going to return a special set of symbols and sizes to ++ print. */ ++ symsizes = (struct size_sym *) xmalloc (symcount * sizeof (struct size_sym)); ++ *symsizesp = symsizes; ++ ++ /* Note that filter_symbols has already removed all absolute and ++ undefined symbols. Here we remove all symbols whose size winds ++ up as zero. */ ++ from = (bfd_byte *) minisyms; ++ fromend = from + symcount * size; ++ ++ store_sym = sort_x; ++ store_next = sort_y; ++ ++ if (from < fromend) ++ { ++ sym = bfd_minisymbol_to_symbol (abfd, is_dynamic, (const void *) from, ++ store_sym); ++ if (sym == NULL) ++ bfd_fatal (bfd_get_filename (abfd)); ++ } ++ ++ for (; from < fromend; from += size) ++ { ++ asymbol *next; ++ asection *sec; ++ bfd_vma sz; ++ asymbol *temp; ++ ++ if (from + size < fromend) ++ { ++ next = bfd_minisymbol_to_symbol (abfd, ++ is_dynamic, ++ (const void *) (from + size), ++ store_next); ++ if (next == NULL) ++ bfd_fatal (bfd_get_filename (abfd)); ++ } ++ else ++ next = NULL; ++ ++ sec = bfd_asymbol_section (sym); ++ ++ /* Synthetic symbols don't have a full type set of data available, thus ++ we can't rely on that information for the symbol size. Ditto for ++ bfd/section.c:global_syms like *ABS*. */ ++ if ((sym->flags & (BSF_SECTION_SYM | BSF_SYNTHETIC)) == 0 ++ && bfd_get_flavour (abfd) == bfd_target_elf_flavour) ++ sz = ((elf_symbol_type *) sym)->internal_elf_sym.st_size; ++ else if ((sym->flags & (BSF_SECTION_SYM | BSF_SYNTHETIC)) == 0 ++ && bfd_is_com_section (sec)) ++ sz = sym->value; ++ else ++ { ++ if (from + size < fromend ++ && sec == bfd_asymbol_section (next)) ++ sz = valueof (next) - valueof (sym); ++ else ++ sz = (bfd_section_vma (sec) ++ + bfd_section_size (sec) ++ - valueof (sym)); ++ } ++ ++ if (sz != 0) ++ { ++ symsizes->minisym = (const void *) from; ++ symsizes->size = sz; ++ ++symsizes; ++ } ++ ++ sym = next; ++ ++ temp = store_sym; ++ store_sym = store_next; ++ store_next = temp; ++ } ++ ++ symcount = symsizes - *symsizesp; ++ ++ /* We must now sort again by size. */ ++ qsort ((void *) *symsizesp, symcount, sizeof (struct size_sym), size_forward2); ++ ++ return symcount; ++} ++ ++/* This function is used to get the relocs for a particular section. ++ It is called via bfd_map_over_sections. */ ++ ++static void ++get_relocs (bfd *abfd, asection *sec, void *dataarg) ++{ ++ struct get_relocs_info *data = (struct get_relocs_info *) dataarg; ++ ++ *data->secs = sec; ++ ++ if ((sec->flags & SEC_RELOC) == 0) ++ { ++ *data->relocs = NULL; ++ *data->relcount = 0; ++ } ++ else ++ { ++ long relsize; ++ ++ relsize = bfd_get_reloc_upper_bound (abfd, sec); ++ if (relsize < 0) ++ bfd_fatal (bfd_get_filename (abfd)); ++ ++ *data->relocs = (arelent **) xmalloc (relsize); ++ *data->relcount = bfd_canonicalize_reloc (abfd, sec, *data->relocs, ++ data->syms); ++ if (*data->relcount < 0) ++ bfd_fatal (bfd_get_filename (abfd)); ++ } ++ ++ ++data->secs; ++ ++data->relocs; ++ ++data->relcount; ++} ++ ++/* Print a single symbol. */ ++ ++static void ++print_symbol (bfd * abfd, ++ asymbol * sym, ++ bfd_vma ssize, ++ bfd * archive_bfd) ++{ ++ symbol_info syminfo; ++ struct extended_symbol_info info; ++ ++ PROGRESS (1); ++ ++ format->print_symbol_filename (archive_bfd, abfd); ++ ++ bfd_get_symbol_info (abfd, sym, &syminfo); ++ ++ info.sinfo = &syminfo; ++ info.ssize = ssize; ++ /* Synthetic symbols do not have a full symbol type set of data available. ++ Nor do bfd/section.c:global_syms like *ABS*. */ ++ if ((sym->flags & (BSF_SECTION_SYM | BSF_SYNTHETIC)) != 0) ++ { ++ info.elfinfo = NULL; ++ info.coffinfo = NULL; ++ } ++ else ++ { ++ info.elfinfo = elf_symbol_from (abfd, sym); ++ info.coffinfo = coff_symbol_from (sym); ++ } ++ ++ format->print_symbol_info (&info, abfd); ++ ++ if (line_numbers) ++ { ++ static asymbol **syms; ++ static long symcount; ++ const char *filename, *functionname; ++ unsigned int lineno; ++ ++ /* We need to get the canonical symbols in order to call ++ bfd_find_nearest_line. This is inefficient, but, then, you ++ don't have to use --line-numbers. */ ++ if (abfd != lineno_cache_bfd && syms != NULL) ++ { ++ free (syms); ++ syms = NULL; ++ } ++ if (syms == NULL) ++ { ++ long symsize; ++ ++ symsize = bfd_get_symtab_upper_bound (abfd); ++ if (symsize < 0) ++ bfd_fatal (bfd_get_filename (abfd)); ++ syms = (asymbol **) xmalloc (symsize); ++ symcount = bfd_canonicalize_symtab (abfd, syms); ++ if (symcount < 0) ++ bfd_fatal (bfd_get_filename (abfd)); ++ lineno_cache_bfd = abfd; ++ } ++ ++ if (bfd_is_und_section (bfd_asymbol_section (sym))) ++ { ++ static asection **secs; ++ static arelent ***relocs; ++ static long *relcount; ++ static unsigned int seccount; ++ unsigned int i; ++ const char *symname; ++ ++ /* For an undefined symbol, we try to find a reloc for the ++ symbol, and print the line number of the reloc. */ ++ if (abfd != lineno_cache_rel_bfd && relocs != NULL) ++ { ++ for (i = 0; i < seccount; i++) ++ if (relocs[i] != NULL) ++ free (relocs[i]); ++ free (secs); ++ free (relocs); ++ free (relcount); ++ secs = NULL; ++ relocs = NULL; ++ relcount = NULL; ++ } ++ ++ if (relocs == NULL) ++ { ++ struct get_relocs_info rinfo; ++ ++ seccount = bfd_count_sections (abfd); ++ ++ secs = (asection **) xmalloc (seccount * sizeof *secs); ++ relocs = (arelent ***) xmalloc (seccount * sizeof *relocs); ++ relcount = (long *) xmalloc (seccount * sizeof *relcount); ++ ++ rinfo.secs = secs; ++ rinfo.relocs = relocs; ++ rinfo.relcount = relcount; ++ rinfo.syms = syms; ++ bfd_map_over_sections (abfd, get_relocs, (void *) &rinfo); ++ lineno_cache_rel_bfd = abfd; ++ } ++ ++ symname = bfd_asymbol_name (sym); ++ for (i = 0; i < seccount; i++) ++ { ++ long j; ++ ++ for (j = 0; j < relcount[i]; j++) ++ { ++ arelent *r; ++ ++ r = relocs[i][j]; ++ if (r->sym_ptr_ptr != NULL ++ && (*r->sym_ptr_ptr)->section == sym->section ++ && (*r->sym_ptr_ptr)->value == sym->value ++ && strcmp (symname, ++ bfd_asymbol_name (*r->sym_ptr_ptr)) == 0 ++ && bfd_find_nearest_line (abfd, secs[i], syms, ++ r->address, &filename, ++ &functionname, &lineno) ++ && filename != NULL) ++ { ++ /* We only print the first one we find. */ ++ printf ("\t%s:%u", filename, lineno); ++ i = seccount; ++ break; ++ } ++ } ++ } ++ } ++ else if (bfd_asymbol_section (sym)->owner == abfd) ++ { ++ if ((bfd_find_line (abfd, syms, sym, &filename, &lineno) ++ || bfd_find_nearest_line (abfd, bfd_asymbol_section (sym), ++ syms, sym->value, &filename, ++ &functionname, &lineno)) ++ && filename != NULL ++ && lineno != 0) ++ printf ("\t%s:%u", filename, lineno); ++ } ++ } ++ ++ putchar ('\n'); ++} ++ ++/* Print the symbols when sorting by size. */ ++ ++static void ++print_size_symbols (bfd * abfd, ++ bfd_boolean is_dynamic, ++ struct size_sym * symsizes, ++ long symcount, ++ bfd * archive_bfd) ++{ ++ asymbol *store; ++ struct size_sym *from; ++ struct size_sym *fromend; ++ ++ store = bfd_make_empty_symbol (abfd); ++ if (store == NULL) ++ bfd_fatal (bfd_get_filename (abfd)); ++ ++ from = symsizes; ++ fromend = from + symcount; ++ ++ for (; from < fromend; from++) ++ { ++ asymbol *sym; ++ ++ sym = bfd_minisymbol_to_symbol (abfd, is_dynamic, from->minisym, store); ++ if (sym == NULL) ++ bfd_fatal (bfd_get_filename (abfd)); ++ ++ print_symbol (abfd, sym, from->size, archive_bfd); ++ } ++} ++ ++ ++/* Print the symbols of ABFD that are held in MINISYMS. ++ ++ If ARCHIVE_BFD is non-NULL, it is the archive containing ABFD. ++ ++ SYMCOUNT is the number of symbols in MINISYMS. ++ ++ SIZE is the size of a symbol in MINISYMS. */ ++ ++static void ++print_symbols (bfd * abfd, ++ bfd_boolean is_dynamic, ++ void * minisyms, ++ long symcount, ++ unsigned int size, ++ bfd * archive_bfd) ++{ ++ asymbol *store; ++ bfd_byte *from; ++ bfd_byte *fromend; ++ ++ store = bfd_make_empty_symbol (abfd); ++ if (store == NULL) ++ bfd_fatal (bfd_get_filename (abfd)); ++ ++ from = (bfd_byte *) minisyms; ++ fromend = from + symcount * size; ++ ++ for (; from < fromend; from += size) ++ { ++ asymbol *sym; ++ ++ sym = bfd_minisymbol_to_symbol (abfd, is_dynamic, from, store); ++ if (sym == NULL) ++ bfd_fatal (bfd_get_filename (abfd)); ++ ++ print_symbol (abfd, sym, (bfd_vma) 0, archive_bfd); ++ } ++} ++ ++/* If ARCHIVE_BFD is non-NULL, it is the archive containing ABFD. */ ++ ++static void ++display_rel_file (bfd *abfd, bfd *archive_bfd) ++{ ++ long symcount; ++ void *minisyms; ++ unsigned int size; ++ struct size_sym *symsizes; ++ asymbol *synthsyms = NULL; ++ ++ if (! dynamic) ++ { ++ if (!(bfd_get_file_flags (abfd) & HAS_SYMS)) ++ { ++ non_fatal (_("%s: no symbols"), bfd_get_filename (abfd)); ++ return; ++ } ++ } ++ ++ symcount = bfd_read_minisymbols (abfd, dynamic, &minisyms, &size); ++ if (symcount < 0) ++ { ++ if (dynamic && bfd_get_error () == bfd_error_no_symbols) ++ { ++ non_fatal (_("%s: no symbols"), bfd_get_filename (abfd)); ++ return; ++ } ++ ++ bfd_fatal (bfd_get_filename (abfd)); ++ } ++ ++ if (symcount == 0) ++ { ++ non_fatal (_("%s: no symbols"), bfd_get_filename (abfd)); ++ return; ++ } ++ ++ if (show_synthetic && size == sizeof (asymbol *)) ++ { ++ asymbol **static_syms = NULL; ++ asymbol **dyn_syms = NULL; ++ long static_count = 0; ++ long dyn_count = 0; ++ long synth_count; ++ ++ if (dynamic) ++ { ++ dyn_count = symcount; ++ dyn_syms = (asymbol **) minisyms; ++ } ++ else ++ { ++ long storage = bfd_get_dynamic_symtab_upper_bound (abfd); ++ ++ static_count = symcount; ++ static_syms = (asymbol **) minisyms; ++ ++ if (storage > 0) ++ { ++ dyn_syms = (asymbol **) xmalloc (storage); ++ dyn_count = bfd_canonicalize_dynamic_symtab (abfd, dyn_syms); ++ if (dyn_count < 0) ++ bfd_fatal (bfd_get_filename (abfd)); ++ } ++ } ++ ++ synth_count = bfd_get_synthetic_symtab (abfd, static_count, static_syms, ++ dyn_count, dyn_syms, &synthsyms); ++ if (synth_count > 0) ++ { ++ asymbol **symp; ++ long i; ++ ++ minisyms = xrealloc (minisyms, ++ (symcount + synth_count + 1) * sizeof (*symp)); ++ symp = (asymbol **) minisyms + symcount; ++ for (i = 0; i < synth_count; i++) ++ *symp++ = synthsyms + i; ++ *symp = 0; ++ symcount += synth_count; ++ } ++ if (!dynamic && dyn_syms != NULL) ++ free (dyn_syms); ++ } ++ ++ /* lto_slim_object is set to false when a bfd is loaded with a compiler ++ LTO plugin. */ ++ if (abfd->lto_slim_object) ++ { ++ report_plugin_err = FALSE; ++ non_fatal (_("%s: plugin needed to handle lto object"), ++ bfd_get_filename (abfd)); ++ } ++ ++ /* Discard the symbols we don't want to print. ++ It's OK to do this in place; we'll free the storage anyway ++ (after printing). */ ++ ++ symcount = filter_symbols (abfd, dynamic, minisyms, symcount, size); ++ ++ symsizes = NULL; ++ if (! no_sort) ++ { ++ sort_bfd = abfd; ++ sort_dynamic = dynamic; ++ sort_x = bfd_make_empty_symbol (abfd); ++ sort_y = bfd_make_empty_symbol (abfd); ++ if (sort_x == NULL || sort_y == NULL) ++ bfd_fatal (bfd_get_filename (abfd)); ++ ++ if (! sort_by_size) ++ qsort (minisyms, symcount, size, ++ sorters[sort_numerically][reverse_sort]); ++ else ++ symcount = sort_symbols_by_size (abfd, dynamic, minisyms, symcount, ++ size, &symsizes); ++ } ++ ++ if (! sort_by_size) ++ print_symbols (abfd, dynamic, minisyms, symcount, size, archive_bfd); ++ else ++ print_size_symbols (abfd, dynamic, symsizes, symcount, archive_bfd); ++ ++ if (synthsyms) ++ free (synthsyms); ++ free (minisyms); ++ free (symsizes); ++} ++ ++/* Construct a formatting string for printing symbol values. */ ++ ++static const char * ++get_print_format (void) ++{ ++ const char * padding; ++ if (print_format == FORMAT_POSIX) ++ { ++ /* POSIX compatible output does not have any padding. */ ++ padding = ""; ++ } ++ else if (print_width == 32) ++ { ++ padding ="08"; ++ } ++ else /* print_width == 64 */ ++ { ++ padding = "016"; ++ } ++ ++ const char * length = "l"; ++ if (print_width == 64) ++ { ++#if BFD_HOST_64BIT_LONG ++ ; ++#elif BFD_HOST_64BIT_LONG_LONG ++#ifndef __MSVCRT__ ++ length = "ll"; ++#else ++ length = "I64"; ++#endif ++#endif ++ } ++ ++ const char * radix = NULL; ++ switch (print_radix) ++ { ++ case 8: radix = "o"; break; ++ case 10: radix = "d"; break; ++ case 16: radix = "x"; break; ++ } ++ ++ return concat ("%", padding, length, radix, NULL); ++} ++ ++static void ++set_print_width (bfd *file) ++{ ++ print_width = bfd_get_arch_size (file); ++ ++ if (print_width == -1) ++ { ++ /* PR binutils/4292 ++ Guess the target's bitsize based on its name. ++ We assume here than any 64-bit format will include ++ "64" somewhere in its name. The only known exception ++ is the MMO object file format. */ ++ if (strstr (bfd_get_target (file), "64") != NULL ++ || strcmp (bfd_get_target (file), "mmo") == 0) ++ print_width = 64; ++ else ++ print_width = 32; ++ } ++ free ((char *) print_format_string); ++ print_format_string = get_print_format (); ++} ++ ++static void ++display_archive (bfd *file) ++{ ++ bfd *arfile = NULL; ++ bfd *last_arfile = NULL; ++ char **matching; ++ ++ format->print_archive_filename (bfd_get_filename (file)); ++ ++ if (print_armap) ++ print_symdef_entry (file); ++ ++ for (;;) ++ { ++ PROGRESS (1); ++ ++ arfile = bfd_openr_next_archived_file (file, arfile); ++ ++ if (arfile == NULL) ++ { ++ if (bfd_get_error () != bfd_error_no_more_archived_files) ++ bfd_fatal (bfd_get_filename (file)); ++ break; ++ } ++ ++ if (bfd_check_format_matches (arfile, bfd_object, &matching)) ++ { ++ set_print_width (arfile); ++ format->print_archive_member (bfd_get_filename (file), ++ bfd_get_filename (arfile)); ++ display_rel_file (arfile, file); ++ } ++ else ++ { ++ bfd_nonfatal (bfd_get_filename (arfile)); ++ if (bfd_get_error () == bfd_error_file_ambiguously_recognized) ++ { ++ list_matching_formats (matching); ++ free (matching); ++ } ++ } ++ ++ if (last_arfile != NULL) ++ { ++ bfd_close (last_arfile); ++ lineno_cache_bfd = NULL; ++ lineno_cache_rel_bfd = NULL; ++ if (arfile == last_arfile) ++ return; ++ } ++ last_arfile = arfile; ++ } ++ ++ if (last_arfile != NULL) ++ { ++ bfd_close (last_arfile); ++ lineno_cache_bfd = NULL; ++ lineno_cache_rel_bfd = NULL; ++ } ++} ++ ++static bfd_boolean ++display_file (char *filename) ++{ ++ bfd_boolean retval = TRUE; ++ bfd *file; ++ char **matching; ++ ++ if (get_file_size (filename) < 1) ++ return FALSE; ++ ++ file = bfd_openr (filename, target ? target : plugin_target); ++ if (file == NULL) ++ { ++ bfd_nonfatal (filename); ++ return FALSE; ++ } ++ ++ /* If printing line numbers, decompress the debug sections. */ ++ if (line_numbers) ++ file->flags |= BFD_DECOMPRESS; ++ ++ if (bfd_check_format (file, bfd_archive)) ++ { ++ display_archive (file); ++ } ++ else if (bfd_check_format_matches (file, bfd_object, &matching)) ++ { ++ set_print_width (file); ++ format->print_object_filename (filename); ++ display_rel_file (file, NULL); ++ } ++ else ++ { ++ bfd_nonfatal (filename); ++ if (bfd_get_error () == bfd_error_file_ambiguously_recognized) ++ { ++ list_matching_formats (matching); ++ free (matching); ++ } ++ retval = FALSE; ++ } ++ ++ if (!bfd_close (file)) ++ bfd_fatal (filename); ++ ++ lineno_cache_bfd = NULL; ++ lineno_cache_rel_bfd = NULL; ++ ++ return retval; ++} ++ ++/* The following 3 groups of functions are called unconditionally, ++ once at the start of processing each file of the appropriate type. ++ They should check `filename_per_file' and `filename_per_symbol', ++ as appropriate for their output format, to determine whether to ++ print anything. */ ++ ++/* Print the name of an object file given on the command line. */ ++ ++static void ++print_object_filename_bsd (const char *filename) ++{ ++ if (filename_per_file && !filename_per_symbol) ++ printf ("\n%s:\n", filename); ++} ++ ++static void ++print_object_filename_sysv (const char *filename) ++{ ++ if (undefined_only) ++ printf (_("\n\nUndefined symbols from %s:\n\n"), filename); ++ else ++ printf (_("\n\nSymbols from %s:\n\n"), filename); ++ if (print_width == 32) ++ printf (_("\ ++Name Value Class Type Size Line Section\n\n")); ++ else ++ printf (_("\ ++Name Value Class Type Size Line Section\n\n")); ++} ++ ++static void ++print_object_filename_posix (const char *filename) ++{ ++ if (filename_per_file && !filename_per_symbol) ++ printf ("%s:\n", filename); ++} ++ ++/* Print the name of an archive file given on the command line. */ ++ ++static void ++print_archive_filename_bsd (const char *filename) ++{ ++ if (filename_per_file) ++ printf ("\n%s:\n", filename); ++} ++ ++static void ++print_archive_filename_sysv (const char *filename ATTRIBUTE_UNUSED) ++{ ++} ++ ++static void ++print_archive_filename_posix (const char *filename ATTRIBUTE_UNUSED) ++{ ++} ++ ++/* Print the name of an archive member file. */ ++ ++static void ++print_archive_member_bsd (const char *archive ATTRIBUTE_UNUSED, ++ const char *filename) ++{ ++ if (!filename_per_symbol) ++ printf ("\n%s:\n", filename); ++} ++ ++static void ++print_archive_member_sysv (const char *archive, const char *filename) ++{ ++ if (undefined_only) ++ printf (_("\n\nUndefined symbols from %s[%s]:\n\n"), archive, filename); ++ else ++ printf (_("\n\nSymbols from %s[%s]:\n\n"), archive, filename); ++ if (print_width == 32) ++ printf (_("\ ++Name Value Class Type Size Line Section\n\n")); ++ else ++ printf (_("\ ++Name Value Class Type Size Line Section\n\n")); ++} ++ ++static void ++print_archive_member_posix (const char *archive, const char *filename) ++{ ++ if (!filename_per_symbol) ++ printf ("%s[%s]:\n", archive, filename); ++} ++ ++/* Print the name of the file (and archive, if there is one) ++ containing a symbol. */ ++ ++static void ++print_symbol_filename_bsd (bfd *archive_bfd, bfd *abfd) ++{ ++ if (filename_per_symbol) ++ { ++ if (archive_bfd) ++ printf ("%s:", bfd_get_filename (archive_bfd)); ++ printf ("%s:", bfd_get_filename (abfd)); ++ } ++} ++ ++static void ++print_symbol_filename_sysv (bfd *archive_bfd, bfd *abfd) ++{ ++ if (filename_per_symbol) ++ { ++ if (archive_bfd) ++ printf ("%s:", bfd_get_filename (archive_bfd)); ++ printf ("%s:", bfd_get_filename (abfd)); ++ } ++} ++ ++static void ++print_symbol_filename_posix (bfd *archive_bfd, bfd *abfd) ++{ ++ if (filename_per_symbol) ++ { ++ if (archive_bfd) ++ printf ("%s[%s]: ", bfd_get_filename (archive_bfd), ++ bfd_get_filename (abfd)); ++ else ++ printf ("%s: ", bfd_get_filename (abfd)); ++ } ++} ++ ++/* Print a symbol value. */ ++ ++static void ++print_value (bfd *abfd ATTRIBUTE_UNUSED, bfd_vma val) ++{ ++ switch (print_width) ++ { ++ case 32: ++ printf (print_format_string, (unsigned long) val); ++ break; ++ ++ case 64: ++#if BFD_HOST_64BIT_LONG || BFD_HOST_64BIT_LONG_LONG ++ printf (print_format_string, val); ++#else ++ /* We have a 64 bit value to print, but the host is only 32 bit. */ ++ if (print_radix == 16) ++ bfd_fprintf_vma (abfd, stdout, val); ++ else ++ { ++ char buf[30]; ++ char *s; ++ ++ s = buf + sizeof buf; ++ *--s = '\0'; ++ while (val > 0) ++ { ++ *--s = (val % print_radix) + '0'; ++ val /= print_radix; ++ } ++ while ((buf + sizeof buf - 1) - s < 16) ++ *--s = '0'; ++ printf ("%s", s); ++ } ++#endif ++ break; ++ ++ default: ++ fatal (_("Print width has not been initialized (%d)"), print_width); ++ break; ++ } ++} ++ ++/* Print a line of information about a symbol. */ ++ ++static void ++print_symbol_info_bsd (struct extended_symbol_info *info, bfd *abfd) ++{ ++ if (bfd_is_undefined_symclass (SYM_TYPE (info))) ++ { ++ if (print_width == 64) ++ printf (" "); ++ printf (" "); ++ } ++ else ++ { ++ /* Normally we print the value of the symbol. If we are printing the ++ size or sorting by size then we print its size, except for the ++ (weird) special case where both flags are defined, in which case we ++ print both values. This conforms to documented behaviour. */ ++ if (sort_by_size && !print_size) ++ print_value (abfd, SYM_SIZE (info)); ++ else ++ print_value (abfd, SYM_VALUE (info)); ++ if (print_size && SYM_SIZE (info)) ++ { ++ printf (" "); ++ print_value (abfd, SYM_SIZE (info)); ++ } ++ } ++ ++ printf (" %c", SYM_TYPE (info)); ++ ++ if (SYM_TYPE (info) == '-') ++ { ++ /* A stab. */ ++ printf (" "); ++ printf (other_format, SYM_STAB_OTHER (info)); ++ printf (" "); ++ printf (desc_format, SYM_STAB_DESC (info)); ++ printf (" %5s", SYM_STAB_NAME (info)); ++ } ++ print_symname (" %s", info, NULL, abfd); ++} ++ ++static void ++print_symbol_info_sysv (struct extended_symbol_info *info, bfd *abfd) ++{ ++ print_symname ("%-20s|", info, NULL, abfd); ++ ++ if (bfd_is_undefined_symclass (SYM_TYPE (info))) ++ { ++ if (print_width == 32) ++ printf (" "); ++ else ++ printf (" "); ++ } ++ else ++ print_value (abfd, SYM_VALUE (info)); ++ ++ printf ("| %c |", SYM_TYPE (info)); ++ ++ if (SYM_TYPE (info) == '-') ++ { ++ /* A stab. */ ++ printf ("%18s| ", SYM_STAB_NAME (info)); /* (C) Type. */ ++ printf (desc_format, SYM_STAB_DESC (info)); /* Size. */ ++ printf ("| |"); /* Line, Section. */ ++ } ++ else ++ { ++ /* Type, Size, Line, Section */ ++ if (info->elfinfo) ++ printf ("%18s|", ++ get_elf_symbol_type (ELF_ST_TYPE (info->elfinfo->internal_elf_sym.st_info))); ++ else if (info->coffinfo) ++ printf ("%18s|", ++ get_coff_symbol_type (&info->coffinfo->native->u.syment)); ++ else ++ printf (" |"); ++ ++ if (SYM_SIZE (info)) ++ print_value (abfd, SYM_SIZE (info)); ++ else ++ { ++ if (print_width == 32) ++ printf (" "); ++ else ++ printf (" "); ++ } ++ ++ if (info->elfinfo) ++ printf("| |%s", info->elfinfo->symbol.section->name); ++ else if (info->coffinfo) ++ printf("| |%s", info->coffinfo->symbol.section->name); ++ else ++ printf("| |"); ++ } ++} ++ ++static void ++print_symbol_info_posix (struct extended_symbol_info *info, bfd *abfd) ++{ ++ print_symname ("%s ", info, NULL, abfd); ++ printf ("%c ", SYM_TYPE (info)); ++ ++ if (bfd_is_undefined_symclass (SYM_TYPE (info))) ++ printf (" "); ++ else ++ { ++ print_value (abfd, SYM_VALUE (info)); ++ printf (" "); ++ if (SYM_SIZE (info)) ++ print_value (abfd, SYM_SIZE (info)); ++ } ++} ++ ++int ++main (int argc, char **argv) ++{ ++ int c; ++ int retval; ++ ++#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) ++ setlocale (LC_MESSAGES, ""); ++#endif ++#if defined (HAVE_SETLOCALE) ++ setlocale (LC_CTYPE, ""); ++ setlocale (LC_COLLATE, ""); ++#endif ++ bindtextdomain (PACKAGE, LOCALEDIR); ++ textdomain (PACKAGE); ++ ++ program_name = *argv; ++ xmalloc_set_program_name (program_name); ++ bfd_set_error_program_name (program_name); ++#if BFD_SUPPORTS_PLUGINS ++ bfd_plugin_set_program_name (program_name); ++#endif ++ ++ START_PROGRESS (program_name, 0); ++ ++ expandargv (&argc, &argv); ++ ++ if (bfd_init () != BFD_INIT_MAGIC) ++ fatal (_("fatal error: libbfd ABI mismatch")); ++ set_default_bfd_target (); ++ ++ while ((c = getopt_long (argc, argv, "aABCDef:gHhlnopPrSst:uvVvX:", ++ long_options, (int *) 0)) != EOF) ++ { ++ switch (c) ++ { ++ case 'a': ++ print_debug_syms = 1; ++ break; ++ case 'A': ++ case 'o': ++ filename_per_symbol = 1; ++ break; ++ case 'B': /* For MIPS compatibility. */ ++ set_output_format ("bsd"); ++ break; ++ case 'C': ++ do_demangle = 1; ++ if (optarg != NULL) ++ { ++ enum demangling_styles style; ++ ++ style = cplus_demangle_name_to_style (optarg); ++ if (style == unknown_demangling) ++ fatal (_("unknown demangling style `%s'"), ++ optarg); ++ ++ cplus_demangle_set_style (style); ++ } ++ break; ++ case OPTION_RECURSE_LIMIT: ++ demangle_flags &= ~ DMGL_NO_RECURSE_LIMIT; ++ break; ++ case OPTION_NO_RECURSE_LIMIT: ++ demangle_flags |= DMGL_NO_RECURSE_LIMIT; ++ break; ++ case OPTION_WITH_SYMBOL_VERSIONS: ++ /* Ignored for backward compatibility. */ ++ break; ++ case 'D': ++ dynamic = 1; ++ break; ++ case 'e': ++ /* Ignored for HP/UX compatibility. */ ++ break; ++ case 'f': ++ set_output_format (optarg); ++ break; ++ case 'g': ++ external_only = 1; ++ break; ++ case 'H': ++ case 'h': ++ usage (stdout, 0); ++ case 'l': ++ line_numbers = 1; ++ break; ++ case 'n': ++ case 'v': ++ no_sort = 0; ++ sort_numerically = 1; ++ sort_by_size = 0; ++ break; ++ case 'p': ++ no_sort = 1; ++ sort_numerically = 0; ++ sort_by_size = 0; ++ break; ++ case OPTION_SIZE_SORT: ++ no_sort = 0; ++ sort_numerically = 0; ++ sort_by_size = 1; ++ break; ++ case 'P': ++ set_output_format ("posix"); ++ break; ++ case 'r': ++ reverse_sort = 1; ++ break; ++ case 's': ++ print_armap = 1; ++ break; ++ case 'S': ++ print_size = 1; ++ break; ++ case 't': ++ set_print_radix (optarg); ++ break; ++ case 'u': ++ undefined_only = 1; ++ break; ++ case 'V': ++ show_version = 1; ++ break; ++ case 'X': ++ /* Ignored for (partial) AIX compatibility. On AIX, the ++ argument has values 32, 64, or 32_64, and specifies that ++ only 32-bit, only 64-bit, or both kinds of objects should ++ be examined. The default is 32. So plain AIX nm on a ++ library archive with both kinds of objects will ignore ++ the 64-bit ones. For GNU nm, the default is and always ++ has been -X 32_64, and other options are not supported. */ ++ if (strcmp (optarg, "32_64") != 0) ++ fatal (_("Only -X 32_64 is supported")); ++ break; ++ ++ case OPTION_TARGET: /* --target */ ++ target = optarg; ++ break; ++ ++ case OPTION_PLUGIN: /* --plugin */ ++#if BFD_SUPPORTS_PLUGINS ++ bfd_plugin_set_plugin (optarg); ++#else ++ fatal (_("sorry - this program has been built without plugin support\n")); ++#endif ++ break; ++ ++ case 0: /* A long option that just sets a flag. */ ++ break; ++ ++ default: ++ usage (stderr, 1); ++ } ++ } ++ ++ if (show_version) ++ print_version ("nm"); ++ ++ if (sort_by_size && undefined_only) ++ { ++ non_fatal (_("Using the --size-sort and --undefined-only options together")); ++ non_fatal (_("will produce no output, since undefined symbols have no size.")); ++ return 0; ++ } ++ ++ /* OK, all options now parsed. If no filename specified, do a.out. */ ++ if (optind == argc) ++ return !display_file ("a.out"); ++ ++ retval = 0; ++ ++ if (argc - optind > 1) ++ filename_per_file = 1; ++ ++ /* We were given several filenames to do. */ ++ while (optind < argc) ++ { ++ PROGRESS (1); ++ if (!display_file (argv[optind++])) ++ retval++; ++ } ++ ++ END_PROGRESS (program_name); ++ ++ exit (retval); ++ return retval; ++} +diff -rupN binutils.orig/binutils/nm.c.rej binutils-2.35.2/binutils/nm.c.rej +--- binutils.orig/binutils/nm.c.rej 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/nm.c.rej 2021-11-09 16:53:47.883895439 +0000 +@@ -0,0 +1,39 @@ ++--- binutils/nm.c 2021-11-09 12:34:21.661802947 +0000 +++++ binutils/nm.c 2021-11-09 12:34:46.291643864 +0000 ++@@ -645,6 +846,7 @@ print_symname (const char *form, struct ++ ++ if (name == NULL) ++ name = info->sinfo->name; +++ ++ if (!with_symbol_versions ++ && bfd_get_flavour (abfd) == bfd_target_elf_flavour) ++ { ++@@ -652,6 +854,7 @@ print_symname (const char *form, struct ++ if (atver) ++ *atver = 0; ++ } +++ ++ if (do_demangle && *name) ++ { ++ alloc = bfd_demangle (abfd, name, demangle_flags); ++@@ -659,6 +862,11 @@ print_symname (const char *form, struct ++ name = alloc; ++ } ++ +++ if (unicode_display != unicode_default) +++ { +++ name = convert_utf8 (name); +++ } +++ ++ if (info != NULL && info->elfinfo && with_symbol_versions) ++ { ++ const char *version_string; ++@@ -2008,7 +2216,7 @@ main (int argc, char **argv) ++ fatal (_("fatal error: libbfd ABI mismatch")); ++ set_default_bfd_target (); ++ ++- while ((c = getopt_long (argc, argv, "aABCDef:gHhjJlnopPrSst:uvVvX:", +++ while ((c = getopt_long (argc, argv, "aABCDef:gHhjJlnopPrSst:uU:vVvX:", ++ long_options, (int *) 0)) != EOF) ++ { ++ switch (c) +diff -rupN binutils.orig/binutils/objdump.c binutils-2.35.2/binutils/objdump.c +--- binutils.orig/binutils/objdump.c 2021-11-09 16:53:12.816128287 +0000 ++++ binutils-2.35.2/binutils/objdump.c 2021-11-09 16:57:57.663237788 +0000 +@@ -205,6 +205,18 @@ static const struct objdump_private_desc + + /* The list of detected jumps inside a function. */ + static struct jump_info *detected_jumps = NULL; ++ ++typedef enum unicode_display_type ++{ ++ unicode_default = 0, ++ unicode_locale, ++ unicode_escape, ++ unicode_hex, ++ unicode_highlight, ++ unicode_invalid ++} unicode_display_type; ++ ++static unicode_display_type unicode_display = unicode_default; + + static void usage (FILE *, int) ATTRIBUTE_NORETURN; + static void +@@ -229,6 +241,9 @@ usage (FILE *stream, int status) + -g, --debugging Display debug information in object file\n\ + -e, --debugging-tags Display debug information using ctags style\n\ + -G, --stabs Display (in raw form) any STABS info in the file\n\ ++ -U[d|l|i|x|e|h] Controls the display of UTF-8 unicode characters\n\ ++ --unicode=[default|locale|invalid|hex|escape|highlight]\n")); ++ fprintf (stream, _("\ + -W[lLiaprmfFsoORtUuTgAckK] or\n\ + --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,\n\ + =frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,\n\ +@@ -348,17 +363,23 @@ static struct option long_options[]= + { + {"adjust-vma", required_argument, NULL, OPTION_ADJUST_VMA}, + {"all-headers", no_argument, NULL, 'x'}, +- {"private-headers", no_argument, NULL, 'p'}, +- {"private", required_argument, NULL, 'P'}, + {"architecture", required_argument, NULL, 'm'}, + {"archive-headers", no_argument, NULL, 'a'}, ++#ifdef ENABLE_LIBCTF ++ {"ctf", required_argument, NULL, OPTION_CTF}, ++ {"ctf-parent", required_argument, NULL, OPTION_CTF_PARENT}, ++#endif + {"debugging", no_argument, NULL, 'g'}, + {"debugging-tags", no_argument, NULL, 'e'}, + {"demangle", optional_argument, NULL, 'C'}, + {"disassemble", optional_argument, NULL, 'd'}, + {"disassemble-all", no_argument, NULL, 'D'}, +- {"disassembler-options", required_argument, NULL, 'M'}, + {"disassemble-zeroes", no_argument, NULL, 'z'}, ++ {"disassembler-options", required_argument, NULL, 'M'}, ++ {"dwarf", optional_argument, NULL, OPTION_DWARF}, ++ {"dwarf-check", no_argument, 0, OPTION_DWARF_CHECK}, ++ {"dwarf-depth", required_argument, 0, OPTION_DWARF_DEPTH}, ++ {"dwarf-start", required_argument, 0, OPTION_DWARF_START}, + {"dynamic-reloc", no_argument, NULL, 'R'}, + {"dynamic-syms", no_argument, NULL, 'T'}, + {"endian", required_argument, NULL, OPTION_ENDIAN}, +@@ -384,28 +405,16 @@ static struct option long_options[]= + {"source", no_argument, NULL, 'S'}, + {"source-comment", optional_argument, NULL, OPTION_SOURCE_COMMENT}, + {"special-syms", no_argument, &dump_special_syms, 1}, +- {"include", required_argument, NULL, 'I'}, +- {"dwarf", optional_argument, NULL, OPTION_DWARF}, +-#ifdef ENABLE_LIBCTF +- {"ctf", required_argument, NULL, OPTION_CTF}, +- {"ctf-parent", required_argument, NULL, OPTION_CTF_PARENT}, +-#endif + {"stabs", no_argument, NULL, 'G'}, + {"start-address", required_argument, NULL, OPTION_START_ADDRESS}, + {"stop-address", required_argument, NULL, OPTION_STOP_ADDRESS}, + {"syms", no_argument, NULL, 't'}, + {"target", required_argument, NULL, 'b'}, ++ {"unicode", required_argument, NULL, 'U'}, + {"version", no_argument, NULL, 'V'}, +- {"wide", no_argument, NULL, 'w'}, +- {"prefix", required_argument, NULL, OPTION_PREFIX}, +- {"prefix-strip", required_argument, NULL, OPTION_PREFIX_STRIP}, +- {"insn-width", required_argument, NULL, OPTION_INSN_WIDTH}, +- {"dwarf-depth", required_argument, 0, OPTION_DWARF_DEPTH}, +- {"dwarf-start", required_argument, 0, OPTION_DWARF_START}, +- {"dwarf-check", no_argument, 0, OPTION_DWARF_CHECK}, +- {"inlines", no_argument, 0, OPTION_INLINES}, + {"visualize-jumps", optional_argument, 0, OPTION_VISUALIZE_JUMPS}, +- {0, no_argument, 0, 0} ++ {"wide", no_argument, NULL, 'w'}, ++ {NULL, no_argument, NULL, 0} + }; + + static void +@@ -415,9 +424,121 @@ nonfatal (const char *msg) + exit_status = 1; + } + ++/* Convert a potential UTF-8 encoded sequence in IN into characters in OUT. ++ The conversion format is controlled by the unicode_display variable. ++ Returns the number of characters added to OUT. ++ Returns the number of bytes consumed from IN in CONSUMED. ++ Always consumes at least one byte and displays at least one character. */ ++ ++static unsigned int ++display_utf8 (const unsigned char * in, char * out, unsigned int * consumed) ++{ ++ char * orig_out = out; ++ unsigned int nchars = 0; ++ unsigned int j; ++ ++ if (unicode_display == unicode_default) ++ goto invalid; ++ ++ if (in[0] < 0xc0) ++ goto invalid; ++ ++ if ((in[1] & 0xc0) != 0x80) ++ goto invalid; ++ ++ if ((in[0] & 0x20) == 0) ++ { ++ nchars = 2; ++ goto valid; ++ } ++ ++ if ((in[2] & 0xc0) != 0x80) ++ goto invalid; ++ ++ if ((in[0] & 0x10) == 0) ++ { ++ nchars = 3; ++ goto valid; ++ } ++ ++ if ((in[3] & 0xc0) != 0x80) ++ goto invalid; ++ ++ nchars = 4; ++ ++ valid: ++ switch (unicode_display) ++ { ++ case unicode_locale: ++ /* Copy the bytes into the output buffer as is. */ ++ memcpy (out, in, nchars); ++ out += nchars; ++ break; ++ ++ case unicode_invalid: ++ case unicode_hex: ++ out += sprintf (out, "%c", unicode_display == unicode_hex ? '<' : '{'); ++ out += sprintf (out, "0x"); ++ for (j = 0; j < nchars; j++) ++ out += sprintf (out, "%02x", in [j]); ++ out += sprintf (out, "%c", unicode_display == unicode_hex ? '>' : '}'); ++ break; ++ ++ case unicode_highlight: ++ if (isatty (1)) ++ out += sprintf (out, "\x1B[31;47m"); /* Red. */ ++ /* Fall through. */ ++ case unicode_escape: ++ switch (nchars) ++ { ++ case 2: ++ out += sprintf (out, "\\u%02x%02x", ++ ((in[0] & 0x1c) >> 2), ++ ((in[0] & 0x03) << 6) | (in[1] & 0x3f)); ++ break; ++ ++ case 3: ++ out += sprintf (out, "\\u%02x%02x", ++ ((in[0] & 0x0f) << 4) | ((in[1] & 0x3c) >> 2), ++ ((in[1] & 0x03) << 6) | ((in[2] & 0x3f))); ++ break; ++ ++ case 4: ++ out += sprintf (out, "\\u%02x%02x%02x", ++ ((in[0] & 0x07) << 6) | ((in[1] & 0x3c) >> 2), ++ ((in[1] & 0x03) << 6) | ((in[2] & 0x3c) >> 2), ++ ((in[2] & 0x03) << 6) | ((in[3] & 0x3f))); ++ break; ++ default: ++ /* URG. */ ++ break; ++ } ++ ++ if (unicode_display == unicode_highlight && isatty (1)) ++ out += sprintf (out, "\033[0m"); /* Default colour. */ ++ break; ++ ++ default: ++ /* URG */ ++ break; ++ } ++ ++ * consumed = nchars; ++ return out - orig_out; ++ ++ invalid: ++ /* Not a valid UTF-8 sequence. */ ++ *out = *in; ++ * consumed = 1; ++ return 1; ++} ++ + /* Returns a version of IN with any control characters + replaced by escape sequences. Uses a static buffer +- if necessary. */ ++ if necessary. ++ ++ If unicode display is enabled, then also handles the ++ conversion of unicode characters. */ + + static const char * + sanitize_string (const char * in) +@@ -435,40 +556,50 @@ sanitize_string (const char * in) + of cases it will not be needed. */ + do + { +- char c = *in++; ++ unsigned char c = *in++; + + if (c == 0) + return original; + + if (ISCNTRL (c)) + break; ++ ++ if (unicode_display != unicode_default && c >= 0xc0) ++ break; + } + while (1); + + /* Copy the input, translating as needed. */ + in = original; +- if (buffer_len < (strlen (in) * 2)) ++ if (buffer_len < (strlen (in) * 9)) + { + free ((void *) buffer); +- buffer_len = strlen (in) * 2; ++ buffer_len = strlen (in) * 9; + buffer = xmalloc (buffer_len + 1); + } + + out = buffer; + do + { +- char c = *in++; ++ unsigned char c = *in++; + + if (c == 0) + break; + +- if (!ISCNTRL (c)) +- *out++ = c; +- else ++ if (ISCNTRL (c)) + { + *out++ = '^'; + *out++ = c + 0x40; + } ++ else if (unicode_display != unicode_default && c >= 0xc0) ++ { ++ unsigned int num_consumed; ++ ++ out += display_utf8 ((const unsigned char *)(in - 1), out, & num_consumed); ++ in += num_consumed - 1; ++ } ++ else ++ *out++ = c; + } + while (1); + +@@ -4447,6 +4578,24 @@ dump_symbols (bfd *abfd ATTRIBUTE_UNUSED + free (alloc); + } + } ++ else if (unicode_display != unicode_default ++ && name != NULL && *name != '\0') ++ { ++ const char * sanitized_name; ++ ++ /* If we want to sanitize the name, we do it here, and ++ temporarily clobber it while calling bfd_print_symbol. ++ FIXME: This is a gross hack. */ ++ sanitized_name = sanitize_string (name); ++ if (sanitized_name != name) ++ (*current)->name = sanitized_name; ++ else ++ sanitized_name = NULL; ++ bfd_print_symbol (cur_bfd, stdout, *current, ++ bfd_print_symbol_all); ++ if (sanitized_name != NULL) ++ (*current)->name = name; ++ } + else + bfd_print_symbol (cur_bfd, stdout, *current, + bfd_print_symbol_all); +@@ -5128,7 +5277,7 @@ main (int argc, char **argv) + set_default_bfd_target (); + + while ((c = getopt_long (argc, argv, +- "pP:ib:m:M:VvCdDlfFaHhrRtTxsSI:j:wE:zgeGW::", ++ "pP:ib:m:M:VvCdDlfFaHhrRtTU:xsSI:j:wE:zgeGW::", + long_options, (int *) 0)) + != EOF) + { +@@ -5407,6 +5556,23 @@ main (int argc, char **argv) + seenflag = TRUE; + break; + ++ case 'U': ++ if (streq (optarg, "default") || streq (optarg, "d")) ++ unicode_display = unicode_default; ++ else if (streq (optarg, "locale") || streq (optarg, "l")) ++ unicode_display = unicode_locale; ++ else if (streq (optarg, "escape") || streq (optarg, "e")) ++ unicode_display = unicode_escape; ++ else if (streq (optarg, "invalid") || streq (optarg, "i")) ++ unicode_display = unicode_invalid; ++ else if (streq (optarg, "hex") || streq (optarg, "x")) ++ unicode_display = unicode_hex; ++ else if (streq (optarg, "highlight") || streq (optarg, "h")) ++ unicode_display = unicode_highlight; ++ else ++ fatal (_("invalid argument to -U/--unicode: %s"), optarg); ++ break; ++ + case 'H': + usage (stdout, 0); + /* No need to set seenflag or to break - usage() does not return. */ +diff -rupN binutils.orig/binutils/objdump.c.orig binutils-2.35.2/binutils/objdump.c.orig +--- binutils.orig/binutils/objdump.c.orig 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/objdump.c.orig 2021-01-30 08:38:03.000000000 +0000 +@@ -0,0 +1,5446 @@ ++/* objdump.c -- dump information about an object file. ++ Copyright (C) 1990-2020 Free Software Foundation, Inc. ++ ++ This file is part of GNU Binutils. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, 51 Franklin Street - Fifth Floor, Boston, ++ MA 02110-1301, USA. */ ++ ++ ++/* Objdump overview. ++ ++ Objdump displays information about one or more object files, either on ++ their own, or inside libraries. It is commonly used as a disassembler, ++ but it can also display information about file headers, symbol tables, ++ relocations, debugging directives and more. ++ ++ The flow of execution is as follows: ++ ++ 1. Command line arguments are checked for control switches and the ++ information to be displayed is selected. ++ ++ 2. Any remaining arguments are assumed to be object files, and they are ++ processed in order by display_bfd(). If the file is an archive each ++ of its elements is processed in turn. ++ ++ 3. The file's target architecture and binary file format are determined ++ by bfd_check_format(). If they are recognised, then dump_bfd() is ++ called. ++ ++ 4. dump_bfd() in turn calls separate functions to display the requested ++ item(s) of information(s). For example disassemble_data() is called if ++ a disassembly has been requested. ++ ++ When disassembling the code loops through blocks of instructions bounded ++ by symbols, calling disassemble_bytes() on each block. The actual ++ disassembling is done by the libopcodes library, via a function pointer ++ supplied by the disassembler() function. */ ++ ++#include "sysdep.h" ++#include "bfd.h" ++#include "elf-bfd.h" ++#include "coff-bfd.h" ++#include "progress.h" ++#include "bucomm.h" ++#include "elfcomm.h" ++#include "dwarf.h" ++#include "ctf-api.h" ++#include "getopt.h" ++#include "safe-ctype.h" ++#include "dis-asm.h" ++#include "libiberty.h" ++#include "demangle.h" ++#include "filenames.h" ++#include "debug.h" ++#include "budbg.h" ++#include "objdump.h" ++ ++#ifdef HAVE_MMAP ++#include ++#endif ++ ++/* Internal headers for the ELF .stab-dump code - sorry. */ ++#define BYTES_IN_WORD 32 ++#include "aout/aout64.h" ++ ++/* Exit status. */ ++static int exit_status = 0; ++ ++static char *default_target = NULL; /* Default at runtime. */ ++ ++/* The following variables are set based on arguments passed on the ++ command line. */ ++static int show_version = 0; /* Show the version number. */ ++static int dump_section_contents; /* -s */ ++static int dump_section_headers; /* -h */ ++static bfd_boolean dump_file_header; /* -f */ ++static int dump_symtab; /* -t */ ++static int dump_dynamic_symtab; /* -T */ ++static int dump_reloc_info; /* -r */ ++static int dump_dynamic_reloc_info; /* -R */ ++static int dump_ar_hdrs; /* -a */ ++static int dump_private_headers; /* -p */ ++static char *dump_private_options; /* -P */ ++static int no_addresses; /* --no-addresses */ ++static int prefix_addresses; /* --prefix-addresses */ ++static int with_line_numbers; /* -l */ ++static bfd_boolean with_source_code; /* -S */ ++static int show_raw_insn; /* --show-raw-insn */ ++static int dump_dwarf_section_info; /* --dwarf */ ++static int dump_stab_section_info; /* --stabs */ ++static int dump_ctf_section_info; /* --ctf */ ++static char *dump_ctf_section_name; ++static char *dump_ctf_parent_name; /* --ctf-parent */ ++static int do_demangle; /* -C, --demangle */ ++static bfd_boolean disassemble; /* -d */ ++static bfd_boolean disassemble_all; /* -D */ ++static int disassemble_zeroes; /* --disassemble-zeroes */ ++static bfd_boolean formats_info; /* -i */ ++static int wide_output; /* -w */ ++static int insn_width; /* --insn-width */ ++static bfd_vma start_address = (bfd_vma) -1; /* --start-address */ ++static bfd_vma stop_address = (bfd_vma) -1; /* --stop-address */ ++static int dump_debugging; /* --debugging */ ++static int dump_debugging_tags; /* --debugging-tags */ ++static int suppress_bfd_header; ++static int dump_special_syms = 0; /* --special-syms */ ++static bfd_vma adjust_section_vma = 0; /* --adjust-vma */ ++static int file_start_context = 0; /* --file-start-context */ ++static bfd_boolean display_file_offsets;/* -F */ ++static const char *prefix; /* --prefix */ ++static int prefix_strip; /* --prefix-strip */ ++static size_t prefix_length; ++static bfd_boolean unwind_inlines; /* --inlines. */ ++static const char * disasm_sym; /* Disassembly start symbol. */ ++static const char * source_comment; /* --source_comment. */ ++static bfd_boolean visualize_jumps = FALSE; /* --visualize-jumps. */ ++static bfd_boolean color_output = FALSE; /* --visualize-jumps=color. */ ++static bfd_boolean extended_color_output = FALSE; /* --visualize-jumps=extended-color. */ ++ ++static int demangle_flags = DMGL_ANSI | DMGL_PARAMS; ++ ++/* A structure to record the sections mentioned in -j switches. */ ++struct only ++{ ++ const char * name; /* The name of the section. */ ++ bfd_boolean seen; /* A flag to indicate that the section has been found in one or more input files. */ ++ struct only * next; /* Pointer to the next structure in the list. */ ++}; ++/* Pointer to an array of 'only' structures. ++ This pointer is NULL if the -j switch has not been used. */ ++static struct only * only_list = NULL; ++ ++/* Variables for handling include file path table. */ ++static const char **include_paths; ++static int include_path_count; ++ ++/* Extra info to pass to the section disassembler and address printing ++ function. */ ++struct objdump_disasm_info ++{ ++ bfd * abfd; ++ bfd_boolean require_sec; ++ arelent ** dynrelbuf; ++ long dynrelcount; ++ disassembler_ftype disassemble_fn; ++ arelent * reloc; ++ const char * symbol; ++}; ++ ++/* Architecture to disassemble for, or default if NULL. */ ++static char *machine = NULL; ++ ++/* Target specific options to the disassembler. */ ++static char *disassembler_options = NULL; ++ ++/* Endianness to disassemble for, or default if BFD_ENDIAN_UNKNOWN. */ ++static enum bfd_endian endian = BFD_ENDIAN_UNKNOWN; ++ ++/* The symbol table. */ ++static asymbol **syms; ++ ++/* Number of symbols in `syms'. */ ++static long symcount = 0; ++ ++/* The sorted symbol table. */ ++static asymbol **sorted_syms; ++ ++/* Number of symbols in `sorted_syms'. */ ++static long sorted_symcount = 0; ++ ++/* The dynamic symbol table. */ ++static asymbol **dynsyms; ++ ++/* The synthetic symbol table. */ ++static asymbol *synthsyms; ++static long synthcount = 0; ++ ++/* Number of symbols in `dynsyms'. */ ++static long dynsymcount = 0; ++ ++static bfd_byte *stabs; ++static bfd_size_type stab_size; ++ ++static bfd_byte *strtab; ++static bfd_size_type stabstr_size; ++ ++/* Handlers for -P/--private. */ ++static const struct objdump_private_desc * const objdump_private_vectors[] = ++ { ++ OBJDUMP_PRIVATE_VECTORS ++ NULL ++ }; ++ ++/* The list of detected jumps inside a function. */ ++static struct jump_info *detected_jumps = NULL; ++ ++static void usage (FILE *, int) ATTRIBUTE_NORETURN; ++static void ++usage (FILE *stream, int status) ++{ ++ fprintf (stream, _("Usage: %s \n"), program_name); ++ fprintf (stream, _(" Display information from object .\n")); ++ fprintf (stream, _(" At least one of the following switches must be given:\n")); ++ fprintf (stream, _("\ ++ -a, --archive-headers Display archive header information\n\ ++ -f, --file-headers Display the contents of the overall file header\n\ ++ -p, --private-headers Display object format specific file header contents\n\ ++ -P, --private=OPT,OPT... Display object format specific contents\n\ ++ -h, --[section-]headers Display the contents of the section headers\n\ ++ -x, --all-headers Display the contents of all headers\n\ ++ -d, --disassemble Display assembler contents of executable sections\n\ ++ -D, --disassemble-all Display assembler contents of all sections\n\ ++ --disassemble= Display assembler contents from \n\ ++ -S, --source Intermix source code with disassembly\n\ ++ --source-comment[=] Prefix lines of source code with \n\ ++ -s, --full-contents Display the full contents of all sections requested\n\ ++ -g, --debugging Display debug information in object file\n\ ++ -e, --debugging-tags Display debug information using ctags style\n\ ++ -G, --stabs Display (in raw form) any STABS info in the file\n\ ++ -W[lLiaprmfFsoORtUuTgAckK] or\n\ ++ --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,\n\ ++ =frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,\n\ ++ =gdb_index,=trace_info,=trace_abbrev,=trace_aranges,\n\ ++ =addr,=cu_index,=links,=follow-links]\n\ ++ Display DWARF info in the file\n\ ++")); ++#ifdef ENABLE_LIBCTF ++ fprintf (stream, _("\ ++ --ctf=SECTION Display CTF info from SECTION\n\ ++")); ++#endif ++ fprintf (stream, _("\ ++ -t, --syms Display the contents of the symbol table(s)\n\ ++ -T, --dynamic-syms Display the contents of the dynamic symbol table\n\ ++ -r, --reloc Display the relocation entries in the file\n\ ++ -R, --dynamic-reloc Display the dynamic relocation entries in the file\n\ ++ @ Read options from \n\ ++ -v, --version Display this program's version number\n\ ++ -i, --info List object formats and architectures supported\n\ ++ -H, --help Display this information\n\ ++")); ++ if (status != 2) ++ { ++ const struct objdump_private_desc * const *desc; ++ ++ fprintf (stream, _("\n The following switches are optional:\n")); ++ fprintf (stream, _("\ ++ -b, --target=BFDNAME Specify the target object format as BFDNAME\n\ ++ -m, --architecture=MACHINE Specify the target architecture as MACHINE\n\ ++ -j, --section=NAME Only display information for section NAME\n\ ++ -M, --disassembler-options=OPT Pass text OPT on to the disassembler\n\ ++ -EB --endian=big Assume big endian format when disassembling\n\ ++ -EL --endian=little Assume little endian format when disassembling\n\ ++ --file-start-context Include context from start of file (with -S)\n\ ++ -I, --include=DIR Add DIR to search list for source files\n\ ++ -l, --line-numbers Include line numbers and filenames in output\n\ ++ -F, --file-offsets Include file offsets when displaying information\n\ ++ -C, --demangle[=STYLE] Decode mangled/processed symbol names\n\ ++ The STYLE, if specified, can be `auto', `gnu',\n\ ++ `lucid', `arm', `hp', `edg', `gnu-v3', `java'\n\ ++ or `gnat'\n\ ++ --recurse-limit Enable a limit on recursion whilst demangling. [Default]\n\ ++ --no-recurse-limit Disable a limit on recursion whilst demangling\n\ ++ -w, --wide Format output for more than 80 columns\n\ ++ -z, --disassemble-zeroes Do not skip blocks of zeroes when disassembling\n\ ++ --start-address=ADDR Only process data whose address is >= ADDR\n\ ++ --stop-address=ADDR Only process data whose address is < ADDR\n\ ++ --no-addresses Do not print address alongside disassembly\n\ ++ --prefix-addresses Print complete address alongside disassembly\n\ ++ --[no-]show-raw-insn Display hex alongside symbolic disassembly\n\ ++ --insn-width=WIDTH Display WIDTH bytes on a single line for -d\n\ ++ --adjust-vma=OFFSET Add OFFSET to all displayed section addresses\n\ ++ --special-syms Include special symbols in symbol dumps\n\ ++ --inlines Print all inlines for source line (with -l)\n\ ++ --prefix=PREFIX Add PREFIX to absolute paths for -S\n\ ++ --prefix-strip=LEVEL Strip initial directory names for -S\n")); ++ fprintf (stream, _("\ ++ --dwarf-depth=N Do not display DIEs at depth N or greater\n\ ++ --dwarf-start=N Display DIEs starting with N, at the same depth\n\ ++ or deeper\n\ ++ --dwarf-check Make additional dwarf internal consistency checks.\n")); ++#ifdef ENABLE_LIBCTF ++ fprintf (stream, _("\ ++ --ctf-parent=SECTION Use SECTION as the CTF parent\n")); ++#endif ++ fprintf (stream, _("\ ++ --visualize-jumps Visualize jumps by drawing ASCII art lines\n\ ++ --visualize-jumps=color Use colors in the ASCII art\n\ ++ --visualize-jumps=extended-color Use extended 8-bit color codes\n\ ++ --visualize-jumps=off Disable jump visualization\n\n")); ++ ++ list_supported_targets (program_name, stream); ++ list_supported_architectures (program_name, stream); ++ ++ disassembler_usage (stream); ++ ++ if (objdump_private_vectors[0] != NULL) ++ { ++ fprintf (stream, ++ _("\nOptions supported for -P/--private switch:\n")); ++ for (desc = objdump_private_vectors; *desc != NULL; desc++) ++ (*desc)->help (stream); ++ } ++ } ++ if (REPORT_BUGS_TO[0] && status == 0) ++ fprintf (stream, _("Report bugs to %s.\n"), REPORT_BUGS_TO); ++ exit (status); ++} ++ ++/* 150 isn't special; it's just an arbitrary non-ASCII char value. */ ++enum option_values ++ { ++ OPTION_ENDIAN=150, ++ OPTION_START_ADDRESS, ++ OPTION_STOP_ADDRESS, ++ OPTION_DWARF, ++ OPTION_PREFIX, ++ OPTION_PREFIX_STRIP, ++ OPTION_INSN_WIDTH, ++ OPTION_ADJUST_VMA, ++ OPTION_DWARF_DEPTH, ++ OPTION_DWARF_CHECK, ++ OPTION_DWARF_START, ++ OPTION_RECURSE_LIMIT, ++ OPTION_NO_RECURSE_LIMIT, ++ OPTION_INLINES, ++ OPTION_SOURCE_COMMENT, ++#ifdef ENABLE_LIBCTF ++ OPTION_CTF, ++ OPTION_CTF_PARENT, ++#endif ++ OPTION_VISUALIZE_JUMPS ++ }; ++ ++static struct option long_options[]= ++{ ++ {"adjust-vma", required_argument, NULL, OPTION_ADJUST_VMA}, ++ {"all-headers", no_argument, NULL, 'x'}, ++ {"private-headers", no_argument, NULL, 'p'}, ++ {"private", required_argument, NULL, 'P'}, ++ {"architecture", required_argument, NULL, 'm'}, ++ {"archive-headers", no_argument, NULL, 'a'}, ++ {"debugging", no_argument, NULL, 'g'}, ++ {"debugging-tags", no_argument, NULL, 'e'}, ++ {"demangle", optional_argument, NULL, 'C'}, ++ {"disassemble", optional_argument, NULL, 'd'}, ++ {"disassemble-all", no_argument, NULL, 'D'}, ++ {"disassembler-options", required_argument, NULL, 'M'}, ++ {"disassemble-zeroes", no_argument, NULL, 'z'}, ++ {"dynamic-reloc", no_argument, NULL, 'R'}, ++ {"dynamic-syms", no_argument, NULL, 'T'}, ++ {"endian", required_argument, NULL, OPTION_ENDIAN}, ++ {"file-headers", no_argument, NULL, 'f'}, ++ {"file-offsets", no_argument, NULL, 'F'}, ++ {"file-start-context", no_argument, &file_start_context, 1}, ++ {"full-contents", no_argument, NULL, 's'}, ++ {"headers", no_argument, NULL, 'h'}, ++ {"help", no_argument, NULL, 'H'}, ++ {"info", no_argument, NULL, 'i'}, ++ {"line-numbers", no_argument, NULL, 'l'}, ++ {"no-show-raw-insn", no_argument, &show_raw_insn, -1}, ++ {"no-addresses", no_argument, &no_addresses, 1}, ++ {"prefix-addresses", no_argument, &prefix_addresses, 1}, ++ {"recurse-limit", no_argument, NULL, OPTION_RECURSE_LIMIT}, ++ {"recursion-limit", no_argument, NULL, OPTION_RECURSE_LIMIT}, ++ {"no-recurse-limit", no_argument, NULL, OPTION_NO_RECURSE_LIMIT}, ++ {"no-recursion-limit", no_argument, NULL, OPTION_NO_RECURSE_LIMIT}, ++ {"reloc", no_argument, NULL, 'r'}, ++ {"section", required_argument, NULL, 'j'}, ++ {"section-headers", no_argument, NULL, 'h'}, ++ {"show-raw-insn", no_argument, &show_raw_insn, 1}, ++ {"source", no_argument, NULL, 'S'}, ++ {"source-comment", optional_argument, NULL, OPTION_SOURCE_COMMENT}, ++ {"special-syms", no_argument, &dump_special_syms, 1}, ++ {"include", required_argument, NULL, 'I'}, ++ {"dwarf", optional_argument, NULL, OPTION_DWARF}, ++#ifdef ENABLE_LIBCTF ++ {"ctf", required_argument, NULL, OPTION_CTF}, ++ {"ctf-parent", required_argument, NULL, OPTION_CTF_PARENT}, ++#endif ++ {"stabs", no_argument, NULL, 'G'}, ++ {"start-address", required_argument, NULL, OPTION_START_ADDRESS}, ++ {"stop-address", required_argument, NULL, OPTION_STOP_ADDRESS}, ++ {"syms", no_argument, NULL, 't'}, ++ {"target", required_argument, NULL, 'b'}, ++ {"version", no_argument, NULL, 'V'}, ++ {"wide", no_argument, NULL, 'w'}, ++ {"prefix", required_argument, NULL, OPTION_PREFIX}, ++ {"prefix-strip", required_argument, NULL, OPTION_PREFIX_STRIP}, ++ {"insn-width", required_argument, NULL, OPTION_INSN_WIDTH}, ++ {"dwarf-depth", required_argument, 0, OPTION_DWARF_DEPTH}, ++ {"dwarf-start", required_argument, 0, OPTION_DWARF_START}, ++ {"dwarf-check", no_argument, 0, OPTION_DWARF_CHECK}, ++ {"inlines", no_argument, 0, OPTION_INLINES}, ++ {"visualize-jumps", optional_argument, 0, OPTION_VISUALIZE_JUMPS}, ++ {0, no_argument, 0, 0} ++}; ++ ++static void ++nonfatal (const char *msg) ++{ ++ bfd_nonfatal (msg); ++ exit_status = 1; ++} ++ ++/* Returns a version of IN with any control characters ++ replaced by escape sequences. Uses a static buffer ++ if necessary. */ ++ ++static const char * ++sanitize_string (const char * in) ++{ ++ static char * buffer = NULL; ++ static size_t buffer_len = 0; ++ const char * original = in; ++ char * out; ++ ++ /* Paranoia. */ ++ if (in == NULL) ++ return ""; ++ ++ /* See if any conversion is necessary. In the majority ++ of cases it will not be needed. */ ++ do ++ { ++ char c = *in++; ++ ++ if (c == 0) ++ return original; ++ ++ if (ISCNTRL (c)) ++ break; ++ } ++ while (1); ++ ++ /* Copy the input, translating as needed. */ ++ in = original; ++ if (buffer_len < (strlen (in) * 2)) ++ { ++ free ((void *) buffer); ++ buffer_len = strlen (in) * 2; ++ buffer = xmalloc (buffer_len + 1); ++ } ++ ++ out = buffer; ++ do ++ { ++ char c = *in++; ++ ++ if (c == 0) ++ break; ++ ++ if (!ISCNTRL (c)) ++ *out++ = c; ++ else ++ { ++ *out++ = '^'; ++ *out++ = c + 0x40; ++ } ++ } ++ while (1); ++ ++ *out = 0; ++ return buffer; ++} ++ ++ ++/* Returns TRUE if the specified section should be dumped. */ ++ ++static bfd_boolean ++process_section_p (asection * section) ++{ ++ struct only * only; ++ ++ if (only_list == NULL) ++ return TRUE; ++ ++ for (only = only_list; only; only = only->next) ++ if (strcmp (only->name, section->name) == 0) ++ { ++ only->seen = TRUE; ++ return TRUE; ++ } ++ ++ return FALSE; ++} ++ ++/* Add an entry to the 'only' list. */ ++ ++static void ++add_only (char * name) ++{ ++ struct only * only; ++ ++ /* First check to make sure that we do not ++ already have an entry for this name. */ ++ for (only = only_list; only; only = only->next) ++ if (strcmp (only->name, name) == 0) ++ return; ++ ++ only = xmalloc (sizeof * only); ++ only->name = name; ++ only->seen = FALSE; ++ only->next = only_list; ++ only_list = only; ++} ++ ++/* Release the memory used by the 'only' list. ++ PR 11225: Issue a warning message for unseen sections. ++ Only do this if none of the sections were seen. This is mainly to support ++ tools like the GAS testsuite where an object file is dumped with a list of ++ generic section names known to be present in a range of different file ++ formats. */ ++ ++static void ++free_only_list (void) ++{ ++ bfd_boolean at_least_one_seen = FALSE; ++ struct only * only; ++ struct only * next; ++ ++ if (only_list == NULL) ++ return; ++ ++ for (only = only_list; only; only = only->next) ++ if (only->seen) ++ { ++ at_least_one_seen = TRUE; ++ break; ++ } ++ ++ for (only = only_list; only; only = next) ++ { ++ if (! at_least_one_seen) ++ { ++ non_fatal (_("section '%s' mentioned in a -j option, " ++ "but not found in any input file"), ++ only->name); ++ exit_status = 1; ++ } ++ next = only->next; ++ free (only); ++ } ++} ++ ++ ++static void ++dump_section_header (bfd *abfd, asection *section, void *data) ++{ ++ char *comma = ""; ++ unsigned int opb = bfd_octets_per_byte (abfd, section); ++ int longest_section_name = *((int *) data); ++ ++ /* Ignore linker created section. See elfNN_ia64_object_p in ++ bfd/elfxx-ia64.c. */ ++ if (section->flags & SEC_LINKER_CREATED) ++ return; ++ ++ /* PR 10413: Skip sections that we are ignoring. */ ++ if (! process_section_p (section)) ++ return; ++ ++ printf ("%3d %-*s %08lx ", section->index, longest_section_name, ++ sanitize_string (bfd_section_name (section)), ++ (unsigned long) bfd_section_size (section) / opb); ++ bfd_printf_vma (abfd, bfd_section_vma (section)); ++ printf (" "); ++ bfd_printf_vma (abfd, section->lma); ++ printf (" %08lx 2**%u", (unsigned long) section->filepos, ++ bfd_section_alignment (section)); ++ if (! wide_output) ++ printf ("\n "); ++ printf (" "); ++ ++#define PF(x, y) \ ++ if (section->flags & x) { printf ("%s%s", comma, y); comma = ", "; } ++ ++ PF (SEC_HAS_CONTENTS, "CONTENTS"); ++ PF (SEC_ALLOC, "ALLOC"); ++ PF (SEC_CONSTRUCTOR, "CONSTRUCTOR"); ++ PF (SEC_LOAD, "LOAD"); ++ PF (SEC_RELOC, "RELOC"); ++ PF (SEC_READONLY, "READONLY"); ++ PF (SEC_CODE, "CODE"); ++ PF (SEC_DATA, "DATA"); ++ PF (SEC_ROM, "ROM"); ++ PF (SEC_DEBUGGING, "DEBUGGING"); ++ PF (SEC_NEVER_LOAD, "NEVER_LOAD"); ++ PF (SEC_EXCLUDE, "EXCLUDE"); ++ PF (SEC_SORT_ENTRIES, "SORT_ENTRIES"); ++ if (bfd_get_arch (abfd) == bfd_arch_tic54x) ++ { ++ PF (SEC_TIC54X_BLOCK, "BLOCK"); ++ PF (SEC_TIC54X_CLINK, "CLINK"); ++ } ++ PF (SEC_SMALL_DATA, "SMALL_DATA"); ++ if (bfd_get_flavour (abfd) == bfd_target_coff_flavour) ++ { ++ PF (SEC_COFF_SHARED, "SHARED"); ++ PF (SEC_COFF_NOREAD, "NOREAD"); ++ } ++ else if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) ++ { ++ PF (SEC_ELF_OCTETS, "OCTETS"); ++ PF (SEC_ELF_PURECODE, "PURECODE"); ++ } ++ PF (SEC_THREAD_LOCAL, "THREAD_LOCAL"); ++ PF (SEC_GROUP, "GROUP"); ++ if (bfd_get_arch (abfd) == bfd_arch_mep) ++ { ++ PF (SEC_MEP_VLIW, "VLIW"); ++ } ++ ++ if ((section->flags & SEC_LINK_ONCE) != 0) ++ { ++ const char *ls; ++ struct coff_comdat_info *comdat; ++ ++ switch (section->flags & SEC_LINK_DUPLICATES) ++ { ++ default: ++ abort (); ++ case SEC_LINK_DUPLICATES_DISCARD: ++ ls = "LINK_ONCE_DISCARD"; ++ break; ++ case SEC_LINK_DUPLICATES_ONE_ONLY: ++ ls = "LINK_ONCE_ONE_ONLY"; ++ break; ++ case SEC_LINK_DUPLICATES_SAME_SIZE: ++ ls = "LINK_ONCE_SAME_SIZE"; ++ break; ++ case SEC_LINK_DUPLICATES_SAME_CONTENTS: ++ ls = "LINK_ONCE_SAME_CONTENTS"; ++ break; ++ } ++ printf ("%s%s", comma, ls); ++ ++ comdat = bfd_coff_get_comdat_section (abfd, section); ++ if (comdat != NULL) ++ printf (" (COMDAT %s %ld)", comdat->name, comdat->symbol); ++ ++ comma = ", "; ++ } ++ ++ printf ("\n"); ++#undef PF ++} ++ ++/* Called on each SECTION in ABFD, update the int variable pointed to by ++ DATA which contains the string length of the longest section name. */ ++ ++static void ++find_longest_section_name (bfd *abfd ATTRIBUTE_UNUSED, ++ asection *section, void *data) ++{ ++ int *longest_so_far = (int *) data; ++ const char *name; ++ int len; ++ ++ /* Ignore linker created section. */ ++ if (section->flags & SEC_LINKER_CREATED) ++ return; ++ ++ /* Skip sections that we are ignoring. */ ++ if (! process_section_p (section)) ++ return; ++ ++ name = bfd_section_name (section); ++ len = (int) strlen (name); ++ if (len > *longest_so_far) ++ *longest_so_far = len; ++} ++ ++static void ++dump_headers (bfd *abfd) ++{ ++ /* The default width of 13 is just an arbitrary choice. */ ++ int max_section_name_length = 13; ++ int bfd_vma_width; ++ ++#ifndef BFD64 ++ bfd_vma_width = 10; ++#else ++ /* With BFD64, non-ELF returns -1 and wants always 64 bit addresses. */ ++ if (bfd_get_arch_size (abfd) == 32) ++ bfd_vma_width = 10; ++ else ++ bfd_vma_width = 18; ++#endif ++ ++ printf (_("Sections:\n")); ++ ++ if (wide_output) ++ bfd_map_over_sections (abfd, find_longest_section_name, ++ &max_section_name_length); ++ ++ printf (_("Idx %-*s Size %-*s%-*sFile off Algn"), ++ max_section_name_length, "Name", ++ bfd_vma_width, "VMA", ++ bfd_vma_width, "LMA"); ++ ++ if (wide_output) ++ printf (_(" Flags")); ++ printf ("\n"); ++ ++ bfd_map_over_sections (abfd, dump_section_header, ++ &max_section_name_length); ++} ++ ++static asymbol ** ++slurp_symtab (bfd *abfd) ++{ ++ asymbol **sy = NULL; ++ long storage; ++ ++ if (!(bfd_get_file_flags (abfd) & HAS_SYMS)) ++ { ++ symcount = 0; ++ return NULL; ++ } ++ ++ storage = bfd_get_symtab_upper_bound (abfd); ++ if (storage < 0) ++ { ++ non_fatal (_("failed to read symbol table from: %s"), bfd_get_filename (abfd)); ++ bfd_fatal (_("error message was")); ++ } ++ if (storage) ++ { ++ off_t filesize = bfd_get_file_size (abfd); ++ ++ /* qv PR 24707. */ ++ if (filesize > 0 ++ && filesize < storage ++ /* The MMO file format supports its own special compression ++ technique, so its sections can be larger than the file size. */ ++ && bfd_get_flavour (abfd) != bfd_target_mmo_flavour) ++ { ++ bfd_nonfatal_message (bfd_get_filename (abfd), abfd, NULL, ++ _("error: symbol table size (%#lx) is larger than filesize (%#lx)"), ++ storage, (long) filesize); ++ exit_status = 1; ++ symcount = 0; ++ return NULL; ++ } ++ ++ sy = (asymbol **) xmalloc (storage); ++ } ++ ++ symcount = bfd_canonicalize_symtab (abfd, sy); ++ if (symcount < 0) ++ bfd_fatal (bfd_get_filename (abfd)); ++ return sy; ++} ++ ++/* Read in the dynamic symbols. */ ++ ++static asymbol ** ++slurp_dynamic_symtab (bfd *abfd) ++{ ++ asymbol **sy = NULL; ++ long storage; ++ ++ storage = bfd_get_dynamic_symtab_upper_bound (abfd); ++ if (storage < 0) ++ { ++ if (!(bfd_get_file_flags (abfd) & DYNAMIC)) ++ { ++ non_fatal (_("%s: not a dynamic object"), bfd_get_filename (abfd)); ++ exit_status = 1; ++ dynsymcount = 0; ++ return NULL; ++ } ++ ++ bfd_fatal (bfd_get_filename (abfd)); ++ } ++ if (storage) ++ sy = (asymbol **) xmalloc (storage); ++ ++ dynsymcount = bfd_canonicalize_dynamic_symtab (abfd, sy); ++ if (dynsymcount < 0) ++ bfd_fatal (bfd_get_filename (abfd)); ++ return sy; ++} ++ ++/* Some symbol names are significant and should be kept in the ++ table of sorted symbol names, even if they are marked as ++ debugging/section symbols. */ ++ ++static bfd_boolean ++is_significant_symbol_name (const char * name) ++{ ++ return strncmp (name, ".plt", 4) == 0 || strcmp (name, ".got") == 0; ++} ++ ++/* Filter out (in place) symbols that are useless for disassembly. ++ COUNT is the number of elements in SYMBOLS. ++ Return the number of useful symbols. */ ++ ++static long ++remove_useless_symbols (asymbol **symbols, long count) ++{ ++ asymbol **in_ptr = symbols, **out_ptr = symbols; ++ ++ while (--count >= 0) ++ { ++ asymbol *sym = *in_ptr++; ++ ++ if (sym->name == NULL || sym->name[0] == '\0') ++ continue; ++ if ((sym->flags & (BSF_DEBUGGING | BSF_SECTION_SYM)) ++ && ! is_significant_symbol_name (sym->name)) ++ continue; ++ if (bfd_is_und_section (sym->section) ++ || bfd_is_com_section (sym->section)) ++ continue; ++ ++ *out_ptr++ = sym; ++ } ++ return out_ptr - symbols; ++} ++ ++static const asection *compare_section; ++ ++/* Sort symbols into value order. */ ++ ++static int ++compare_symbols (const void *ap, const void *bp) ++{ ++ const asymbol *a = * (const asymbol **) ap; ++ const asymbol *b = * (const asymbol **) bp; ++ const char *an; ++ const char *bn; ++ size_t anl; ++ size_t bnl; ++ bfd_boolean as, af, bs, bf; ++ flagword aflags; ++ flagword bflags; ++ ++ if (bfd_asymbol_value (a) > bfd_asymbol_value (b)) ++ return 1; ++ else if (bfd_asymbol_value (a) < bfd_asymbol_value (b)) ++ return -1; ++ ++ /* Prefer symbols from the section currently being disassembled. ++ Don't sort symbols from other sections by section, since there ++ isn't much reason to prefer one section over another otherwise. ++ See sym_ok comment for why we compare by section name. */ ++ as = strcmp (compare_section->name, a->section->name) == 0; ++ bs = strcmp (compare_section->name, b->section->name) == 0; ++ if (as && !bs) ++ return -1; ++ if (!as && bs) ++ return 1; ++ ++ an = bfd_asymbol_name (a); ++ bn = bfd_asymbol_name (b); ++ anl = strlen (an); ++ bnl = strlen (bn); ++ ++ /* The symbols gnu_compiled and gcc2_compiled convey no real ++ information, so put them after other symbols with the same value. */ ++ af = (strstr (an, "gnu_compiled") != NULL ++ || strstr (an, "gcc2_compiled") != NULL); ++ bf = (strstr (bn, "gnu_compiled") != NULL ++ || strstr (bn, "gcc2_compiled") != NULL); ++ ++ if (af && ! bf) ++ return 1; ++ if (! af && bf) ++ return -1; ++ ++ /* We use a heuristic for the file name, to try to sort it after ++ more useful symbols. It may not work on non Unix systems, but it ++ doesn't really matter; the only difference is precisely which ++ symbol names get printed. */ ++ ++#define file_symbol(s, sn, snl) \ ++ (((s)->flags & BSF_FILE) != 0 \ ++ || ((snl) > 2 \ ++ && (sn)[(snl) - 2] == '.' \ ++ && ((sn)[(snl) - 1] == 'o' \ ++ || (sn)[(snl) - 1] == 'a'))) ++ ++ af = file_symbol (a, an, anl); ++ bf = file_symbol (b, bn, bnl); ++ ++ if (af && ! bf) ++ return 1; ++ if (! af && bf) ++ return -1; ++ ++ /* Sort function and object symbols before global symbols before ++ local symbols before section symbols before debugging symbols. */ ++ ++ aflags = a->flags; ++ bflags = b->flags; ++ ++ if ((aflags & BSF_DEBUGGING) != (bflags & BSF_DEBUGGING)) ++ { ++ if ((aflags & BSF_DEBUGGING) != 0) ++ return 1; ++ else ++ return -1; ++ } ++ if ((aflags & BSF_SECTION_SYM) != (bflags & BSF_SECTION_SYM)) ++ { ++ if ((aflags & BSF_SECTION_SYM) != 0) ++ return 1; ++ else ++ return -1; ++ } ++ if ((aflags & BSF_FUNCTION) != (bflags & BSF_FUNCTION)) ++ { ++ if ((aflags & BSF_FUNCTION) != 0) ++ return -1; ++ else ++ return 1; ++ } ++ if ((aflags & BSF_OBJECT) != (bflags & BSF_OBJECT)) ++ { ++ if ((aflags & BSF_OBJECT) != 0) ++ return -1; ++ else ++ return 1; ++ } ++ if ((aflags & BSF_LOCAL) != (bflags & BSF_LOCAL)) ++ { ++ if ((aflags & BSF_LOCAL) != 0) ++ return 1; ++ else ++ return -1; ++ } ++ if ((aflags & BSF_GLOBAL) != (bflags & BSF_GLOBAL)) ++ { ++ if ((aflags & BSF_GLOBAL) != 0) ++ return -1; ++ else ++ return 1; ++ } ++ ++ if (bfd_get_flavour (bfd_asymbol_bfd (a)) == bfd_target_elf_flavour ++ && bfd_get_flavour (bfd_asymbol_bfd (b)) == bfd_target_elf_flavour) ++ { ++ bfd_vma asz, bsz; ++ ++ asz = 0; ++ if ((a->flags & (BSF_SECTION_SYM | BSF_SYNTHETIC)) == 0) ++ asz = ((elf_symbol_type *) a)->internal_elf_sym.st_size; ++ bsz = 0; ++ if ((b->flags & (BSF_SECTION_SYM | BSF_SYNTHETIC)) == 0) ++ bsz = ((elf_symbol_type *) b)->internal_elf_sym.st_size; ++ if (asz != bsz) ++ return asz > bsz ? -1 : 1; ++ } ++ ++ /* Symbols that start with '.' might be section names, so sort them ++ after symbols that don't start with '.'. */ ++ if (an[0] == '.' && bn[0] != '.') ++ return 1; ++ if (an[0] != '.' && bn[0] == '.') ++ return -1; ++ ++ /* Finally, if we can't distinguish them in any other way, try to ++ get consistent results by sorting the symbols by name. */ ++ return strcmp (an, bn); ++} ++ ++/* Sort relocs into address order. */ ++ ++static int ++compare_relocs (const void *ap, const void *bp) ++{ ++ const arelent *a = * (const arelent **) ap; ++ const arelent *b = * (const arelent **) bp; ++ ++ if (a->address > b->address) ++ return 1; ++ else if (a->address < b->address) ++ return -1; ++ ++ /* So that associated relocations tied to the same address show up ++ in the correct order, we don't do any further sorting. */ ++ if (a > b) ++ return 1; ++ else if (a < b) ++ return -1; ++ else ++ return 0; ++} ++ ++/* Print an address (VMA) to the output stream in INFO. ++ If SKIP_ZEROES is TRUE, omit leading zeroes. */ ++ ++static void ++objdump_print_value (bfd_vma vma, struct disassemble_info *inf, ++ bfd_boolean skip_zeroes) ++{ ++ char buf[30]; ++ char *p; ++ struct objdump_disasm_info *aux; ++ ++ aux = (struct objdump_disasm_info *) inf->application_data; ++ bfd_sprintf_vma (aux->abfd, buf, vma); ++ if (! skip_zeroes) ++ p = buf; ++ else ++ { ++ for (p = buf; *p == '0'; ++p) ++ ; ++ if (*p == '\0') ++ --p; ++ } ++ (*inf->fprintf_func) (inf->stream, "%s", p); ++} ++ ++/* Print the name of a symbol. */ ++ ++static void ++objdump_print_symname (bfd *abfd, struct disassemble_info *inf, ++ asymbol *sym) ++{ ++ char *alloc; ++ const char *name, *version_string = NULL; ++ bfd_boolean hidden = FALSE; ++ ++ alloc = NULL; ++ name = bfd_asymbol_name (sym); ++ if (do_demangle && name[0] != '\0') ++ { ++ /* Demangle the name. */ ++ alloc = bfd_demangle (abfd, name, demangle_flags); ++ if (alloc != NULL) ++ name = alloc; ++ } ++ ++ if ((sym->flags & (BSF_SECTION_SYM | BSF_SYNTHETIC)) == 0) ++ version_string = bfd_get_symbol_version_string (abfd, sym, TRUE, ++ &hidden); ++ ++ if (bfd_is_und_section (bfd_asymbol_section (sym))) ++ hidden = TRUE; ++ ++ name = sanitize_string (name); ++ ++ if (inf != NULL) ++ { ++ (*inf->fprintf_func) (inf->stream, "%s", name); ++ if (version_string && *version_string != '\0') ++ (*inf->fprintf_func) (inf->stream, hidden ? "@%s" : "@@%s", ++ version_string); ++ } ++ else ++ { ++ printf ("%s", name); ++ if (version_string && *version_string != '\0') ++ printf (hidden ? "@%s" : "@@%s", version_string); ++ } ++ ++ if (alloc != NULL) ++ free (alloc); ++} ++ ++static inline bfd_boolean ++sym_ok (bfd_boolean want_section, ++ bfd * abfd ATTRIBUTE_UNUSED, ++ long place, ++ asection * sec, ++ struct disassemble_info * inf) ++{ ++ if (want_section) ++ { ++ /* NB: An object file can have different sections with the same ++ section name. Compare compare section pointers if they have ++ the same owner. */ ++ if (sorted_syms[place]->section->owner == sec->owner ++ && sorted_syms[place]->section != sec) ++ return FALSE; ++ ++ /* Note - we cannot just compare section pointers because they could ++ be different, but the same... Ie the symbol that we are trying to ++ find could have come from a separate debug info file. Under such ++ circumstances the symbol will be associated with a section in the ++ debug info file, whilst the section we want is in a normal file. ++ So the section pointers will be different, but the section names ++ will be the same. */ ++ if (strcmp (bfd_section_name (sorted_syms[place]->section), ++ bfd_section_name (sec)) != 0) ++ return FALSE; ++ } ++ ++ return inf->symbol_is_valid (sorted_syms[place], inf); ++} ++ ++/* Locate a symbol given a bfd and a section (from INFO->application_data), ++ and a VMA. If INFO->application_data->require_sec is TRUE, then always ++ require the symbol to be in the section. Returns NULL if there is no ++ suitable symbol. If PLACE is not NULL, then *PLACE is set to the index ++ of the symbol in sorted_syms. */ ++ ++static asymbol * ++find_symbol_for_address (bfd_vma vma, ++ struct disassemble_info *inf, ++ long *place) ++{ ++ /* @@ Would it speed things up to cache the last two symbols returned, ++ and maybe their address ranges? For many processors, only one memory ++ operand can be present at a time, so the 2-entry cache wouldn't be ++ constantly churned by code doing heavy memory accesses. */ ++ ++ /* Indices in `sorted_syms'. */ ++ long min = 0; ++ long max_count = sorted_symcount; ++ long thisplace; ++ struct objdump_disasm_info *aux; ++ bfd *abfd; ++ asection *sec; ++ unsigned int opb; ++ bfd_boolean want_section; ++ long rel_count; ++ ++ if (sorted_symcount < 1) ++ return NULL; ++ ++ aux = (struct objdump_disasm_info *) inf->application_data; ++ abfd = aux->abfd; ++ sec = inf->section; ++ opb = inf->octets_per_byte; ++ ++ /* Perform a binary search looking for the closest symbol to the ++ required value. We are searching the range (min, max_count]. */ ++ while (min + 1 < max_count) ++ { ++ asymbol *sym; ++ ++ thisplace = (max_count + min) / 2; ++ sym = sorted_syms[thisplace]; ++ ++ if (bfd_asymbol_value (sym) > vma) ++ max_count = thisplace; ++ else if (bfd_asymbol_value (sym) < vma) ++ min = thisplace; ++ else ++ { ++ min = thisplace; ++ break; ++ } ++ } ++ ++ /* The symbol we want is now in min, the low end of the range we ++ were searching. If there are several symbols with the same ++ value, we want the first one. */ ++ thisplace = min; ++ while (thisplace > 0 ++ && (bfd_asymbol_value (sorted_syms[thisplace]) ++ == bfd_asymbol_value (sorted_syms[thisplace - 1]))) ++ --thisplace; ++ ++ /* Prefer a symbol in the current section if we have multple symbols ++ with the same value, as can occur with overlays or zero size ++ sections. */ ++ min = thisplace; ++ while (min < max_count ++ && (bfd_asymbol_value (sorted_syms[min]) ++ == bfd_asymbol_value (sorted_syms[thisplace]))) ++ { ++ if (sym_ok (TRUE, abfd, min, sec, inf)) ++ { ++ thisplace = min; ++ ++ if (place != NULL) ++ *place = thisplace; ++ ++ return sorted_syms[thisplace]; ++ } ++ ++min; ++ } ++ ++ /* If the file is relocatable, and the symbol could be from this ++ section, prefer a symbol from this section over symbols from ++ others, even if the other symbol's value might be closer. ++ ++ Note that this may be wrong for some symbol references if the ++ sections have overlapping memory ranges, but in that case there's ++ no way to tell what's desired without looking at the relocation ++ table. ++ ++ Also give the target a chance to reject symbols. */ ++ want_section = (aux->require_sec ++ || ((abfd->flags & HAS_RELOC) != 0 ++ && vma >= bfd_section_vma (sec) ++ && vma < (bfd_section_vma (sec) ++ + bfd_section_size (sec) / opb))); ++ ++ if (! sym_ok (want_section, abfd, thisplace, sec, inf)) ++ { ++ long i; ++ long newplace = sorted_symcount; ++ ++ for (i = min - 1; i >= 0; i--) ++ { ++ if (sym_ok (want_section, abfd, i, sec, inf)) ++ { ++ if (newplace == sorted_symcount) ++ newplace = i; ++ ++ if (bfd_asymbol_value (sorted_syms[i]) ++ != bfd_asymbol_value (sorted_syms[newplace])) ++ break; ++ ++ /* Remember this symbol and keep searching until we reach ++ an earlier address. */ ++ newplace = i; ++ } ++ } ++ ++ if (newplace != sorted_symcount) ++ thisplace = newplace; ++ else ++ { ++ /* We didn't find a good symbol with a smaller value. ++ Look for one with a larger value. */ ++ for (i = thisplace + 1; i < sorted_symcount; i++) ++ { ++ if (sym_ok (want_section, abfd, i, sec, inf)) ++ { ++ thisplace = i; ++ break; ++ } ++ } ++ } ++ ++ if (! sym_ok (want_section, abfd, thisplace, sec, inf)) ++ /* There is no suitable symbol. */ ++ return NULL; ++ } ++ ++ /* If we have not found an exact match for the specified address ++ and we have dynamic relocations available, then we can produce ++ a better result by matching a relocation to the address and ++ using the symbol associated with that relocation. */ ++ rel_count = aux->dynrelcount; ++ if (!want_section ++ && sorted_syms[thisplace]->value != vma ++ && rel_count > 0 ++ && aux->dynrelbuf != NULL ++ && aux->dynrelbuf[0]->address <= vma ++ && aux->dynrelbuf[rel_count - 1]->address >= vma ++ /* If we have matched a synthetic symbol, then stick with that. */ ++ && (sorted_syms[thisplace]->flags & BSF_SYNTHETIC) == 0) ++ { ++ arelent ** rel_low; ++ arelent ** rel_high; ++ ++ rel_low = aux->dynrelbuf; ++ rel_high = rel_low + rel_count - 1; ++ while (rel_low <= rel_high) ++ { ++ arelent **rel_mid = &rel_low[(rel_high - rel_low) / 2]; ++ arelent * rel = *rel_mid; ++ ++ if (rel->address == vma) ++ { ++ /* Absolute relocations do not provide a more helpful ++ symbolic address. Find a non-absolute relocation ++ with the same address. */ ++ arelent **rel_vma = rel_mid; ++ for (rel_mid--; ++ rel_mid >= rel_low && rel_mid[0]->address == vma; ++ rel_mid--) ++ rel_vma = rel_mid; ++ ++ for (; rel_vma <= rel_high && rel_vma[0]->address == vma; ++ rel_vma++) ++ { ++ rel = *rel_vma; ++ if (rel->sym_ptr_ptr != NULL ++ && ! bfd_is_abs_section ((* rel->sym_ptr_ptr)->section)) ++ { ++ if (place != NULL) ++ * place = thisplace; ++ return * rel->sym_ptr_ptr; ++ } ++ } ++ break; ++ } ++ ++ if (vma < rel->address) ++ rel_high = rel_mid; ++ else if (vma >= rel_mid[1]->address) ++ rel_low = rel_mid + 1; ++ else ++ break; ++ } ++ } ++ ++ if (place != NULL) ++ *place = thisplace; ++ ++ return sorted_syms[thisplace]; ++} ++ ++/* Print an address and the offset to the nearest symbol. */ ++ ++static void ++objdump_print_addr_with_sym (bfd *abfd, asection *sec, asymbol *sym, ++ bfd_vma vma, struct disassemble_info *inf, ++ bfd_boolean skip_zeroes) ++{ ++ if (!no_addresses) ++ { ++ objdump_print_value (vma, inf, skip_zeroes); ++ (*inf->fprintf_func) (inf->stream, " "); ++ } ++ ++ if (sym == NULL) ++ { ++ bfd_vma secaddr; ++ ++ (*inf->fprintf_func) (inf->stream, "<%s", ++ sanitize_string (bfd_section_name (sec))); ++ secaddr = bfd_section_vma (sec); ++ if (vma < secaddr) ++ { ++ (*inf->fprintf_func) (inf->stream, "-0x"); ++ objdump_print_value (secaddr - vma, inf, TRUE); ++ } ++ else if (vma > secaddr) ++ { ++ (*inf->fprintf_func) (inf->stream, "+0x"); ++ objdump_print_value (vma - secaddr, inf, TRUE); ++ } ++ (*inf->fprintf_func) (inf->stream, ">"); ++ } ++ else ++ { ++ (*inf->fprintf_func) (inf->stream, "<"); ++ ++ objdump_print_symname (abfd, inf, sym); ++ ++ if (bfd_asymbol_value (sym) == vma) ++ ; ++ /* Undefined symbols in an executables and dynamic objects do not have ++ a value associated with them, so it does not make sense to display ++ an offset relative to them. Normally we would not be provided with ++ this kind of symbol, but the target backend might choose to do so, ++ and the code in find_symbol_for_address might return an as yet ++ unresolved symbol associated with a dynamic reloc. */ ++ else if ((bfd_get_file_flags (abfd) & (EXEC_P | DYNAMIC)) ++ && bfd_is_und_section (sym->section)) ++ ; ++ else if (bfd_asymbol_value (sym) > vma) ++ { ++ (*inf->fprintf_func) (inf->stream, "-0x"); ++ objdump_print_value (bfd_asymbol_value (sym) - vma, inf, TRUE); ++ } ++ else if (vma > bfd_asymbol_value (sym)) ++ { ++ (*inf->fprintf_func) (inf->stream, "+0x"); ++ objdump_print_value (vma - bfd_asymbol_value (sym), inf, TRUE); ++ } ++ ++ (*inf->fprintf_func) (inf->stream, ">"); ++ } ++ ++ if (display_file_offsets) ++ inf->fprintf_func (inf->stream, _(" (File Offset: 0x%lx)"), ++ (long int)(sec->filepos + (vma - sec->vma))); ++} ++ ++/* Print an address (VMA), symbolically if possible. ++ If SKIP_ZEROES is TRUE, don't output leading zeroes. */ ++ ++static void ++objdump_print_addr (bfd_vma vma, ++ struct disassemble_info *inf, ++ bfd_boolean skip_zeroes) ++{ ++ struct objdump_disasm_info *aux; ++ asymbol *sym = NULL; ++ bfd_boolean skip_find = FALSE; ++ ++ aux = (struct objdump_disasm_info *) inf->application_data; ++ ++ if (sorted_symcount < 1) ++ { ++ if (!no_addresses) ++ { ++ (*inf->fprintf_func) (inf->stream, "0x"); ++ objdump_print_value (vma, inf, skip_zeroes); ++ } ++ ++ if (display_file_offsets) ++ inf->fprintf_func (inf->stream, _(" (File Offset: 0x%lx)"), ++ (long int) (inf->section->filepos ++ + (vma - inf->section->vma))); ++ return; ++ } ++ ++ if (aux->reloc != NULL ++ && aux->reloc->sym_ptr_ptr != NULL ++ && * aux->reloc->sym_ptr_ptr != NULL) ++ { ++ sym = * aux->reloc->sym_ptr_ptr; ++ ++ /* Adjust the vma to the reloc. */ ++ vma += bfd_asymbol_value (sym); ++ ++ if (bfd_is_und_section (bfd_asymbol_section (sym))) ++ skip_find = TRUE; ++ } ++ ++ if (!skip_find) ++ sym = find_symbol_for_address (vma, inf, NULL); ++ ++ objdump_print_addr_with_sym (aux->abfd, inf->section, sym, vma, inf, ++ skip_zeroes); ++} ++ ++/* Print VMA to INFO. This function is passed to the disassembler ++ routine. */ ++ ++static void ++objdump_print_address (bfd_vma vma, struct disassemble_info *inf) ++{ ++ objdump_print_addr (vma, inf, ! prefix_addresses); ++} ++ ++/* Determine if the given address has a symbol associated with it. */ ++ ++static int ++objdump_symbol_at_address (bfd_vma vma, struct disassemble_info * inf) ++{ ++ asymbol * sym; ++ ++ sym = find_symbol_for_address (vma, inf, NULL); ++ ++ return (sym != NULL && (bfd_asymbol_value (sym) == vma)); ++} ++ ++/* Hold the last function name and the last line number we displayed ++ in a disassembly. */ ++ ++static char *prev_functionname; ++static unsigned int prev_line; ++static unsigned int prev_discriminator; ++ ++/* We keep a list of all files that we have seen when doing a ++ disassembly with source, so that we know how much of the file to ++ display. This can be important for inlined functions. */ ++ ++struct print_file_list ++{ ++ struct print_file_list *next; ++ const char *filename; ++ const char *modname; ++ const char *map; ++ size_t mapsize; ++ const char **linemap; ++ unsigned maxline; ++ unsigned last_line; ++ unsigned max_printed; ++ int first; ++}; ++ ++static struct print_file_list *print_files; ++ ++/* The number of preceding context lines to show when we start ++ displaying a file for the first time. */ ++ ++#define SHOW_PRECEDING_CONTEXT_LINES (5) ++ ++/* Read a complete file into memory. */ ++ ++static const char * ++slurp_file (const char *fn, size_t *size, struct stat *fst) ++{ ++#ifdef HAVE_MMAP ++ int ps = getpagesize (); ++ size_t msize; ++#endif ++ const char *map; ++ int fd = open (fn, O_RDONLY | O_BINARY); ++ ++ if (fd < 0) ++ return NULL; ++ if (fstat (fd, fst) < 0) ++ { ++ close (fd); ++ return NULL; ++ } ++ *size = fst->st_size; ++#ifdef HAVE_MMAP ++ msize = (*size + ps - 1) & ~(ps - 1); ++ map = mmap (NULL, msize, PROT_READ, MAP_SHARED, fd, 0); ++ if (map != (char *) -1L) ++ { ++ close (fd); ++ return map; ++ } ++#endif ++ map = (const char *) malloc (*size); ++ if (!map || (size_t) read (fd, (char *) map, *size) != *size) ++ { ++ free ((void *) map); ++ map = NULL; ++ } ++ close (fd); ++ return map; ++} ++ ++#define line_map_decrease 5 ++ ++/* Precompute array of lines for a mapped file. */ ++ ++static const char ** ++index_file (const char *map, size_t size, unsigned int *maxline) ++{ ++ const char *p, *lstart, *end; ++ int chars_per_line = 45; /* First iteration will use 40. */ ++ unsigned int lineno; ++ const char **linemap = NULL; ++ unsigned long line_map_size = 0; ++ ++ lineno = 0; ++ lstart = map; ++ end = map + size; ++ ++ for (p = map; p < end; p++) ++ { ++ if (*p == '\n') ++ { ++ if (p + 1 < end && p[1] == '\r') ++ p++; ++ } ++ else if (*p == '\r') ++ { ++ if (p + 1 < end && p[1] == '\n') ++ p++; ++ } ++ else ++ continue; ++ ++ /* End of line found. */ ++ ++ if (linemap == NULL || line_map_size < lineno + 1) ++ { ++ unsigned long newsize; ++ ++ chars_per_line -= line_map_decrease; ++ if (chars_per_line <= 1) ++ chars_per_line = 1; ++ line_map_size = size / chars_per_line + 1; ++ if (line_map_size < lineno + 1) ++ line_map_size = lineno + 1; ++ newsize = line_map_size * sizeof (char *); ++ linemap = (const char **) xrealloc (linemap, newsize); ++ } ++ ++ linemap[lineno++] = lstart; ++ lstart = p + 1; ++ } ++ ++ *maxline = lineno; ++ return linemap; ++} ++ ++/* Tries to open MODNAME, and if successful adds a node to print_files ++ linked list and returns that node. Returns NULL on failure. */ ++ ++static struct print_file_list * ++try_print_file_open (const char *origname, const char *modname, struct stat *fst) ++{ ++ struct print_file_list *p; ++ ++ p = (struct print_file_list *) xmalloc (sizeof (struct print_file_list)); ++ ++ p->map = slurp_file (modname, &p->mapsize, fst); ++ if (p->map == NULL) ++ { ++ free (p); ++ return NULL; ++ } ++ ++ p->linemap = index_file (p->map, p->mapsize, &p->maxline); ++ p->last_line = 0; ++ p->max_printed = 0; ++ p->filename = origname; ++ p->modname = modname; ++ p->next = print_files; ++ p->first = 1; ++ print_files = p; ++ return p; ++} ++ ++/* If the source file, as described in the symtab, is not found ++ try to locate it in one of the paths specified with -I ++ If found, add location to print_files linked list. */ ++ ++static struct print_file_list * ++update_source_path (const char *filename, bfd *abfd) ++{ ++ struct print_file_list *p; ++ const char *fname; ++ struct stat fst; ++ int i; ++ ++ p = try_print_file_open (filename, filename, &fst); ++ if (p == NULL) ++ { ++ if (include_path_count == 0) ++ return NULL; ++ ++ /* Get the name of the file. */ ++ fname = lbasename (filename); ++ ++ /* If file exists under a new path, we need to add it to the list ++ so that show_line knows about it. */ ++ for (i = 0; i < include_path_count; i++) ++ { ++ char *modname = concat (include_paths[i], "/", fname, ++ (const char *) 0); ++ ++ p = try_print_file_open (filename, modname, &fst); ++ if (p) ++ break; ++ ++ free (modname); ++ } ++ } ++ ++ if (p != NULL) ++ { ++ long mtime = bfd_get_mtime (abfd); ++ ++ if (fst.st_mtime > mtime) ++ warn (_("source file %s is more recent than object file\n"), ++ filename); ++ } ++ ++ return p; ++} ++ ++/* Print a source file line. */ ++ ++static void ++print_line (struct print_file_list *p, unsigned int linenum) ++{ ++ const char *l; ++ size_t len; ++ ++ --linenum; ++ if (linenum >= p->maxline) ++ return; ++ l = p->linemap [linenum]; ++ if (source_comment != NULL && strlen (l) > 0) ++ printf ("%s", source_comment); ++ len = strcspn (l, "\n\r"); ++ /* Test fwrite return value to quiet glibc warning. */ ++ if (len == 0 || fwrite (l, len, 1, stdout) == 1) ++ putchar ('\n'); ++} ++ ++/* Print a range of source code lines. */ ++ ++static void ++dump_lines (struct print_file_list *p, unsigned int start, unsigned int end) ++{ ++ if (p->map == NULL) ++ return; ++ while (start <= end) ++ { ++ print_line (p, start); ++ start++; ++ } ++} ++ ++/* Show the line number, or the source line, in a disassembly ++ listing. */ ++ ++static void ++show_line (bfd *abfd, asection *section, bfd_vma addr_offset) ++{ ++ const char *filename; ++ const char *functionname; ++ unsigned int linenumber; ++ unsigned int discriminator; ++ bfd_boolean reloc; ++ char *path = NULL; ++ ++ if (! with_line_numbers && ! with_source_code) ++ return; ++ ++ if (! bfd_find_nearest_line_discriminator (abfd, section, syms, addr_offset, ++ &filename, &functionname, ++ &linenumber, &discriminator)) ++ return; ++ ++ if (filename != NULL && *filename == '\0') ++ filename = NULL; ++ if (functionname != NULL && *functionname == '\0') ++ functionname = NULL; ++ ++ if (filename ++ && IS_ABSOLUTE_PATH (filename) ++ && prefix) ++ { ++ char *path_up; ++ const char *fname = filename; ++ ++ path = xmalloc (prefix_length + PATH_MAX + 1); ++ ++ if (prefix_length) ++ memcpy (path, prefix, prefix_length); ++ path_up = path + prefix_length; ++ ++ /* Build relocated filename, stripping off leading directories ++ from the initial filename if requested. */ ++ if (prefix_strip > 0) ++ { ++ int level = 0; ++ const char *s; ++ ++ /* Skip selected directory levels. */ ++ for (s = fname + 1; *s != '\0' && level < prefix_strip; s++) ++ if (IS_DIR_SEPARATOR (*s)) ++ { ++ fname = s; ++ level++; ++ } ++ } ++ ++ /* Update complete filename. */ ++ strncpy (path_up, fname, PATH_MAX); ++ path_up[PATH_MAX] = '\0'; ++ ++ filename = path; ++ reloc = TRUE; ++ } ++ else ++ reloc = FALSE; ++ ++ if (with_line_numbers) ++ { ++ if (functionname != NULL ++ && (prev_functionname == NULL ++ || strcmp (functionname, prev_functionname) != 0)) ++ { ++ char *demangle_alloc = NULL; ++ if (do_demangle && functionname[0] != '\0') ++ { ++ /* Demangle the name. */ ++ demangle_alloc = bfd_demangle (abfd, functionname, ++ demangle_flags); ++ } ++ ++ /* Demangling adds trailing parens, so don't print those. */ ++ if (demangle_alloc != NULL) ++ printf ("%s:\n", sanitize_string (demangle_alloc)); ++ else ++ printf ("%s():\n", sanitize_string (functionname)); ++ ++ prev_line = -1; ++ free (demangle_alloc); ++ } ++ if (linenumber > 0 ++ && (linenumber != prev_line ++ || discriminator != prev_discriminator)) ++ { ++ if (discriminator > 0) ++ printf ("%s:%u (discriminator %u)\n", ++ filename == NULL ? "???" : sanitize_string (filename), ++ linenumber, discriminator); ++ else ++ printf ("%s:%u\n", filename == NULL ++ ? "???" : sanitize_string (filename), ++ linenumber); ++ } ++ if (unwind_inlines) ++ { ++ const char *filename2; ++ const char *functionname2; ++ unsigned line2; ++ ++ while (bfd_find_inliner_info (abfd, &filename2, &functionname2, ++ &line2)) ++ { ++ printf ("inlined by %s:%u", ++ sanitize_string (filename2), line2); ++ printf (" (%s)\n", sanitize_string (functionname2)); ++ } ++ } ++ } ++ ++ if (with_source_code ++ && filename != NULL ++ && linenumber > 0) ++ { ++ struct print_file_list **pp, *p; ++ unsigned l; ++ ++ for (pp = &print_files; *pp != NULL; pp = &(*pp)->next) ++ if (filename_cmp ((*pp)->filename, filename) == 0) ++ break; ++ p = *pp; ++ ++ if (p == NULL) ++ { ++ if (reloc) ++ filename = xstrdup (filename); ++ p = update_source_path (filename, abfd); ++ } ++ ++ if (p != NULL && linenumber != p->last_line) ++ { ++ if (file_start_context && p->first) ++ l = 1; ++ else ++ { ++ l = linenumber - SHOW_PRECEDING_CONTEXT_LINES; ++ if (l >= linenumber) ++ l = 1; ++ if (p->max_printed >= l) ++ { ++ if (p->max_printed < linenumber) ++ l = p->max_printed + 1; ++ else ++ l = linenumber; ++ } ++ } ++ dump_lines (p, l, linenumber); ++ if (p->max_printed < linenumber) ++ p->max_printed = linenumber; ++ p->last_line = linenumber; ++ p->first = 0; ++ } ++ } ++ ++ if (functionname != NULL ++ && (prev_functionname == NULL ++ || strcmp (functionname, prev_functionname) != 0)) ++ { ++ if (prev_functionname != NULL) ++ free (prev_functionname); ++ prev_functionname = (char *) xmalloc (strlen (functionname) + 1); ++ strcpy (prev_functionname, functionname); ++ } ++ ++ if (linenumber > 0 && linenumber != prev_line) ++ prev_line = linenumber; ++ ++ if (discriminator != prev_discriminator) ++ prev_discriminator = discriminator; ++ ++ if (path) ++ free (path); ++} ++ ++/* Pseudo FILE object for strings. */ ++typedef struct ++{ ++ char *buffer; ++ size_t pos; ++ size_t alloc; ++} SFILE; ++ ++/* sprintf to a "stream". */ ++ ++static int ATTRIBUTE_PRINTF_2 ++objdump_sprintf (SFILE *f, const char *format, ...) ++{ ++ size_t n; ++ va_list args; ++ ++ while (1) ++ { ++ size_t space = f->alloc - f->pos; ++ ++ va_start (args, format); ++ n = vsnprintf (f->buffer + f->pos, space, format, args); ++ va_end (args); ++ ++ if (space > n) ++ break; ++ ++ f->alloc = (f->alloc + n) * 2; ++ f->buffer = (char *) xrealloc (f->buffer, f->alloc); ++ } ++ f->pos += n; ++ ++ return n; ++} ++ ++/* Code for generating (colored) diagrams of control flow start and end ++ points. */ ++ ++/* Structure used to store the properties of a jump. */ ++ ++struct jump_info ++{ ++ /* The next jump, or NULL if this is the last object. */ ++ struct jump_info *next; ++ /* The previous jump, or NULL if this is the first object. */ ++ struct jump_info *prev; ++ /* The start addresses of the jump. */ ++ struct ++ { ++ /* The list of start addresses. */ ++ bfd_vma *addresses; ++ /* The number of elements. */ ++ size_t count; ++ /* The maximum number of elements that fit into the array. */ ++ size_t max_count; ++ } start; ++ /* The end address of the jump. */ ++ bfd_vma end; ++ /* The drawing level of the jump. */ ++ int level; ++}; ++ ++/* Construct a jump object for a jump from start ++ to end with the corresponding level. */ ++ ++static struct jump_info * ++jump_info_new (bfd_vma start, bfd_vma end, int level) ++{ ++ struct jump_info *result = xmalloc (sizeof (struct jump_info)); ++ ++ result->next = NULL; ++ result->prev = NULL; ++ result->start.addresses = xmalloc (sizeof (bfd_vma *) * 2); ++ result->start.addresses[0] = start; ++ result->start.count = 1; ++ result->start.max_count = 2; ++ result->end = end; ++ result->level = level; ++ ++ return result; ++} ++ ++/* Free a jump object and return the next object ++ or NULL if this was the last one. */ ++ ++static struct jump_info * ++jump_info_free (struct jump_info *ji) ++{ ++ struct jump_info *result = NULL; ++ ++ if (ji) ++ { ++ result = ji->next; ++ if (ji->start.addresses) ++ free (ji->start.addresses); ++ free (ji); ++ } ++ ++ return result; ++} ++ ++/* Get the smallest value of all start and end addresses. */ ++ ++static bfd_vma ++jump_info_min_address (const struct jump_info *ji) ++{ ++ bfd_vma min_address = ji->end; ++ size_t i; ++ ++ for (i = ji->start.count; i-- > 0;) ++ if (ji->start.addresses[i] < min_address) ++ min_address = ji->start.addresses[i]; ++ return min_address; ++} ++ ++/* Get the largest value of all start and end addresses. */ ++ ++static bfd_vma ++jump_info_max_address (const struct jump_info *ji) ++{ ++ bfd_vma max_address = ji->end; ++ size_t i; ++ ++ for (i = ji->start.count; i-- > 0;) ++ if (ji->start.addresses[i] > max_address) ++ max_address = ji->start.addresses[i]; ++ return max_address; ++} ++ ++/* Get the target address of a jump. */ ++ ++static bfd_vma ++jump_info_end_address (const struct jump_info *ji) ++{ ++ return ji->end; ++} ++ ++/* Test if an address is one of the start addresses of a jump. */ ++ ++static bfd_boolean ++jump_info_is_start_address (const struct jump_info *ji, bfd_vma address) ++{ ++ bfd_boolean result = FALSE; ++ size_t i; ++ ++ for (i = ji->start.count; i-- > 0;) ++ if (address == ji->start.addresses[i]) ++ { ++ result = TRUE; ++ break; ++ } ++ ++ return result; ++} ++ ++/* Test if an address is the target address of a jump. */ ++ ++static bfd_boolean ++jump_info_is_end_address (const struct jump_info *ji, bfd_vma address) ++{ ++ return (address == ji->end); ++} ++ ++/* Get the difference between the smallest and largest address of a jump. */ ++ ++static bfd_vma ++jump_info_size (const struct jump_info *ji) ++{ ++ return jump_info_max_address (ji) - jump_info_min_address (ji); ++} ++ ++/* Unlink a jump object from a list. */ ++ ++static void ++jump_info_unlink (struct jump_info *node, ++ struct jump_info **base) ++{ ++ if (node->next) ++ node->next->prev = node->prev; ++ if (node->prev) ++ node->prev->next = node->next; ++ else ++ *base = node->next; ++ node->next = NULL; ++ node->prev = NULL; ++} ++ ++/* Insert unlinked jump info node into a list. */ ++ ++static void ++jump_info_insert (struct jump_info *node, ++ struct jump_info *target, ++ struct jump_info **base) ++{ ++ node->next = target; ++ node->prev = target->prev; ++ target->prev = node; ++ if (node->prev) ++ node->prev->next = node; ++ else ++ *base = node; ++} ++ ++/* Add unlinked node to the front of a list. */ ++ ++static void ++jump_info_add_front (struct jump_info *node, ++ struct jump_info **base) ++{ ++ node->next = *base; ++ if (node->next) ++ node->next->prev = node; ++ node->prev = NULL; ++ *base = node; ++} ++ ++/* Move linked node to target position. */ ++ ++static void ++jump_info_move_linked (struct jump_info *node, ++ struct jump_info *target, ++ struct jump_info **base) ++{ ++ /* Unlink node. */ ++ jump_info_unlink (node, base); ++ /* Insert node at target position. */ ++ jump_info_insert (node, target, base); ++} ++ ++/* Test if two jumps intersect. */ ++ ++static bfd_boolean ++jump_info_intersect (const struct jump_info *a, ++ const struct jump_info *b) ++{ ++ return ((jump_info_max_address (a) >= jump_info_min_address (b)) ++ && (jump_info_min_address (a) <= jump_info_max_address (b))); ++} ++ ++/* Merge two compatible jump info objects. */ ++ ++static void ++jump_info_merge (struct jump_info **base) ++{ ++ struct jump_info *a; ++ ++ for (a = *base; a; a = a->next) ++ { ++ struct jump_info *b; ++ ++ for (b = a->next; b; b = b->next) ++ { ++ /* Merge both jumps into one. */ ++ if (a->end == b->end) ++ { ++ /* Reallocate addresses. */ ++ size_t needed_size = a->start.count + b->start.count; ++ size_t i; ++ ++ if (needed_size > a->start.max_count) ++ { ++ a->start.max_count += b->start.max_count; ++ a->start.addresses = ++ xrealloc (a->start.addresses, ++ a->start.max_count * sizeof (bfd_vma *)); ++ } ++ ++ /* Append start addresses. */ ++ for (i = 0; i < b->start.count; ++i) ++ a->start.addresses[a->start.count++] = ++ b->start.addresses[i]; ++ ++ /* Remove and delete jump. */ ++ struct jump_info *tmp = b->prev; ++ jump_info_unlink (b, base); ++ jump_info_free (b); ++ b = tmp; ++ } ++ } ++ } ++} ++ ++/* Sort jumps by their size and starting point using a stable ++ minsort. This could be improved if sorting performance is ++ an issue, for example by using mergesort. */ ++ ++static void ++jump_info_sort (struct jump_info **base) ++{ ++ struct jump_info *current_element = *base; ++ ++ while (current_element) ++ { ++ struct jump_info *best_match = current_element; ++ struct jump_info *runner = current_element->next; ++ bfd_vma best_size = jump_info_size (best_match); ++ ++ while (runner) ++ { ++ bfd_vma runner_size = jump_info_size (runner); ++ ++ if ((runner_size < best_size) ++ || ((runner_size == best_size) ++ && (jump_info_min_address (runner) ++ < jump_info_min_address (best_match)))) ++ { ++ best_match = runner; ++ best_size = runner_size; ++ } ++ ++ runner = runner->next; ++ } ++ ++ if (best_match == current_element) ++ current_element = current_element->next; ++ else ++ jump_info_move_linked (best_match, current_element, base); ++ } ++} ++ ++/* Visualize all jumps at a given address. */ ++ ++static void ++jump_info_visualize_address (bfd_vma address, ++ int max_level, ++ char *line_buffer, ++ uint8_t *color_buffer) ++{ ++ struct jump_info *ji = detected_jumps; ++ size_t len = (max_level + 1) * 3; ++ ++ /* Clear line buffer. */ ++ memset (line_buffer, ' ', len); ++ memset (color_buffer, 0, len); ++ ++ /* Iterate over jumps and add their ASCII art. */ ++ while (ji) ++ { ++ /* Discard jumps that are never needed again. */ ++ if (jump_info_max_address (ji) < address) ++ { ++ struct jump_info *tmp = ji; ++ ++ ji = ji->next; ++ jump_info_unlink (tmp, &detected_jumps); ++ jump_info_free (tmp); ++ continue; ++ } ++ ++ /* This jump intersects with the current address. */ ++ if (jump_info_min_address (ji) <= address) ++ { ++ /* Hash target address to get an even ++ distribution between all values. */ ++ bfd_vma hash_address = jump_info_end_address (ji); ++ uint8_t color = iterative_hash_object (hash_address, 0); ++ /* Fetch line offset. */ ++ int offset = (max_level - ji->level) * 3; ++ ++ /* Draw start line. */ ++ if (jump_info_is_start_address (ji, address)) ++ { ++ size_t i = offset + 1; ++ ++ for (; i < len - 1; ++i) ++ if (line_buffer[i] == ' ') ++ { ++ line_buffer[i] = '-'; ++ color_buffer[i] = color; ++ } ++ ++ if (line_buffer[i] == ' ') ++ { ++ line_buffer[i] = '-'; ++ color_buffer[i] = color; ++ } ++ else if (line_buffer[i] == '>') ++ { ++ line_buffer[i] = 'X'; ++ color_buffer[i] = color; ++ } ++ ++ if (line_buffer[offset] == ' ') ++ { ++ if (address <= ji->end) ++ line_buffer[offset] = ++ (jump_info_min_address (ji) == address) ? '/': '+'; ++ else ++ line_buffer[offset] = ++ (jump_info_max_address (ji) == address) ? '\\': '+'; ++ color_buffer[offset] = color; ++ } ++ } ++ /* Draw jump target. */ ++ else if (jump_info_is_end_address (ji, address)) ++ { ++ size_t i = offset + 1; ++ ++ for (; i < len - 1; ++i) ++ if (line_buffer[i] == ' ') ++ { ++ line_buffer[i] = '-'; ++ color_buffer[i] = color; ++ } ++ ++ if (line_buffer[i] == ' ') ++ { ++ line_buffer[i] = '>'; ++ color_buffer[i] = color; ++ } ++ else if (line_buffer[i] == '-') ++ { ++ line_buffer[i] = 'X'; ++ color_buffer[i] = color; ++ } ++ ++ if (line_buffer[offset] == ' ') ++ { ++ if (jump_info_min_address (ji) < address) ++ line_buffer[offset] = ++ (jump_info_max_address (ji) > address) ? '>' : '\\'; ++ else ++ line_buffer[offset] = '/'; ++ color_buffer[offset] = color; ++ } ++ } ++ /* Draw intermediate line segment. */ ++ else if (line_buffer[offset] == ' ') ++ { ++ line_buffer[offset] = '|'; ++ color_buffer[offset] = color; ++ } ++ } ++ ++ ji = ji->next; ++ } ++} ++ ++/* Clone of disassemble_bytes to detect jumps inside a function. */ ++/* FIXME: is this correct? Can we strip it down even further? */ ++ ++static struct jump_info * ++disassemble_jumps (struct disassemble_info * inf, ++ disassembler_ftype disassemble_fn, ++ bfd_vma start_offset, ++ bfd_vma stop_offset, ++ bfd_vma rel_offset, ++ arelent *** relppp, ++ arelent ** relppend) ++{ ++ struct objdump_disasm_info *aux; ++ struct jump_info *jumps = NULL; ++ asection *section; ++ bfd_vma addr_offset; ++ unsigned int opb = inf->octets_per_byte; ++ int octets = opb; ++ SFILE sfile; ++ ++ aux = (struct objdump_disasm_info *) inf->application_data; ++ section = inf->section; ++ ++ sfile.alloc = 120; ++ sfile.buffer = (char *) xmalloc (sfile.alloc); ++ sfile.pos = 0; ++ ++ inf->insn_info_valid = 0; ++ inf->fprintf_func = (fprintf_ftype) objdump_sprintf; ++ inf->stream = &sfile; ++ ++ addr_offset = start_offset; ++ while (addr_offset < stop_offset) ++ { ++ int previous_octets; ++ ++ /* Remember the length of the previous instruction. */ ++ previous_octets = octets; ++ octets = 0; ++ ++ sfile.pos = 0; ++ inf->bytes_per_line = 0; ++ inf->bytes_per_chunk = 0; ++ inf->flags = ((disassemble_all ? DISASSEMBLE_DATA : 0) ++ | (wide_output ? WIDE_OUTPUT : 0)); ++ if (machine) ++ inf->flags |= USER_SPECIFIED_MACHINE_TYPE; ++ ++ if (inf->disassembler_needs_relocs ++ && (bfd_get_file_flags (aux->abfd) & EXEC_P) == 0 ++ && (bfd_get_file_flags (aux->abfd) & DYNAMIC) == 0 ++ && *relppp < relppend) ++ { ++ bfd_signed_vma distance_to_rel; ++ ++ distance_to_rel = (**relppp)->address - (rel_offset + addr_offset); ++ ++ /* Check to see if the current reloc is associated with ++ the instruction that we are about to disassemble. */ ++ if (distance_to_rel == 0 ++ /* FIXME: This is wrong. We are trying to catch ++ relocs that are addressed part way through the ++ current instruction, as might happen with a packed ++ VLIW instruction. Unfortunately we do not know the ++ length of the current instruction since we have not ++ disassembled it yet. Instead we take a guess based ++ upon the length of the previous instruction. The ++ proper solution is to have a new target-specific ++ disassembler function which just returns the length ++ of an instruction at a given address without trying ++ to display its disassembly. */ ++ || (distance_to_rel > 0 ++ && distance_to_rel < (bfd_signed_vma) (previous_octets/ opb))) ++ { ++ inf->flags |= INSN_HAS_RELOC; ++ } ++ } ++ ++ if (! disassemble_all ++ && (section->flags & (SEC_CODE | SEC_HAS_CONTENTS)) ++ == (SEC_CODE | SEC_HAS_CONTENTS)) ++ /* Set a stop_vma so that the disassembler will not read ++ beyond the next symbol. We assume that symbols appear on ++ the boundaries between instructions. We only do this when ++ disassembling code of course, and when -D is in effect. */ ++ inf->stop_vma = section->vma + stop_offset; ++ ++ inf->stop_offset = stop_offset; ++ ++ /* Extract jump information. */ ++ inf->insn_info_valid = 0; ++ octets = (*disassemble_fn) (section->vma + addr_offset, inf); ++ /* Test if a jump was detected. */ ++ if (inf->insn_info_valid ++ && ((inf->insn_type == dis_branch) ++ || (inf->insn_type == dis_condbranch) ++ || (inf->insn_type == dis_jsr) ++ || (inf->insn_type == dis_condjsr)) ++ && (inf->target >= section->vma + start_offset) ++ && (inf->target < section->vma + stop_offset)) ++ { ++ struct jump_info *ji = ++ jump_info_new (section->vma + addr_offset, inf->target, -1); ++ jump_info_add_front (ji, &jumps); ++ } ++ ++ inf->stop_vma = 0; ++ ++ addr_offset += octets / opb; ++ } ++ ++ inf->fprintf_func = (fprintf_ftype) fprintf; ++ inf->stream = stdout; ++ ++ free (sfile.buffer); ++ ++ /* Merge jumps. */ ++ jump_info_merge (&jumps); ++ /* Process jumps. */ ++ jump_info_sort (&jumps); ++ ++ /* Group jumps by level. */ ++ struct jump_info *last_jump = jumps; ++ int max_level = -1; ++ ++ while (last_jump) ++ { ++ /* The last jump is part of the next group. */ ++ struct jump_info *base = last_jump; ++ /* Increment level. */ ++ base->level = ++max_level; ++ ++ /* Find jumps that can be combined on the same ++ level, with the largest jumps tested first. ++ This has the advantage that large jumps are on ++ lower levels and do not intersect with small ++ jumps that get grouped on higher levels. */ ++ struct jump_info *exchange_item = last_jump->next; ++ struct jump_info *it = exchange_item; ++ ++ for (; it; it = it->next) ++ { ++ /* Test if the jump intersects with any ++ jump from current group. */ ++ bfd_boolean ok = TRUE; ++ struct jump_info *it_collision; ++ ++ for (it_collision = base; ++ it_collision != exchange_item; ++ it_collision = it_collision->next) ++ { ++ /* This jump intersects so we leave it out. */ ++ if (jump_info_intersect (it_collision, it)) ++ { ++ ok = FALSE; ++ break; ++ } ++ } ++ ++ /* Add jump to group. */ ++ if (ok) ++ { ++ /* Move current element to the front. */ ++ if (it != exchange_item) ++ { ++ struct jump_info *save = it->prev; ++ jump_info_move_linked (it, exchange_item, &jumps); ++ last_jump = it; ++ it = save; ++ } ++ else ++ { ++ last_jump = exchange_item; ++ exchange_item = exchange_item->next; ++ } ++ last_jump->level = max_level; ++ } ++ } ++ ++ /* Move to next group. */ ++ last_jump = exchange_item; ++ } ++ ++ return jumps; ++} ++ ++/* The number of zeroes we want to see before we start skipping them. ++ The number is arbitrarily chosen. */ ++ ++#define DEFAULT_SKIP_ZEROES 8 ++ ++/* The number of zeroes to skip at the end of a section. If the ++ number of zeroes at the end is between SKIP_ZEROES_AT_END and ++ SKIP_ZEROES, they will be disassembled. If there are fewer than ++ SKIP_ZEROES_AT_END, they will be skipped. This is a heuristic ++ attempt to avoid disassembling zeroes inserted by section ++ alignment. */ ++ ++#define DEFAULT_SKIP_ZEROES_AT_END 3 ++ ++static int ++null_print (const void * stream ATTRIBUTE_UNUSED, const char * format ATTRIBUTE_UNUSED, ...) ++{ ++ return 1; ++} ++ ++/* Print out jump visualization. */ ++ ++static void ++print_jump_visualisation (bfd_vma addr, int max_level, char *line_buffer, ++ uint8_t *color_buffer) ++{ ++ if (!line_buffer) ++ return; ++ ++ jump_info_visualize_address (addr, max_level, line_buffer, color_buffer); ++ ++ size_t line_buffer_size = strlen (line_buffer); ++ char last_color = 0; ++ size_t i; ++ ++ for (i = 0; i <= line_buffer_size; ++i) ++ { ++ if (color_output) ++ { ++ uint8_t color = (i < line_buffer_size) ? color_buffer[i]: 0; ++ ++ if (color != last_color) ++ { ++ if (color) ++ if (extended_color_output) ++ /* Use extended 8bit color, but ++ do not choose dark colors. */ ++ printf ("\033[38;5;%dm", 124 + (color % 108)); ++ else ++ /* Use simple terminal colors. */ ++ printf ("\033[%dm", 31 + (color % 7)); ++ else ++ /* Clear color. */ ++ printf ("\033[0m"); ++ last_color = color; ++ } ++ } ++ putchar ((i < line_buffer_size) ? line_buffer[i]: ' '); ++ } ++} ++ ++/* Disassemble some data in memory between given values. */ ++ ++static void ++disassemble_bytes (struct disassemble_info * inf, ++ disassembler_ftype disassemble_fn, ++ bfd_boolean insns, ++ bfd_byte * data, ++ bfd_vma start_offset, ++ bfd_vma stop_offset, ++ bfd_vma rel_offset, ++ arelent *** relppp, ++ arelent ** relppend) ++{ ++ struct objdump_disasm_info *aux; ++ asection *section; ++ unsigned int octets_per_line; ++ unsigned int skip_addr_chars; ++ bfd_vma addr_offset; ++ unsigned int opb = inf->octets_per_byte; ++ unsigned int skip_zeroes = inf->skip_zeroes; ++ unsigned int skip_zeroes_at_end = inf->skip_zeroes_at_end; ++ size_t octets; ++ SFILE sfile; ++ ++ aux = (struct objdump_disasm_info *) inf->application_data; ++ section = inf->section; ++ ++ sfile.alloc = 120; ++ sfile.buffer = (char *) xmalloc (sfile.alloc); ++ sfile.pos = 0; ++ ++ if (insn_width) ++ octets_per_line = insn_width; ++ else if (insns) ++ octets_per_line = 4; ++ else ++ octets_per_line = 16; ++ ++ /* Figure out how many characters to skip at the start of an ++ address, to make the disassembly look nicer. We discard leading ++ zeroes in chunks of 4, ensuring that there is always a leading ++ zero remaining. */ ++ skip_addr_chars = 0; ++ if (!no_addresses && !prefix_addresses) ++ { ++ char buf[30]; ++ ++ bfd_sprintf_vma (aux->abfd, buf, section->vma + section->size / opb); ++ ++ while (buf[skip_addr_chars] == '0') ++ ++skip_addr_chars; ++ ++ /* Don't discard zeros on overflow. */ ++ if (buf[skip_addr_chars] == '\0' && section->vma != 0) ++ skip_addr_chars = 0; ++ ++ if (skip_addr_chars != 0) ++ skip_addr_chars = (skip_addr_chars - 1) & -4; ++ } ++ ++ inf->insn_info_valid = 0; ++ ++ /* Determine maximum level. */ ++ uint8_t *color_buffer = NULL; ++ char *line_buffer = NULL; ++ int max_level = -1; ++ ++ /* Some jumps were detected. */ ++ if (detected_jumps) ++ { ++ struct jump_info *ji; ++ ++ /* Find maximum jump level. */ ++ for (ji = detected_jumps; ji; ji = ji->next) ++ { ++ if (ji->level > max_level) ++ max_level = ji->level; ++ } ++ ++ /* Allocate buffers. */ ++ size_t len = (max_level + 1) * 3 + 1; ++ line_buffer = xmalloc (len); ++ line_buffer[len - 1] = 0; ++ color_buffer = xmalloc (len); ++ color_buffer[len - 1] = 0; ++ } ++ ++ addr_offset = start_offset; ++ while (addr_offset < stop_offset) ++ { ++ bfd_boolean need_nl = FALSE; ++ ++ octets = 0; ++ ++ /* Make sure we don't use relocs from previous instructions. */ ++ aux->reloc = NULL; ++ ++ /* If we see more than SKIP_ZEROES octets of zeroes, we just ++ print `...'. */ ++ if (! disassemble_zeroes) ++ for (; addr_offset * opb + octets < stop_offset * opb; octets++) ++ if (data[addr_offset * opb + octets] != 0) ++ break; ++ if (! disassemble_zeroes ++ && (inf->insn_info_valid == 0 ++ || inf->branch_delay_insns == 0) ++ && (octets >= skip_zeroes ++ || (addr_offset * opb + octets == stop_offset * opb ++ && octets < skip_zeroes_at_end))) ++ { ++ /* If there are more nonzero octets to follow, we only skip ++ zeroes in multiples of 4, to try to avoid running over ++ the start of an instruction which happens to start with ++ zero. */ ++ if (addr_offset * opb + octets != stop_offset * opb) ++ octets &= ~3; ++ ++ /* If we are going to display more data, and we are displaying ++ file offsets, then tell the user how many zeroes we skip ++ and the file offset from where we resume dumping. */ ++ if (display_file_offsets ++ && addr_offset + octets / opb < stop_offset) ++ printf (_("\t... (skipping %lu zeroes, " ++ "resuming at file offset: 0x%lx)\n"), ++ (unsigned long) (octets / opb), ++ (unsigned long) (section->filepos ++ + addr_offset + octets / opb)); ++ else ++ printf ("\t...\n"); ++ } ++ else ++ { ++ char buf[50]; ++ unsigned int bpc = 0; ++ unsigned int pb = 0; ++ ++ if (with_line_numbers || with_source_code) ++ show_line (aux->abfd, section, addr_offset); ++ ++ if (no_addresses) ++ printf ("\t"); ++ else if (!prefix_addresses) ++ { ++ char *s; ++ ++ bfd_sprintf_vma (aux->abfd, buf, section->vma + addr_offset); ++ for (s = buf + skip_addr_chars; *s == '0'; s++) ++ *s = ' '; ++ if (*s == '\0') ++ *--s = '0'; ++ printf ("%s:\t", buf + skip_addr_chars); ++ } ++ else ++ { ++ aux->require_sec = TRUE; ++ objdump_print_address (section->vma + addr_offset, inf); ++ aux->require_sec = FALSE; ++ putchar (' '); ++ } ++ ++ print_jump_visualisation (section->vma + addr_offset, ++ max_level, line_buffer, ++ color_buffer); ++ ++ if (insns) ++ { ++ int insn_size; ++ ++ sfile.pos = 0; ++ inf->fprintf_func = (fprintf_ftype) objdump_sprintf; ++ inf->stream = &sfile; ++ inf->bytes_per_line = 0; ++ inf->bytes_per_chunk = 0; ++ inf->flags = ((disassemble_all ? DISASSEMBLE_DATA : 0) ++ | (wide_output ? WIDE_OUTPUT : 0)); ++ if (machine) ++ inf->flags |= USER_SPECIFIED_MACHINE_TYPE; ++ ++ if (inf->disassembler_needs_relocs ++ && (bfd_get_file_flags (aux->abfd) & EXEC_P) == 0 ++ && (bfd_get_file_flags (aux->abfd) & DYNAMIC) == 0 ++ && *relppp < relppend) ++ { ++ bfd_signed_vma distance_to_rel; ++ int max_reloc_offset ++ = aux->abfd->arch_info->max_reloc_offset_into_insn; ++ ++ distance_to_rel = ((**relppp)->address - rel_offset ++ - addr_offset); ++ ++ insn_size = 0; ++ if (distance_to_rel > 0 ++ && (max_reloc_offset < 0 ++ || distance_to_rel <= max_reloc_offset)) ++ { ++ /* This reloc *might* apply to the current insn, ++ starting somewhere inside it. Discover the length ++ of the current insn so that the check below will ++ work. */ ++ if (insn_width) ++ insn_size = insn_width; ++ else ++ { ++ /* We find the length by calling the dissassembler ++ function with a dummy print handler. This should ++ work unless the disassembler is not expecting to ++ be called multiple times for the same address. ++ ++ This does mean disassembling the instruction ++ twice, but we only do this when there is a high ++ probability that there is a reloc that will ++ affect the instruction. */ ++ inf->fprintf_func = (fprintf_ftype) null_print; ++ insn_size = disassemble_fn (section->vma ++ + addr_offset, inf); ++ inf->fprintf_func = (fprintf_ftype) objdump_sprintf; ++ } ++ } ++ ++ /* Check to see if the current reloc is associated with ++ the instruction that we are about to disassemble. */ ++ if (distance_to_rel == 0 ++ || (distance_to_rel > 0 ++ && distance_to_rel < insn_size / (int) opb)) ++ { ++ inf->flags |= INSN_HAS_RELOC; ++ aux->reloc = **relppp; ++ } ++ } ++ ++ if (! disassemble_all ++ && ((section->flags & (SEC_CODE | SEC_HAS_CONTENTS)) ++ == (SEC_CODE | SEC_HAS_CONTENTS))) ++ /* Set a stop_vma so that the disassembler will not read ++ beyond the next symbol. We assume that symbols appear on ++ the boundaries between instructions. We only do this when ++ disassembling code of course, and when -D is in effect. */ ++ inf->stop_vma = section->vma + stop_offset; ++ ++ inf->stop_offset = stop_offset; ++ insn_size = (*disassemble_fn) (section->vma + addr_offset, inf); ++ octets = insn_size; ++ ++ inf->stop_vma = 0; ++ inf->fprintf_func = (fprintf_ftype) fprintf; ++ inf->stream = stdout; ++ if (insn_width == 0 && inf->bytes_per_line != 0) ++ octets_per_line = inf->bytes_per_line; ++ if (insn_size < (int) opb) ++ { ++ if (sfile.pos) ++ printf ("%s\n", sfile.buffer); ++ if (insn_size >= 0) ++ { ++ non_fatal (_("disassemble_fn returned length %d"), ++ insn_size); ++ exit_status = 1; ++ } ++ break; ++ } ++ } ++ else ++ { ++ bfd_vma j; ++ ++ octets = octets_per_line; ++ if (addr_offset + octets / opb > stop_offset) ++ octets = (stop_offset - addr_offset) * opb; ++ ++ for (j = addr_offset * opb; j < addr_offset * opb + octets; ++j) ++ { ++ if (ISPRINT (data[j])) ++ buf[j - addr_offset * opb] = data[j]; ++ else ++ buf[j - addr_offset * opb] = '.'; ++ } ++ buf[j - addr_offset * opb] = '\0'; ++ } ++ ++ if (prefix_addresses ++ ? show_raw_insn > 0 ++ : show_raw_insn >= 0) ++ { ++ bfd_vma j; ++ ++ /* If ! prefix_addresses and ! wide_output, we print ++ octets_per_line octets per line. */ ++ pb = octets; ++ if (pb > octets_per_line && ! prefix_addresses && ! wide_output) ++ pb = octets_per_line; ++ ++ if (inf->bytes_per_chunk) ++ bpc = inf->bytes_per_chunk; ++ else ++ bpc = 1; ++ ++ for (j = addr_offset * opb; j < addr_offset * opb + pb; j += bpc) ++ { ++ /* PR 21580: Check for a buffer ending early. */ ++ if (j + bpc <= stop_offset * opb) ++ { ++ unsigned int k; ++ ++ if (inf->display_endian == BFD_ENDIAN_LITTLE) ++ { ++ for (k = bpc; k-- != 0; ) ++ printf ("%02x", (unsigned) data[j + k]); ++ } ++ else ++ { ++ for (k = 0; k < bpc; k++) ++ printf ("%02x", (unsigned) data[j + k]); ++ } ++ } ++ putchar (' '); ++ } ++ ++ for (; pb < octets_per_line; pb += bpc) ++ { ++ unsigned int k; ++ ++ for (k = 0; k < bpc; k++) ++ printf (" "); ++ putchar (' '); ++ } ++ ++ /* Separate raw data from instruction by extra space. */ ++ if (insns) ++ putchar ('\t'); ++ else ++ printf (" "); ++ } ++ ++ if (! insns) ++ printf ("%s", buf); ++ else if (sfile.pos) ++ printf ("%s", sfile.buffer); ++ ++ if (prefix_addresses ++ ? show_raw_insn > 0 ++ : show_raw_insn >= 0) ++ { ++ while (pb < octets) ++ { ++ bfd_vma j; ++ char *s; ++ ++ putchar ('\n'); ++ j = addr_offset * opb + pb; ++ ++ if (no_addresses) ++ printf ("\t"); ++ else ++ { ++ bfd_sprintf_vma (aux->abfd, buf, section->vma + j / opb); ++ for (s = buf + skip_addr_chars; *s == '0'; s++) ++ *s = ' '; ++ if (*s == '\0') ++ *--s = '0'; ++ printf ("%s:\t", buf + skip_addr_chars); ++ } ++ ++ print_jump_visualisation (section->vma + j / opb, ++ max_level, line_buffer, ++ color_buffer); ++ ++ pb += octets_per_line; ++ if (pb > octets) ++ pb = octets; ++ for (; j < addr_offset * opb + pb; j += bpc) ++ { ++ /* PR 21619: Check for a buffer ending early. */ ++ if (j + bpc <= stop_offset * opb) ++ { ++ unsigned int k; ++ ++ if (inf->display_endian == BFD_ENDIAN_LITTLE) ++ { ++ for (k = bpc; k-- != 0; ) ++ printf ("%02x", (unsigned) data[j + k]); ++ } ++ else ++ { ++ for (k = 0; k < bpc; k++) ++ printf ("%02x", (unsigned) data[j + k]); ++ } ++ } ++ putchar (' '); ++ } ++ } ++ } ++ ++ if (!wide_output) ++ putchar ('\n'); ++ else ++ need_nl = TRUE; ++ } ++ ++ while ((*relppp) < relppend ++ && (**relppp)->address < rel_offset + addr_offset + octets / opb) ++ { ++ if (dump_reloc_info || dump_dynamic_reloc_info) ++ { ++ arelent *q; ++ ++ q = **relppp; ++ ++ if (wide_output) ++ putchar ('\t'); ++ else ++ printf ("\t\t\t"); ++ ++ if (!no_addresses) ++ { ++ objdump_print_value (section->vma - rel_offset + q->address, ++ inf, TRUE); ++ printf (": "); ++ } ++ ++ if (q->howto == NULL) ++ printf ("*unknown*\t"); ++ else if (q->howto->name) ++ printf ("%s\t", q->howto->name); ++ else ++ printf ("%d\t", q->howto->type); ++ ++ if (q->sym_ptr_ptr == NULL || *q->sym_ptr_ptr == NULL) ++ printf ("*unknown*"); ++ else ++ { ++ const char *sym_name; ++ ++ sym_name = bfd_asymbol_name (*q->sym_ptr_ptr); ++ if (sym_name != NULL && *sym_name != '\0') ++ objdump_print_symname (aux->abfd, inf, *q->sym_ptr_ptr); ++ else ++ { ++ asection *sym_sec; ++ ++ sym_sec = bfd_asymbol_section (*q->sym_ptr_ptr); ++ sym_name = bfd_section_name (sym_sec); ++ if (sym_name == NULL || *sym_name == '\0') ++ sym_name = "*unknown*"; ++ printf ("%s", sanitize_string (sym_name)); ++ } ++ } ++ ++ if (q->addend) ++ { ++ bfd_signed_vma addend = q->addend; ++ if (addend < 0) ++ { ++ printf ("-0x"); ++ addend = -addend; ++ } ++ else ++ printf ("+0x"); ++ objdump_print_value (addend, inf, TRUE); ++ } ++ ++ printf ("\n"); ++ need_nl = FALSE; ++ } ++ ++(*relppp); ++ } ++ ++ if (need_nl) ++ printf ("\n"); ++ ++ addr_offset += octets / opb; ++ } ++ ++ free (sfile.buffer); ++ free (line_buffer); ++ free (color_buffer); ++} ++ ++static void ++disassemble_section (bfd *abfd, asection *section, void *inf) ++{ ++ const struct elf_backend_data * bed; ++ bfd_vma sign_adjust = 0; ++ struct disassemble_info * pinfo = (struct disassemble_info *) inf; ++ struct objdump_disasm_info * paux; ++ unsigned int opb = pinfo->octets_per_byte; ++ bfd_byte * data = NULL; ++ bfd_size_type datasize = 0; ++ arelent ** rel_pp = NULL; ++ arelent ** rel_ppstart = NULL; ++ arelent ** rel_ppend; ++ bfd_vma stop_offset; ++ asymbol * sym = NULL; ++ long place = 0; ++ long rel_count; ++ bfd_vma rel_offset; ++ unsigned long addr_offset; ++ bfd_boolean do_print; ++ enum loop_control ++ { ++ stop_offset_reached, ++ function_sym, ++ next_sym ++ } loop_until; ++ ++ /* Sections that do not contain machine ++ code are not normally disassembled. */ ++ if (! disassemble_all ++ && only_list == NULL ++ && ((section->flags & (SEC_CODE | SEC_HAS_CONTENTS)) ++ != (SEC_CODE | SEC_HAS_CONTENTS))) ++ return; ++ ++ if (! process_section_p (section)) ++ return; ++ ++ datasize = bfd_section_size (section); ++ if (datasize == 0) ++ return; ++ ++ if (start_address == (bfd_vma) -1 ++ || start_address < section->vma) ++ addr_offset = 0; ++ else ++ addr_offset = start_address - section->vma; ++ ++ if (stop_address == (bfd_vma) -1) ++ stop_offset = datasize / opb; ++ else ++ { ++ if (stop_address < section->vma) ++ stop_offset = 0; ++ else ++ stop_offset = stop_address - section->vma; ++ if (stop_offset > datasize / opb) ++ stop_offset = datasize / opb; ++ } ++ ++ if (addr_offset >= stop_offset) ++ return; ++ ++ /* Decide which set of relocs to use. Load them if necessary. */ ++ paux = (struct objdump_disasm_info *) pinfo->application_data; ++ if (paux->dynrelbuf && dump_dynamic_reloc_info) ++ { ++ rel_pp = paux->dynrelbuf; ++ rel_count = paux->dynrelcount; ++ /* Dynamic reloc addresses are absolute, non-dynamic are section ++ relative. REL_OFFSET specifies the reloc address corresponding ++ to the start of this section. */ ++ rel_offset = section->vma; ++ } ++ else ++ { ++ rel_count = 0; ++ rel_pp = NULL; ++ rel_offset = 0; ++ ++ if ((section->flags & SEC_RELOC) != 0 ++ && (dump_reloc_info || pinfo->disassembler_needs_relocs)) ++ { ++ long relsize; ++ ++ relsize = bfd_get_reloc_upper_bound (abfd, section); ++ if (relsize < 0) ++ bfd_fatal (bfd_get_filename (abfd)); ++ ++ if (relsize > 0) ++ { ++ rel_ppstart = rel_pp = (arelent **) xmalloc (relsize); ++ rel_count = bfd_canonicalize_reloc (abfd, section, rel_pp, syms); ++ if (rel_count < 0) ++ bfd_fatal (bfd_get_filename (abfd)); ++ ++ /* Sort the relocs by address. */ ++ qsort (rel_pp, rel_count, sizeof (arelent *), compare_relocs); ++ } ++ } ++ } ++ rel_ppend = rel_pp + rel_count; ++ ++ if (!bfd_malloc_and_get_section (abfd, section, &data)) ++ { ++ non_fatal (_("Reading section %s failed because: %s"), ++ section->name, bfd_errmsg (bfd_get_error ())); ++ return; ++ } ++ ++ pinfo->buffer = data; ++ pinfo->buffer_vma = section->vma; ++ pinfo->buffer_length = datasize; ++ pinfo->section = section; ++ ++ /* Sort the symbols into value and section order. */ ++ compare_section = section; ++ if (sorted_symcount > 1) ++ qsort (sorted_syms, sorted_symcount, sizeof (asymbol *), compare_symbols); ++ ++ /* Skip over the relocs belonging to addresses below the ++ start address. */ ++ while (rel_pp < rel_ppend ++ && (*rel_pp)->address < rel_offset + addr_offset) ++ ++rel_pp; ++ ++ printf (_("\nDisassembly of section %s:\n"), sanitize_string (section->name)); ++ ++ /* Find the nearest symbol forwards from our current position. */ ++ paux->require_sec = TRUE; ++ sym = (asymbol *) find_symbol_for_address (section->vma + addr_offset, ++ (struct disassemble_info *) inf, ++ &place); ++ paux->require_sec = FALSE; ++ ++ /* PR 9774: If the target used signed addresses then we must make ++ sure that we sign extend the value that we calculate for 'addr' ++ in the loop below. */ ++ if (bfd_get_flavour (abfd) == bfd_target_elf_flavour ++ && (bed = get_elf_backend_data (abfd)) != NULL ++ && bed->sign_extend_vma) ++ sign_adjust = (bfd_vma) 1 << (bed->s->arch_size - 1); ++ ++ /* Disassemble a block of instructions up to the address associated with ++ the symbol we have just found. Then print the symbol and find the ++ next symbol on. Repeat until we have disassembled the entire section ++ or we have reached the end of the address range we are interested in. */ ++ do_print = paux->symbol == NULL; ++ loop_until = stop_offset_reached; ++ ++ while (addr_offset < stop_offset) ++ { ++ bfd_vma addr; ++ asymbol *nextsym; ++ bfd_vma nextstop_offset; ++ bfd_boolean insns; ++ ++ addr = section->vma + addr_offset; ++ addr = ((addr & ((sign_adjust << 1) - 1)) ^ sign_adjust) - sign_adjust; ++ ++ if (sym != NULL && bfd_asymbol_value (sym) <= addr) ++ { ++ int x; ++ ++ for (x = place; ++ (x < sorted_symcount ++ && (bfd_asymbol_value (sorted_syms[x]) <= addr)); ++ ++x) ++ continue; ++ ++ pinfo->symbols = sorted_syms + place; ++ pinfo->num_symbols = x - place; ++ pinfo->symtab_pos = place; ++ } ++ else ++ { ++ pinfo->symbols = NULL; ++ pinfo->num_symbols = 0; ++ pinfo->symtab_pos = -1; ++ } ++ ++ /* If we are only disassembling from a specific symbol, ++ check to see if we should start or stop displaying. */ ++ if (sym && paux->symbol) ++ { ++ if (do_print) ++ { ++ /* See if we should stop printing. */ ++ switch (loop_until) ++ { ++ case function_sym: ++ if (sym->flags & BSF_FUNCTION) ++ do_print = FALSE; ++ break; ++ ++ case stop_offset_reached: ++ /* Handled by the while loop. */ ++ break; ++ ++ case next_sym: ++ /* FIXME: There is an implicit assumption here ++ that the name of sym is different from ++ paux->symbol. */ ++ if (! bfd_is_local_label (abfd, sym)) ++ do_print = FALSE; ++ break; ++ } ++ } ++ else ++ { ++ const char * name = bfd_asymbol_name (sym); ++ char * alloc = NULL; ++ ++ if (do_demangle && name[0] != '\0') ++ { ++ /* Demangle the name. */ ++ alloc = bfd_demangle (abfd, name, demangle_flags); ++ if (alloc != NULL) ++ name = alloc; ++ } ++ ++ /* We are not currently printing. Check to see ++ if the current symbol matches the requested symbol. */ ++ if (streq (name, paux->symbol)) ++ { ++ do_print = TRUE; ++ ++ if (sym->flags & BSF_FUNCTION) ++ { ++ if (bfd_get_flavour (abfd) == bfd_target_elf_flavour ++ && ((elf_symbol_type *) sym)->internal_elf_sym.st_size > 0) ++ { ++ /* Sym is a function symbol with a size associated ++ with it. Turn on automatic disassembly for the ++ next VALUE bytes. */ ++ stop_offset = addr_offset ++ + ((elf_symbol_type *) sym)->internal_elf_sym.st_size; ++ loop_until = stop_offset_reached; ++ } ++ else ++ { ++ /* Otherwise we need to tell the loop heuristic to ++ loop until the next function symbol is encountered. */ ++ loop_until = function_sym; ++ } ++ } ++ else ++ { ++ /* Otherwise loop until the next symbol is encountered. */ ++ loop_until = next_sym; ++ } ++ } ++ ++ free (alloc); ++ } ++ } ++ ++ if (! prefix_addresses && do_print) ++ { ++ pinfo->fprintf_func (pinfo->stream, "\n"); ++ objdump_print_addr_with_sym (abfd, section, sym, addr, ++ pinfo, FALSE); ++ pinfo->fprintf_func (pinfo->stream, ":\n"); ++ } ++ ++ if (sym != NULL && bfd_asymbol_value (sym) > addr) ++ nextsym = sym; ++ else if (sym == NULL) ++ nextsym = NULL; ++ else ++ { ++#define is_valid_next_sym(SYM) \ ++ (strcmp (bfd_section_name ((SYM)->section), bfd_section_name (section)) == 0 \ ++ && (bfd_asymbol_value (SYM) > bfd_asymbol_value (sym)) \ ++ && pinfo->symbol_is_valid (SYM, pinfo)) ++ ++ /* Search forward for the next appropriate symbol in ++ SECTION. Note that all the symbols are sorted ++ together into one big array, and that some sections ++ may have overlapping addresses. */ ++ while (place < sorted_symcount ++ && ! is_valid_next_sym (sorted_syms [place])) ++ ++place; ++ ++ if (place >= sorted_symcount) ++ nextsym = NULL; ++ else ++ nextsym = sorted_syms[place]; ++ } ++ ++ if (sym != NULL && bfd_asymbol_value (sym) > addr) ++ nextstop_offset = bfd_asymbol_value (sym) - section->vma; ++ else if (nextsym == NULL) ++ nextstop_offset = stop_offset; ++ else ++ nextstop_offset = bfd_asymbol_value (nextsym) - section->vma; ++ ++ if (nextstop_offset > stop_offset ++ || nextstop_offset <= addr_offset) ++ nextstop_offset = stop_offset; ++ ++ /* If a symbol is explicitly marked as being an object ++ rather than a function, just dump the bytes without ++ disassembling them. */ ++ if (disassemble_all ++ || sym == NULL ++ || sym->section != section ++ || bfd_asymbol_value (sym) > addr ++ || ((sym->flags & BSF_OBJECT) == 0 ++ && (strstr (bfd_asymbol_name (sym), "gnu_compiled") ++ == NULL) ++ && (strstr (bfd_asymbol_name (sym), "gcc2_compiled") ++ == NULL)) ++ || (sym->flags & BSF_FUNCTION) != 0) ++ insns = TRUE; ++ else ++ insns = FALSE; ++ ++ if (do_print) ++ { ++ /* Resolve symbol name. */ ++ if (visualize_jumps && abfd && sym && sym->name) ++ { ++ struct disassemble_info di; ++ SFILE sf; ++ ++ sf.alloc = strlen (sym->name) + 40; ++ sf.buffer = (char*) xmalloc (sf.alloc); ++ sf.pos = 0; ++ di.fprintf_func = (fprintf_ftype) objdump_sprintf; ++ di.stream = &sf; ++ ++ objdump_print_symname (abfd, &di, sym); ++ ++ /* Fetch jump information. */ ++ detected_jumps = disassemble_jumps ++ (pinfo, paux->disassemble_fn, ++ addr_offset, nextstop_offset, ++ rel_offset, &rel_pp, rel_ppend); ++ ++ /* Free symbol name. */ ++ free (sf.buffer); ++ } ++ ++ /* Add jumps to output. */ ++ disassemble_bytes (pinfo, paux->disassemble_fn, insns, data, ++ addr_offset, nextstop_offset, ++ rel_offset, &rel_pp, rel_ppend); ++ ++ /* Free jumps. */ ++ while (detected_jumps) ++ { ++ detected_jumps = jump_info_free (detected_jumps); ++ } ++ } ++ ++ addr_offset = nextstop_offset; ++ sym = nextsym; ++ } ++ ++ free (data); ++ ++ if (rel_ppstart != NULL) ++ free (rel_ppstart); ++} ++ ++/* Disassemble the contents of an object file. */ ++ ++static void ++disassemble_data (bfd *abfd) ++{ ++ struct disassemble_info disasm_info; ++ struct objdump_disasm_info aux; ++ long i; ++ ++ print_files = NULL; ++ prev_functionname = NULL; ++ prev_line = -1; ++ prev_discriminator = 0; ++ ++ /* We make a copy of syms to sort. We don't want to sort syms ++ because that will screw up the relocs. */ ++ sorted_symcount = symcount ? symcount : dynsymcount; ++ sorted_syms = (asymbol **) xmalloc ((sorted_symcount + synthcount) ++ * sizeof (asymbol *)); ++ if (sorted_symcount != 0) ++ { ++ memcpy (sorted_syms, symcount ? syms : dynsyms, ++ sorted_symcount * sizeof (asymbol *)); ++ ++ sorted_symcount = remove_useless_symbols (sorted_syms, sorted_symcount); ++ } ++ ++ for (i = 0; i < synthcount; ++i) ++ { ++ sorted_syms[sorted_symcount] = synthsyms + i; ++ ++sorted_symcount; ++ } ++ ++ init_disassemble_info (&disasm_info, stdout, (fprintf_ftype) fprintf); ++ ++ disasm_info.application_data = (void *) &aux; ++ aux.abfd = abfd; ++ aux.require_sec = FALSE; ++ aux.dynrelbuf = NULL; ++ aux.dynrelcount = 0; ++ aux.reloc = NULL; ++ aux.symbol = disasm_sym; ++ ++ disasm_info.print_address_func = objdump_print_address; ++ disasm_info.symbol_at_address_func = objdump_symbol_at_address; ++ ++ if (machine != NULL) ++ { ++ const bfd_arch_info_type *inf = bfd_scan_arch (machine); ++ ++ if (inf == NULL) ++ fatal (_("can't use supplied machine %s"), machine); ++ ++ abfd->arch_info = inf; ++ } ++ ++ if (endian != BFD_ENDIAN_UNKNOWN) ++ { ++ struct bfd_target *xvec; ++ ++ xvec = (struct bfd_target *) xmalloc (sizeof (struct bfd_target)); ++ memcpy (xvec, abfd->xvec, sizeof (struct bfd_target)); ++ xvec->byteorder = endian; ++ abfd->xvec = xvec; ++ } ++ ++ /* Use libopcodes to locate a suitable disassembler. */ ++ aux.disassemble_fn = disassembler (bfd_get_arch (abfd), ++ bfd_big_endian (abfd), ++ bfd_get_mach (abfd), abfd); ++ if (!aux.disassemble_fn) ++ { ++ non_fatal (_("can't disassemble for architecture %s\n"), ++ bfd_printable_arch_mach (bfd_get_arch (abfd), 0)); ++ exit_status = 1; ++ return; ++ } ++ ++ disasm_info.flavour = bfd_get_flavour (abfd); ++ disasm_info.arch = bfd_get_arch (abfd); ++ disasm_info.mach = bfd_get_mach (abfd); ++ disasm_info.disassembler_options = disassembler_options; ++ disasm_info.octets_per_byte = bfd_octets_per_byte (abfd, NULL); ++ disasm_info.skip_zeroes = DEFAULT_SKIP_ZEROES; ++ disasm_info.skip_zeroes_at_end = DEFAULT_SKIP_ZEROES_AT_END; ++ disasm_info.disassembler_needs_relocs = FALSE; ++ ++ if (bfd_big_endian (abfd)) ++ disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_BIG; ++ else if (bfd_little_endian (abfd)) ++ disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_LITTLE; ++ else ++ /* ??? Aborting here seems too drastic. We could default to big or little ++ instead. */ ++ disasm_info.endian = BFD_ENDIAN_UNKNOWN; ++ ++ disasm_info.endian_code = disasm_info.endian; ++ ++ /* Allow the target to customize the info structure. */ ++ disassemble_init_for_target (& disasm_info); ++ ++ /* Pre-load the dynamic relocs as we may need them during the disassembly. */ ++ { ++ long relsize = bfd_get_dynamic_reloc_upper_bound (abfd); ++ ++ if (relsize < 0 && dump_dynamic_reloc_info) ++ bfd_fatal (bfd_get_filename (abfd)); ++ ++ if (relsize > 0) ++ { ++ aux.dynrelbuf = (arelent **) xmalloc (relsize); ++ aux.dynrelcount = bfd_canonicalize_dynamic_reloc (abfd, ++ aux.dynrelbuf, ++ dynsyms); ++ if (aux.dynrelcount < 0) ++ bfd_fatal (bfd_get_filename (abfd)); ++ ++ /* Sort the relocs by address. */ ++ qsort (aux.dynrelbuf, aux.dynrelcount, sizeof (arelent *), ++ compare_relocs); ++ } ++ } ++ disasm_info.symtab = sorted_syms; ++ disasm_info.symtab_size = sorted_symcount; ++ ++ bfd_map_over_sections (abfd, disassemble_section, & disasm_info); ++ ++ if (aux.dynrelbuf != NULL) ++ free (aux.dynrelbuf); ++ free (sorted_syms); ++ disassemble_free_target (&disasm_info); ++} ++ ++static bfd_boolean ++load_specific_debug_section (enum dwarf_section_display_enum debug, ++ asection *sec, void *file) ++{ ++ struct dwarf_section *section = &debug_displays [debug].section; ++ bfd *abfd = (bfd *) file; ++ bfd_byte *contents; ++ bfd_size_type amt; ++ size_t alloced; ++ ++ if (section->start != NULL) ++ { ++ /* If it is already loaded, do nothing. */ ++ if (streq (section->filename, bfd_get_filename (abfd))) ++ return TRUE; ++ free (section->start); ++ } ++ ++ section->filename = bfd_get_filename (abfd); ++ section->reloc_info = NULL; ++ section->num_relocs = 0; ++ section->address = bfd_section_vma (sec); ++ section->user_data = sec; ++ section->size = bfd_section_size (sec); ++ /* PR 24360: On 32-bit hosts sizeof (size_t) < sizeof (bfd_size_type). */ ++ alloced = amt = section->size + 1; ++ if (alloced != amt || alloced == 0) ++ { ++ section->start = NULL; ++ free_debug_section (debug); ++ printf (_("\nSection '%s' has an invalid size: %#llx.\n"), ++ sanitize_string (section->name), ++ (unsigned long long) section->size); ++ return FALSE; ++ } ++ section->start = contents = malloc (alloced); ++ if (section->start == NULL ++ || !bfd_get_full_section_contents (abfd, sec, &contents)) ++ { ++ free_debug_section (debug); ++ printf (_("\nCan't get contents for section '%s'.\n"), ++ sanitize_string (section->name)); ++ return FALSE; ++ } ++ /* Ensure any string section has a terminating NUL. */ ++ section->start[section->size] = 0; ++ ++ if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0 ++ && debug_displays [debug].relocate) ++ { ++ long reloc_size; ++ bfd_boolean ret; ++ ++ bfd_cache_section_contents (sec, section->start); ++ ++ ret = bfd_simple_get_relocated_section_contents (abfd, ++ sec, ++ section->start, ++ syms) != NULL; ++ ++ if (! ret) ++ { ++ free_debug_section (debug); ++ printf (_("\nCan't get contents for section '%s'.\n"), ++ sanitize_string (section->name)); ++ return FALSE; ++ } ++ ++ reloc_size = bfd_get_reloc_upper_bound (abfd, sec); ++ if (reloc_size > 0) ++ { ++ unsigned long reloc_count; ++ arelent **relocs; ++ ++ relocs = (arelent **) xmalloc (reloc_size); ++ ++ reloc_count = bfd_canonicalize_reloc (abfd, sec, relocs, NULL); ++ if (reloc_count == 0) ++ free (relocs); ++ else ++ { ++ section->reloc_info = relocs; ++ section->num_relocs = reloc_count; ++ } ++ } ++ } ++ ++ return TRUE; ++} ++ ++bfd_boolean ++reloc_at (struct dwarf_section * dsec, dwarf_vma offset) ++{ ++ arelent ** relocs; ++ arelent * rp; ++ ++ if (dsec == NULL || dsec->reloc_info == NULL) ++ return FALSE; ++ ++ relocs = (arelent **) dsec->reloc_info; ++ ++ for (; (rp = * relocs) != NULL; ++ relocs) ++ if (rp->address == offset) ++ return TRUE; ++ ++ return FALSE; ++} ++ ++bfd_boolean ++load_debug_section (enum dwarf_section_display_enum debug, void *file) ++{ ++ struct dwarf_section *section = &debug_displays [debug].section; ++ bfd *abfd = (bfd *) file; ++ asection *sec; ++ ++ /* If it is already loaded, do nothing. */ ++ if (section->start != NULL) ++ { ++ if (streq (section->filename, bfd_get_filename (abfd))) ++ return TRUE; ++ } ++ ++ /* Locate the debug section. */ ++ sec = bfd_get_section_by_name (abfd, section->uncompressed_name); ++ if (sec != NULL) ++ section->name = section->uncompressed_name; ++ else ++ { ++ sec = bfd_get_section_by_name (abfd, section->compressed_name); ++ if (sec != NULL) ++ section->name = section->compressed_name; ++ } ++ if (sec == NULL) ++ return FALSE; ++ ++ return load_specific_debug_section (debug, sec, file); ++} ++ ++void ++free_debug_section (enum dwarf_section_display_enum debug) ++{ ++ struct dwarf_section *section = &debug_displays [debug].section; ++ ++ if (section->start == NULL) ++ return; ++ ++ /* PR 17512: file: 0f67f69d. */ ++ if (section->user_data != NULL) ++ { ++ asection * sec = (asection *) section->user_data; ++ ++ /* If we are freeing contents that are also pointed to by the BFD ++ library's section structure then make sure to update those pointers ++ too. Otherwise, the next time we try to load data for this section ++ we can end up using a stale pointer. */ ++ if (section->start == sec->contents) ++ { ++ sec->contents = NULL; ++ sec->flags &= ~ SEC_IN_MEMORY; ++ sec->compress_status = COMPRESS_SECTION_NONE; ++ } ++ } ++ ++ free ((char *) section->start); ++ section->start = NULL; ++ section->address = 0; ++ section->size = 0; ++} ++ ++void ++close_debug_file (void * file) ++{ ++ bfd * abfd = (bfd *) file; ++ ++ bfd_close (abfd); ++} ++ ++void * ++open_debug_file (const char * pathname) ++{ ++ bfd * data; ++ ++ data = bfd_openr (pathname, NULL); ++ if (data == NULL) ++ return NULL; ++ ++ if (! bfd_check_format (data, bfd_object)) ++ return NULL; ++ ++ return data; ++} ++ ++#if HAVE_LIBDEBUGINFOD ++/* Return a hex string represention of the build-id. */ ++ ++unsigned char * ++get_build_id (void * data) ++{ ++ unsigned i; ++ char * build_id_str; ++ bfd * abfd = (bfd *) data; ++ const struct bfd_build_id * build_id; ++ ++ build_id = abfd->build_id; ++ if (build_id == NULL) ++ return NULL; ++ ++ build_id_str = malloc (build_id->size * 2 + 1); ++ if (build_id_str == NULL) ++ return NULL; ++ ++ for (i = 0; i < build_id->size; i++) ++ sprintf (build_id_str + (i * 2), "%02x", build_id->data[i]); ++ build_id_str[build_id->size * 2] = '\0'; ++ ++ return (unsigned char *)build_id_str; ++} ++#endif /* HAVE_LIBDEBUGINFOD */ ++ ++static void ++dump_dwarf_section (bfd *abfd, asection *section, ++ void *arg ATTRIBUTE_UNUSED) ++{ ++ const char *name = bfd_section_name (section); ++ const char *match; ++ int i; ++ ++ if (CONST_STRNEQ (name, ".gnu.linkonce.wi.")) ++ match = ".debug_info"; ++ else ++ match = name; ++ ++ for (i = 0; i < max; i++) ++ if ((strcmp (debug_displays [i].section.uncompressed_name, match) == 0 ++ || strcmp (debug_displays [i].section.compressed_name, match) == 0) ++ && debug_displays [i].enabled != NULL ++ && *debug_displays [i].enabled) ++ { ++ struct dwarf_section *sec = &debug_displays [i].section; ++ ++ if (strcmp (sec->uncompressed_name, match) == 0) ++ sec->name = sec->uncompressed_name; ++ else ++ sec->name = sec->compressed_name; ++ if (load_specific_debug_section ((enum dwarf_section_display_enum) i, ++ section, abfd)) ++ { ++ debug_displays [i].display (sec, abfd); ++ ++ if (i != info && i != abbrev) ++ free_debug_section ((enum dwarf_section_display_enum) i); ++ } ++ break; ++ } ++} ++ ++/* Dump the dwarf debugging information. */ ++ ++static void ++dump_dwarf (bfd *abfd) ++{ ++ /* The byte_get pointer should have been set at the start of dump_bfd(). */ ++ if (byte_get == NULL) ++ { ++ warn (_("File %s does not contain any dwarf debug information\n"), ++ bfd_get_filename (abfd)); ++ return; ++ } ++ ++ switch (bfd_get_arch (abfd)) ++ { ++ case bfd_arch_s12z: ++ /* S12Z has a 24 bit address space. But the only known ++ producer of dwarf_info encodes addresses into 32 bits. */ ++ eh_addr_size = 4; ++ break; ++ ++ default: ++ eh_addr_size = bfd_arch_bits_per_address (abfd) / 8; ++ break; ++ } ++ ++ init_dwarf_regnames_by_bfd_arch_and_mach (bfd_get_arch (abfd), ++ bfd_get_mach (abfd)); ++ ++ bfd_map_over_sections (abfd, dump_dwarf_section, NULL); ++} ++ ++/* Read ABFD's stabs section STABSECT_NAME, and return a pointer to ++ it. Return NULL on failure. */ ++ ++static bfd_byte * ++read_section_stabs (bfd *abfd, const char *sect_name, bfd_size_type *size_ptr, ++ bfd_size_type *entsize_ptr) ++{ ++ asection *stabsect; ++ bfd_byte *contents; ++ ++ stabsect = bfd_get_section_by_name (abfd, sect_name); ++ if (stabsect == NULL) ++ { ++ printf (_("No %s section present\n\n"), ++ sanitize_string (sect_name)); ++ return FALSE; ++ } ++ ++ if (!bfd_malloc_and_get_section (abfd, stabsect, &contents)) ++ { ++ non_fatal (_("reading %s section of %s failed: %s"), ++ sect_name, bfd_get_filename (abfd), ++ bfd_errmsg (bfd_get_error ())); ++ exit_status = 1; ++ free (contents); ++ return NULL; ++ } ++ ++ *size_ptr = bfd_section_size (stabsect); ++ if (entsize_ptr) ++ *entsize_ptr = stabsect->entsize; ++ ++ return contents; ++} ++ ++/* Stabs entries use a 12 byte format: ++ 4 byte string table index ++ 1 byte stab type ++ 1 byte stab other field ++ 2 byte stab desc field ++ 4 byte stab value ++ FIXME: This will have to change for a 64 bit object format. */ ++ ++#define STRDXOFF (0) ++#define TYPEOFF (4) ++#define OTHEROFF (5) ++#define DESCOFF (6) ++#define VALOFF (8) ++#define STABSIZE (12) ++ ++/* Print ABFD's stabs section STABSECT_NAME (in `stabs'), ++ using string table section STRSECT_NAME (in `strtab'). */ ++ ++static void ++print_section_stabs (bfd *abfd, ++ const char *stabsect_name, ++ unsigned *string_offset_ptr) ++{ ++ int i; ++ unsigned file_string_table_offset = 0; ++ unsigned next_file_string_table_offset = *string_offset_ptr; ++ bfd_byte *stabp, *stabs_end; ++ ++ stabp = stabs; ++ stabs_end = stabp + stab_size; ++ ++ printf (_("Contents of %s section:\n\n"), sanitize_string (stabsect_name)); ++ printf ("Symnum n_type n_othr n_desc n_value n_strx String\n"); ++ ++ /* Loop through all symbols and print them. ++ ++ We start the index at -1 because there is a dummy symbol on ++ the front of stabs-in-{coff,elf} sections that supplies sizes. */ ++ for (i = -1; stabp <= stabs_end - STABSIZE; stabp += STABSIZE, i++) ++ { ++ const char *name; ++ unsigned long strx; ++ unsigned char type, other; ++ unsigned short desc; ++ bfd_vma value; ++ ++ strx = bfd_h_get_32 (abfd, stabp + STRDXOFF); ++ type = bfd_h_get_8 (abfd, stabp + TYPEOFF); ++ other = bfd_h_get_8 (abfd, stabp + OTHEROFF); ++ desc = bfd_h_get_16 (abfd, stabp + DESCOFF); ++ value = bfd_h_get_32 (abfd, stabp + VALOFF); ++ ++ printf ("\n%-6d ", i); ++ /* Either print the stab name, or, if unnamed, print its number ++ again (makes consistent formatting for tools like awk). */ ++ name = bfd_get_stab_name (type); ++ if (name != NULL) ++ printf ("%-6s", sanitize_string (name)); ++ else if (type == N_UNDF) ++ printf ("HdrSym"); ++ else ++ printf ("%-6d", type); ++ printf (" %-6d %-6d ", other, desc); ++ bfd_printf_vma (abfd, value); ++ printf (" %-6lu", strx); ++ ++ /* Symbols with type == 0 (N_UNDF) specify the length of the ++ string table associated with this file. We use that info ++ to know how to relocate the *next* file's string table indices. */ ++ if (type == N_UNDF) ++ { ++ file_string_table_offset = next_file_string_table_offset; ++ next_file_string_table_offset += value; ++ } ++ else ++ { ++ bfd_size_type amt = strx + file_string_table_offset; ++ ++ /* Using the (possibly updated) string table offset, print the ++ string (if any) associated with this symbol. */ ++ if (amt < stabstr_size) ++ /* PR 17512: file: 079-79389-0.001:0.1. ++ FIXME: May need to sanitize this string before displaying. */ ++ printf (" %.*s", (int)(stabstr_size - amt), strtab + amt); ++ else ++ printf (" *"); ++ } ++ } ++ printf ("\n\n"); ++ *string_offset_ptr = next_file_string_table_offset; ++} ++ ++typedef struct ++{ ++ const char * section_name; ++ const char * string_section_name; ++ unsigned string_offset; ++} ++stab_section_names; ++ ++static void ++find_stabs_section (bfd *abfd, asection *section, void *names) ++{ ++ int len; ++ stab_section_names * sought = (stab_section_names *) names; ++ ++ /* Check for section names for which stabsect_name is a prefix, to ++ handle .stab.N, etc. */ ++ len = strlen (sought->section_name); ++ ++ /* If the prefix matches, and the files section name ends with a ++ nul or a digit, then we match. I.e., we want either an exact ++ match or a section followed by a number. */ ++ if (strncmp (sought->section_name, section->name, len) == 0 ++ && (section->name[len] == 0 ++ || (section->name[len] == '.' && ISDIGIT (section->name[len + 1])))) ++ { ++ if (strtab == NULL) ++ strtab = read_section_stabs (abfd, sought->string_section_name, ++ &stabstr_size, NULL); ++ ++ if (strtab) ++ { ++ stabs = read_section_stabs (abfd, section->name, &stab_size, NULL); ++ if (stabs) ++ print_section_stabs (abfd, section->name, &sought->string_offset); ++ } ++ } ++} ++ ++static void ++dump_stabs_section (bfd *abfd, char *stabsect_name, char *strsect_name) ++{ ++ stab_section_names s; ++ ++ s.section_name = stabsect_name; ++ s.string_section_name = strsect_name; ++ s.string_offset = 0; ++ ++ bfd_map_over_sections (abfd, find_stabs_section, & s); ++ ++ free (strtab); ++ strtab = NULL; ++} ++ ++/* Dump the any sections containing stabs debugging information. */ ++ ++static void ++dump_stabs (bfd *abfd) ++{ ++ dump_stabs_section (abfd, ".stab", ".stabstr"); ++ dump_stabs_section (abfd, ".stab.excl", ".stab.exclstr"); ++ dump_stabs_section (abfd, ".stab.index", ".stab.indexstr"); ++ ++ /* For Darwin. */ ++ dump_stabs_section (abfd, "LC_SYMTAB.stabs", "LC_SYMTAB.stabstr"); ++ ++ dump_stabs_section (abfd, "$GDB_SYMBOLS$", "$GDB_STRINGS$"); ++} ++ ++static void ++dump_bfd_header (bfd *abfd) ++{ ++ char *comma = ""; ++ ++ printf (_("architecture: %s, "), ++ bfd_printable_arch_mach (bfd_get_arch (abfd), ++ bfd_get_mach (abfd))); ++ printf (_("flags 0x%08x:\n"), abfd->flags & ~BFD_FLAGS_FOR_BFD_USE_MASK); ++ ++#define PF(x, y) if (abfd->flags & x) {printf ("%s%s", comma, y); comma=", ";} ++ PF (HAS_RELOC, "HAS_RELOC"); ++ PF (EXEC_P, "EXEC_P"); ++ PF (HAS_LINENO, "HAS_LINENO"); ++ PF (HAS_DEBUG, "HAS_DEBUG"); ++ PF (HAS_SYMS, "HAS_SYMS"); ++ PF (HAS_LOCALS, "HAS_LOCALS"); ++ PF (DYNAMIC, "DYNAMIC"); ++ PF (WP_TEXT, "WP_TEXT"); ++ PF (D_PAGED, "D_PAGED"); ++ PF (BFD_IS_RELAXABLE, "BFD_IS_RELAXABLE"); ++ printf (_("\nstart address 0x")); ++ bfd_printf_vma (abfd, abfd->start_address); ++ printf ("\n"); ++} ++ ++ ++#ifdef ENABLE_LIBCTF ++/* Formatting callback function passed to ctf_dump. Returns either the pointer ++ it is passed, or a pointer to newly-allocated storage, in which case ++ dump_ctf() will free it when it no longer needs it. */ ++ ++static char * ++dump_ctf_indent_lines (ctf_sect_names_t sect ATTRIBUTE_UNUSED, ++ char *s, void *arg) ++{ ++ const char *blanks = arg; ++ char *new_s; ++ ++ if (asprintf (&new_s, "%s%s", blanks, s) < 0) ++ return s; ++ return new_s; ++} ++ ++/* Make a ctfsect suitable for ctf_bfdopen_ctfsect(). */ ++static ctf_sect_t ++make_ctfsect (const char *name, bfd_byte *data, ++ bfd_size_type size) ++{ ++ ctf_sect_t ctfsect; ++ ++ ctfsect.cts_name = name; ++ ctfsect.cts_entsize = 1; ++ ctfsect.cts_size = size; ++ ctfsect.cts_data = data; ++ ++ return ctfsect; ++} ++ ++/* Dump one CTF archive member. */ ++ ++static int ++dump_ctf_archive_member (ctf_file_t *ctf, const char *name, void *arg) ++{ ++ ctf_file_t *parent = (ctf_file_t *) arg; ++ const char *things[] = {"Header", "Labels", "Data objects", ++ "Function objects", "Variables", "Types", "Strings", ++ ""}; ++ const char **thing; ++ size_t i; ++ ++ /* Only print out the name of non-default-named archive members. ++ The name .ctf appears everywhere, even for things that aren't ++ really archives, so printing it out is liable to be confusing. ++ ++ The parent, if there is one, is the default-owned archive member: ++ avoid importing it into itself. (This does no harm, but looks ++ confusing.) */ ++ ++ if (strcmp (name, ".ctf") != 0) ++ { ++ printf (_("\nCTF archive member: %s:\n"), sanitize_string (name)); ++ ctf_import (ctf, parent); ++ } ++ ++ for (i = 0, thing = things; *thing[0]; thing++, i++) ++ { ++ ctf_dump_state_t *s = NULL; ++ char *item; ++ ++ printf ("\n %s:\n", *thing); ++ while ((item = ctf_dump (ctf, &s, i, dump_ctf_indent_lines, ++ (void *) " ")) != NULL) ++ { ++ printf ("%s\n", item); ++ free (item); ++ } ++ ++ if (ctf_errno (ctf)) ++ { ++ non_fatal (_("Iteration failed: %s, %s\n"), *thing, ++ ctf_errmsg (ctf_errno (ctf))); ++ break; ++ } ++ } ++ return 0; ++} ++ ++/* Dump the CTF debugging information. */ ++ ++static void ++dump_ctf (bfd *abfd, const char *sect_name, const char *parent_name) ++{ ++ ctf_archive_t *ctfa, *parenta = NULL, *lookparent; ++ bfd_byte *ctfdata, *parentdata = NULL; ++ bfd_size_type ctfsize, parentsize; ++ ctf_sect_t ctfsect; ++ ctf_file_t *parent = NULL; ++ int err; ++ ++ if ((ctfdata = read_section_stabs (abfd, sect_name, &ctfsize, NULL)) == NULL) ++ bfd_fatal (bfd_get_filename (abfd)); ++ ++ if (parent_name ++ && (parentdata = read_section_stabs (abfd, parent_name, &parentsize, ++ NULL)) == NULL) ++ bfd_fatal (bfd_get_filename (abfd)); ++ ++ /* Load the CTF file and dump it. */ ++ ++ ctfsect = make_ctfsect (sect_name, ctfdata, ctfsize); ++ if ((ctfa = ctf_bfdopen_ctfsect (abfd, &ctfsect, &err)) == NULL) ++ { ++ non_fatal (_("CTF open failure: %s\n"), ctf_errmsg (err)); ++ bfd_fatal (bfd_get_filename (abfd)); ++ } ++ ++ if (parentdata) ++ { ++ ctfsect = make_ctfsect (parent_name, parentdata, parentsize); ++ if ((parenta = ctf_bfdopen_ctfsect (abfd, &ctfsect, &err)) == NULL) ++ { ++ non_fatal (_("CTF open failure: %s\n"), ctf_errmsg (err)); ++ bfd_fatal (bfd_get_filename (abfd)); ++ } ++ ++ lookparent = parenta; ++ } ++ else ++ lookparent = ctfa; ++ ++ /* Assume that the applicable parent archive member is the default one. ++ (This is what all known implementations are expected to do, if they ++ put CTFs and their parents in archives together.) */ ++ if ((parent = ctf_arc_open_by_name (lookparent, NULL, &err)) == NULL) ++ { ++ non_fatal (_("CTF open failure: %s\n"), ctf_errmsg (err)); ++ bfd_fatal (bfd_get_filename (abfd)); ++ } ++ ++ printf (_("Contents of CTF section %s:\n"), sanitize_string (sect_name)); ++ ++ ctf_archive_iter (ctfa, dump_ctf_archive_member, parent); ++ ctf_file_close (parent); ++ ctf_close (ctfa); ++ ctf_close (parenta); ++ free (parentdata); ++ free (ctfdata); ++} ++#else ++static void ++dump_ctf (bfd *abfd ATTRIBUTE_UNUSED, const char *sect_name ATTRIBUTE_UNUSED, ++ const char *parent_name ATTRIBUTE_UNUSED) {} ++#endif ++ ++ ++static void ++dump_bfd_private_header (bfd *abfd) ++{ ++ if (!bfd_print_private_bfd_data (abfd, stdout)) ++ non_fatal (_("warning: private headers incomplete: %s"), ++ bfd_errmsg (bfd_get_error ())); ++} ++ ++static void ++dump_target_specific (bfd *abfd) ++{ ++ const struct objdump_private_desc * const *desc; ++ struct objdump_private_option *opt; ++ char *e, *b; ++ ++ /* Find the desc. */ ++ for (desc = objdump_private_vectors; *desc != NULL; desc++) ++ if ((*desc)->filter (abfd)) ++ break; ++ ++ if (*desc == NULL) ++ { ++ non_fatal (_("option -P/--private not supported by this file")); ++ return; ++ } ++ ++ /* Clear all options. */ ++ for (opt = (*desc)->options; opt->name; opt++) ++ opt->selected = FALSE; ++ ++ /* Decode options. */ ++ b = dump_private_options; ++ do ++ { ++ e = strchr (b, ','); ++ ++ if (e) ++ *e = 0; ++ ++ for (opt = (*desc)->options; opt->name; opt++) ++ if (strcmp (opt->name, b) == 0) ++ { ++ opt->selected = TRUE; ++ break; ++ } ++ if (opt->name == NULL) ++ non_fatal (_("target specific dump '%s' not supported"), b); ++ ++ if (e) ++ { ++ *e = ','; ++ b = e + 1; ++ } ++ } ++ while (e != NULL); ++ ++ /* Dump. */ ++ (*desc)->dump (abfd); ++} ++ ++/* Display a section in hexadecimal format with associated characters. ++ Each line prefixed by the zero padded address. */ ++ ++static void ++dump_section (bfd *abfd, asection *section, void *dummy ATTRIBUTE_UNUSED) ++{ ++ bfd_byte *data = NULL; ++ bfd_size_type datasize; ++ bfd_vma addr_offset; ++ bfd_vma start_offset; ++ bfd_vma stop_offset; ++ unsigned int opb = bfd_octets_per_byte (abfd, section); ++ /* Bytes per line. */ ++ const int onaline = 16; ++ char buf[64]; ++ int count; ++ int width; ++ ++ if ((section->flags & SEC_HAS_CONTENTS) == 0) ++ return; ++ ++ if (! process_section_p (section)) ++ return; ++ ++ if ((datasize = bfd_section_size (section)) == 0) ++ return; ++ ++ /* Compute the address range to display. */ ++ if (start_address == (bfd_vma) -1 ++ || start_address < section->vma) ++ start_offset = 0; ++ else ++ start_offset = start_address - section->vma; ++ ++ if (stop_address == (bfd_vma) -1) ++ stop_offset = datasize / opb; ++ else ++ { ++ if (stop_address < section->vma) ++ stop_offset = 0; ++ else ++ stop_offset = stop_address - section->vma; ++ ++ if (stop_offset > datasize / opb) ++ stop_offset = datasize / opb; ++ } ++ ++ if (start_offset >= stop_offset) ++ return; ++ ++ printf (_("Contents of section %s:"), sanitize_string (section->name)); ++ if (display_file_offsets) ++ printf (_(" (Starting at file offset: 0x%lx)"), ++ (unsigned long) (section->filepos + start_offset)); ++ printf ("\n"); ++ ++ if (!bfd_get_full_section_contents (abfd, section, &data)) ++ { ++ non_fatal (_("Reading section %s failed because: %s"), ++ section->name, bfd_errmsg (bfd_get_error ())); ++ return; ++ } ++ ++ width = 4; ++ ++ bfd_sprintf_vma (abfd, buf, start_offset + section->vma); ++ if (strlen (buf) >= sizeof (buf)) ++ abort (); ++ ++ count = 0; ++ while (buf[count] == '0' && buf[count+1] != '\0') ++ count++; ++ count = strlen (buf) - count; ++ if (count > width) ++ width = count; ++ ++ bfd_sprintf_vma (abfd, buf, stop_offset + section->vma - 1); ++ if (strlen (buf) >= sizeof (buf)) ++ abort (); ++ ++ count = 0; ++ while (buf[count] == '0' && buf[count+1] != '\0') ++ count++; ++ count = strlen (buf) - count; ++ if (count > width) ++ width = count; ++ ++ for (addr_offset = start_offset; ++ addr_offset < stop_offset; addr_offset += onaline / opb) ++ { ++ bfd_size_type j; ++ ++ bfd_sprintf_vma (abfd, buf, (addr_offset + section->vma)); ++ count = strlen (buf); ++ if ((size_t) count >= sizeof (buf)) ++ abort (); ++ ++ putchar (' '); ++ while (count < width) ++ { ++ putchar ('0'); ++ count++; ++ } ++ fputs (buf + count - width, stdout); ++ putchar (' '); ++ ++ for (j = addr_offset * opb; ++ j < addr_offset * opb + onaline; j++) ++ { ++ if (j < stop_offset * opb) ++ printf ("%02x", (unsigned) (data[j])); ++ else ++ printf (" "); ++ if ((j & 3) == 3) ++ printf (" "); ++ } ++ ++ printf (" "); ++ for (j = addr_offset * opb; ++ j < addr_offset * opb + onaline; j++) ++ { ++ if (j >= stop_offset * opb) ++ printf (" "); ++ else ++ printf ("%c", ISPRINT (data[j]) ? data[j] : '.'); ++ } ++ putchar ('\n'); ++ } ++ free (data); ++} ++ ++/* Actually display the various requested regions. */ ++ ++static void ++dump_data (bfd *abfd) ++{ ++ bfd_map_over_sections (abfd, dump_section, NULL); ++} ++ ++/* Should perhaps share code and display with nm? */ ++ ++static void ++dump_symbols (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean dynamic) ++{ ++ asymbol **current; ++ long max_count; ++ long count; ++ ++ if (dynamic) ++ { ++ current = dynsyms; ++ max_count = dynsymcount; ++ printf ("DYNAMIC SYMBOL TABLE:\n"); ++ } ++ else ++ { ++ current = syms; ++ max_count = symcount; ++ printf ("SYMBOL TABLE:\n"); ++ } ++ ++ if (max_count == 0) ++ printf (_("no symbols\n")); ++ ++ for (count = 0; count < max_count; count++) ++ { ++ bfd *cur_bfd; ++ ++ if (*current == NULL) ++ printf (_("no information for symbol number %ld\n"), count); ++ ++ else if ((cur_bfd = bfd_asymbol_bfd (*current)) == NULL) ++ printf (_("could not determine the type of symbol number %ld\n"), ++ count); ++ ++ else if (process_section_p ((* current)->section) ++ && (dump_special_syms ++ || !bfd_is_target_special_symbol (cur_bfd, *current))) ++ { ++ const char *name = (*current)->name; ++ ++ if (do_demangle && name != NULL && *name != '\0') ++ { ++ char *alloc; ++ ++ /* If we want to demangle the name, we demangle it ++ here, and temporarily clobber it while calling ++ bfd_print_symbol. FIXME: This is a gross hack. */ ++ alloc = bfd_demangle (cur_bfd, name, demangle_flags); ++ if (alloc != NULL) ++ (*current)->name = alloc; ++ bfd_print_symbol (cur_bfd, stdout, *current, ++ bfd_print_symbol_all); ++ if (alloc != NULL) ++ { ++ (*current)->name = name; ++ free (alloc); ++ } ++ } ++ else ++ bfd_print_symbol (cur_bfd, stdout, *current, ++ bfd_print_symbol_all); ++ printf ("\n"); ++ } ++ ++ current++; ++ } ++ printf ("\n\n"); ++} ++ ++static void ++dump_reloc_set (bfd *abfd, asection *sec, arelent **relpp, long relcount) ++{ ++ arelent **p; ++ char *last_filename, *last_functionname; ++ unsigned int last_line; ++ unsigned int last_discriminator; ++ ++ /* Get column headers lined up reasonably. */ ++ { ++ static int width; ++ ++ if (width == 0) ++ { ++ char buf[30]; ++ ++ bfd_sprintf_vma (abfd, buf, (bfd_vma) -1); ++ width = strlen (buf) - 7; ++ } ++ printf ("OFFSET %*s TYPE %*s VALUE \n", width, "", 12, ""); ++ } ++ ++ last_filename = NULL; ++ last_functionname = NULL; ++ last_line = 0; ++ last_discriminator = 0; ++ ++ for (p = relpp; relcount && *p != NULL; p++, relcount--) ++ { ++ arelent *q = *p; ++ const char *filename, *functionname; ++ unsigned int linenumber; ++ unsigned int discriminator; ++ const char *sym_name; ++ const char *section_name; ++ bfd_vma addend2 = 0; ++ ++ if (start_address != (bfd_vma) -1 ++ && q->address < start_address) ++ continue; ++ if (stop_address != (bfd_vma) -1 ++ && q->address > stop_address) ++ continue; ++ ++ if (with_line_numbers ++ && sec != NULL ++ && bfd_find_nearest_line_discriminator (abfd, sec, syms, q->address, ++ &filename, &functionname, ++ &linenumber, &discriminator)) ++ { ++ if (functionname != NULL ++ && (last_functionname == NULL ++ || strcmp (functionname, last_functionname) != 0)) ++ { ++ printf ("%s():\n", sanitize_string (functionname)); ++ if (last_functionname != NULL) ++ free (last_functionname); ++ last_functionname = xstrdup (functionname); ++ } ++ ++ if (linenumber > 0 ++ && (linenumber != last_line ++ || (filename != NULL ++ && last_filename != NULL ++ && filename_cmp (filename, last_filename) != 0) ++ || (discriminator != last_discriminator))) ++ { ++ if (discriminator > 0) ++ printf ("%s:%u\n", filename == NULL ? "???" : ++ sanitize_string (filename), linenumber); ++ else ++ printf ("%s:%u (discriminator %u)\n", ++ filename == NULL ? "???" : sanitize_string (filename), ++ linenumber, discriminator); ++ last_line = linenumber; ++ last_discriminator = discriminator; ++ if (last_filename != NULL) ++ free (last_filename); ++ if (filename == NULL) ++ last_filename = NULL; ++ else ++ last_filename = xstrdup (filename); ++ } ++ } ++ ++ if (q->sym_ptr_ptr && *q->sym_ptr_ptr) ++ { ++ sym_name = (*(q->sym_ptr_ptr))->name; ++ section_name = (*(q->sym_ptr_ptr))->section->name; ++ } ++ else ++ { ++ sym_name = NULL; ++ section_name = NULL; ++ } ++ ++ bfd_printf_vma (abfd, q->address); ++ if (q->howto == NULL) ++ printf (" *unknown* "); ++ else if (q->howto->name) ++ { ++ const char *name = q->howto->name; ++ ++ /* R_SPARC_OLO10 relocations contain two addends. ++ But because 'arelent' lacks enough storage to ++ store them both, the 64-bit ELF Sparc backend ++ records this as two relocations. One R_SPARC_LO10 ++ and one R_SPARC_13, both pointing to the same ++ address. This is merely so that we have some ++ place to store both addend fields. ++ ++ Undo this transformation, otherwise the output ++ will be confusing. */ ++ if (abfd->xvec->flavour == bfd_target_elf_flavour ++ && elf_tdata (abfd)->elf_header->e_machine == EM_SPARCV9 ++ && relcount > 1 ++ && !strcmp (q->howto->name, "R_SPARC_LO10")) ++ { ++ arelent *q2 = *(p + 1); ++ if (q2 != NULL ++ && q2->howto ++ && q->address == q2->address ++ && !strcmp (q2->howto->name, "R_SPARC_13")) ++ { ++ name = "R_SPARC_OLO10"; ++ addend2 = q2->addend; ++ p++; ++ } ++ } ++ printf (" %-16s ", name); ++ } ++ else ++ printf (" %-16d ", q->howto->type); ++ ++ if (sym_name) ++ { ++ objdump_print_symname (abfd, NULL, *q->sym_ptr_ptr); ++ } ++ else ++ { ++ if (section_name == NULL) ++ section_name = "*unknown*"; ++ printf ("[%s]", sanitize_string (section_name)); ++ } ++ ++ if (q->addend) ++ { ++ bfd_signed_vma addend = q->addend; ++ if (addend < 0) ++ { ++ printf ("-0x"); ++ addend = -addend; ++ } ++ else ++ printf ("+0x"); ++ bfd_printf_vma (abfd, addend); ++ } ++ if (addend2) ++ { ++ printf ("+0x"); ++ bfd_printf_vma (abfd, addend2); ++ } ++ ++ printf ("\n"); ++ } ++ ++ if (last_filename != NULL) ++ free (last_filename); ++ if (last_functionname != NULL) ++ free (last_functionname); ++} ++ ++static void ++dump_relocs_in_section (bfd *abfd, ++ asection *section, ++ void *dummy ATTRIBUTE_UNUSED) ++{ ++ arelent **relpp = NULL; ++ long relcount; ++ long relsize; ++ ++ if ( bfd_is_abs_section (section) ++ || bfd_is_und_section (section) ++ || bfd_is_com_section (section) ++ || (! process_section_p (section)) ++ || ((section->flags & SEC_RELOC) == 0)) ++ return; ++ ++ printf ("RELOCATION RECORDS FOR [%s]:", sanitize_string (section->name)); ++ ++ relsize = bfd_get_reloc_upper_bound (abfd, section); ++ if (relsize == 0) ++ { ++ printf (" (none)\n\n"); ++ return; ++ } ++ ++ if (relsize < 0) ++ relcount = relsize; ++ else ++ { ++ relpp = (arelent **) xmalloc (relsize); ++ relcount = bfd_canonicalize_reloc (abfd, section, relpp, syms); ++ } ++ ++ if (relcount < 0) ++ { ++ printf ("\n"); ++ non_fatal (_("failed to read relocs in: %s"), ++ sanitize_string (bfd_get_filename (abfd))); ++ bfd_fatal (_("error message was")); ++ } ++ else if (relcount == 0) ++ printf (" (none)\n\n"); ++ else ++ { ++ printf ("\n"); ++ dump_reloc_set (abfd, section, relpp, relcount); ++ printf ("\n\n"); ++ } ++ free (relpp); ++} ++ ++static void ++dump_relocs (bfd *abfd) ++{ ++ bfd_map_over_sections (abfd, dump_relocs_in_section, NULL); ++} ++ ++static void ++dump_dynamic_relocs (bfd *abfd) ++{ ++ long relsize; ++ arelent **relpp; ++ long relcount; ++ ++ relsize = bfd_get_dynamic_reloc_upper_bound (abfd); ++ if (relsize < 0) ++ bfd_fatal (bfd_get_filename (abfd)); ++ ++ printf ("DYNAMIC RELOCATION RECORDS"); ++ ++ if (relsize == 0) ++ printf (" (none)\n\n"); ++ else ++ { ++ relpp = (arelent **) xmalloc (relsize); ++ relcount = bfd_canonicalize_dynamic_reloc (abfd, relpp, dynsyms); ++ ++ if (relcount < 0) ++ bfd_fatal (bfd_get_filename (abfd)); ++ else if (relcount == 0) ++ printf (" (none)\n\n"); ++ else ++ { ++ printf ("\n"); ++ dump_reloc_set (abfd, NULL, relpp, relcount); ++ printf ("\n\n"); ++ } ++ free (relpp); ++ } ++} ++ ++/* Creates a table of paths, to search for source files. */ ++ ++static void ++add_include_path (const char *path) ++{ ++ if (path[0] == 0) ++ return; ++ include_path_count++; ++ include_paths = (const char **) ++ xrealloc (include_paths, include_path_count * sizeof (*include_paths)); ++#ifdef HAVE_DOS_BASED_FILE_SYSTEM ++ if (path[1] == ':' && path[2] == 0) ++ path = concat (path, ".", (const char *) 0); ++#endif ++ include_paths[include_path_count - 1] = path; ++} ++ ++static void ++adjust_addresses (bfd *abfd ATTRIBUTE_UNUSED, ++ asection *section, ++ void *arg) ++{ ++ if ((section->flags & SEC_DEBUGGING) == 0) ++ { ++ bfd_boolean *has_reloc_p = (bfd_boolean *) arg; ++ section->vma += adjust_section_vma; ++ if (*has_reloc_p) ++ section->lma += adjust_section_vma; ++ } ++} ++ ++/* Return the sign-extended form of an ARCH_SIZE sized VMA. */ ++ ++static bfd_vma ++sign_extend_address (bfd *abfd ATTRIBUTE_UNUSED, ++ bfd_vma vma, ++ unsigned arch_size) ++{ ++ bfd_vma mask; ++ mask = (bfd_vma) 1 << (arch_size - 1); ++ return (((vma & ((mask << 1) - 1)) ^ mask) - mask); ++} ++ ++/* Dump selected contents of ABFD. */ ++ ++static void ++dump_bfd (bfd *abfd, bfd_boolean is_mainfile) ++{ ++ const struct elf_backend_data * bed; ++ ++ if (bfd_big_endian (abfd)) ++ byte_get = byte_get_big_endian; ++ else if (bfd_little_endian (abfd)) ++ byte_get = byte_get_little_endian; ++ else ++ byte_get = NULL; ++ ++ /* Load any separate debug information files. ++ We do this now and without checking do_follow_links because separate ++ debug info files may contain symbol tables that we will need when ++ displaying information about the main file. Any memory allocated by ++ load_separate_debug_files will be released when we call ++ free_debug_memory below. ++ ++ The test on is_mainfile is there because the chain of separate debug ++ info files is a global variable shared by all invocations of dump_bfd. */ ++ if (is_mainfile) ++ { ++ load_separate_debug_files (abfd, bfd_get_filename (abfd)); ++ ++ /* If asked to do so, recursively dump the separate files. */ ++ if (do_follow_links) ++ { ++ separate_info * i; ++ ++ for (i = first_separate_info; i != NULL; i = i->next) ++ dump_bfd (i->handle, FALSE); ++ } ++ } ++ ++ /* Adjust user-specified start and stop limits for targets that use ++ signed addresses. */ ++ if (bfd_get_flavour (abfd) == bfd_target_elf_flavour ++ && (bed = get_elf_backend_data (abfd)) != NULL ++ && bed->sign_extend_vma) ++ { ++ start_address = sign_extend_address (abfd, start_address, ++ bed->s->arch_size); ++ stop_address = sign_extend_address (abfd, stop_address, ++ bed->s->arch_size); ++ } ++ ++ /* If we are adjusting section VMA's, change them all now. Changing ++ the BFD information is a hack. However, we must do it, or ++ bfd_find_nearest_line will not do the right thing. */ ++ if (adjust_section_vma != 0) ++ { ++ bfd_boolean has_reloc = (abfd->flags & HAS_RELOC); ++ bfd_map_over_sections (abfd, adjust_addresses, &has_reloc); ++ } ++ ++ if (! dump_debugging_tags && ! suppress_bfd_header) ++ printf (_("\n%s: file format %s\n"), ++ sanitize_string (bfd_get_filename (abfd)), ++ abfd->xvec->name); ++ if (dump_ar_hdrs) ++ print_arelt_descr (stdout, abfd, TRUE, FALSE); ++ if (dump_file_header) ++ dump_bfd_header (abfd); ++ if (dump_private_headers) ++ dump_bfd_private_header (abfd); ++ if (dump_private_options != NULL) ++ dump_target_specific (abfd); ++ if (! dump_debugging_tags && ! suppress_bfd_header) ++ putchar ('\n'); ++ ++ if (dump_symtab ++ || dump_reloc_info ++ || disassemble ++ || dump_debugging ++ || dump_dwarf_section_info) ++ { ++ syms = slurp_symtab (abfd); ++ ++ /* If following links, load any symbol tables from the linked files as well. */ ++ if (do_follow_links && is_mainfile) ++ { ++ separate_info * i; ++ ++ for (i = first_separate_info; i != NULL; i = i->next) ++ { ++ asymbol ** extra_syms; ++ long old_symcount = symcount; ++ ++ extra_syms = slurp_symtab (i->handle); ++ ++ if (extra_syms) ++ { ++ if (old_symcount == 0) ++ { ++ syms = extra_syms; ++ } ++ else ++ { ++ syms = xrealloc (syms, (symcount + old_symcount) * sizeof (asymbol *)); ++ memcpy (syms + old_symcount, ++ extra_syms, ++ symcount * sizeof (asymbol *)); ++ } ++ } ++ ++ symcount += old_symcount; ++ } ++ } ++ } ++ ++ if (dump_section_headers) ++ dump_headers (abfd); ++ ++ if (dump_dynamic_symtab || dump_dynamic_reloc_info ++ || (disassemble && bfd_get_dynamic_symtab_upper_bound (abfd) > 0)) ++ dynsyms = slurp_dynamic_symtab (abfd); ++ ++ if (disassemble) ++ { ++ synthcount = bfd_get_synthetic_symtab (abfd, symcount, syms, ++ dynsymcount, dynsyms, &synthsyms); ++ if (synthcount < 0) ++ synthcount = 0; ++ } ++ ++ if (dump_symtab) ++ dump_symbols (abfd, FALSE); ++ if (dump_dynamic_symtab) ++ dump_symbols (abfd, TRUE); ++ if (dump_dwarf_section_info) ++ dump_dwarf (abfd); ++ if (dump_ctf_section_info) ++ dump_ctf (abfd, dump_ctf_section_name, dump_ctf_parent_name); ++ if (dump_stab_section_info) ++ dump_stabs (abfd); ++ if (dump_reloc_info && ! disassemble) ++ dump_relocs (abfd); ++ if (dump_dynamic_reloc_info && ! disassemble) ++ dump_dynamic_relocs (abfd); ++ if (dump_section_contents) ++ dump_data (abfd); ++ if (disassemble) ++ disassemble_data (abfd); ++ ++ if (dump_debugging) ++ { ++ void *dhandle; ++ ++ dhandle = read_debugging_info (abfd, syms, symcount, TRUE); ++ if (dhandle != NULL) ++ { ++ if (!print_debugging_info (stdout, dhandle, abfd, syms, ++ bfd_demangle, ++ dump_debugging_tags ? TRUE : FALSE)) ++ { ++ non_fatal (_("%s: printing debugging information failed"), ++ bfd_get_filename (abfd)); ++ exit_status = 1; ++ } ++ ++ free (dhandle); ++ } ++ /* PR 6483: If there was no STABS debug info in the file, try ++ DWARF instead. */ ++ else if (! dump_dwarf_section_info) ++ { ++ dwarf_select_sections_all (); ++ dump_dwarf (abfd); ++ } ++ } ++ ++ if (syms) ++ { ++ free (syms); ++ syms = NULL; ++ } ++ ++ if (dynsyms) ++ { ++ free (dynsyms); ++ dynsyms = NULL; ++ } ++ ++ if (synthsyms) ++ { ++ free (synthsyms); ++ synthsyms = NULL; ++ } ++ ++ symcount = 0; ++ dynsymcount = 0; ++ synthcount = 0; ++ ++ if (is_mainfile) ++ free_debug_memory (); ++} ++ ++static void ++display_object_bfd (bfd *abfd) ++{ ++ char **matching; ++ ++ if (bfd_check_format_matches (abfd, bfd_object, &matching)) ++ { ++ dump_bfd (abfd, TRUE); ++ return; ++ } ++ ++ if (bfd_get_error () == bfd_error_file_ambiguously_recognized) ++ { ++ nonfatal (bfd_get_filename (abfd)); ++ list_matching_formats (matching); ++ free (matching); ++ return; ++ } ++ ++ if (bfd_get_error () != bfd_error_file_not_recognized) ++ { ++ nonfatal (bfd_get_filename (abfd)); ++ return; ++ } ++ ++ if (bfd_check_format_matches (abfd, bfd_core, &matching)) ++ { ++ dump_bfd (abfd, TRUE); ++ return; ++ } ++ ++ nonfatal (bfd_get_filename (abfd)); ++ ++ if (bfd_get_error () == bfd_error_file_ambiguously_recognized) ++ { ++ list_matching_formats (matching); ++ free (matching); ++ } ++} ++ ++static void ++display_any_bfd (bfd *file, int level) ++{ ++ /* Decompress sections unless dumping the section contents. */ ++ if (!dump_section_contents) ++ file->flags |= BFD_DECOMPRESS; ++ ++ /* If the file is an archive, process all of its elements. */ ++ if (bfd_check_format (file, bfd_archive)) ++ { ++ bfd *arfile = NULL; ++ bfd *last_arfile = NULL; ++ ++ if (level == 0) ++ printf (_("In archive %s:\n"), sanitize_string (bfd_get_filename (file))); ++ else if (level > 100) ++ { ++ /* Prevent corrupted files from spinning us into an ++ infinite loop. 100 is an arbitrary heuristic. */ ++ fatal (_("Archive nesting is too deep")); ++ return; ++ } ++ else ++ printf (_("In nested archive %s:\n"), ++ sanitize_string (bfd_get_filename (file))); ++ ++ for (;;) ++ { ++ bfd_set_error (bfd_error_no_error); ++ ++ arfile = bfd_openr_next_archived_file (file, arfile); ++ if (arfile == NULL) ++ { ++ if (bfd_get_error () != bfd_error_no_more_archived_files) ++ nonfatal (bfd_get_filename (file)); ++ break; ++ } ++ ++ display_any_bfd (arfile, level + 1); ++ ++ if (last_arfile != NULL) ++ { ++ bfd_close (last_arfile); ++ /* PR 17512: file: ac585d01. */ ++ if (arfile == last_arfile) ++ { ++ last_arfile = NULL; ++ break; ++ } ++ } ++ last_arfile = arfile; ++ } ++ ++ if (last_arfile != NULL) ++ bfd_close (last_arfile); ++ } ++ else ++ display_object_bfd (file); ++} ++ ++static void ++display_file (char *filename, char *target, bfd_boolean last_file) ++{ ++ bfd *file; ++ ++ if (get_file_size (filename) < 1) ++ { ++ exit_status = 1; ++ return; ++ } ++ ++ file = bfd_openr (filename, target); ++ if (file == NULL) ++ { ++ nonfatal (filename); ++ return; ++ } ++ ++ display_any_bfd (file, 0); ++ ++ /* This is an optimization to improve the speed of objdump, especially when ++ dumping a file with lots of associated debug informatiom. Calling ++ bfd_close on such a file can take a non-trivial amount of time as there ++ are lots of lists to walk and buffers to free. This is only really ++ necessary however if we are about to load another file and we need the ++ memory back. Otherwise, if we are about to exit, then we can save (a lot ++ of) time by only doing a quick close, and allowing the OS to reclaim the ++ memory for us. */ ++ if (! last_file) ++ bfd_close (file); ++ else ++ bfd_close_all_done (file); ++} ++ ++int ++main (int argc, char **argv) ++{ ++ int c; ++ char *target = default_target; ++ bfd_boolean seenflag = FALSE; ++ ++#if defined (HAVE_SETLOCALE) ++#if defined (HAVE_LC_MESSAGES) ++ setlocale (LC_MESSAGES, ""); ++#endif ++ setlocale (LC_CTYPE, ""); ++#endif ++ ++ bindtextdomain (PACKAGE, LOCALEDIR); ++ textdomain (PACKAGE); ++ ++ program_name = *argv; ++ xmalloc_set_program_name (program_name); ++ bfd_set_error_program_name (program_name); ++ ++ START_PROGRESS (program_name, 0); ++ ++ expandargv (&argc, &argv); ++ ++ if (bfd_init () != BFD_INIT_MAGIC) ++ fatal (_("fatal error: libbfd ABI mismatch")); ++ set_default_bfd_target (); ++ ++ while ((c = getopt_long (argc, argv, ++ "pP:ib:m:M:VvCdDlfFaHhrRtTxsSI:j:wE:zgeGW::", ++ long_options, (int *) 0)) ++ != EOF) ++ { ++ switch (c) ++ { ++ case 0: ++ break; /* We've been given a long option. */ ++ case 'm': ++ machine = optarg; ++ break; ++ case 'M': ++ { ++ char *options; ++ if (disassembler_options) ++ /* Ignore potential memory leak for now. */ ++ options = concat (disassembler_options, ",", ++ optarg, (const char *) NULL); ++ else ++ options = optarg; ++ disassembler_options = remove_whitespace_and_extra_commas (options); ++ } ++ break; ++ case 'j': ++ add_only (optarg); ++ break; ++ case 'F': ++ display_file_offsets = TRUE; ++ break; ++ case 'l': ++ with_line_numbers = TRUE; ++ break; ++ case 'b': ++ target = optarg; ++ break; ++ case 'C': ++ do_demangle = TRUE; ++ if (optarg != NULL) ++ { ++ enum demangling_styles style; ++ ++ style = cplus_demangle_name_to_style (optarg); ++ if (style == unknown_demangling) ++ fatal (_("unknown demangling style `%s'"), ++ optarg); ++ ++ cplus_demangle_set_style (style); ++ } ++ break; ++ case OPTION_RECURSE_LIMIT: ++ demangle_flags &= ~ DMGL_NO_RECURSE_LIMIT; ++ break; ++ case OPTION_NO_RECURSE_LIMIT: ++ demangle_flags |= DMGL_NO_RECURSE_LIMIT; ++ break; ++ case 'w': ++ do_wide = wide_output = TRUE; ++ break; ++ case OPTION_ADJUST_VMA: ++ adjust_section_vma = parse_vma (optarg, "--adjust-vma"); ++ break; ++ case OPTION_START_ADDRESS: ++ start_address = parse_vma (optarg, "--start-address"); ++ if ((stop_address != (bfd_vma) -1) && stop_address <= start_address) ++ fatal (_("error: the start address should be before the end address")); ++ break; ++ case OPTION_STOP_ADDRESS: ++ stop_address = parse_vma (optarg, "--stop-address"); ++ if ((start_address != (bfd_vma) -1) && stop_address <= start_address) ++ fatal (_("error: the stop address should be after the start address")); ++ break; ++ case OPTION_PREFIX: ++ prefix = optarg; ++ prefix_length = strlen (prefix); ++ /* Remove an unnecessary trailing '/' */ ++ while (IS_DIR_SEPARATOR (prefix[prefix_length - 1])) ++ prefix_length--; ++ break; ++ case OPTION_PREFIX_STRIP: ++ prefix_strip = atoi (optarg); ++ if (prefix_strip < 0) ++ fatal (_("error: prefix strip must be non-negative")); ++ break; ++ case OPTION_INSN_WIDTH: ++ insn_width = strtoul (optarg, NULL, 0); ++ if (insn_width <= 0) ++ fatal (_("error: instruction width must be positive")); ++ break; ++ case OPTION_INLINES: ++ unwind_inlines = TRUE; ++ break; ++ case OPTION_VISUALIZE_JUMPS: ++ visualize_jumps = TRUE; ++ color_output = FALSE; ++ extended_color_output = FALSE; ++ if (optarg != NULL) ++ { ++ if (streq (optarg, "color")) ++ color_output = TRUE; ++ else if (streq (optarg, "extended-color")) ++ { ++ color_output = TRUE; ++ extended_color_output = TRUE; ++ } ++ else if (streq (optarg, "off")) ++ visualize_jumps = FALSE; ++ else ++ nonfatal (_("unrecognized argument to --visualize-option")); ++ } ++ break; ++ case 'E': ++ if (strcmp (optarg, "B") == 0) ++ endian = BFD_ENDIAN_BIG; ++ else if (strcmp (optarg, "L") == 0) ++ endian = BFD_ENDIAN_LITTLE; ++ else ++ { ++ nonfatal (_("unrecognized -E option")); ++ usage (stderr, 1); ++ } ++ break; ++ case OPTION_ENDIAN: ++ if (strncmp (optarg, "big", strlen (optarg)) == 0) ++ endian = BFD_ENDIAN_BIG; ++ else if (strncmp (optarg, "little", strlen (optarg)) == 0) ++ endian = BFD_ENDIAN_LITTLE; ++ else ++ { ++ non_fatal (_("unrecognized --endian type `%s'"), optarg); ++ exit_status = 1; ++ usage (stderr, 1); ++ } ++ break; ++ ++ case 'f': ++ dump_file_header = TRUE; ++ seenflag = TRUE; ++ break; ++ case 'i': ++ formats_info = TRUE; ++ seenflag = TRUE; ++ break; ++ case 'I': ++ add_include_path (optarg); ++ break; ++ case 'p': ++ dump_private_headers = TRUE; ++ seenflag = TRUE; ++ break; ++ case 'P': ++ dump_private_options = optarg; ++ seenflag = TRUE; ++ break; ++ case 'x': ++ dump_private_headers = TRUE; ++ dump_symtab = TRUE; ++ dump_reloc_info = TRUE; ++ dump_file_header = TRUE; ++ dump_ar_hdrs = TRUE; ++ dump_section_headers = TRUE; ++ seenflag = TRUE; ++ break; ++ case 't': ++ dump_symtab = TRUE; ++ seenflag = TRUE; ++ break; ++ case 'T': ++ dump_dynamic_symtab = TRUE; ++ seenflag = TRUE; ++ break; ++ case 'd': ++ disassemble = TRUE; ++ seenflag = TRUE; ++ disasm_sym = optarg; ++ break; ++ case 'z': ++ disassemble_zeroes = TRUE; ++ break; ++ case 'D': ++ disassemble = TRUE; ++ disassemble_all = TRUE; ++ seenflag = TRUE; ++ break; ++ case 'S': ++ disassemble = TRUE; ++ with_source_code = TRUE; ++ seenflag = TRUE; ++ break; ++ case OPTION_SOURCE_COMMENT: ++ disassemble = TRUE; ++ with_source_code = TRUE; ++ seenflag = TRUE; ++ if (optarg) ++ source_comment = xstrdup (sanitize_string (optarg)); ++ else ++ source_comment = xstrdup ("# "); ++ break; ++ case 'g': ++ dump_debugging = 1; ++ seenflag = TRUE; ++ break; ++ case 'e': ++ dump_debugging = 1; ++ dump_debugging_tags = 1; ++ do_demangle = TRUE; ++ seenflag = TRUE; ++ break; ++ case 'W': ++ dump_dwarf_section_info = TRUE; ++ seenflag = TRUE; ++ if (optarg) ++ dwarf_select_sections_by_letters (optarg); ++ else ++ dwarf_select_sections_all (); ++ break; ++ case OPTION_DWARF: ++ dump_dwarf_section_info = TRUE; ++ seenflag = TRUE; ++ if (optarg) ++ dwarf_select_sections_by_names (optarg); ++ else ++ dwarf_select_sections_all (); ++ break; ++ case OPTION_DWARF_DEPTH: ++ { ++ char *cp; ++ dwarf_cutoff_level = strtoul (optarg, & cp, 0); ++ } ++ break; ++ case OPTION_DWARF_START: ++ { ++ char *cp; ++ dwarf_start_die = strtoul (optarg, & cp, 0); ++ suppress_bfd_header = 1; ++ } ++ break; ++ case OPTION_DWARF_CHECK: ++ dwarf_check = TRUE; ++ break; ++#ifdef ENABLE_LIBCTF ++ case OPTION_CTF: ++ dump_ctf_section_info = TRUE; ++ dump_ctf_section_name = xstrdup (optarg); ++ seenflag = TRUE; ++ break; ++ case OPTION_CTF_PARENT: ++ dump_ctf_parent_name = xstrdup (optarg); ++ break; ++#endif ++ case 'G': ++ dump_stab_section_info = TRUE; ++ seenflag = TRUE; ++ break; ++ case 's': ++ dump_section_contents = TRUE; ++ seenflag = TRUE; ++ break; ++ case 'r': ++ dump_reloc_info = TRUE; ++ seenflag = TRUE; ++ break; ++ case 'R': ++ dump_dynamic_reloc_info = TRUE; ++ seenflag = TRUE; ++ break; ++ case 'a': ++ dump_ar_hdrs = TRUE; ++ seenflag = TRUE; ++ break; ++ case 'h': ++ dump_section_headers = TRUE; ++ seenflag = TRUE; ++ break; ++ case 'v': ++ case 'V': ++ show_version = TRUE; ++ seenflag = TRUE; ++ break; ++ ++ case 'H': ++ usage (stdout, 0); ++ /* No need to set seenflag or to break - usage() does not return. */ ++ default: ++ usage (stderr, 1); ++ } ++ } ++ ++ if (show_version) ++ print_version ("objdump"); ++ ++ if (!seenflag) ++ usage (stderr, 2); ++ ++ if (formats_info) ++ exit_status = display_info (); ++ else ++ { ++ if (optind == argc) ++ display_file ("a.out", target, TRUE); ++ else ++ for (; optind < argc;) ++ { ++ display_file (argv[optind], target, optind == argc - 1); ++ optind++; ++ } ++ } ++ ++ free_only_list (); ++ free (dump_ctf_section_name); ++ free (dump_ctf_parent_name); ++ free ((void *) source_comment); ++ ++ END_PROGRESS (program_name); ++ ++ return exit_status; ++} +diff -rupN binutils.orig/binutils/objdump.c.rej binutils-2.35.2/binutils/objdump.c.rej +--- binutils.orig/binutils/objdump.c.rej 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/objdump.c.rej 2021-11-09 16:53:50.319879263 +0000 +@@ -0,0 +1,40 @@ ++--- binutils/objdump.c 2021-11-09 12:34:21.662802941 +0000 +++++ binutils/objdump.c 2021-11-09 12:40:53.084208435 +0000 ++@@ -342,6 +354,9 @@ usage (FILE *stream, int status) ++ fprintf (stream, _("\ ++ -w, --wide Format output for more than 80 columns\n")); ++ fprintf (stream, _("\ +++ -U[d|l|i|x|e|h] Controls the display of UTF-8 unicode characters\n\ +++ --unicode=[default|locale|invalid|hex|escape|highlight]\n")); +++ fprintf (stream, _("\ ++ -z, --disassemble-zeroes Do not skip blocks of zeroes when disassembling\n")); ++ fprintf (stream, _("\ ++ --start-address=ADDR Only process data whose address is >= ADDR\n")); ++@@ -458,16 +479,23 @@ static struct option long_options[]= ++ {"full-contents", no_argument, NULL, 's'}, ++ {"headers", no_argument, NULL, 'h'}, ++ {"help", no_argument, NULL, 'H'}, +++ {"include", required_argument, NULL, 'I'}, ++ {"info", no_argument, NULL, 'i'}, +++ {"inlines", no_argument, 0, OPTION_INLINES}, +++ {"insn-width", required_argument, NULL, OPTION_INSN_WIDTH}, ++ {"line-numbers", no_argument, NULL, 'l'}, ++- {"no-show-raw-insn", no_argument, &show_raw_insn, -1}, ++ {"no-addresses", no_argument, &no_addresses, 1}, ++- {"process-links", no_argument, &process_links, true}, +++ {"no-recurse-limit", no_argument, NULL, OPTION_NO_RECURSE_LIMIT}, +++ {"no-recursion-limit", no_argument, NULL, OPTION_NO_RECURSE_LIMIT}, +++ {"no-show-raw-insn", no_argument, &show_raw_insn, -1}, +++ {"prefix", required_argument, NULL, OPTION_PREFIX}, ++ {"prefix-addresses", no_argument, &prefix_addresses, 1}, +++ {"prefix-strip", required_argument, NULL, OPTION_PREFIX_STRIP}, +++ {"private", required_argument, NULL, 'P'}, +++ {"private-headers", no_argument, NULL, 'p'}, +++ {"process-links", no_argument, &process_links, true}, ++ {"recurse-limit", no_argument, NULL, OPTION_RECURSE_LIMIT}, ++ {"recursion-limit", no_argument, NULL, OPTION_RECURSE_LIMIT}, ++- {"no-recurse-limit", no_argument, NULL, OPTION_NO_RECURSE_LIMIT}, ++- {"no-recursion-limit", no_argument, NULL, OPTION_NO_RECURSE_LIMIT}, ++ {"reloc", no_argument, NULL, 'r'}, ++ {"section", required_argument, NULL, 'j'}, ++ {"section-headers", no_argument, NULL, 'h'}, +diff -rupN binutils.orig/binutils/readelf.c binutils-2.35.2/binutils/readelf.c +--- binutils.orig/binutils/readelf.c 2021-11-09 16:53:12.814128300 +0000 ++++ binutils-2.35.2/binutils/readelf.c 2021-11-09 17:31:31.490966752 +0000 +@@ -317,6 +317,19 @@ typedef enum print_mode + } + print_mode; + ++typedef enum unicode_display_type ++{ ++ unicode_default = 0, ++ unicode_locale, ++ unicode_escape, ++ unicode_hex, ++ unicode_highlight, ++ unicode_invalid ++} unicode_display_type; ++ ++static unicode_display_type unicode_display = unicode_default; ++ ++ + /* Versioned symbol info. */ + enum versioned_symbol_info + { +@@ -592,11 +605,18 @@ print_symbol (signed int width, const ch + if (c == 0) + break; + +- /* Do not print control characters directly as they can affect terminal +- settings. Such characters usually appear in the names generated +- by the assembler for local labels. */ +- if (ISCNTRL (c)) ++ if (ISPRINT (c)) ++ { ++ putchar (c); ++ width_remaining --; ++ num_printed ++; ++ } ++ else if (ISCNTRL (c)) + { ++ /* Do not print control characters directly as they can affect terminal ++ settings. Such characters usually appear in the names generated ++ by the assembler for local labels. */ ++ + if (width_remaining < 2) + break; + +@@ -604,11 +624,137 @@ print_symbol (signed int width, const ch + width_remaining -= 2; + num_printed += 2; + } +- else if (ISPRINT (c)) ++ else if (c == 0x7f) + { +- putchar (c); +- width_remaining --; +- num_printed ++; ++ if (width_remaining < 5) ++ break; ++ printf (""); ++ width_remaining -= 5; ++ num_printed += 5; ++ } ++ else if (unicode_display != unicode_locale ++ && unicode_display != unicode_default) ++ { ++ /* Display unicode characters as something else. */ ++ unsigned char bytes[4]; ++ bfd_boolean is_utf8; ++ uint nbytes; ++ ++ bytes[0] = c; ++ ++ if (bytes[0] < 0xc0) ++ { ++ nbytes = 1; ++ is_utf8 = FALSE; ++ } ++ else ++ { ++ bytes[1] = *symbol++; ++ ++ if ((bytes[1] & 0xc0) != 0x80) ++ { ++ is_utf8 = FALSE; ++ /* Do not consume this character. It may only ++ be the first byte in the sequence that was ++ corrupt. */ ++ --symbol; ++ nbytes = 1; ++ } ++ else if ((bytes[0] & 0x20) == 0) ++ { ++ is_utf8 = TRUE; ++ nbytes = 2; ++ } ++ else ++ { ++ bytes[2] = *symbol++; ++ ++ if ((bytes[2] & 0xc0) != 0x80) ++ { ++ is_utf8 = FALSE; ++ symbol -= 2; ++ nbytes = 1; ++ } ++ else if ((bytes[0] & 0x10) == 0) ++ { ++ is_utf8 = TRUE; ++ nbytes = 3; ++ } ++ else ++ { ++ bytes[3] = *symbol++; ++ ++ nbytes = 4; ++ ++ if ((bytes[3] & 0xc0) != 0x80) ++ { ++ is_utf8 = FALSE; ++ symbol -= 3; ++ nbytes = 1; ++ } ++ else ++ is_utf8 = TRUE; ++ } ++ } ++ } ++ ++ if (unicode_display == unicode_invalid) ++ is_utf8 = FALSE; ++ ++ if (unicode_display == unicode_hex || ! is_utf8) ++ { ++ uint i; ++ ++ if (width_remaining < (nbytes * 2) + 2) ++ break; ++ ++ putchar (is_utf8 ? '<' : '{'); ++ printf ("0x"); ++ for (i = 0; i < nbytes; i++) ++ printf ("%02x", bytes[i]); ++ putchar (is_utf8 ? '>' : '}'); ++ } ++ else ++ { ++ if (unicode_display == unicode_highlight && isatty (1)) ++ printf ("\x1B[31;47m"); /* Red. */ ++ ++ switch (nbytes) ++ { ++ case 2: ++ if (width_remaining < 6) ++ break; ++ printf ("\\u%02x%02x", ++ (bytes[0] & 0x1c) >> 2, ++ ((bytes[0] & 0x03) << 6) | (bytes[1] & 0x3f)); ++ break; ++ case 3: ++ if (width_remaining < 6) ++ break; ++ printf ("\\u%02x%02x", ++ ((bytes[0] & 0x0f) << 4) | ((bytes[1] & 0x3c) >> 2), ++ ((bytes[1] & 0x03) << 6) | (bytes[2] & 0x3f)); ++ break; ++ case 4: ++ if (width_remaining < 8) ++ break; ++ printf ("\\u%02x%02x%02x", ++ ((bytes[0] & 0x07) << 6) | ((bytes[1] & 0x3c) >> 2), ++ ((bytes[1] & 0x03) << 6) | ((bytes[2] & 0x3c) >> 2), ++ ((bytes[2] & 0x03) << 6) | (bytes[3] & 0x3f)); ++ ++ break; ++ default: ++ /* URG. */ ++ break; ++ } ++ ++ if (unicode_display == unicode_highlight && isatty (1)) ++ printf ("\033[0m"); /* Default colour. */ ++ } ++ ++ if (bytes[nbytes - 1] == 0) ++ break; + } + else + { +@@ -4510,6 +4656,7 @@ static struct option options[] = + {"hex-dump", required_argument, 0, 'x'}, + {"relocated-dump", required_argument, 0, 'R'}, + {"string-dump", required_argument, 0, 'p'}, ++ {"unicode", required_argument, NULL, 'U'}, + {"decompress", no_argument, 0, 'z'}, + #ifdef SUPPORT_DISASSEMBLY + {"instruction-dump", required_argument, 0, 'i'}, +@@ -4569,6 +4716,11 @@ usage (FILE * stream) + -R --relocated-dump=\n\ + Dump the contents of section as relocated bytes\n\ + -z --decompress Decompress section before dumping it\n\ ++ -U[dlexhi] --unicode=[default|locale|escape|hex|highlight|invalid]\n\ ++ Display unicode characters as determined by the current locale\n\ ++ (default), escape sequences, \"\", highlighted\n\ ++ escape sequences, or treat them as invalid and display as\n\ ++ \"{hex sequences}\"\n\ + -w[lLiaprmfFsoORtUuTgAckK] or\n\ + --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,\n\ + =frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,\n\ +@@ -4855,6 +5007,26 @@ parse_args (struct dump_data *dumpdata, + case 'T': + do_not_show_symbol_truncation = TRUE; + break; ++ ++ case 'U': ++ if (optarg == NULL) ++ error (_("Missing arg to -U/--unicode")); /* Can this happen ? */ ++ else if (streq (optarg, "default") || streq (optarg, "d")) ++ unicode_display = unicode_default; ++ else if (streq (optarg, "locale") || streq (optarg, "l")) ++ unicode_display = unicode_locale; ++ else if (streq (optarg, "escape") || streq (optarg, "e")) ++ unicode_display = unicode_escape; ++ else if (streq (optarg, "invalid") || streq (optarg, "i")) ++ unicode_display = unicode_invalid; ++ else if (streq (optarg, "hex") || streq (optarg, "x")) ++ unicode_display = unicode_hex; ++ else if (streq (optarg, "highlight") || streq (optarg, "h")) ++ unicode_display = unicode_highlight; ++ else ++ error (_("invalid argument to -U/--unicode: %s"), optarg); ++ break; ++ + default: + /* xgettext:c-format */ + error (_("Invalid option '-%c'\n"), c); +diff -rupN binutils.orig/binutils/readelf.c.orig binutils-2.35.2/binutils/readelf.c.orig +--- binutils.orig/binutils/readelf.c.orig 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/readelf.c.orig 2021-11-09 16:52:55.349244269 +0000 +@@ -0,0 +1,20904 @@ ++/* readelf.c -- display contents of an ELF format file ++ Copyright (C) 1998-2020 Free Software Foundation, Inc. ++ ++ Originally developed by Eric Youngdale ++ Modifications by Nick Clifton ++ ++ This file is part of GNU Binutils. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA ++ 02110-1301, USA. */ ++ ++/* The difference between readelf and objdump: ++ ++ Both programs are capable of displaying the contents of ELF format files, ++ so why does the binutils project have two file dumpers ? ++ ++ The reason is that objdump sees an ELF file through a BFD filter of the ++ world; if BFD has a bug where, say, it disagrees about a machine constant ++ in e_flags, then the odds are good that it will remain internally ++ consistent. The linker sees it the BFD way, objdump sees it the BFD way, ++ GAS sees it the BFD way. There was need for a tool to go find out what ++ the file actually says. ++ ++ This is why the readelf program does not link against the BFD library - it ++ exists as an independent program to help verify the correct working of BFD. ++ ++ There is also the case that readelf can provide more information about an ++ ELF file than is provided by objdump. In particular it can display DWARF ++ debugging information which (at the moment) objdump cannot. */ ++ ++#include "sysdep.h" ++#include ++#include ++#include ++#ifdef HAVE_WCHAR_H ++#include ++#endif ++ ++#if __GNUC__ >= 2 ++/* Define BFD64 here, even if our default architecture is 32 bit ELF ++ as this will allow us to read in and parse 64bit and 32bit ELF files. ++ Only do this if we believe that the compiler can support a 64 bit ++ data type. For now we only rely on GCC being able to do this. */ ++#define BFD64 ++#endif ++ ++#include "bfd.h" ++#include "bucomm.h" ++#include "elfcomm.h" ++#include "dwarf.h" ++#include "ctf-api.h" ++ ++#include "elf/common.h" ++#include "elf/external.h" ++#include "elf/internal.h" ++ ++ ++/* Included here, before RELOC_MACROS_GEN_FUNC is defined, so that ++ we can obtain the H8 reloc numbers. We need these for the ++ get_reloc_size() function. We include h8.h again after defining ++ RELOC_MACROS_GEN_FUNC so that we get the naming function as well. */ ++ ++#include "elf/h8.h" ++#undef _ELF_H8_H ++ ++/* Undo the effects of #including reloc-macros.h. */ ++ ++#undef START_RELOC_NUMBERS ++#undef RELOC_NUMBER ++#undef FAKE_RELOC ++#undef EMPTY_RELOC ++#undef END_RELOC_NUMBERS ++#undef _RELOC_MACROS_H ++ ++/* The following headers use the elf/reloc-macros.h file to ++ automatically generate relocation recognition functions ++ such as elf_mips_reloc_type() */ ++ ++#define RELOC_MACROS_GEN_FUNC ++ ++#include "elf/aarch64.h" ++#include "elf/alpha.h" ++#include "elf/arc.h" ++#include "elf/arm.h" ++#include "elf/avr.h" ++#include "elf/bfin.h" ++#include "elf/cr16.h" ++#include "elf/cris.h" ++#include "elf/crx.h" ++#include "elf/csky.h" ++#include "elf/d10v.h" ++#include "elf/d30v.h" ++#include "elf/dlx.h" ++#include "elf/bpf.h" ++#include "elf/epiphany.h" ++#include "elf/fr30.h" ++#include "elf/frv.h" ++#include "elf/ft32.h" ++#include "elf/h8.h" ++#include "elf/hppa.h" ++#include "elf/i386.h" ++#include "elf/i370.h" ++#include "elf/i860.h" ++#include "elf/i960.h" ++#include "elf/ia64.h" ++#include "elf/ip2k.h" ++#include "elf/lm32.h" ++#include "elf/iq2000.h" ++#include "elf/m32c.h" ++#include "elf/m32r.h" ++#include "elf/m68k.h" ++#include "elf/m68hc11.h" ++#include "elf/s12z.h" ++#include "elf/mcore.h" ++#include "elf/mep.h" ++#include "elf/metag.h" ++#include "elf/microblaze.h" ++#include "elf/mips.h" ++#include "elf/mmix.h" ++#include "elf/mn10200.h" ++#include "elf/mn10300.h" ++#include "elf/moxie.h" ++#include "elf/mt.h" ++#include "elf/msp430.h" ++#include "elf/nds32.h" ++#include "elf/nfp.h" ++#include "elf/nios2.h" ++#include "elf/or1k.h" ++#include "elf/pj.h" ++#include "elf/ppc.h" ++#include "elf/ppc64.h" ++#include "elf/pru.h" ++#include "elf/riscv.h" ++#include "elf/rl78.h" ++#include "elf/rx.h" ++#include "elf/s390.h" ++#include "elf/score.h" ++#include "elf/sh.h" ++#include "elf/sparc.h" ++#include "elf/spu.h" ++#include "elf/tic6x.h" ++#include "elf/tilegx.h" ++#include "elf/tilepro.h" ++#include "elf/v850.h" ++#include "elf/vax.h" ++#include "elf/visium.h" ++#include "elf/wasm32.h" ++#include "elf/x86-64.h" ++#include "elf/xc16x.h" ++#include "elf/xgate.h" ++#include "elf/xstormy16.h" ++#include "elf/xtensa.h" ++#include "elf/z80.h" ++ ++#include "getopt.h" ++#include "libiberty.h" ++#include "safe-ctype.h" ++#include "filenames.h" ++ ++#ifndef offsetof ++#define offsetof(TYPE, MEMBER) ((size_t) &(((TYPE *) 0)->MEMBER)) ++#endif ++ ++typedef struct elf_section_list ++{ ++ Elf_Internal_Shdr * hdr; ++ struct elf_section_list * next; ++} elf_section_list; ++ ++/* Flag bits indicating particular types of dump. */ ++#define HEX_DUMP (1 << 0) /* The -x command line switch. */ ++#define DISASS_DUMP (1 << 1) /* The -i command line switch. */ ++#define DEBUG_DUMP (1 << 2) /* The -w command line switch. */ ++#define STRING_DUMP (1 << 3) /* The -p command line switch. */ ++#define RELOC_DUMP (1 << 4) /* The -R command line switch. */ ++#define CTF_DUMP (1 << 5) /* The --ctf command line switch. */ ++ ++typedef unsigned char dump_type; ++ ++/* A linked list of the section names for which dumps were requested. */ ++struct dump_list_entry ++{ ++ char * name; ++ dump_type type; ++ struct dump_list_entry * next; ++}; ++ ++/* A dynamic array of flags indicating for which sections a dump ++ has been requested via command line switches. */ ++struct dump_data ++{ ++ dump_type * dump_sects; ++ unsigned int num_dump_sects; ++}; ++ ++static struct dump_data cmdline; ++ ++static struct dump_list_entry * dump_sects_byname; ++ ++char * program_name = "readelf"; ++ ++static bfd_boolean show_name = FALSE; ++static bfd_boolean do_dynamic = FALSE; ++static bfd_boolean do_syms = FALSE; ++static bfd_boolean do_dyn_syms = FALSE; ++static bfd_boolean do_reloc = FALSE; ++static bfd_boolean do_sections = FALSE; ++static bfd_boolean do_section_groups = FALSE; ++static bfd_boolean do_section_details = FALSE; ++static bfd_boolean do_segments = FALSE; ++static bfd_boolean do_unwind = FALSE; ++static bfd_boolean do_using_dynamic = FALSE; ++static bfd_boolean do_header = FALSE; ++static bfd_boolean do_dump = FALSE; ++static bfd_boolean do_version = FALSE; ++static bfd_boolean do_histogram = FALSE; ++static bfd_boolean do_debugging = FALSE; ++static bfd_boolean do_ctf = FALSE; ++static bfd_boolean do_arch = FALSE; ++static bfd_boolean do_notes = FALSE; ++static bfd_boolean do_archive_index = FALSE; ++static bfd_boolean check_all = FALSE; ++static bfd_boolean is_32bit_elf = FALSE; ++static bfd_boolean decompress_dumps = FALSE; ++static bfd_boolean do_not_show_symbol_truncation = FALSE; ++ ++static char *dump_ctf_parent_name; ++static char *dump_ctf_symtab_name; ++static char *dump_ctf_strtab_name; ++ ++struct group_list ++{ ++ struct group_list * next; ++ unsigned int section_index; ++}; ++ ++struct group ++{ ++ struct group_list * root; ++ unsigned int group_index; ++}; ++ ++typedef struct filedata ++{ ++ const char * file_name; ++ FILE * handle; ++ bfd_size_type file_size; ++ Elf_Internal_Ehdr file_header; ++ Elf_Internal_Shdr * section_headers; ++ Elf_Internal_Phdr * program_headers; ++ char * string_table; ++ unsigned long string_table_length; ++ unsigned long archive_file_offset; ++ unsigned long archive_file_size; ++ unsigned long dynamic_addr; ++ bfd_size_type dynamic_size; ++ size_t dynamic_nent; ++ Elf_Internal_Dyn * dynamic_section; ++ Elf_Internal_Shdr * dynamic_strtab_section; ++ char * dynamic_strings; ++ unsigned long dynamic_strings_length; ++ Elf_Internal_Shdr * dynamic_symtab_section; ++ unsigned long num_dynamic_syms; ++ Elf_Internal_Sym * dynamic_symbols; ++ bfd_vma version_info[16]; ++ unsigned int dynamic_syminfo_nent; ++ Elf_Internal_Syminfo * dynamic_syminfo; ++ unsigned long dynamic_syminfo_offset; ++ bfd_size_type nbuckets; ++ bfd_size_type nchains; ++ bfd_vma * buckets; ++ bfd_vma * chains; ++ bfd_size_type ngnubuckets; ++ bfd_size_type ngnuchains; ++ bfd_vma * gnubuckets; ++ bfd_vma * gnuchains; ++ bfd_vma * mipsxlat; ++ bfd_vma gnusymidx; ++ char program_interpreter[PATH_MAX]; ++ bfd_vma dynamic_info[DT_ENCODING]; ++ bfd_vma dynamic_info_DT_GNU_HASH; ++ bfd_vma dynamic_info_DT_MIPS_XHASH; ++ elf_section_list * symtab_shndx_list; ++ size_t group_count; ++ struct group * section_groups; ++ struct group ** section_headers_groups; ++ /* A dynamic array of flags indicating for which sections a dump of ++ some kind has been requested. It is reset on a per-object file ++ basis and then initialised from the cmdline_dump_sects array, ++ the results of interpreting the -w switch, and the ++ dump_sects_byname list. */ ++ struct dump_data dump; ++} Filedata; ++ ++/* How to print a vma value. */ ++typedef enum print_mode ++{ ++ HEX, ++ DEC, ++ DEC_5, ++ UNSIGNED, ++ PREFIX_HEX, ++ FULL_HEX, ++ LONG_HEX ++} ++print_mode; ++ ++/* Versioned symbol info. */ ++enum versioned_symbol_info ++{ ++ symbol_undefined, ++ symbol_hidden, ++ symbol_public ++}; ++ ++static const char * get_symbol_version_string ++ (Filedata *, bfd_boolean, const char *, unsigned long, unsigned, ++ Elf_Internal_Sym *, enum versioned_symbol_info *, unsigned short *); ++ ++#define UNKNOWN -1 ++ ++#define SECTION_NAME(X) \ ++ ((X) == NULL ? _("") \ ++ : filedata->string_table == NULL ? _("") \ ++ : ((X)->sh_name >= filedata->string_table_length ? _("") \ ++ : filedata->string_table + (X)->sh_name)) ++ ++#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */ ++ ++#define GET_ELF_SYMBOLS(file, section, sym_count) \ ++ (is_32bit_elf ? get_32bit_elf_symbols (file, section, sym_count) \ ++ : get_64bit_elf_symbols (file, section, sym_count)) ++ ++#define VALID_SYMBOL_NAME(strtab, strtab_size, offset) \ ++ (strtab != NULL && offset < strtab_size) ++#define VALID_DYNAMIC_NAME(filedata, offset) \ ++ VALID_SYMBOL_NAME (filedata->dynamic_strings, \ ++ filedata->dynamic_strings_length, offset) ++/* GET_DYNAMIC_NAME asssumes that VALID_DYNAMIC_NAME has ++ already been called and verified that the string exists. */ ++#define GET_DYNAMIC_NAME(filedata, offset) \ ++ (filedata->dynamic_strings + offset) ++ ++#define REMOVE_ARCH_BITS(ADDR) \ ++ do \ ++ { \ ++ if (filedata->file_header.e_machine == EM_ARM) \ ++ (ADDR) &= ~1; \ ++ } \ ++ while (0) ++ ++/* Get the correct GNU hash section name. */ ++#define GNU_HASH_SECTION_NAME(filedata) \ ++ filedata->dynamic_info_DT_MIPS_XHASH ? ".MIPS.xhash" : ".gnu.hash" ++ ++/* Print a BFD_VMA to an internal buffer, for use in error messages. ++ BFD_FMA_FMT can't be used in translated strings. */ ++ ++static const char * ++bfd_vmatoa (char *fmtch, bfd_vma value) ++{ ++ /* bfd_vmatoa is used more then once in a printf call for output. ++ Cycle through an array of buffers. */ ++ static int buf_pos = 0; ++ static struct bfd_vmatoa_buf ++ { ++ char place[64]; ++ } buf[4]; ++ char *ret; ++ char fmt[32]; ++ ++ ret = buf[buf_pos++].place; ++ buf_pos %= ARRAY_SIZE (buf); ++ ++ sprintf (fmt, "%%%s%s", BFD_VMA_FMT, fmtch); ++ snprintf (ret, sizeof (buf[0].place), fmt, value); ++ return ret; ++} ++ ++/* Retrieve NMEMB structures, each SIZE bytes long from FILEDATA starting at ++ OFFSET + the offset of the current archive member, if we are examining an ++ archive. Put the retrieved data into VAR, if it is not NULL. Otherwise ++ allocate a buffer using malloc and fill that. In either case return the ++ pointer to the start of the retrieved data or NULL if something went wrong. ++ If something does go wrong and REASON is not NULL then emit an error ++ message using REASON as part of the context. */ ++ ++static void * ++get_data (void * var, ++ Filedata * filedata, ++ unsigned long offset, ++ bfd_size_type size, ++ bfd_size_type nmemb, ++ const char * reason) ++{ ++ void * mvar; ++ bfd_size_type amt = size * nmemb; ++ ++ if (size == 0 || nmemb == 0) ++ return NULL; ++ ++ /* If the size_t type is smaller than the bfd_size_type, eg because ++ you are building a 32-bit tool on a 64-bit host, then make sure ++ that when the sizes are cast to (size_t) no information is lost. */ ++ if ((size_t) size != size ++ || (size_t) nmemb != nmemb ++ || (size_t) amt != amt) ++ { ++ if (reason) ++ error (_("Size truncation prevents reading %s" ++ " elements of size %s for %s\n"), ++ bfd_vmatoa ("u", nmemb), bfd_vmatoa ("u", size), reason); ++ return NULL; ++ } ++ ++ /* Check for size overflow. */ ++ if (amt / size != nmemb || (size_t) amt + 1 == 0) ++ { ++ if (reason) ++ error (_("Size overflow prevents reading %s" ++ " elements of size %s for %s\n"), ++ bfd_vmatoa ("u", nmemb), bfd_vmatoa ("u", size), reason); ++ return NULL; ++ } ++ ++ /* Be kind to memory checkers (eg valgrind, address sanitizer) by not ++ attempting to allocate memory when the read is bound to fail. */ ++ if (filedata->archive_file_offset > filedata->file_size ++ || offset > filedata->file_size - filedata->archive_file_offset ++ || amt > filedata->file_size - filedata->archive_file_offset - offset) ++ { ++ if (reason) ++ error (_("Reading %s bytes extends past end of file for %s\n"), ++ bfd_vmatoa ("u", amt), reason); ++ return NULL; ++ } ++ ++ if (fseek (filedata->handle, filedata->archive_file_offset + offset, ++ SEEK_SET)) ++ { ++ if (reason) ++ error (_("Unable to seek to 0x%lx for %s\n"), ++ filedata->archive_file_offset + offset, reason); ++ return NULL; ++ } ++ ++ mvar = var; ++ if (mvar == NULL) ++ { ++ /* + 1 so that we can '\0' terminate invalid string table sections. */ ++ mvar = malloc ((size_t) amt + 1); ++ ++ if (mvar == NULL) ++ { ++ if (reason) ++ error (_("Out of memory allocating %s bytes for %s\n"), ++ bfd_vmatoa ("u", amt), reason); ++ return NULL; ++ } ++ ++ ((char *) mvar)[amt] = '\0'; ++ } ++ ++ if (fread (mvar, (size_t) size, (size_t) nmemb, filedata->handle) != nmemb) ++ { ++ if (reason) ++ error (_("Unable to read in %s bytes of %s\n"), ++ bfd_vmatoa ("u", amt), reason); ++ if (mvar != var) ++ free (mvar); ++ return NULL; ++ } ++ ++ return mvar; ++} ++ ++/* Print a VMA value in the MODE specified. ++ Returns the number of characters displayed. */ ++ ++static unsigned int ++print_vma (bfd_vma vma, print_mode mode) ++{ ++ unsigned int nc = 0; ++ ++ switch (mode) ++ { ++ case FULL_HEX: ++ nc = printf ("0x"); ++ /* Fall through. */ ++ case LONG_HEX: ++#ifdef BFD64 ++ if (is_32bit_elf) ++ return nc + printf ("%8.8" BFD_VMA_FMT "x", vma); ++#endif ++ printf_vma (vma); ++ return nc + 16; ++ ++ case DEC_5: ++ if (vma <= 99999) ++ return printf ("%5" BFD_VMA_FMT "d", vma); ++ /* Fall through. */ ++ case PREFIX_HEX: ++ nc = printf ("0x"); ++ /* Fall through. */ ++ case HEX: ++ return nc + printf ("%" BFD_VMA_FMT "x", vma); ++ ++ case DEC: ++ return printf ("%" BFD_VMA_FMT "d", vma); ++ ++ case UNSIGNED: ++ return printf ("%" BFD_VMA_FMT "u", vma); ++ ++ default: ++ /* FIXME: Report unrecognised mode ? */ ++ return 0; ++ } ++} ++ ++/* Display a symbol on stdout. Handles the display of control characters and ++ multibye characters (assuming the host environment supports them). ++ ++ Display at most abs(WIDTH) characters, truncating as necessary, unless do_wide is true. ++ ++ If truncation will happen and do_not_show_symbol_truncation is FALSE then display ++ abs(WIDTH) - 5 characters followed by "[...]". ++ ++ If WIDTH is negative then ensure that the output is at least (- WIDTH) characters, ++ padding as necessary. ++ ++ Returns the number of emitted characters. */ ++ ++static unsigned int ++print_symbol (signed int width, const char * symbol) ++{ ++ bfd_boolean extra_padding = FALSE; ++ bfd_boolean do_dots = FALSE; ++ signed int num_printed = 0; ++#ifdef HAVE_MBSTATE_T ++ mbstate_t state; ++#endif ++ unsigned int width_remaining; ++ ++ if (width < 0) ++ { ++ /* Keep the width positive. This helps the code below. */ ++ width = - width; ++ extra_padding = TRUE; ++ } ++ else if (width == 0) ++ return 0; ++ ++ if (do_wide) ++ /* Set the remaining width to a very large value. ++ This simplifies the code below. */ ++ width_remaining = INT_MAX; ++ else ++ { ++ width_remaining = width; ++ if (! do_not_show_symbol_truncation ++ && (int) strlen (symbol) > width) ++ { ++ width_remaining -= 5; ++ if ((int) width_remaining < 0) ++ width_remaining = 0; ++ do_dots = TRUE; ++ } ++ } ++ ++#ifdef HAVE_MBSTATE_T ++ /* Initialise the multibyte conversion state. */ ++ memset (& state, 0, sizeof (state)); ++#endif ++ ++ while (width_remaining) ++ { ++ size_t n; ++ const char c = *symbol++; ++ ++ if (c == 0) ++ break; ++ ++ /* Do not print control characters directly as they can affect terminal ++ settings. Such characters usually appear in the names generated ++ by the assembler for local labels. */ ++ if (ISCNTRL (c)) ++ { ++ if (width_remaining < 2) ++ break; ++ ++ printf ("^%c", c + 0x40); ++ width_remaining -= 2; ++ num_printed += 2; ++ } ++ else if (ISPRINT (c)) ++ { ++ putchar (c); ++ width_remaining --; ++ num_printed ++; ++ } ++ else ++ { ++#ifdef HAVE_MBSTATE_T ++ wchar_t w; ++#endif ++ /* Let printf do the hard work of displaying multibyte characters. */ ++ printf ("%.1s", symbol - 1); ++ width_remaining --; ++ num_printed ++; ++ ++#ifdef HAVE_MBSTATE_T ++ /* Try to find out how many bytes made up the character that was ++ just printed. Advance the symbol pointer past the bytes that ++ were displayed. */ ++ n = mbrtowc (& w, symbol - 1, MB_CUR_MAX, & state); ++#else ++ n = 1; ++#endif ++ if (n != (size_t) -1 && n != (size_t) -2 && n > 0) ++ symbol += (n - 1); ++ } ++ } ++ ++ if (do_dots) ++ num_printed += printf ("[...]"); ++ ++ if (extra_padding && num_printed < width) ++ { ++ /* Fill in the remaining spaces. */ ++ printf ("%-*s", width - num_printed, " "); ++ num_printed = width; ++ } ++ ++ return num_printed; ++} ++ ++/* Returns a pointer to a static buffer containing a printable version of ++ the given section's name. Like print_symbol, except that it does not try ++ to print multibyte characters, it just interprets them as hex values. */ ++ ++static const char * ++printable_section_name (Filedata * filedata, const Elf_Internal_Shdr * sec) ++{ ++#define MAX_PRINT_SEC_NAME_LEN 128 ++ static char sec_name_buf [MAX_PRINT_SEC_NAME_LEN + 1]; ++ const char * name = SECTION_NAME (sec); ++ char * buf = sec_name_buf; ++ char c; ++ unsigned int remaining = MAX_PRINT_SEC_NAME_LEN; ++ ++ while ((c = * name ++) != 0) ++ { ++ if (ISCNTRL (c)) ++ { ++ if (remaining < 2) ++ break; ++ ++ * buf ++ = '^'; ++ * buf ++ = c + 0x40; ++ remaining -= 2; ++ } ++ else if (ISPRINT (c)) ++ { ++ * buf ++ = c; ++ remaining -= 1; ++ } ++ else ++ { ++ static char hex[17] = "0123456789ABCDEF"; ++ ++ if (remaining < 4) ++ break; ++ * buf ++ = '<'; ++ * buf ++ = hex[(c & 0xf0) >> 4]; ++ * buf ++ = hex[c & 0x0f]; ++ * buf ++ = '>'; ++ remaining -= 4; ++ } ++ ++ if (remaining == 0) ++ break; ++ } ++ ++ * buf = 0; ++ return sec_name_buf; ++} ++ ++static const char * ++printable_section_name_from_index (Filedata * filedata, unsigned long ndx) ++{ ++ if (ndx >= filedata->file_header.e_shnum) ++ return _(""); ++ ++ return printable_section_name (filedata, filedata->section_headers + ndx); ++} ++ ++/* Return a pointer to section NAME, or NULL if no such section exists. */ ++ ++static Elf_Internal_Shdr * ++find_section (Filedata * filedata, const char * name) ++{ ++ unsigned int i; ++ ++ if (filedata->section_headers == NULL) ++ return NULL; ++ ++ for (i = 0; i < filedata->file_header.e_shnum; i++) ++ if (streq (SECTION_NAME (filedata->section_headers + i), name)) ++ return filedata->section_headers + i; ++ ++ return NULL; ++} ++ ++/* Return a pointer to a section containing ADDR, or NULL if no such ++ section exists. */ ++ ++static Elf_Internal_Shdr * ++find_section_by_address (Filedata * filedata, bfd_vma addr) ++{ ++ unsigned int i; ++ ++ if (filedata->section_headers == NULL) ++ return NULL; ++ ++ for (i = 0; i < filedata->file_header.e_shnum; i++) ++ { ++ Elf_Internal_Shdr *sec = filedata->section_headers + i; ++ ++ if (addr >= sec->sh_addr && addr < sec->sh_addr + sec->sh_size) ++ return sec; ++ } ++ ++ return NULL; ++} ++ ++static Elf_Internal_Shdr * ++find_section_by_type (Filedata * filedata, unsigned int type) ++{ ++ unsigned int i; ++ ++ if (filedata->section_headers == NULL) ++ return NULL; ++ ++ for (i = 0; i < filedata->file_header.e_shnum; i++) ++ { ++ Elf_Internal_Shdr *sec = filedata->section_headers + i; ++ ++ if (sec->sh_type == type) ++ return sec; ++ } ++ ++ return NULL; ++} ++ ++/* Return a pointer to section NAME, or NULL if no such section exists, ++ restricted to the list of sections given in SET. */ ++ ++static Elf_Internal_Shdr * ++find_section_in_set (Filedata * filedata, const char * name, unsigned int * set) ++{ ++ unsigned int i; ++ ++ if (filedata->section_headers == NULL) ++ return NULL; ++ ++ if (set != NULL) ++ { ++ while ((i = *set++) > 0) ++ { ++ /* See PR 21156 for a reproducer. */ ++ if (i >= filedata->file_header.e_shnum) ++ continue; /* FIXME: Should we issue an error message ? */ ++ ++ if (streq (SECTION_NAME (filedata->section_headers + i), name)) ++ return filedata->section_headers + i; ++ } ++ } ++ ++ return find_section (filedata, name); ++} ++ ++/* Return TRUE if the current file is for IA-64 machine and OpenVMS ABI. ++ This OS has so many departures from the ELF standard that we test it at ++ many places. */ ++ ++static inline bfd_boolean ++is_ia64_vms (Filedata * filedata) ++{ ++ return filedata->file_header.e_machine == EM_IA_64 ++ && filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_OPENVMS; ++} ++ ++/* Guess the relocation size commonly used by the specific machines. */ ++ ++static bfd_boolean ++guess_is_rela (unsigned int e_machine) ++{ ++ switch (e_machine) ++ { ++ /* Targets that use REL relocations. */ ++ case EM_386: ++ case EM_IAMCU: ++ case EM_960: ++ case EM_ARM: ++ case EM_D10V: ++ case EM_CYGNUS_D10V: ++ case EM_DLX: ++ case EM_MIPS: ++ case EM_MIPS_RS3_LE: ++ case EM_CYGNUS_M32R: ++ case EM_SCORE: ++ case EM_XGATE: ++ case EM_NFP: ++ case EM_BPF: ++ return FALSE; ++ ++ /* Targets that use RELA relocations. */ ++ case EM_68K: ++ case EM_860: ++ case EM_AARCH64: ++ case EM_ADAPTEVA_EPIPHANY: ++ case EM_ALPHA: ++ case EM_ALTERA_NIOS2: ++ case EM_ARC: ++ case EM_ARC_COMPACT: ++ case EM_ARC_COMPACT2: ++ case EM_AVR: ++ case EM_AVR_OLD: ++ case EM_BLACKFIN: ++ case EM_CR16: ++ case EM_CRIS: ++ case EM_CRX: ++ case EM_CSKY: ++ case EM_D30V: ++ case EM_CYGNUS_D30V: ++ case EM_FR30: ++ case EM_FT32: ++ case EM_CYGNUS_FR30: ++ case EM_CYGNUS_FRV: ++ case EM_H8S: ++ case EM_H8_300: ++ case EM_H8_300H: ++ case EM_IA_64: ++ case EM_IP2K: ++ case EM_IP2K_OLD: ++ case EM_IQ2000: ++ case EM_LATTICEMICO32: ++ case EM_M32C_OLD: ++ case EM_M32C: ++ case EM_M32R: ++ case EM_MCORE: ++ case EM_CYGNUS_MEP: ++ case EM_METAG: ++ case EM_MMIX: ++ case EM_MN10200: ++ case EM_CYGNUS_MN10200: ++ case EM_MN10300: ++ case EM_CYGNUS_MN10300: ++ case EM_MOXIE: ++ case EM_MSP430: ++ case EM_MSP430_OLD: ++ case EM_MT: ++ case EM_NDS32: ++ case EM_NIOS32: ++ case EM_OR1K: ++ case EM_PPC64: ++ case EM_PPC: ++ case EM_TI_PRU: ++ case EM_RISCV: ++ case EM_RL78: ++ case EM_RX: ++ case EM_S390: ++ case EM_S390_OLD: ++ case EM_SH: ++ case EM_SPARC: ++ case EM_SPARC32PLUS: ++ case EM_SPARCV9: ++ case EM_SPU: ++ case EM_TI_C6000: ++ case EM_TILEGX: ++ case EM_TILEPRO: ++ case EM_V800: ++ case EM_V850: ++ case EM_CYGNUS_V850: ++ case EM_VAX: ++ case EM_VISIUM: ++ case EM_X86_64: ++ case EM_L1OM: ++ case EM_K1OM: ++ case EM_XSTORMY16: ++ case EM_XTENSA: ++ case EM_XTENSA_OLD: ++ case EM_MICROBLAZE: ++ case EM_MICROBLAZE_OLD: ++ case EM_WEBASSEMBLY: ++ return TRUE; ++ ++ case EM_68HC05: ++ case EM_68HC08: ++ case EM_68HC11: ++ case EM_68HC16: ++ case EM_FX66: ++ case EM_ME16: ++ case EM_MMA: ++ case EM_NCPU: ++ case EM_NDR1: ++ case EM_PCP: ++ case EM_ST100: ++ case EM_ST19: ++ case EM_ST7: ++ case EM_ST9PLUS: ++ case EM_STARCORE: ++ case EM_SVX: ++ case EM_TINYJ: ++ default: ++ warn (_("Don't know about relocations on this machine architecture\n")); ++ return FALSE; ++ } ++} ++ ++/* Load RELA type relocations from FILEDATA at REL_OFFSET extending for REL_SIZE bytes. ++ Returns TRUE upon success, FALSE otherwise. If successful then a ++ pointer to a malloc'ed buffer containing the relocs is placed in *RELASP, ++ and the number of relocs loaded is placed in *NRELASP. It is the caller's ++ responsibility to free the allocated buffer. */ ++ ++static bfd_boolean ++slurp_rela_relocs (Filedata * filedata, ++ unsigned long rel_offset, ++ unsigned long rel_size, ++ Elf_Internal_Rela ** relasp, ++ unsigned long * nrelasp) ++{ ++ Elf_Internal_Rela * relas; ++ size_t nrelas; ++ unsigned int i; ++ ++ if (is_32bit_elf) ++ { ++ Elf32_External_Rela * erelas; ++ ++ erelas = (Elf32_External_Rela *) get_data (NULL, filedata, rel_offset, 1, ++ rel_size, _("32-bit relocation data")); ++ if (!erelas) ++ return FALSE; ++ ++ nrelas = rel_size / sizeof (Elf32_External_Rela); ++ ++ relas = (Elf_Internal_Rela *) cmalloc (nrelas, ++ sizeof (Elf_Internal_Rela)); ++ ++ if (relas == NULL) ++ { ++ free (erelas); ++ error (_("out of memory parsing relocs\n")); ++ return FALSE; ++ } ++ ++ for (i = 0; i < nrelas; i++) ++ { ++ relas[i].r_offset = BYTE_GET (erelas[i].r_offset); ++ relas[i].r_info = BYTE_GET (erelas[i].r_info); ++ relas[i].r_addend = BYTE_GET_SIGNED (erelas[i].r_addend); ++ } ++ ++ free (erelas); ++ } ++ else ++ { ++ Elf64_External_Rela * erelas; ++ ++ erelas = (Elf64_External_Rela *) get_data (NULL, filedata, rel_offset, 1, ++ rel_size, _("64-bit relocation data")); ++ if (!erelas) ++ return FALSE; ++ ++ nrelas = rel_size / sizeof (Elf64_External_Rela); ++ ++ relas = (Elf_Internal_Rela *) cmalloc (nrelas, ++ sizeof (Elf_Internal_Rela)); ++ ++ if (relas == NULL) ++ { ++ free (erelas); ++ error (_("out of memory parsing relocs\n")); ++ return FALSE; ++ } ++ ++ for (i = 0; i < nrelas; i++) ++ { ++ relas[i].r_offset = BYTE_GET (erelas[i].r_offset); ++ relas[i].r_info = BYTE_GET (erelas[i].r_info); ++ relas[i].r_addend = BYTE_GET_SIGNED (erelas[i].r_addend); ++ ++ /* The #ifdef BFD64 below is to prevent a compile time ++ warning. We know that if we do not have a 64 bit data ++ type that we will never execute this code anyway. */ ++#ifdef BFD64 ++ if (filedata->file_header.e_machine == EM_MIPS ++ && filedata->file_header.e_ident[EI_DATA] != ELFDATA2MSB) ++ { ++ /* In little-endian objects, r_info isn't really a ++ 64-bit little-endian value: it has a 32-bit ++ little-endian symbol index followed by four ++ individual byte fields. Reorder INFO ++ accordingly. */ ++ bfd_vma inf = relas[i].r_info; ++ inf = (((inf & 0xffffffff) << 32) ++ | ((inf >> 56) & 0xff) ++ | ((inf >> 40) & 0xff00) ++ | ((inf >> 24) & 0xff0000) ++ | ((inf >> 8) & 0xff000000)); ++ relas[i].r_info = inf; ++ } ++#endif /* BFD64 */ ++ } ++ ++ free (erelas); ++ } ++ ++ *relasp = relas; ++ *nrelasp = nrelas; ++ return TRUE; ++} ++ ++/* Load REL type relocations from FILEDATA at REL_OFFSET extending for REL_SIZE bytes. ++ Returns TRUE upon success, FALSE otherwise. If successful then a ++ pointer to a malloc'ed buffer containing the relocs is placed in *RELSP, ++ and the number of relocs loaded is placed in *NRELSP. It is the caller's ++ responsibility to free the allocated buffer. */ ++ ++static bfd_boolean ++slurp_rel_relocs (Filedata * filedata, ++ unsigned long rel_offset, ++ unsigned long rel_size, ++ Elf_Internal_Rela ** relsp, ++ unsigned long * nrelsp) ++{ ++ Elf_Internal_Rela * rels; ++ size_t nrels; ++ unsigned int i; ++ ++ if (is_32bit_elf) ++ { ++ Elf32_External_Rel * erels; ++ ++ erels = (Elf32_External_Rel *) get_data (NULL, filedata, rel_offset, 1, ++ rel_size, _("32-bit relocation data")); ++ if (!erels) ++ return FALSE; ++ ++ nrels = rel_size / sizeof (Elf32_External_Rel); ++ ++ rels = (Elf_Internal_Rela *) cmalloc (nrels, sizeof (Elf_Internal_Rela)); ++ ++ if (rels == NULL) ++ { ++ free (erels); ++ error (_("out of memory parsing relocs\n")); ++ return FALSE; ++ } ++ ++ for (i = 0; i < nrels; i++) ++ { ++ rels[i].r_offset = BYTE_GET (erels[i].r_offset); ++ rels[i].r_info = BYTE_GET (erels[i].r_info); ++ rels[i].r_addend = 0; ++ } ++ ++ free (erels); ++ } ++ else ++ { ++ Elf64_External_Rel * erels; ++ ++ erels = (Elf64_External_Rel *) get_data (NULL, filedata, rel_offset, 1, ++ rel_size, _("64-bit relocation data")); ++ if (!erels) ++ return FALSE; ++ ++ nrels = rel_size / sizeof (Elf64_External_Rel); ++ ++ rels = (Elf_Internal_Rela *) cmalloc (nrels, sizeof (Elf_Internal_Rela)); ++ ++ if (rels == NULL) ++ { ++ free (erels); ++ error (_("out of memory parsing relocs\n")); ++ return FALSE; ++ } ++ ++ for (i = 0; i < nrels; i++) ++ { ++ rels[i].r_offset = BYTE_GET (erels[i].r_offset); ++ rels[i].r_info = BYTE_GET (erels[i].r_info); ++ rels[i].r_addend = 0; ++ ++ /* The #ifdef BFD64 below is to prevent a compile time ++ warning. We know that if we do not have a 64 bit data ++ type that we will never execute this code anyway. */ ++#ifdef BFD64 ++ if (filedata->file_header.e_machine == EM_MIPS ++ && filedata->file_header.e_ident[EI_DATA] != ELFDATA2MSB) ++ { ++ /* In little-endian objects, r_info isn't really a ++ 64-bit little-endian value: it has a 32-bit ++ little-endian symbol index followed by four ++ individual byte fields. Reorder INFO ++ accordingly. */ ++ bfd_vma inf = rels[i].r_info; ++ inf = (((inf & 0xffffffff) << 32) ++ | ((inf >> 56) & 0xff) ++ | ((inf >> 40) & 0xff00) ++ | ((inf >> 24) & 0xff0000) ++ | ((inf >> 8) & 0xff000000)); ++ rels[i].r_info = inf; ++ } ++#endif /* BFD64 */ ++ } ++ ++ free (erels); ++ } ++ ++ *relsp = rels; ++ *nrelsp = nrels; ++ return TRUE; ++} ++ ++/* Returns the reloc type extracted from the reloc info field. */ ++ ++static unsigned int ++get_reloc_type (Filedata * filedata, bfd_vma reloc_info) ++{ ++ if (is_32bit_elf) ++ return ELF32_R_TYPE (reloc_info); ++ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_MIPS: ++ /* Note: We assume that reloc_info has already been adjusted for us. */ ++ return ELF64_MIPS_R_TYPE (reloc_info); ++ ++ case EM_SPARCV9: ++ return ELF64_R_TYPE_ID (reloc_info); ++ ++ default: ++ return ELF64_R_TYPE (reloc_info); ++ } ++} ++ ++/* Return the symbol index extracted from the reloc info field. */ ++ ++static bfd_vma ++get_reloc_symindex (bfd_vma reloc_info) ++{ ++ return is_32bit_elf ? ELF32_R_SYM (reloc_info) : ELF64_R_SYM (reloc_info); ++} ++ ++static inline bfd_boolean ++uses_msp430x_relocs (Filedata * filedata) ++{ ++ return ++ filedata->file_header.e_machine == EM_MSP430 /* Paranoia. */ ++ /* GCC uses osabi == ELFOSBI_STANDALONE. */ ++ && (((filedata->file_header.e_flags & EF_MSP430_MACH) == E_MSP430_MACH_MSP430X) ++ /* TI compiler uses ELFOSABI_NONE. */ ++ || (filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_NONE)); ++} ++ ++/* Display the contents of the relocation data found at the specified ++ offset. */ ++ ++static bfd_boolean ++dump_relocations (Filedata * filedata, ++ unsigned long rel_offset, ++ unsigned long rel_size, ++ Elf_Internal_Sym * symtab, ++ unsigned long nsyms, ++ char * strtab, ++ unsigned long strtablen, ++ int is_rela, ++ bfd_boolean is_dynsym) ++{ ++ unsigned long i; ++ Elf_Internal_Rela * rels; ++ bfd_boolean res = TRUE; ++ ++ if (is_rela == UNKNOWN) ++ is_rela = guess_is_rela (filedata->file_header.e_machine); ++ ++ if (is_rela) ++ { ++ if (!slurp_rela_relocs (filedata, rel_offset, rel_size, &rels, &rel_size)) ++ return FALSE; ++ } ++ else ++ { ++ if (!slurp_rel_relocs (filedata, rel_offset, rel_size, &rels, &rel_size)) ++ return FALSE; ++ } ++ ++ if (is_32bit_elf) ++ { ++ if (is_rela) ++ { ++ if (do_wide) ++ printf (_(" Offset Info Type Sym. Value Symbol's Name + Addend\n")); ++ else ++ printf (_(" Offset Info Type Sym.Value Sym. Name + Addend\n")); ++ } ++ else ++ { ++ if (do_wide) ++ printf (_(" Offset Info Type Sym. Value Symbol's Name\n")); ++ else ++ printf (_(" Offset Info Type Sym.Value Sym. Name\n")); ++ } ++ } ++ else ++ { ++ if (is_rela) ++ { ++ if (do_wide) ++ printf (_(" Offset Info Type Symbol's Value Symbol's Name + Addend\n")); ++ else ++ printf (_(" Offset Info Type Sym. Value Sym. Name + Addend\n")); ++ } ++ else ++ { ++ if (do_wide) ++ printf (_(" Offset Info Type Symbol's Value Symbol's Name\n")); ++ else ++ printf (_(" Offset Info Type Sym. Value Sym. Name\n")); ++ } ++ } ++ ++ for (i = 0; i < rel_size; i++) ++ { ++ const char * rtype; ++ bfd_vma offset; ++ bfd_vma inf; ++ bfd_vma symtab_index; ++ bfd_vma type; ++ ++ offset = rels[i].r_offset; ++ inf = rels[i].r_info; ++ ++ type = get_reloc_type (filedata, inf); ++ symtab_index = get_reloc_symindex (inf); ++ ++ if (is_32bit_elf) ++ { ++ printf ("%8.8lx %8.8lx ", ++ (unsigned long) offset & 0xffffffff, ++ (unsigned long) inf & 0xffffffff); ++ } ++ else ++ { ++#if BFD_HOST_64BIT_LONG ++ printf (do_wide ++ ? "%16.16lx %16.16lx " ++ : "%12.12lx %12.12lx ", ++ offset, inf); ++#elif BFD_HOST_64BIT_LONG_LONG ++#ifndef __MSVCRT__ ++ printf (do_wide ++ ? "%16.16llx %16.16llx " ++ : "%12.12llx %12.12llx ", ++ offset, inf); ++#else ++ printf (do_wide ++ ? "%16.16I64x %16.16I64x " ++ : "%12.12I64x %12.12I64x ", ++ offset, inf); ++#endif ++#else ++ printf (do_wide ++ ? "%8.8lx%8.8lx %8.8lx%8.8lx " ++ : "%4.4lx%8.8lx %4.4lx%8.8lx ", ++ _bfd_int64_high (offset), ++ _bfd_int64_low (offset), ++ _bfd_int64_high (inf), ++ _bfd_int64_low (inf)); ++#endif ++ } ++ ++ switch (filedata->file_header.e_machine) ++ { ++ default: ++ rtype = NULL; ++ break; ++ ++ case EM_AARCH64: ++ rtype = elf_aarch64_reloc_type (type); ++ break; ++ ++ case EM_M32R: ++ case EM_CYGNUS_M32R: ++ rtype = elf_m32r_reloc_type (type); ++ break; ++ ++ case EM_386: ++ case EM_IAMCU: ++ rtype = elf_i386_reloc_type (type); ++ break; ++ ++ case EM_68HC11: ++ case EM_68HC12: ++ rtype = elf_m68hc11_reloc_type (type); ++ break; ++ ++ case EM_S12Z: ++ rtype = elf_s12z_reloc_type (type); ++ break; ++ ++ case EM_68K: ++ rtype = elf_m68k_reloc_type (type); ++ break; ++ ++ case EM_960: ++ rtype = elf_i960_reloc_type (type); ++ break; ++ ++ case EM_AVR: ++ case EM_AVR_OLD: ++ rtype = elf_avr_reloc_type (type); ++ break; ++ ++ case EM_OLD_SPARCV9: ++ case EM_SPARC32PLUS: ++ case EM_SPARCV9: ++ case EM_SPARC: ++ rtype = elf_sparc_reloc_type (type); ++ break; ++ ++ case EM_SPU: ++ rtype = elf_spu_reloc_type (type); ++ break; ++ ++ case EM_V800: ++ rtype = v800_reloc_type (type); ++ break; ++ case EM_V850: ++ case EM_CYGNUS_V850: ++ rtype = v850_reloc_type (type); ++ break; ++ ++ case EM_D10V: ++ case EM_CYGNUS_D10V: ++ rtype = elf_d10v_reloc_type (type); ++ break; ++ ++ case EM_D30V: ++ case EM_CYGNUS_D30V: ++ rtype = elf_d30v_reloc_type (type); ++ break; ++ ++ case EM_DLX: ++ rtype = elf_dlx_reloc_type (type); ++ break; ++ ++ case EM_SH: ++ rtype = elf_sh_reloc_type (type); ++ break; ++ ++ case EM_MN10300: ++ case EM_CYGNUS_MN10300: ++ rtype = elf_mn10300_reloc_type (type); ++ break; ++ ++ case EM_MN10200: ++ case EM_CYGNUS_MN10200: ++ rtype = elf_mn10200_reloc_type (type); ++ break; ++ ++ case EM_FR30: ++ case EM_CYGNUS_FR30: ++ rtype = elf_fr30_reloc_type (type); ++ break; ++ ++ case EM_CYGNUS_FRV: ++ rtype = elf_frv_reloc_type (type); ++ break; ++ ++ case EM_CSKY: ++ rtype = elf_csky_reloc_type (type); ++ break; ++ ++ case EM_FT32: ++ rtype = elf_ft32_reloc_type (type); ++ break; ++ ++ case EM_MCORE: ++ rtype = elf_mcore_reloc_type (type); ++ break; ++ ++ case EM_MMIX: ++ rtype = elf_mmix_reloc_type (type); ++ break; ++ ++ case EM_MOXIE: ++ rtype = elf_moxie_reloc_type (type); ++ break; ++ ++ case EM_MSP430: ++ if (uses_msp430x_relocs (filedata)) ++ { ++ rtype = elf_msp430x_reloc_type (type); ++ break; ++ } ++ /* Fall through. */ ++ case EM_MSP430_OLD: ++ rtype = elf_msp430_reloc_type (type); ++ break; ++ ++ case EM_NDS32: ++ rtype = elf_nds32_reloc_type (type); ++ break; ++ ++ case EM_PPC: ++ rtype = elf_ppc_reloc_type (type); ++ break; ++ ++ case EM_PPC64: ++ rtype = elf_ppc64_reloc_type (type); ++ break; ++ ++ case EM_MIPS: ++ case EM_MIPS_RS3_LE: ++ rtype = elf_mips_reloc_type (type); ++ break; ++ ++ case EM_RISCV: ++ rtype = elf_riscv_reloc_type (type); ++ break; ++ ++ case EM_ALPHA: ++ rtype = elf_alpha_reloc_type (type); ++ break; ++ ++ case EM_ARM: ++ rtype = elf_arm_reloc_type (type); ++ break; ++ ++ case EM_ARC: ++ case EM_ARC_COMPACT: ++ case EM_ARC_COMPACT2: ++ rtype = elf_arc_reloc_type (type); ++ break; ++ ++ case EM_PARISC: ++ rtype = elf_hppa_reloc_type (type); ++ break; ++ ++ case EM_H8_300: ++ case EM_H8_300H: ++ case EM_H8S: ++ rtype = elf_h8_reloc_type (type); ++ break; ++ ++ case EM_OR1K: ++ rtype = elf_or1k_reloc_type (type); ++ break; ++ ++ case EM_PJ: ++ case EM_PJ_OLD: ++ rtype = elf_pj_reloc_type (type); ++ break; ++ case EM_IA_64: ++ rtype = elf_ia64_reloc_type (type); ++ break; ++ ++ case EM_CRIS: ++ rtype = elf_cris_reloc_type (type); ++ break; ++ ++ case EM_860: ++ rtype = elf_i860_reloc_type (type); ++ break; ++ ++ case EM_X86_64: ++ case EM_L1OM: ++ case EM_K1OM: ++ rtype = elf_x86_64_reloc_type (type); ++ break; ++ ++ case EM_S370: ++ rtype = i370_reloc_type (type); ++ break; ++ ++ case EM_S390_OLD: ++ case EM_S390: ++ rtype = elf_s390_reloc_type (type); ++ break; ++ ++ case EM_SCORE: ++ rtype = elf_score_reloc_type (type); ++ break; ++ ++ case EM_XSTORMY16: ++ rtype = elf_xstormy16_reloc_type (type); ++ break; ++ ++ case EM_CRX: ++ rtype = elf_crx_reloc_type (type); ++ break; ++ ++ case EM_VAX: ++ rtype = elf_vax_reloc_type (type); ++ break; ++ ++ case EM_VISIUM: ++ rtype = elf_visium_reloc_type (type); ++ break; ++ ++ case EM_BPF: ++ rtype = elf_bpf_reloc_type (type); ++ break; ++ ++ case EM_ADAPTEVA_EPIPHANY: ++ rtype = elf_epiphany_reloc_type (type); ++ break; ++ ++ case EM_IP2K: ++ case EM_IP2K_OLD: ++ rtype = elf_ip2k_reloc_type (type); ++ break; ++ ++ case EM_IQ2000: ++ rtype = elf_iq2000_reloc_type (type); ++ break; ++ ++ case EM_XTENSA_OLD: ++ case EM_XTENSA: ++ rtype = elf_xtensa_reloc_type (type); ++ break; ++ ++ case EM_LATTICEMICO32: ++ rtype = elf_lm32_reloc_type (type); ++ break; ++ ++ case EM_M32C_OLD: ++ case EM_M32C: ++ rtype = elf_m32c_reloc_type (type); ++ break; ++ ++ case EM_MT: ++ rtype = elf_mt_reloc_type (type); ++ break; ++ ++ case EM_BLACKFIN: ++ rtype = elf_bfin_reloc_type (type); ++ break; ++ ++ case EM_CYGNUS_MEP: ++ rtype = elf_mep_reloc_type (type); ++ break; ++ ++ case EM_CR16: ++ rtype = elf_cr16_reloc_type (type); ++ break; ++ ++ case EM_MICROBLAZE: ++ case EM_MICROBLAZE_OLD: ++ rtype = elf_microblaze_reloc_type (type); ++ break; ++ ++ case EM_RL78: ++ rtype = elf_rl78_reloc_type (type); ++ break; ++ ++ case EM_RX: ++ rtype = elf_rx_reloc_type (type); ++ break; ++ ++ case EM_METAG: ++ rtype = elf_metag_reloc_type (type); ++ break; ++ ++ case EM_XC16X: ++ case EM_C166: ++ rtype = elf_xc16x_reloc_type (type); ++ break; ++ ++ case EM_TI_C6000: ++ rtype = elf_tic6x_reloc_type (type); ++ break; ++ ++ case EM_TILEGX: ++ rtype = elf_tilegx_reloc_type (type); ++ break; ++ ++ case EM_TILEPRO: ++ rtype = elf_tilepro_reloc_type (type); ++ break; ++ ++ case EM_WEBASSEMBLY: ++ rtype = elf_wasm32_reloc_type (type); ++ break; ++ ++ case EM_XGATE: ++ rtype = elf_xgate_reloc_type (type); ++ break; ++ ++ case EM_ALTERA_NIOS2: ++ rtype = elf_nios2_reloc_type (type); ++ break; ++ ++ case EM_TI_PRU: ++ rtype = elf_pru_reloc_type (type); ++ break; ++ ++ case EM_NFP: ++ if (EF_NFP_MACH (filedata->file_header.e_flags) == E_NFP_MACH_3200) ++ rtype = elf_nfp3200_reloc_type (type); ++ else ++ rtype = elf_nfp_reloc_type (type); ++ break; ++ ++ case EM_Z80: ++ rtype = elf_z80_reloc_type (type); ++ break; ++ } ++ ++ if (rtype == NULL) ++ printf (_("unrecognized: %-7lx"), (unsigned long) type & 0xffffffff); ++ else ++ printf (do_wide ? "%-22s" : "%-17.17s", rtype); ++ ++ if (filedata->file_header.e_machine == EM_ALPHA ++ && rtype != NULL ++ && streq (rtype, "R_ALPHA_LITUSE") ++ && is_rela) ++ { ++ switch (rels[i].r_addend) ++ { ++ case LITUSE_ALPHA_ADDR: rtype = "ADDR"; break; ++ case LITUSE_ALPHA_BASE: rtype = "BASE"; break; ++ case LITUSE_ALPHA_BYTOFF: rtype = "BYTOFF"; break; ++ case LITUSE_ALPHA_JSR: rtype = "JSR"; break; ++ case LITUSE_ALPHA_TLSGD: rtype = "TLSGD"; break; ++ case LITUSE_ALPHA_TLSLDM: rtype = "TLSLDM"; break; ++ case LITUSE_ALPHA_JSRDIRECT: rtype = "JSRDIRECT"; break; ++ default: rtype = NULL; ++ } ++ ++ if (rtype) ++ printf (" (%s)", rtype); ++ else ++ { ++ putchar (' '); ++ printf (_(""), ++ (unsigned long) rels[i].r_addend); ++ res = FALSE; ++ } ++ } ++ else if (symtab_index) ++ { ++ if (symtab == NULL || symtab_index >= nsyms) ++ { ++ error (_(" bad symbol index: %08lx in reloc\n"), ++ (unsigned long) symtab_index); ++ res = FALSE; ++ } ++ else ++ { ++ Elf_Internal_Sym * psym; ++ const char * version_string; ++ enum versioned_symbol_info sym_info; ++ unsigned short vna_other; ++ ++ psym = symtab + symtab_index; ++ ++ version_string ++ = get_symbol_version_string (filedata, is_dynsym, ++ strtab, strtablen, ++ symtab_index, ++ psym, ++ &sym_info, ++ &vna_other); ++ ++ printf (" "); ++ ++ if (ELF_ST_TYPE (psym->st_info) == STT_GNU_IFUNC) ++ { ++ const char * name; ++ unsigned int len; ++ unsigned int width = is_32bit_elf ? 8 : 14; ++ ++ /* Relocations against GNU_IFUNC symbols do not use the value ++ of the symbol as the address to relocate against. Instead ++ they invoke the function named by the symbol and use its ++ result as the address for relocation. ++ ++ To indicate this to the user, do not display the value of ++ the symbol in the "Symbols's Value" field. Instead show ++ its name followed by () as a hint that the symbol is ++ invoked. */ ++ ++ if (strtab == NULL ++ || psym->st_name == 0 ++ || psym->st_name >= strtablen) ++ name = "??"; ++ else ++ name = strtab + psym->st_name; ++ ++ len = print_symbol (width, name); ++ if (version_string) ++ printf (sym_info == symbol_public ? "@@%s" : "@%s", ++ version_string); ++ printf ("()%-*s", len <= width ? (width + 1) - len : 1, " "); ++ } ++ else ++ { ++ print_vma (psym->st_value, LONG_HEX); ++ ++ printf (is_32bit_elf ? " " : " "); ++ } ++ ++ if (psym->st_name == 0) ++ { ++ const char * sec_name = ""; ++ char name_buf[40]; ++ ++ if (ELF_ST_TYPE (psym->st_info) == STT_SECTION) ++ { ++ if (psym->st_shndx < filedata->file_header.e_shnum) ++ sec_name = SECTION_NAME (filedata->section_headers + psym->st_shndx); ++ else if (psym->st_shndx == SHN_ABS) ++ sec_name = "ABS"; ++ else if (psym->st_shndx == SHN_COMMON) ++ sec_name = "COMMON"; ++ else if ((filedata->file_header.e_machine == EM_MIPS ++ && psym->st_shndx == SHN_MIPS_SCOMMON) ++ || (filedata->file_header.e_machine == EM_TI_C6000 ++ && psym->st_shndx == SHN_TIC6X_SCOMMON)) ++ sec_name = "SCOMMON"; ++ else if (filedata->file_header.e_machine == EM_MIPS ++ && psym->st_shndx == SHN_MIPS_SUNDEFINED) ++ sec_name = "SUNDEF"; ++ else if ((filedata->file_header.e_machine == EM_X86_64 ++ || filedata->file_header.e_machine == EM_L1OM ++ || filedata->file_header.e_machine == EM_K1OM) ++ && psym->st_shndx == SHN_X86_64_LCOMMON) ++ sec_name = "LARGE_COMMON"; ++ else if (filedata->file_header.e_machine == EM_IA_64 ++ && filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_HPUX ++ && psym->st_shndx == SHN_IA_64_ANSI_COMMON) ++ sec_name = "ANSI_COM"; ++ else if (is_ia64_vms (filedata) ++ && psym->st_shndx == SHN_IA_64_VMS_SYMVEC) ++ sec_name = "VMS_SYMVEC"; ++ else ++ { ++ sprintf (name_buf, "
", ++ (unsigned int) psym->st_shndx); ++ sec_name = name_buf; ++ } ++ } ++ print_symbol (22, sec_name); ++ } ++ else if (strtab == NULL) ++ printf (_(""), psym->st_name); ++ else if (psym->st_name >= strtablen) ++ { ++ error (_("\n"), ++ psym->st_name); ++ res = FALSE; ++ } ++ else ++ { ++ print_symbol (22, strtab + psym->st_name); ++ if (version_string) ++ printf (sym_info == symbol_public ? "@@%s" : "@%s", ++ version_string); ++ } ++ ++ if (is_rela) ++ { ++ bfd_vma off = rels[i].r_addend; ++ ++ if ((bfd_signed_vma) off < 0) ++ printf (" - %" BFD_VMA_FMT "x", - off); ++ else ++ printf (" + %" BFD_VMA_FMT "x", off); ++ } ++ } ++ } ++ else if (is_rela) ++ { ++ bfd_vma off = rels[i].r_addend; ++ ++ printf ("%*c", is_32bit_elf ? 12 : 20, ' '); ++ if ((bfd_signed_vma) off < 0) ++ printf ("-%" BFD_VMA_FMT "x", - off); ++ else ++ printf ("%" BFD_VMA_FMT "x", off); ++ } ++ ++ if (filedata->file_header.e_machine == EM_SPARCV9 ++ && rtype != NULL ++ && streq (rtype, "R_SPARC_OLO10")) ++ printf (" + %lx", (unsigned long) ELF64_R_TYPE_DATA (inf)); ++ ++ putchar ('\n'); ++ ++#ifdef BFD64 ++ if (! is_32bit_elf && filedata->file_header.e_machine == EM_MIPS) ++ { ++ bfd_vma type2 = ELF64_MIPS_R_TYPE2 (inf); ++ bfd_vma type3 = ELF64_MIPS_R_TYPE3 (inf); ++ const char * rtype2 = elf_mips_reloc_type (type2); ++ const char * rtype3 = elf_mips_reloc_type (type3); ++ ++ printf (" Type2: "); ++ ++ if (rtype2 == NULL) ++ printf (_("unrecognized: %-7lx"), ++ (unsigned long) type2 & 0xffffffff); ++ else ++ printf ("%-17.17s", rtype2); ++ ++ printf ("\n Type3: "); ++ ++ if (rtype3 == NULL) ++ printf (_("unrecognized: %-7lx"), ++ (unsigned long) type3 & 0xffffffff); ++ else ++ printf ("%-17.17s", rtype3); ++ ++ putchar ('\n'); ++ } ++#endif /* BFD64 */ ++ } ++ ++ free (rels); ++ ++ return res; ++} ++ ++static const char * ++get_aarch64_dynamic_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case DT_AARCH64_BTI_PLT: return "AARCH64_BTI_PLT"; ++ case DT_AARCH64_PAC_PLT: return "AARCH64_PAC_PLT"; ++ case DT_AARCH64_VARIANT_PCS: return "AARCH64_VARIANT_PCS"; ++ default: ++ return NULL; ++ } ++} ++ ++static const char * ++get_mips_dynamic_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case DT_MIPS_RLD_VERSION: return "MIPS_RLD_VERSION"; ++ case DT_MIPS_TIME_STAMP: return "MIPS_TIME_STAMP"; ++ case DT_MIPS_ICHECKSUM: return "MIPS_ICHECKSUM"; ++ case DT_MIPS_IVERSION: return "MIPS_IVERSION"; ++ case DT_MIPS_FLAGS: return "MIPS_FLAGS"; ++ case DT_MIPS_BASE_ADDRESS: return "MIPS_BASE_ADDRESS"; ++ case DT_MIPS_MSYM: return "MIPS_MSYM"; ++ case DT_MIPS_CONFLICT: return "MIPS_CONFLICT"; ++ case DT_MIPS_LIBLIST: return "MIPS_LIBLIST"; ++ case DT_MIPS_LOCAL_GOTNO: return "MIPS_LOCAL_GOTNO"; ++ case DT_MIPS_CONFLICTNO: return "MIPS_CONFLICTNO"; ++ case DT_MIPS_LIBLISTNO: return "MIPS_LIBLISTNO"; ++ case DT_MIPS_SYMTABNO: return "MIPS_SYMTABNO"; ++ case DT_MIPS_UNREFEXTNO: return "MIPS_UNREFEXTNO"; ++ case DT_MIPS_GOTSYM: return "MIPS_GOTSYM"; ++ case DT_MIPS_HIPAGENO: return "MIPS_HIPAGENO"; ++ case DT_MIPS_RLD_MAP: return "MIPS_RLD_MAP"; ++ case DT_MIPS_RLD_MAP_REL: return "MIPS_RLD_MAP_REL"; ++ case DT_MIPS_DELTA_CLASS: return "MIPS_DELTA_CLASS"; ++ case DT_MIPS_DELTA_CLASS_NO: return "MIPS_DELTA_CLASS_NO"; ++ case DT_MIPS_DELTA_INSTANCE: return "MIPS_DELTA_INSTANCE"; ++ case DT_MIPS_DELTA_INSTANCE_NO: return "MIPS_DELTA_INSTANCE_NO"; ++ case DT_MIPS_DELTA_RELOC: return "MIPS_DELTA_RELOC"; ++ case DT_MIPS_DELTA_RELOC_NO: return "MIPS_DELTA_RELOC_NO"; ++ case DT_MIPS_DELTA_SYM: return "MIPS_DELTA_SYM"; ++ case DT_MIPS_DELTA_SYM_NO: return "MIPS_DELTA_SYM_NO"; ++ case DT_MIPS_DELTA_CLASSSYM: return "MIPS_DELTA_CLASSSYM"; ++ case DT_MIPS_DELTA_CLASSSYM_NO: return "MIPS_DELTA_CLASSSYM_NO"; ++ case DT_MIPS_CXX_FLAGS: return "MIPS_CXX_FLAGS"; ++ case DT_MIPS_PIXIE_INIT: return "MIPS_PIXIE_INIT"; ++ case DT_MIPS_SYMBOL_LIB: return "MIPS_SYMBOL_LIB"; ++ case DT_MIPS_LOCALPAGE_GOTIDX: return "MIPS_LOCALPAGE_GOTIDX"; ++ case DT_MIPS_LOCAL_GOTIDX: return "MIPS_LOCAL_GOTIDX"; ++ case DT_MIPS_HIDDEN_GOTIDX: return "MIPS_HIDDEN_GOTIDX"; ++ case DT_MIPS_PROTECTED_GOTIDX: return "MIPS_PROTECTED_GOTIDX"; ++ case DT_MIPS_OPTIONS: return "MIPS_OPTIONS"; ++ case DT_MIPS_INTERFACE: return "MIPS_INTERFACE"; ++ case DT_MIPS_DYNSTR_ALIGN: return "MIPS_DYNSTR_ALIGN"; ++ case DT_MIPS_INTERFACE_SIZE: return "MIPS_INTERFACE_SIZE"; ++ case DT_MIPS_RLD_TEXT_RESOLVE_ADDR: return "MIPS_RLD_TEXT_RESOLVE_ADDR"; ++ case DT_MIPS_PERF_SUFFIX: return "MIPS_PERF_SUFFIX"; ++ case DT_MIPS_COMPACT_SIZE: return "MIPS_COMPACT_SIZE"; ++ case DT_MIPS_GP_VALUE: return "MIPS_GP_VALUE"; ++ case DT_MIPS_AUX_DYNAMIC: return "MIPS_AUX_DYNAMIC"; ++ case DT_MIPS_PLTGOT: return "MIPS_PLTGOT"; ++ case DT_MIPS_RWPLT: return "MIPS_RWPLT"; ++ case DT_MIPS_XHASH: return "MIPS_XHASH"; ++ default: ++ return NULL; ++ } ++} ++ ++static const char * ++get_sparc64_dynamic_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case DT_SPARC_REGISTER: return "SPARC_REGISTER"; ++ default: ++ return NULL; ++ } ++} ++ ++static const char * ++get_ppc_dynamic_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case DT_PPC_GOT: return "PPC_GOT"; ++ case DT_PPC_OPT: return "PPC_OPT"; ++ default: ++ return NULL; ++ } ++} ++ ++static const char * ++get_ppc64_dynamic_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case DT_PPC64_GLINK: return "PPC64_GLINK"; ++ case DT_PPC64_OPD: return "PPC64_OPD"; ++ case DT_PPC64_OPDSZ: return "PPC64_OPDSZ"; ++ case DT_PPC64_OPT: return "PPC64_OPT"; ++ default: ++ return NULL; ++ } ++} ++ ++static const char * ++get_parisc_dynamic_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case DT_HP_LOAD_MAP: return "HP_LOAD_MAP"; ++ case DT_HP_DLD_FLAGS: return "HP_DLD_FLAGS"; ++ case DT_HP_DLD_HOOK: return "HP_DLD_HOOK"; ++ case DT_HP_UX10_INIT: return "HP_UX10_INIT"; ++ case DT_HP_UX10_INITSZ: return "HP_UX10_INITSZ"; ++ case DT_HP_PREINIT: return "HP_PREINIT"; ++ case DT_HP_PREINITSZ: return "HP_PREINITSZ"; ++ case DT_HP_NEEDED: return "HP_NEEDED"; ++ case DT_HP_TIME_STAMP: return "HP_TIME_STAMP"; ++ case DT_HP_CHECKSUM: return "HP_CHECKSUM"; ++ case DT_HP_GST_SIZE: return "HP_GST_SIZE"; ++ case DT_HP_GST_VERSION: return "HP_GST_VERSION"; ++ case DT_HP_GST_HASHVAL: return "HP_GST_HASHVAL"; ++ case DT_HP_EPLTREL: return "HP_GST_EPLTREL"; ++ case DT_HP_EPLTRELSZ: return "HP_GST_EPLTRELSZ"; ++ case DT_HP_FILTERED: return "HP_FILTERED"; ++ case DT_HP_FILTER_TLS: return "HP_FILTER_TLS"; ++ case DT_HP_COMPAT_FILTERED: return "HP_COMPAT_FILTERED"; ++ case DT_HP_LAZYLOAD: return "HP_LAZYLOAD"; ++ case DT_HP_BIND_NOW_COUNT: return "HP_BIND_NOW_COUNT"; ++ case DT_PLT: return "PLT"; ++ case DT_PLT_SIZE: return "PLT_SIZE"; ++ case DT_DLT: return "DLT"; ++ case DT_DLT_SIZE: return "DLT_SIZE"; ++ default: ++ return NULL; ++ } ++} ++ ++static const char * ++get_ia64_dynamic_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case DT_IA_64_PLT_RESERVE: return "IA_64_PLT_RESERVE"; ++ case DT_IA_64_VMS_SUBTYPE: return "VMS_SUBTYPE"; ++ case DT_IA_64_VMS_IMGIOCNT: return "VMS_IMGIOCNT"; ++ case DT_IA_64_VMS_LNKFLAGS: return "VMS_LNKFLAGS"; ++ case DT_IA_64_VMS_VIR_MEM_BLK_SIZ: return "VMS_VIR_MEM_BLK_SIZ"; ++ case DT_IA_64_VMS_IDENT: return "VMS_IDENT"; ++ case DT_IA_64_VMS_NEEDED_IDENT: return "VMS_NEEDED_IDENT"; ++ case DT_IA_64_VMS_IMG_RELA_CNT: return "VMS_IMG_RELA_CNT"; ++ case DT_IA_64_VMS_SEG_RELA_CNT: return "VMS_SEG_RELA_CNT"; ++ case DT_IA_64_VMS_FIXUP_RELA_CNT: return "VMS_FIXUP_RELA_CNT"; ++ case DT_IA_64_VMS_FIXUP_NEEDED: return "VMS_FIXUP_NEEDED"; ++ case DT_IA_64_VMS_SYMVEC_CNT: return "VMS_SYMVEC_CNT"; ++ case DT_IA_64_VMS_XLATED: return "VMS_XLATED"; ++ case DT_IA_64_VMS_STACKSIZE: return "VMS_STACKSIZE"; ++ case DT_IA_64_VMS_UNWINDSZ: return "VMS_UNWINDSZ"; ++ case DT_IA_64_VMS_UNWIND_CODSEG: return "VMS_UNWIND_CODSEG"; ++ case DT_IA_64_VMS_UNWIND_INFOSEG: return "VMS_UNWIND_INFOSEG"; ++ case DT_IA_64_VMS_LINKTIME: return "VMS_LINKTIME"; ++ case DT_IA_64_VMS_SEG_NO: return "VMS_SEG_NO"; ++ case DT_IA_64_VMS_SYMVEC_OFFSET: return "VMS_SYMVEC_OFFSET"; ++ case DT_IA_64_VMS_SYMVEC_SEG: return "VMS_SYMVEC_SEG"; ++ case DT_IA_64_VMS_UNWIND_OFFSET: return "VMS_UNWIND_OFFSET"; ++ case DT_IA_64_VMS_UNWIND_SEG: return "VMS_UNWIND_SEG"; ++ case DT_IA_64_VMS_STRTAB_OFFSET: return "VMS_STRTAB_OFFSET"; ++ case DT_IA_64_VMS_SYSVER_OFFSET: return "VMS_SYSVER_OFFSET"; ++ case DT_IA_64_VMS_IMG_RELA_OFF: return "VMS_IMG_RELA_OFF"; ++ case DT_IA_64_VMS_SEG_RELA_OFF: return "VMS_SEG_RELA_OFF"; ++ case DT_IA_64_VMS_FIXUP_RELA_OFF: return "VMS_FIXUP_RELA_OFF"; ++ case DT_IA_64_VMS_PLTGOT_OFFSET: return "VMS_PLTGOT_OFFSET"; ++ case DT_IA_64_VMS_PLTGOT_SEG: return "VMS_PLTGOT_SEG"; ++ case DT_IA_64_VMS_FPMODE: return "VMS_FPMODE"; ++ default: ++ return NULL; ++ } ++} ++ ++static const char * ++get_solaris_section_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case 0x6fffffee: return "SUNW_ancillary"; ++ case 0x6fffffef: return "SUNW_capchain"; ++ case 0x6ffffff0: return "SUNW_capinfo"; ++ case 0x6ffffff1: return "SUNW_symsort"; ++ case 0x6ffffff2: return "SUNW_tlssort"; ++ case 0x6ffffff3: return "SUNW_LDYNSYM"; ++ case 0x6ffffff4: return "SUNW_dof"; ++ case 0x6ffffff5: return "SUNW_cap"; ++ case 0x6ffffff6: return "SUNW_SIGNATURE"; ++ case 0x6ffffff7: return "SUNW_ANNOTATE"; ++ case 0x6ffffff8: return "SUNW_DEBUGSTR"; ++ case 0x6ffffff9: return "SUNW_DEBUG"; ++ case 0x6ffffffa: return "SUNW_move"; ++ case 0x6ffffffb: return "SUNW_COMDAT"; ++ case 0x6ffffffc: return "SUNW_syminfo"; ++ case 0x6ffffffd: return "SUNW_verdef"; ++ case 0x6ffffffe: return "SUNW_verneed"; ++ case 0x6fffffff: return "SUNW_versym"; ++ case 0x70000000: return "SPARC_GOTDATA"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_alpha_dynamic_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case DT_ALPHA_PLTRO: return "ALPHA_PLTRO"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_score_dynamic_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case DT_SCORE_BASE_ADDRESS: return "SCORE_BASE_ADDRESS"; ++ case DT_SCORE_LOCAL_GOTNO: return "SCORE_LOCAL_GOTNO"; ++ case DT_SCORE_SYMTABNO: return "SCORE_SYMTABNO"; ++ case DT_SCORE_GOTSYM: return "SCORE_GOTSYM"; ++ case DT_SCORE_UNREFEXTNO: return "SCORE_UNREFEXTNO"; ++ case DT_SCORE_HIPAGENO: return "SCORE_HIPAGENO"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_tic6x_dynamic_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case DT_C6000_GSYM_OFFSET: return "C6000_GSYM_OFFSET"; ++ case DT_C6000_GSTR_OFFSET: return "C6000_GSTR_OFFSET"; ++ case DT_C6000_DSBT_BASE: return "C6000_DSBT_BASE"; ++ case DT_C6000_DSBT_SIZE: return "C6000_DSBT_SIZE"; ++ case DT_C6000_PREEMPTMAP: return "C6000_PREEMPTMAP"; ++ case DT_C6000_DSBT_INDEX: return "C6000_DSBT_INDEX"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_nios2_dynamic_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case DT_NIOS2_GP: return "NIOS2_GP"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_solaris_dynamic_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case 0x6000000d: return "SUNW_AUXILIARY"; ++ case 0x6000000e: return "SUNW_RTLDINF"; ++ case 0x6000000f: return "SUNW_FILTER"; ++ case 0x60000010: return "SUNW_CAP"; ++ case 0x60000011: return "SUNW_SYMTAB"; ++ case 0x60000012: return "SUNW_SYMSZ"; ++ case 0x60000013: return "SUNW_SORTENT"; ++ case 0x60000014: return "SUNW_SYMSORT"; ++ case 0x60000015: return "SUNW_SYMSORTSZ"; ++ case 0x60000016: return "SUNW_TLSSORT"; ++ case 0x60000017: return "SUNW_TLSSORTSZ"; ++ case 0x60000018: return "SUNW_CAPINFO"; ++ case 0x60000019: return "SUNW_STRPAD"; ++ case 0x6000001a: return "SUNW_CAPCHAIN"; ++ case 0x6000001b: return "SUNW_LDMACH"; ++ case 0x6000001d: return "SUNW_CAPCHAINENT"; ++ case 0x6000001f: return "SUNW_CAPCHAINSZ"; ++ case 0x60000021: return "SUNW_PARENT"; ++ case 0x60000023: return "SUNW_ASLR"; ++ case 0x60000025: return "SUNW_RELAX"; ++ case 0x60000029: return "SUNW_NXHEAP"; ++ case 0x6000002b: return "SUNW_NXSTACK"; ++ ++ case 0x70000001: return "SPARC_REGISTER"; ++ case 0x7ffffffd: return "AUXILIARY"; ++ case 0x7ffffffe: return "USED"; ++ case 0x7fffffff: return "FILTER"; ++ ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_dynamic_type (Filedata * filedata, unsigned long type) ++{ ++ static char buff[64]; ++ ++ switch (type) ++ { ++ case DT_NULL: return "NULL"; ++ case DT_NEEDED: return "NEEDED"; ++ case DT_PLTRELSZ: return "PLTRELSZ"; ++ case DT_PLTGOT: return "PLTGOT"; ++ case DT_HASH: return "HASH"; ++ case DT_STRTAB: return "STRTAB"; ++ case DT_SYMTAB: return "SYMTAB"; ++ case DT_RELA: return "RELA"; ++ case DT_RELASZ: return "RELASZ"; ++ case DT_RELAENT: return "RELAENT"; ++ case DT_STRSZ: return "STRSZ"; ++ case DT_SYMENT: return "SYMENT"; ++ case DT_INIT: return "INIT"; ++ case DT_FINI: return "FINI"; ++ case DT_SONAME: return "SONAME"; ++ case DT_RPATH: return "RPATH"; ++ case DT_SYMBOLIC: return "SYMBOLIC"; ++ case DT_REL: return "REL"; ++ case DT_RELSZ: return "RELSZ"; ++ case DT_RELENT: return "RELENT"; ++ case DT_PLTREL: return "PLTREL"; ++ case DT_DEBUG: return "DEBUG"; ++ case DT_TEXTREL: return "TEXTREL"; ++ case DT_JMPREL: return "JMPREL"; ++ case DT_BIND_NOW: return "BIND_NOW"; ++ case DT_INIT_ARRAY: return "INIT_ARRAY"; ++ case DT_FINI_ARRAY: return "FINI_ARRAY"; ++ case DT_INIT_ARRAYSZ: return "INIT_ARRAYSZ"; ++ case DT_FINI_ARRAYSZ: return "FINI_ARRAYSZ"; ++ case DT_RUNPATH: return "RUNPATH"; ++ case DT_FLAGS: return "FLAGS"; ++ ++ case DT_PREINIT_ARRAY: return "PREINIT_ARRAY"; ++ case DT_PREINIT_ARRAYSZ: return "PREINIT_ARRAYSZ"; ++ case DT_SYMTAB_SHNDX: return "SYMTAB_SHNDX"; ++ ++ case DT_CHECKSUM: return "CHECKSUM"; ++ case DT_PLTPADSZ: return "PLTPADSZ"; ++ case DT_MOVEENT: return "MOVEENT"; ++ case DT_MOVESZ: return "MOVESZ"; ++ case DT_FEATURE: return "FEATURE"; ++ case DT_POSFLAG_1: return "POSFLAG_1"; ++ case DT_SYMINSZ: return "SYMINSZ"; ++ case DT_SYMINENT: return "SYMINENT"; /* aka VALRNGHI */ ++ ++ case DT_ADDRRNGLO: return "ADDRRNGLO"; ++ case DT_CONFIG: return "CONFIG"; ++ case DT_DEPAUDIT: return "DEPAUDIT"; ++ case DT_AUDIT: return "AUDIT"; ++ case DT_PLTPAD: return "PLTPAD"; ++ case DT_MOVETAB: return "MOVETAB"; ++ case DT_SYMINFO: return "SYMINFO"; /* aka ADDRRNGHI */ ++ ++ case DT_VERSYM: return "VERSYM"; ++ ++ case DT_TLSDESC_GOT: return "TLSDESC_GOT"; ++ case DT_TLSDESC_PLT: return "TLSDESC_PLT"; ++ case DT_RELACOUNT: return "RELACOUNT"; ++ case DT_RELCOUNT: return "RELCOUNT"; ++ case DT_FLAGS_1: return "FLAGS_1"; ++ case DT_VERDEF: return "VERDEF"; ++ case DT_VERDEFNUM: return "VERDEFNUM"; ++ case DT_VERNEED: return "VERNEED"; ++ case DT_VERNEEDNUM: return "VERNEEDNUM"; ++ ++ case DT_AUXILIARY: return "AUXILIARY"; ++ case DT_USED: return "USED"; ++ case DT_FILTER: return "FILTER"; ++ ++ case DT_GNU_PRELINKED: return "GNU_PRELINKED"; ++ case DT_GNU_CONFLICT: return "GNU_CONFLICT"; ++ case DT_GNU_CONFLICTSZ: return "GNU_CONFLICTSZ"; ++ case DT_GNU_LIBLIST: return "GNU_LIBLIST"; ++ case DT_GNU_LIBLISTSZ: return "GNU_LIBLISTSZ"; ++ case DT_GNU_HASH: return "GNU_HASH"; ++ ++ default: ++ if ((type >= DT_LOPROC) && (type <= DT_HIPROC)) ++ { ++ const char * result; ++ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_AARCH64: ++ result = get_aarch64_dynamic_type (type); ++ break; ++ case EM_MIPS: ++ case EM_MIPS_RS3_LE: ++ result = get_mips_dynamic_type (type); ++ break; ++ case EM_SPARCV9: ++ result = get_sparc64_dynamic_type (type); ++ break; ++ case EM_PPC: ++ result = get_ppc_dynamic_type (type); ++ break; ++ case EM_PPC64: ++ result = get_ppc64_dynamic_type (type); ++ break; ++ case EM_IA_64: ++ result = get_ia64_dynamic_type (type); ++ break; ++ case EM_ALPHA: ++ result = get_alpha_dynamic_type (type); ++ break; ++ case EM_SCORE: ++ result = get_score_dynamic_type (type); ++ break; ++ case EM_TI_C6000: ++ result = get_tic6x_dynamic_type (type); ++ break; ++ case EM_ALTERA_NIOS2: ++ result = get_nios2_dynamic_type (type); ++ break; ++ default: ++ if (filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_SOLARIS) ++ result = get_solaris_dynamic_type (type); ++ else ++ result = NULL; ++ break; ++ } ++ ++ if (result != NULL) ++ return result; ++ ++ snprintf (buff, sizeof (buff), _("Processor Specific: %lx"), type); ++ } ++ else if (((type >= DT_LOOS) && (type <= DT_HIOS)) ++ || (filedata->file_header.e_machine == EM_PARISC ++ && (type >= OLD_DT_LOOS) && (type <= OLD_DT_HIOS))) ++ { ++ const char * result; ++ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_PARISC: ++ result = get_parisc_dynamic_type (type); ++ break; ++ case EM_IA_64: ++ result = get_ia64_dynamic_type (type); ++ break; ++ default: ++ if (filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_SOLARIS) ++ result = get_solaris_dynamic_type (type); ++ else ++ result = NULL; ++ break; ++ } ++ ++ if (result != NULL) ++ return result; ++ ++ snprintf (buff, sizeof (buff), _("Operating System specific: %lx"), ++ type); ++ } ++ else ++ snprintf (buff, sizeof (buff), _(": %lx"), type); ++ ++ return buff; ++ } ++} ++ ++static char * ++get_file_type (unsigned e_type) ++{ ++ static char buff[64]; ++ ++ switch (e_type) ++ { ++ case ET_NONE: return _("NONE (None)"); ++ case ET_REL: return _("REL (Relocatable file)"); ++ case ET_EXEC: return _("EXEC (Executable file)"); ++ case ET_DYN: return _("DYN (Shared object file)"); ++ case ET_CORE: return _("CORE (Core file)"); ++ ++ default: ++ if ((e_type >= ET_LOPROC) && (e_type <= ET_HIPROC)) ++ snprintf (buff, sizeof (buff), _("Processor Specific: (%x)"), e_type); ++ else if ((e_type >= ET_LOOS) && (e_type <= ET_HIOS)) ++ snprintf (buff, sizeof (buff), _("OS Specific: (%x)"), e_type); ++ else ++ snprintf (buff, sizeof (buff), _(": %x"), e_type); ++ return buff; ++ } ++} ++ ++static char * ++get_machine_name (unsigned e_machine) ++{ ++ static char buff[64]; /* XXX */ ++ ++ switch (e_machine) ++ { ++ /* Please keep this switch table sorted by increasing EM_ value. */ ++ /* 0 */ ++ case EM_NONE: return _("None"); ++ case EM_M32: return "WE32100"; ++ case EM_SPARC: return "Sparc"; ++ case EM_386: return "Intel 80386"; ++ case EM_68K: return "MC68000"; ++ case EM_88K: return "MC88000"; ++ case EM_IAMCU: return "Intel MCU"; ++ case EM_860: return "Intel 80860"; ++ case EM_MIPS: return "MIPS R3000"; ++ case EM_S370: return "IBM System/370"; ++ /* 10 */ ++ case EM_MIPS_RS3_LE: return "MIPS R4000 big-endian"; ++ case EM_OLD_SPARCV9: return "Sparc v9 (old)"; ++ case EM_PARISC: return "HPPA"; ++ case EM_VPP550: return "Fujitsu VPP500"; ++ case EM_SPARC32PLUS: return "Sparc v8+" ; ++ case EM_960: return "Intel 80960"; ++ case EM_PPC: return "PowerPC"; ++ /* 20 */ ++ case EM_PPC64: return "PowerPC64"; ++ case EM_S390_OLD: ++ case EM_S390: return "IBM S/390"; ++ case EM_SPU: return "SPU"; ++ /* 30 */ ++ case EM_V800: return "Renesas V850 (using RH850 ABI)"; ++ case EM_FR20: return "Fujitsu FR20"; ++ case EM_RH32: return "TRW RH32"; ++ case EM_MCORE: return "MCORE"; ++ /* 40 */ ++ case EM_ARM: return "ARM"; ++ case EM_OLD_ALPHA: return "Digital Alpha (old)"; ++ case EM_SH: return "Renesas / SuperH SH"; ++ case EM_SPARCV9: return "Sparc v9"; ++ case EM_TRICORE: return "Siemens Tricore"; ++ case EM_ARC: return "ARC"; ++ case EM_H8_300: return "Renesas H8/300"; ++ case EM_H8_300H: return "Renesas H8/300H"; ++ case EM_H8S: return "Renesas H8S"; ++ case EM_H8_500: return "Renesas H8/500"; ++ /* 50 */ ++ case EM_IA_64: return "Intel IA-64"; ++ case EM_MIPS_X: return "Stanford MIPS-X"; ++ case EM_COLDFIRE: return "Motorola Coldfire"; ++ case EM_68HC12: return "Motorola MC68HC12 Microcontroller"; ++ case EM_MMA: return "Fujitsu Multimedia Accelerator"; ++ case EM_PCP: return "Siemens PCP"; ++ case EM_NCPU: return "Sony nCPU embedded RISC processor"; ++ case EM_NDR1: return "Denso NDR1 microprocesspr"; ++ case EM_STARCORE: return "Motorola Star*Core processor"; ++ case EM_ME16: return "Toyota ME16 processor"; ++ /* 60 */ ++ case EM_ST100: return "STMicroelectronics ST100 processor"; ++ case EM_TINYJ: return "Advanced Logic Corp. TinyJ embedded processor"; ++ case EM_X86_64: return "Advanced Micro Devices X86-64"; ++ case EM_PDSP: return "Sony DSP processor"; ++ case EM_PDP10: return "Digital Equipment Corp. PDP-10"; ++ case EM_PDP11: return "Digital Equipment Corp. PDP-11"; ++ case EM_FX66: return "Siemens FX66 microcontroller"; ++ case EM_ST9PLUS: return "STMicroelectronics ST9+ 8/16 bit microcontroller"; ++ case EM_ST7: return "STMicroelectronics ST7 8-bit microcontroller"; ++ case EM_68HC16: return "Motorola MC68HC16 Microcontroller"; ++ /* 70 */ ++ case EM_68HC11: return "Motorola MC68HC11 Microcontroller"; ++ case EM_68HC08: return "Motorola MC68HC08 Microcontroller"; ++ case EM_68HC05: return "Motorola MC68HC05 Microcontroller"; ++ case EM_SVX: return "Silicon Graphics SVx"; ++ case EM_ST19: return "STMicroelectronics ST19 8-bit microcontroller"; ++ case EM_VAX: return "Digital VAX"; ++ case EM_CRIS: return "Axis Communications 32-bit embedded processor"; ++ case EM_JAVELIN: return "Infineon Technologies 32-bit embedded cpu"; ++ case EM_FIREPATH: return "Element 14 64-bit DSP processor"; ++ case EM_ZSP: return "LSI Logic's 16-bit DSP processor"; ++ /* 80 */ ++ case EM_MMIX: return "Donald Knuth's educational 64-bit processor"; ++ case EM_HUANY: return "Harvard Universitys's machine-independent object format"; ++ case EM_PRISM: return "Vitesse Prism"; ++ case EM_AVR_OLD: ++ case EM_AVR: return "Atmel AVR 8-bit microcontroller"; ++ case EM_CYGNUS_FR30: ++ case EM_FR30: return "Fujitsu FR30"; ++ case EM_CYGNUS_D10V: ++ case EM_D10V: return "d10v"; ++ case EM_CYGNUS_D30V: ++ case EM_D30V: return "d30v"; ++ case EM_CYGNUS_V850: ++ case EM_V850: return "Renesas V850"; ++ case EM_CYGNUS_M32R: ++ case EM_M32R: return "Renesas M32R (formerly Mitsubishi M32r)"; ++ case EM_CYGNUS_MN10300: ++ case EM_MN10300: return "mn10300"; ++ /* 90 */ ++ case EM_CYGNUS_MN10200: ++ case EM_MN10200: return "mn10200"; ++ case EM_PJ: return "picoJava"; ++ case EM_OR1K: return "OpenRISC 1000"; ++ case EM_ARC_COMPACT: return "ARCompact"; ++ case EM_XTENSA_OLD: ++ case EM_XTENSA: return "Tensilica Xtensa Processor"; ++ case EM_VIDEOCORE: return "Alphamosaic VideoCore processor"; ++ case EM_TMM_GPP: return "Thompson Multimedia General Purpose Processor"; ++ case EM_NS32K: return "National Semiconductor 32000 series"; ++ case EM_TPC: return "Tenor Network TPC processor"; ++ case EM_SNP1K: return "Trebia SNP 1000 processor"; ++ /* 100 */ ++ case EM_ST200: return "STMicroelectronics ST200 microcontroller"; ++ case EM_IP2K_OLD: ++ case EM_IP2K: return "Ubicom IP2xxx 8-bit microcontrollers"; ++ case EM_MAX: return "MAX Processor"; ++ case EM_CR: return "National Semiconductor CompactRISC"; ++ case EM_F2MC16: return "Fujitsu F2MC16"; ++ case EM_MSP430: return "Texas Instruments msp430 microcontroller"; ++ case EM_BLACKFIN: return "Analog Devices Blackfin"; ++ case EM_SE_C33: return "S1C33 Family of Seiko Epson processors"; ++ case EM_SEP: return "Sharp embedded microprocessor"; ++ case EM_ARCA: return "Arca RISC microprocessor"; ++ /* 110 */ ++ case EM_UNICORE: return "Unicore"; ++ case EM_EXCESS: return "eXcess 16/32/64-bit configurable embedded CPU"; ++ case EM_DXP: return "Icera Semiconductor Inc. Deep Execution Processor"; ++ case EM_ALTERA_NIOS2: return "Altera Nios II"; ++ case EM_CRX: return "National Semiconductor CRX microprocessor"; ++ case EM_XGATE: return "Motorola XGATE embedded processor"; ++ case EM_C166: ++ case EM_XC16X: return "Infineon Technologies xc16x"; ++ case EM_M16C: return "Renesas M16C series microprocessors"; ++ case EM_DSPIC30F: return "Microchip Technology dsPIC30F Digital Signal Controller"; ++ case EM_CE: return "Freescale Communication Engine RISC core"; ++ /* 120 */ ++ case EM_M32C: return "Renesas M32c"; ++ /* 130 */ ++ case EM_TSK3000: return "Altium TSK3000 core"; ++ case EM_RS08: return "Freescale RS08 embedded processor"; ++ case EM_ECOG2: return "Cyan Technology eCOG2 microprocessor"; ++ case EM_SCORE: return "SUNPLUS S+Core"; ++ case EM_DSP24: return "New Japan Radio (NJR) 24-bit DSP Processor"; ++ case EM_VIDEOCORE3: return "Broadcom VideoCore III processor"; ++ case EM_LATTICEMICO32: return "Lattice Mico32"; ++ case EM_SE_C17: return "Seiko Epson C17 family"; ++ /* 140 */ ++ case EM_TI_C6000: return "Texas Instruments TMS320C6000 DSP family"; ++ case EM_TI_C2000: return "Texas Instruments TMS320C2000 DSP family"; ++ case EM_TI_C5500: return "Texas Instruments TMS320C55x DSP family"; ++ case EM_TI_PRU: return "TI PRU I/O processor"; ++ /* 160 */ ++ case EM_MMDSP_PLUS: return "STMicroelectronics 64bit VLIW Data Signal Processor"; ++ case EM_CYPRESS_M8C: return "Cypress M8C microprocessor"; ++ case EM_R32C: return "Renesas R32C series microprocessors"; ++ case EM_TRIMEDIA: return "NXP Semiconductors TriMedia architecture family"; ++ case EM_QDSP6: return "QUALCOMM DSP6 Processor"; ++ case EM_8051: return "Intel 8051 and variants"; ++ case EM_STXP7X: return "STMicroelectronics STxP7x family"; ++ case EM_NDS32: return "Andes Technology compact code size embedded RISC processor family"; ++ case EM_ECOG1X: return "Cyan Technology eCOG1X family"; ++ case EM_MAXQ30: return "Dallas Semiconductor MAXQ30 Core microcontrollers"; ++ /* 170 */ ++ case EM_XIMO16: return "New Japan Radio (NJR) 16-bit DSP Processor"; ++ case EM_MANIK: return "M2000 Reconfigurable RISC Microprocessor"; ++ case EM_CRAYNV2: return "Cray Inc. NV2 vector architecture"; ++ case EM_RX: return "Renesas RX"; ++ case EM_METAG: return "Imagination Technologies Meta processor architecture"; ++ case EM_MCST_ELBRUS: return "MCST Elbrus general purpose hardware architecture"; ++ case EM_ECOG16: return "Cyan Technology eCOG16 family"; ++ case EM_CR16: ++ case EM_MICROBLAZE: ++ case EM_MICROBLAZE_OLD: return "Xilinx MicroBlaze"; ++ case EM_ETPU: return "Freescale Extended Time Processing Unit"; ++ case EM_SLE9X: return "Infineon Technologies SLE9X core"; ++ /* 180 */ ++ case EM_L1OM: return "Intel L1OM"; ++ case EM_K1OM: return "Intel K1OM"; ++ case EM_INTEL182: return "Intel (reserved)"; ++ case EM_AARCH64: return "AArch64"; ++ case EM_ARM184: return "ARM (reserved)"; ++ case EM_AVR32: return "Atmel Corporation 32-bit microprocessor"; ++ case EM_STM8: return "STMicroeletronics STM8 8-bit microcontroller"; ++ case EM_TILE64: return "Tilera TILE64 multicore architecture family"; ++ case EM_TILEPRO: return "Tilera TILEPro multicore architecture family"; ++ /* 190 */ ++ case EM_CUDA: return "NVIDIA CUDA architecture"; ++ case EM_TILEGX: return "Tilera TILE-Gx multicore architecture family"; ++ case EM_CLOUDSHIELD: return "CloudShield architecture family"; ++ case EM_COREA_1ST: return "KIPO-KAIST Core-A 1st generation processor family"; ++ case EM_COREA_2ND: return "KIPO-KAIST Core-A 2nd generation processor family"; ++ case EM_ARC_COMPACT2: return "ARCv2"; ++ case EM_OPEN8: return "Open8 8-bit RISC soft processor core"; ++ case EM_RL78: return "Renesas RL78"; ++ case EM_VIDEOCORE5: return "Broadcom VideoCore V processor"; ++ case EM_78K0R: return "Renesas 78K0R"; ++ /* 200 */ ++ case EM_56800EX: return "Freescale 56800EX Digital Signal Controller (DSC)"; ++ case EM_BA1: return "Beyond BA1 CPU architecture"; ++ case EM_BA2: return "Beyond BA2 CPU architecture"; ++ case EM_XCORE: return "XMOS xCORE processor family"; ++ case EM_MCHP_PIC: return "Microchip 8-bit PIC(r) family"; ++ /* 210 */ ++ case EM_KM32: return "KM211 KM32 32-bit processor"; ++ case EM_KMX32: return "KM211 KMX32 32-bit processor"; ++ case EM_KMX16: return "KM211 KMX16 16-bit processor"; ++ case EM_KMX8: return "KM211 KMX8 8-bit processor"; ++ case EM_KVARC: return "KM211 KVARC processor"; ++ case EM_CDP: return "Paneve CDP architecture family"; ++ case EM_COGE: return "Cognitive Smart Memory Processor"; ++ case EM_COOL: return "Bluechip Systems CoolEngine"; ++ case EM_NORC: return "Nanoradio Optimized RISC"; ++ case EM_CSR_KALIMBA: return "CSR Kalimba architecture family"; ++ /* 220 */ ++ case EM_Z80: return "Zilog Z80"; ++ case EM_VISIUM: return "CDS VISIUMcore processor"; ++ case EM_FT32: return "FTDI Chip FT32"; ++ case EM_MOXIE: return "Moxie"; ++ case EM_AMDGPU: return "AMD GPU"; ++ case EM_RISCV: return "RISC-V"; ++ case EM_LANAI: return "Lanai 32-bit processor"; ++ case EM_BPF: return "Linux BPF"; ++ case EM_NFP: return "Netronome Flow Processor"; ++ ++ /* Large numbers... */ ++ case EM_MT: return "Morpho Techologies MT processor"; ++ case EM_ALPHA: return "Alpha"; ++ case EM_WEBASSEMBLY: return "Web Assembly"; ++ case EM_DLX: return "OpenDLX"; ++ case EM_XSTORMY16: return "Sanyo XStormy16 CPU core"; ++ case EM_IQ2000: return "Vitesse IQ2000"; ++ case EM_M32C_OLD: ++ case EM_NIOS32: return "Altera Nios"; ++ case EM_CYGNUS_MEP: return "Toshiba MeP Media Engine"; ++ case EM_ADAPTEVA_EPIPHANY: return "Adapteva EPIPHANY"; ++ case EM_CYGNUS_FRV: return "Fujitsu FR-V"; ++ case EM_S12Z: return "Freescale S12Z"; ++ case EM_CSKY: return "C-SKY"; ++ ++ default: ++ snprintf (buff, sizeof (buff), _(": 0x%x"), e_machine); ++ return buff; ++ } ++} ++ ++static void ++decode_ARC_machine_flags (unsigned e_flags, unsigned e_machine, char buf[]) ++{ ++ /* ARC has two machine types EM_ARC_COMPACT and EM_ARC_COMPACT2. Some ++ other compilers don't a specific architecture type in the e_flags, and ++ instead use EM_ARC_COMPACT for old ARC600, ARC601, and ARC700 ++ architectures, and switch to EM_ARC_COMPACT2 for newer ARCEM and ARCHS ++ architectures. ++ ++ Th GNU tools follows this use of EM_ARC_COMPACT and EM_ARC_COMPACT2, ++ but also sets a specific architecture type in the e_flags field. ++ ++ However, when decoding the flags we don't worry if we see an ++ unexpected pairing, for example EM_ARC_COMPACT machine type, with ++ ARCEM architecture type. */ ++ ++ switch (e_flags & EF_ARC_MACH_MSK) ++ { ++ /* We only expect these to occur for EM_ARC_COMPACT2. */ ++ case EF_ARC_CPU_ARCV2EM: ++ strcat (buf, ", ARC EM"); ++ break; ++ case EF_ARC_CPU_ARCV2HS: ++ strcat (buf, ", ARC HS"); ++ break; ++ ++ /* We only expect these to occur for EM_ARC_COMPACT. */ ++ case E_ARC_MACH_ARC600: ++ strcat (buf, ", ARC600"); ++ break; ++ case E_ARC_MACH_ARC601: ++ strcat (buf, ", ARC601"); ++ break; ++ case E_ARC_MACH_ARC700: ++ strcat (buf, ", ARC700"); ++ break; ++ ++ /* The only times we should end up here are (a) A corrupt ELF, (b) A ++ new ELF with new architecture being read by an old version of ++ readelf, or (c) An ELF built with non-GNU compiler that does not ++ set the architecture in the e_flags. */ ++ default: ++ if (e_machine == EM_ARC_COMPACT) ++ strcat (buf, ", Unknown ARCompact"); ++ else ++ strcat (buf, ", Unknown ARC"); ++ break; ++ } ++ ++ switch (e_flags & EF_ARC_OSABI_MSK) ++ { ++ case E_ARC_OSABI_ORIG: ++ strcat (buf, ", (ABI:legacy)"); ++ break; ++ case E_ARC_OSABI_V2: ++ strcat (buf, ", (ABI:v2)"); ++ break; ++ /* Only upstream 3.9+ kernels will support ARCv2 ISA. */ ++ case E_ARC_OSABI_V3: ++ strcat (buf, ", v3 no-legacy-syscalls ABI"); ++ break; ++ case E_ARC_OSABI_V4: ++ strcat (buf, ", v4 ABI"); ++ break; ++ default: ++ strcat (buf, ", unrecognised ARC OSABI flag"); ++ break; ++ } ++} ++ ++static void ++decode_ARM_machine_flags (unsigned e_flags, char buf[]) ++{ ++ unsigned eabi; ++ bfd_boolean unknown = FALSE; ++ ++ eabi = EF_ARM_EABI_VERSION (e_flags); ++ e_flags &= ~ EF_ARM_EABIMASK; ++ ++ /* Handle "generic" ARM flags. */ ++ if (e_flags & EF_ARM_RELEXEC) ++ { ++ strcat (buf, ", relocatable executable"); ++ e_flags &= ~ EF_ARM_RELEXEC; ++ } ++ ++ if (e_flags & EF_ARM_PIC) ++ { ++ strcat (buf, ", position independent"); ++ e_flags &= ~ EF_ARM_PIC; ++ } ++ ++ /* Now handle EABI specific flags. */ ++ switch (eabi) ++ { ++ default: ++ strcat (buf, ", "); ++ if (e_flags) ++ unknown = TRUE; ++ break; ++ ++ case EF_ARM_EABI_VER1: ++ strcat (buf, ", Version1 EABI"); ++ while (e_flags) ++ { ++ unsigned flag; ++ ++ /* Process flags one bit at a time. */ ++ flag = e_flags & - e_flags; ++ e_flags &= ~ flag; ++ ++ switch (flag) ++ { ++ case EF_ARM_SYMSARESORTED: /* Conflicts with EF_ARM_INTERWORK. */ ++ strcat (buf, ", sorted symbol tables"); ++ break; ++ ++ default: ++ unknown = TRUE; ++ break; ++ } ++ } ++ break; ++ ++ case EF_ARM_EABI_VER2: ++ strcat (buf, ", Version2 EABI"); ++ while (e_flags) ++ { ++ unsigned flag; ++ ++ /* Process flags one bit at a time. */ ++ flag = e_flags & - e_flags; ++ e_flags &= ~ flag; ++ ++ switch (flag) ++ { ++ case EF_ARM_SYMSARESORTED: /* Conflicts with EF_ARM_INTERWORK. */ ++ strcat (buf, ", sorted symbol tables"); ++ break; ++ ++ case EF_ARM_DYNSYMSUSESEGIDX: ++ strcat (buf, ", dynamic symbols use segment index"); ++ break; ++ ++ case EF_ARM_MAPSYMSFIRST: ++ strcat (buf, ", mapping symbols precede others"); ++ break; ++ ++ default: ++ unknown = TRUE; ++ break; ++ } ++ } ++ break; ++ ++ case EF_ARM_EABI_VER3: ++ strcat (buf, ", Version3 EABI"); ++ break; ++ ++ case EF_ARM_EABI_VER4: ++ strcat (buf, ", Version4 EABI"); ++ while (e_flags) ++ { ++ unsigned flag; ++ ++ /* Process flags one bit at a time. */ ++ flag = e_flags & - e_flags; ++ e_flags &= ~ flag; ++ ++ switch (flag) ++ { ++ case EF_ARM_BE8: ++ strcat (buf, ", BE8"); ++ break; ++ ++ case EF_ARM_LE8: ++ strcat (buf, ", LE8"); ++ break; ++ ++ default: ++ unknown = TRUE; ++ break; ++ } ++ } ++ break; ++ ++ case EF_ARM_EABI_VER5: ++ strcat (buf, ", Version5 EABI"); ++ while (e_flags) ++ { ++ unsigned flag; ++ ++ /* Process flags one bit at a time. */ ++ flag = e_flags & - e_flags; ++ e_flags &= ~ flag; ++ ++ switch (flag) ++ { ++ case EF_ARM_BE8: ++ strcat (buf, ", BE8"); ++ break; ++ ++ case EF_ARM_LE8: ++ strcat (buf, ", LE8"); ++ break; ++ ++ case EF_ARM_ABI_FLOAT_SOFT: /* Conflicts with EF_ARM_SOFT_FLOAT. */ ++ strcat (buf, ", soft-float ABI"); ++ break; ++ ++ case EF_ARM_ABI_FLOAT_HARD: /* Conflicts with EF_ARM_VFP_FLOAT. */ ++ strcat (buf, ", hard-float ABI"); ++ break; ++ ++ default: ++ unknown = TRUE; ++ break; ++ } ++ } ++ break; ++ ++ case EF_ARM_EABI_UNKNOWN: ++ strcat (buf, ", GNU EABI"); ++ while (e_flags) ++ { ++ unsigned flag; ++ ++ /* Process flags one bit at a time. */ ++ flag = e_flags & - e_flags; ++ e_flags &= ~ flag; ++ ++ switch (flag) ++ { ++ case EF_ARM_INTERWORK: ++ strcat (buf, ", interworking enabled"); ++ break; ++ ++ case EF_ARM_APCS_26: ++ strcat (buf, ", uses APCS/26"); ++ break; ++ ++ case EF_ARM_APCS_FLOAT: ++ strcat (buf, ", uses APCS/float"); ++ break; ++ ++ case EF_ARM_PIC: ++ strcat (buf, ", position independent"); ++ break; ++ ++ case EF_ARM_ALIGN8: ++ strcat (buf, ", 8 bit structure alignment"); ++ break; ++ ++ case EF_ARM_NEW_ABI: ++ strcat (buf, ", uses new ABI"); ++ break; ++ ++ case EF_ARM_OLD_ABI: ++ strcat (buf, ", uses old ABI"); ++ break; ++ ++ case EF_ARM_SOFT_FLOAT: ++ strcat (buf, ", software FP"); ++ break; ++ ++ case EF_ARM_VFP_FLOAT: ++ strcat (buf, ", VFP"); ++ break; ++ ++ case EF_ARM_MAVERICK_FLOAT: ++ strcat (buf, ", Maverick FP"); ++ break; ++ ++ default: ++ unknown = TRUE; ++ break; ++ } ++ } ++ } ++ ++ if (unknown) ++ strcat (buf,_(", ")); ++} ++ ++static void ++decode_AVR_machine_flags (unsigned e_flags, char buf[], size_t size) ++{ ++ --size; /* Leave space for null terminator. */ ++ ++ switch (e_flags & EF_AVR_MACH) ++ { ++ case E_AVR_MACH_AVR1: ++ strncat (buf, ", avr:1", size); ++ break; ++ case E_AVR_MACH_AVR2: ++ strncat (buf, ", avr:2", size); ++ break; ++ case E_AVR_MACH_AVR25: ++ strncat (buf, ", avr:25", size); ++ break; ++ case E_AVR_MACH_AVR3: ++ strncat (buf, ", avr:3", size); ++ break; ++ case E_AVR_MACH_AVR31: ++ strncat (buf, ", avr:31", size); ++ break; ++ case E_AVR_MACH_AVR35: ++ strncat (buf, ", avr:35", size); ++ break; ++ case E_AVR_MACH_AVR4: ++ strncat (buf, ", avr:4", size); ++ break; ++ case E_AVR_MACH_AVR5: ++ strncat (buf, ", avr:5", size); ++ break; ++ case E_AVR_MACH_AVR51: ++ strncat (buf, ", avr:51", size); ++ break; ++ case E_AVR_MACH_AVR6: ++ strncat (buf, ", avr:6", size); ++ break; ++ case E_AVR_MACH_AVRTINY: ++ strncat (buf, ", avr:100", size); ++ break; ++ case E_AVR_MACH_XMEGA1: ++ strncat (buf, ", avr:101", size); ++ break; ++ case E_AVR_MACH_XMEGA2: ++ strncat (buf, ", avr:102", size); ++ break; ++ case E_AVR_MACH_XMEGA3: ++ strncat (buf, ", avr:103", size); ++ break; ++ case E_AVR_MACH_XMEGA4: ++ strncat (buf, ", avr:104", size); ++ break; ++ case E_AVR_MACH_XMEGA5: ++ strncat (buf, ", avr:105", size); ++ break; ++ case E_AVR_MACH_XMEGA6: ++ strncat (buf, ", avr:106", size); ++ break; ++ case E_AVR_MACH_XMEGA7: ++ strncat (buf, ", avr:107", size); ++ break; ++ default: ++ strncat (buf, ", avr:", size); ++ break; ++ } ++ ++ size -= strlen (buf); ++ if (e_flags & EF_AVR_LINKRELAX_PREPARED) ++ strncat (buf, ", link-relax", size); ++} ++ ++static void ++decode_NDS32_machine_flags (unsigned e_flags, char buf[], size_t size) ++{ ++ unsigned abi; ++ unsigned arch; ++ unsigned config; ++ unsigned version; ++ bfd_boolean has_fpu = FALSE; ++ unsigned int r = 0; ++ ++ static const char *ABI_STRINGS[] = ++ { ++ "ABI v0", /* use r5 as return register; only used in N1213HC */ ++ "ABI v1", /* use r0 as return register */ ++ "ABI v2", /* use r0 as return register and don't reserve 24 bytes for arguments */ ++ "ABI v2fp", /* for FPU */ ++ "AABI", ++ "ABI2 FP+" ++ }; ++ static const char *VER_STRINGS[] = ++ { ++ "Andes ELF V1.3 or older", ++ "Andes ELF V1.3.1", ++ "Andes ELF V1.4" ++ }; ++ static const char *ARCH_STRINGS[] = ++ { ++ "", ++ "Andes Star v1.0", ++ "Andes Star v2.0", ++ "Andes Star v3.0", ++ "Andes Star v3.0m" ++ }; ++ ++ abi = EF_NDS_ABI & e_flags; ++ arch = EF_NDS_ARCH & e_flags; ++ config = EF_NDS_INST & e_flags; ++ version = EF_NDS32_ELF_VERSION & e_flags; ++ ++ memset (buf, 0, size); ++ ++ switch (abi) ++ { ++ case E_NDS_ABI_V0: ++ case E_NDS_ABI_V1: ++ case E_NDS_ABI_V2: ++ case E_NDS_ABI_V2FP: ++ case E_NDS_ABI_AABI: ++ case E_NDS_ABI_V2FP_PLUS: ++ /* In case there are holes in the array. */ ++ r += snprintf (buf + r, size - r, ", %s", ABI_STRINGS[abi >> EF_NDS_ABI_SHIFT]); ++ break; ++ ++ default: ++ r += snprintf (buf + r, size - r, ", "); ++ break; ++ } ++ ++ switch (version) ++ { ++ case E_NDS32_ELF_VER_1_2: ++ case E_NDS32_ELF_VER_1_3: ++ case E_NDS32_ELF_VER_1_4: ++ r += snprintf (buf + r, size - r, ", %s", VER_STRINGS[version >> EF_NDS32_ELF_VERSION_SHIFT]); ++ break; ++ ++ default: ++ r += snprintf (buf + r, size - r, ", "); ++ break; ++ } ++ ++ if (E_NDS_ABI_V0 == abi) ++ { ++ /* OLD ABI; only used in N1213HC, has performance extension 1. */ ++ r += snprintf (buf + r, size - r, ", Andes Star v1.0, N1213HC, MAC, PERF1"); ++ if (arch == E_NDS_ARCH_STAR_V1_0) ++ r += snprintf (buf + r, size -r, ", 16b"); /* has 16-bit instructions */ ++ return; ++ } ++ ++ switch (arch) ++ { ++ case E_NDS_ARCH_STAR_V1_0: ++ case E_NDS_ARCH_STAR_V2_0: ++ case E_NDS_ARCH_STAR_V3_0: ++ case E_NDS_ARCH_STAR_V3_M: ++ r += snprintf (buf + r, size - r, ", %s", ARCH_STRINGS[arch >> EF_NDS_ARCH_SHIFT]); ++ break; ++ ++ default: ++ r += snprintf (buf + r, size - r, ", "); ++ /* ARCH version determines how the e_flags are interpreted. ++ If it is unknown, we cannot proceed. */ ++ return; ++ } ++ ++ /* Newer ABI; Now handle architecture specific flags. */ ++ if (arch == E_NDS_ARCH_STAR_V1_0) ++ { ++ if (config & E_NDS32_HAS_MFUSR_PC_INST) ++ r += snprintf (buf + r, size -r, ", MFUSR_PC"); ++ ++ if (!(config & E_NDS32_HAS_NO_MAC_INST)) ++ r += snprintf (buf + r, size -r, ", MAC"); ++ ++ if (config & E_NDS32_HAS_DIV_INST) ++ r += snprintf (buf + r, size -r, ", DIV"); ++ ++ if (config & E_NDS32_HAS_16BIT_INST) ++ r += snprintf (buf + r, size -r, ", 16b"); ++ } ++ else ++ { ++ if (config & E_NDS32_HAS_MFUSR_PC_INST) ++ { ++ if (version <= E_NDS32_ELF_VER_1_3) ++ r += snprintf (buf + r, size -r, ", [B8]"); ++ else ++ r += snprintf (buf + r, size -r, ", EX9"); ++ } ++ ++ if (config & E_NDS32_HAS_MAC_DX_INST) ++ r += snprintf (buf + r, size -r, ", MAC_DX"); ++ ++ if (config & E_NDS32_HAS_DIV_DX_INST) ++ r += snprintf (buf + r, size -r, ", DIV_DX"); ++ ++ if (config & E_NDS32_HAS_16BIT_INST) ++ { ++ if (version <= E_NDS32_ELF_VER_1_3) ++ r += snprintf (buf + r, size -r, ", 16b"); ++ else ++ r += snprintf (buf + r, size -r, ", IFC"); ++ } ++ } ++ ++ if (config & E_NDS32_HAS_EXT_INST) ++ r += snprintf (buf + r, size -r, ", PERF1"); ++ ++ if (config & E_NDS32_HAS_EXT2_INST) ++ r += snprintf (buf + r, size -r, ", PERF2"); ++ ++ if (config & E_NDS32_HAS_FPU_INST) ++ { ++ has_fpu = TRUE; ++ r += snprintf (buf + r, size -r, ", FPU_SP"); ++ } ++ ++ if (config & E_NDS32_HAS_FPU_DP_INST) ++ { ++ has_fpu = TRUE; ++ r += snprintf (buf + r, size -r, ", FPU_DP"); ++ } ++ ++ if (config & E_NDS32_HAS_FPU_MAC_INST) ++ { ++ has_fpu = TRUE; ++ r += snprintf (buf + r, size -r, ", FPU_MAC"); ++ } ++ ++ if (has_fpu) ++ { ++ switch ((config & E_NDS32_FPU_REG_CONF) >> E_NDS32_FPU_REG_CONF_SHIFT) ++ { ++ case E_NDS32_FPU_REG_8SP_4DP: ++ r += snprintf (buf + r, size -r, ", FPU_REG:8/4"); ++ break; ++ case E_NDS32_FPU_REG_16SP_8DP: ++ r += snprintf (buf + r, size -r, ", FPU_REG:16/8"); ++ break; ++ case E_NDS32_FPU_REG_32SP_16DP: ++ r += snprintf (buf + r, size -r, ", FPU_REG:32/16"); ++ break; ++ case E_NDS32_FPU_REG_32SP_32DP: ++ r += snprintf (buf + r, size -r, ", FPU_REG:32/32"); ++ break; ++ } ++ } ++ ++ if (config & E_NDS32_HAS_AUDIO_INST) ++ r += snprintf (buf + r, size -r, ", AUDIO"); ++ ++ if (config & E_NDS32_HAS_STRING_INST) ++ r += snprintf (buf + r, size -r, ", STR"); ++ ++ if (config & E_NDS32_HAS_REDUCED_REGS) ++ r += snprintf (buf + r, size -r, ", 16REG"); ++ ++ if (config & E_NDS32_HAS_VIDEO_INST) ++ { ++ if (version <= E_NDS32_ELF_VER_1_3) ++ r += snprintf (buf + r, size -r, ", VIDEO"); ++ else ++ r += snprintf (buf + r, size -r, ", SATURATION"); ++ } ++ ++ if (config & E_NDS32_HAS_ENCRIPT_INST) ++ r += snprintf (buf + r, size -r, ", ENCRP"); ++ ++ if (config & E_NDS32_HAS_L2C_INST) ++ r += snprintf (buf + r, size -r, ", L2C"); ++} ++ ++static char * ++get_machine_flags (Filedata * filedata, unsigned e_flags, unsigned e_machine) ++{ ++ static char buf[1024]; ++ ++ buf[0] = '\0'; ++ ++ if (e_flags) ++ { ++ switch (e_machine) ++ { ++ default: ++ break; ++ ++ case EM_ARC_COMPACT2: ++ case EM_ARC_COMPACT: ++ decode_ARC_machine_flags (e_flags, e_machine, buf); ++ break; ++ ++ case EM_ARM: ++ decode_ARM_machine_flags (e_flags, buf); ++ break; ++ ++ case EM_AVR: ++ decode_AVR_machine_flags (e_flags, buf, sizeof buf); ++ break; ++ ++ case EM_BLACKFIN: ++ if (e_flags & EF_BFIN_PIC) ++ strcat (buf, ", PIC"); ++ ++ if (e_flags & EF_BFIN_FDPIC) ++ strcat (buf, ", FDPIC"); ++ ++ if (e_flags & EF_BFIN_CODE_IN_L1) ++ strcat (buf, ", code in L1"); ++ ++ if (e_flags & EF_BFIN_DATA_IN_L1) ++ strcat (buf, ", data in L1"); ++ ++ break; ++ ++ case EM_CYGNUS_FRV: ++ switch (e_flags & EF_FRV_CPU_MASK) ++ { ++ case EF_FRV_CPU_GENERIC: ++ break; ++ ++ default: ++ strcat (buf, ", fr???"); ++ break; ++ ++ case EF_FRV_CPU_FR300: ++ strcat (buf, ", fr300"); ++ break; ++ ++ case EF_FRV_CPU_FR400: ++ strcat (buf, ", fr400"); ++ break; ++ case EF_FRV_CPU_FR405: ++ strcat (buf, ", fr405"); ++ break; ++ ++ case EF_FRV_CPU_FR450: ++ strcat (buf, ", fr450"); ++ break; ++ ++ case EF_FRV_CPU_FR500: ++ strcat (buf, ", fr500"); ++ break; ++ case EF_FRV_CPU_FR550: ++ strcat (buf, ", fr550"); ++ break; ++ ++ case EF_FRV_CPU_SIMPLE: ++ strcat (buf, ", simple"); ++ break; ++ case EF_FRV_CPU_TOMCAT: ++ strcat (buf, ", tomcat"); ++ break; ++ } ++ break; ++ ++ case EM_68K: ++ if ((e_flags & EF_M68K_ARCH_MASK) == EF_M68K_M68000) ++ strcat (buf, ", m68000"); ++ else if ((e_flags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32) ++ strcat (buf, ", cpu32"); ++ else if ((e_flags & EF_M68K_ARCH_MASK) == EF_M68K_FIDO) ++ strcat (buf, ", fido_a"); ++ else ++ { ++ char const * isa = _("unknown"); ++ char const * mac = _("unknown mac"); ++ char const * additional = NULL; ++ ++ switch (e_flags & EF_M68K_CF_ISA_MASK) ++ { ++ case EF_M68K_CF_ISA_A_NODIV: ++ isa = "A"; ++ additional = ", nodiv"; ++ break; ++ case EF_M68K_CF_ISA_A: ++ isa = "A"; ++ break; ++ case EF_M68K_CF_ISA_A_PLUS: ++ isa = "A+"; ++ break; ++ case EF_M68K_CF_ISA_B_NOUSP: ++ isa = "B"; ++ additional = ", nousp"; ++ break; ++ case EF_M68K_CF_ISA_B: ++ isa = "B"; ++ break; ++ case EF_M68K_CF_ISA_C: ++ isa = "C"; ++ break; ++ case EF_M68K_CF_ISA_C_NODIV: ++ isa = "C"; ++ additional = ", nodiv"; ++ break; ++ } ++ strcat (buf, ", cf, isa "); ++ strcat (buf, isa); ++ if (additional) ++ strcat (buf, additional); ++ if (e_flags & EF_M68K_CF_FLOAT) ++ strcat (buf, ", float"); ++ switch (e_flags & EF_M68K_CF_MAC_MASK) ++ { ++ case 0: ++ mac = NULL; ++ break; ++ case EF_M68K_CF_MAC: ++ mac = "mac"; ++ break; ++ case EF_M68K_CF_EMAC: ++ mac = "emac"; ++ break; ++ case EF_M68K_CF_EMAC_B: ++ mac = "emac_b"; ++ break; ++ } ++ if (mac) ++ { ++ strcat (buf, ", "); ++ strcat (buf, mac); ++ } ++ } ++ break; ++ ++ case EM_CYGNUS_MEP: ++ switch (e_flags & EF_MEP_CPU_MASK) ++ { ++ case EF_MEP_CPU_MEP: strcat (buf, ", generic MeP"); break; ++ case EF_MEP_CPU_C2: strcat (buf, ", MeP C2"); break; ++ case EF_MEP_CPU_C3: strcat (buf, ", MeP C3"); break; ++ case EF_MEP_CPU_C4: strcat (buf, ", MeP C4"); break; ++ case EF_MEP_CPU_C5: strcat (buf, ", MeP C5"); break; ++ case EF_MEP_CPU_H1: strcat (buf, ", MeP H1"); break; ++ default: strcat (buf, _(", ")); break; ++ } ++ ++ switch (e_flags & EF_MEP_COP_MASK) ++ { ++ case EF_MEP_COP_NONE: break; ++ case EF_MEP_COP_AVC: strcat (buf, ", AVC coprocessor"); break; ++ case EF_MEP_COP_AVC2: strcat (buf, ", AVC2 coprocessor"); break; ++ case EF_MEP_COP_FMAX: strcat (buf, ", FMAX coprocessor"); break; ++ case EF_MEP_COP_IVC2: strcat (buf, ", IVC2 coprocessor"); break; ++ default: strcat (buf, _("")); break; ++ } ++ ++ if (e_flags & EF_MEP_LIBRARY) ++ strcat (buf, ", Built for Library"); ++ ++ if (e_flags & EF_MEP_INDEX_MASK) ++ sprintf (buf + strlen (buf), ", Configuration Index: %#x", ++ e_flags & EF_MEP_INDEX_MASK); ++ ++ if (e_flags & ~ EF_MEP_ALL_FLAGS) ++ sprintf (buf + strlen (buf), _(", unknown flags bits: %#x"), ++ e_flags & ~ EF_MEP_ALL_FLAGS); ++ break; ++ ++ case EM_PPC: ++ if (e_flags & EF_PPC_EMB) ++ strcat (buf, ", emb"); ++ ++ if (e_flags & EF_PPC_RELOCATABLE) ++ strcat (buf, _(", relocatable")); ++ ++ if (e_flags & EF_PPC_RELOCATABLE_LIB) ++ strcat (buf, _(", relocatable-lib")); ++ break; ++ ++ case EM_PPC64: ++ if (e_flags & EF_PPC64_ABI) ++ { ++ char abi[] = ", abiv0"; ++ ++ abi[6] += e_flags & EF_PPC64_ABI; ++ strcat (buf, abi); ++ } ++ break; ++ ++ case EM_V800: ++ if ((e_flags & EF_RH850_ABI) == EF_RH850_ABI) ++ strcat (buf, ", RH850 ABI"); ++ ++ if (e_flags & EF_V800_850E3) ++ strcat (buf, ", V3 architecture"); ++ ++ if ((e_flags & (EF_RH850_FPU_DOUBLE | EF_RH850_FPU_SINGLE)) == 0) ++ strcat (buf, ", FPU not used"); ++ ++ if ((e_flags & (EF_RH850_REGMODE22 | EF_RH850_REGMODE32)) == 0) ++ strcat (buf, ", regmode: COMMON"); ++ ++ if ((e_flags & (EF_RH850_GP_FIX | EF_RH850_GP_NOFIX)) == 0) ++ strcat (buf, ", r4 not used"); ++ ++ if ((e_flags & (EF_RH850_EP_FIX | EF_RH850_EP_NOFIX)) == 0) ++ strcat (buf, ", r30 not used"); ++ ++ if ((e_flags & (EF_RH850_TP_FIX | EF_RH850_TP_NOFIX)) == 0) ++ strcat (buf, ", r5 not used"); ++ ++ if ((e_flags & (EF_RH850_REG2_RESERVE | EF_RH850_REG2_NORESERVE)) == 0) ++ strcat (buf, ", r2 not used"); ++ ++ for (e_flags &= 0xFFFF; e_flags; e_flags &= ~ (e_flags & - e_flags)) ++ { ++ switch (e_flags & - e_flags) ++ { ++ case EF_RH850_FPU_DOUBLE: strcat (buf, ", double precision FPU"); break; ++ case EF_RH850_FPU_SINGLE: strcat (buf, ", single precision FPU"); break; ++ case EF_RH850_REGMODE22: strcat (buf, ", regmode:22"); break; ++ case EF_RH850_REGMODE32: strcat (buf, ", regmode:23"); break; ++ case EF_RH850_GP_FIX: strcat (buf, ", r4 fixed"); break; ++ case EF_RH850_GP_NOFIX: strcat (buf, ", r4 free"); break; ++ case EF_RH850_EP_FIX: strcat (buf, ", r30 fixed"); break; ++ case EF_RH850_EP_NOFIX: strcat (buf, ", r30 free"); break; ++ case EF_RH850_TP_FIX: strcat (buf, ", r5 fixed"); break; ++ case EF_RH850_TP_NOFIX: strcat (buf, ", r5 free"); break; ++ case EF_RH850_REG2_RESERVE: strcat (buf, ", r2 fixed"); break; ++ case EF_RH850_REG2_NORESERVE: strcat (buf, ", r2 free"); break; ++ default: break; ++ } ++ } ++ break; ++ ++ case EM_V850: ++ case EM_CYGNUS_V850: ++ switch (e_flags & EF_V850_ARCH) ++ { ++ case E_V850E3V5_ARCH: ++ strcat (buf, ", v850e3v5"); ++ break; ++ case E_V850E2V3_ARCH: ++ strcat (buf, ", v850e2v3"); ++ break; ++ case E_V850E2_ARCH: ++ strcat (buf, ", v850e2"); ++ break; ++ case E_V850E1_ARCH: ++ strcat (buf, ", v850e1"); ++ break; ++ case E_V850E_ARCH: ++ strcat (buf, ", v850e"); ++ break; ++ case E_V850_ARCH: ++ strcat (buf, ", v850"); ++ break; ++ default: ++ strcat (buf, _(", unknown v850 architecture variant")); ++ break; ++ } ++ break; ++ ++ case EM_M32R: ++ case EM_CYGNUS_M32R: ++ if ((e_flags & EF_M32R_ARCH) == E_M32R_ARCH) ++ strcat (buf, ", m32r"); ++ break; ++ ++ case EM_MIPS: ++ case EM_MIPS_RS3_LE: ++ if (e_flags & EF_MIPS_NOREORDER) ++ strcat (buf, ", noreorder"); ++ ++ if (e_flags & EF_MIPS_PIC) ++ strcat (buf, ", pic"); ++ ++ if (e_flags & EF_MIPS_CPIC) ++ strcat (buf, ", cpic"); ++ ++ if (e_flags & EF_MIPS_UCODE) ++ strcat (buf, ", ugen_reserved"); ++ ++ if (e_flags & EF_MIPS_ABI2) ++ strcat (buf, ", abi2"); ++ ++ if (e_flags & EF_MIPS_OPTIONS_FIRST) ++ strcat (buf, ", odk first"); ++ ++ if (e_flags & EF_MIPS_32BITMODE) ++ strcat (buf, ", 32bitmode"); ++ ++ if (e_flags & EF_MIPS_NAN2008) ++ strcat (buf, ", nan2008"); ++ ++ if (e_flags & EF_MIPS_FP64) ++ strcat (buf, ", fp64"); ++ ++ switch ((e_flags & EF_MIPS_MACH)) ++ { ++ case E_MIPS_MACH_3900: strcat (buf, ", 3900"); break; ++ case E_MIPS_MACH_4010: strcat (buf, ", 4010"); break; ++ case E_MIPS_MACH_4100: strcat (buf, ", 4100"); break; ++ case E_MIPS_MACH_4111: strcat (buf, ", 4111"); break; ++ case E_MIPS_MACH_4120: strcat (buf, ", 4120"); break; ++ case E_MIPS_MACH_4650: strcat (buf, ", 4650"); break; ++ case E_MIPS_MACH_5400: strcat (buf, ", 5400"); break; ++ case E_MIPS_MACH_5500: strcat (buf, ", 5500"); break; ++ case E_MIPS_MACH_5900: strcat (buf, ", 5900"); break; ++ case E_MIPS_MACH_SB1: strcat (buf, ", sb1"); break; ++ case E_MIPS_MACH_9000: strcat (buf, ", 9000"); break; ++ case E_MIPS_MACH_LS2E: strcat (buf, ", loongson-2e"); break; ++ case E_MIPS_MACH_LS2F: strcat (buf, ", loongson-2f"); break; ++ case E_MIPS_MACH_GS464: strcat (buf, ", gs464"); break; ++ case E_MIPS_MACH_GS464E: strcat (buf, ", gs464e"); break; ++ case E_MIPS_MACH_GS264E: strcat (buf, ", gs264e"); break; ++ case E_MIPS_MACH_OCTEON: strcat (buf, ", octeon"); break; ++ case E_MIPS_MACH_OCTEON2: strcat (buf, ", octeon2"); break; ++ case E_MIPS_MACH_OCTEON3: strcat (buf, ", octeon3"); break; ++ case E_MIPS_MACH_XLR: strcat (buf, ", xlr"); break; ++ case E_MIPS_MACH_IAMR2: strcat (buf, ", interaptiv-mr2"); break; ++ case 0: ++ /* We simply ignore the field in this case to avoid confusion: ++ MIPS ELF does not specify EF_MIPS_MACH, it is a GNU ++ extension. */ ++ break; ++ default: strcat (buf, _(", unknown CPU")); break; ++ } ++ ++ switch ((e_flags & EF_MIPS_ABI)) ++ { ++ case E_MIPS_ABI_O32: strcat (buf, ", o32"); break; ++ case E_MIPS_ABI_O64: strcat (buf, ", o64"); break; ++ case E_MIPS_ABI_EABI32: strcat (buf, ", eabi32"); break; ++ case E_MIPS_ABI_EABI64: strcat (buf, ", eabi64"); break; ++ case 0: ++ /* We simply ignore the field in this case to avoid confusion: ++ MIPS ELF does not specify EF_MIPS_ABI, it is a GNU extension. ++ This means it is likely to be an o32 file, but not for ++ sure. */ ++ break; ++ default: strcat (buf, _(", unknown ABI")); break; ++ } ++ ++ if (e_flags & EF_MIPS_ARCH_ASE_MDMX) ++ strcat (buf, ", mdmx"); ++ ++ if (e_flags & EF_MIPS_ARCH_ASE_M16) ++ strcat (buf, ", mips16"); ++ ++ if (e_flags & EF_MIPS_ARCH_ASE_MICROMIPS) ++ strcat (buf, ", micromips"); ++ ++ switch ((e_flags & EF_MIPS_ARCH)) ++ { ++ case E_MIPS_ARCH_1: strcat (buf, ", mips1"); break; ++ case E_MIPS_ARCH_2: strcat (buf, ", mips2"); break; ++ case E_MIPS_ARCH_3: strcat (buf, ", mips3"); break; ++ case E_MIPS_ARCH_4: strcat (buf, ", mips4"); break; ++ case E_MIPS_ARCH_5: strcat (buf, ", mips5"); break; ++ case E_MIPS_ARCH_32: strcat (buf, ", mips32"); break; ++ case E_MIPS_ARCH_32R2: strcat (buf, ", mips32r2"); break; ++ case E_MIPS_ARCH_32R6: strcat (buf, ", mips32r6"); break; ++ case E_MIPS_ARCH_64: strcat (buf, ", mips64"); break; ++ case E_MIPS_ARCH_64R2: strcat (buf, ", mips64r2"); break; ++ case E_MIPS_ARCH_64R6: strcat (buf, ", mips64r6"); break; ++ default: strcat (buf, _(", unknown ISA")); break; ++ } ++ break; ++ ++ case EM_NDS32: ++ decode_NDS32_machine_flags (e_flags, buf, sizeof buf); ++ break; ++ ++ case EM_NFP: ++ switch (EF_NFP_MACH (e_flags)) ++ { ++ case E_NFP_MACH_3200: ++ strcat (buf, ", NFP-32xx"); ++ break; ++ case E_NFP_MACH_6000: ++ strcat (buf, ", NFP-6xxx"); ++ break; ++ } ++ break; ++ ++ case EM_RISCV: ++ if (e_flags & EF_RISCV_RVC) ++ strcat (buf, ", RVC"); ++ ++ if (e_flags & EF_RISCV_RVE) ++ strcat (buf, ", RVE"); ++ ++ switch (e_flags & EF_RISCV_FLOAT_ABI) ++ { ++ case EF_RISCV_FLOAT_ABI_SOFT: ++ strcat (buf, ", soft-float ABI"); ++ break; ++ ++ case EF_RISCV_FLOAT_ABI_SINGLE: ++ strcat (buf, ", single-float ABI"); ++ break; ++ ++ case EF_RISCV_FLOAT_ABI_DOUBLE: ++ strcat (buf, ", double-float ABI"); ++ break; ++ ++ case EF_RISCV_FLOAT_ABI_QUAD: ++ strcat (buf, ", quad-float ABI"); ++ break; ++ } ++ break; ++ ++ case EM_SH: ++ switch ((e_flags & EF_SH_MACH_MASK)) ++ { ++ case EF_SH1: strcat (buf, ", sh1"); break; ++ case EF_SH2: strcat (buf, ", sh2"); break; ++ case EF_SH3: strcat (buf, ", sh3"); break; ++ case EF_SH_DSP: strcat (buf, ", sh-dsp"); break; ++ case EF_SH3_DSP: strcat (buf, ", sh3-dsp"); break; ++ case EF_SH4AL_DSP: strcat (buf, ", sh4al-dsp"); break; ++ case EF_SH3E: strcat (buf, ", sh3e"); break; ++ case EF_SH4: strcat (buf, ", sh4"); break; ++ case EF_SH5: strcat (buf, ", sh5"); break; ++ case EF_SH2E: strcat (buf, ", sh2e"); break; ++ case EF_SH4A: strcat (buf, ", sh4a"); break; ++ case EF_SH2A: strcat (buf, ", sh2a"); break; ++ case EF_SH4_NOFPU: strcat (buf, ", sh4-nofpu"); break; ++ case EF_SH4A_NOFPU: strcat (buf, ", sh4a-nofpu"); break; ++ case EF_SH2A_NOFPU: strcat (buf, ", sh2a-nofpu"); break; ++ case EF_SH3_NOMMU: strcat (buf, ", sh3-nommu"); break; ++ case EF_SH4_NOMMU_NOFPU: strcat (buf, ", sh4-nommu-nofpu"); break; ++ case EF_SH2A_SH4_NOFPU: strcat (buf, ", sh2a-nofpu-or-sh4-nommu-nofpu"); break; ++ case EF_SH2A_SH3_NOFPU: strcat (buf, ", sh2a-nofpu-or-sh3-nommu"); break; ++ case EF_SH2A_SH4: strcat (buf, ", sh2a-or-sh4"); break; ++ case EF_SH2A_SH3E: strcat (buf, ", sh2a-or-sh3e"); break; ++ default: strcat (buf, _(", unknown ISA")); break; ++ } ++ ++ if (e_flags & EF_SH_PIC) ++ strcat (buf, ", pic"); ++ ++ if (e_flags & EF_SH_FDPIC) ++ strcat (buf, ", fdpic"); ++ break; ++ ++ case EM_OR1K: ++ if (e_flags & EF_OR1K_NODELAY) ++ strcat (buf, ", no delay"); ++ break; ++ ++ case EM_SPARCV9: ++ if (e_flags & EF_SPARC_32PLUS) ++ strcat (buf, ", v8+"); ++ ++ if (e_flags & EF_SPARC_SUN_US1) ++ strcat (buf, ", ultrasparcI"); ++ ++ if (e_flags & EF_SPARC_SUN_US3) ++ strcat (buf, ", ultrasparcIII"); ++ ++ if (e_flags & EF_SPARC_HAL_R1) ++ strcat (buf, ", halr1"); ++ ++ if (e_flags & EF_SPARC_LEDATA) ++ strcat (buf, ", ledata"); ++ ++ if ((e_flags & EF_SPARCV9_MM) == EF_SPARCV9_TSO) ++ strcat (buf, ", tso"); ++ ++ if ((e_flags & EF_SPARCV9_MM) == EF_SPARCV9_PSO) ++ strcat (buf, ", pso"); ++ ++ if ((e_flags & EF_SPARCV9_MM) == EF_SPARCV9_RMO) ++ strcat (buf, ", rmo"); ++ break; ++ ++ case EM_PARISC: ++ switch (e_flags & EF_PARISC_ARCH) ++ { ++ case EFA_PARISC_1_0: ++ strcpy (buf, ", PA-RISC 1.0"); ++ break; ++ case EFA_PARISC_1_1: ++ strcpy (buf, ", PA-RISC 1.1"); ++ break; ++ case EFA_PARISC_2_0: ++ strcpy (buf, ", PA-RISC 2.0"); ++ break; ++ default: ++ break; ++ } ++ if (e_flags & EF_PARISC_TRAPNIL) ++ strcat (buf, ", trapnil"); ++ if (e_flags & EF_PARISC_EXT) ++ strcat (buf, ", ext"); ++ if (e_flags & EF_PARISC_LSB) ++ strcat (buf, ", lsb"); ++ if (e_flags & EF_PARISC_WIDE) ++ strcat (buf, ", wide"); ++ if (e_flags & EF_PARISC_NO_KABP) ++ strcat (buf, ", no kabp"); ++ if (e_flags & EF_PARISC_LAZYSWAP) ++ strcat (buf, ", lazyswap"); ++ break; ++ ++ case EM_PJ: ++ case EM_PJ_OLD: ++ if ((e_flags & EF_PICOJAVA_NEWCALLS) == EF_PICOJAVA_NEWCALLS) ++ strcat (buf, ", new calling convention"); ++ ++ if ((e_flags & EF_PICOJAVA_GNUCALLS) == EF_PICOJAVA_GNUCALLS) ++ strcat (buf, ", gnu calling convention"); ++ break; ++ ++ case EM_IA_64: ++ if ((e_flags & EF_IA_64_ABI64)) ++ strcat (buf, ", 64-bit"); ++ else ++ strcat (buf, ", 32-bit"); ++ if ((e_flags & EF_IA_64_REDUCEDFP)) ++ strcat (buf, ", reduced fp model"); ++ if ((e_flags & EF_IA_64_NOFUNCDESC_CONS_GP)) ++ strcat (buf, ", no function descriptors, constant gp"); ++ else if ((e_flags & EF_IA_64_CONS_GP)) ++ strcat (buf, ", constant gp"); ++ if ((e_flags & EF_IA_64_ABSOLUTE)) ++ strcat (buf, ", absolute"); ++ if (filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_OPENVMS) ++ { ++ if ((e_flags & EF_IA_64_VMS_LINKAGES)) ++ strcat (buf, ", vms_linkages"); ++ switch ((e_flags & EF_IA_64_VMS_COMCOD)) ++ { ++ case EF_IA_64_VMS_COMCOD_SUCCESS: ++ break; ++ case EF_IA_64_VMS_COMCOD_WARNING: ++ strcat (buf, ", warning"); ++ break; ++ case EF_IA_64_VMS_COMCOD_ERROR: ++ strcat (buf, ", error"); ++ break; ++ case EF_IA_64_VMS_COMCOD_ABORT: ++ strcat (buf, ", abort"); ++ break; ++ default: ++ warn (_("Unrecognised IA64 VMS Command Code: %x\n"), ++ e_flags & EF_IA_64_VMS_COMCOD); ++ strcat (buf, ", "); ++ } ++ } ++ break; ++ ++ case EM_VAX: ++ if ((e_flags & EF_VAX_NONPIC)) ++ strcat (buf, ", non-PIC"); ++ if ((e_flags & EF_VAX_DFLOAT)) ++ strcat (buf, ", D-Float"); ++ if ((e_flags & EF_VAX_GFLOAT)) ++ strcat (buf, ", G-Float"); ++ break; ++ ++ case EM_VISIUM: ++ if (e_flags & EF_VISIUM_ARCH_MCM) ++ strcat (buf, ", mcm"); ++ else if (e_flags & EF_VISIUM_ARCH_MCM24) ++ strcat (buf, ", mcm24"); ++ if (e_flags & EF_VISIUM_ARCH_GR6) ++ strcat (buf, ", gr6"); ++ break; ++ ++ case EM_RL78: ++ switch (e_flags & E_FLAG_RL78_CPU_MASK) ++ { ++ case E_FLAG_RL78_ANY_CPU: break; ++ case E_FLAG_RL78_G10: strcat (buf, ", G10"); break; ++ case E_FLAG_RL78_G13: strcat (buf, ", G13"); break; ++ case E_FLAG_RL78_G14: strcat (buf, ", G14"); break; ++ } ++ if (e_flags & E_FLAG_RL78_64BIT_DOUBLES) ++ strcat (buf, ", 64-bit doubles"); ++ break; ++ ++ case EM_RX: ++ if (e_flags & E_FLAG_RX_64BIT_DOUBLES) ++ strcat (buf, ", 64-bit doubles"); ++ if (e_flags & E_FLAG_RX_DSP) ++ strcat (buf, ", dsp"); ++ if (e_flags & E_FLAG_RX_PID) ++ strcat (buf, ", pid"); ++ if (e_flags & E_FLAG_RX_ABI) ++ strcat (buf, ", RX ABI"); ++ if (e_flags & E_FLAG_RX_SINSNS_SET) ++ strcat (buf, e_flags & E_FLAG_RX_SINSNS_YES ++ ? ", uses String instructions" : ", bans String instructions"); ++ if (e_flags & E_FLAG_RX_V2) ++ strcat (buf, ", V2"); ++ if (e_flags & E_FLAG_RX_V3) ++ strcat (buf, ", V3"); ++ break; ++ ++ case EM_S390: ++ if (e_flags & EF_S390_HIGH_GPRS) ++ strcat (buf, ", highgprs"); ++ break; ++ ++ case EM_TI_C6000: ++ if ((e_flags & EF_C6000_REL)) ++ strcat (buf, ", relocatable module"); ++ break; ++ ++ case EM_MSP430: ++ strcat (buf, _(": architecture variant: ")); ++ switch (e_flags & EF_MSP430_MACH) ++ { ++ case E_MSP430_MACH_MSP430x11: strcat (buf, "MSP430x11"); break; ++ case E_MSP430_MACH_MSP430x11x1 : strcat (buf, "MSP430x11x1 "); break; ++ case E_MSP430_MACH_MSP430x12: strcat (buf, "MSP430x12"); break; ++ case E_MSP430_MACH_MSP430x13: strcat (buf, "MSP430x13"); break; ++ case E_MSP430_MACH_MSP430x14: strcat (buf, "MSP430x14"); break; ++ case E_MSP430_MACH_MSP430x15: strcat (buf, "MSP430x15"); break; ++ case E_MSP430_MACH_MSP430x16: strcat (buf, "MSP430x16"); break; ++ case E_MSP430_MACH_MSP430x31: strcat (buf, "MSP430x31"); break; ++ case E_MSP430_MACH_MSP430x32: strcat (buf, "MSP430x32"); break; ++ case E_MSP430_MACH_MSP430x33: strcat (buf, "MSP430x33"); break; ++ case E_MSP430_MACH_MSP430x41: strcat (buf, "MSP430x41"); break; ++ case E_MSP430_MACH_MSP430x42: strcat (buf, "MSP430x42"); break; ++ case E_MSP430_MACH_MSP430x43: strcat (buf, "MSP430x43"); break; ++ case E_MSP430_MACH_MSP430x44: strcat (buf, "MSP430x44"); break; ++ case E_MSP430_MACH_MSP430X : strcat (buf, "MSP430X"); break; ++ default: ++ strcat (buf, _(": unknown")); break; ++ } ++ ++ if (e_flags & ~ EF_MSP430_MACH) ++ strcat (buf, _(": unknown extra flag bits also present")); ++ break; ++ ++ case EM_Z80: ++ switch (e_flags & EF_Z80_MACH_MSK) ++ { ++ case EF_Z80_MACH_Z80: strcat (buf, ", Z80"); break; ++ case EF_Z80_MACH_Z180: strcat (buf, ", Z180"); break; ++ case EF_Z80_MACH_R800: strcat (buf, ", R800"); break; ++ case EF_Z80_MACH_EZ80_Z80: strcat (buf, ", EZ80"); break; ++ case EF_Z80_MACH_EZ80_ADL: strcat (buf, ", EZ80, ADL"); break; ++ case EF_Z80_MACH_GBZ80: strcat (buf, ", GBZ80"); break; ++ case EF_Z80_MACH_Z80N: strcat (buf, ", Z80N"); break; ++ default: ++ strcat (buf, _(", unknown")); break; ++ } ++ break; ++ } ++ } ++ ++ return buf; ++} ++ ++static const char * ++get_osabi_name (Filedata * filedata, unsigned int osabi) ++{ ++ static char buff[32]; ++ ++ switch (osabi) ++ { ++ case ELFOSABI_NONE: return "UNIX - System V"; ++ case ELFOSABI_HPUX: return "UNIX - HP-UX"; ++ case ELFOSABI_NETBSD: return "UNIX - NetBSD"; ++ case ELFOSABI_GNU: return "UNIX - GNU"; ++ case ELFOSABI_SOLARIS: return "UNIX - Solaris"; ++ case ELFOSABI_AIX: return "UNIX - AIX"; ++ case ELFOSABI_IRIX: return "UNIX - IRIX"; ++ case ELFOSABI_FREEBSD: return "UNIX - FreeBSD"; ++ case ELFOSABI_TRU64: return "UNIX - TRU64"; ++ case ELFOSABI_MODESTO: return "Novell - Modesto"; ++ case ELFOSABI_OPENBSD: return "UNIX - OpenBSD"; ++ case ELFOSABI_OPENVMS: return "VMS - OpenVMS"; ++ case ELFOSABI_NSK: return "HP - Non-Stop Kernel"; ++ case ELFOSABI_AROS: return "AROS"; ++ case ELFOSABI_FENIXOS: return "FenixOS"; ++ case ELFOSABI_CLOUDABI: return "Nuxi CloudABI"; ++ case ELFOSABI_OPENVOS: return "Stratus Technologies OpenVOS"; ++ default: ++ if (osabi >= 64) ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_ARM: ++ switch (osabi) ++ { ++ case ELFOSABI_ARM: return "ARM"; ++ case ELFOSABI_ARM_FDPIC: return "ARM FDPIC"; ++ default: ++ break; ++ } ++ break; ++ ++ case EM_MSP430: ++ case EM_MSP430_OLD: ++ case EM_VISIUM: ++ switch (osabi) ++ { ++ case ELFOSABI_STANDALONE: return _("Standalone App"); ++ default: ++ break; ++ } ++ break; ++ ++ case EM_TI_C6000: ++ switch (osabi) ++ { ++ case ELFOSABI_C6000_ELFABI: return _("Bare-metal C6000"); ++ case ELFOSABI_C6000_LINUX: return "Linux C6000"; ++ default: ++ break; ++ } ++ break; ++ ++ default: ++ break; ++ } ++ snprintf (buff, sizeof (buff), _(""), osabi); ++ return buff; ++ } ++} ++ ++static const char * ++get_aarch64_segment_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case PT_AARCH64_ARCHEXT: return "AARCH64_ARCHEXT"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_arm_segment_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case PT_ARM_EXIDX: return "EXIDX"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_s390_segment_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case PT_S390_PGSTE: return "S390_PGSTE"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_mips_segment_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case PT_MIPS_REGINFO: return "REGINFO"; ++ case PT_MIPS_RTPROC: return "RTPROC"; ++ case PT_MIPS_OPTIONS: return "OPTIONS"; ++ case PT_MIPS_ABIFLAGS: return "ABIFLAGS"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_parisc_segment_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case PT_PARISC_ARCHEXT: return "PARISC_ARCHEXT"; ++ case PT_PARISC_UNWIND: return "PARISC_UNWIND"; ++ case PT_PARISC_WEAKORDER: return "PARISC_WEAKORDER"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_ia64_segment_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case PT_IA_64_ARCHEXT: return "IA_64_ARCHEXT"; ++ case PT_IA_64_UNWIND: return "IA_64_UNWIND"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_tic6x_segment_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case PT_C6000_PHATTR: return "C6000_PHATTR"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_hpux_segment_type (unsigned long type, unsigned e_machine) ++{ ++ if (e_machine == EM_PARISC) ++ switch (type) ++ { ++ case PT_HP_TLS: return "HP_TLS"; ++ case PT_HP_CORE_NONE: return "HP_CORE_NONE"; ++ case PT_HP_CORE_VERSION: return "HP_CORE_VERSION"; ++ case PT_HP_CORE_KERNEL: return "HP_CORE_KERNEL"; ++ case PT_HP_CORE_COMM: return "HP_CORE_COMM"; ++ case PT_HP_CORE_PROC: return "HP_CORE_PROC"; ++ case PT_HP_CORE_LOADABLE: return "HP_CORE_LOADABLE"; ++ case PT_HP_CORE_STACK: return "HP_CORE_STACK"; ++ case PT_HP_CORE_SHM: return "HP_CORE_SHM"; ++ case PT_HP_CORE_MMF: return "HP_CORE_MMF"; ++ case PT_HP_PARALLEL: return "HP_PARALLEL"; ++ case PT_HP_FASTBIND: return "HP_FASTBIND"; ++ case PT_HP_OPT_ANNOT: return "HP_OPT_ANNOT"; ++ case PT_HP_HSL_ANNOT: return "HP_HSL_ANNOT"; ++ case PT_HP_STACK: return "HP_STACK"; ++ case PT_HP_CORE_UTSNAME: return "HP_CORE_UTSNAME"; ++ default: return NULL; ++ } ++ ++ if (e_machine == EM_IA_64) ++ switch (type) ++ { ++ case PT_HP_TLS: return "HP_TLS"; ++ case PT_IA_64_HP_OPT_ANOT: return "HP_OPT_ANNOT"; ++ case PT_IA_64_HP_HSL_ANOT: return "HP_HSL_ANNOT"; ++ case PT_IA_64_HP_STACK: return "HP_STACK"; ++ default: return NULL; ++ } ++ ++ return NULL; ++} ++ ++static const char * ++get_solaris_segment_type (unsigned long type) ++{ ++ switch (type) ++ { ++ case 0x6464e550: return "PT_SUNW_UNWIND"; ++ case 0x6474e550: return "PT_SUNW_EH_FRAME"; ++ case 0x6ffffff7: return "PT_LOSUNW"; ++ case 0x6ffffffa: return "PT_SUNWBSS"; ++ case 0x6ffffffb: return "PT_SUNWSTACK"; ++ case 0x6ffffffc: return "PT_SUNWDTRACE"; ++ case 0x6ffffffd: return "PT_SUNWCAP"; ++ case 0x6fffffff: return "PT_HISUNW"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_segment_type (Filedata * filedata, unsigned long p_type) ++{ ++ static char buff[32]; ++ ++ switch (p_type) ++ { ++ case PT_NULL: return "NULL"; ++ case PT_LOAD: return "LOAD"; ++ case PT_DYNAMIC: return "DYNAMIC"; ++ case PT_INTERP: return "INTERP"; ++ case PT_NOTE: return "NOTE"; ++ case PT_SHLIB: return "SHLIB"; ++ case PT_PHDR: return "PHDR"; ++ case PT_TLS: return "TLS"; ++ case PT_GNU_EH_FRAME: return "GNU_EH_FRAME"; ++ case PT_GNU_STACK: return "GNU_STACK"; ++ case PT_GNU_RELRO: return "GNU_RELRO"; ++ case PT_GNU_PROPERTY: return "GNU_PROPERTY"; ++ ++ default: ++ if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC)) ++ { ++ const char * result; ++ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_AARCH64: ++ result = get_aarch64_segment_type (p_type); ++ break; ++ case EM_ARM: ++ result = get_arm_segment_type (p_type); ++ break; ++ case EM_MIPS: ++ case EM_MIPS_RS3_LE: ++ result = get_mips_segment_type (p_type); ++ break; ++ case EM_PARISC: ++ result = get_parisc_segment_type (p_type); ++ break; ++ case EM_IA_64: ++ result = get_ia64_segment_type (p_type); ++ break; ++ case EM_TI_C6000: ++ result = get_tic6x_segment_type (p_type); ++ break; ++ case EM_S390: ++ case EM_S390_OLD: ++ result = get_s390_segment_type (p_type); ++ break; ++ default: ++ result = NULL; ++ break; ++ } ++ ++ if (result != NULL) ++ return result; ++ ++ sprintf (buff, "LOPROC+%#lx", p_type - PT_LOPROC); ++ } ++ else if ((p_type >= PT_LOOS) && (p_type <= PT_HIOS)) ++ { ++ const char * result = NULL; ++ ++ switch (filedata->file_header.e_ident[EI_OSABI]) ++ { ++ case ELFOSABI_GNU: ++ case ELFOSABI_FREEBSD: ++ if (p_type >= PT_GNU_MBIND_LO && p_type <= PT_GNU_MBIND_HI) ++ { ++ sprintf (buff, "GNU_MBIND+%#lx", p_type - PT_GNU_MBIND_LO); ++ result = buff; ++ } ++ break; ++ case ELFOSABI_HPUX: ++ result = get_hpux_segment_type (p_type, ++ filedata->file_header.e_machine); ++ break; ++ case ELFOSABI_SOLARIS: ++ result = get_solaris_segment_type (p_type); ++ break; ++ default: ++ break; ++ } ++ if (result != NULL) ++ return result; ++ ++ sprintf (buff, "LOOS+%#lx", p_type - PT_LOOS); ++ } ++ else ++ snprintf (buff, sizeof (buff), _(": %lx"), p_type); ++ ++ return buff; ++ } ++} ++ ++static const char * ++get_arc_section_type_name (unsigned int sh_type) ++{ ++ switch (sh_type) ++ { ++ case SHT_ARC_ATTRIBUTES: return "ARC_ATTRIBUTES"; ++ default: ++ break; ++ } ++ return NULL; ++} ++ ++static const char * ++get_mips_section_type_name (unsigned int sh_type) ++{ ++ switch (sh_type) ++ { ++ case SHT_MIPS_LIBLIST: return "MIPS_LIBLIST"; ++ case SHT_MIPS_MSYM: return "MIPS_MSYM"; ++ case SHT_MIPS_CONFLICT: return "MIPS_CONFLICT"; ++ case SHT_MIPS_GPTAB: return "MIPS_GPTAB"; ++ case SHT_MIPS_UCODE: return "MIPS_UCODE"; ++ case SHT_MIPS_DEBUG: return "MIPS_DEBUG"; ++ case SHT_MIPS_REGINFO: return "MIPS_REGINFO"; ++ case SHT_MIPS_PACKAGE: return "MIPS_PACKAGE"; ++ case SHT_MIPS_PACKSYM: return "MIPS_PACKSYM"; ++ case SHT_MIPS_RELD: return "MIPS_RELD"; ++ case SHT_MIPS_IFACE: return "MIPS_IFACE"; ++ case SHT_MIPS_CONTENT: return "MIPS_CONTENT"; ++ case SHT_MIPS_OPTIONS: return "MIPS_OPTIONS"; ++ case SHT_MIPS_SHDR: return "MIPS_SHDR"; ++ case SHT_MIPS_FDESC: return "MIPS_FDESC"; ++ case SHT_MIPS_EXTSYM: return "MIPS_EXTSYM"; ++ case SHT_MIPS_DENSE: return "MIPS_DENSE"; ++ case SHT_MIPS_PDESC: return "MIPS_PDESC"; ++ case SHT_MIPS_LOCSYM: return "MIPS_LOCSYM"; ++ case SHT_MIPS_AUXSYM: return "MIPS_AUXSYM"; ++ case SHT_MIPS_OPTSYM: return "MIPS_OPTSYM"; ++ case SHT_MIPS_LOCSTR: return "MIPS_LOCSTR"; ++ case SHT_MIPS_LINE: return "MIPS_LINE"; ++ case SHT_MIPS_RFDESC: return "MIPS_RFDESC"; ++ case SHT_MIPS_DELTASYM: return "MIPS_DELTASYM"; ++ case SHT_MIPS_DELTAINST: return "MIPS_DELTAINST"; ++ case SHT_MIPS_DELTACLASS: return "MIPS_DELTACLASS"; ++ case SHT_MIPS_DWARF: return "MIPS_DWARF"; ++ case SHT_MIPS_DELTADECL: return "MIPS_DELTADECL"; ++ case SHT_MIPS_SYMBOL_LIB: return "MIPS_SYMBOL_LIB"; ++ case SHT_MIPS_EVENTS: return "MIPS_EVENTS"; ++ case SHT_MIPS_TRANSLATE: return "MIPS_TRANSLATE"; ++ case SHT_MIPS_PIXIE: return "MIPS_PIXIE"; ++ case SHT_MIPS_XLATE: return "MIPS_XLATE"; ++ case SHT_MIPS_XLATE_DEBUG: return "MIPS_XLATE_DEBUG"; ++ case SHT_MIPS_WHIRL: return "MIPS_WHIRL"; ++ case SHT_MIPS_EH_REGION: return "MIPS_EH_REGION"; ++ case SHT_MIPS_XLATE_OLD: return "MIPS_XLATE_OLD"; ++ case SHT_MIPS_PDR_EXCEPTION: return "MIPS_PDR_EXCEPTION"; ++ case SHT_MIPS_ABIFLAGS: return "MIPS_ABIFLAGS"; ++ case SHT_MIPS_XHASH: return "MIPS_XHASH"; ++ default: ++ break; ++ } ++ return NULL; ++} ++ ++static const char * ++get_parisc_section_type_name (unsigned int sh_type) ++{ ++ switch (sh_type) ++ { ++ case SHT_PARISC_EXT: return "PARISC_EXT"; ++ case SHT_PARISC_UNWIND: return "PARISC_UNWIND"; ++ case SHT_PARISC_DOC: return "PARISC_DOC"; ++ case SHT_PARISC_ANNOT: return "PARISC_ANNOT"; ++ case SHT_PARISC_SYMEXTN: return "PARISC_SYMEXTN"; ++ case SHT_PARISC_STUBS: return "PARISC_STUBS"; ++ case SHT_PARISC_DLKM: return "PARISC_DLKM"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_ia64_section_type_name (Filedata * filedata, unsigned int sh_type) ++{ ++ /* If the top 8 bits are 0x78 the next 8 are the os/abi ID. */ ++ if ((sh_type & 0xFF000000) == SHT_IA_64_LOPSREG) ++ return get_osabi_name (filedata, (sh_type & 0x00FF0000) >> 16); ++ ++ switch (sh_type) ++ { ++ case SHT_IA_64_EXT: return "IA_64_EXT"; ++ case SHT_IA_64_UNWIND: return "IA_64_UNWIND"; ++ case SHT_IA_64_PRIORITY_INIT: return "IA_64_PRIORITY_INIT"; ++ case SHT_IA_64_VMS_TRACE: return "VMS_TRACE"; ++ case SHT_IA_64_VMS_TIE_SIGNATURES: return "VMS_TIE_SIGNATURES"; ++ case SHT_IA_64_VMS_DEBUG: return "VMS_DEBUG"; ++ case SHT_IA_64_VMS_DEBUG_STR: return "VMS_DEBUG_STR"; ++ case SHT_IA_64_VMS_LINKAGES: return "VMS_LINKAGES"; ++ case SHT_IA_64_VMS_SYMBOL_VECTOR: return "VMS_SYMBOL_VECTOR"; ++ case SHT_IA_64_VMS_FIXUP: return "VMS_FIXUP"; ++ default: ++ break; ++ } ++ return NULL; ++} ++ ++static const char * ++get_x86_64_section_type_name (unsigned int sh_type) ++{ ++ switch (sh_type) ++ { ++ case SHT_X86_64_UNWIND: return "X86_64_UNWIND"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_aarch64_section_type_name (unsigned int sh_type) ++{ ++ switch (sh_type) ++ { ++ case SHT_AARCH64_ATTRIBUTES: return "AARCH64_ATTRIBUTES"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_arm_section_type_name (unsigned int sh_type) ++{ ++ switch (sh_type) ++ { ++ case SHT_ARM_EXIDX: return "ARM_EXIDX"; ++ case SHT_ARM_PREEMPTMAP: return "ARM_PREEMPTMAP"; ++ case SHT_ARM_ATTRIBUTES: return "ARM_ATTRIBUTES"; ++ case SHT_ARM_DEBUGOVERLAY: return "ARM_DEBUGOVERLAY"; ++ case SHT_ARM_OVERLAYSECTION: return "ARM_OVERLAYSECTION"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_tic6x_section_type_name (unsigned int sh_type) ++{ ++ switch (sh_type) ++ { ++ case SHT_C6000_UNWIND: return "C6000_UNWIND"; ++ case SHT_C6000_PREEMPTMAP: return "C6000_PREEMPTMAP"; ++ case SHT_C6000_ATTRIBUTES: return "C6000_ATTRIBUTES"; ++ case SHT_TI_ICODE: return "TI_ICODE"; ++ case SHT_TI_XREF: return "TI_XREF"; ++ case SHT_TI_HANDLER: return "TI_HANDLER"; ++ case SHT_TI_INITINFO: return "TI_INITINFO"; ++ case SHT_TI_PHATTRS: return "TI_PHATTRS"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_msp430x_section_type_name (unsigned int sh_type) ++{ ++ switch (sh_type) ++ { ++ case SHT_MSP430_SEC_FLAGS: return "MSP430_SEC_FLAGS"; ++ case SHT_MSP430_SYM_ALIASES: return "MSP430_SYM_ALIASES"; ++ case SHT_MSP430_ATTRIBUTES: return "MSP430_ATTRIBUTES"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_nfp_section_type_name (unsigned int sh_type) ++{ ++ switch (sh_type) ++ { ++ case SHT_NFP_MECONFIG: return "NFP_MECONFIG"; ++ case SHT_NFP_INITREG: return "NFP_INITREG"; ++ case SHT_NFP_UDEBUG: return "NFP_UDEBUG"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_v850_section_type_name (unsigned int sh_type) ++{ ++ switch (sh_type) ++ { ++ case SHT_V850_SCOMMON: return "V850 Small Common"; ++ case SHT_V850_TCOMMON: return "V850 Tiny Common"; ++ case SHT_V850_ZCOMMON: return "V850 Zero Common"; ++ case SHT_RENESAS_IOP: return "RENESAS IOP"; ++ case SHT_RENESAS_INFO: return "RENESAS INFO"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_riscv_section_type_name (unsigned int sh_type) ++{ ++ switch (sh_type) ++ { ++ case SHT_RISCV_ATTRIBUTES: return "RISCV_ATTRIBUTES"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_section_type_name (Filedata * filedata, unsigned int sh_type) ++{ ++ static char buff[32]; ++ const char * result; ++ ++ switch (sh_type) ++ { ++ case SHT_NULL: return "NULL"; ++ case SHT_PROGBITS: return "PROGBITS"; ++ case SHT_SYMTAB: return "SYMTAB"; ++ case SHT_STRTAB: return "STRTAB"; ++ case SHT_RELA: return "RELA"; ++ case SHT_HASH: return "HASH"; ++ case SHT_DYNAMIC: return "DYNAMIC"; ++ case SHT_NOTE: return "NOTE"; ++ case SHT_NOBITS: return "NOBITS"; ++ case SHT_REL: return "REL"; ++ case SHT_SHLIB: return "SHLIB"; ++ case SHT_DYNSYM: return "DYNSYM"; ++ case SHT_INIT_ARRAY: return "INIT_ARRAY"; ++ case SHT_FINI_ARRAY: return "FINI_ARRAY"; ++ case SHT_PREINIT_ARRAY: return "PREINIT_ARRAY"; ++ case SHT_GNU_HASH: return "GNU_HASH"; ++ case SHT_GROUP: return "GROUP"; ++ case SHT_SYMTAB_SHNDX: return "SYMTAB SECTION INDICES"; ++ case SHT_GNU_verdef: return "VERDEF"; ++ case SHT_GNU_verneed: return "VERNEED"; ++ case SHT_GNU_versym: return "VERSYM"; ++ case 0x6ffffff0: return "VERSYM"; ++ case 0x6ffffffc: return "VERDEF"; ++ case 0x7ffffffd: return "AUXILIARY"; ++ case 0x7fffffff: return "FILTER"; ++ case SHT_GNU_LIBLIST: return "GNU_LIBLIST"; ++ ++ default: ++ if ((sh_type >= SHT_LOPROC) && (sh_type <= SHT_HIPROC)) ++ { ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_ARC: ++ case EM_ARC_COMPACT: ++ case EM_ARC_COMPACT2: ++ result = get_arc_section_type_name (sh_type); ++ break; ++ case EM_MIPS: ++ case EM_MIPS_RS3_LE: ++ result = get_mips_section_type_name (sh_type); ++ break; ++ case EM_PARISC: ++ result = get_parisc_section_type_name (sh_type); ++ break; ++ case EM_IA_64: ++ result = get_ia64_section_type_name (filedata, sh_type); ++ break; ++ case EM_X86_64: ++ case EM_L1OM: ++ case EM_K1OM: ++ result = get_x86_64_section_type_name (sh_type); ++ break; ++ case EM_AARCH64: ++ result = get_aarch64_section_type_name (sh_type); ++ break; ++ case EM_ARM: ++ result = get_arm_section_type_name (sh_type); ++ break; ++ case EM_TI_C6000: ++ result = get_tic6x_section_type_name (sh_type); ++ break; ++ case EM_MSP430: ++ result = get_msp430x_section_type_name (sh_type); ++ break; ++ case EM_NFP: ++ result = get_nfp_section_type_name (sh_type); ++ break; ++ case EM_V800: ++ case EM_V850: ++ case EM_CYGNUS_V850: ++ result = get_v850_section_type_name (sh_type); ++ break; ++ case EM_RISCV: ++ result = get_riscv_section_type_name (sh_type); ++ break; ++ default: ++ result = NULL; ++ break; ++ } ++ ++ if (result != NULL) ++ return result; ++ ++ sprintf (buff, "LOPROC+%#x", sh_type - SHT_LOPROC); ++ } ++ else if ((sh_type >= SHT_LOOS) && (sh_type <= SHT_HIOS)) ++ { ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_IA_64: ++ result = get_ia64_section_type_name (filedata, sh_type); ++ break; ++ default: ++ if (filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_SOLARIS) ++ result = get_solaris_section_type (sh_type); ++ else ++ { ++ switch (sh_type) ++ { ++ case SHT_GNU_INCREMENTAL_INPUTS: result = "GNU_INCREMENTAL_INPUTS"; break; ++ case SHT_GNU_ATTRIBUTES: result = "GNU_ATTRIBUTES"; break; ++ case SHT_GNU_HASH: result = "GNU_HASH"; break; ++ case SHT_GNU_LIBLIST: result = "GNU_LIBLIST"; break; ++ default: ++ result = NULL; ++ break; ++ } ++ } ++ break; ++ } ++ ++ if (result != NULL) ++ return result; ++ ++ sprintf (buff, "LOOS+%#x", sh_type - SHT_LOOS); ++ } ++ else if ((sh_type >= SHT_LOUSER) && (sh_type <= SHT_HIUSER)) ++ { ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_V800: ++ case EM_V850: ++ case EM_CYGNUS_V850: ++ result = get_v850_section_type_name (sh_type); ++ break; ++ default: ++ result = NULL; ++ break; ++ } ++ ++ if (result != NULL) ++ return result; ++ ++ sprintf (buff, "LOUSER+%#x", sh_type - SHT_LOUSER); ++ } ++ else ++ /* This message is probably going to be displayed in a 15 ++ character wide field, so put the hex value first. */ ++ snprintf (buff, sizeof (buff), _("%08x: "), sh_type); ++ ++ return buff; ++ } ++} ++ ++#define OPTION_DEBUG_DUMP 512 ++#define OPTION_DYN_SYMS 513 ++#define OPTION_DWARF_DEPTH 514 ++#define OPTION_DWARF_START 515 ++#define OPTION_DWARF_CHECK 516 ++#define OPTION_CTF_DUMP 517 ++#define OPTION_CTF_PARENT 518 ++#define OPTION_CTF_SYMBOLS 519 ++#define OPTION_CTF_STRINGS 520 ++ ++static struct option options[] = ++{ ++ {"all", no_argument, 0, 'a'}, ++ {"file-header", no_argument, 0, 'h'}, ++ {"program-headers", no_argument, 0, 'l'}, ++ {"headers", no_argument, 0, 'e'}, ++ {"histogram", no_argument, 0, 'I'}, ++ {"segments", no_argument, 0, 'l'}, ++ {"sections", no_argument, 0, 'S'}, ++ {"section-headers", no_argument, 0, 'S'}, ++ {"section-groups", no_argument, 0, 'g'}, ++ {"section-details", no_argument, 0, 't'}, ++ {"full-section-name",no_argument, 0, 'N'}, ++ {"symbols", no_argument, 0, 's'}, ++ {"syms", no_argument, 0, 's'}, ++ {"dyn-syms", no_argument, 0, OPTION_DYN_SYMS}, ++ {"relocs", no_argument, 0, 'r'}, ++ {"notes", no_argument, 0, 'n'}, ++ {"dynamic", no_argument, 0, 'd'}, ++ {"lint", no_argument, 0, 'L'}, ++ {"enable-checks", no_argument, 0, 'L'}, ++ {"arch-specific", no_argument, 0, 'A'}, ++ {"version-info", no_argument, 0, 'V'}, ++ {"use-dynamic", no_argument, 0, 'D'}, ++ {"unwind", no_argument, 0, 'u'}, ++ {"archive-index", no_argument, 0, 'c'}, ++ {"hex-dump", required_argument, 0, 'x'}, ++ {"relocated-dump", required_argument, 0, 'R'}, ++ {"string-dump", required_argument, 0, 'p'}, ++ {"decompress", no_argument, 0, 'z'}, ++#ifdef SUPPORT_DISASSEMBLY ++ {"instruction-dump", required_argument, 0, 'i'}, ++#endif ++ {"debug-dump", optional_argument, 0, OPTION_DEBUG_DUMP}, ++ ++ {"dwarf-depth", required_argument, 0, OPTION_DWARF_DEPTH}, ++ {"dwarf-start", required_argument, 0, OPTION_DWARF_START}, ++ {"dwarf-check", no_argument, 0, OPTION_DWARF_CHECK}, ++ ++#ifdef ENABLE_LIBCTF ++ {"ctf", required_argument, 0, OPTION_CTF_DUMP}, ++ ++ {"ctf-symbols", required_argument, 0, OPTION_CTF_SYMBOLS}, ++ {"ctf-strings", required_argument, 0, OPTION_CTF_STRINGS}, ++ {"ctf-parent", required_argument, 0, OPTION_CTF_PARENT}, ++#endif ++ ++ {"version", no_argument, 0, 'v'}, ++ {"wide", no_argument, 0, 'W'}, ++ {"silent-truncation",no_argument, 0, 'T'}, ++ {"help", no_argument, 0, 'H'}, ++ {0, no_argument, 0, 0} ++}; ++ ++static void ++usage (FILE * stream) ++{ ++ fprintf (stream, _("Usage: readelf elf-file(s)\n")); ++ fprintf (stream, _(" Display information about the contents of ELF format files\n")); ++ fprintf (stream, _(" Options are:\n\ ++ -a --all Equivalent to: -h -l -S -s -r -d -V -A -I\n\ ++ -h --file-header Display the ELF file header\n\ ++ -l --program-headers Display the program headers\n\ ++ --segments An alias for --program-headers\n\ ++ -S --section-headers Display the sections' header\n\ ++ --sections An alias for --section-headers\n\ ++ -g --section-groups Display the section groups\n\ ++ -t --section-details Display the section details\n\ ++ -e --headers Equivalent to: -h -l -S\n\ ++ -s --syms Display the symbol table\n\ ++ --symbols An alias for --syms\n\ ++ --dyn-syms Display the dynamic symbol table\n\ ++ -n --notes Display the core notes (if present)\n\ ++ -r --relocs Display the relocations (if present)\n\ ++ -u --unwind Display the unwind info (if present)\n\ ++ -d --dynamic Display the dynamic section (if present)\n\ ++ -V --version-info Display the version sections (if present)\n\ ++ -A --arch-specific Display architecture specific information (if any)\n\ ++ -c --archive-index Display the symbol/file index in an archive\n\ ++ -D --use-dynamic Use the dynamic section info when displaying symbols\n\ ++ -L --lint|--enable-checks Display warning messages for possible problems\n\ ++ -x --hex-dump=\n\ ++ Dump the contents of section as bytes\n\ ++ -p --string-dump=\n\ ++ Dump the contents of section as strings\n\ ++ -R --relocated-dump=\n\ ++ Dump the contents of section as relocated bytes\n\ ++ -z --decompress Decompress section before dumping it\n\ ++ -w[lLiaprmfFsoORtUuTgAckK] or\n\ ++ --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,\n\ ++ =frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,\n\ ++ =gdb_index,=trace_info,=trace_abbrev,=trace_aranges,\n\ ++ =addr,=cu_index,=links,=follow-links]\n\ ++ Display the contents of DWARF debug sections\n")); ++ fprintf (stream, _("\ ++ --dwarf-depth=N Do not display DIEs at depth N or greater\n\ ++ --dwarf-start=N Display DIEs starting with N, at the same depth\n\ ++ or deeper\n")); ++#ifdef ENABLE_LIBCTF ++ fprintf (stream, _("\ ++ --ctf= Display CTF info from section \n\ ++ --ctf-parent=\n\ ++ Use section as the CTF parent\n\n\ ++ --ctf-symbols=\n\ ++ Use section as the CTF external symtab\n\n\ ++ --ctf-strings=\n\ ++ Use section as the CTF external strtab\n\n")); ++#endif ++ ++#ifdef SUPPORT_DISASSEMBLY ++ fprintf (stream, _("\ ++ -i --instruction-dump=\n\ ++ Disassemble the contents of section \n")); ++#endif ++ fprintf (stream, _("\ ++ -I --histogram Display histogram of bucket list lengths\n\ ++ -W --wide Allow output width to exceed 80 characters\n\ ++ -T --silent-truncation If a symbol name is truncated, do not add a suffix [...]\n\ ++ @ Read options from \n\ ++ -H --help Display this information\n\ ++ -v --version Display the version number of readelf\n")); ++ ++ if (REPORT_BUGS_TO[0] && stream == stdout) ++ fprintf (stdout, _("Report bugs to %s\n"), REPORT_BUGS_TO); ++ ++ exit (stream == stdout ? 0 : 1); ++} ++ ++/* Record the fact that the user wants the contents of section number ++ SECTION to be displayed using the method(s) encoded as flags bits ++ in TYPE. Note, TYPE can be zero if we are creating the array for ++ the first time. */ ++ ++static void ++request_dump_bynumber (struct dump_data *dumpdata, ++ unsigned int section, dump_type type) ++{ ++ if (section >= dumpdata->num_dump_sects) ++ { ++ dump_type * new_dump_sects; ++ ++ new_dump_sects = (dump_type *) calloc (section + 1, ++ sizeof (* new_dump_sects)); ++ ++ if (new_dump_sects == NULL) ++ error (_("Out of memory allocating dump request table.\n")); ++ else ++ { ++ if (dumpdata->dump_sects) ++ { ++ /* Copy current flag settings. */ ++ memcpy (new_dump_sects, dumpdata->dump_sects, ++ dumpdata->num_dump_sects * sizeof (* new_dump_sects)); ++ ++ free (dumpdata->dump_sects); ++ } ++ ++ dumpdata->dump_sects = new_dump_sects; ++ dumpdata->num_dump_sects = section + 1; ++ } ++ } ++ ++ if (dumpdata->dump_sects) ++ dumpdata->dump_sects[section] |= type; ++} ++ ++/* Request a dump by section name. */ ++ ++static void ++request_dump_byname (const char * section, dump_type type) ++{ ++ struct dump_list_entry * new_request; ++ ++ new_request = (struct dump_list_entry *) ++ malloc (sizeof (struct dump_list_entry)); ++ if (!new_request) ++ error (_("Out of memory allocating dump request table.\n")); ++ ++ new_request->name = strdup (section); ++ if (!new_request->name) ++ error (_("Out of memory allocating dump request table.\n")); ++ ++ new_request->type = type; ++ ++ new_request->next = dump_sects_byname; ++ dump_sects_byname = new_request; ++} ++ ++static inline void ++request_dump (struct dump_data *dumpdata, dump_type type) ++{ ++ int section; ++ char * cp; ++ ++ do_dump++; ++ section = strtoul (optarg, & cp, 0); ++ ++ if (! *cp && section >= 0) ++ request_dump_bynumber (dumpdata, section, type); ++ else ++ request_dump_byname (optarg, type); ++} ++ ++static void ++parse_args (struct dump_data *dumpdata, int argc, char ** argv) ++{ ++ int c; ++ ++ if (argc < 2) ++ usage (stderr); ++ ++ while ((c = getopt_long ++ (argc, argv, "ADHILNR:STVWacdeghi:lnp:rstuvw::x:z", options, NULL)) != EOF) ++ { ++ switch (c) ++ { ++ case 0: ++ /* Long options. */ ++ break; ++ case 'H': ++ usage (stdout); ++ break; ++ ++ case 'a': ++ do_syms = TRUE; ++ do_reloc = TRUE; ++ do_unwind = TRUE; ++ do_dynamic = TRUE; ++ do_header = TRUE; ++ do_sections = TRUE; ++ do_section_groups = TRUE; ++ do_segments = TRUE; ++ do_version = TRUE; ++ do_histogram = TRUE; ++ do_arch = TRUE; ++ do_notes = TRUE; ++ break; ++ case 'g': ++ do_section_groups = TRUE; ++ break; ++ case 't': ++ case 'N': ++ do_sections = TRUE; ++ do_section_details = TRUE; ++ break; ++ case 'e': ++ do_header = TRUE; ++ do_sections = TRUE; ++ do_segments = TRUE; ++ break; ++ case 'A': ++ do_arch = TRUE; ++ break; ++ case 'D': ++ do_using_dynamic = TRUE; ++ break; ++ case 'r': ++ do_reloc = TRUE; ++ break; ++ case 'u': ++ do_unwind = TRUE; ++ break; ++ case 'h': ++ do_header = TRUE; ++ break; ++ case 'l': ++ do_segments = TRUE; ++ break; ++ case 's': ++ do_syms = TRUE; ++ break; ++ case 'S': ++ do_sections = TRUE; ++ break; ++ case 'd': ++ do_dynamic = TRUE; ++ break; ++ case 'I': ++ do_histogram = TRUE; ++ break; ++ case 'n': ++ do_notes = TRUE; ++ break; ++ case 'c': ++ do_archive_index = TRUE; ++ break; ++ case 'L': ++ do_checks = TRUE; ++ break; ++ case 'x': ++ request_dump (dumpdata, HEX_DUMP); ++ break; ++ case 'p': ++ request_dump (dumpdata, STRING_DUMP); ++ break; ++ case 'R': ++ request_dump (dumpdata, RELOC_DUMP); ++ break; ++ case 'z': ++ decompress_dumps = TRUE; ++ break; ++ case 'w': ++ do_dump = TRUE; ++ if (optarg == 0) ++ { ++ do_debugging = TRUE; ++ dwarf_select_sections_all (); ++ } ++ else ++ { ++ do_debugging = FALSE; ++ dwarf_select_sections_by_letters (optarg); ++ } ++ break; ++ case OPTION_DEBUG_DUMP: ++ do_dump = TRUE; ++ if (optarg == 0) ++ do_debugging = TRUE; ++ else ++ { ++ do_debugging = FALSE; ++ dwarf_select_sections_by_names (optarg); ++ } ++ break; ++ case OPTION_DWARF_DEPTH: ++ { ++ char *cp; ++ ++ dwarf_cutoff_level = strtoul (optarg, & cp, 0); ++ } ++ break; ++ case OPTION_DWARF_START: ++ { ++ char *cp; ++ ++ dwarf_start_die = strtoul (optarg, & cp, 0); ++ } ++ break; ++ case OPTION_DWARF_CHECK: ++ dwarf_check = TRUE; ++ break; ++ case OPTION_CTF_DUMP: ++ do_ctf = TRUE; ++ request_dump (dumpdata, CTF_DUMP); ++ break; ++ case OPTION_CTF_SYMBOLS: ++ dump_ctf_symtab_name = strdup (optarg); ++ break; ++ case OPTION_CTF_STRINGS: ++ dump_ctf_strtab_name = strdup (optarg); ++ break; ++ case OPTION_CTF_PARENT: ++ dump_ctf_parent_name = strdup (optarg); ++ break; ++ case OPTION_DYN_SYMS: ++ do_dyn_syms = TRUE; ++ break; ++#ifdef SUPPORT_DISASSEMBLY ++ case 'i': ++ request_dump (dumpdata, DISASS_DUMP); ++ break; ++#endif ++ case 'v': ++ print_version (program_name); ++ break; ++ case 'V': ++ do_version = TRUE; ++ break; ++ case 'W': ++ do_wide = TRUE; ++ break; ++ case 'T': ++ do_not_show_symbol_truncation = TRUE; ++ break; ++ default: ++ /* xgettext:c-format */ ++ error (_("Invalid option '-%c'\n"), c); ++ /* Fall through. */ ++ case '?': ++ usage (stderr); ++ } ++ } ++ ++ if (!do_dynamic && !do_syms && !do_reloc && !do_unwind && !do_sections ++ && !do_segments && !do_header && !do_dump && !do_version ++ && !do_histogram && !do_debugging && !do_arch && !do_notes ++ && !do_section_groups && !do_archive_index ++ && !do_dyn_syms) ++ { ++ if (do_checks) ++ { ++ check_all = TRUE; ++ do_dynamic = do_syms = do_reloc = do_unwind = do_sections = TRUE; ++ do_segments = do_header = do_dump = do_version = TRUE; ++ do_histogram = do_debugging = do_arch = do_notes = TRUE; ++ do_section_groups = do_archive_index = do_dyn_syms = TRUE; ++ } ++ else ++ usage (stderr); ++ } ++} ++ ++static const char * ++get_elf_class (unsigned int elf_class) ++{ ++ static char buff[32]; ++ ++ switch (elf_class) ++ { ++ case ELFCLASSNONE: return _("none"); ++ case ELFCLASS32: return "ELF32"; ++ case ELFCLASS64: return "ELF64"; ++ default: ++ snprintf (buff, sizeof (buff), _(""), elf_class); ++ return buff; ++ } ++} ++ ++static const char * ++get_data_encoding (unsigned int encoding) ++{ ++ static char buff[32]; ++ ++ switch (encoding) ++ { ++ case ELFDATANONE: return _("none"); ++ case ELFDATA2LSB: return _("2's complement, little endian"); ++ case ELFDATA2MSB: return _("2's complement, big endian"); ++ default: ++ snprintf (buff, sizeof (buff), _(""), encoding); ++ return buff; ++ } ++} ++ ++/* Decode the data held in 'filedata->file_header'. */ ++ ++static bfd_boolean ++process_file_header (Filedata * filedata) ++{ ++ Elf_Internal_Ehdr * header = & filedata->file_header; ++ ++ if ( header->e_ident[EI_MAG0] != ELFMAG0 ++ || header->e_ident[EI_MAG1] != ELFMAG1 ++ || header->e_ident[EI_MAG2] != ELFMAG2 ++ || header->e_ident[EI_MAG3] != ELFMAG3) ++ { ++ error ++ (_("Not an ELF file - it has the wrong magic bytes at the start\n")); ++ return FALSE; ++ } ++ ++ init_dwarf_regnames_by_elf_machine_code (header->e_machine); ++ ++ if (do_header) ++ { ++ unsigned i; ++ ++ printf (_("ELF Header:\n")); ++ printf (_(" Magic: ")); ++ for (i = 0; i < EI_NIDENT; i++) ++ printf ("%2.2x ", header->e_ident[i]); ++ printf ("\n"); ++ printf (_(" Class: %s\n"), ++ get_elf_class (header->e_ident[EI_CLASS])); ++ printf (_(" Data: %s\n"), ++ get_data_encoding (header->e_ident[EI_DATA])); ++ printf (_(" Version: %d%s\n"), ++ header->e_ident[EI_VERSION], ++ (header->e_ident[EI_VERSION] == EV_CURRENT ++ ? _(" (current)") ++ : (header->e_ident[EI_VERSION] != EV_NONE ++ ? _(" ") ++ : ""))); ++ printf (_(" OS/ABI: %s\n"), ++ get_osabi_name (filedata, header->e_ident[EI_OSABI])); ++ printf (_(" ABI Version: %d\n"), ++ header->e_ident[EI_ABIVERSION]); ++ printf (_(" Type: %s\n"), ++ get_file_type (header->e_type)); ++ printf (_(" Machine: %s\n"), ++ get_machine_name (header->e_machine)); ++ printf (_(" Version: 0x%lx\n"), ++ header->e_version); ++ ++ printf (_(" Entry point address: ")); ++ print_vma (header->e_entry, PREFIX_HEX); ++ printf (_("\n Start of program headers: ")); ++ print_vma (header->e_phoff, DEC); ++ printf (_(" (bytes into file)\n Start of section headers: ")); ++ print_vma (header->e_shoff, DEC); ++ printf (_(" (bytes into file)\n")); ++ ++ printf (_(" Flags: 0x%lx%s\n"), ++ header->e_flags, ++ get_machine_flags (filedata, header->e_flags, header->e_machine)); ++ printf (_(" Size of this header: %u (bytes)\n"), ++ header->e_ehsize); ++ printf (_(" Size of program headers: %u (bytes)\n"), ++ header->e_phentsize); ++ printf (_(" Number of program headers: %u"), ++ header->e_phnum); ++ if (filedata->section_headers != NULL ++ && header->e_phnum == PN_XNUM ++ && filedata->section_headers[0].sh_info != 0) ++ { ++ header->e_phnum = filedata->section_headers[0].sh_info; ++ printf (" (%u)", header->e_phnum); ++ } ++ putc ('\n', stdout); ++ printf (_(" Size of section headers: %u (bytes)\n"), ++ header->e_shentsize); ++ printf (_(" Number of section headers: %u"), ++ header->e_shnum); ++ if (filedata->section_headers != NULL && header->e_shnum == SHN_UNDEF) ++ { ++ header->e_shnum = filedata->section_headers[0].sh_size; ++ printf (" (%u)", header->e_shnum); ++ } ++ putc ('\n', stdout); ++ printf (_(" Section header string table index: %u"), ++ header->e_shstrndx); ++ if (filedata->section_headers != NULL ++ && header->e_shstrndx == (SHN_XINDEX & 0xffff)) ++ { ++ header->e_shstrndx = filedata->section_headers[0].sh_link; ++ printf (" (%u)", header->e_shstrndx); ++ } ++ if (header->e_shstrndx != SHN_UNDEF ++ && header->e_shstrndx >= header->e_shnum) ++ { ++ header->e_shstrndx = SHN_UNDEF; ++ printf (_(" ")); ++ } ++ putc ('\n', stdout); ++ } ++ ++ if (filedata->section_headers != NULL) ++ { ++ if (header->e_phnum == PN_XNUM ++ && filedata->section_headers[0].sh_info != 0) ++ header->e_phnum = filedata->section_headers[0].sh_info; ++ if (header->e_shnum == SHN_UNDEF) ++ header->e_shnum = filedata->section_headers[0].sh_size; ++ if (header->e_shstrndx == (SHN_XINDEX & 0xffff)) ++ header->e_shstrndx = filedata->section_headers[0].sh_link; ++ if (header->e_shstrndx >= header->e_shnum) ++ header->e_shstrndx = SHN_UNDEF; ++ free (filedata->section_headers); ++ filedata->section_headers = NULL; ++ } ++ ++ return TRUE; ++} ++ ++/* Read in the program headers from FILEDATA and store them in PHEADERS. ++ Returns TRUE upon success, FALSE otherwise. Loads 32-bit headers. */ ++ ++static bfd_boolean ++get_32bit_program_headers (Filedata * filedata, Elf_Internal_Phdr * pheaders) ++{ ++ Elf32_External_Phdr * phdrs; ++ Elf32_External_Phdr * external; ++ Elf_Internal_Phdr * internal; ++ unsigned int i; ++ unsigned int size = filedata->file_header.e_phentsize; ++ unsigned int num = filedata->file_header.e_phnum; ++ ++ /* PR binutils/17531: Cope with unexpected section header sizes. */ ++ if (size == 0 || num == 0) ++ return FALSE; ++ if (size < sizeof * phdrs) ++ { ++ error (_("The e_phentsize field in the ELF header is less than the size of an ELF program header\n")); ++ return FALSE; ++ } ++ if (size > sizeof * phdrs) ++ warn (_("The e_phentsize field in the ELF header is larger than the size of an ELF program header\n")); ++ ++ phdrs = (Elf32_External_Phdr *) get_data (NULL, filedata, filedata->file_header.e_phoff, ++ size, num, _("program headers")); ++ if (phdrs == NULL) ++ return FALSE; ++ ++ for (i = 0, internal = pheaders, external = phdrs; ++ i < filedata->file_header.e_phnum; ++ i++, internal++, external++) ++ { ++ internal->p_type = BYTE_GET (external->p_type); ++ internal->p_offset = BYTE_GET (external->p_offset); ++ internal->p_vaddr = BYTE_GET (external->p_vaddr); ++ internal->p_paddr = BYTE_GET (external->p_paddr); ++ internal->p_filesz = BYTE_GET (external->p_filesz); ++ internal->p_memsz = BYTE_GET (external->p_memsz); ++ internal->p_flags = BYTE_GET (external->p_flags); ++ internal->p_align = BYTE_GET (external->p_align); ++ } ++ ++ free (phdrs); ++ return TRUE; ++} ++ ++/* Read in the program headers from FILEDATA and store them in PHEADERS. ++ Returns TRUE upon success, FALSE otherwise. Loads 64-bit headers. */ ++ ++static bfd_boolean ++get_64bit_program_headers (Filedata * filedata, Elf_Internal_Phdr * pheaders) ++{ ++ Elf64_External_Phdr * phdrs; ++ Elf64_External_Phdr * external; ++ Elf_Internal_Phdr * internal; ++ unsigned int i; ++ unsigned int size = filedata->file_header.e_phentsize; ++ unsigned int num = filedata->file_header.e_phnum; ++ ++ /* PR binutils/17531: Cope with unexpected section header sizes. */ ++ if (size == 0 || num == 0) ++ return FALSE; ++ if (size < sizeof * phdrs) ++ { ++ error (_("The e_phentsize field in the ELF header is less than the size of an ELF program header\n")); ++ return FALSE; ++ } ++ if (size > sizeof * phdrs) ++ warn (_("The e_phentsize field in the ELF header is larger than the size of an ELF program header\n")); ++ ++ phdrs = (Elf64_External_Phdr *) get_data (NULL, filedata, filedata->file_header.e_phoff, ++ size, num, _("program headers")); ++ if (!phdrs) ++ return FALSE; ++ ++ for (i = 0, internal = pheaders, external = phdrs; ++ i < filedata->file_header.e_phnum; ++ i++, internal++, external++) ++ { ++ internal->p_type = BYTE_GET (external->p_type); ++ internal->p_flags = BYTE_GET (external->p_flags); ++ internal->p_offset = BYTE_GET (external->p_offset); ++ internal->p_vaddr = BYTE_GET (external->p_vaddr); ++ internal->p_paddr = BYTE_GET (external->p_paddr); ++ internal->p_filesz = BYTE_GET (external->p_filesz); ++ internal->p_memsz = BYTE_GET (external->p_memsz); ++ internal->p_align = BYTE_GET (external->p_align); ++ } ++ ++ free (phdrs); ++ return TRUE; ++} ++ ++/* Returns TRUE if the program headers were read into `program_headers'. */ ++ ++static bfd_boolean ++get_program_headers (Filedata * filedata) ++{ ++ Elf_Internal_Phdr * phdrs; ++ ++ /* Check cache of prior read. */ ++ if (filedata->program_headers != NULL) ++ return TRUE; ++ ++ /* Be kind to memory checkers by looking for ++ e_phnum values which we know must be invalid. */ ++ if (filedata->file_header.e_phnum ++ * (is_32bit_elf ? sizeof (Elf32_External_Phdr) : sizeof (Elf64_External_Phdr)) ++ >= filedata->file_size) ++ { ++ error (_("Too many program headers - %#x - the file is not that big\n"), ++ filedata->file_header.e_phnum); ++ return FALSE; ++ } ++ ++ phdrs = (Elf_Internal_Phdr *) cmalloc (filedata->file_header.e_phnum, ++ sizeof (Elf_Internal_Phdr)); ++ if (phdrs == NULL) ++ { ++ error (_("Out of memory reading %u program headers\n"), ++ filedata->file_header.e_phnum); ++ return FALSE; ++ } ++ ++ if (is_32bit_elf ++ ? get_32bit_program_headers (filedata, phdrs) ++ : get_64bit_program_headers (filedata, phdrs)) ++ { ++ filedata->program_headers = phdrs; ++ return TRUE; ++ } ++ ++ free (phdrs); ++ return FALSE; ++} ++ ++/* Returns TRUE if the program headers were loaded. */ ++ ++static bfd_boolean ++process_program_headers (Filedata * filedata) ++{ ++ Elf_Internal_Phdr * segment; ++ unsigned int i; ++ Elf_Internal_Phdr * previous_load = NULL; ++ ++ filedata->dynamic_addr = 0; ++ filedata->dynamic_size = 0; ++ ++ if (filedata->file_header.e_phnum == 0) ++ { ++ /* PR binutils/12467. */ ++ if (filedata->file_header.e_phoff != 0) ++ { ++ warn (_("possibly corrupt ELF header - it has a non-zero program" ++ " header offset, but no program headers\n")); ++ return FALSE; ++ } ++ else if (do_segments) ++ printf (_("\nThere are no program headers in this file.\n")); ++ return TRUE; ++ } ++ ++ if (do_segments && !do_header) ++ { ++ printf (_("\nElf file type is %s\n"), get_file_type (filedata->file_header.e_type)); ++ printf (_("Entry point 0x%s\n"), bfd_vmatoa ("x", filedata->file_header.e_entry)); ++ printf (ngettext ("There is %d program header, starting at offset %s\n", ++ "There are %d program headers, starting at offset %s\n", ++ filedata->file_header.e_phnum), ++ filedata->file_header.e_phnum, ++ bfd_vmatoa ("u", filedata->file_header.e_phoff)); ++ } ++ ++ if (! get_program_headers (filedata)) ++ return TRUE; ++ ++ if (do_segments) ++ { ++ if (filedata->file_header.e_phnum > 1) ++ printf (_("\nProgram Headers:\n")); ++ else ++ printf (_("\nProgram Headers:\n")); ++ ++ if (is_32bit_elf) ++ printf ++ (_(" Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n")); ++ else if (do_wide) ++ printf ++ (_(" Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n")); ++ else ++ { ++ printf ++ (_(" Type Offset VirtAddr PhysAddr\n")); ++ printf ++ (_(" FileSiz MemSiz Flags Align\n")); ++ } ++ } ++ ++ for (i = 0, segment = filedata->program_headers; ++ i < filedata->file_header.e_phnum; ++ i++, segment++) ++ { ++ if (do_segments) ++ { ++ printf (" %-14.14s ", get_segment_type (filedata, segment->p_type)); ++ ++ if (is_32bit_elf) ++ { ++ printf ("0x%6.6lx ", (unsigned long) segment->p_offset); ++ printf ("0x%8.8lx ", (unsigned long) segment->p_vaddr); ++ printf ("0x%8.8lx ", (unsigned long) segment->p_paddr); ++ printf ("0x%5.5lx ", (unsigned long) segment->p_filesz); ++ printf ("0x%5.5lx ", (unsigned long) segment->p_memsz); ++ printf ("%c%c%c ", ++ (segment->p_flags & PF_R ? 'R' : ' '), ++ (segment->p_flags & PF_W ? 'W' : ' '), ++ (segment->p_flags & PF_X ? 'E' : ' ')); ++ printf ("%#lx", (unsigned long) segment->p_align); ++ } ++ else if (do_wide) ++ { ++ if ((unsigned long) segment->p_offset == segment->p_offset) ++ printf ("0x%6.6lx ", (unsigned long) segment->p_offset); ++ else ++ { ++ print_vma (segment->p_offset, FULL_HEX); ++ putchar (' '); ++ } ++ ++ print_vma (segment->p_vaddr, FULL_HEX); ++ putchar (' '); ++ print_vma (segment->p_paddr, FULL_HEX); ++ putchar (' '); ++ ++ if ((unsigned long) segment->p_filesz == segment->p_filesz) ++ printf ("0x%6.6lx ", (unsigned long) segment->p_filesz); ++ else ++ { ++ print_vma (segment->p_filesz, FULL_HEX); ++ putchar (' '); ++ } ++ ++ if ((unsigned long) segment->p_memsz == segment->p_memsz) ++ printf ("0x%6.6lx", (unsigned long) segment->p_memsz); ++ else ++ { ++ print_vma (segment->p_memsz, FULL_HEX); ++ } ++ ++ printf (" %c%c%c ", ++ (segment->p_flags & PF_R ? 'R' : ' '), ++ (segment->p_flags & PF_W ? 'W' : ' '), ++ (segment->p_flags & PF_X ? 'E' : ' ')); ++ ++ if ((unsigned long) segment->p_align == segment->p_align) ++ printf ("%#lx", (unsigned long) segment->p_align); ++ else ++ { ++ print_vma (segment->p_align, PREFIX_HEX); ++ } ++ } ++ else ++ { ++ print_vma (segment->p_offset, FULL_HEX); ++ putchar (' '); ++ print_vma (segment->p_vaddr, FULL_HEX); ++ putchar (' '); ++ print_vma (segment->p_paddr, FULL_HEX); ++ printf ("\n "); ++ print_vma (segment->p_filesz, FULL_HEX); ++ putchar (' '); ++ print_vma (segment->p_memsz, FULL_HEX); ++ printf (" %c%c%c ", ++ (segment->p_flags & PF_R ? 'R' : ' '), ++ (segment->p_flags & PF_W ? 'W' : ' '), ++ (segment->p_flags & PF_X ? 'E' : ' ')); ++ print_vma (segment->p_align, PREFIX_HEX); ++ } ++ ++ putc ('\n', stdout); ++ } ++ ++ switch (segment->p_type) ++ { ++ case PT_LOAD: ++#if 0 /* Do not warn about out of order PT_LOAD segments. Although officially ++ required by the ELF standard, several programs, including the Linux ++ kernel, make use of non-ordered segments. */ ++ if (previous_load ++ && previous_load->p_vaddr > segment->p_vaddr) ++ error (_("LOAD segments must be sorted in order of increasing VirtAddr\n")); ++#endif ++ if (segment->p_memsz < segment->p_filesz) ++ error (_("the segment's file size is larger than its memory size\n")); ++ previous_load = segment; ++ break; ++ ++ case PT_PHDR: ++ /* PR 20815 - Verify that the program header is loaded into memory. */ ++ if (i > 0 && previous_load != NULL) ++ error (_("the PHDR segment must occur before any LOAD segment\n")); ++ if (filedata->file_header.e_machine != EM_PARISC) ++ { ++ unsigned int j; ++ ++ for (j = 1; j < filedata->file_header.e_phnum; j++) ++ { ++ Elf_Internal_Phdr *load = filedata->program_headers + j; ++ if (load->p_type == PT_LOAD ++ && load->p_offset <= segment->p_offset ++ && (load->p_offset + load->p_filesz ++ >= segment->p_offset + segment->p_filesz) ++ && load->p_vaddr <= segment->p_vaddr ++ && (load->p_vaddr + load->p_filesz ++ >= segment->p_vaddr + segment->p_filesz)) ++ break; ++ } ++ if (j == filedata->file_header.e_phnum) ++ error (_("the PHDR segment is not covered by a LOAD segment\n")); ++ } ++ break; ++ ++ case PT_DYNAMIC: ++ if (filedata->dynamic_addr) ++ error (_("more than one dynamic segment\n")); ++ ++ /* By default, assume that the .dynamic section is the first ++ section in the DYNAMIC segment. */ ++ filedata->dynamic_addr = segment->p_offset; ++ filedata->dynamic_size = segment->p_filesz; ++ ++ /* Try to locate the .dynamic section. If there is ++ a section header table, we can easily locate it. */ ++ if (filedata->section_headers != NULL) ++ { ++ Elf_Internal_Shdr * sec; ++ ++ sec = find_section (filedata, ".dynamic"); ++ if (sec == NULL || sec->sh_size == 0) ++ { ++ /* A corresponding .dynamic section is expected, but on ++ IA-64/OpenVMS it is OK for it to be missing. */ ++ if (!is_ia64_vms (filedata)) ++ error (_("no .dynamic section in the dynamic segment\n")); ++ break; ++ } ++ ++ if (sec->sh_type == SHT_NOBITS) ++ { ++ filedata->dynamic_size = 0; ++ break; ++ } ++ ++ filedata->dynamic_addr = sec->sh_offset; ++ filedata->dynamic_size = sec->sh_size; ++ ++ /* The PT_DYNAMIC segment, which is used by the run-time ++ loader, should exactly match the .dynamic section. */ ++ if (do_checks ++ && (filedata->dynamic_addr != segment->p_offset ++ || filedata->dynamic_size != segment->p_filesz)) ++ warn (_("\ ++the .dynamic section is not the same as the dynamic segment\n")); ++ } ++ ++ /* PR binutils/17512: Avoid corrupt dynamic section info in the ++ segment. Check this after matching against the section headers ++ so we don't warn on debuginfo file (which have NOBITS .dynamic ++ sections). */ ++ if (filedata->dynamic_addr > filedata->file_size ++ || (filedata->dynamic_size ++ > filedata->file_size - filedata->dynamic_addr)) ++ { ++ error (_("the dynamic segment offset + size exceeds the size of the file\n")); ++ filedata->dynamic_addr = filedata->dynamic_size = 0; ++ } ++ break; ++ ++ case PT_INTERP: ++ if (fseek (filedata->handle, ++ filedata->archive_file_offset + (long) segment->p_offset, ++ SEEK_SET)) ++ error (_("Unable to find program interpreter name\n")); ++ else ++ { ++ char fmt [32]; ++ int ret = snprintf (fmt, sizeof (fmt), "%%%ds", PATH_MAX - 1); ++ ++ if (ret >= (int) sizeof (fmt) || ret < 0) ++ error (_("Internal error: failed to create format string to display program interpreter\n")); ++ ++ filedata->program_interpreter[0] = 0; ++ if (fscanf (filedata->handle, fmt, ++ filedata->program_interpreter) <= 0) ++ error (_("Unable to read program interpreter name\n")); ++ ++ if (do_segments) ++ printf (_(" [Requesting program interpreter: %s]\n"), ++ filedata->program_interpreter); ++ } ++ break; ++ } ++ } ++ ++ if (do_segments ++ && filedata->section_headers != NULL ++ && filedata->string_table != NULL) ++ { ++ printf (_("\n Section to Segment mapping:\n")); ++ printf (_(" Segment Sections...\n")); ++ ++ for (i = 0; i < filedata->file_header.e_phnum; i++) ++ { ++ unsigned int j; ++ Elf_Internal_Shdr * section; ++ ++ segment = filedata->program_headers + i; ++ section = filedata->section_headers + 1; ++ ++ printf (" %2.2d ", i); ++ ++ for (j = 1; j < filedata->file_header.e_shnum; j++, section++) ++ { ++ if (!ELF_TBSS_SPECIAL (section, segment) ++ && ELF_SECTION_IN_SEGMENT_STRICT (section, segment)) ++ printf ("%s ", printable_section_name (filedata, section)); ++ } ++ ++ putc ('\n',stdout); ++ } ++ } ++ ++ return TRUE; ++} ++ ++ ++/* Find the file offset corresponding to VMA by using the program headers. */ ++ ++static long ++offset_from_vma (Filedata * filedata, bfd_vma vma, bfd_size_type size) ++{ ++ Elf_Internal_Phdr * seg; ++ ++ if (! get_program_headers (filedata)) ++ { ++ warn (_("Cannot interpret virtual addresses without program headers.\n")); ++ return (long) vma; ++ } ++ ++ for (seg = filedata->program_headers; ++ seg < filedata->program_headers + filedata->file_header.e_phnum; ++ ++seg) ++ { ++ if (seg->p_type != PT_LOAD) ++ continue; ++ ++ if (vma >= (seg->p_vaddr & -seg->p_align) ++ && vma + size <= seg->p_vaddr + seg->p_filesz) ++ return vma - seg->p_vaddr + seg->p_offset; ++ } ++ ++ warn (_("Virtual address 0x%lx not located in any PT_LOAD segment.\n"), ++ (unsigned long) vma); ++ return (long) vma; ++} ++ ++ ++/* Allocate memory and load the sections headers into FILEDATA->filedata->section_headers. ++ If PROBE is true, this is just a probe and we do not generate any error ++ messages if the load fails. */ ++ ++static bfd_boolean ++get_32bit_section_headers (Filedata * filedata, bfd_boolean probe) ++{ ++ Elf32_External_Shdr * shdrs; ++ Elf_Internal_Shdr * internal; ++ unsigned int i; ++ unsigned int size = filedata->file_header.e_shentsize; ++ unsigned int num = probe ? 1 : filedata->file_header.e_shnum; ++ ++ /* PR binutils/17531: Cope with unexpected section header sizes. */ ++ if (size == 0 || num == 0) ++ return FALSE; ++ if (size < sizeof * shdrs) ++ { ++ if (! probe) ++ error (_("The e_shentsize field in the ELF header is less than the size of an ELF section header\n")); ++ return FALSE; ++ } ++ if (!probe && size > sizeof * shdrs) ++ warn (_("The e_shentsize field in the ELF header is larger than the size of an ELF section header\n")); ++ ++ shdrs = (Elf32_External_Shdr *) get_data (NULL, filedata, filedata->file_header.e_shoff, ++ size, num, ++ probe ? NULL : _("section headers")); ++ if (shdrs == NULL) ++ return FALSE; ++ ++ free (filedata->section_headers); ++ filedata->section_headers = (Elf_Internal_Shdr *) ++ cmalloc (num, sizeof (Elf_Internal_Shdr)); ++ if (filedata->section_headers == NULL) ++ { ++ if (!probe) ++ error (_("Out of memory reading %u section headers\n"), num); ++ free (shdrs); ++ return FALSE; ++ } ++ ++ for (i = 0, internal = filedata->section_headers; ++ i < num; ++ i++, internal++) ++ { ++ internal->sh_name = BYTE_GET (shdrs[i].sh_name); ++ internal->sh_type = BYTE_GET (shdrs[i].sh_type); ++ internal->sh_flags = BYTE_GET (shdrs[i].sh_flags); ++ internal->sh_addr = BYTE_GET (shdrs[i].sh_addr); ++ internal->sh_offset = BYTE_GET (shdrs[i].sh_offset); ++ internal->sh_size = BYTE_GET (shdrs[i].sh_size); ++ internal->sh_link = BYTE_GET (shdrs[i].sh_link); ++ internal->sh_info = BYTE_GET (shdrs[i].sh_info); ++ internal->sh_addralign = BYTE_GET (shdrs[i].sh_addralign); ++ internal->sh_entsize = BYTE_GET (shdrs[i].sh_entsize); ++ if (!probe && internal->sh_link > num) ++ warn (_("Section %u has an out of range sh_link value of %u\n"), i, internal->sh_link); ++ if (!probe && internal->sh_flags & SHF_INFO_LINK && internal->sh_info > num) ++ warn (_("Section %u has an out of range sh_info value of %u\n"), i, internal->sh_info); ++ } ++ ++ free (shdrs); ++ return TRUE; ++} ++ ++/* Like get_32bit_section_headers, except that it fetches 64-bit headers. */ ++ ++static bfd_boolean ++get_64bit_section_headers (Filedata * filedata, bfd_boolean probe) ++{ ++ Elf64_External_Shdr * shdrs; ++ Elf_Internal_Shdr * internal; ++ unsigned int i; ++ unsigned int size = filedata->file_header.e_shentsize; ++ unsigned int num = probe ? 1 : filedata->file_header.e_shnum; ++ ++ /* PR binutils/17531: Cope with unexpected section header sizes. */ ++ if (size == 0 || num == 0) ++ return FALSE; ++ ++ if (size < sizeof * shdrs) ++ { ++ if (! probe) ++ error (_("The e_shentsize field in the ELF header is less than the size of an ELF section header\n")); ++ return FALSE; ++ } ++ ++ if (! probe && size > sizeof * shdrs) ++ warn (_("The e_shentsize field in the ELF header is larger than the size of an ELF section header\n")); ++ ++ shdrs = (Elf64_External_Shdr *) get_data (NULL, filedata, ++ filedata->file_header.e_shoff, ++ size, num, ++ probe ? NULL : _("section headers")); ++ if (shdrs == NULL) ++ return FALSE; ++ ++ free (filedata->section_headers); ++ filedata->section_headers = (Elf_Internal_Shdr *) ++ cmalloc (num, sizeof (Elf_Internal_Shdr)); ++ if (filedata->section_headers == NULL) ++ { ++ if (! probe) ++ error (_("Out of memory reading %u section headers\n"), num); ++ free (shdrs); ++ return FALSE; ++ } ++ ++ for (i = 0, internal = filedata->section_headers; ++ i < num; ++ i++, internal++) ++ { ++ internal->sh_name = BYTE_GET (shdrs[i].sh_name); ++ internal->sh_type = BYTE_GET (shdrs[i].sh_type); ++ internal->sh_flags = BYTE_GET (shdrs[i].sh_flags); ++ internal->sh_addr = BYTE_GET (shdrs[i].sh_addr); ++ internal->sh_size = BYTE_GET (shdrs[i].sh_size); ++ internal->sh_entsize = BYTE_GET (shdrs[i].sh_entsize); ++ internal->sh_link = BYTE_GET (shdrs[i].sh_link); ++ internal->sh_info = BYTE_GET (shdrs[i].sh_info); ++ internal->sh_offset = BYTE_GET (shdrs[i].sh_offset); ++ internal->sh_addralign = BYTE_GET (shdrs[i].sh_addralign); ++ if (!probe && internal->sh_link > num) ++ warn (_("Section %u has an out of range sh_link value of %u\n"), i, internal->sh_link); ++ if (!probe && internal->sh_flags & SHF_INFO_LINK && internal->sh_info > num) ++ warn (_("Section %u has an out of range sh_info value of %u\n"), i, internal->sh_info); ++ } ++ ++ free (shdrs); ++ return TRUE; ++} ++ ++static Elf_Internal_Sym * ++get_32bit_elf_symbols (Filedata * filedata, ++ Elf_Internal_Shdr * section, ++ unsigned long * num_syms_return) ++{ ++ unsigned long number = 0; ++ Elf32_External_Sym * esyms = NULL; ++ Elf_External_Sym_Shndx * shndx = NULL; ++ Elf_Internal_Sym * isyms = NULL; ++ Elf_Internal_Sym * psym; ++ unsigned int j; ++ elf_section_list * entry; ++ ++ if (section->sh_size == 0) ++ { ++ if (num_syms_return != NULL) ++ * num_syms_return = 0; ++ return NULL; ++ } ++ ++ /* Run some sanity checks first. */ ++ if (section->sh_entsize == 0 || section->sh_entsize > section->sh_size) ++ { ++ error (_("Section %s has an invalid sh_entsize of 0x%lx\n"), ++ printable_section_name (filedata, section), ++ (unsigned long) section->sh_entsize); ++ goto exit_point; ++ } ++ ++ if (section->sh_size > filedata->file_size) ++ { ++ error (_("Section %s has an invalid sh_size of 0x%lx\n"), ++ printable_section_name (filedata, section), ++ (unsigned long) section->sh_size); ++ goto exit_point; ++ } ++ ++ number = section->sh_size / section->sh_entsize; ++ ++ if (number * sizeof (Elf32_External_Sym) > section->sh_size + 1) ++ { ++ error (_("Size (0x%lx) of section %s is not a multiple of its sh_entsize (0x%lx)\n"), ++ (unsigned long) section->sh_size, ++ printable_section_name (filedata, section), ++ (unsigned long) section->sh_entsize); ++ goto exit_point; ++ } ++ ++ esyms = (Elf32_External_Sym *) get_data (NULL, filedata, section->sh_offset, 1, ++ section->sh_size, _("symbols")); ++ if (esyms == NULL) ++ goto exit_point; ++ ++ shndx = NULL; ++ for (entry = filedata->symtab_shndx_list; entry != NULL; entry = entry->next) ++ { ++ if (entry->hdr->sh_link != (unsigned long) (section - filedata->section_headers)) ++ continue; ++ ++ if (shndx != NULL) ++ { ++ error (_("Multiple symbol table index sections associated with the same symbol section\n")); ++ free (shndx); ++ } ++ ++ shndx = (Elf_External_Sym_Shndx *) get_data (NULL, filedata, ++ entry->hdr->sh_offset, ++ 1, entry->hdr->sh_size, ++ _("symbol table section indices")); ++ if (shndx == NULL) ++ goto exit_point; ++ ++ /* PR17531: file: heap-buffer-overflow */ ++ if (entry->hdr->sh_size / sizeof (Elf_External_Sym_Shndx) < number) ++ { ++ error (_("Index section %s has an sh_size of 0x%lx - expected 0x%lx\n"), ++ printable_section_name (filedata, entry->hdr), ++ (unsigned long) entry->hdr->sh_size, ++ (unsigned long) section->sh_size); ++ goto exit_point; ++ } ++ } ++ ++ isyms = (Elf_Internal_Sym *) cmalloc (number, sizeof (Elf_Internal_Sym)); ++ ++ if (isyms == NULL) ++ { ++ error (_("Out of memory reading %lu symbols\n"), ++ (unsigned long) number); ++ goto exit_point; ++ } ++ ++ for (j = 0, psym = isyms; j < number; j++, psym++) ++ { ++ psym->st_name = BYTE_GET (esyms[j].st_name); ++ psym->st_value = BYTE_GET (esyms[j].st_value); ++ psym->st_size = BYTE_GET (esyms[j].st_size); ++ psym->st_shndx = BYTE_GET (esyms[j].st_shndx); ++ if (psym->st_shndx == (SHN_XINDEX & 0xffff) && shndx != NULL) ++ psym->st_shndx ++ = byte_get ((unsigned char *) &shndx[j], sizeof (shndx[j])); ++ else if (psym->st_shndx >= (SHN_LORESERVE & 0xffff)) ++ psym->st_shndx += SHN_LORESERVE - (SHN_LORESERVE & 0xffff); ++ psym->st_info = BYTE_GET (esyms[j].st_info); ++ psym->st_other = BYTE_GET (esyms[j].st_other); ++ } ++ ++ exit_point: ++ free (shndx); ++ free (esyms); ++ ++ if (num_syms_return != NULL) ++ * num_syms_return = isyms == NULL ? 0 : number; ++ ++ return isyms; ++} ++ ++static Elf_Internal_Sym * ++get_64bit_elf_symbols (Filedata * filedata, ++ Elf_Internal_Shdr * section, ++ unsigned long * num_syms_return) ++{ ++ unsigned long number = 0; ++ Elf64_External_Sym * esyms = NULL; ++ Elf_External_Sym_Shndx * shndx = NULL; ++ Elf_Internal_Sym * isyms = NULL; ++ Elf_Internal_Sym * psym; ++ unsigned int j; ++ elf_section_list * entry; ++ ++ if (section->sh_size == 0) ++ { ++ if (num_syms_return != NULL) ++ * num_syms_return = 0; ++ return NULL; ++ } ++ ++ /* Run some sanity checks first. */ ++ if (section->sh_entsize == 0 || section->sh_entsize > section->sh_size) ++ { ++ error (_("Section %s has an invalid sh_entsize of 0x%lx\n"), ++ printable_section_name (filedata, section), ++ (unsigned long) section->sh_entsize); ++ goto exit_point; ++ } ++ ++ if (section->sh_size > filedata->file_size) ++ { ++ error (_("Section %s has an invalid sh_size of 0x%lx\n"), ++ printable_section_name (filedata, section), ++ (unsigned long) section->sh_size); ++ goto exit_point; ++ } ++ ++ number = section->sh_size / section->sh_entsize; ++ ++ if (number * sizeof (Elf64_External_Sym) > section->sh_size + 1) ++ { ++ error (_("Size (0x%lx) of section %s is not a multiple of its sh_entsize (0x%lx)\n"), ++ (unsigned long) section->sh_size, ++ printable_section_name (filedata, section), ++ (unsigned long) section->sh_entsize); ++ goto exit_point; ++ } ++ ++ esyms = (Elf64_External_Sym *) get_data (NULL, filedata, section->sh_offset, 1, ++ section->sh_size, _("symbols")); ++ if (!esyms) ++ goto exit_point; ++ ++ shndx = NULL; ++ for (entry = filedata->symtab_shndx_list; entry != NULL; entry = entry->next) ++ { ++ if (entry->hdr->sh_link != (unsigned long) (section - filedata->section_headers)) ++ continue; ++ ++ if (shndx != NULL) ++ { ++ error (_("Multiple symbol table index sections associated with the same symbol section\n")); ++ free (shndx); ++ } ++ ++ shndx = (Elf_External_Sym_Shndx *) get_data (NULL, filedata, ++ entry->hdr->sh_offset, ++ 1, entry->hdr->sh_size, ++ _("symbol table section indices")); ++ if (shndx == NULL) ++ goto exit_point; ++ ++ /* PR17531: file: heap-buffer-overflow */ ++ if (entry->hdr->sh_size / sizeof (Elf_External_Sym_Shndx) < number) ++ { ++ error (_("Index section %s has an sh_size of 0x%lx - expected 0x%lx\n"), ++ printable_section_name (filedata, entry->hdr), ++ (unsigned long) entry->hdr->sh_size, ++ (unsigned long) section->sh_size); ++ goto exit_point; ++ } ++ } ++ ++ isyms = (Elf_Internal_Sym *) cmalloc (number, sizeof (Elf_Internal_Sym)); ++ ++ if (isyms == NULL) ++ { ++ error (_("Out of memory reading %lu symbols\n"), ++ (unsigned long) number); ++ goto exit_point; ++ } ++ ++ for (j = 0, psym = isyms; j < number; j++, psym++) ++ { ++ psym->st_name = BYTE_GET (esyms[j].st_name); ++ psym->st_info = BYTE_GET (esyms[j].st_info); ++ psym->st_other = BYTE_GET (esyms[j].st_other); ++ psym->st_shndx = BYTE_GET (esyms[j].st_shndx); ++ ++ if (psym->st_shndx == (SHN_XINDEX & 0xffff) && shndx != NULL) ++ psym->st_shndx ++ = byte_get ((unsigned char *) &shndx[j], sizeof (shndx[j])); ++ else if (psym->st_shndx >= (SHN_LORESERVE & 0xffff)) ++ psym->st_shndx += SHN_LORESERVE - (SHN_LORESERVE & 0xffff); ++ ++ psym->st_value = BYTE_GET (esyms[j].st_value); ++ psym->st_size = BYTE_GET (esyms[j].st_size); ++ } ++ ++ exit_point: ++ free (shndx); ++ free (esyms); ++ ++ if (num_syms_return != NULL) ++ * num_syms_return = isyms == NULL ? 0 : number; ++ ++ return isyms; ++} ++ ++static const char * ++get_elf_section_flags (Filedata * filedata, bfd_vma sh_flags) ++{ ++ static char buff[1024]; ++ char * p = buff; ++ unsigned int field_size = is_32bit_elf ? 8 : 16; ++ signed int sindex; ++ unsigned int size = sizeof (buff) - (field_size + 4 + 1); ++ bfd_vma os_flags = 0; ++ bfd_vma proc_flags = 0; ++ bfd_vma unknown_flags = 0; ++ static const struct ++ { ++ const char * str; ++ unsigned int len; ++ } ++ flags [] = ++ { ++ /* 0 */ { STRING_COMMA_LEN ("WRITE") }, ++ /* 1 */ { STRING_COMMA_LEN ("ALLOC") }, ++ /* 2 */ { STRING_COMMA_LEN ("EXEC") }, ++ /* 3 */ { STRING_COMMA_LEN ("MERGE") }, ++ /* 4 */ { STRING_COMMA_LEN ("STRINGS") }, ++ /* 5 */ { STRING_COMMA_LEN ("INFO LINK") }, ++ /* 6 */ { STRING_COMMA_LEN ("LINK ORDER") }, ++ /* 7 */ { STRING_COMMA_LEN ("OS NONCONF") }, ++ /* 8 */ { STRING_COMMA_LEN ("GROUP") }, ++ /* 9 */ { STRING_COMMA_LEN ("TLS") }, ++ /* IA-64 specific. */ ++ /* 10 */ { STRING_COMMA_LEN ("SHORT") }, ++ /* 11 */ { STRING_COMMA_LEN ("NORECOV") }, ++ /* IA-64 OpenVMS specific. */ ++ /* 12 */ { STRING_COMMA_LEN ("VMS_GLOBAL") }, ++ /* 13 */ { STRING_COMMA_LEN ("VMS_OVERLAID") }, ++ /* 14 */ { STRING_COMMA_LEN ("VMS_SHARED") }, ++ /* 15 */ { STRING_COMMA_LEN ("VMS_VECTOR") }, ++ /* 16 */ { STRING_COMMA_LEN ("VMS_ALLOC_64BIT") }, ++ /* 17 */ { STRING_COMMA_LEN ("VMS_PROTECTED") }, ++ /* Generic. */ ++ /* 18 */ { STRING_COMMA_LEN ("EXCLUDE") }, ++ /* SPARC specific. */ ++ /* 19 */ { STRING_COMMA_LEN ("ORDERED") }, ++ /* 20 */ { STRING_COMMA_LEN ("COMPRESSED") }, ++ /* ARM specific. */ ++ /* 21 */ { STRING_COMMA_LEN ("ENTRYSECT") }, ++ /* 22 */ { STRING_COMMA_LEN ("ARM_PURECODE") }, ++ /* 23 */ { STRING_COMMA_LEN ("COMDEF") }, ++ /* GNU specific. */ ++ /* 24 */ { STRING_COMMA_LEN ("GNU_MBIND") }, ++ /* VLE specific. */ ++ /* 25 */ { STRING_COMMA_LEN ("VLE") }, ++ }; ++ ++ if (do_section_details) ++ { ++ sprintf (buff, "[%*.*lx]: ", ++ field_size, field_size, (unsigned long) sh_flags); ++ p += field_size + 4; ++ } ++ ++ while (sh_flags) ++ { ++ bfd_vma flag; ++ ++ flag = sh_flags & - sh_flags; ++ sh_flags &= ~ flag; ++ ++ if (do_section_details) ++ { ++ switch (flag) ++ { ++ case SHF_WRITE: sindex = 0; break; ++ case SHF_ALLOC: sindex = 1; break; ++ case SHF_EXECINSTR: sindex = 2; break; ++ case SHF_MERGE: sindex = 3; break; ++ case SHF_STRINGS: sindex = 4; break; ++ case SHF_INFO_LINK: sindex = 5; break; ++ case SHF_LINK_ORDER: sindex = 6; break; ++ case SHF_OS_NONCONFORMING: sindex = 7; break; ++ case SHF_GROUP: sindex = 8; break; ++ case SHF_TLS: sindex = 9; break; ++ case SHF_EXCLUDE: sindex = 18; break; ++ case SHF_COMPRESSED: sindex = 20; break; ++ case SHF_GNU_MBIND: sindex = 24; break; ++ ++ default: ++ sindex = -1; ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_IA_64: ++ if (flag == SHF_IA_64_SHORT) ++ sindex = 10; ++ else if (flag == SHF_IA_64_NORECOV) ++ sindex = 11; ++#ifdef BFD64 ++ else if (filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_OPENVMS) ++ switch (flag) ++ { ++ case SHF_IA_64_VMS_GLOBAL: sindex = 12; break; ++ case SHF_IA_64_VMS_OVERLAID: sindex = 13; break; ++ case SHF_IA_64_VMS_SHARED: sindex = 14; break; ++ case SHF_IA_64_VMS_VECTOR: sindex = 15; break; ++ case SHF_IA_64_VMS_ALLOC_64BIT: sindex = 16; break; ++ case SHF_IA_64_VMS_PROTECTED: sindex = 17; break; ++ default: break; ++ } ++#endif ++ break; ++ ++ case EM_386: ++ case EM_IAMCU: ++ case EM_X86_64: ++ case EM_L1OM: ++ case EM_K1OM: ++ case EM_OLD_SPARCV9: ++ case EM_SPARC32PLUS: ++ case EM_SPARCV9: ++ case EM_SPARC: ++ if (flag == SHF_ORDERED) ++ sindex = 19; ++ break; ++ ++ case EM_ARM: ++ switch (flag) ++ { ++ case SHF_ENTRYSECT: sindex = 21; break; ++ case SHF_ARM_PURECODE: sindex = 22; break; ++ case SHF_COMDEF: sindex = 23; break; ++ default: break; ++ } ++ break; ++ case EM_PPC: ++ if (flag == SHF_PPC_VLE) ++ sindex = 25; ++ break; ++ ++ default: ++ break; ++ } ++ } ++ ++ if (sindex != -1) ++ { ++ if (p != buff + field_size + 4) ++ { ++ if (size < (10 + 2)) ++ { ++ warn (_("Internal error: not enough buffer room for section flag info")); ++ return _(""); ++ } ++ size -= 2; ++ *p++ = ','; ++ *p++ = ' '; ++ } ++ ++ size -= flags [sindex].len; ++ p = stpcpy (p, flags [sindex].str); ++ } ++ else if (flag & SHF_MASKOS) ++ os_flags |= flag; ++ else if (flag & SHF_MASKPROC) ++ proc_flags |= flag; ++ else ++ unknown_flags |= flag; ++ } ++ else ++ { ++ switch (flag) ++ { ++ case SHF_WRITE: *p = 'W'; break; ++ case SHF_ALLOC: *p = 'A'; break; ++ case SHF_EXECINSTR: *p = 'X'; break; ++ case SHF_MERGE: *p = 'M'; break; ++ case SHF_STRINGS: *p = 'S'; break; ++ case SHF_INFO_LINK: *p = 'I'; break; ++ case SHF_LINK_ORDER: *p = 'L'; break; ++ case SHF_OS_NONCONFORMING: *p = 'O'; break; ++ case SHF_GROUP: *p = 'G'; break; ++ case SHF_TLS: *p = 'T'; break; ++ case SHF_EXCLUDE: *p = 'E'; break; ++ case SHF_COMPRESSED: *p = 'C'; break; ++ case SHF_GNU_MBIND: *p = 'D'; break; ++ ++ default: ++ if ((filedata->file_header.e_machine == EM_X86_64 ++ || filedata->file_header.e_machine == EM_L1OM ++ || filedata->file_header.e_machine == EM_K1OM) ++ && flag == SHF_X86_64_LARGE) ++ *p = 'l'; ++ else if (filedata->file_header.e_machine == EM_ARM ++ && flag == SHF_ARM_PURECODE) ++ *p = 'y'; ++ else if (filedata->file_header.e_machine == EM_PPC ++ && flag == SHF_PPC_VLE) ++ *p = 'v'; ++ else if (flag & SHF_MASKOS) ++ { ++ *p = 'o'; ++ sh_flags &= ~ SHF_MASKOS; ++ } ++ else if (flag & SHF_MASKPROC) ++ { ++ *p = 'p'; ++ sh_flags &= ~ SHF_MASKPROC; ++ } ++ else ++ *p = 'x'; ++ break; ++ } ++ p++; ++ } ++ } ++ ++ if (do_section_details) ++ { ++ if (os_flags) ++ { ++ size -= 5 + field_size; ++ if (p != buff + field_size + 4) ++ { ++ if (size < (2 + 1)) ++ { ++ warn (_("Internal error: not enough buffer room for section flag info")); ++ return _(""); ++ } ++ size -= 2; ++ *p++ = ','; ++ *p++ = ' '; ++ } ++ sprintf (p, "OS (%*.*lx)", field_size, field_size, ++ (unsigned long) os_flags); ++ p += 5 + field_size; ++ } ++ if (proc_flags) ++ { ++ size -= 7 + field_size; ++ if (p != buff + field_size + 4) ++ { ++ if (size < (2 + 1)) ++ { ++ warn (_("Internal error: not enough buffer room for section flag info")); ++ return _(""); ++ } ++ size -= 2; ++ *p++ = ','; ++ *p++ = ' '; ++ } ++ sprintf (p, "PROC (%*.*lx)", field_size, field_size, ++ (unsigned long) proc_flags); ++ p += 7 + field_size; ++ } ++ if (unknown_flags) ++ { ++ size -= 10 + field_size; ++ if (p != buff + field_size + 4) ++ { ++ if (size < (2 + 1)) ++ { ++ warn (_("Internal error: not enough buffer room for section flag info")); ++ return _(""); ++ } ++ size -= 2; ++ *p++ = ','; ++ *p++ = ' '; ++ } ++ sprintf (p, _("UNKNOWN (%*.*lx)"), field_size, field_size, ++ (unsigned long) unknown_flags); ++ p += 10 + field_size; ++ } ++ } ++ ++ *p = '\0'; ++ return buff; ++} ++ ++static unsigned int ATTRIBUTE_WARN_UNUSED_RESULT ++get_compression_header (Elf_Internal_Chdr *chdr, unsigned char *buf, bfd_size_type size) ++{ ++ if (is_32bit_elf) ++ { ++ Elf32_External_Chdr *echdr = (Elf32_External_Chdr *) buf; ++ ++ if (size < sizeof (* echdr)) ++ { ++ error (_("Compressed section is too small even for a compression header\n")); ++ return 0; ++ } ++ ++ chdr->ch_type = BYTE_GET (echdr->ch_type); ++ chdr->ch_size = BYTE_GET (echdr->ch_size); ++ chdr->ch_addralign = BYTE_GET (echdr->ch_addralign); ++ return sizeof (*echdr); ++ } ++ else ++ { ++ Elf64_External_Chdr *echdr = (Elf64_External_Chdr *) buf; ++ ++ if (size < sizeof (* echdr)) ++ { ++ error (_("Compressed section is too small even for a compression header\n")); ++ return 0; ++ } ++ ++ chdr->ch_type = BYTE_GET (echdr->ch_type); ++ chdr->ch_size = BYTE_GET (echdr->ch_size); ++ chdr->ch_addralign = BYTE_GET (echdr->ch_addralign); ++ return sizeof (*echdr); ++ } ++} ++ ++static bfd_boolean ++process_section_headers (Filedata * filedata) ++{ ++ Elf_Internal_Shdr * section; ++ unsigned int i; ++ ++ free (filedata->section_headers); ++ filedata->section_headers = NULL; ++ free (filedata->dynamic_symbols); ++ filedata->dynamic_symbols = NULL; ++ filedata->num_dynamic_syms = 0; ++ free (filedata->dynamic_strings); ++ filedata->dynamic_strings = NULL; ++ filedata->dynamic_strings_length = 0; ++ free (filedata->dynamic_syminfo); ++ filedata->dynamic_syminfo = NULL; ++ while (filedata->symtab_shndx_list != NULL) ++ { ++ elf_section_list *next = filedata->symtab_shndx_list->next; ++ free (filedata->symtab_shndx_list); ++ filedata->symtab_shndx_list = next; ++ } ++ ++ if (filedata->file_header.e_shnum == 0) ++ { ++ /* PR binutils/12467. */ ++ if (filedata->file_header.e_shoff != 0) ++ { ++ warn (_("possibly corrupt ELF file header - it has a non-zero" ++ " section header offset, but no section headers\n")); ++ return FALSE; ++ } ++ else if (do_sections) ++ printf (_("\nThere are no sections in this file.\n")); ++ ++ return TRUE; ++ } ++ ++ if (do_sections && !do_header) ++ printf (ngettext ("There is %d section header, " ++ "starting at offset 0x%lx:\n", ++ "There are %d section headers, " ++ "starting at offset 0x%lx:\n", ++ filedata->file_header.e_shnum), ++ filedata->file_header.e_shnum, ++ (unsigned long) filedata->file_header.e_shoff); ++ ++ if (is_32bit_elf) ++ { ++ if (! get_32bit_section_headers (filedata, FALSE)) ++ return FALSE; ++ } ++ else ++ { ++ if (! get_64bit_section_headers (filedata, FALSE)) ++ return FALSE; ++ } ++ ++ /* Read in the string table, so that we have names to display. */ ++ if (filedata->file_header.e_shstrndx != SHN_UNDEF ++ && filedata->file_header.e_shstrndx < filedata->file_header.e_shnum) ++ { ++ section = filedata->section_headers + filedata->file_header.e_shstrndx; ++ ++ if (section->sh_size != 0) ++ { ++ filedata->string_table = (char *) get_data (NULL, filedata, section->sh_offset, ++ 1, section->sh_size, ++ _("string table")); ++ ++ filedata->string_table_length = filedata->string_table != NULL ? section->sh_size : 0; ++ } ++ } ++ ++ /* Scan the sections for the dynamic symbol table ++ and dynamic string table and debug sections. */ ++ eh_addr_size = is_32bit_elf ? 4 : 8; ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_MIPS: ++ case EM_MIPS_RS3_LE: ++ /* The 64-bit MIPS EABI uses a combination of 32-bit ELF and 64-bit ++ FDE addresses. However, the ABI also has a semi-official ILP32 ++ variant for which the normal FDE address size rules apply. ++ ++ GCC 4.0 marks EABI64 objects with a dummy .gcc_compiled_longXX ++ section, where XX is the size of longs in bits. Unfortunately, ++ earlier compilers provided no way of distinguishing ILP32 objects ++ from LP64 objects, so if there's any doubt, we should assume that ++ the official LP64 form is being used. */ ++ if ((filedata->file_header.e_flags & EF_MIPS_ABI) == E_MIPS_ABI_EABI64 ++ && find_section (filedata, ".gcc_compiled_long32") == NULL) ++ eh_addr_size = 8; ++ break; ++ ++ case EM_H8_300: ++ case EM_H8_300H: ++ switch (filedata->file_header.e_flags & EF_H8_MACH) ++ { ++ case E_H8_MACH_H8300: ++ case E_H8_MACH_H8300HN: ++ case E_H8_MACH_H8300SN: ++ case E_H8_MACH_H8300SXN: ++ eh_addr_size = 2; ++ break; ++ case E_H8_MACH_H8300H: ++ case E_H8_MACH_H8300S: ++ case E_H8_MACH_H8300SX: ++ eh_addr_size = 4; ++ break; ++ } ++ break; ++ ++ case EM_M32C_OLD: ++ case EM_M32C: ++ switch (filedata->file_header.e_flags & EF_M32C_CPU_MASK) ++ { ++ case EF_M32C_CPU_M16C: ++ eh_addr_size = 2; ++ break; ++ } ++ break; ++ } ++ ++#define CHECK_ENTSIZE_VALUES(section, i, size32, size64) \ ++ do \ ++ { \ ++ bfd_size_type expected_entsize = is_32bit_elf ? size32 : size64; \ ++ if (section->sh_entsize != expected_entsize) \ ++ { \ ++ char buf[40]; \ ++ sprintf_vma (buf, section->sh_entsize); \ ++ /* Note: coded this way so that there is a single string for \ ++ translation. */ \ ++ error (_("Section %d has invalid sh_entsize of %s\n"), i, buf); \ ++ error (_("(Using the expected size of %u for the rest of this dump)\n"), \ ++ (unsigned) expected_entsize); \ ++ section->sh_entsize = expected_entsize; \ ++ } \ ++ } \ ++ while (0) ++ ++#define CHECK_ENTSIZE(section, i, type) \ ++ CHECK_ENTSIZE_VALUES (section, i, sizeof (Elf32_External_##type), \ ++ sizeof (Elf64_External_##type)) ++ ++ for (i = 0, section = filedata->section_headers; ++ i < filedata->file_header.e_shnum; ++ i++, section++) ++ { ++ char * name = SECTION_NAME (section); ++ ++ /* Run some sanity checks on the headers and ++ possibly fill in some file data as well. */ ++ switch (section->sh_type) ++ { ++ case SHT_DYNSYM: ++ if (filedata->dynamic_symbols != NULL) ++ { ++ error (_("File contains multiple dynamic symbol tables\n")); ++ continue; ++ } ++ ++ CHECK_ENTSIZE (section, i, Sym); ++ filedata->dynamic_symbols ++ = GET_ELF_SYMBOLS (filedata, section, &filedata->num_dynamic_syms); ++ filedata->dynamic_symtab_section = section; ++ break; ++ ++ case SHT_STRTAB: ++ if (streq (name, ".dynstr")) ++ { ++ if (filedata->dynamic_strings != NULL) ++ { ++ error (_("File contains multiple dynamic string tables\n")); ++ continue; ++ } ++ ++ filedata->dynamic_strings ++ = (char *) get_data (NULL, filedata, section->sh_offset, ++ 1, section->sh_size, _("dynamic strings")); ++ filedata->dynamic_strings_length ++ = filedata->dynamic_strings == NULL ? 0 : section->sh_size; ++ filedata->dynamic_strtab_section = section; ++ } ++ break; ++ ++ case SHT_SYMTAB_SHNDX: ++ { ++ elf_section_list * entry = xmalloc (sizeof * entry); ++ ++ entry->hdr = section; ++ entry->next = filedata->symtab_shndx_list; ++ filedata->symtab_shndx_list = entry; ++ } ++ break; ++ ++ case SHT_SYMTAB: ++ CHECK_ENTSIZE (section, i, Sym); ++ break; ++ ++ case SHT_GROUP: ++ CHECK_ENTSIZE_VALUES (section, i, GRP_ENTRY_SIZE, GRP_ENTRY_SIZE); ++ break; ++ ++ case SHT_REL: ++ CHECK_ENTSIZE (section, i, Rel); ++ if (do_checks && section->sh_size == 0) ++ warn (_("Section '%s': zero-sized relocation section\n"), name); ++ break; ++ ++ case SHT_RELA: ++ CHECK_ENTSIZE (section, i, Rela); ++ if (do_checks && section->sh_size == 0) ++ warn (_("Section '%s': zero-sized relocation section\n"), name); ++ break; ++ ++ case SHT_NOTE: ++ case SHT_PROGBITS: ++ /* Having a zero sized section is not illegal according to the ++ ELF standard, but it might be an indication that something ++ is wrong. So issue a warning if we are running in lint mode. */ ++ if (do_checks && section->sh_size == 0) ++ warn (_("Section '%s': has a size of zero - is this intended ?\n"), name); ++ break; ++ ++ default: ++ break; ++ } ++ ++ if ((do_debugging || do_debug_info || do_debug_abbrevs ++ || do_debug_lines || do_debug_pubnames || do_debug_pubtypes ++ || do_debug_aranges || do_debug_frames || do_debug_macinfo ++ || do_debug_str || do_debug_str_offsets || do_debug_loc || do_debug_ranges ++ || do_debug_addr || do_debug_cu_index || do_debug_links) ++ && (const_strneq (name, ".debug_") ++ || const_strneq (name, ".zdebug_"))) ++ { ++ if (name[1] == 'z') ++ name += sizeof (".zdebug_") - 1; ++ else ++ name += sizeof (".debug_") - 1; ++ ++ if (do_debugging ++ || (do_debug_info && const_strneq (name, "info")) ++ || (do_debug_info && const_strneq (name, "types")) ++ || (do_debug_abbrevs && const_strneq (name, "abbrev")) ++ || (do_debug_lines && strcmp (name, "line") == 0) ++ || (do_debug_lines && const_strneq (name, "line.")) ++ || (do_debug_pubnames && const_strneq (name, "pubnames")) ++ || (do_debug_pubtypes && const_strneq (name, "pubtypes")) ++ || (do_debug_pubnames && const_strneq (name, "gnu_pubnames")) ++ || (do_debug_pubtypes && const_strneq (name, "gnu_pubtypes")) ++ || (do_debug_aranges && const_strneq (name, "aranges")) ++ || (do_debug_ranges && const_strneq (name, "ranges")) ++ || (do_debug_ranges && const_strneq (name, "rnglists")) ++ || (do_debug_frames && const_strneq (name, "frame")) ++ || (do_debug_macinfo && const_strneq (name, "macinfo")) ++ || (do_debug_macinfo && const_strneq (name, "macro")) ++ || (do_debug_str && const_strneq (name, "str")) ++ || (do_debug_str_offsets && const_strneq (name, "str_offsets")) ++ || (do_debug_loc && const_strneq (name, "loc")) ++ || (do_debug_loc && const_strneq (name, "loclists")) ++ || (do_debug_addr && const_strneq (name, "addr")) ++ || (do_debug_cu_index && const_strneq (name, "cu_index")) ++ || (do_debug_cu_index && const_strneq (name, "tu_index")) ++ ) ++ request_dump_bynumber (&filedata->dump, i, DEBUG_DUMP); ++ } ++ /* Linkonce section to be combined with .debug_info at link time. */ ++ else if ((do_debugging || do_debug_info) ++ && const_strneq (name, ".gnu.linkonce.wi.")) ++ request_dump_bynumber (&filedata->dump, i, DEBUG_DUMP); ++ else if (do_debug_frames && streq (name, ".eh_frame")) ++ request_dump_bynumber (&filedata->dump, i, DEBUG_DUMP); ++ else if (do_gdb_index && (streq (name, ".gdb_index") ++ || streq (name, ".debug_names"))) ++ request_dump_bynumber (&filedata->dump, i, DEBUG_DUMP); ++ /* Trace sections for Itanium VMS. */ ++ else if ((do_debugging || do_trace_info || do_trace_abbrevs ++ || do_trace_aranges) ++ && const_strneq (name, ".trace_")) ++ { ++ name += sizeof (".trace_") - 1; ++ ++ if (do_debugging ++ || (do_trace_info && streq (name, "info")) ++ || (do_trace_abbrevs && streq (name, "abbrev")) ++ || (do_trace_aranges && streq (name, "aranges")) ++ ) ++ request_dump_bynumber (&filedata->dump, i, DEBUG_DUMP); ++ } ++ else if ((do_debugging || do_debug_links) ++ && (const_strneq (name, ".gnu_debuglink") ++ || const_strneq (name, ".gnu_debugaltlink"))) ++ request_dump_bynumber (&filedata->dump, i, DEBUG_DUMP); ++ } ++ ++ if (! do_sections) ++ return TRUE; ++ ++ if (filedata->file_header.e_shnum > 1) ++ printf (_("\nSection Headers:\n")); ++ else ++ printf (_("\nSection Header:\n")); ++ ++ if (is_32bit_elf) ++ { ++ if (do_section_details) ++ { ++ printf (_(" [Nr] Name\n")); ++ printf (_(" Type Addr Off Size ES Lk Inf Al\n")); ++ } ++ else ++ printf ++ (_(" [Nr] Name Type Addr Off Size ES Flg Lk Inf Al\n")); ++ } ++ else if (do_wide) ++ { ++ if (do_section_details) ++ { ++ printf (_(" [Nr] Name\n")); ++ printf (_(" Type Address Off Size ES Lk Inf Al\n")); ++ } ++ else ++ printf ++ (_(" [Nr] Name Type Address Off Size ES Flg Lk Inf Al\n")); ++ } ++ else ++ { ++ if (do_section_details) ++ { ++ printf (_(" [Nr] Name\n")); ++ printf (_(" Type Address Offset Link\n")); ++ printf (_(" Size EntSize Info Align\n")); ++ } ++ else ++ { ++ printf (_(" [Nr] Name Type Address Offset\n")); ++ printf (_(" Size EntSize Flags Link Info Align\n")); ++ } ++ } ++ ++ if (do_section_details) ++ printf (_(" Flags\n")); ++ ++ for (i = 0, section = filedata->section_headers; ++ i < filedata->file_header.e_shnum; ++ i++, section++) ++ { ++ /* Run some sanity checks on the section header. */ ++ ++ /* Check the sh_link field. */ ++ switch (section->sh_type) ++ { ++ case SHT_REL: ++ case SHT_RELA: ++ if (section->sh_link == 0 ++ && (filedata->file_header.e_type == ET_EXEC ++ || filedata->file_header.e_type == ET_DYN)) ++ /* A dynamic relocation section where all entries use a ++ zero symbol index need not specify a symtab section. */ ++ break; ++ /* Fall through. */ ++ case SHT_SYMTAB_SHNDX: ++ case SHT_GROUP: ++ case SHT_HASH: ++ case SHT_GNU_HASH: ++ case SHT_GNU_versym: ++ if (section->sh_link == 0 ++ || section->sh_link >= filedata->file_header.e_shnum ++ || (filedata->section_headers[section->sh_link].sh_type != SHT_SYMTAB ++ && filedata->section_headers[section->sh_link].sh_type != SHT_DYNSYM)) ++ warn (_("[%2u]: Link field (%u) should index a symtab section.\n"), ++ i, section->sh_link); ++ break; ++ ++ case SHT_DYNAMIC: ++ case SHT_SYMTAB: ++ case SHT_DYNSYM: ++ case SHT_GNU_verneed: ++ case SHT_GNU_verdef: ++ case SHT_GNU_LIBLIST: ++ if (section->sh_link == 0 ++ || section->sh_link >= filedata->file_header.e_shnum ++ || filedata->section_headers[section->sh_link].sh_type != SHT_STRTAB) ++ warn (_("[%2u]: Link field (%u) should index a string section.\n"), ++ i, section->sh_link); ++ break; ++ ++ case SHT_INIT_ARRAY: ++ case SHT_FINI_ARRAY: ++ case SHT_PREINIT_ARRAY: ++ if (section->sh_type < SHT_LOOS && section->sh_link != 0) ++ warn (_("[%2u]: Unexpected value (%u) in link field.\n"), ++ i, section->sh_link); ++ break; ++ ++ default: ++ /* FIXME: Add support for target specific section types. */ ++#if 0 /* Currently we do not check other section types as there are too ++ many special cases. Stab sections for example have a type ++ of SHT_PROGBITS but an sh_link field that links to the .stabstr ++ section. */ ++ if (section->sh_type < SHT_LOOS && section->sh_link != 0) ++ warn (_("[%2u]: Unexpected value (%u) in link field.\n"), ++ i, section->sh_link); ++#endif ++ break; ++ } ++ ++ /* Check the sh_info field. */ ++ switch (section->sh_type) ++ { ++ case SHT_REL: ++ case SHT_RELA: ++ if (section->sh_info == 0 ++ && (filedata->file_header.e_type == ET_EXEC ++ || filedata->file_header.e_type == ET_DYN)) ++ /* Dynamic relocations apply to segments, so they do not ++ need to specify the section they relocate. */ ++ break; ++ if (section->sh_info == 0 ++ || section->sh_info >= filedata->file_header.e_shnum ++ || (filedata->section_headers[section->sh_info].sh_type != SHT_PROGBITS ++ && filedata->section_headers[section->sh_info].sh_type != SHT_NOBITS ++ && filedata->section_headers[section->sh_info].sh_type != SHT_NOTE ++ && filedata->section_headers[section->sh_info].sh_type != SHT_INIT_ARRAY ++ && filedata->section_headers[section->sh_info].sh_type != SHT_FINI_ARRAY ++ && filedata->section_headers[section->sh_info].sh_type != SHT_PREINIT_ARRAY ++ /* FIXME: Are other section types valid ? */ ++ && filedata->section_headers[section->sh_info].sh_type < SHT_LOOS)) ++ warn (_("[%2u]: Info field (%u) should index a relocatable section.\n"), ++ i, section->sh_info); ++ break; ++ ++ case SHT_DYNAMIC: ++ case SHT_HASH: ++ case SHT_SYMTAB_SHNDX: ++ case SHT_INIT_ARRAY: ++ case SHT_FINI_ARRAY: ++ case SHT_PREINIT_ARRAY: ++ if (section->sh_info != 0) ++ warn (_("[%2u]: Unexpected value (%u) in info field.\n"), ++ i, section->sh_info); ++ break; ++ ++ case SHT_GROUP: ++ case SHT_SYMTAB: ++ case SHT_DYNSYM: ++ /* A symbol index - we assume that it is valid. */ ++ break; ++ ++ default: ++ /* FIXME: Add support for target specific section types. */ ++ if (section->sh_type == SHT_NOBITS) ++ /* NOBITS section headers with non-zero sh_info fields can be ++ created when a binary is stripped of everything but its debug ++ information. The stripped sections have their headers ++ preserved but their types set to SHT_NOBITS. So do not check ++ this type of section. */ ++ ; ++ else if (section->sh_flags & SHF_INFO_LINK) ++ { ++ if (section->sh_info < 1 || section->sh_info >= filedata->file_header.e_shnum) ++ warn (_("[%2u]: Expected link to another section in info field"), i); ++ } ++ else if (section->sh_type < SHT_LOOS ++ && (section->sh_flags & SHF_GNU_MBIND) == 0 ++ && section->sh_info != 0) ++ warn (_("[%2u]: Unexpected value (%u) in info field.\n"), ++ i, section->sh_info); ++ break; ++ } ++ ++ /* Check the sh_size field. */ ++ if (section->sh_size > filedata->file_size ++ && section->sh_type != SHT_NOBITS ++ && section->sh_type != SHT_NULL ++ && section->sh_type < SHT_LOOS) ++ warn (_("Size of section %u is larger than the entire file!\n"), i); ++ ++ printf (" [%2u] ", i); ++ if (do_section_details) ++ printf ("%s\n ", printable_section_name (filedata, section)); ++ else ++ print_symbol (-17, SECTION_NAME (section)); ++ ++ printf (do_wide ? " %-15s " : " %-15.15s ", ++ get_section_type_name (filedata, section->sh_type)); ++ ++ if (is_32bit_elf) ++ { ++ const char * link_too_big = NULL; ++ ++ print_vma (section->sh_addr, LONG_HEX); ++ ++ printf ( " %6.6lx %6.6lx %2.2lx", ++ (unsigned long) section->sh_offset, ++ (unsigned long) section->sh_size, ++ (unsigned long) section->sh_entsize); ++ ++ if (do_section_details) ++ fputs (" ", stdout); ++ else ++ printf (" %3s ", get_elf_section_flags (filedata, section->sh_flags)); ++ ++ if (section->sh_link >= filedata->file_header.e_shnum) ++ { ++ link_too_big = ""; ++ /* The sh_link value is out of range. Normally this indicates ++ an error but it can have special values in Solaris binaries. */ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_386: ++ case EM_IAMCU: ++ case EM_X86_64: ++ case EM_L1OM: ++ case EM_K1OM: ++ case EM_OLD_SPARCV9: ++ case EM_SPARC32PLUS: ++ case EM_SPARCV9: ++ case EM_SPARC: ++ if (section->sh_link == (SHN_BEFORE & 0xffff)) ++ link_too_big = "BEFORE"; ++ else if (section->sh_link == (SHN_AFTER & 0xffff)) ++ link_too_big = "AFTER"; ++ break; ++ default: ++ break; ++ } ++ } ++ ++ if (do_section_details) ++ { ++ if (link_too_big != NULL && * link_too_big) ++ printf ("<%s> ", link_too_big); ++ else ++ printf ("%2u ", section->sh_link); ++ printf ("%3u %2lu\n", section->sh_info, ++ (unsigned long) section->sh_addralign); ++ } ++ else ++ printf ("%2u %3u %2lu\n", ++ section->sh_link, ++ section->sh_info, ++ (unsigned long) section->sh_addralign); ++ ++ if (link_too_big && ! * link_too_big) ++ warn (_("section %u: sh_link value of %u is larger than the number of sections\n"), ++ i, section->sh_link); ++ } ++ else if (do_wide) ++ { ++ print_vma (section->sh_addr, LONG_HEX); ++ ++ if ((long) section->sh_offset == section->sh_offset) ++ printf (" %6.6lx", (unsigned long) section->sh_offset); ++ else ++ { ++ putchar (' '); ++ print_vma (section->sh_offset, LONG_HEX); ++ } ++ ++ if ((unsigned long) section->sh_size == section->sh_size) ++ printf (" %6.6lx", (unsigned long) section->sh_size); ++ else ++ { ++ putchar (' '); ++ print_vma (section->sh_size, LONG_HEX); ++ } ++ ++ if ((unsigned long) section->sh_entsize == section->sh_entsize) ++ printf (" %2.2lx", (unsigned long) section->sh_entsize); ++ else ++ { ++ putchar (' '); ++ print_vma (section->sh_entsize, LONG_HEX); ++ } ++ ++ if (do_section_details) ++ fputs (" ", stdout); ++ else ++ printf (" %3s ", get_elf_section_flags (filedata, section->sh_flags)); ++ ++ printf ("%2u %3u ", section->sh_link, section->sh_info); ++ ++ if ((unsigned long) section->sh_addralign == section->sh_addralign) ++ printf ("%2lu\n", (unsigned long) section->sh_addralign); ++ else ++ { ++ print_vma (section->sh_addralign, DEC); ++ putchar ('\n'); ++ } ++ } ++ else if (do_section_details) ++ { ++ putchar (' '); ++ print_vma (section->sh_addr, LONG_HEX); ++ if ((long) section->sh_offset == section->sh_offset) ++ printf (" %16.16lx", (unsigned long) section->sh_offset); ++ else ++ { ++ printf (" "); ++ print_vma (section->sh_offset, LONG_HEX); ++ } ++ printf (" %u\n ", section->sh_link); ++ print_vma (section->sh_size, LONG_HEX); ++ putchar (' '); ++ print_vma (section->sh_entsize, LONG_HEX); ++ ++ printf (" %-16u %lu\n", ++ section->sh_info, ++ (unsigned long) section->sh_addralign); ++ } ++ else ++ { ++ putchar (' '); ++ print_vma (section->sh_addr, LONG_HEX); ++ if ((long) section->sh_offset == section->sh_offset) ++ printf (" %8.8lx", (unsigned long) section->sh_offset); ++ else ++ { ++ printf (" "); ++ print_vma (section->sh_offset, LONG_HEX); ++ } ++ printf ("\n "); ++ print_vma (section->sh_size, LONG_HEX); ++ printf (" "); ++ print_vma (section->sh_entsize, LONG_HEX); ++ ++ printf (" %3s ", get_elf_section_flags (filedata, section->sh_flags)); ++ ++ printf (" %2u %3u %lu\n", ++ section->sh_link, ++ section->sh_info, ++ (unsigned long) section->sh_addralign); ++ } ++ ++ if (do_section_details) ++ { ++ printf (" %s\n", get_elf_section_flags (filedata, section->sh_flags)); ++ if ((section->sh_flags & SHF_COMPRESSED) != 0) ++ { ++ /* Minimum section size is 12 bytes for 32-bit compression ++ header + 12 bytes for compressed data header. */ ++ unsigned char buf[24]; ++ ++ assert (sizeof (buf) >= sizeof (Elf64_External_Chdr)); ++ if (get_data (&buf, filedata, section->sh_offset, 1, ++ sizeof (buf), _("compression header"))) ++ { ++ Elf_Internal_Chdr chdr; ++ ++ if (get_compression_header (&chdr, buf, sizeof (buf)) == 0) ++ printf (_(" []\n")); ++ else ++ { ++ if (chdr.ch_type == ELFCOMPRESS_ZLIB) ++ printf (" ZLIB, "); ++ else ++ printf (_(" [: 0x%x], "), ++ chdr.ch_type); ++ print_vma (chdr.ch_size, LONG_HEX); ++ printf (", %lu\n", (unsigned long) chdr.ch_addralign); ++ } ++ } ++ } ++ } ++ } ++ ++ if (!do_section_details) ++ { ++ /* The ordering of the letters shown here matches the ordering of the ++ corresponding SHF_xxx values, and hence the order in which these ++ letters will be displayed to the user. */ ++ printf (_("Key to Flags:\n\ ++ W (write), A (alloc), X (execute), M (merge), S (strings), I (info),\n\ ++ L (link order), O (extra OS processing required), G (group), T (TLS),\n\ ++ C (compressed), x (unknown), o (OS specific), E (exclude),\n ")); ++ if (filedata->file_header.e_machine == EM_X86_64 ++ || filedata->file_header.e_machine == EM_L1OM ++ || filedata->file_header.e_machine == EM_K1OM) ++ printf (_("l (large), ")); ++ else if (filedata->file_header.e_machine == EM_ARM) ++ printf (_("y (purecode), ")); ++ else if (filedata->file_header.e_machine == EM_PPC) ++ printf (_("v (VLE), ")); ++ printf ("p (processor specific)\n"); ++ } ++ ++ return TRUE; ++} ++ ++static bfd_boolean ++get_symtab (Filedata *filedata, Elf_Internal_Shdr *symsec, ++ Elf_Internal_Sym **symtab, unsigned long *nsyms, ++ char **strtab, unsigned long *strtablen) ++{ ++ *strtab = NULL; ++ *strtablen = 0; ++ *symtab = GET_ELF_SYMBOLS (filedata, symsec, nsyms); ++ ++ if (*symtab == NULL) ++ return FALSE; ++ ++ if (symsec->sh_link != 0) ++ { ++ Elf_Internal_Shdr *strsec; ++ ++ if (symsec->sh_link >= filedata->file_header.e_shnum) ++ { ++ error (_("Bad sh_link in symbol table section\n")); ++ free (*symtab); ++ *symtab = NULL; ++ *nsyms = 0; ++ return FALSE; ++ } ++ ++ strsec = filedata->section_headers + symsec->sh_link; ++ ++ *strtab = (char *) get_data (NULL, filedata, strsec->sh_offset, ++ 1, strsec->sh_size, _("string table")); ++ if (*strtab == NULL) ++ { ++ free (*symtab); ++ *symtab = NULL; ++ *nsyms = 0; ++ return FALSE; ++ } ++ *strtablen = strsec->sh_size; ++ } ++ return TRUE; ++} ++ ++static const char * ++get_group_flags (unsigned int flags) ++{ ++ static char buff[128]; ++ ++ if (flags == 0) ++ return ""; ++ else if (flags == GRP_COMDAT) ++ return "COMDAT "; ++ ++ snprintf (buff, sizeof buff, "[0x%x: %s%s%s]", ++ flags, ++ flags & GRP_MASKOS ? _("") : "", ++ flags & GRP_MASKPROC ? _("") : "", ++ (flags & ~(GRP_COMDAT | GRP_MASKOS | GRP_MASKPROC) ++ ? _("") : "")); ++ ++ return buff; ++} ++ ++static bfd_boolean ++process_section_groups (Filedata * filedata) ++{ ++ Elf_Internal_Shdr * section; ++ unsigned int i; ++ struct group * group; ++ Elf_Internal_Shdr * symtab_sec; ++ Elf_Internal_Shdr * strtab_sec; ++ Elf_Internal_Sym * symtab; ++ unsigned long num_syms; ++ char * strtab; ++ size_t strtab_size; ++ ++ /* Don't process section groups unless needed. */ ++ if (!do_unwind && !do_section_groups) ++ return TRUE; ++ ++ if (filedata->file_header.e_shnum == 0) ++ { ++ if (do_section_groups) ++ printf (_("\nThere are no sections to group in this file.\n")); ++ ++ return TRUE; ++ } ++ ++ if (filedata->section_headers == NULL) ++ { ++ error (_("Section headers are not available!\n")); ++ /* PR 13622: This can happen with a corrupt ELF header. */ ++ return FALSE; ++ } ++ ++ filedata->section_headers_groups ++ = (struct group **) calloc (filedata->file_header.e_shnum, ++ sizeof (struct group *)); ++ ++ if (filedata->section_headers_groups == NULL) ++ { ++ error (_("Out of memory reading %u section group headers\n"), ++ filedata->file_header.e_shnum); ++ return FALSE; ++ } ++ ++ /* Scan the sections for the group section. */ ++ filedata->group_count = 0; ++ for (i = 0, section = filedata->section_headers; ++ i < filedata->file_header.e_shnum; ++ i++, section++) ++ if (section->sh_type == SHT_GROUP) ++ filedata->group_count++; ++ ++ if (filedata->group_count == 0) ++ { ++ if (do_section_groups) ++ printf (_("\nThere are no section groups in this file.\n")); ++ ++ return TRUE; ++ } ++ ++ filedata->section_groups = (struct group *) calloc (filedata->group_count, ++ sizeof (struct group)); ++ ++ if (filedata->section_groups == NULL) ++ { ++ error (_("Out of memory reading %lu groups\n"), ++ (unsigned long) filedata->group_count); ++ return FALSE; ++ } ++ ++ symtab_sec = NULL; ++ strtab_sec = NULL; ++ symtab = NULL; ++ num_syms = 0; ++ strtab = NULL; ++ strtab_size = 0; ++ for (i = 0, section = filedata->section_headers, group = filedata->section_groups; ++ i < filedata->file_header.e_shnum; ++ i++, section++) ++ { ++ if (section->sh_type == SHT_GROUP) ++ { ++ const char * name = printable_section_name (filedata, section); ++ const char * group_name; ++ unsigned char * start; ++ unsigned char * indices; ++ unsigned int entry, j, size; ++ Elf_Internal_Shdr * sec; ++ Elf_Internal_Sym * sym; ++ ++ /* Get the symbol table. */ ++ if (section->sh_link >= filedata->file_header.e_shnum ++ || ((sec = filedata->section_headers + section->sh_link)->sh_type ++ != SHT_SYMTAB)) ++ { ++ error (_("Bad sh_link in group section `%s'\n"), name); ++ continue; ++ } ++ ++ if (symtab_sec != sec) ++ { ++ symtab_sec = sec; ++ free (symtab); ++ symtab = GET_ELF_SYMBOLS (filedata, symtab_sec, & num_syms); ++ } ++ ++ if (symtab == NULL) ++ { ++ error (_("Corrupt header in group section `%s'\n"), name); ++ continue; ++ } ++ ++ if (section->sh_info >= num_syms) ++ { ++ error (_("Bad sh_info in group section `%s'\n"), name); ++ continue; ++ } ++ ++ sym = symtab + section->sh_info; ++ ++ if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) ++ { ++ if (sym->st_shndx == 0 ++ || sym->st_shndx >= filedata->file_header.e_shnum) ++ { ++ error (_("Bad sh_info in group section `%s'\n"), name); ++ continue; ++ } ++ ++ group_name = SECTION_NAME (filedata->section_headers + sym->st_shndx); ++ strtab_sec = NULL; ++ free (strtab); ++ strtab = NULL; ++ strtab_size = 0; ++ } ++ else ++ { ++ /* Get the string table. */ ++ if (symtab_sec->sh_link >= filedata->file_header.e_shnum) ++ { ++ strtab_sec = NULL; ++ free (strtab); ++ strtab = NULL; ++ strtab_size = 0; ++ } ++ else if (strtab_sec ++ != (sec = filedata->section_headers + symtab_sec->sh_link)) ++ { ++ strtab_sec = sec; ++ free (strtab); ++ ++ strtab = (char *) get_data (NULL, filedata, strtab_sec->sh_offset, ++ 1, strtab_sec->sh_size, ++ _("string table")); ++ strtab_size = strtab != NULL ? strtab_sec->sh_size : 0; ++ } ++ group_name = sym->st_name < strtab_size ++ ? strtab + sym->st_name : _(""); ++ } ++ ++ /* PR 17531: file: loop. */ ++ if (section->sh_entsize > section->sh_size) ++ { ++ error (_("Section %s has sh_entsize (0x%lx) which is larger than its size (0x%lx)\n"), ++ printable_section_name (filedata, section), ++ (unsigned long) section->sh_entsize, ++ (unsigned long) section->sh_size); ++ continue; ++ } ++ ++ start = (unsigned char *) get_data (NULL, filedata, section->sh_offset, ++ 1, section->sh_size, ++ _("section data")); ++ if (start == NULL) ++ continue; ++ ++ indices = start; ++ size = (section->sh_size / section->sh_entsize) - 1; ++ entry = byte_get (indices, 4); ++ indices += 4; ++ ++ if (do_section_groups) ++ { ++ printf (_("\n%sgroup section [%5u] `%s' [%s] contains %u sections:\n"), ++ get_group_flags (entry), i, name, group_name, size); ++ ++ printf (_(" [Index] Name\n")); ++ } ++ ++ group->group_index = i; ++ ++ for (j = 0; j < size; j++) ++ { ++ struct group_list * g; ++ ++ entry = byte_get (indices, 4); ++ indices += 4; ++ ++ if (entry >= filedata->file_header.e_shnum) ++ { ++ static unsigned num_group_errors = 0; ++ ++ if (num_group_errors ++ < 10) ++ { ++ error (_("section [%5u] in group section [%5u] > maximum section [%5u]\n"), ++ entry, i, filedata->file_header.e_shnum - 1); ++ if (num_group_errors == 10) ++ warn (_("Further error messages about overlarge group section indices suppressed\n")); ++ } ++ continue; ++ } ++ ++ if (filedata->section_headers_groups [entry] != NULL) ++ { ++ if (entry) ++ { ++ static unsigned num_errs = 0; ++ ++ if (num_errs ++ < 10) ++ { ++ error (_("section [%5u] in group section [%5u] already in group section [%5u]\n"), ++ entry, i, ++ filedata->section_headers_groups [entry]->group_index); ++ if (num_errs == 10) ++ warn (_("Further error messages about already contained group sections suppressed\n")); ++ } ++ continue; ++ } ++ else ++ { ++ /* Intel C/C++ compiler may put section 0 in a ++ section group. We just warn it the first time ++ and ignore it afterwards. */ ++ static bfd_boolean warned = FALSE; ++ if (!warned) ++ { ++ error (_("section 0 in group section [%5u]\n"), ++ filedata->section_headers_groups [entry]->group_index); ++ warned = TRUE; ++ } ++ } ++ } ++ ++ filedata->section_headers_groups [entry] = group; ++ ++ if (do_section_groups) ++ { ++ sec = filedata->section_headers + entry; ++ printf (" [%5u] %s\n", entry, printable_section_name (filedata, sec)); ++ } ++ ++ g = (struct group_list *) xmalloc (sizeof (struct group_list)); ++ g->section_index = entry; ++ g->next = group->root; ++ group->root = g; ++ } ++ ++ free (start); ++ ++ group++; ++ } ++ } ++ ++ free (symtab); ++ free (strtab); ++ return TRUE; ++} ++ ++/* Data used to display dynamic fixups. */ ++ ++struct ia64_vms_dynfixup ++{ ++ bfd_vma needed_ident; /* Library ident number. */ ++ bfd_vma needed; /* Index in the dstrtab of the library name. */ ++ bfd_vma fixup_needed; /* Index of the library. */ ++ bfd_vma fixup_rela_cnt; /* Number of fixups. */ ++ bfd_vma fixup_rela_off; /* Fixups offset in the dynamic segment. */ ++}; ++ ++/* Data used to display dynamic relocations. */ ++ ++struct ia64_vms_dynimgrela ++{ ++ bfd_vma img_rela_cnt; /* Number of relocations. */ ++ bfd_vma img_rela_off; /* Reloc offset in the dynamic segment. */ ++}; ++ ++/* Display IA-64 OpenVMS dynamic fixups (used to dynamically link a shared ++ library). */ ++ ++static bfd_boolean ++dump_ia64_vms_dynamic_fixups (Filedata * filedata, ++ struct ia64_vms_dynfixup * fixup, ++ const char * strtab, ++ unsigned int strtab_sz) ++{ ++ Elf64_External_VMS_IMAGE_FIXUP * imfs; ++ long i; ++ const char * lib_name; ++ ++ imfs = get_data (NULL, filedata, ++ filedata->dynamic_addr + fixup->fixup_rela_off, ++ sizeof (*imfs), fixup->fixup_rela_cnt, ++ _("dynamic section image fixups")); ++ if (!imfs) ++ return FALSE; ++ ++ if (fixup->needed < strtab_sz) ++ lib_name = strtab + fixup->needed; ++ else ++ { ++ warn (_("corrupt library name index of 0x%lx found in dynamic entry"), ++ (unsigned long) fixup->needed); ++ lib_name = "???"; ++ } ++ ++ printf (_("\nImage fixups for needed library #%d: %s - ident: %lx\n"), ++ (int) fixup->fixup_needed, lib_name, (long) fixup->needed_ident); ++ printf ++ (_("Seg Offset Type SymVec DataType\n")); ++ ++ for (i = 0; i < (long) fixup->fixup_rela_cnt; i++) ++ { ++ unsigned int type; ++ const char *rtype; ++ ++ printf ("%3u ", (unsigned) BYTE_GET (imfs [i].fixup_seg)); ++ printf_vma ((bfd_vma) BYTE_GET (imfs [i].fixup_offset)); ++ type = BYTE_GET (imfs [i].type); ++ rtype = elf_ia64_reloc_type (type); ++ if (rtype == NULL) ++ printf (" 0x%08x ", type); ++ else ++ printf (" %-32s ", rtype); ++ printf ("%6u ", (unsigned) BYTE_GET (imfs [i].symvec_index)); ++ printf ("0x%08x\n", (unsigned) BYTE_GET (imfs [i].data_type)); ++ } ++ ++ free (imfs); ++ return TRUE; ++} ++ ++/* Display IA-64 OpenVMS dynamic relocations (used to relocate an image). */ ++ ++static bfd_boolean ++dump_ia64_vms_dynamic_relocs (Filedata * filedata, struct ia64_vms_dynimgrela *imgrela) ++{ ++ Elf64_External_VMS_IMAGE_RELA *imrs; ++ long i; ++ ++ imrs = get_data (NULL, filedata, ++ filedata->dynamic_addr + imgrela->img_rela_off, ++ sizeof (*imrs), imgrela->img_rela_cnt, ++ _("dynamic section image relocations")); ++ if (!imrs) ++ return FALSE; ++ ++ printf (_("\nImage relocs\n")); ++ printf ++ (_("Seg Offset Type Addend Seg Sym Off\n")); ++ ++ for (i = 0; i < (long) imgrela->img_rela_cnt; i++) ++ { ++ unsigned int type; ++ const char *rtype; ++ ++ printf ("%3u ", (unsigned) BYTE_GET (imrs [i].rela_seg)); ++ printf ("%08" BFD_VMA_FMT "x ", ++ (bfd_vma) BYTE_GET (imrs [i].rela_offset)); ++ type = BYTE_GET (imrs [i].type); ++ rtype = elf_ia64_reloc_type (type); ++ if (rtype == NULL) ++ printf ("0x%08x ", type); ++ else ++ printf ("%-31s ", rtype); ++ print_vma (BYTE_GET (imrs [i].addend), FULL_HEX); ++ printf ("%3u ", (unsigned) BYTE_GET (imrs [i].sym_seg)); ++ printf ("%08" BFD_VMA_FMT "x\n", ++ (bfd_vma) BYTE_GET (imrs [i].sym_offset)); ++ } ++ ++ free (imrs); ++ return TRUE; ++} ++ ++/* Display IA-64 OpenVMS dynamic relocations and fixups. */ ++ ++static bfd_boolean ++process_ia64_vms_dynamic_relocs (Filedata * filedata) ++{ ++ struct ia64_vms_dynfixup fixup; ++ struct ia64_vms_dynimgrela imgrela; ++ Elf_Internal_Dyn *entry; ++ bfd_vma strtab_off = 0; ++ bfd_vma strtab_sz = 0; ++ char *strtab = NULL; ++ bfd_boolean res = TRUE; ++ ++ memset (&fixup, 0, sizeof (fixup)); ++ memset (&imgrela, 0, sizeof (imgrela)); ++ ++ /* Note: the order of the entries is specified by the OpenVMS specs. */ ++ for (entry = filedata->dynamic_section; ++ entry < filedata->dynamic_section + filedata->dynamic_nent; ++ entry++) ++ { ++ switch (entry->d_tag) ++ { ++ case DT_IA_64_VMS_STRTAB_OFFSET: ++ strtab_off = entry->d_un.d_val; ++ break; ++ case DT_STRSZ: ++ strtab_sz = entry->d_un.d_val; ++ if (strtab == NULL) ++ strtab = get_data (NULL, filedata, ++ filedata->dynamic_addr + strtab_off, ++ 1, strtab_sz, _("dynamic string section")); ++ if (strtab == NULL) ++ strtab_sz = 0; ++ break; ++ ++ case DT_IA_64_VMS_NEEDED_IDENT: ++ fixup.needed_ident = entry->d_un.d_val; ++ break; ++ case DT_NEEDED: ++ fixup.needed = entry->d_un.d_val; ++ break; ++ case DT_IA_64_VMS_FIXUP_NEEDED: ++ fixup.fixup_needed = entry->d_un.d_val; ++ break; ++ case DT_IA_64_VMS_FIXUP_RELA_CNT: ++ fixup.fixup_rela_cnt = entry->d_un.d_val; ++ break; ++ case DT_IA_64_VMS_FIXUP_RELA_OFF: ++ fixup.fixup_rela_off = entry->d_un.d_val; ++ if (! dump_ia64_vms_dynamic_fixups (filedata, &fixup, strtab, strtab_sz)) ++ res = FALSE; ++ break; ++ case DT_IA_64_VMS_IMG_RELA_CNT: ++ imgrela.img_rela_cnt = entry->d_un.d_val; ++ break; ++ case DT_IA_64_VMS_IMG_RELA_OFF: ++ imgrela.img_rela_off = entry->d_un.d_val; ++ if (! dump_ia64_vms_dynamic_relocs (filedata, &imgrela)) ++ res = FALSE; ++ break; ++ ++ default: ++ break; ++ } ++ } ++ ++ free (strtab); ++ ++ return res; ++} ++ ++static struct ++{ ++ const char * name; ++ int reloc; ++ int size; ++ int rela; ++} ++ dynamic_relocations [] = ++{ ++ { "REL", DT_REL, DT_RELSZ, FALSE }, ++ { "RELA", DT_RELA, DT_RELASZ, TRUE }, ++ { "PLT", DT_JMPREL, DT_PLTRELSZ, UNKNOWN } ++}; ++ ++/* Process the reloc section. */ ++ ++static bfd_boolean ++process_relocs (Filedata * filedata) ++{ ++ unsigned long rel_size; ++ unsigned long rel_offset; ++ ++ if (!do_reloc) ++ return TRUE; ++ ++ if (do_using_dynamic) ++ { ++ int is_rela; ++ const char * name; ++ bfd_boolean has_dynamic_reloc; ++ unsigned int i; ++ ++ has_dynamic_reloc = FALSE; ++ ++ for (i = 0; i < ARRAY_SIZE (dynamic_relocations); i++) ++ { ++ is_rela = dynamic_relocations [i].rela; ++ name = dynamic_relocations [i].name; ++ rel_size = filedata->dynamic_info[dynamic_relocations [i].size]; ++ rel_offset = filedata->dynamic_info[dynamic_relocations [i].reloc]; ++ ++ if (rel_size) ++ has_dynamic_reloc = TRUE; ++ ++ if (is_rela == UNKNOWN) ++ { ++ if (dynamic_relocations [i].reloc == DT_JMPREL) ++ switch (filedata->dynamic_info[DT_PLTREL]) ++ { ++ case DT_REL: ++ is_rela = FALSE; ++ break; ++ case DT_RELA: ++ is_rela = TRUE; ++ break; ++ } ++ } ++ ++ if (rel_size) ++ { ++ printf ++ (_("\n'%s' relocation section at offset 0x%lx contains %ld bytes:\n"), ++ name, rel_offset, rel_size); ++ ++ dump_relocations (filedata, ++ offset_from_vma (filedata, rel_offset, rel_size), ++ rel_size, ++ filedata->dynamic_symbols, ++ filedata->num_dynamic_syms, ++ filedata->dynamic_strings, ++ filedata->dynamic_strings_length, ++ is_rela, TRUE /* is_dynamic */); ++ } ++ } ++ ++ if (is_ia64_vms (filedata)) ++ if (process_ia64_vms_dynamic_relocs (filedata)) ++ has_dynamic_reloc = TRUE; ++ ++ if (! has_dynamic_reloc) ++ printf (_("\nThere are no dynamic relocations in this file.\n")); ++ } ++ else ++ { ++ Elf_Internal_Shdr * section; ++ unsigned long i; ++ bfd_boolean found = FALSE; ++ ++ for (i = 0, section = filedata->section_headers; ++ i < filedata->file_header.e_shnum; ++ i++, section++) ++ { ++ if ( section->sh_type != SHT_RELA ++ && section->sh_type != SHT_REL) ++ continue; ++ ++ rel_offset = section->sh_offset; ++ rel_size = section->sh_size; ++ ++ if (rel_size) ++ { ++ int is_rela; ++ unsigned long num_rela; ++ ++ printf (_("\nRelocation section ")); ++ ++ if (filedata->string_table == NULL) ++ printf ("%d", section->sh_name); ++ else ++ printf ("'%s'", printable_section_name (filedata, section)); ++ ++ num_rela = rel_size / section->sh_entsize; ++ printf (ngettext (" at offset 0x%lx contains %lu entry:\n", ++ " at offset 0x%lx contains %lu entries:\n", ++ num_rela), ++ rel_offset, num_rela); ++ ++ is_rela = section->sh_type == SHT_RELA; ++ ++ if (section->sh_link != 0 ++ && section->sh_link < filedata->file_header.e_shnum) ++ { ++ Elf_Internal_Shdr * symsec; ++ Elf_Internal_Sym * symtab; ++ unsigned long nsyms; ++ unsigned long strtablen = 0; ++ char * strtab = NULL; ++ ++ symsec = filedata->section_headers + section->sh_link; ++ if (symsec->sh_type != SHT_SYMTAB ++ && symsec->sh_type != SHT_DYNSYM) ++ continue; ++ ++ if (!get_symtab (filedata, symsec, ++ &symtab, &nsyms, &strtab, &strtablen)) ++ continue; ++ ++ dump_relocations (filedata, rel_offset, rel_size, ++ symtab, nsyms, strtab, strtablen, ++ is_rela, ++ symsec->sh_type == SHT_DYNSYM); ++ free (strtab); ++ free (symtab); ++ } ++ else ++ dump_relocations (filedata, rel_offset, rel_size, ++ NULL, 0, NULL, 0, is_rela, ++ FALSE /* is_dynamic */); ++ ++ found = TRUE; ++ } ++ } ++ ++ if (! found) ++ { ++ /* Users sometimes forget the -D option, so try to be helpful. */ ++ for (i = 0; i < ARRAY_SIZE (dynamic_relocations); i++) ++ { ++ if (filedata->dynamic_info[dynamic_relocations [i].size]) ++ { ++ printf (_("\nThere are no static relocations in this file.")); ++ printf (_("\nTo see the dynamic relocations add --use-dynamic to the command line.\n")); ++ ++ break; ++ } ++ } ++ if (i == ARRAY_SIZE (dynamic_relocations)) ++ printf (_("\nThere are no relocations in this file.\n")); ++ } ++ } ++ ++ return TRUE; ++} ++ ++/* An absolute address consists of a section and an offset. If the ++ section is NULL, the offset itself is the address, otherwise, the ++ address equals to LOAD_ADDRESS(section) + offset. */ ++ ++struct absaddr ++{ ++ unsigned short section; ++ bfd_vma offset; ++}; ++ ++/* Find the nearest symbol at or below ADDR. Returns the symbol ++ name, if found, and the offset from the symbol to ADDR. */ ++ ++static void ++find_symbol_for_address (Filedata * filedata, ++ Elf_Internal_Sym * symtab, ++ unsigned long nsyms, ++ const char * strtab, ++ unsigned long strtab_size, ++ struct absaddr addr, ++ const char ** symname, ++ bfd_vma * offset) ++{ ++ bfd_vma dist = 0x100000; ++ Elf_Internal_Sym * sym; ++ Elf_Internal_Sym * beg; ++ Elf_Internal_Sym * end; ++ Elf_Internal_Sym * best = NULL; ++ ++ REMOVE_ARCH_BITS (addr.offset); ++ beg = symtab; ++ end = symtab + nsyms; ++ ++ while (beg < end) ++ { ++ bfd_vma value; ++ ++ sym = beg + (end - beg) / 2; ++ ++ value = sym->st_value; ++ REMOVE_ARCH_BITS (value); ++ ++ if (sym->st_name != 0 ++ && (addr.section == SHN_UNDEF || addr.section == sym->st_shndx) ++ && addr.offset >= value ++ && addr.offset - value < dist) ++ { ++ best = sym; ++ dist = addr.offset - value; ++ if (!dist) ++ break; ++ } ++ ++ if (addr.offset < value) ++ end = sym; ++ else ++ beg = sym + 1; ++ } ++ ++ if (best) ++ { ++ *symname = (best->st_name >= strtab_size ++ ? _("") : strtab + best->st_name); ++ *offset = dist; ++ return; ++ } ++ ++ *symname = NULL; ++ *offset = addr.offset; ++} ++ ++static /* signed */ int ++symcmp (const void *p, const void *q) ++{ ++ Elf_Internal_Sym *sp = (Elf_Internal_Sym *) p; ++ Elf_Internal_Sym *sq = (Elf_Internal_Sym *) q; ++ ++ return sp->st_value > sq->st_value ? 1 : (sp->st_value < sq->st_value ? -1 : 0); ++} ++ ++/* Process the unwind section. */ ++ ++#include "unwind-ia64.h" ++ ++struct ia64_unw_table_entry ++{ ++ struct absaddr start; ++ struct absaddr end; ++ struct absaddr info; ++}; ++ ++struct ia64_unw_aux_info ++{ ++ struct ia64_unw_table_entry * table; /* Unwind table. */ ++ unsigned long table_len; /* Length of unwind table. */ ++ unsigned char * info; /* Unwind info. */ ++ unsigned long info_size; /* Size of unwind info. */ ++ bfd_vma info_addr; /* Starting address of unwind info. */ ++ bfd_vma seg_base; /* Starting address of segment. */ ++ Elf_Internal_Sym * symtab; /* The symbol table. */ ++ unsigned long nsyms; /* Number of symbols. */ ++ Elf_Internal_Sym * funtab; /* Sorted table of STT_FUNC symbols. */ ++ unsigned long nfuns; /* Number of entries in funtab. */ ++ char * strtab; /* The string table. */ ++ unsigned long strtab_size; /* Size of string table. */ ++}; ++ ++static bfd_boolean ++dump_ia64_unwind (Filedata * filedata, struct ia64_unw_aux_info * aux) ++{ ++ struct ia64_unw_table_entry * tp; ++ unsigned long j, nfuns; ++ int in_body; ++ bfd_boolean res = TRUE; ++ ++ aux->funtab = xmalloc (aux->nsyms * sizeof (Elf_Internal_Sym)); ++ for (nfuns = 0, j = 0; j < aux->nsyms; j++) ++ if (aux->symtab[j].st_value && ELF_ST_TYPE (aux->symtab[j].st_info) == STT_FUNC) ++ aux->funtab[nfuns++] = aux->symtab[j]; ++ aux->nfuns = nfuns; ++ qsort (aux->funtab, aux->nfuns, sizeof (Elf_Internal_Sym), symcmp); ++ ++ for (tp = aux->table; tp < aux->table + aux->table_len; ++tp) ++ { ++ bfd_vma stamp; ++ bfd_vma offset; ++ const unsigned char * dp; ++ const unsigned char * head; ++ const unsigned char * end; ++ const char * procname; ++ ++ find_symbol_for_address (filedata, aux->funtab, aux->nfuns, aux->strtab, ++ aux->strtab_size, tp->start, &procname, &offset); ++ ++ fputs ("\n<", stdout); ++ ++ if (procname) ++ { ++ fputs (procname, stdout); ++ ++ if (offset) ++ printf ("+%lx", (unsigned long) offset); ++ } ++ ++ fputs (">: [", stdout); ++ print_vma (tp->start.offset, PREFIX_HEX); ++ fputc ('-', stdout); ++ print_vma (tp->end.offset, PREFIX_HEX); ++ printf ("], info at +0x%lx\n", ++ (unsigned long) (tp->info.offset - aux->seg_base)); ++ ++ /* PR 17531: file: 86232b32. */ ++ if (aux->info == NULL) ++ continue; ++ ++ offset = tp->info.offset; ++ if (tp->info.section) ++ { ++ if (tp->info.section >= filedata->file_header.e_shnum) ++ { ++ warn (_("Invalid section %u in table entry %ld\n"), ++ tp->info.section, (long) (tp - aux->table)); ++ res = FALSE; ++ continue; ++ } ++ offset += filedata->section_headers[tp->info.section].sh_addr; ++ } ++ offset -= aux->info_addr; ++ /* PR 17531: file: 0997b4d1. */ ++ if (offset >= aux->info_size ++ || aux->info_size - offset < 8) ++ { ++ warn (_("Invalid offset %lx in table entry %ld\n"), ++ (long) tp->info.offset, (long) (tp - aux->table)); ++ res = FALSE; ++ continue; ++ } ++ ++ head = aux->info + offset; ++ stamp = byte_get ((unsigned char *) head, sizeof (stamp)); ++ ++ printf (" v%u, flags=0x%lx (%s%s), len=%lu bytes\n", ++ (unsigned) UNW_VER (stamp), ++ (unsigned long) ((stamp & UNW_FLAG_MASK) >> 32), ++ UNW_FLAG_EHANDLER (stamp) ? " ehandler" : "", ++ UNW_FLAG_UHANDLER (stamp) ? " uhandler" : "", ++ (unsigned long) (eh_addr_size * UNW_LENGTH (stamp))); ++ ++ if (UNW_VER (stamp) != 1) ++ { ++ printf (_("\tUnknown version.\n")); ++ continue; ++ } ++ ++ in_body = 0; ++ end = head + 8 + eh_addr_size * UNW_LENGTH (stamp); ++ /* PR 17531: file: 16ceda89. */ ++ if (end > aux->info + aux->info_size) ++ end = aux->info + aux->info_size; ++ for (dp = head + 8; dp < end;) ++ dp = unw_decode (dp, in_body, & in_body, end); ++ } ++ ++ free (aux->funtab); ++ ++ return res; ++} ++ ++static bfd_boolean ++slurp_ia64_unwind_table (Filedata * filedata, ++ struct ia64_unw_aux_info * aux, ++ Elf_Internal_Shdr * sec) ++{ ++ unsigned long size, nrelas, i; ++ Elf_Internal_Phdr * seg; ++ struct ia64_unw_table_entry * tep; ++ Elf_Internal_Shdr * relsec; ++ Elf_Internal_Rela * rela; ++ Elf_Internal_Rela * rp; ++ unsigned char * table; ++ unsigned char * tp; ++ Elf_Internal_Sym * sym; ++ const char * relname; ++ ++ aux->table_len = 0; ++ ++ /* First, find the starting address of the segment that includes ++ this section: */ ++ ++ if (filedata->file_header.e_phnum) ++ { ++ if (! get_program_headers (filedata)) ++ return FALSE; ++ ++ for (seg = filedata->program_headers; ++ seg < filedata->program_headers + filedata->file_header.e_phnum; ++ ++seg) ++ { ++ if (seg->p_type != PT_LOAD) ++ continue; ++ ++ if (sec->sh_addr >= seg->p_vaddr ++ && (sec->sh_addr + sec->sh_size <= seg->p_vaddr + seg->p_memsz)) ++ { ++ aux->seg_base = seg->p_vaddr; ++ break; ++ } ++ } ++ } ++ ++ /* Second, build the unwind table from the contents of the unwind section: */ ++ size = sec->sh_size; ++ table = (unsigned char *) get_data (NULL, filedata, sec->sh_offset, 1, size, ++ _("unwind table")); ++ if (!table) ++ return FALSE; ++ ++ aux->table_len = size / (3 * eh_addr_size); ++ aux->table = (struct ia64_unw_table_entry *) ++ xcmalloc (aux->table_len, sizeof (aux->table[0])); ++ tep = aux->table; ++ ++ for (tp = table; tp <= table + size - (3 * eh_addr_size); ++tep) ++ { ++ tep->start.section = SHN_UNDEF; ++ tep->end.section = SHN_UNDEF; ++ tep->info.section = SHN_UNDEF; ++ tep->start.offset = byte_get (tp, eh_addr_size); tp += eh_addr_size; ++ tep->end.offset = byte_get (tp, eh_addr_size); tp += eh_addr_size; ++ tep->info.offset = byte_get (tp, eh_addr_size); tp += eh_addr_size; ++ tep->start.offset += aux->seg_base; ++ tep->end.offset += aux->seg_base; ++ tep->info.offset += aux->seg_base; ++ } ++ free (table); ++ ++ /* Third, apply any relocations to the unwind table: */ ++ for (relsec = filedata->section_headers; ++ relsec < filedata->section_headers + filedata->file_header.e_shnum; ++ ++relsec) ++ { ++ if (relsec->sh_type != SHT_RELA ++ || relsec->sh_info >= filedata->file_header.e_shnum ++ || filedata->section_headers + relsec->sh_info != sec) ++ continue; ++ ++ if (!slurp_rela_relocs (filedata, relsec->sh_offset, relsec->sh_size, ++ & rela, & nrelas)) ++ { ++ free (aux->table); ++ aux->table = NULL; ++ aux->table_len = 0; ++ return FALSE; ++ } ++ ++ for (rp = rela; rp < rela + nrelas; ++rp) ++ { ++ unsigned int sym_ndx; ++ unsigned int r_type = get_reloc_type (filedata, rp->r_info); ++ relname = elf_ia64_reloc_type (r_type); ++ ++ /* PR 17531: file: 9fa67536. */ ++ if (relname == NULL) ++ { ++ warn (_("Skipping unknown relocation type: %u\n"), r_type); ++ continue; ++ } ++ ++ if (! const_strneq (relname, "R_IA64_SEGREL")) ++ { ++ warn (_("Skipping unexpected relocation type: %s\n"), relname); ++ continue; ++ } ++ ++ i = rp->r_offset / (3 * eh_addr_size); ++ ++ /* PR 17531: file: 5bc8d9bf. */ ++ if (i >= aux->table_len) ++ { ++ warn (_("Skipping reloc with overlarge offset: %lx\n"), i); ++ continue; ++ } ++ ++ sym_ndx = get_reloc_symindex (rp->r_info); ++ if (sym_ndx >= aux->nsyms) ++ { ++ warn (_("Skipping reloc with invalid symbol index: %u\n"), ++ sym_ndx); ++ continue; ++ } ++ sym = aux->symtab + sym_ndx; ++ ++ switch (rp->r_offset / eh_addr_size % 3) ++ { ++ case 0: ++ aux->table[i].start.section = sym->st_shndx; ++ aux->table[i].start.offset = rp->r_addend + sym->st_value; ++ break; ++ case 1: ++ aux->table[i].end.section = sym->st_shndx; ++ aux->table[i].end.offset = rp->r_addend + sym->st_value; ++ break; ++ case 2: ++ aux->table[i].info.section = sym->st_shndx; ++ aux->table[i].info.offset = rp->r_addend + sym->st_value; ++ break; ++ default: ++ break; ++ } ++ } ++ ++ free (rela); ++ } ++ ++ return TRUE; ++} ++ ++static bfd_boolean ++ia64_process_unwind (Filedata * filedata) ++{ ++ Elf_Internal_Shdr * sec; ++ Elf_Internal_Shdr * unwsec = NULL; ++ unsigned long i, unwcount = 0, unwstart = 0; ++ struct ia64_unw_aux_info aux; ++ bfd_boolean res = TRUE; ++ ++ memset (& aux, 0, sizeof (aux)); ++ ++ for (i = 0, sec = filedata->section_headers; i < filedata->file_header.e_shnum; ++i, ++sec) ++ { ++ if (sec->sh_type == SHT_SYMTAB) ++ { ++ if (aux.symtab) ++ { ++ error (_("Multiple symbol tables encountered\n")); ++ free (aux.symtab); ++ aux.symtab = NULL; ++ free (aux.strtab); ++ aux.strtab = NULL; ++ } ++ if (!get_symtab (filedata, sec, &aux.symtab, &aux.nsyms, ++ &aux.strtab, &aux.strtab_size)) ++ return FALSE; ++ } ++ else if (sec->sh_type == SHT_IA_64_UNWIND) ++ unwcount++; ++ } ++ ++ if (!unwcount) ++ printf (_("\nThere are no unwind sections in this file.\n")); ++ ++ while (unwcount-- > 0) ++ { ++ char * suffix; ++ size_t len, len2; ++ ++ for (i = unwstart, sec = filedata->section_headers + unwstart, unwsec = NULL; ++ i < filedata->file_header.e_shnum; ++i, ++sec) ++ if (sec->sh_type == SHT_IA_64_UNWIND) ++ { ++ unwsec = sec; ++ break; ++ } ++ /* We have already counted the number of SHT_IA64_UNWIND ++ sections so the loop above should never fail. */ ++ assert (unwsec != NULL); ++ ++ unwstart = i + 1; ++ len = sizeof (ELF_STRING_ia64_unwind_once) - 1; ++ ++ if ((unwsec->sh_flags & SHF_GROUP) != 0) ++ { ++ /* We need to find which section group it is in. */ ++ struct group_list * g; ++ ++ if (filedata->section_headers_groups == NULL ++ || filedata->section_headers_groups[i] == NULL) ++ i = filedata->file_header.e_shnum; ++ else ++ { ++ g = filedata->section_headers_groups[i]->root; ++ ++ for (; g != NULL; g = g->next) ++ { ++ sec = filedata->section_headers + g->section_index; ++ ++ if (streq (SECTION_NAME (sec), ELF_STRING_ia64_unwind_info)) ++ break; ++ } ++ ++ if (g == NULL) ++ i = filedata->file_header.e_shnum; ++ } ++ } ++ else if (strneq (SECTION_NAME (unwsec), ELF_STRING_ia64_unwind_once, len)) ++ { ++ /* .gnu.linkonce.ia64unw.FOO -> .gnu.linkonce.ia64unwi.FOO. */ ++ len2 = sizeof (ELF_STRING_ia64_unwind_info_once) - 1; ++ suffix = SECTION_NAME (unwsec) + len; ++ for (i = 0, sec = filedata->section_headers; i < filedata->file_header.e_shnum; ++ ++i, ++sec) ++ if (strneq (SECTION_NAME (sec), ELF_STRING_ia64_unwind_info_once, len2) ++ && streq (SECTION_NAME (sec) + len2, suffix)) ++ break; ++ } ++ else ++ { ++ /* .IA_64.unwindFOO -> .IA_64.unwind_infoFOO ++ .IA_64.unwind or BAR -> .IA_64.unwind_info. */ ++ len = sizeof (ELF_STRING_ia64_unwind) - 1; ++ len2 = sizeof (ELF_STRING_ia64_unwind_info) - 1; ++ suffix = ""; ++ if (strneq (SECTION_NAME (unwsec), ELF_STRING_ia64_unwind, len)) ++ suffix = SECTION_NAME (unwsec) + len; ++ for (i = 0, sec = filedata->section_headers; i < filedata->file_header.e_shnum; ++ ++i, ++sec) ++ if (strneq (SECTION_NAME (sec), ELF_STRING_ia64_unwind_info, len2) ++ && streq (SECTION_NAME (sec) + len2, suffix)) ++ break; ++ } ++ ++ if (i == filedata->file_header.e_shnum) ++ { ++ printf (_("\nCould not find unwind info section for ")); ++ ++ if (filedata->string_table == NULL) ++ printf ("%d", unwsec->sh_name); ++ else ++ printf ("'%s'", printable_section_name (filedata, unwsec)); ++ } ++ else ++ { ++ aux.info_addr = sec->sh_addr; ++ aux.info = (unsigned char *) get_data (NULL, filedata, sec->sh_offset, 1, ++ sec->sh_size, ++ _("unwind info")); ++ aux.info_size = aux.info == NULL ? 0 : sec->sh_size; ++ ++ printf (_("\nUnwind section ")); ++ ++ if (filedata->string_table == NULL) ++ printf ("%d", unwsec->sh_name); ++ else ++ printf ("'%s'", printable_section_name (filedata, unwsec)); ++ ++ printf (_(" at offset 0x%lx contains %lu entries:\n"), ++ (unsigned long) unwsec->sh_offset, ++ (unsigned long) (unwsec->sh_size / (3 * eh_addr_size))); ++ ++ if (slurp_ia64_unwind_table (filedata, & aux, unwsec) ++ && aux.table_len > 0) ++ dump_ia64_unwind (filedata, & aux); ++ ++ free ((char *) aux.table); ++ free ((char *) aux.info); ++ aux.table = NULL; ++ aux.info = NULL; ++ } ++ } ++ ++ free (aux.symtab); ++ free ((char *) aux.strtab); ++ ++ return res; ++} ++ ++struct hppa_unw_table_entry ++{ ++ struct absaddr start; ++ struct absaddr end; ++ unsigned int Cannot_unwind:1; /* 0 */ ++ unsigned int Millicode:1; /* 1 */ ++ unsigned int Millicode_save_sr0:1; /* 2 */ ++ unsigned int Region_description:2; /* 3..4 */ ++ unsigned int reserved1:1; /* 5 */ ++ unsigned int Entry_SR:1; /* 6 */ ++ unsigned int Entry_FR:4; /* Number saved 7..10 */ ++ unsigned int Entry_GR:5; /* Number saved 11..15 */ ++ unsigned int Args_stored:1; /* 16 */ ++ unsigned int Variable_Frame:1; /* 17 */ ++ unsigned int Separate_Package_Body:1; /* 18 */ ++ unsigned int Frame_Extension_Millicode:1; /* 19 */ ++ unsigned int Stack_Overflow_Check:1; /* 20 */ ++ unsigned int Two_Instruction_SP_Increment:1; /* 21 */ ++ unsigned int Ada_Region:1; /* 22 */ ++ unsigned int cxx_info:1; /* 23 */ ++ unsigned int cxx_try_catch:1; /* 24 */ ++ unsigned int sched_entry_seq:1; /* 25 */ ++ unsigned int reserved2:1; /* 26 */ ++ unsigned int Save_SP:1; /* 27 */ ++ unsigned int Save_RP:1; /* 28 */ ++ unsigned int Save_MRP_in_frame:1; /* 29 */ ++ unsigned int extn_ptr_defined:1; /* 30 */ ++ unsigned int Cleanup_defined:1; /* 31 */ ++ ++ unsigned int MPE_XL_interrupt_marker:1; /* 0 */ ++ unsigned int HP_UX_interrupt_marker:1; /* 1 */ ++ unsigned int Large_frame:1; /* 2 */ ++ unsigned int Pseudo_SP_Set:1; /* 3 */ ++ unsigned int reserved4:1; /* 4 */ ++ unsigned int Total_frame_size:27; /* 5..31 */ ++}; ++ ++struct hppa_unw_aux_info ++{ ++ struct hppa_unw_table_entry * table; /* Unwind table. */ ++ unsigned long table_len; /* Length of unwind table. */ ++ bfd_vma seg_base; /* Starting address of segment. */ ++ Elf_Internal_Sym * symtab; /* The symbol table. */ ++ unsigned long nsyms; /* Number of symbols. */ ++ Elf_Internal_Sym * funtab; /* Sorted table of STT_FUNC symbols. */ ++ unsigned long nfuns; /* Number of entries in funtab. */ ++ char * strtab; /* The string table. */ ++ unsigned long strtab_size; /* Size of string table. */ ++}; ++ ++static bfd_boolean ++dump_hppa_unwind (Filedata * filedata, struct hppa_unw_aux_info * aux) ++{ ++ struct hppa_unw_table_entry * tp; ++ unsigned long j, nfuns; ++ bfd_boolean res = TRUE; ++ ++ aux->funtab = xmalloc (aux->nsyms * sizeof (Elf_Internal_Sym)); ++ for (nfuns = 0, j = 0; j < aux->nsyms; j++) ++ if (aux->symtab[j].st_value && ELF_ST_TYPE (aux->symtab[j].st_info) == STT_FUNC) ++ aux->funtab[nfuns++] = aux->symtab[j]; ++ aux->nfuns = nfuns; ++ qsort (aux->funtab, aux->nfuns, sizeof (Elf_Internal_Sym), symcmp); ++ ++ for (tp = aux->table; tp < aux->table + aux->table_len; ++tp) ++ { ++ bfd_vma offset; ++ const char * procname; ++ ++ find_symbol_for_address (filedata, aux->funtab, aux->nfuns, aux->strtab, ++ aux->strtab_size, tp->start, &procname, ++ &offset); ++ ++ fputs ("\n<", stdout); ++ ++ if (procname) ++ { ++ fputs (procname, stdout); ++ ++ if (offset) ++ printf ("+%lx", (unsigned long) offset); ++ } ++ ++ fputs (">: [", stdout); ++ print_vma (tp->start.offset, PREFIX_HEX); ++ fputc ('-', stdout); ++ print_vma (tp->end.offset, PREFIX_HEX); ++ printf ("]\n\t"); ++ ++#define PF(_m) if (tp->_m) printf (#_m " "); ++#define PV(_m) if (tp->_m) printf (#_m "=%d ", tp->_m); ++ PF(Cannot_unwind); ++ PF(Millicode); ++ PF(Millicode_save_sr0); ++ /* PV(Region_description); */ ++ PF(Entry_SR); ++ PV(Entry_FR); ++ PV(Entry_GR); ++ PF(Args_stored); ++ PF(Variable_Frame); ++ PF(Separate_Package_Body); ++ PF(Frame_Extension_Millicode); ++ PF(Stack_Overflow_Check); ++ PF(Two_Instruction_SP_Increment); ++ PF(Ada_Region); ++ PF(cxx_info); ++ PF(cxx_try_catch); ++ PF(sched_entry_seq); ++ PF(Save_SP); ++ PF(Save_RP); ++ PF(Save_MRP_in_frame); ++ PF(extn_ptr_defined); ++ PF(Cleanup_defined); ++ PF(MPE_XL_interrupt_marker); ++ PF(HP_UX_interrupt_marker); ++ PF(Large_frame); ++ PF(Pseudo_SP_Set); ++ PV(Total_frame_size); ++#undef PF ++#undef PV ++ } ++ ++ printf ("\n"); ++ ++ free (aux->funtab); ++ ++ return res; ++} ++ ++static bfd_boolean ++slurp_hppa_unwind_table (Filedata * filedata, ++ struct hppa_unw_aux_info * aux, ++ Elf_Internal_Shdr * sec) ++{ ++ unsigned long size, unw_ent_size, nentries, nrelas, i; ++ Elf_Internal_Phdr * seg; ++ struct hppa_unw_table_entry * tep; ++ Elf_Internal_Shdr * relsec; ++ Elf_Internal_Rela * rela; ++ Elf_Internal_Rela * rp; ++ unsigned char * table; ++ unsigned char * tp; ++ Elf_Internal_Sym * sym; ++ const char * relname; ++ ++ /* First, find the starting address of the segment that includes ++ this section. */ ++ if (filedata->file_header.e_phnum) ++ { ++ if (! get_program_headers (filedata)) ++ return FALSE; ++ ++ for (seg = filedata->program_headers; ++ seg < filedata->program_headers + filedata->file_header.e_phnum; ++ ++seg) ++ { ++ if (seg->p_type != PT_LOAD) ++ continue; ++ ++ if (sec->sh_addr >= seg->p_vaddr ++ && (sec->sh_addr + sec->sh_size <= seg->p_vaddr + seg->p_memsz)) ++ { ++ aux->seg_base = seg->p_vaddr; ++ break; ++ } ++ } ++ } ++ ++ /* Second, build the unwind table from the contents of the unwind ++ section. */ ++ size = sec->sh_size; ++ table = (unsigned char *) get_data (NULL, filedata, sec->sh_offset, 1, size, ++ _("unwind table")); ++ if (!table) ++ return FALSE; ++ ++ unw_ent_size = 16; ++ nentries = size / unw_ent_size; ++ size = unw_ent_size * nentries; ++ ++ tep = aux->table = (struct hppa_unw_table_entry *) ++ xcmalloc (nentries, sizeof (aux->table[0])); ++ ++ for (tp = table; tp < table + size; tp += unw_ent_size, ++tep) ++ { ++ unsigned int tmp1, tmp2; ++ ++ tep->start.section = SHN_UNDEF; ++ tep->end.section = SHN_UNDEF; ++ ++ tep->start.offset = byte_get ((unsigned char *) tp + 0, 4); ++ tep->end.offset = byte_get ((unsigned char *) tp + 4, 4); ++ tmp1 = byte_get ((unsigned char *) tp + 8, 4); ++ tmp2 = byte_get ((unsigned char *) tp + 12, 4); ++ ++ tep->start.offset += aux->seg_base; ++ tep->end.offset += aux->seg_base; ++ ++ tep->Cannot_unwind = (tmp1 >> 31) & 0x1; ++ tep->Millicode = (tmp1 >> 30) & 0x1; ++ tep->Millicode_save_sr0 = (tmp1 >> 29) & 0x1; ++ tep->Region_description = (tmp1 >> 27) & 0x3; ++ tep->reserved1 = (tmp1 >> 26) & 0x1; ++ tep->Entry_SR = (tmp1 >> 25) & 0x1; ++ tep->Entry_FR = (tmp1 >> 21) & 0xf; ++ tep->Entry_GR = (tmp1 >> 16) & 0x1f; ++ tep->Args_stored = (tmp1 >> 15) & 0x1; ++ tep->Variable_Frame = (tmp1 >> 14) & 0x1; ++ tep->Separate_Package_Body = (tmp1 >> 13) & 0x1; ++ tep->Frame_Extension_Millicode = (tmp1 >> 12) & 0x1; ++ tep->Stack_Overflow_Check = (tmp1 >> 11) & 0x1; ++ tep->Two_Instruction_SP_Increment = (tmp1 >> 10) & 0x1; ++ tep->Ada_Region = (tmp1 >> 9) & 0x1; ++ tep->cxx_info = (tmp1 >> 8) & 0x1; ++ tep->cxx_try_catch = (tmp1 >> 7) & 0x1; ++ tep->sched_entry_seq = (tmp1 >> 6) & 0x1; ++ tep->reserved2 = (tmp1 >> 5) & 0x1; ++ tep->Save_SP = (tmp1 >> 4) & 0x1; ++ tep->Save_RP = (tmp1 >> 3) & 0x1; ++ tep->Save_MRP_in_frame = (tmp1 >> 2) & 0x1; ++ tep->extn_ptr_defined = (tmp1 >> 1) & 0x1; ++ tep->Cleanup_defined = tmp1 & 0x1; ++ ++ tep->MPE_XL_interrupt_marker = (tmp2 >> 31) & 0x1; ++ tep->HP_UX_interrupt_marker = (tmp2 >> 30) & 0x1; ++ tep->Large_frame = (tmp2 >> 29) & 0x1; ++ tep->Pseudo_SP_Set = (tmp2 >> 28) & 0x1; ++ tep->reserved4 = (tmp2 >> 27) & 0x1; ++ tep->Total_frame_size = tmp2 & 0x7ffffff; ++ } ++ free (table); ++ ++ /* Third, apply any relocations to the unwind table. */ ++ for (relsec = filedata->section_headers; ++ relsec < filedata->section_headers + filedata->file_header.e_shnum; ++ ++relsec) ++ { ++ if (relsec->sh_type != SHT_RELA ++ || relsec->sh_info >= filedata->file_header.e_shnum ++ || filedata->section_headers + relsec->sh_info != sec) ++ continue; ++ ++ if (!slurp_rela_relocs (filedata, relsec->sh_offset, relsec->sh_size, ++ & rela, & nrelas)) ++ return FALSE; ++ ++ for (rp = rela; rp < rela + nrelas; ++rp) ++ { ++ unsigned int sym_ndx; ++ unsigned int r_type = get_reloc_type (filedata, rp->r_info); ++ relname = elf_hppa_reloc_type (r_type); ++ ++ if (relname == NULL) ++ { ++ warn (_("Skipping unknown relocation type: %u\n"), r_type); ++ continue; ++ } ++ ++ /* R_PARISC_SEGREL32 or R_PARISC_SEGREL64. */ ++ if (! const_strneq (relname, "R_PARISC_SEGREL")) ++ { ++ warn (_("Skipping unexpected relocation type: %s\n"), relname); ++ continue; ++ } ++ ++ i = rp->r_offset / unw_ent_size; ++ if (i >= aux->table_len) ++ { ++ warn (_("Skipping reloc with overlarge offset: %lx\n"), i); ++ continue; ++ } ++ ++ sym_ndx = get_reloc_symindex (rp->r_info); ++ if (sym_ndx >= aux->nsyms) ++ { ++ warn (_("Skipping reloc with invalid symbol index: %u\n"), ++ sym_ndx); ++ continue; ++ } ++ sym = aux->symtab + sym_ndx; ++ ++ switch ((rp->r_offset % unw_ent_size) / 4) ++ { ++ case 0: ++ aux->table[i].start.section = sym->st_shndx; ++ aux->table[i].start.offset = sym->st_value + rp->r_addend; ++ break; ++ case 1: ++ aux->table[i].end.section = sym->st_shndx; ++ aux->table[i].end.offset = sym->st_value + rp->r_addend; ++ break; ++ default: ++ break; ++ } ++ } ++ ++ free (rela); ++ } ++ ++ aux->table_len = nentries; ++ ++ return TRUE; ++} ++ ++static bfd_boolean ++hppa_process_unwind (Filedata * filedata) ++{ ++ struct hppa_unw_aux_info aux; ++ Elf_Internal_Shdr * unwsec = NULL; ++ Elf_Internal_Shdr * sec; ++ unsigned long i; ++ bfd_boolean res = TRUE; ++ ++ if (filedata->string_table == NULL) ++ return FALSE; ++ ++ memset (& aux, 0, sizeof (aux)); ++ ++ for (i = 0, sec = filedata->section_headers; i < filedata->file_header.e_shnum; ++i, ++sec) ++ { ++ if (sec->sh_type == SHT_SYMTAB) ++ { ++ if (aux.symtab) ++ { ++ error (_("Multiple symbol tables encountered\n")); ++ free (aux.symtab); ++ aux.symtab = NULL; ++ free (aux.strtab); ++ aux.strtab = NULL; ++ } ++ if (!get_symtab (filedata, sec, &aux.symtab, &aux.nsyms, ++ &aux.strtab, &aux.strtab_size)) ++ return FALSE; ++ } ++ else if (streq (SECTION_NAME (sec), ".PARISC.unwind")) ++ unwsec = sec; ++ } ++ ++ if (!unwsec) ++ printf (_("\nThere are no unwind sections in this file.\n")); ++ ++ for (i = 0, sec = filedata->section_headers; i < filedata->file_header.e_shnum; ++i, ++sec) ++ { ++ if (streq (SECTION_NAME (sec), ".PARISC.unwind")) ++ { ++ unsigned long num_unwind = sec->sh_size / 16; ++ ++ printf (ngettext ("\nUnwind section '%s' at offset 0x%lx " ++ "contains %lu entry:\n", ++ "\nUnwind section '%s' at offset 0x%lx " ++ "contains %lu entries:\n", ++ num_unwind), ++ printable_section_name (filedata, sec), ++ (unsigned long) sec->sh_offset, ++ num_unwind); ++ ++ if (! slurp_hppa_unwind_table (filedata, &aux, sec)) ++ res = FALSE; ++ ++ if (res && aux.table_len > 0) ++ { ++ if (! dump_hppa_unwind (filedata, &aux)) ++ res = FALSE; ++ } ++ ++ free ((char *) aux.table); ++ aux.table = NULL; ++ } ++ } ++ ++ free (aux.symtab); ++ free ((char *) aux.strtab); ++ ++ return res; ++} ++ ++struct arm_section ++{ ++ unsigned char * data; /* The unwind data. */ ++ Elf_Internal_Shdr * sec; /* The cached unwind section header. */ ++ Elf_Internal_Rela * rela; /* The cached relocations for this section. */ ++ unsigned long nrelas; /* The number of relocations. */ ++ unsigned int rel_type; /* REL or RELA ? */ ++ Elf_Internal_Rela * next_rela; /* Cyclic pointer to the next reloc to process. */ ++}; ++ ++struct arm_unw_aux_info ++{ ++ Filedata * filedata; /* The file containing the unwind sections. */ ++ Elf_Internal_Sym * symtab; /* The file's symbol table. */ ++ unsigned long nsyms; /* Number of symbols. */ ++ Elf_Internal_Sym * funtab; /* Sorted table of STT_FUNC symbols. */ ++ unsigned long nfuns; /* Number of these symbols. */ ++ char * strtab; /* The file's string table. */ ++ unsigned long strtab_size; /* Size of string table. */ ++}; ++ ++static const char * ++arm_print_vma_and_name (Filedata * filedata, ++ struct arm_unw_aux_info * aux, ++ bfd_vma fn, ++ struct absaddr addr) ++{ ++ const char *procname; ++ bfd_vma sym_offset; ++ ++ if (addr.section == SHN_UNDEF) ++ addr.offset = fn; ++ ++ find_symbol_for_address (filedata, aux->funtab, aux->nfuns, aux->strtab, ++ aux->strtab_size, addr, &procname, ++ &sym_offset); ++ ++ print_vma (fn, PREFIX_HEX); ++ ++ if (procname) ++ { ++ fputs (" <", stdout); ++ fputs (procname, stdout); ++ ++ if (sym_offset) ++ printf ("+0x%lx", (unsigned long) sym_offset); ++ fputc ('>', stdout); ++ } ++ ++ return procname; ++} ++ ++static void ++arm_free_section (struct arm_section *arm_sec) ++{ ++ free (arm_sec->data); ++ free (arm_sec->rela); ++} ++ ++/* 1) If SEC does not match the one cached in ARM_SEC, then free the current ++ cached section and install SEC instead. ++ 2) Locate the 32-bit word at WORD_OFFSET in unwind section SEC ++ and return its valued in * WORDP, relocating if necessary. ++ 3) Update the NEXT_RELA field in ARM_SEC and store the section index and ++ relocation's offset in ADDR. ++ 4) If SYM_NAME is non-NULL and a relocation was applied, record the offset ++ into the string table of the symbol associated with the reloc. If no ++ reloc was applied store -1 there. ++ 5) Return TRUE upon success, FALSE otherwise. */ ++ ++static bfd_boolean ++get_unwind_section_word (Filedata * filedata, ++ struct arm_unw_aux_info * aux, ++ struct arm_section * arm_sec, ++ Elf_Internal_Shdr * sec, ++ bfd_vma word_offset, ++ unsigned int * wordp, ++ struct absaddr * addr, ++ bfd_vma * sym_name) ++{ ++ Elf_Internal_Rela *rp; ++ Elf_Internal_Sym *sym; ++ const char * relname; ++ unsigned int word; ++ bfd_boolean wrapped; ++ ++ if (sec == NULL || arm_sec == NULL) ++ return FALSE; ++ ++ addr->section = SHN_UNDEF; ++ addr->offset = 0; ++ ++ if (sym_name != NULL) ++ *sym_name = (bfd_vma) -1; ++ ++ /* If necessary, update the section cache. */ ++ if (sec != arm_sec->sec) ++ { ++ Elf_Internal_Shdr *relsec; ++ ++ arm_free_section (arm_sec); ++ ++ arm_sec->sec = sec; ++ arm_sec->data = get_data (NULL, aux->filedata, sec->sh_offset, 1, ++ sec->sh_size, _("unwind data")); ++ arm_sec->rela = NULL; ++ arm_sec->nrelas = 0; ++ ++ for (relsec = filedata->section_headers; ++ relsec < filedata->section_headers + filedata->file_header.e_shnum; ++ ++relsec) ++ { ++ if (relsec->sh_info >= filedata->file_header.e_shnum ++ || filedata->section_headers + relsec->sh_info != sec ++ /* PR 15745: Check the section type as well. */ ++ || (relsec->sh_type != SHT_REL ++ && relsec->sh_type != SHT_RELA)) ++ continue; ++ ++ arm_sec->rel_type = relsec->sh_type; ++ if (relsec->sh_type == SHT_REL) ++ { ++ if (!slurp_rel_relocs (aux->filedata, relsec->sh_offset, ++ relsec->sh_size, ++ & arm_sec->rela, & arm_sec->nrelas)) ++ return FALSE; ++ } ++ else /* relsec->sh_type == SHT_RELA */ ++ { ++ if (!slurp_rela_relocs (aux->filedata, relsec->sh_offset, ++ relsec->sh_size, ++ & arm_sec->rela, & arm_sec->nrelas)) ++ return FALSE; ++ } ++ break; ++ } ++ ++ arm_sec->next_rela = arm_sec->rela; ++ } ++ ++ /* If there is no unwind data we can do nothing. */ ++ if (arm_sec->data == NULL) ++ return FALSE; ++ ++ /* If the offset is invalid then fail. */ ++ if (/* PR 21343 *//* PR 18879 */ ++ sec->sh_size < 4 ++ || word_offset > (sec->sh_size - 4) ++ || ((bfd_signed_vma) word_offset) < 0) ++ return FALSE; ++ ++ /* Get the word at the required offset. */ ++ word = byte_get (arm_sec->data + word_offset, 4); ++ ++ /* PR 17531: file: id:000001,src:001266+003044,op:splice,rep:128. */ ++ if (arm_sec->rela == NULL) ++ { ++ * wordp = word; ++ return TRUE; ++ } ++ ++ /* Look through the relocs to find the one that applies to the provided offset. */ ++ wrapped = FALSE; ++ for (rp = arm_sec->next_rela; rp != arm_sec->rela + arm_sec->nrelas; rp++) ++ { ++ bfd_vma prelval, offset; ++ ++ if (rp->r_offset > word_offset && !wrapped) ++ { ++ rp = arm_sec->rela; ++ wrapped = TRUE; ++ } ++ if (rp->r_offset > word_offset) ++ break; ++ ++ if (rp->r_offset & 3) ++ { ++ warn (_("Skipping unexpected relocation at offset 0x%lx\n"), ++ (unsigned long) rp->r_offset); ++ continue; ++ } ++ ++ if (rp->r_offset < word_offset) ++ continue; ++ ++ /* PR 17531: file: 027-161405-0.004 */ ++ if (aux->symtab == NULL) ++ continue; ++ ++ if (arm_sec->rel_type == SHT_REL) ++ { ++ offset = word & 0x7fffffff; ++ if (offset & 0x40000000) ++ offset |= ~ (bfd_vma) 0x7fffffff; ++ } ++ else if (arm_sec->rel_type == SHT_RELA) ++ offset = rp->r_addend; ++ else ++ { ++ error (_("Unknown section relocation type %d encountered\n"), ++ arm_sec->rel_type); ++ break; ++ } ++ ++ /* PR 17531 file: 027-1241568-0.004. */ ++ if (ELF32_R_SYM (rp->r_info) >= aux->nsyms) ++ { ++ error (_("Bad symbol index in unwind relocation (%lu > %lu)\n"), ++ (unsigned long) ELF32_R_SYM (rp->r_info), aux->nsyms); ++ break; ++ } ++ ++ sym = aux->symtab + ELF32_R_SYM (rp->r_info); ++ offset += sym->st_value; ++ prelval = offset - (arm_sec->sec->sh_addr + rp->r_offset); ++ ++ /* Check that we are processing the expected reloc type. */ ++ if (filedata->file_header.e_machine == EM_ARM) ++ { ++ relname = elf_arm_reloc_type (ELF32_R_TYPE (rp->r_info)); ++ if (relname == NULL) ++ { ++ warn (_("Skipping unknown ARM relocation type: %d\n"), ++ (int) ELF32_R_TYPE (rp->r_info)); ++ continue; ++ } ++ ++ if (streq (relname, "R_ARM_NONE")) ++ continue; ++ ++ if (! streq (relname, "R_ARM_PREL31")) ++ { ++ warn (_("Skipping unexpected ARM relocation type %s\n"), relname); ++ continue; ++ } ++ } ++ else if (filedata->file_header.e_machine == EM_TI_C6000) ++ { ++ relname = elf_tic6x_reloc_type (ELF32_R_TYPE (rp->r_info)); ++ if (relname == NULL) ++ { ++ warn (_("Skipping unknown C6000 relocation type: %d\n"), ++ (int) ELF32_R_TYPE (rp->r_info)); ++ continue; ++ } ++ ++ if (streq (relname, "R_C6000_NONE")) ++ continue; ++ ++ if (! streq (relname, "R_C6000_PREL31")) ++ { ++ warn (_("Skipping unexpected C6000 relocation type %s\n"), relname); ++ continue; ++ } ++ ++ prelval >>= 1; ++ } ++ else ++ { ++ /* This function currently only supports ARM and TI unwinders. */ ++ warn (_("Only TI and ARM unwinders are currently supported\n")); ++ break; ++ } ++ ++ word = (word & ~ (bfd_vma) 0x7fffffff) | (prelval & 0x7fffffff); ++ addr->section = sym->st_shndx; ++ addr->offset = offset; ++ ++ if (sym_name) ++ * sym_name = sym->st_name; ++ break; ++ } ++ ++ *wordp = word; ++ arm_sec->next_rela = rp; ++ ++ return TRUE; ++} ++ ++static const char *tic6x_unwind_regnames[16] = ++{ ++ "A15", "B15", "B14", "B13", "B12", "B11", "B10", "B3", ++ "A14", "A13", "A12", "A11", "A10", ++ "[invalid reg 13]", "[invalid reg 14]", "[invalid reg 15]" ++}; ++ ++static void ++decode_tic6x_unwind_regmask (unsigned int mask) ++{ ++ int i; ++ ++ for (i = 12; mask; mask >>= 1, i--) ++ { ++ if (mask & 1) ++ { ++ fputs (tic6x_unwind_regnames[i], stdout); ++ if (mask > 1) ++ fputs (", ", stdout); ++ } ++ } ++} ++ ++#define ADVANCE \ ++ if (remaining == 0 && more_words) \ ++ { \ ++ data_offset += 4; \ ++ if (! get_unwind_section_word (filedata, aux, data_arm_sec, data_sec, \ ++ data_offset, & word, & addr, NULL)) \ ++ return FALSE; \ ++ remaining = 4; \ ++ more_words--; \ ++ } \ ++ ++#define GET_OP(OP) \ ++ ADVANCE; \ ++ if (remaining) \ ++ { \ ++ remaining--; \ ++ (OP) = word >> 24; \ ++ word <<= 8; \ ++ } \ ++ else \ ++ { \ ++ printf (_("[Truncated opcode]\n")); \ ++ return FALSE; \ ++ } \ ++ printf ("0x%02x ", OP) ++ ++static bfd_boolean ++decode_arm_unwind_bytecode (Filedata * filedata, ++ struct arm_unw_aux_info * aux, ++ unsigned int word, ++ unsigned int remaining, ++ unsigned int more_words, ++ bfd_vma data_offset, ++ Elf_Internal_Shdr * data_sec, ++ struct arm_section * data_arm_sec) ++{ ++ struct absaddr addr; ++ bfd_boolean res = TRUE; ++ ++ /* Decode the unwinding instructions. */ ++ while (1) ++ { ++ unsigned int op, op2; ++ ++ ADVANCE; ++ if (remaining == 0) ++ break; ++ remaining--; ++ op = word >> 24; ++ word <<= 8; ++ ++ printf (" 0x%02x ", op); ++ ++ if ((op & 0xc0) == 0x00) ++ { ++ int offset = ((op & 0x3f) << 2) + 4; ++ ++ printf (" vsp = vsp + %d", offset); ++ } ++ else if ((op & 0xc0) == 0x40) ++ { ++ int offset = ((op & 0x3f) << 2) + 4; ++ ++ printf (" vsp = vsp - %d", offset); ++ } ++ else if ((op & 0xf0) == 0x80) ++ { ++ GET_OP (op2); ++ if (op == 0x80 && op2 == 0) ++ printf (_("Refuse to unwind")); ++ else ++ { ++ unsigned int mask = ((op & 0x0f) << 8) | op2; ++ bfd_boolean first = TRUE; ++ int i; ++ ++ printf ("pop {"); ++ for (i = 0; i < 12; i++) ++ if (mask & (1 << i)) ++ { ++ if (first) ++ first = FALSE; ++ else ++ printf (", "); ++ printf ("r%d", 4 + i); ++ } ++ printf ("}"); ++ } ++ } ++ else if ((op & 0xf0) == 0x90) ++ { ++ if (op == 0x9d || op == 0x9f) ++ printf (_(" [Reserved]")); ++ else ++ printf (" vsp = r%d", op & 0x0f); ++ } ++ else if ((op & 0xf0) == 0xa0) ++ { ++ int end = 4 + (op & 0x07); ++ bfd_boolean first = TRUE; ++ int i; ++ ++ printf (" pop {"); ++ for (i = 4; i <= end; i++) ++ { ++ if (first) ++ first = FALSE; ++ else ++ printf (", "); ++ printf ("r%d", i); ++ } ++ if (op & 0x08) ++ { ++ if (!first) ++ printf (", "); ++ printf ("r14"); ++ } ++ printf ("}"); ++ } ++ else if (op == 0xb0) ++ printf (_(" finish")); ++ else if (op == 0xb1) ++ { ++ GET_OP (op2); ++ if (op2 == 0 || (op2 & 0xf0) != 0) ++ printf (_("[Spare]")); ++ else ++ { ++ unsigned int mask = op2 & 0x0f; ++ bfd_boolean first = TRUE; ++ int i; ++ ++ printf ("pop {"); ++ for (i = 0; i < 12; i++) ++ if (mask & (1 << i)) ++ { ++ if (first) ++ first = FALSE; ++ else ++ printf (", "); ++ printf ("r%d", i); ++ } ++ printf ("}"); ++ } ++ } ++ else if (op == 0xb2) ++ { ++ unsigned char buf[9]; ++ unsigned int i, len; ++ unsigned long offset; ++ ++ for (i = 0; i < sizeof (buf); i++) ++ { ++ GET_OP (buf[i]); ++ if ((buf[i] & 0x80) == 0) ++ break; ++ } ++ if (i == sizeof (buf)) ++ { ++ error (_("corrupt change to vsp\n")); ++ res = FALSE; ++ } ++ else ++ { ++ offset = read_leb128 (buf, buf + i + 1, FALSE, &len, NULL); ++ assert (len == i + 1); ++ offset = offset * 4 + 0x204; ++ printf ("vsp = vsp + %ld", offset); ++ } ++ } ++ else if (op == 0xb3 || op == 0xc8 || op == 0xc9) ++ { ++ unsigned int first, last; ++ ++ GET_OP (op2); ++ first = op2 >> 4; ++ last = op2 & 0x0f; ++ if (op == 0xc8) ++ first = first + 16; ++ printf ("pop {D%d", first); ++ if (last) ++ printf ("-D%d", first + last); ++ printf ("}"); ++ } ++ else if ((op & 0xf8) == 0xb8 || (op & 0xf8) == 0xd0) ++ { ++ unsigned int count = op & 0x07; ++ ++ printf ("pop {D8"); ++ if (count) ++ printf ("-D%d", 8 + count); ++ printf ("}"); ++ } ++ else if (op >= 0xc0 && op <= 0xc5) ++ { ++ unsigned int count = op & 0x07; ++ ++ printf (" pop {wR10"); ++ if (count) ++ printf ("-wR%d", 10 + count); ++ printf ("}"); ++ } ++ else if (op == 0xc6) ++ { ++ unsigned int first, last; ++ ++ GET_OP (op2); ++ first = op2 >> 4; ++ last = op2 & 0x0f; ++ printf ("pop {wR%d", first); ++ if (last) ++ printf ("-wR%d", first + last); ++ printf ("}"); ++ } ++ else if (op == 0xc7) ++ { ++ GET_OP (op2); ++ if (op2 == 0 || (op2 & 0xf0) != 0) ++ printf (_("[Spare]")); ++ else ++ { ++ unsigned int mask = op2 & 0x0f; ++ bfd_boolean first = TRUE; ++ int i; ++ ++ printf ("pop {"); ++ for (i = 0; i < 4; i++) ++ if (mask & (1 << i)) ++ { ++ if (first) ++ first = FALSE; ++ else ++ printf (", "); ++ printf ("wCGR%d", i); ++ } ++ printf ("}"); ++ } ++ } ++ else ++ { ++ printf (_(" [unsupported opcode]")); ++ res = FALSE; ++ } ++ ++ printf ("\n"); ++ } ++ ++ return res; ++} ++ ++static bfd_boolean ++decode_tic6x_unwind_bytecode (Filedata * filedata, ++ struct arm_unw_aux_info * aux, ++ unsigned int word, ++ unsigned int remaining, ++ unsigned int more_words, ++ bfd_vma data_offset, ++ Elf_Internal_Shdr * data_sec, ++ struct arm_section * data_arm_sec) ++{ ++ struct absaddr addr; ++ ++ /* Decode the unwinding instructions. */ ++ while (1) ++ { ++ unsigned int op, op2; ++ ++ ADVANCE; ++ if (remaining == 0) ++ break; ++ remaining--; ++ op = word >> 24; ++ word <<= 8; ++ ++ printf (" 0x%02x ", op); ++ ++ if ((op & 0xc0) == 0x00) ++ { ++ int offset = ((op & 0x3f) << 3) + 8; ++ printf (" sp = sp + %d", offset); ++ } ++ else if ((op & 0xc0) == 0x80) ++ { ++ GET_OP (op2); ++ if (op == 0x80 && op2 == 0) ++ printf (_("Refuse to unwind")); ++ else ++ { ++ unsigned int mask = ((op & 0x1f) << 8) | op2; ++ if (op & 0x20) ++ printf ("pop compact {"); ++ else ++ printf ("pop {"); ++ ++ decode_tic6x_unwind_regmask (mask); ++ printf("}"); ++ } ++ } ++ else if ((op & 0xf0) == 0xc0) ++ { ++ unsigned int reg; ++ unsigned int nregs; ++ unsigned int i; ++ const char *name; ++ struct ++ { ++ unsigned int offset; ++ unsigned int reg; ++ } regpos[16]; ++ ++ /* Scan entire instruction first so that GET_OP output is not ++ interleaved with disassembly. */ ++ nregs = 0; ++ for (i = 0; nregs < (op & 0xf); i++) ++ { ++ GET_OP (op2); ++ reg = op2 >> 4; ++ if (reg != 0xf) ++ { ++ regpos[nregs].offset = i * 2; ++ regpos[nregs].reg = reg; ++ nregs++; ++ } ++ ++ reg = op2 & 0xf; ++ if (reg != 0xf) ++ { ++ regpos[nregs].offset = i * 2 + 1; ++ regpos[nregs].reg = reg; ++ nregs++; ++ } ++ } ++ ++ printf (_("pop frame {")); ++ if (nregs == 0) ++ { ++ printf (_("*corrupt* - no registers specified")); ++ } ++ else ++ { ++ reg = nregs - 1; ++ for (i = i * 2; i > 0; i--) ++ { ++ if (regpos[reg].offset == i - 1) ++ { ++ name = tic6x_unwind_regnames[regpos[reg].reg]; ++ if (reg > 0) ++ reg--; ++ } ++ else ++ name = _("[pad]"); ++ ++ fputs (name, stdout); ++ if (i > 1) ++ printf (", "); ++ } ++ } ++ ++ printf ("}"); ++ } ++ else if (op == 0xd0) ++ printf (" MOV FP, SP"); ++ else if (op == 0xd1) ++ printf (" __c6xabi_pop_rts"); ++ else if (op == 0xd2) ++ { ++ unsigned char buf[9]; ++ unsigned int i, len; ++ unsigned long offset; ++ ++ for (i = 0; i < sizeof (buf); i++) ++ { ++ GET_OP (buf[i]); ++ if ((buf[i] & 0x80) == 0) ++ break; ++ } ++ /* PR 17531: file: id:000001,src:001906+004739,op:splice,rep:2. */ ++ if (i == sizeof (buf)) ++ { ++ warn (_("Corrupt stack pointer adjustment detected\n")); ++ return FALSE; ++ } ++ ++ offset = read_leb128 (buf, buf + i + 1, FALSE, &len, NULL); ++ assert (len == i + 1); ++ offset = offset * 8 + 0x408; ++ printf (_("sp = sp + %ld"), offset); ++ } ++ else if ((op & 0xf0) == 0xe0) ++ { ++ if ((op & 0x0f) == 7) ++ printf (" RETURN"); ++ else ++ printf (" MV %s, B3", tic6x_unwind_regnames[op & 0x0f]); ++ } ++ else ++ { ++ printf (_(" [unsupported opcode]")); ++ } ++ putchar ('\n'); ++ } ++ ++ return TRUE; ++} ++ ++static bfd_vma ++arm_expand_prel31 (Filedata * filedata, bfd_vma word, bfd_vma where) ++{ ++ bfd_vma offset; ++ ++ offset = word & 0x7fffffff; ++ if (offset & 0x40000000) ++ offset |= ~ (bfd_vma) 0x7fffffff; ++ ++ if (filedata->file_header.e_machine == EM_TI_C6000) ++ offset <<= 1; ++ ++ return offset + where; ++} ++ ++static bfd_boolean ++decode_arm_unwind (Filedata * filedata, ++ struct arm_unw_aux_info * aux, ++ unsigned int word, ++ unsigned int remaining, ++ bfd_vma data_offset, ++ Elf_Internal_Shdr * data_sec, ++ struct arm_section * data_arm_sec) ++{ ++ int per_index; ++ unsigned int more_words = 0; ++ struct absaddr addr; ++ bfd_vma sym_name = (bfd_vma) -1; ++ bfd_boolean res = TRUE; ++ ++ if (remaining == 0) ++ { ++ /* Fetch the first word. ++ Note - when decoding an object file the address extracted ++ here will always be 0. So we also pass in the sym_name ++ parameter so that we can find the symbol associated with ++ the personality routine. */ ++ if (! get_unwind_section_word (filedata, aux, data_arm_sec, data_sec, data_offset, ++ & word, & addr, & sym_name)) ++ return FALSE; ++ ++ remaining = 4; ++ } ++ else ++ { ++ addr.section = SHN_UNDEF; ++ addr.offset = 0; ++ } ++ ++ if ((word & 0x80000000) == 0) ++ { ++ /* Expand prel31 for personality routine. */ ++ bfd_vma fn; ++ const char *procname; ++ ++ fn = arm_expand_prel31 (filedata, word, data_sec->sh_addr + data_offset); ++ printf (_(" Personality routine: ")); ++ if (fn == 0 ++ && addr.section == SHN_UNDEF && addr.offset == 0 ++ && sym_name != (bfd_vma) -1 && sym_name < aux->strtab_size) ++ { ++ procname = aux->strtab + sym_name; ++ print_vma (fn, PREFIX_HEX); ++ if (procname) ++ { ++ fputs (" <", stdout); ++ fputs (procname, stdout); ++ fputc ('>', stdout); ++ } ++ } ++ else ++ procname = arm_print_vma_and_name (filedata, aux, fn, addr); ++ fputc ('\n', stdout); ++ ++ /* The GCC personality routines use the standard compact ++ encoding, starting with one byte giving the number of ++ words. */ ++ if (procname != NULL ++ && (const_strneq (procname, "__gcc_personality_v0") ++ || const_strneq (procname, "__gxx_personality_v0") ++ || const_strneq (procname, "__gcj_personality_v0") ++ || const_strneq (procname, "__gnu_objc_personality_v0"))) ++ { ++ remaining = 0; ++ more_words = 1; ++ ADVANCE; ++ if (!remaining) ++ { ++ printf (_(" [Truncated data]\n")); ++ return FALSE; ++ } ++ more_words = word >> 24; ++ word <<= 8; ++ remaining--; ++ per_index = -1; ++ } ++ else ++ return TRUE; ++ } ++ else ++ { ++ /* ARM EHABI Section 6.3: ++ ++ An exception-handling table entry for the compact model looks like: ++ ++ 31 30-28 27-24 23-0 ++ -- ----- ----- ---- ++ 1 0 index Data for personalityRoutine[index] */ ++ ++ if (filedata->file_header.e_machine == EM_ARM ++ && (word & 0x70000000)) ++ { ++ warn (_("Corrupt ARM compact model table entry: %x \n"), word); ++ res = FALSE; ++ } ++ ++ per_index = (word >> 24) & 0x7f; ++ printf (_(" Compact model index: %d\n"), per_index); ++ if (per_index == 0) ++ { ++ more_words = 0; ++ word <<= 8; ++ remaining--; ++ } ++ else if (per_index < 3) ++ { ++ more_words = (word >> 16) & 0xff; ++ word <<= 16; ++ remaining -= 2; ++ } ++ } ++ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_ARM: ++ if (per_index < 3) ++ { ++ if (! decode_arm_unwind_bytecode (filedata, aux, word, remaining, more_words, ++ data_offset, data_sec, data_arm_sec)) ++ res = FALSE; ++ } ++ else ++ { ++ warn (_("Unknown ARM compact model index encountered\n")); ++ printf (_(" [reserved]\n")); ++ res = FALSE; ++ } ++ break; ++ ++ case EM_TI_C6000: ++ if (per_index < 3) ++ { ++ if (! decode_tic6x_unwind_bytecode (filedata, aux, word, remaining, more_words, ++ data_offset, data_sec, data_arm_sec)) ++ res = FALSE; ++ } ++ else if (per_index < 5) ++ { ++ if (((word >> 17) & 0x7f) == 0x7f) ++ printf (_(" Restore stack from frame pointer\n")); ++ else ++ printf (_(" Stack increment %d\n"), (word >> 14) & 0x1fc); ++ printf (_(" Registers restored: ")); ++ if (per_index == 4) ++ printf (" (compact) "); ++ decode_tic6x_unwind_regmask ((word >> 4) & 0x1fff); ++ putchar ('\n'); ++ printf (_(" Return register: %s\n"), ++ tic6x_unwind_regnames[word & 0xf]); ++ } ++ else ++ printf (_(" [reserved (%d)]\n"), per_index); ++ break; ++ ++ default: ++ error (_("Unsupported architecture type %d encountered when decoding unwind table\n"), ++ filedata->file_header.e_machine); ++ res = FALSE; ++ } ++ ++ /* Decode the descriptors. Not implemented. */ ++ ++ return res; ++} ++ ++static bfd_boolean ++dump_arm_unwind (Filedata * filedata, ++ struct arm_unw_aux_info * aux, ++ Elf_Internal_Shdr * exidx_sec) ++{ ++ struct arm_section exidx_arm_sec, extab_arm_sec; ++ unsigned int i, exidx_len; ++ unsigned long j, nfuns; ++ bfd_boolean res = TRUE; ++ ++ memset (&exidx_arm_sec, 0, sizeof (exidx_arm_sec)); ++ memset (&extab_arm_sec, 0, sizeof (extab_arm_sec)); ++ exidx_len = exidx_sec->sh_size / 8; ++ ++ aux->funtab = xmalloc (aux->nsyms * sizeof (Elf_Internal_Sym)); ++ for (nfuns = 0, j = 0; j < aux->nsyms; j++) ++ if (aux->symtab[j].st_value && ELF_ST_TYPE (aux->symtab[j].st_info) == STT_FUNC) ++ aux->funtab[nfuns++] = aux->symtab[j]; ++ aux->nfuns = nfuns; ++ qsort (aux->funtab, aux->nfuns, sizeof (Elf_Internal_Sym), symcmp); ++ ++ for (i = 0; i < exidx_len; i++) ++ { ++ unsigned int exidx_fn, exidx_entry; ++ struct absaddr fn_addr, entry_addr; ++ bfd_vma fn; ++ ++ fputc ('\n', stdout); ++ ++ if (! get_unwind_section_word (filedata, aux, & exidx_arm_sec, exidx_sec, ++ 8 * i, & exidx_fn, & fn_addr, NULL) ++ || ! get_unwind_section_word (filedata, aux, & exidx_arm_sec, exidx_sec, ++ 8 * i + 4, & exidx_entry, & entry_addr, NULL)) ++ { ++ free (aux->funtab); ++ arm_free_section (& exidx_arm_sec); ++ arm_free_section (& extab_arm_sec); ++ return FALSE; ++ } ++ ++ /* ARM EHABI, Section 5: ++ An index table entry consists of 2 words. ++ The first word contains a prel31 offset to the start of a function, with bit 31 clear. */ ++ if (exidx_fn & 0x80000000) ++ { ++ warn (_("corrupt index table entry: %x\n"), exidx_fn); ++ res = FALSE; ++ } ++ ++ fn = arm_expand_prel31 (filedata, exidx_fn, exidx_sec->sh_addr + 8 * i); ++ ++ arm_print_vma_and_name (filedata, aux, fn, fn_addr); ++ fputs (": ", stdout); ++ ++ if (exidx_entry == 1) ++ { ++ print_vma (exidx_entry, PREFIX_HEX); ++ fputs (" [cantunwind]\n", stdout); ++ } ++ else if (exidx_entry & 0x80000000) ++ { ++ print_vma (exidx_entry, PREFIX_HEX); ++ fputc ('\n', stdout); ++ decode_arm_unwind (filedata, aux, exidx_entry, 4, 0, NULL, NULL); ++ } ++ else ++ { ++ bfd_vma table, table_offset = 0; ++ Elf_Internal_Shdr *table_sec; ++ ++ fputs ("@", stdout); ++ table = arm_expand_prel31 (filedata, exidx_entry, exidx_sec->sh_addr + 8 * i + 4); ++ print_vma (table, PREFIX_HEX); ++ printf ("\n"); ++ ++ /* Locate the matching .ARM.extab. */ ++ if (entry_addr.section != SHN_UNDEF ++ && entry_addr.section < filedata->file_header.e_shnum) ++ { ++ table_sec = filedata->section_headers + entry_addr.section; ++ table_offset = entry_addr.offset; ++ /* PR 18879 */ ++ if (table_offset > table_sec->sh_size ++ || ((bfd_signed_vma) table_offset) < 0) ++ { ++ warn (_("Unwind entry contains corrupt offset (0x%lx) into section %s\n"), ++ (unsigned long) table_offset, ++ printable_section_name (filedata, table_sec)); ++ res = FALSE; ++ continue; ++ } ++ } ++ else ++ { ++ table_sec = find_section_by_address (filedata, table); ++ if (table_sec != NULL) ++ table_offset = table - table_sec->sh_addr; ++ } ++ ++ if (table_sec == NULL) ++ { ++ warn (_("Could not locate .ARM.extab section containing 0x%lx.\n"), ++ (unsigned long) table); ++ res = FALSE; ++ continue; ++ } ++ ++ if (! decode_arm_unwind (filedata, aux, 0, 0, table_offset, table_sec, ++ &extab_arm_sec)) ++ res = FALSE; ++ } ++ } ++ ++ printf ("\n"); ++ ++ free (aux->funtab); ++ arm_free_section (&exidx_arm_sec); ++ arm_free_section (&extab_arm_sec); ++ ++ return res; ++} ++ ++/* Used for both ARM and C6X unwinding tables. */ ++ ++static bfd_boolean ++arm_process_unwind (Filedata * filedata) ++{ ++ struct arm_unw_aux_info aux; ++ Elf_Internal_Shdr *unwsec = NULL; ++ Elf_Internal_Shdr *sec; ++ unsigned long i; ++ unsigned int sec_type; ++ bfd_boolean res = TRUE; ++ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_ARM: ++ sec_type = SHT_ARM_EXIDX; ++ break; ++ ++ case EM_TI_C6000: ++ sec_type = SHT_C6000_UNWIND; ++ break; ++ ++ default: ++ error (_("Unsupported architecture type %d encountered when processing unwind table\n"), ++ filedata->file_header.e_machine); ++ return FALSE; ++ } ++ ++ if (filedata->string_table == NULL) ++ return FALSE; ++ ++ memset (& aux, 0, sizeof (aux)); ++ aux.filedata = filedata; ++ ++ for (i = 0, sec = filedata->section_headers; i < filedata->file_header.e_shnum; ++i, ++sec) ++ { ++ if (sec->sh_type == SHT_SYMTAB) ++ { ++ if (aux.symtab) ++ { ++ error (_("Multiple symbol tables encountered\n")); ++ free (aux.symtab); ++ aux.symtab = NULL; ++ free (aux.strtab); ++ aux.strtab = NULL; ++ } ++ if (!get_symtab (filedata, sec, &aux.symtab, &aux.nsyms, ++ &aux.strtab, &aux.strtab_size)) ++ return FALSE; ++ } ++ else if (sec->sh_type == sec_type) ++ unwsec = sec; ++ } ++ ++ if (unwsec == NULL) ++ printf (_("\nThere are no unwind sections in this file.\n")); ++ else ++ for (i = 0, sec = filedata->section_headers; i < filedata->file_header.e_shnum; ++i, ++sec) ++ { ++ if (sec->sh_type == sec_type) ++ { ++ unsigned long num_unwind = sec->sh_size / (2 * eh_addr_size); ++ printf (ngettext ("\nUnwind section '%s' at offset 0x%lx " ++ "contains %lu entry:\n", ++ "\nUnwind section '%s' at offset 0x%lx " ++ "contains %lu entries:\n", ++ num_unwind), ++ printable_section_name (filedata, sec), ++ (unsigned long) sec->sh_offset, ++ num_unwind); ++ ++ if (! dump_arm_unwind (filedata, &aux, sec)) ++ res = FALSE; ++ } ++ } ++ ++ free (aux.symtab); ++ free ((char *) aux.strtab); ++ ++ return res; ++} ++ ++static bfd_boolean ++process_unwind (Filedata * filedata) ++{ ++ struct unwind_handler ++ { ++ unsigned int machtype; ++ bfd_boolean (* handler)(Filedata *); ++ } handlers[] = ++ { ++ { EM_ARM, arm_process_unwind }, ++ { EM_IA_64, ia64_process_unwind }, ++ { EM_PARISC, hppa_process_unwind }, ++ { EM_TI_C6000, arm_process_unwind }, ++ { 0, NULL } ++ }; ++ int i; ++ ++ if (!do_unwind) ++ return TRUE; ++ ++ for (i = 0; handlers[i].handler != NULL; i++) ++ if (filedata->file_header.e_machine == handlers[i].machtype) ++ return handlers[i].handler (filedata); ++ ++ printf (_("\nThe decoding of unwind sections for machine type %s is not currently supported.\n"), ++ get_machine_name (filedata->file_header.e_machine)); ++ return TRUE; ++} ++ ++static void ++dynamic_section_aarch64_val (Elf_Internal_Dyn * entry) ++{ ++ switch (entry->d_tag) ++ { ++ case DT_AARCH64_BTI_PLT: ++ case DT_AARCH64_PAC_PLT: ++ break; ++ default: ++ print_vma (entry->d_un.d_ptr, PREFIX_HEX); ++ break; ++ } ++ putchar ('\n'); ++} ++ ++static void ++dynamic_section_mips_val (Filedata * filedata, Elf_Internal_Dyn * entry) ++{ ++ switch (entry->d_tag) ++ { ++ case DT_MIPS_FLAGS: ++ if (entry->d_un.d_val == 0) ++ printf (_("NONE")); ++ else ++ { ++ static const char * opts[] = ++ { ++ "QUICKSTART", "NOTPOT", "NO_LIBRARY_REPLACEMENT", ++ "NO_MOVE", "SGI_ONLY", "GUARANTEE_INIT", "DELTA_C_PLUS_PLUS", ++ "GUARANTEE_START_INIT", "PIXIE", "DEFAULT_DELAY_LOAD", ++ "REQUICKSTART", "REQUICKSTARTED", "CORD", "NO_UNRES_UNDEF", ++ "RLD_ORDER_SAFE" ++ }; ++ unsigned int cnt; ++ bfd_boolean first = TRUE; ++ ++ for (cnt = 0; cnt < ARRAY_SIZE (opts); ++cnt) ++ if (entry->d_un.d_val & (1 << cnt)) ++ { ++ printf ("%s%s", first ? "" : " ", opts[cnt]); ++ first = FALSE; ++ } ++ } ++ break; ++ ++ case DT_MIPS_IVERSION: ++ if (VALID_DYNAMIC_NAME (filedata, entry->d_un.d_val)) ++ printf (_("Interface Version: %s"), ++ GET_DYNAMIC_NAME (filedata, entry->d_un.d_val)); ++ else ++ { ++ char buf[40]; ++ sprintf_vma (buf, entry->d_un.d_ptr); ++ /* Note: coded this way so that there is a single string for translation. */ ++ printf (_(""), buf); ++ } ++ break; ++ ++ case DT_MIPS_TIME_STAMP: ++ { ++ char timebuf[128]; ++ struct tm * tmp; ++ time_t atime = entry->d_un.d_val; ++ ++ tmp = gmtime (&atime); ++ /* PR 17531: file: 6accc532. */ ++ if (tmp == NULL) ++ snprintf (timebuf, sizeof (timebuf), _("")); ++ else ++ snprintf (timebuf, sizeof (timebuf), "%04u-%02u-%02uT%02u:%02u:%02u", ++ tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday, ++ tmp->tm_hour, tmp->tm_min, tmp->tm_sec); ++ printf (_("Time Stamp: %s"), timebuf); ++ } ++ break; ++ ++ case DT_MIPS_RLD_VERSION: ++ case DT_MIPS_LOCAL_GOTNO: ++ case DT_MIPS_CONFLICTNO: ++ case DT_MIPS_LIBLISTNO: ++ case DT_MIPS_SYMTABNO: ++ case DT_MIPS_UNREFEXTNO: ++ case DT_MIPS_HIPAGENO: ++ case DT_MIPS_DELTA_CLASS_NO: ++ case DT_MIPS_DELTA_INSTANCE_NO: ++ case DT_MIPS_DELTA_RELOC_NO: ++ case DT_MIPS_DELTA_SYM_NO: ++ case DT_MIPS_DELTA_CLASSSYM_NO: ++ case DT_MIPS_COMPACT_SIZE: ++ print_vma (entry->d_un.d_val, DEC); ++ break; ++ ++ case DT_MIPS_XHASH: ++ filedata->dynamic_info_DT_MIPS_XHASH = entry->d_un.d_val; ++ filedata->dynamic_info_DT_GNU_HASH = entry->d_un.d_val; ++ /* Falls through. */ ++ ++ default: ++ print_vma (entry->d_un.d_ptr, PREFIX_HEX); ++ } ++ putchar ('\n'); ++} ++ ++static void ++dynamic_section_parisc_val (Elf_Internal_Dyn * entry) ++{ ++ switch (entry->d_tag) ++ { ++ case DT_HP_DLD_FLAGS: ++ { ++ static struct ++ { ++ long int bit; ++ const char * str; ++ } ++ flags[] = ++ { ++ { DT_HP_DEBUG_PRIVATE, "HP_DEBUG_PRIVATE" }, ++ { DT_HP_DEBUG_CALLBACK, "HP_DEBUG_CALLBACK" }, ++ { DT_HP_DEBUG_CALLBACK_BOR, "HP_DEBUG_CALLBACK_BOR" }, ++ { DT_HP_NO_ENVVAR, "HP_NO_ENVVAR" }, ++ { DT_HP_BIND_NOW, "HP_BIND_NOW" }, ++ { DT_HP_BIND_NONFATAL, "HP_BIND_NONFATAL" }, ++ { DT_HP_BIND_VERBOSE, "HP_BIND_VERBOSE" }, ++ { DT_HP_BIND_RESTRICTED, "HP_BIND_RESTRICTED" }, ++ { DT_HP_BIND_SYMBOLIC, "HP_BIND_SYMBOLIC" }, ++ { DT_HP_RPATH_FIRST, "HP_RPATH_FIRST" }, ++ { DT_HP_BIND_DEPTH_FIRST, "HP_BIND_DEPTH_FIRST" }, ++ { DT_HP_GST, "HP_GST" }, ++ { DT_HP_SHLIB_FIXED, "HP_SHLIB_FIXED" }, ++ { DT_HP_MERGE_SHLIB_SEG, "HP_MERGE_SHLIB_SEG" }, ++ { DT_HP_NODELETE, "HP_NODELETE" }, ++ { DT_HP_GROUP, "HP_GROUP" }, ++ { DT_HP_PROTECT_LINKAGE_TABLE, "HP_PROTECT_LINKAGE_TABLE" } ++ }; ++ bfd_boolean first = TRUE; ++ size_t cnt; ++ bfd_vma val = entry->d_un.d_val; ++ ++ for (cnt = 0; cnt < ARRAY_SIZE (flags); ++cnt) ++ if (val & flags[cnt].bit) ++ { ++ if (! first) ++ putchar (' '); ++ fputs (flags[cnt].str, stdout); ++ first = FALSE; ++ val ^= flags[cnt].bit; ++ } ++ ++ if (val != 0 || first) ++ { ++ if (! first) ++ putchar (' '); ++ print_vma (val, HEX); ++ } ++ } ++ break; ++ ++ default: ++ print_vma (entry->d_un.d_ptr, PREFIX_HEX); ++ break; ++ } ++ putchar ('\n'); ++} ++ ++#ifdef BFD64 ++ ++/* VMS vs Unix time offset and factor. */ ++ ++#define VMS_EPOCH_OFFSET 35067168000000000LL ++#define VMS_GRANULARITY_FACTOR 10000000 ++ ++/* Display a VMS time in a human readable format. */ ++ ++static void ++print_vms_time (bfd_int64_t vmstime) ++{ ++ struct tm *tm; ++ time_t unxtime; ++ ++ unxtime = (vmstime - VMS_EPOCH_OFFSET) / VMS_GRANULARITY_FACTOR; ++ tm = gmtime (&unxtime); ++ printf ("%04u-%02u-%02uT%02u:%02u:%02u", ++ tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, ++ tm->tm_hour, tm->tm_min, tm->tm_sec); ++} ++#endif /* BFD64 */ ++ ++static void ++dynamic_section_ia64_val (Elf_Internal_Dyn * entry) ++{ ++ switch (entry->d_tag) ++ { ++ case DT_IA_64_PLT_RESERVE: ++ /* First 3 slots reserved. */ ++ print_vma (entry->d_un.d_ptr, PREFIX_HEX); ++ printf (" -- "); ++ print_vma (entry->d_un.d_ptr + (3 * 8), PREFIX_HEX); ++ break; ++ ++ case DT_IA_64_VMS_LINKTIME: ++#ifdef BFD64 ++ print_vms_time (entry->d_un.d_val); ++#endif ++ break; ++ ++ case DT_IA_64_VMS_LNKFLAGS: ++ print_vma (entry->d_un.d_ptr, PREFIX_HEX); ++ if (entry->d_un.d_val & VMS_LF_CALL_DEBUG) ++ printf (" CALL_DEBUG"); ++ if (entry->d_un.d_val & VMS_LF_NOP0BUFS) ++ printf (" NOP0BUFS"); ++ if (entry->d_un.d_val & VMS_LF_P0IMAGE) ++ printf (" P0IMAGE"); ++ if (entry->d_un.d_val & VMS_LF_MKTHREADS) ++ printf (" MKTHREADS"); ++ if (entry->d_un.d_val & VMS_LF_UPCALLS) ++ printf (" UPCALLS"); ++ if (entry->d_un.d_val & VMS_LF_IMGSTA) ++ printf (" IMGSTA"); ++ if (entry->d_un.d_val & VMS_LF_INITIALIZE) ++ printf (" INITIALIZE"); ++ if (entry->d_un.d_val & VMS_LF_MAIN) ++ printf (" MAIN"); ++ if (entry->d_un.d_val & VMS_LF_EXE_INIT) ++ printf (" EXE_INIT"); ++ if (entry->d_un.d_val & VMS_LF_TBK_IN_IMG) ++ printf (" TBK_IN_IMG"); ++ if (entry->d_un.d_val & VMS_LF_DBG_IN_IMG) ++ printf (" DBG_IN_IMG"); ++ if (entry->d_un.d_val & VMS_LF_TBK_IN_DSF) ++ printf (" TBK_IN_DSF"); ++ if (entry->d_un.d_val & VMS_LF_DBG_IN_DSF) ++ printf (" DBG_IN_DSF"); ++ if (entry->d_un.d_val & VMS_LF_SIGNATURES) ++ printf (" SIGNATURES"); ++ if (entry->d_un.d_val & VMS_LF_REL_SEG_OFF) ++ printf (" REL_SEG_OFF"); ++ break; ++ ++ default: ++ print_vma (entry->d_un.d_ptr, PREFIX_HEX); ++ break; ++ } ++ putchar ('\n'); ++} ++ ++static bfd_boolean ++get_32bit_dynamic_section (Filedata * filedata) ++{ ++ Elf32_External_Dyn * edyn; ++ Elf32_External_Dyn * ext; ++ Elf_Internal_Dyn * entry; ++ ++ edyn = (Elf32_External_Dyn *) get_data (NULL, filedata, ++ filedata->dynamic_addr, 1, ++ filedata->dynamic_size, ++ _("dynamic section")); ++ if (!edyn) ++ return FALSE; ++ ++ /* SGI's ELF has more than one section in the DYNAMIC segment, and we ++ might not have the luxury of section headers. Look for the DT_NULL ++ terminator to determine the number of entries. */ ++ for (ext = edyn, filedata->dynamic_nent = 0; ++ (char *) (ext + 1) <= (char *) edyn + filedata->dynamic_size; ++ ext++) ++ { ++ filedata->dynamic_nent++; ++ if (BYTE_GET (ext->d_tag) == DT_NULL) ++ break; ++ } ++ ++ filedata->dynamic_section ++ = (Elf_Internal_Dyn *) cmalloc (filedata->dynamic_nent, sizeof (* entry)); ++ if (filedata->dynamic_section == NULL) ++ { ++ error (_("Out of memory allocating space for %lu dynamic entries\n"), ++ (unsigned long) filedata->dynamic_nent); ++ free (edyn); ++ return FALSE; ++ } ++ ++ for (ext = edyn, entry = filedata->dynamic_section; ++ entry < filedata->dynamic_section + filedata->dynamic_nent; ++ ext++, entry++) ++ { ++ entry->d_tag = BYTE_GET (ext->d_tag); ++ entry->d_un.d_val = BYTE_GET (ext->d_un.d_val); ++ } ++ ++ free (edyn); ++ ++ return TRUE; ++} ++ ++static bfd_boolean ++get_64bit_dynamic_section (Filedata * filedata) ++{ ++ Elf64_External_Dyn * edyn; ++ Elf64_External_Dyn * ext; ++ Elf_Internal_Dyn * entry; ++ ++ /* Read in the data. */ ++ edyn = (Elf64_External_Dyn *) get_data (NULL, filedata, ++ filedata->dynamic_addr, 1, ++ filedata->dynamic_size, ++ _("dynamic section")); ++ if (!edyn) ++ return FALSE; ++ ++ /* SGI's ELF has more than one section in the DYNAMIC segment, and we ++ might not have the luxury of section headers. Look for the DT_NULL ++ terminator to determine the number of entries. */ ++ for (ext = edyn, filedata->dynamic_nent = 0; ++ /* PR 17533 file: 033-67080-0.004 - do not read past end of buffer. */ ++ (char *) (ext + 1) <= (char *) edyn + filedata->dynamic_size; ++ ext++) ++ { ++ filedata->dynamic_nent++; ++ if (BYTE_GET (ext->d_tag) == DT_NULL) ++ break; ++ } ++ ++ filedata->dynamic_section ++ = (Elf_Internal_Dyn *) cmalloc (filedata->dynamic_nent, sizeof (* entry)); ++ if (filedata->dynamic_section == NULL) ++ { ++ error (_("Out of memory allocating space for %lu dynamic entries\n"), ++ (unsigned long) filedata->dynamic_nent); ++ free (edyn); ++ return FALSE; ++ } ++ ++ /* Convert from external to internal formats. */ ++ for (ext = edyn, entry = filedata->dynamic_section; ++ entry < filedata->dynamic_section + filedata->dynamic_nent; ++ ext++, entry++) ++ { ++ entry->d_tag = BYTE_GET (ext->d_tag); ++ entry->d_un.d_val = BYTE_GET (ext->d_un.d_val); ++ } ++ ++ free (edyn); ++ ++ return TRUE; ++} ++ ++static void ++print_dynamic_flags (bfd_vma flags) ++{ ++ bfd_boolean first = TRUE; ++ ++ while (flags) ++ { ++ bfd_vma flag; ++ ++ flag = flags & - flags; ++ flags &= ~ flag; ++ ++ if (first) ++ first = FALSE; ++ else ++ putc (' ', stdout); ++ ++ switch (flag) ++ { ++ case DF_ORIGIN: fputs ("ORIGIN", stdout); break; ++ case DF_SYMBOLIC: fputs ("SYMBOLIC", stdout); break; ++ case DF_TEXTREL: fputs ("TEXTREL", stdout); break; ++ case DF_BIND_NOW: fputs ("BIND_NOW", stdout); break; ++ case DF_STATIC_TLS: fputs ("STATIC_TLS", stdout); break; ++ default: fputs (_("unknown"), stdout); break; ++ } ++ } ++ puts (""); ++} ++ ++static bfd_vma * ++get_dynamic_data (Filedata * filedata, bfd_size_type number, unsigned int ent_size) ++{ ++ unsigned char * e_data; ++ bfd_vma * i_data; ++ ++ /* If the size_t type is smaller than the bfd_size_type, eg because ++ you are building a 32-bit tool on a 64-bit host, then make sure ++ that when (number) is cast to (size_t) no information is lost. */ ++ if (sizeof (size_t) < sizeof (bfd_size_type) ++ && (bfd_size_type) ((size_t) number) != number) ++ { ++ error (_("Size truncation prevents reading %s elements of size %u\n"), ++ bfd_vmatoa ("u", number), ent_size); ++ return NULL; ++ } ++ ++ /* Be kind to memory checkers (eg valgrind, address sanitizer) by not ++ attempting to allocate memory when the read is bound to fail. */ ++ if (ent_size * number > filedata->file_size) ++ { ++ error (_("Invalid number of dynamic entries: %s\n"), ++ bfd_vmatoa ("u", number)); ++ return NULL; ++ } ++ ++ e_data = (unsigned char *) cmalloc ((size_t) number, ent_size); ++ if (e_data == NULL) ++ { ++ error (_("Out of memory reading %s dynamic entries\n"), ++ bfd_vmatoa ("u", number)); ++ return NULL; ++ } ++ ++ if (fread (e_data, ent_size, (size_t) number, filedata->handle) != number) ++ { ++ error (_("Unable to read in %s bytes of dynamic data\n"), ++ bfd_vmatoa ("u", number * ent_size)); ++ free (e_data); ++ return NULL; ++ } ++ ++ i_data = (bfd_vma *) cmalloc ((size_t) number, sizeof (*i_data)); ++ if (i_data == NULL) ++ { ++ error (_("Out of memory allocating space for %s dynamic entries\n"), ++ bfd_vmatoa ("u", number)); ++ free (e_data); ++ return NULL; ++ } ++ ++ while (number--) ++ i_data[number] = byte_get (e_data + number * ent_size, ent_size); ++ ++ free (e_data); ++ ++ return i_data; ++} ++ ++static unsigned long ++get_num_dynamic_syms (Filedata * filedata) ++{ ++ unsigned long num_of_syms = 0; ++ ++ if (!do_histogram && (!do_using_dynamic || do_dyn_syms)) ++ return num_of_syms; ++ ++ if (filedata->dynamic_info[DT_HASH]) ++ { ++ unsigned char nb[8]; ++ unsigned char nc[8]; ++ unsigned int hash_ent_size = 4; ++ ++ if ((filedata->file_header.e_machine == EM_ALPHA ++ || filedata->file_header.e_machine == EM_S390 ++ || filedata->file_header.e_machine == EM_S390_OLD) ++ && filedata->file_header.e_ident[EI_CLASS] == ELFCLASS64) ++ hash_ent_size = 8; ++ ++ if (fseek (filedata->handle, ++ (filedata->archive_file_offset ++ + offset_from_vma (filedata, filedata->dynamic_info[DT_HASH], ++ sizeof nb + sizeof nc)), ++ SEEK_SET)) ++ { ++ error (_("Unable to seek to start of dynamic information\n")); ++ goto no_hash; ++ } ++ ++ if (fread (nb, hash_ent_size, 1, filedata->handle) != 1) ++ { ++ error (_("Failed to read in number of buckets\n")); ++ goto no_hash; ++ } ++ ++ if (fread (nc, hash_ent_size, 1, filedata->handle) != 1) ++ { ++ error (_("Failed to read in number of chains\n")); ++ goto no_hash; ++ } ++ ++ filedata->nbuckets = byte_get (nb, hash_ent_size); ++ filedata->nchains = byte_get (nc, hash_ent_size); ++ ++ if (filedata->nbuckets != 0 && filedata->nchains != 0) ++ { ++ filedata->buckets = get_dynamic_data (filedata, filedata->nbuckets, ++ hash_ent_size); ++ filedata->chains = get_dynamic_data (filedata, filedata->nchains, ++ hash_ent_size); ++ ++ if (filedata->buckets != NULL && filedata->chains != NULL) ++ num_of_syms = filedata->nchains; ++ } ++ no_hash: ++ if (num_of_syms == 0) ++ { ++ free (filedata->buckets); ++ filedata->buckets = NULL; ++ free (filedata->chains); ++ filedata->chains = NULL; ++ filedata->nbuckets = 0; ++ } ++ } ++ ++ if (filedata->dynamic_info_DT_GNU_HASH) ++ { ++ unsigned char nb[16]; ++ bfd_vma i, maxchain = 0xffffffff, bitmaskwords; ++ bfd_vma buckets_vma; ++ unsigned long hn; ++ ++ if (fseek (filedata->handle, ++ (filedata->archive_file_offset ++ + offset_from_vma (filedata, ++ filedata->dynamic_info_DT_GNU_HASH, ++ sizeof nb)), ++ SEEK_SET)) ++ { ++ error (_("Unable to seek to start of dynamic information\n")); ++ goto no_gnu_hash; ++ } ++ ++ if (fread (nb, 16, 1, filedata->handle) != 1) ++ { ++ error (_("Failed to read in number of buckets\n")); ++ goto no_gnu_hash; ++ } ++ ++ filedata->ngnubuckets = byte_get (nb, 4); ++ filedata->gnusymidx = byte_get (nb + 4, 4); ++ bitmaskwords = byte_get (nb + 8, 4); ++ buckets_vma = filedata->dynamic_info_DT_GNU_HASH + 16; ++ if (is_32bit_elf) ++ buckets_vma += bitmaskwords * 4; ++ else ++ buckets_vma += bitmaskwords * 8; ++ ++ if (fseek (filedata->handle, ++ (filedata->archive_file_offset ++ + offset_from_vma (filedata, buckets_vma, 4)), ++ SEEK_SET)) ++ { ++ error (_("Unable to seek to start of dynamic information\n")); ++ goto no_gnu_hash; ++ } ++ ++ filedata->gnubuckets ++ = get_dynamic_data (filedata, filedata->ngnubuckets, 4); ++ ++ if (filedata->gnubuckets == NULL) ++ goto no_gnu_hash; ++ ++ for (i = 0; i < filedata->ngnubuckets; i++) ++ if (filedata->gnubuckets[i] != 0) ++ { ++ if (filedata->gnubuckets[i] < filedata->gnusymidx) ++ goto no_gnu_hash; ++ ++ if (maxchain == 0xffffffff || filedata->gnubuckets[i] > maxchain) ++ maxchain = filedata->gnubuckets[i]; ++ } ++ ++ if (maxchain == 0xffffffff) ++ goto no_gnu_hash; ++ ++ maxchain -= filedata->gnusymidx; ++ ++ if (fseek (filedata->handle, ++ (filedata->archive_file_offset ++ + offset_from_vma (filedata, ++ buckets_vma + 4 * (filedata->ngnubuckets ++ + maxchain), ++ 4)), ++ SEEK_SET)) ++ { ++ error (_("Unable to seek to start of dynamic information\n")); ++ goto no_gnu_hash; ++ } ++ ++ do ++ { ++ if (fread (nb, 4, 1, filedata->handle) != 1) ++ { ++ error (_("Failed to determine last chain length\n")); ++ goto no_gnu_hash; ++ } ++ ++ if (maxchain + 1 == 0) ++ goto no_gnu_hash; ++ ++ ++maxchain; ++ } ++ while ((byte_get (nb, 4) & 1) == 0); ++ ++ if (fseek (filedata->handle, ++ (filedata->archive_file_offset ++ + offset_from_vma (filedata, (buckets_vma ++ + 4 * filedata->ngnubuckets), ++ 4)), ++ SEEK_SET)) ++ { ++ error (_("Unable to seek to start of dynamic information\n")); ++ goto no_gnu_hash; ++ } ++ ++ filedata->gnuchains = get_dynamic_data (filedata, maxchain, 4); ++ filedata->ngnuchains = maxchain; ++ ++ if (filedata->gnuchains == NULL) ++ goto no_gnu_hash; ++ ++ if (filedata->dynamic_info_DT_MIPS_XHASH) ++ { ++ if (fseek (filedata->handle, ++ (filedata->archive_file_offset ++ + offset_from_vma (filedata, (buckets_vma ++ + 4 * (filedata->ngnubuckets ++ + maxchain)), 4)), ++ SEEK_SET)) ++ { ++ error (_("Unable to seek to start of dynamic information\n")); ++ goto no_gnu_hash; ++ } ++ ++ filedata->mipsxlat = get_dynamic_data (filedata, maxchain, 4); ++ if (filedata->mipsxlat == NULL) ++ goto no_gnu_hash; ++ } ++ ++ for (hn = 0; hn < filedata->ngnubuckets; ++hn) ++ if (filedata->gnubuckets[hn] != 0) ++ { ++ bfd_vma si = filedata->gnubuckets[hn]; ++ bfd_vma off = si - filedata->gnusymidx; ++ ++ do ++ { ++ if (filedata->dynamic_info_DT_MIPS_XHASH) ++ { ++ if (off < filedata->ngnuchains ++ && filedata->mipsxlat[off] >= num_of_syms) ++ num_of_syms = filedata->mipsxlat[off] + 1; ++ } ++ else ++ { ++ if (si >= num_of_syms) ++ num_of_syms = si + 1; ++ } ++ si++; ++ } ++ while (off < filedata->ngnuchains ++ && (filedata->gnuchains[off++] & 1) == 0); ++ } ++ ++ if (num_of_syms == 0) ++ { ++ no_gnu_hash: ++ free (filedata->mipsxlat); ++ filedata->mipsxlat = NULL; ++ free (filedata->gnuchains); ++ filedata->gnuchains = NULL; ++ free (filedata->gnubuckets); ++ filedata->gnubuckets = NULL; ++ filedata->ngnubuckets = 0; ++ filedata->ngnuchains = 0; ++ } ++ } ++ ++ return num_of_syms; ++} ++ ++/* Parse and display the contents of the dynamic section. */ ++ ++static bfd_boolean ++process_dynamic_section (Filedata * filedata) ++{ ++ Elf_Internal_Dyn * entry; ++ ++ if (filedata->dynamic_size == 0) ++ { ++ if (do_dynamic) ++ printf (_("\nThere is no dynamic section in this file.\n")); ++ ++ return TRUE; ++ } ++ ++ if (is_32bit_elf) ++ { ++ if (! get_32bit_dynamic_section (filedata)) ++ return FALSE; ++ } ++ else ++ { ++ if (! get_64bit_dynamic_section (filedata)) ++ return FALSE; ++ } ++ ++ /* Find the appropriate symbol table. */ ++ if (filedata->dynamic_symbols == NULL || do_histogram) ++ { ++ unsigned long num_of_syms; ++ ++ for (entry = filedata->dynamic_section; ++ entry < filedata->dynamic_section + filedata->dynamic_nent; ++ ++entry) ++ if (entry->d_tag == DT_SYMTAB) ++ filedata->dynamic_info[DT_SYMTAB] = entry->d_un.d_val; ++ else if (entry->d_tag == DT_SYMENT) ++ filedata->dynamic_info[DT_SYMENT] = entry->d_un.d_val; ++ else if (entry->d_tag == DT_HASH) ++ filedata->dynamic_info[DT_HASH] = entry->d_un.d_val; ++ else if (entry->d_tag == DT_GNU_HASH) ++ filedata->dynamic_info_DT_GNU_HASH = entry->d_un.d_val; ++ else if ((filedata->file_header.e_machine == EM_MIPS ++ || filedata->file_header.e_machine == EM_MIPS_RS3_LE) ++ && entry->d_tag == DT_MIPS_XHASH) ++ { ++ filedata->dynamic_info_DT_MIPS_XHASH = entry->d_un.d_val; ++ filedata->dynamic_info_DT_GNU_HASH = entry->d_un.d_val; ++ } ++ ++ num_of_syms = get_num_dynamic_syms (filedata); ++ ++ if (num_of_syms != 0 ++ && filedata->dynamic_symbols == NULL ++ && filedata->dynamic_info[DT_SYMTAB] ++ && filedata->dynamic_info[DT_SYMENT]) ++ { ++ Elf_Internal_Phdr *seg; ++ bfd_vma vma = filedata->dynamic_info[DT_SYMTAB]; ++ ++ if (! get_program_headers (filedata)) ++ { ++ error (_("Cannot interpret virtual addresses " ++ "without program headers.\n")); ++ return FALSE; ++ } ++ ++ for (seg = filedata->program_headers; ++ seg < filedata->program_headers + filedata->file_header.e_phnum; ++ ++seg) ++ { ++ if (seg->p_type != PT_LOAD) ++ continue; ++ ++ if (seg->p_offset + seg->p_filesz > filedata->file_size) ++ { ++ /* See PR 21379 for a reproducer. */ ++ error (_("Invalid PT_LOAD entry\n")); ++ return FALSE; ++ } ++ ++ if (vma >= (seg->p_vaddr & -seg->p_align) ++ && vma < seg->p_vaddr + seg->p_filesz) ++ { ++ /* Since we do not know how big the symbol table is, ++ we default to reading in up to the end of PT_LOAD ++ segment and processing that. This is overkill, I ++ know, but it should work. */ ++ Elf_Internal_Shdr section; ++ section.sh_offset = (vma - seg->p_vaddr ++ + seg->p_offset); ++ section.sh_size = (num_of_syms ++ * filedata->dynamic_info[DT_SYMENT]); ++ section.sh_entsize = filedata->dynamic_info[DT_SYMENT]; ++ ++ if (do_checks ++ && filedata->dynamic_symtab_section != NULL ++ && ((filedata->dynamic_symtab_section->sh_offset ++ != section.sh_offset) ++ || (filedata->dynamic_symtab_section->sh_size ++ != section.sh_size) ++ || (filedata->dynamic_symtab_section->sh_entsize ++ != section.sh_entsize))) ++ warn (_("\ ++the .dynsym section doesn't match the DT_SYMTAB and DT_SYMENT tags\n")); ++ ++ section.sh_name = filedata->string_table_length; ++ filedata->dynamic_symbols ++ = GET_ELF_SYMBOLS (filedata, §ion, ++ &filedata->num_dynamic_syms); ++ if (filedata->dynamic_symbols == NULL ++ || filedata->num_dynamic_syms != num_of_syms) ++ { ++ error (_("Corrupt DT_SYMTAB dynamic entry\n")); ++ return FALSE; ++ } ++ break; ++ } ++ } ++ } ++ } ++ ++ /* Similarly find a string table. */ ++ if (filedata->dynamic_strings == NULL) ++ for (entry = filedata->dynamic_section; ++ entry < filedata->dynamic_section + filedata->dynamic_nent; ++ ++entry) ++ { ++ if (entry->d_tag == DT_STRTAB) ++ filedata->dynamic_info[DT_STRTAB] = entry->d_un.d_val; ++ ++ if (entry->d_tag == DT_STRSZ) ++ filedata->dynamic_info[DT_STRSZ] = entry->d_un.d_val; ++ ++ if (filedata->dynamic_info[DT_STRTAB] ++ && filedata->dynamic_info[DT_STRSZ]) ++ { ++ unsigned long offset; ++ bfd_size_type str_tab_len = filedata->dynamic_info[DT_STRSZ]; ++ ++ offset = offset_from_vma (filedata, ++ filedata->dynamic_info[DT_STRTAB], ++ str_tab_len); ++ if (do_checks ++ && filedata->dynamic_strtab_section ++ && ((filedata->dynamic_strtab_section->sh_offset ++ != (file_ptr) offset) ++ || (filedata->dynamic_strtab_section->sh_size ++ != str_tab_len))) ++ warn (_("\ ++the .dynstr section doesn't match the DT_STRTAB and DT_STRSZ tags\n")); ++ ++ filedata->dynamic_strings ++ = (char *) get_data (NULL, filedata, offset, 1, str_tab_len, ++ _("dynamic string table")); ++ if (filedata->dynamic_strings == NULL) ++ { ++ error (_("Corrupt DT_STRTAB dynamic entry\n")); ++ break; ++ } ++ ++ filedata->dynamic_strings_length = str_tab_len; ++ break; ++ } ++ } ++ ++ /* And find the syminfo section if available. */ ++ if (filedata->dynamic_syminfo == NULL) ++ { ++ unsigned long syminsz = 0; ++ ++ for (entry = filedata->dynamic_section; ++ entry < filedata->dynamic_section + filedata->dynamic_nent; ++ ++entry) ++ { ++ if (entry->d_tag == DT_SYMINENT) ++ { ++ /* Note: these braces are necessary to avoid a syntax ++ error from the SunOS4 C compiler. */ ++ /* PR binutils/17531: A corrupt file can trigger this test. ++ So do not use an assert, instead generate an error message. */ ++ if (sizeof (Elf_External_Syminfo) != entry->d_un.d_val) ++ error (_("Bad value (%d) for SYMINENT entry\n"), ++ (int) entry->d_un.d_val); ++ } ++ else if (entry->d_tag == DT_SYMINSZ) ++ syminsz = entry->d_un.d_val; ++ else if (entry->d_tag == DT_SYMINFO) ++ filedata->dynamic_syminfo_offset ++ = offset_from_vma (filedata, entry->d_un.d_val, syminsz); ++ } ++ ++ if (filedata->dynamic_syminfo_offset != 0 && syminsz != 0) ++ { ++ Elf_External_Syminfo * extsyminfo; ++ Elf_External_Syminfo * extsym; ++ Elf_Internal_Syminfo * syminfo; ++ ++ /* There is a syminfo section. Read the data. */ ++ extsyminfo = (Elf_External_Syminfo *) ++ get_data (NULL, filedata, filedata->dynamic_syminfo_offset, ++ 1, syminsz, _("symbol information")); ++ if (!extsyminfo) ++ return FALSE; ++ ++ if (filedata->dynamic_syminfo != NULL) ++ { ++ error (_("Multiple dynamic symbol information sections found\n")); ++ free (filedata->dynamic_syminfo); ++ } ++ filedata->dynamic_syminfo = (Elf_Internal_Syminfo *) malloc (syminsz); ++ if (filedata->dynamic_syminfo == NULL) ++ { ++ error (_("Out of memory allocating %lu bytes " ++ "for dynamic symbol info\n"), ++ (unsigned long) syminsz); ++ return FALSE; ++ } ++ ++ filedata->dynamic_syminfo_nent ++ = syminsz / sizeof (Elf_External_Syminfo); ++ for (syminfo = filedata->dynamic_syminfo, extsym = extsyminfo; ++ syminfo < (filedata->dynamic_syminfo ++ + filedata->dynamic_syminfo_nent); ++ ++syminfo, ++extsym) ++ { ++ syminfo->si_boundto = BYTE_GET (extsym->si_boundto); ++ syminfo->si_flags = BYTE_GET (extsym->si_flags); ++ } ++ ++ free (extsyminfo); ++ } ++ } ++ ++ if (do_dynamic && filedata->dynamic_addr) ++ printf (ngettext ("\nDynamic section at offset 0x%lx " ++ "contains %lu entry:\n", ++ "\nDynamic section at offset 0x%lx " ++ "contains %lu entries:\n", ++ filedata->dynamic_nent), ++ filedata->dynamic_addr, (unsigned long) filedata->dynamic_nent); ++ if (do_dynamic) ++ printf (_(" Tag Type Name/Value\n")); ++ ++ for (entry = filedata->dynamic_section; ++ entry < filedata->dynamic_section + filedata->dynamic_nent; ++ entry++) ++ { ++ if (do_dynamic) ++ { ++ const char * dtype; ++ ++ putchar (' '); ++ print_vma (entry->d_tag, FULL_HEX); ++ dtype = get_dynamic_type (filedata, entry->d_tag); ++ printf (" (%s)%*s", dtype, ++ ((is_32bit_elf ? 27 : 19) - (int) strlen (dtype)), " "); ++ } ++ ++ switch (entry->d_tag) ++ { ++ case DT_FLAGS: ++ if (do_dynamic) ++ print_dynamic_flags (entry->d_un.d_val); ++ break; ++ ++ case DT_AUXILIARY: ++ case DT_FILTER: ++ case DT_CONFIG: ++ case DT_DEPAUDIT: ++ case DT_AUDIT: ++ if (do_dynamic) ++ { ++ switch (entry->d_tag) ++ { ++ case DT_AUXILIARY: ++ printf (_("Auxiliary library")); ++ break; ++ ++ case DT_FILTER: ++ printf (_("Filter library")); ++ break; ++ ++ case DT_CONFIG: ++ printf (_("Configuration file")); ++ break; ++ ++ case DT_DEPAUDIT: ++ printf (_("Dependency audit library")); ++ break; ++ ++ case DT_AUDIT: ++ printf (_("Audit library")); ++ break; ++ } ++ ++ if (VALID_DYNAMIC_NAME (filedata, entry->d_un.d_val)) ++ printf (": [%s]\n", ++ GET_DYNAMIC_NAME (filedata, entry->d_un.d_val)); ++ else ++ { ++ printf (": "); ++ print_vma (entry->d_un.d_val, PREFIX_HEX); ++ putchar ('\n'); ++ } ++ } ++ break; ++ ++ case DT_FEATURE: ++ if (do_dynamic) ++ { ++ printf (_("Flags:")); ++ ++ if (entry->d_un.d_val == 0) ++ printf (_(" None\n")); ++ else ++ { ++ unsigned long int val = entry->d_un.d_val; ++ ++ if (val & DTF_1_PARINIT) ++ { ++ printf (" PARINIT"); ++ val ^= DTF_1_PARINIT; ++ } ++ if (val & DTF_1_CONFEXP) ++ { ++ printf (" CONFEXP"); ++ val ^= DTF_1_CONFEXP; ++ } ++ if (val != 0) ++ printf (" %lx", val); ++ puts (""); ++ } ++ } ++ break; ++ ++ case DT_POSFLAG_1: ++ if (do_dynamic) ++ { ++ printf (_("Flags:")); ++ ++ if (entry->d_un.d_val == 0) ++ printf (_(" None\n")); ++ else ++ { ++ unsigned long int val = entry->d_un.d_val; ++ ++ if (val & DF_P1_LAZYLOAD) ++ { ++ printf (" LAZYLOAD"); ++ val ^= DF_P1_LAZYLOAD; ++ } ++ if (val & DF_P1_GROUPPERM) ++ { ++ printf (" GROUPPERM"); ++ val ^= DF_P1_GROUPPERM; ++ } ++ if (val != 0) ++ printf (" %lx", val); ++ puts (""); ++ } ++ } ++ break; ++ ++ case DT_FLAGS_1: ++ if (do_dynamic) ++ { ++ printf (_("Flags:")); ++ if (entry->d_un.d_val == 0) ++ printf (_(" None\n")); ++ else ++ { ++ unsigned long int val = entry->d_un.d_val; ++ ++ if (val & DF_1_NOW) ++ { ++ printf (" NOW"); ++ val ^= DF_1_NOW; ++ } ++ if (val & DF_1_GLOBAL) ++ { ++ printf (" GLOBAL"); ++ val ^= DF_1_GLOBAL; ++ } ++ if (val & DF_1_GROUP) ++ { ++ printf (" GROUP"); ++ val ^= DF_1_GROUP; ++ } ++ if (val & DF_1_NODELETE) ++ { ++ printf (" NODELETE"); ++ val ^= DF_1_NODELETE; ++ } ++ if (val & DF_1_LOADFLTR) ++ { ++ printf (" LOADFLTR"); ++ val ^= DF_1_LOADFLTR; ++ } ++ if (val & DF_1_INITFIRST) ++ { ++ printf (" INITFIRST"); ++ val ^= DF_1_INITFIRST; ++ } ++ if (val & DF_1_NOOPEN) ++ { ++ printf (" NOOPEN"); ++ val ^= DF_1_NOOPEN; ++ } ++ if (val & DF_1_ORIGIN) ++ { ++ printf (" ORIGIN"); ++ val ^= DF_1_ORIGIN; ++ } ++ if (val & DF_1_DIRECT) ++ { ++ printf (" DIRECT"); ++ val ^= DF_1_DIRECT; ++ } ++ if (val & DF_1_TRANS) ++ { ++ printf (" TRANS"); ++ val ^= DF_1_TRANS; ++ } ++ if (val & DF_1_INTERPOSE) ++ { ++ printf (" INTERPOSE"); ++ val ^= DF_1_INTERPOSE; ++ } ++ if (val & DF_1_NODEFLIB) ++ { ++ printf (" NODEFLIB"); ++ val ^= DF_1_NODEFLIB; ++ } ++ if (val & DF_1_NODUMP) ++ { ++ printf (" NODUMP"); ++ val ^= DF_1_NODUMP; ++ } ++ if (val & DF_1_CONFALT) ++ { ++ printf (" CONFALT"); ++ val ^= DF_1_CONFALT; ++ } ++ if (val & DF_1_ENDFILTEE) ++ { ++ printf (" ENDFILTEE"); ++ val ^= DF_1_ENDFILTEE; ++ } ++ if (val & DF_1_DISPRELDNE) ++ { ++ printf (" DISPRELDNE"); ++ val ^= DF_1_DISPRELDNE; ++ } ++ if (val & DF_1_DISPRELPND) ++ { ++ printf (" DISPRELPND"); ++ val ^= DF_1_DISPRELPND; ++ } ++ if (val & DF_1_NODIRECT) ++ { ++ printf (" NODIRECT"); ++ val ^= DF_1_NODIRECT; ++ } ++ if (val & DF_1_IGNMULDEF) ++ { ++ printf (" IGNMULDEF"); ++ val ^= DF_1_IGNMULDEF; ++ } ++ if (val & DF_1_NOKSYMS) ++ { ++ printf (" NOKSYMS"); ++ val ^= DF_1_NOKSYMS; ++ } ++ if (val & DF_1_NOHDR) ++ { ++ printf (" NOHDR"); ++ val ^= DF_1_NOHDR; ++ } ++ if (val & DF_1_EDITED) ++ { ++ printf (" EDITED"); ++ val ^= DF_1_EDITED; ++ } ++ if (val & DF_1_NORELOC) ++ { ++ printf (" NORELOC"); ++ val ^= DF_1_NORELOC; ++ } ++ if (val & DF_1_SYMINTPOSE) ++ { ++ printf (" SYMINTPOSE"); ++ val ^= DF_1_SYMINTPOSE; ++ } ++ if (val & DF_1_GLOBAUDIT) ++ { ++ printf (" GLOBAUDIT"); ++ val ^= DF_1_GLOBAUDIT; ++ } ++ if (val & DF_1_SINGLETON) ++ { ++ printf (" SINGLETON"); ++ val ^= DF_1_SINGLETON; ++ } ++ if (val & DF_1_STUB) ++ { ++ printf (" STUB"); ++ val ^= DF_1_STUB; ++ } ++ if (val & DF_1_PIE) ++ { ++ printf (" PIE"); ++ val ^= DF_1_PIE; ++ } ++ if (val & DF_1_KMOD) ++ { ++ printf (" KMOD"); ++ val ^= DF_1_KMOD; ++ } ++ if (val & DF_1_WEAKFILTER) ++ { ++ printf (" WEAKFILTER"); ++ val ^= DF_1_WEAKFILTER; ++ } ++ if (val & DF_1_NOCOMMON) ++ { ++ printf (" NOCOMMON"); ++ val ^= DF_1_NOCOMMON; ++ } ++ if (val != 0) ++ printf (" %lx", val); ++ puts (""); ++ } ++ } ++ break; ++ ++ case DT_PLTREL: ++ filedata->dynamic_info[entry->d_tag] = entry->d_un.d_val; ++ if (do_dynamic) ++ puts (get_dynamic_type (filedata, entry->d_un.d_val)); ++ break; ++ ++ case DT_NULL : ++ case DT_NEEDED : ++ case DT_PLTGOT : ++ case DT_HASH : ++ case DT_STRTAB : ++ case DT_SYMTAB : ++ case DT_RELA : ++ case DT_INIT : ++ case DT_FINI : ++ case DT_SONAME : ++ case DT_RPATH : ++ case DT_SYMBOLIC: ++ case DT_REL : ++ case DT_DEBUG : ++ case DT_TEXTREL : ++ case DT_JMPREL : ++ case DT_RUNPATH : ++ filedata->dynamic_info[entry->d_tag] = entry->d_un.d_val; ++ ++ if (do_dynamic) ++ { ++ char * name; ++ ++ if (VALID_DYNAMIC_NAME (filedata, entry->d_un.d_val)) ++ name = GET_DYNAMIC_NAME (filedata, entry->d_un.d_val); ++ else ++ name = NULL; ++ ++ if (name) ++ { ++ switch (entry->d_tag) ++ { ++ case DT_NEEDED: ++ printf (_("Shared library: [%s]"), name); ++ ++ if (streq (name, filedata->program_interpreter)) ++ printf (_(" program interpreter")); ++ break; ++ ++ case DT_SONAME: ++ printf (_("Library soname: [%s]"), name); ++ break; ++ ++ case DT_RPATH: ++ printf (_("Library rpath: [%s]"), name); ++ break; ++ ++ case DT_RUNPATH: ++ printf (_("Library runpath: [%s]"), name); ++ break; ++ ++ default: ++ print_vma (entry->d_un.d_val, PREFIX_HEX); ++ break; ++ } ++ } ++ else ++ print_vma (entry->d_un.d_val, PREFIX_HEX); ++ ++ putchar ('\n'); ++ } ++ break; ++ ++ case DT_PLTRELSZ: ++ case DT_RELASZ : ++ case DT_STRSZ : ++ case DT_RELSZ : ++ case DT_RELAENT : ++ case DT_SYMENT : ++ case DT_RELENT : ++ filedata->dynamic_info[entry->d_tag] = entry->d_un.d_val; ++ /* Fall through. */ ++ case DT_PLTPADSZ: ++ case DT_MOVEENT : ++ case DT_MOVESZ : ++ case DT_INIT_ARRAYSZ: ++ case DT_FINI_ARRAYSZ: ++ case DT_GNU_CONFLICTSZ: ++ case DT_GNU_LIBLISTSZ: ++ if (do_dynamic) ++ { ++ print_vma (entry->d_un.d_val, UNSIGNED); ++ printf (_(" (bytes)\n")); ++ } ++ break; ++ ++ case DT_VERDEFNUM: ++ case DT_VERNEEDNUM: ++ case DT_RELACOUNT: ++ case DT_RELCOUNT: ++ if (do_dynamic) ++ { ++ print_vma (entry->d_un.d_val, UNSIGNED); ++ putchar ('\n'); ++ } ++ break; ++ ++ case DT_SYMINSZ: ++ case DT_SYMINENT: ++ case DT_SYMINFO: ++ case DT_USED: ++ case DT_INIT_ARRAY: ++ case DT_FINI_ARRAY: ++ if (do_dynamic) ++ { ++ if (entry->d_tag == DT_USED ++ && VALID_DYNAMIC_NAME (filedata, entry->d_un.d_val)) ++ { ++ char * name = GET_DYNAMIC_NAME (filedata, entry->d_un.d_val); ++ ++ if (*name) ++ { ++ printf (_("Not needed object: [%s]\n"), name); ++ break; ++ } ++ } ++ ++ print_vma (entry->d_un.d_val, PREFIX_HEX); ++ putchar ('\n'); ++ } ++ break; ++ ++ case DT_BIND_NOW: ++ /* The value of this entry is ignored. */ ++ if (do_dynamic) ++ putchar ('\n'); ++ break; ++ ++ case DT_GNU_PRELINKED: ++ if (do_dynamic) ++ { ++ struct tm * tmp; ++ time_t atime = entry->d_un.d_val; ++ ++ tmp = gmtime (&atime); ++ /* PR 17533 file: 041-1244816-0.004. */ ++ if (tmp == NULL) ++ printf (_("tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday, ++ tmp->tm_hour, tmp->tm_min, tmp->tm_sec); ++ ++ } ++ break; ++ ++ case DT_GNU_HASH: ++ filedata->dynamic_info_DT_GNU_HASH = entry->d_un.d_val; ++ if (do_dynamic) ++ { ++ print_vma (entry->d_un.d_val, PREFIX_HEX); ++ putchar ('\n'); ++ } ++ break; ++ ++ default: ++ if ((entry->d_tag >= DT_VERSYM) && (entry->d_tag <= DT_VERNEEDNUM)) ++ filedata->version_info[DT_VERSIONTAGIDX (entry->d_tag)] ++ = entry->d_un.d_val; ++ ++ if (do_dynamic) ++ { ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_AARCH64: ++ dynamic_section_aarch64_val (entry); ++ break; ++ case EM_MIPS: ++ case EM_MIPS_RS3_LE: ++ dynamic_section_mips_val (filedata, entry); ++ break; ++ case EM_PARISC: ++ dynamic_section_parisc_val (entry); ++ break; ++ case EM_IA_64: ++ dynamic_section_ia64_val (entry); ++ break; ++ default: ++ print_vma (entry->d_un.d_val, PREFIX_HEX); ++ putchar ('\n'); ++ } ++ } ++ break; ++ } ++ } ++ ++ return TRUE; ++} ++ ++static char * ++get_ver_flags (unsigned int flags) ++{ ++ static char buff[128]; ++ ++ buff[0] = 0; ++ ++ if (flags == 0) ++ return _("none"); ++ ++ if (flags & VER_FLG_BASE) ++ strcat (buff, "BASE"); ++ ++ if (flags & VER_FLG_WEAK) ++ { ++ if (flags & VER_FLG_BASE) ++ strcat (buff, " | "); ++ ++ strcat (buff, "WEAK"); ++ } ++ ++ if (flags & VER_FLG_INFO) ++ { ++ if (flags & (VER_FLG_BASE|VER_FLG_WEAK)) ++ strcat (buff, " | "); ++ ++ strcat (buff, "INFO"); ++ } ++ ++ if (flags & ~(VER_FLG_BASE | VER_FLG_WEAK | VER_FLG_INFO)) ++ { ++ if (flags & (VER_FLG_BASE | VER_FLG_WEAK | VER_FLG_INFO)) ++ strcat (buff, " | "); ++ ++ strcat (buff, _("")); ++ } ++ ++ return buff; ++} ++ ++/* Display the contents of the version sections. */ ++ ++static bfd_boolean ++process_version_sections (Filedata * filedata) ++{ ++ Elf_Internal_Shdr * section; ++ unsigned i; ++ bfd_boolean found = FALSE; ++ ++ if (! do_version) ++ return TRUE; ++ ++ for (i = 0, section = filedata->section_headers; ++ i < filedata->file_header.e_shnum; ++ i++, section++) ++ { ++ switch (section->sh_type) ++ { ++ case SHT_GNU_verdef: ++ { ++ Elf_External_Verdef * edefs; ++ unsigned long idx; ++ unsigned long cnt; ++ char * endbuf; ++ ++ found = TRUE; ++ ++ printf (ngettext ("\nVersion definition section '%s' " ++ "contains %u entry:\n", ++ "\nVersion definition section '%s' " ++ "contains %u entries:\n", ++ section->sh_info), ++ printable_section_name (filedata, section), ++ section->sh_info); ++ ++ printf (_(" Addr: 0x")); ++ printf_vma (section->sh_addr); ++ printf (_(" Offset: %#08lx Link: %u (%s)\n"), ++ (unsigned long) section->sh_offset, section->sh_link, ++ printable_section_name_from_index (filedata, section->sh_link)); ++ ++ edefs = (Elf_External_Verdef *) ++ get_data (NULL, filedata, section->sh_offset, 1,section->sh_size, ++ _("version definition section")); ++ if (!edefs) ++ break; ++ endbuf = (char *) edefs + section->sh_size; ++ ++ for (idx = cnt = 0; cnt < section->sh_info; ++cnt) ++ { ++ char * vstart; ++ Elf_External_Verdef * edef; ++ Elf_Internal_Verdef ent; ++ Elf_External_Verdaux * eaux; ++ Elf_Internal_Verdaux aux; ++ unsigned long isum; ++ int j; ++ ++ vstart = ((char *) edefs) + idx; ++ if (vstart + sizeof (*edef) > endbuf) ++ break; ++ ++ edef = (Elf_External_Verdef *) vstart; ++ ++ ent.vd_version = BYTE_GET (edef->vd_version); ++ ent.vd_flags = BYTE_GET (edef->vd_flags); ++ ent.vd_ndx = BYTE_GET (edef->vd_ndx); ++ ent.vd_cnt = BYTE_GET (edef->vd_cnt); ++ ent.vd_hash = BYTE_GET (edef->vd_hash); ++ ent.vd_aux = BYTE_GET (edef->vd_aux); ++ ent.vd_next = BYTE_GET (edef->vd_next); ++ ++ printf (_(" %#06lx: Rev: %d Flags: %s"), ++ idx, ent.vd_version, get_ver_flags (ent.vd_flags)); ++ ++ printf (_(" Index: %d Cnt: %d "), ++ ent.vd_ndx, ent.vd_cnt); ++ ++ /* Check for overflow. */ ++ if (ent.vd_aux > (size_t) (endbuf - vstart)) ++ break; ++ ++ vstart += ent.vd_aux; ++ ++ if (vstart + sizeof (*eaux) > endbuf) ++ break; ++ eaux = (Elf_External_Verdaux *) vstart; ++ ++ aux.vda_name = BYTE_GET (eaux->vda_name); ++ aux.vda_next = BYTE_GET (eaux->vda_next); ++ ++ if (VALID_DYNAMIC_NAME (filedata, aux.vda_name)) ++ printf (_("Name: %s\n"), ++ GET_DYNAMIC_NAME (filedata, aux.vda_name)); ++ else ++ printf (_("Name index: %ld\n"), aux.vda_name); ++ ++ isum = idx + ent.vd_aux; ++ ++ for (j = 1; j < ent.vd_cnt; j++) ++ { ++ if (aux.vda_next < sizeof (*eaux) ++ && !(j == ent.vd_cnt - 1 && aux.vda_next == 0)) ++ { ++ warn (_("Invalid vda_next field of %lx\n"), ++ aux.vda_next); ++ j = ent.vd_cnt; ++ break; ++ } ++ /* Check for overflow. */ ++ if (aux.vda_next > (size_t) (endbuf - vstart)) ++ break; ++ ++ isum += aux.vda_next; ++ vstart += aux.vda_next; ++ ++ if (vstart + sizeof (*eaux) > endbuf) ++ break; ++ eaux = (Elf_External_Verdaux *) vstart; ++ ++ aux.vda_name = BYTE_GET (eaux->vda_name); ++ aux.vda_next = BYTE_GET (eaux->vda_next); ++ ++ if (VALID_DYNAMIC_NAME (filedata, aux.vda_name)) ++ printf (_(" %#06lx: Parent %d: %s\n"), ++ isum, j, ++ GET_DYNAMIC_NAME (filedata, aux.vda_name)); ++ else ++ printf (_(" %#06lx: Parent %d, name index: %ld\n"), ++ isum, j, aux.vda_name); ++ } ++ ++ if (j < ent.vd_cnt) ++ printf (_(" Version def aux past end of section\n")); ++ ++ /* PR 17531: ++ file: id:000001,src:000172+005151,op:splice,rep:2. */ ++ if (ent.vd_next < sizeof (*edef) ++ && !(cnt == section->sh_info - 1 && ent.vd_next == 0)) ++ { ++ warn (_("Invalid vd_next field of %lx\n"), ent.vd_next); ++ cnt = section->sh_info; ++ break; ++ } ++ if (ent.vd_next > (size_t) (endbuf - ((char *) edefs + idx))) ++ break; ++ ++ idx += ent.vd_next; ++ } ++ ++ if (cnt < section->sh_info) ++ printf (_(" Version definition past end of section\n")); ++ ++ free (edefs); ++ } ++ break; ++ ++ case SHT_GNU_verneed: ++ { ++ Elf_External_Verneed * eneed; ++ unsigned long idx; ++ unsigned long cnt; ++ char * endbuf; ++ ++ found = TRUE; ++ ++ printf (ngettext ("\nVersion needs section '%s' " ++ "contains %u entry:\n", ++ "\nVersion needs section '%s' " ++ "contains %u entries:\n", ++ section->sh_info), ++ printable_section_name (filedata, section), section->sh_info); ++ ++ printf (_(" Addr: 0x")); ++ printf_vma (section->sh_addr); ++ printf (_(" Offset: %#08lx Link: %u (%s)\n"), ++ (unsigned long) section->sh_offset, section->sh_link, ++ printable_section_name_from_index (filedata, section->sh_link)); ++ ++ eneed = (Elf_External_Verneed *) get_data (NULL, filedata, ++ section->sh_offset, 1, ++ section->sh_size, ++ _("Version Needs section")); ++ if (!eneed) ++ break; ++ endbuf = (char *) eneed + section->sh_size; ++ ++ for (idx = cnt = 0; cnt < section->sh_info; ++cnt) ++ { ++ Elf_External_Verneed * entry; ++ Elf_Internal_Verneed ent; ++ unsigned long isum; ++ int j; ++ char * vstart; ++ ++ vstart = ((char *) eneed) + idx; ++ if (vstart + sizeof (*entry) > endbuf) ++ break; ++ ++ entry = (Elf_External_Verneed *) vstart; ++ ++ ent.vn_version = BYTE_GET (entry->vn_version); ++ ent.vn_cnt = BYTE_GET (entry->vn_cnt); ++ ent.vn_file = BYTE_GET (entry->vn_file); ++ ent.vn_aux = BYTE_GET (entry->vn_aux); ++ ent.vn_next = BYTE_GET (entry->vn_next); ++ ++ printf (_(" %#06lx: Version: %d"), idx, ent.vn_version); ++ ++ if (VALID_DYNAMIC_NAME (filedata, ent.vn_file)) ++ printf (_(" File: %s"), ++ GET_DYNAMIC_NAME (filedata, ent.vn_file)); ++ else ++ printf (_(" File: %lx"), ent.vn_file); ++ ++ printf (_(" Cnt: %d\n"), ent.vn_cnt); ++ ++ /* Check for overflow. */ ++ if (ent.vn_aux > (size_t) (endbuf - vstart)) ++ break; ++ vstart += ent.vn_aux; ++ ++ for (j = 0, isum = idx + ent.vn_aux; j < ent.vn_cnt; ++j) ++ { ++ Elf_External_Vernaux * eaux; ++ Elf_Internal_Vernaux aux; ++ ++ if (vstart + sizeof (*eaux) > endbuf) ++ break; ++ eaux = (Elf_External_Vernaux *) vstart; ++ ++ aux.vna_hash = BYTE_GET (eaux->vna_hash); ++ aux.vna_flags = BYTE_GET (eaux->vna_flags); ++ aux.vna_other = BYTE_GET (eaux->vna_other); ++ aux.vna_name = BYTE_GET (eaux->vna_name); ++ aux.vna_next = BYTE_GET (eaux->vna_next); ++ ++ if (VALID_DYNAMIC_NAME (filedata, aux.vna_name)) ++ printf (_(" %#06lx: Name: %s"), ++ isum, GET_DYNAMIC_NAME (filedata, aux.vna_name)); ++ else ++ printf (_(" %#06lx: Name index: %lx"), ++ isum, aux.vna_name); ++ ++ printf (_(" Flags: %s Version: %d\n"), ++ get_ver_flags (aux.vna_flags), aux.vna_other); ++ ++ if (aux.vna_next < sizeof (*eaux) ++ && !(j == ent.vn_cnt - 1 && aux.vna_next == 0)) ++ { ++ warn (_("Invalid vna_next field of %lx\n"), ++ aux.vna_next); ++ j = ent.vn_cnt; ++ break; ++ } ++ /* Check for overflow. */ ++ if (aux.vna_next > (size_t) (endbuf - vstart)) ++ break; ++ isum += aux.vna_next; ++ vstart += aux.vna_next; ++ } ++ ++ if (j < ent.vn_cnt) ++ warn (_("Missing Version Needs auxillary information\n")); ++ ++ if (ent.vn_next < sizeof (*entry) ++ && !(cnt == section->sh_info - 1 && ent.vn_next == 0)) ++ { ++ warn (_("Invalid vn_next field of %lx\n"), ent.vn_next); ++ cnt = section->sh_info; ++ break; ++ } ++ if (ent.vn_next > (size_t) (endbuf - ((char *) eneed + idx))) ++ break; ++ idx += ent.vn_next; ++ } ++ ++ if (cnt < section->sh_info) ++ warn (_("Missing Version Needs information\n")); ++ ++ free (eneed); ++ } ++ break; ++ ++ case SHT_GNU_versym: ++ { ++ Elf_Internal_Shdr * link_section; ++ size_t total; ++ unsigned int cnt; ++ unsigned char * edata; ++ unsigned short * data; ++ char * strtab; ++ Elf_Internal_Sym * symbols; ++ Elf_Internal_Shdr * string_sec; ++ unsigned long num_syms; ++ long off; ++ ++ if (section->sh_link >= filedata->file_header.e_shnum) ++ break; ++ ++ link_section = filedata->section_headers + section->sh_link; ++ total = section->sh_size / sizeof (Elf_External_Versym); ++ ++ if (link_section->sh_link >= filedata->file_header.e_shnum) ++ break; ++ ++ found = TRUE; ++ ++ symbols = GET_ELF_SYMBOLS (filedata, link_section, & num_syms); ++ if (symbols == NULL) ++ break; ++ ++ string_sec = filedata->section_headers + link_section->sh_link; ++ ++ strtab = (char *) get_data (NULL, filedata, string_sec->sh_offset, 1, ++ string_sec->sh_size, ++ _("version string table")); ++ if (!strtab) ++ { ++ free (symbols); ++ break; ++ } ++ ++ printf (ngettext ("\nVersion symbols section '%s' " ++ "contains %lu entry:\n", ++ "\nVersion symbols section '%s' " ++ "contains %lu entries:\n", ++ total), ++ printable_section_name (filedata, section), (unsigned long) total); ++ ++ printf (_(" Addr: 0x")); ++ printf_vma (section->sh_addr); ++ printf (_(" Offset: %#08lx Link: %u (%s)\n"), ++ (unsigned long) section->sh_offset, section->sh_link, ++ printable_section_name (filedata, link_section)); ++ ++ off = offset_from_vma (filedata, ++ filedata->version_info[DT_VERSIONTAGIDX (DT_VERSYM)], ++ total * sizeof (short)); ++ edata = (unsigned char *) get_data (NULL, filedata, off, ++ sizeof (short), total, ++ _("version symbol data")); ++ if (!edata) ++ { ++ free (strtab); ++ free (symbols); ++ break; ++ } ++ ++ data = (short unsigned int *) cmalloc (total, sizeof (short)); ++ ++ for (cnt = total; cnt --;) ++ data[cnt] = byte_get (edata + cnt * sizeof (short), ++ sizeof (short)); ++ ++ free (edata); ++ ++ for (cnt = 0; cnt < total; cnt += 4) ++ { ++ int j, nn; ++ char *name; ++ char *invalid = _("*invalid*"); ++ ++ printf (" %03x:", cnt); ++ ++ for (j = 0; (j < 4) && (cnt + j) < total; ++j) ++ switch (data[cnt + j]) ++ { ++ case 0: ++ fputs (_(" 0 (*local*) "), stdout); ++ break; ++ ++ case 1: ++ fputs (_(" 1 (*global*) "), stdout); ++ break; ++ ++ default: ++ nn = printf ("%4x%c", data[cnt + j] & VERSYM_VERSION, ++ data[cnt + j] & VERSYM_HIDDEN ? 'h' : ' '); ++ ++ /* If this index value is greater than the size of the symbols ++ array, break to avoid an out-of-bounds read. */ ++ if ((unsigned long)(cnt + j) >= num_syms) ++ { ++ warn (_("invalid index into symbol array\n")); ++ break; ++ } ++ ++ name = NULL; ++ if (filedata->version_info[DT_VERSIONTAGIDX (DT_VERNEED)]) ++ { ++ Elf_Internal_Verneed ivn; ++ unsigned long offset; ++ ++ offset = offset_from_vma ++ (filedata, ++ filedata->version_info[DT_VERSIONTAGIDX (DT_VERNEED)], ++ sizeof (Elf_External_Verneed)); ++ ++ do ++ { ++ Elf_Internal_Vernaux ivna; ++ Elf_External_Verneed evn; ++ Elf_External_Vernaux evna; ++ unsigned long a_off; ++ ++ if (get_data (&evn, filedata, offset, sizeof (evn), 1, ++ _("version need")) == NULL) ++ break; ++ ++ ivn.vn_aux = BYTE_GET (evn.vn_aux); ++ ivn.vn_next = BYTE_GET (evn.vn_next); ++ ++ a_off = offset + ivn.vn_aux; ++ ++ do ++ { ++ if (get_data (&evna, filedata, a_off, sizeof (evna), ++ 1, _("version need aux (2)")) == NULL) ++ { ++ ivna.vna_next = 0; ++ ivna.vna_other = 0; ++ } ++ else ++ { ++ ivna.vna_next = BYTE_GET (evna.vna_next); ++ ivna.vna_other = BYTE_GET (evna.vna_other); ++ } ++ ++ a_off += ivna.vna_next; ++ } ++ while (ivna.vna_other != data[cnt + j] ++ && ivna.vna_next != 0); ++ ++ if (ivna.vna_other == data[cnt + j]) ++ { ++ ivna.vna_name = BYTE_GET (evna.vna_name); ++ ++ if (ivna.vna_name >= string_sec->sh_size) ++ name = invalid; ++ else ++ name = strtab + ivna.vna_name; ++ break; ++ } ++ ++ offset += ivn.vn_next; ++ } ++ while (ivn.vn_next); ++ } ++ ++ if (data[cnt + j] != 0x8001 ++ && filedata->version_info[DT_VERSIONTAGIDX (DT_VERDEF)]) ++ { ++ Elf_Internal_Verdef ivd; ++ Elf_External_Verdef evd; ++ unsigned long offset; ++ ++ offset = offset_from_vma ++ (filedata, ++ filedata->version_info[DT_VERSIONTAGIDX (DT_VERDEF)], ++ sizeof evd); ++ ++ do ++ { ++ if (get_data (&evd, filedata, offset, sizeof (evd), 1, ++ _("version def")) == NULL) ++ { ++ ivd.vd_next = 0; ++ /* PR 17531: file: 046-1082287-0.004. */ ++ ivd.vd_ndx = (data[cnt + j] & VERSYM_VERSION) + 1; ++ break; ++ } ++ else ++ { ++ ivd.vd_next = BYTE_GET (evd.vd_next); ++ ivd.vd_ndx = BYTE_GET (evd.vd_ndx); ++ } ++ ++ offset += ivd.vd_next; ++ } ++ while (ivd.vd_ndx != (data[cnt + j] & VERSYM_VERSION) ++ && ivd.vd_next != 0); ++ ++ if (ivd.vd_ndx == (data[cnt + j] & VERSYM_VERSION)) ++ { ++ Elf_External_Verdaux evda; ++ Elf_Internal_Verdaux ivda; ++ ++ ivd.vd_aux = BYTE_GET (evd.vd_aux); ++ ++ if (get_data (&evda, filedata, ++ offset - ivd.vd_next + ivd.vd_aux, ++ sizeof (evda), 1, ++ _("version def aux")) == NULL) ++ break; ++ ++ ivda.vda_name = BYTE_GET (evda.vda_name); ++ ++ if (ivda.vda_name >= string_sec->sh_size) ++ name = invalid; ++ else if (name != NULL && name != invalid) ++ name = _("*both*"); ++ else ++ name = strtab + ivda.vda_name; ++ } ++ } ++ if (name != NULL) ++ nn += printf ("(%s%-*s", ++ name, ++ 12 - (int) strlen (name), ++ ")"); ++ ++ if (nn < 18) ++ printf ("%*c", 18 - nn, ' '); ++ } ++ ++ putchar ('\n'); ++ } ++ ++ free (data); ++ free (strtab); ++ free (symbols); ++ } ++ break; ++ ++ default: ++ break; ++ } ++ } ++ ++ if (! found) ++ printf (_("\nNo version information found in this file.\n")); ++ ++ return TRUE; ++} ++ ++static const char * ++get_symbol_binding (Filedata * filedata, unsigned int binding) ++{ ++ static char buff[64]; ++ ++ switch (binding) ++ { ++ case STB_LOCAL: return "LOCAL"; ++ case STB_GLOBAL: return "GLOBAL"; ++ case STB_WEAK: return "WEAK"; ++ default: ++ if (binding >= STB_LOPROC && binding <= STB_HIPROC) ++ snprintf (buff, sizeof (buff), _(": %d"), ++ binding); ++ else if (binding >= STB_LOOS && binding <= STB_HIOS) ++ { ++ if (binding == STB_GNU_UNIQUE ++ && filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_GNU) ++ return "UNIQUE"; ++ snprintf (buff, sizeof (buff), _(": %d"), binding); ++ } ++ else ++ snprintf (buff, sizeof (buff), _(": %d"), binding); ++ return buff; ++ } ++} ++ ++static const char * ++get_symbol_type (Filedata * filedata, unsigned int type) ++{ ++ static char buff[64]; ++ ++ switch (type) ++ { ++ case STT_NOTYPE: return "NOTYPE"; ++ case STT_OBJECT: return "OBJECT"; ++ case STT_FUNC: return "FUNC"; ++ case STT_SECTION: return "SECTION"; ++ case STT_FILE: return "FILE"; ++ case STT_COMMON: return "COMMON"; ++ case STT_TLS: return "TLS"; ++ case STT_RELC: return "RELC"; ++ case STT_SRELC: return "SRELC"; ++ default: ++ if (type >= STT_LOPROC && type <= STT_HIPROC) ++ { ++ if (filedata->file_header.e_machine == EM_ARM && type == STT_ARM_TFUNC) ++ return "THUMB_FUNC"; ++ ++ if (filedata->file_header.e_machine == EM_SPARCV9 && type == STT_REGISTER) ++ return "REGISTER"; ++ ++ if (filedata->file_header.e_machine == EM_PARISC && type == STT_PARISC_MILLI) ++ return "PARISC_MILLI"; ++ ++ snprintf (buff, sizeof (buff), _(": %d"), type); ++ } ++ else if (type >= STT_LOOS && type <= STT_HIOS) ++ { ++ if (filedata->file_header.e_machine == EM_PARISC) ++ { ++ if (type == STT_HP_OPAQUE) ++ return "HP_OPAQUE"; ++ if (type == STT_HP_STUB) ++ return "HP_STUB"; ++ } ++ ++ if (type == STT_GNU_IFUNC ++ && (filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_GNU ++ || filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_FREEBSD)) ++ return "IFUNC"; ++ ++ snprintf (buff, sizeof (buff), _(": %d"), type); ++ } ++ else ++ snprintf (buff, sizeof (buff), _(": %d"), type); ++ return buff; ++ } ++} ++ ++static const char * ++get_symbol_visibility (unsigned int visibility) ++{ ++ switch (visibility) ++ { ++ case STV_DEFAULT: return "DEFAULT"; ++ case STV_INTERNAL: return "INTERNAL"; ++ case STV_HIDDEN: return "HIDDEN"; ++ case STV_PROTECTED: return "PROTECTED"; ++ default: ++ error (_("Unrecognized visibility value: %u\n"), visibility); ++ return _(""); ++ } ++} ++ ++static const char * ++get_alpha_symbol_other (unsigned int other) ++{ ++ switch (other) ++ { ++ case STO_ALPHA_NOPV: return "NOPV"; ++ case STO_ALPHA_STD_GPLOAD: return "STD GPLOAD"; ++ default: ++ error (_("Unrecognized alpha specific other value: %u\n"), other); ++ return _(""); ++ } ++} ++ ++static const char * ++get_solaris_symbol_visibility (unsigned int visibility) ++{ ++ switch (visibility) ++ { ++ case 4: return "EXPORTED"; ++ case 5: return "SINGLETON"; ++ case 6: return "ELIMINATE"; ++ default: return get_symbol_visibility (visibility); ++ } ++} ++ ++static const char * ++get_aarch64_symbol_other (unsigned int other) ++{ ++ static char buf[32]; ++ ++ if (other & STO_AARCH64_VARIANT_PCS) ++ { ++ other &= ~STO_AARCH64_VARIANT_PCS; ++ if (other == 0) ++ return "VARIANT_PCS"; ++ snprintf (buf, sizeof buf, "VARIANT_PCS | %x", other); ++ return buf; ++ } ++ return NULL; ++} ++ ++static const char * ++get_mips_symbol_other (unsigned int other) ++{ ++ switch (other) ++ { ++ case STO_OPTIONAL: return "OPTIONAL"; ++ case STO_MIPS_PLT: return "MIPS PLT"; ++ case STO_MIPS_PIC: return "MIPS PIC"; ++ case STO_MICROMIPS: return "MICROMIPS"; ++ case STO_MICROMIPS | STO_MIPS_PIC: return "MICROMIPS, MIPS PIC"; ++ case STO_MIPS16: return "MIPS16"; ++ default: return NULL; ++ } ++} ++ ++static const char * ++get_ia64_symbol_other (Filedata * filedata, unsigned int other) ++{ ++ if (is_ia64_vms (filedata)) ++ { ++ static char res[32]; ++ ++ res[0] = 0; ++ ++ /* Function types is for images and .STB files only. */ ++ switch (filedata->file_header.e_type) ++ { ++ case ET_DYN: ++ case ET_EXEC: ++ switch (VMS_ST_FUNC_TYPE (other)) ++ { ++ case VMS_SFT_CODE_ADDR: ++ strcat (res, " CA"); ++ break; ++ case VMS_SFT_SYMV_IDX: ++ strcat (res, " VEC"); ++ break; ++ case VMS_SFT_FD: ++ strcat (res, " FD"); ++ break; ++ case VMS_SFT_RESERVE: ++ strcat (res, " RSV"); ++ break; ++ default: ++ warn (_("Unrecognized IA64 VMS ST Function type: %d\n"), ++ VMS_ST_FUNC_TYPE (other)); ++ strcat (res, " "); ++ break; ++ } ++ break; ++ default: ++ break; ++ } ++ switch (VMS_ST_LINKAGE (other)) ++ { ++ case VMS_STL_IGNORE: ++ strcat (res, " IGN"); ++ break; ++ case VMS_STL_RESERVE: ++ strcat (res, " RSV"); ++ break; ++ case VMS_STL_STD: ++ strcat (res, " STD"); ++ break; ++ case VMS_STL_LNK: ++ strcat (res, " LNK"); ++ break; ++ default: ++ warn (_("Unrecognized IA64 VMS ST Linkage: %d\n"), ++ VMS_ST_LINKAGE (other)); ++ strcat (res, " "); ++ break; ++ } ++ ++ if (res[0] != 0) ++ return res + 1; ++ else ++ return res; ++ } ++ return NULL; ++} ++ ++static const char * ++get_ppc64_symbol_other (unsigned int other) ++{ ++ if ((other & ~STO_PPC64_LOCAL_MASK) != 0) ++ return NULL; ++ ++ other >>= STO_PPC64_LOCAL_BIT; ++ if (other <= 6) ++ { ++ static char buf[64]; ++ if (other >= 2) ++ other = ppc64_decode_local_entry (other); ++ snprintf (buf, sizeof buf, _(": %d"), other); ++ return buf; ++ } ++ return NULL; ++} ++ ++static const char * ++get_symbol_other (Filedata * filedata, unsigned int other) ++{ ++ const char * result = NULL; ++ static char buff [64]; ++ ++ if (other == 0) ++ return ""; ++ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_ALPHA: ++ result = get_alpha_symbol_other (other); ++ break; ++ case EM_AARCH64: ++ result = get_aarch64_symbol_other (other); ++ break; ++ case EM_MIPS: ++ result = get_mips_symbol_other (other); ++ break; ++ case EM_IA_64: ++ result = get_ia64_symbol_other (filedata, other); ++ break; ++ case EM_PPC64: ++ result = get_ppc64_symbol_other (other); ++ break; ++ default: ++ result = NULL; ++ break; ++ } ++ ++ if (result) ++ return result; ++ ++ snprintf (buff, sizeof buff, _(": %x"), other); ++ return buff; ++} ++ ++static const char * ++get_symbol_index_type (Filedata * filedata, unsigned int type) ++{ ++ static char buff[32]; ++ ++ switch (type) ++ { ++ case SHN_UNDEF: return "UND"; ++ case SHN_ABS: return "ABS"; ++ case SHN_COMMON: return "COM"; ++ default: ++ if (type == SHN_IA_64_ANSI_COMMON ++ && filedata->file_header.e_machine == EM_IA_64 ++ && filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_HPUX) ++ return "ANSI_COM"; ++ else if ((filedata->file_header.e_machine == EM_X86_64 ++ || filedata->file_header.e_machine == EM_L1OM ++ || filedata->file_header.e_machine == EM_K1OM) ++ && type == SHN_X86_64_LCOMMON) ++ return "LARGE_COM"; ++ else if ((type == SHN_MIPS_SCOMMON ++ && filedata->file_header.e_machine == EM_MIPS) ++ || (type == SHN_TIC6X_SCOMMON ++ && filedata->file_header.e_machine == EM_TI_C6000)) ++ return "SCOM"; ++ else if (type == SHN_MIPS_SUNDEFINED ++ && filedata->file_header.e_machine == EM_MIPS) ++ return "SUND"; ++ else if (type >= SHN_LOPROC && type <= SHN_HIPROC) ++ sprintf (buff, "PRC[0x%04x]", type & 0xffff); ++ else if (type >= SHN_LOOS && type <= SHN_HIOS) ++ sprintf (buff, "OS [0x%04x]", type & 0xffff); ++ else if (type >= SHN_LORESERVE) ++ sprintf (buff, "RSV[0x%04x]", type & 0xffff); ++ else if (filedata->file_header.e_shnum != 0 ++ && type >= filedata->file_header.e_shnum) ++ sprintf (buff, _("bad section index[%3d]"), type); ++ else ++ sprintf (buff, "%3d", type); ++ break; ++ } ++ ++ return buff; ++} ++ ++static const char * ++get_symbol_version_string (Filedata * filedata, ++ bfd_boolean is_dynsym, ++ const char * strtab, ++ unsigned long int strtab_size, ++ unsigned int si, ++ Elf_Internal_Sym * psym, ++ enum versioned_symbol_info * sym_info, ++ unsigned short * vna_other) ++{ ++ unsigned char data[2]; ++ unsigned short vers_data; ++ unsigned long offset; ++ unsigned short max_vd_ndx; ++ ++ if (!is_dynsym ++ || filedata->version_info[DT_VERSIONTAGIDX (DT_VERSYM)] == 0) ++ return NULL; ++ ++ offset = offset_from_vma (filedata, ++ filedata->version_info[DT_VERSIONTAGIDX (DT_VERSYM)], ++ sizeof data + si * sizeof (vers_data)); ++ ++ if (get_data (&data, filedata, offset + si * sizeof (vers_data), ++ sizeof (data), 1, _("version data")) == NULL) ++ return NULL; ++ ++ vers_data = byte_get (data, 2); ++ ++ if ((vers_data & VERSYM_HIDDEN) == 0 && vers_data == 0) ++ return NULL; ++ ++ *sym_info = (vers_data & VERSYM_HIDDEN) != 0 ? symbol_hidden : symbol_public; ++ max_vd_ndx = 0; ++ ++ /* Usually we'd only see verdef for defined symbols, and verneed for ++ undefined symbols. However, symbols defined by the linker in ++ .dynbss for variables copied from a shared library in order to ++ avoid text relocations are defined yet have verneed. We could ++ use a heuristic to detect the special case, for example, check ++ for verneed first on symbols defined in SHT_NOBITS sections, but ++ it is simpler and more reliable to just look for both verdef and ++ verneed. .dynbss might not be mapped to a SHT_NOBITS section. */ ++ ++ if (psym->st_shndx != SHN_UNDEF ++ && vers_data != 0x8001 ++ && filedata->version_info[DT_VERSIONTAGIDX (DT_VERDEF)]) ++ { ++ Elf_Internal_Verdef ivd; ++ Elf_Internal_Verdaux ivda; ++ Elf_External_Verdaux evda; ++ unsigned long off; ++ ++ off = offset_from_vma (filedata, ++ filedata->version_info[DT_VERSIONTAGIDX (DT_VERDEF)], ++ sizeof (Elf_External_Verdef)); ++ ++ do ++ { ++ Elf_External_Verdef evd; ++ ++ if (get_data (&evd, filedata, off, sizeof (evd), 1, ++ _("version def")) == NULL) ++ { ++ ivd.vd_ndx = 0; ++ ivd.vd_aux = 0; ++ ivd.vd_next = 0; ++ ivd.vd_flags = 0; ++ } ++ else ++ { ++ ivd.vd_ndx = BYTE_GET (evd.vd_ndx); ++ ivd.vd_aux = BYTE_GET (evd.vd_aux); ++ ivd.vd_next = BYTE_GET (evd.vd_next); ++ ivd.vd_flags = BYTE_GET (evd.vd_flags); ++ } ++ ++ if ((ivd.vd_ndx & VERSYM_VERSION) > max_vd_ndx) ++ max_vd_ndx = ivd.vd_ndx & VERSYM_VERSION; ++ ++ off += ivd.vd_next; ++ } ++ while (ivd.vd_ndx != (vers_data & VERSYM_VERSION) && ivd.vd_next != 0); ++ ++ if (ivd.vd_ndx == (vers_data & VERSYM_VERSION)) ++ { ++ if (ivd.vd_ndx == 1 && ivd.vd_flags == VER_FLG_BASE) ++ return NULL; ++ ++ off -= ivd.vd_next; ++ off += ivd.vd_aux; ++ ++ if (get_data (&evda, filedata, off, sizeof (evda), 1, ++ _("version def aux")) != NULL) ++ { ++ ivda.vda_name = BYTE_GET (evda.vda_name); ++ ++ if (psym->st_name != ivda.vda_name) ++ return (ivda.vda_name < strtab_size ++ ? strtab + ivda.vda_name : _("")); ++ } ++ } ++ } ++ ++ if (filedata->version_info[DT_VERSIONTAGIDX (DT_VERNEED)]) ++ { ++ Elf_External_Verneed evn; ++ Elf_Internal_Verneed ivn; ++ Elf_Internal_Vernaux ivna; ++ ++ offset = offset_from_vma (filedata, ++ filedata->version_info[DT_VERSIONTAGIDX (DT_VERNEED)], ++ sizeof evn); ++ do ++ { ++ unsigned long vna_off; ++ ++ if (get_data (&evn, filedata, offset, sizeof (evn), 1, ++ _("version need")) == NULL) ++ { ++ ivna.vna_next = 0; ++ ivna.vna_other = 0; ++ ivna.vna_name = 0; ++ break; ++ } ++ ++ ivn.vn_aux = BYTE_GET (evn.vn_aux); ++ ivn.vn_next = BYTE_GET (evn.vn_next); ++ ++ vna_off = offset + ivn.vn_aux; ++ ++ do ++ { ++ Elf_External_Vernaux evna; ++ ++ if (get_data (&evna, filedata, vna_off, sizeof (evna), 1, ++ _("version need aux (3)")) == NULL) ++ { ++ ivna.vna_next = 0; ++ ivna.vna_other = 0; ++ ivna.vna_name = 0; ++ } ++ else ++ { ++ ivna.vna_other = BYTE_GET (evna.vna_other); ++ ivna.vna_next = BYTE_GET (evna.vna_next); ++ ivna.vna_name = BYTE_GET (evna.vna_name); ++ } ++ ++ vna_off += ivna.vna_next; ++ } ++ while (ivna.vna_other != vers_data && ivna.vna_next != 0); ++ ++ if (ivna.vna_other == vers_data) ++ break; ++ ++ offset += ivn.vn_next; ++ } ++ while (ivn.vn_next != 0); ++ ++ if (ivna.vna_other == vers_data) ++ { ++ *sym_info = symbol_undefined; ++ *vna_other = ivna.vna_other; ++ return (ivna.vna_name < strtab_size ++ ? strtab + ivna.vna_name : _("")); ++ } ++ else if ((max_vd_ndx || (vers_data & VERSYM_VERSION) != 1) ++ && (vers_data & VERSYM_VERSION) > max_vd_ndx) ++ return _(""); ++ } ++ return NULL; ++} ++ ++static void ++print_dynamic_symbol (Filedata *filedata, unsigned long si, ++ Elf_Internal_Sym *symtab, ++ Elf_Internal_Shdr *section, ++ char *strtab, size_t strtab_size) ++{ ++ const char *version_string; ++ enum versioned_symbol_info sym_info; ++ unsigned short vna_other; ++ Elf_Internal_Sym *psym = symtab + si; ++ ++ printf ("%6ld: ", si); ++ print_vma (psym->st_value, LONG_HEX); ++ putchar (' '); ++ print_vma (psym->st_size, DEC_5); ++ printf (" %-7s", get_symbol_type (filedata, ELF_ST_TYPE (psym->st_info))); ++ printf (" %-6s", get_symbol_binding (filedata, ELF_ST_BIND (psym->st_info))); ++ if (filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_SOLARIS) ++ printf (" %-7s", get_solaris_symbol_visibility (psym->st_other)); ++ else ++ { ++ unsigned int vis = ELF_ST_VISIBILITY (psym->st_other); ++ ++ printf (" %-7s", get_symbol_visibility (vis)); ++#if 0 ++ /* Check to see if any other bits in the st_other field are set. ++ Note - displaying this information disrupts the layout of the ++ table being generated, but for the moment this case is very rare. */ ++ if (psym->st_other ^ vis) ++ printf (" [%s] ", get_symbol_other (filedata, psym->st_other ^ vis)); ++#endif ++ } ++ printf (" %4s ", get_symbol_index_type (filedata, psym->st_shndx)); ++ ++ bfd_boolean is_valid = VALID_SYMBOL_NAME (strtab, strtab_size, ++ psym->st_name); ++ const char * sstr = is_valid ? strtab + psym->st_name : _(""); ++ ++ version_string ++ = get_symbol_version_string (filedata, ++ (section == NULL ++ || section->sh_type == SHT_DYNSYM), ++ strtab, strtab_size, si, ++ psym, &sym_info, &vna_other); ++ ++ int len_avail = 21; ++ if (! do_wide && version_string != NULL) ++ { ++ char buffer[16]; ++ ++ len_avail -= 1 + strlen (version_string); ++ ++ if (sym_info == symbol_undefined) ++ len_avail -= sprintf (buffer," (%d)", vna_other); ++ else if (sym_info != symbol_hidden) ++ len_avail -= 1; ++ } ++ ++ print_symbol (len_avail, sstr); ++ ++ if (version_string) ++ { ++ if (sym_info == symbol_undefined) ++ printf ("@%s (%d)", version_string, vna_other); ++ else ++ printf (sym_info == symbol_hidden ? "@%s" : "@@%s", ++ version_string); ++ } ++ ++#if 1 ++ { ++ unsigned int vis = ELF_ST_VISIBILITY (psym->st_other); ++ ++ /* Check to see if any other bits in the st_other field are set. */ ++ if (psym->st_other ^ vis) ++ printf (" \t[%s]", get_symbol_other (filedata, psym->st_other ^ vis)); ++ } ++#endif ++ ++ putchar ('\n'); ++ ++ if (ELF_ST_BIND (psym->st_info) == STB_LOCAL ++ && section != NULL ++ && si >= section->sh_info ++ /* Irix 5 and 6 MIPS binaries are known to ignore this requirement. */ ++ && filedata->file_header.e_machine != EM_MIPS ++ /* Solaris binaries have been found to violate this requirement as ++ well. Not sure if this is a bug or an ABI requirement. */ ++ && filedata->file_header.e_ident[EI_OSABI] != ELFOSABI_SOLARIS) ++ warn (_("local symbol %lu found at index >= %s's sh_info value of %u\n"), ++ si, printable_section_name (filedata, section), section->sh_info); ++} ++ ++/* Dump the symbol table. */ ++static bfd_boolean ++process_symbol_table (Filedata * filedata) ++{ ++ Elf_Internal_Shdr * section; ++ ++ if (!do_syms && !do_dyn_syms && !do_histogram) ++ return TRUE; ++ ++ if ((filedata->dynamic_info[DT_HASH] || filedata->dynamic_info_DT_GNU_HASH) ++ && do_syms ++ && do_using_dynamic ++ && filedata->dynamic_strings != NULL ++ && filedata->dynamic_symbols != NULL) ++ { ++ unsigned long si; ++ ++ printf (ngettext ("\nSymbol table for image contains %lu entry:\n", ++ "\nSymbol table for image contains %lu entries:\n", ++ filedata->num_dynamic_syms), ++ filedata->num_dynamic_syms); ++ if (is_32bit_elf) ++ printf (_(" Num: Value Size Type Bind Vis Ndx Name\n")); ++ else ++ printf (_(" Num: Value Size Type Bind Vis Ndx Name\n")); ++ ++ for (si = 0; si < filedata->num_dynamic_syms; si++) ++ print_dynamic_symbol (filedata, si, filedata->dynamic_symbols, NULL, ++ filedata->dynamic_strings, ++ filedata->dynamic_strings_length); ++ } ++ else if ((do_dyn_syms || (do_syms && !do_using_dynamic)) ++ && filedata->section_headers != NULL) ++ { ++ unsigned int i; ++ ++ for (i = 0, section = filedata->section_headers; ++ i < filedata->file_header.e_shnum; ++ i++, section++) ++ { ++ char * strtab = NULL; ++ unsigned long int strtab_size = 0; ++ Elf_Internal_Sym * symtab; ++ unsigned long si, num_syms; ++ ++ if ((section->sh_type != SHT_SYMTAB ++ && section->sh_type != SHT_DYNSYM) ++ || (!do_syms ++ && section->sh_type == SHT_SYMTAB)) ++ continue; ++ ++ if (section->sh_entsize == 0) ++ { ++ printf (_("\nSymbol table '%s' has a sh_entsize of zero!\n"), ++ printable_section_name (filedata, section)); ++ continue; ++ } ++ ++ num_syms = section->sh_size / section->sh_entsize; ++ printf (ngettext ("\nSymbol table '%s' contains %lu entry:\n", ++ "\nSymbol table '%s' contains %lu entries:\n", ++ num_syms), ++ printable_section_name (filedata, section), ++ num_syms); ++ ++ if (is_32bit_elf) ++ printf (_(" Num: Value Size Type Bind Vis Ndx Name\n")); ++ else ++ printf (_(" Num: Value Size Type Bind Vis Ndx Name\n")); ++ ++ symtab = GET_ELF_SYMBOLS (filedata, section, & num_syms); ++ if (symtab == NULL) ++ continue; ++ ++ if (section->sh_link == filedata->file_header.e_shstrndx) ++ { ++ strtab = filedata->string_table; ++ strtab_size = filedata->string_table_length; ++ } ++ else if (section->sh_link < filedata->file_header.e_shnum) ++ { ++ Elf_Internal_Shdr * string_sec; ++ ++ string_sec = filedata->section_headers + section->sh_link; ++ ++ strtab = (char *) get_data (NULL, filedata, string_sec->sh_offset, ++ 1, string_sec->sh_size, ++ _("string table")); ++ strtab_size = strtab != NULL ? string_sec->sh_size : 0; ++ } ++ ++ for (si = 0; si < num_syms; si++) ++ print_dynamic_symbol (filedata, si, symtab, section, ++ strtab, strtab_size); ++ ++ free (symtab); ++ if (strtab != filedata->string_table) ++ free (strtab); ++ } ++ } ++ else if (do_syms) ++ printf ++ (_("\nDynamic symbol information is not available for displaying symbols.\n")); ++ ++ if (do_histogram && filedata->buckets != NULL) ++ { ++ unsigned long * lengths; ++ unsigned long * counts; ++ unsigned long hn; ++ bfd_vma si; ++ unsigned long maxlength = 0; ++ unsigned long nzero_counts = 0; ++ unsigned long nsyms = 0; ++ char *visited; ++ ++ printf (ngettext ("\nHistogram for bucket list length " ++ "(total of %lu bucket):\n", ++ "\nHistogram for bucket list length " ++ "(total of %lu buckets):\n", ++ (unsigned long) filedata->nbuckets), ++ (unsigned long) filedata->nbuckets); ++ ++ lengths = (unsigned long *) calloc (filedata->nbuckets, ++ sizeof (*lengths)); ++ if (lengths == NULL) ++ { ++ error (_("Out of memory allocating space for histogram buckets\n")); ++ goto err_out; ++ } ++ visited = xcmalloc (filedata->nchains, 1); ++ memset (visited, 0, filedata->nchains); ++ ++ printf (_(" Length Number %% of total Coverage\n")); ++ for (hn = 0; hn < filedata->nbuckets; ++hn) ++ { ++ for (si = filedata->buckets[hn]; si > 0; si = filedata->chains[si]) ++ { ++ ++nsyms; ++ if (maxlength < ++lengths[hn]) ++ ++maxlength; ++ if (si >= filedata->nchains || visited[si]) ++ { ++ error (_("histogram chain is corrupt\n")); ++ break; ++ } ++ visited[si] = 1; ++ } ++ } ++ free (visited); ++ ++ counts = (unsigned long *) calloc (maxlength + 1, sizeof (*counts)); ++ if (counts == NULL) ++ { ++ free (lengths); ++ error (_("Out of memory allocating space for histogram counts\n")); ++ goto err_out; ++ } ++ ++ for (hn = 0; hn < filedata->nbuckets; ++hn) ++ ++counts[lengths[hn]]; ++ ++ if (filedata->nbuckets > 0) ++ { ++ unsigned long i; ++ printf (" 0 %-10lu (%5.1f%%)\n", ++ counts[0], (counts[0] * 100.0) / filedata->nbuckets); ++ for (i = 1; i <= maxlength; ++i) ++ { ++ nzero_counts += counts[i] * i; ++ printf ("%7lu %-10lu (%5.1f%%) %5.1f%%\n", ++ i, counts[i], (counts[i] * 100.0) / filedata->nbuckets, ++ (nzero_counts * 100.0) / nsyms); ++ } ++ } ++ ++ free (counts); ++ free (lengths); ++ } ++ ++ free (filedata->buckets); ++ filedata->buckets = NULL; ++ filedata->nbuckets = 0; ++ free (filedata->chains); ++ filedata->chains = NULL; ++ ++ if (do_histogram && filedata->gnubuckets != NULL) ++ { ++ unsigned long * lengths; ++ unsigned long * counts; ++ unsigned long hn; ++ unsigned long maxlength = 0; ++ unsigned long nzero_counts = 0; ++ unsigned long nsyms = 0; ++ ++ printf (ngettext ("\nHistogram for `%s' bucket list length " ++ "(total of %lu bucket):\n", ++ "\nHistogram for `%s' bucket list length " ++ "(total of %lu buckets):\n", ++ (unsigned long) filedata->ngnubuckets), ++ GNU_HASH_SECTION_NAME (filedata), ++ (unsigned long) filedata->ngnubuckets); ++ ++ lengths = (unsigned long *) calloc (filedata->ngnubuckets, ++ sizeof (*lengths)); ++ if (lengths == NULL) ++ { ++ error (_("Out of memory allocating space for gnu histogram buckets\n")); ++ goto err_out; ++ } ++ ++ printf (_(" Length Number %% of total Coverage\n")); ++ ++ for (hn = 0; hn < filedata->ngnubuckets; ++hn) ++ if (filedata->gnubuckets[hn] != 0) ++ { ++ bfd_vma off, length = 1; ++ ++ for (off = filedata->gnubuckets[hn] - filedata->gnusymidx; ++ /* PR 17531 file: 010-77222-0.004. */ ++ off < filedata->ngnuchains ++ && (filedata->gnuchains[off] & 1) == 0; ++ ++off) ++ ++length; ++ lengths[hn] = length; ++ if (length > maxlength) ++ maxlength = length; ++ nsyms += length; ++ } ++ ++ counts = (unsigned long *) calloc (maxlength + 1, sizeof (*counts)); ++ if (counts == NULL) ++ { ++ free (lengths); ++ error (_("Out of memory allocating space for gnu histogram counts\n")); ++ goto err_out; ++ } ++ ++ for (hn = 0; hn < filedata->ngnubuckets; ++hn) ++ ++counts[lengths[hn]]; ++ ++ if (filedata->ngnubuckets > 0) ++ { ++ unsigned long j; ++ printf (" 0 %-10lu (%5.1f%%)\n", ++ counts[0], (counts[0] * 100.0) / filedata->ngnubuckets); ++ for (j = 1; j <= maxlength; ++j) ++ { ++ nzero_counts += counts[j] * j; ++ printf ("%7lu %-10lu (%5.1f%%) %5.1f%%\n", ++ j, counts[j], (counts[j] * 100.0) / filedata->ngnubuckets, ++ (nzero_counts * 100.0) / nsyms); ++ } ++ } ++ ++ free (counts); ++ free (lengths); ++ } ++ free (filedata->gnubuckets); ++ filedata->gnubuckets = NULL; ++ filedata->ngnubuckets = 0; ++ free (filedata->gnuchains); ++ filedata->gnuchains = NULL; ++ filedata->ngnuchains = 0; ++ free (filedata->mipsxlat); ++ filedata->mipsxlat = NULL; ++ return TRUE; ++ ++ err_out: ++ free (filedata->gnubuckets); ++ filedata->gnubuckets = NULL; ++ filedata->ngnubuckets = 0; ++ free (filedata->gnuchains); ++ filedata->gnuchains = NULL; ++ filedata->ngnuchains = 0; ++ free (filedata->mipsxlat); ++ filedata->mipsxlat = NULL; ++ free (filedata->buckets); ++ filedata->buckets = NULL; ++ filedata->nbuckets = 0; ++ free (filedata->chains); ++ filedata->chains = NULL; ++ return FALSE; ++} ++ ++static bfd_boolean ++process_syminfo (Filedata * filedata ATTRIBUTE_UNUSED) ++{ ++ unsigned int i; ++ ++ if (filedata->dynamic_syminfo == NULL ++ || !do_dynamic) ++ /* No syminfo, this is ok. */ ++ return TRUE; ++ ++ /* There better should be a dynamic symbol section. */ ++ if (filedata->dynamic_symbols == NULL || filedata->dynamic_strings == NULL) ++ return FALSE; ++ ++ if (filedata->dynamic_addr) ++ printf (ngettext ("\nDynamic info segment at offset 0x%lx " ++ "contains %d entry:\n", ++ "\nDynamic info segment at offset 0x%lx " ++ "contains %d entries:\n", ++ filedata->dynamic_syminfo_nent), ++ filedata->dynamic_syminfo_offset, filedata->dynamic_syminfo_nent); ++ ++ printf (_(" Num: Name BoundTo Flags\n")); ++ for (i = 0; i < filedata->dynamic_syminfo_nent; ++i) ++ { ++ unsigned short int flags = filedata->dynamic_syminfo[i].si_flags; ++ ++ printf ("%4d: ", i); ++ if (i >= filedata->num_dynamic_syms) ++ printf (_("")); ++ else if (VALID_DYNAMIC_NAME (filedata, filedata->dynamic_symbols[i].st_name)) ++ print_symbol (30, GET_DYNAMIC_NAME (filedata, ++ filedata->dynamic_symbols[i].st_name)); ++ else ++ printf (_(""), filedata->dynamic_symbols[i].st_name); ++ putchar (' '); ++ ++ switch (filedata->dynamic_syminfo[i].si_boundto) ++ { ++ case SYMINFO_BT_SELF: ++ fputs ("SELF ", stdout); ++ break; ++ case SYMINFO_BT_PARENT: ++ fputs ("PARENT ", stdout); ++ break; ++ default: ++ if (filedata->dynamic_syminfo[i].si_boundto > 0 ++ && filedata->dynamic_syminfo[i].si_boundto < filedata->dynamic_nent ++ && VALID_DYNAMIC_NAME (filedata, ++ filedata->dynamic_section[filedata->dynamic_syminfo[i].si_boundto].d_un.d_val)) ++ { ++ print_symbol (10, GET_DYNAMIC_NAME (filedata, ++ filedata->dynamic_section[filedata->dynamic_syminfo[i].si_boundto].d_un.d_val)); ++ putchar (' ' ); ++ } ++ else ++ printf ("%-10d ", filedata->dynamic_syminfo[i].si_boundto); ++ break; ++ } ++ ++ if (flags & SYMINFO_FLG_DIRECT) ++ printf (" DIRECT"); ++ if (flags & SYMINFO_FLG_PASSTHRU) ++ printf (" PASSTHRU"); ++ if (flags & SYMINFO_FLG_COPY) ++ printf (" COPY"); ++ if (flags & SYMINFO_FLG_LAZYLOAD) ++ printf (" LAZYLOAD"); ++ ++ puts (""); ++ } ++ ++ return TRUE; ++} ++ ++/* A macro which evaluates to TRUE if the region ADDR .. ADDR + NELEM ++ is contained by the region START .. END. The types of ADDR, START ++ and END should all be the same. Note both ADDR + NELEM and END ++ point to just beyond the end of the regions that are being tested. */ ++#define IN_RANGE(START,END,ADDR,NELEM) \ ++ (((ADDR) >= (START)) && ((ADDR) < (END)) && ((ADDR) + (NELEM) <= (END))) ++ ++/* Check to see if the given reloc needs to be handled in a target specific ++ manner. If so then process the reloc and return TRUE otherwise return ++ FALSE. ++ ++ If called with reloc == NULL, then this is a signal that reloc processing ++ for the current section has finished, and any saved state should be ++ discarded. */ ++ ++static bfd_boolean ++target_specific_reloc_handling (Filedata * filedata, ++ Elf_Internal_Rela * reloc, ++ unsigned char * start, ++ unsigned char * end, ++ Elf_Internal_Sym * symtab, ++ unsigned long num_syms) ++{ ++ unsigned int reloc_type = 0; ++ unsigned long sym_index = 0; ++ ++ if (reloc) ++ { ++ reloc_type = get_reloc_type (filedata, reloc->r_info); ++ sym_index = get_reloc_symindex (reloc->r_info); ++ } ++ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_MSP430: ++ case EM_MSP430_OLD: ++ { ++ static Elf_Internal_Sym * saved_sym = NULL; ++ ++ if (reloc == NULL) ++ { ++ saved_sym = NULL; ++ return TRUE; ++ } ++ ++ switch (reloc_type) ++ { ++ case 10: /* R_MSP430_SYM_DIFF */ ++ if (uses_msp430x_relocs (filedata)) ++ break; ++ /* Fall through. */ ++ case 21: /* R_MSP430X_SYM_DIFF */ ++ /* PR 21139. */ ++ if (sym_index >= num_syms) ++ error (_("MSP430 SYM_DIFF reloc contains invalid symbol index %lu\n"), ++ sym_index); ++ else ++ saved_sym = symtab + sym_index; ++ return TRUE; ++ ++ case 1: /* R_MSP430_32 or R_MSP430_ABS32 */ ++ case 3: /* R_MSP430_16 or R_MSP430_ABS8 */ ++ goto handle_sym_diff; ++ ++ case 5: /* R_MSP430_16_BYTE */ ++ case 9: /* R_MSP430_8 */ ++ if (uses_msp430x_relocs (filedata)) ++ break; ++ goto handle_sym_diff; ++ ++ case 2: /* R_MSP430_ABS16 */ ++ case 15: /* R_MSP430X_ABS16 */ ++ if (! uses_msp430x_relocs (filedata)) ++ break; ++ goto handle_sym_diff; ++ ++ handle_sym_diff: ++ if (saved_sym != NULL) ++ { ++ int reloc_size = reloc_type == 1 ? 4 : 2; ++ bfd_vma value; ++ ++ if (sym_index >= num_syms) ++ error (_("MSP430 reloc contains invalid symbol index %lu\n"), ++ sym_index); ++ else ++ { ++ value = reloc->r_addend + (symtab[sym_index].st_value ++ - saved_sym->st_value); ++ ++ if (IN_RANGE (start, end, start + reloc->r_offset, reloc_size)) ++ byte_put (start + reloc->r_offset, value, reloc_size); ++ else ++ /* PR 21137 */ ++ error (_("MSP430 sym diff reloc contains invalid offset: 0x%lx\n"), ++ (long) reloc->r_offset); ++ } ++ ++ saved_sym = NULL; ++ return TRUE; ++ } ++ break; ++ ++ default: ++ if (saved_sym != NULL) ++ error (_("Unhandled MSP430 reloc type found after SYM_DIFF reloc\n")); ++ break; ++ } ++ break; ++ } ++ ++ case EM_MN10300: ++ case EM_CYGNUS_MN10300: ++ { ++ static Elf_Internal_Sym * saved_sym = NULL; ++ ++ if (reloc == NULL) ++ { ++ saved_sym = NULL; ++ return TRUE; ++ } ++ ++ switch (reloc_type) ++ { ++ case 34: /* R_MN10300_ALIGN */ ++ return TRUE; ++ case 33: /* R_MN10300_SYM_DIFF */ ++ if (sym_index >= num_syms) ++ error (_("MN10300_SYM_DIFF reloc contains invalid symbol index %lu\n"), ++ sym_index); ++ else ++ saved_sym = symtab + sym_index; ++ return TRUE; ++ ++ case 1: /* R_MN10300_32 */ ++ case 2: /* R_MN10300_16 */ ++ if (saved_sym != NULL) ++ { ++ int reloc_size = reloc_type == 1 ? 4 : 2; ++ bfd_vma value; ++ ++ if (sym_index >= num_syms) ++ error (_("MN10300 reloc contains invalid symbol index %lu\n"), ++ sym_index); ++ else ++ { ++ value = reloc->r_addend + (symtab[sym_index].st_value ++ - saved_sym->st_value); ++ ++ if (IN_RANGE (start, end, start + reloc->r_offset, reloc_size)) ++ byte_put (start + reloc->r_offset, value, reloc_size); ++ else ++ error (_("MN10300 sym diff reloc contains invalid offset: 0x%lx\n"), ++ (long) reloc->r_offset); ++ } ++ ++ saved_sym = NULL; ++ return TRUE; ++ } ++ break; ++ default: ++ if (saved_sym != NULL) ++ error (_("Unhandled MN10300 reloc type found after SYM_DIFF reloc\n")); ++ break; ++ } ++ break; ++ } ++ ++ case EM_RL78: ++ { ++ static bfd_vma saved_sym1 = 0; ++ static bfd_vma saved_sym2 = 0; ++ static bfd_vma value; ++ ++ if (reloc == NULL) ++ { ++ saved_sym1 = saved_sym2 = 0; ++ return TRUE; ++ } ++ ++ switch (reloc_type) ++ { ++ case 0x80: /* R_RL78_SYM. */ ++ saved_sym1 = saved_sym2; ++ if (sym_index >= num_syms) ++ error (_("RL78_SYM reloc contains invalid symbol index %lu\n"), ++ sym_index); ++ else ++ { ++ saved_sym2 = symtab[sym_index].st_value; ++ saved_sym2 += reloc->r_addend; ++ } ++ return TRUE; ++ ++ case 0x83: /* R_RL78_OPsub. */ ++ value = saved_sym1 - saved_sym2; ++ saved_sym2 = saved_sym1 = 0; ++ return TRUE; ++ break; ++ ++ case 0x41: /* R_RL78_ABS32. */ ++ if (IN_RANGE (start, end, start + reloc->r_offset, 4)) ++ byte_put (start + reloc->r_offset, value, 4); ++ else ++ error (_("RL78 sym diff reloc contains invalid offset: 0x%lx\n"), ++ (long) reloc->r_offset); ++ value = 0; ++ return TRUE; ++ ++ case 0x43: /* R_RL78_ABS16. */ ++ if (IN_RANGE (start, end, start + reloc->r_offset, 2)) ++ byte_put (start + reloc->r_offset, value, 2); ++ else ++ error (_("RL78 sym diff reloc contains invalid offset: 0x%lx\n"), ++ (long) reloc->r_offset); ++ value = 0; ++ return TRUE; ++ ++ default: ++ break; ++ } ++ break; ++ } ++ } ++ ++ return FALSE; ++} ++ ++/* Returns TRUE iff RELOC_TYPE is a 32-bit absolute RELA relocation used in ++ DWARF debug sections. This is a target specific test. Note - we do not ++ go through the whole including-target-headers-multiple-times route, (as ++ we have already done with ) because this would become very ++ messy and even then this function would have to contain target specific ++ information (the names of the relocs instead of their numeric values). ++ FIXME: This is not the correct way to solve this problem. The proper way ++ is to have target specific reloc sizing and typing functions created by ++ the reloc-macros.h header, in the same way that it already creates the ++ reloc naming functions. */ ++ ++static bfd_boolean ++is_32bit_abs_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ /* Please keep this table alpha-sorted for ease of visual lookup. */ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_386: ++ case EM_IAMCU: ++ return reloc_type == 1; /* R_386_32. */ ++ case EM_68K: ++ return reloc_type == 1; /* R_68K_32. */ ++ case EM_860: ++ return reloc_type == 1; /* R_860_32. */ ++ case EM_960: ++ return reloc_type == 2; /* R_960_32. */ ++ case EM_AARCH64: ++ return (reloc_type == 258 ++ || reloc_type == 1); /* R_AARCH64_ABS32 || R_AARCH64_P32_ABS32 */ ++ case EM_BPF: ++ return reloc_type == 11; /* R_BPF_DATA_32 */ ++ case EM_ADAPTEVA_EPIPHANY: ++ return reloc_type == 3; ++ case EM_ALPHA: ++ return reloc_type == 1; /* R_ALPHA_REFLONG. */ ++ case EM_ARC: ++ return reloc_type == 1; /* R_ARC_32. */ ++ case EM_ARC_COMPACT: ++ case EM_ARC_COMPACT2: ++ return reloc_type == 4; /* R_ARC_32. */ ++ case EM_ARM: ++ return reloc_type == 2; /* R_ARM_ABS32 */ ++ case EM_AVR_OLD: ++ case EM_AVR: ++ return reloc_type == 1; ++ case EM_BLACKFIN: ++ return reloc_type == 0x12; /* R_byte4_data. */ ++ case EM_CRIS: ++ return reloc_type == 3; /* R_CRIS_32. */ ++ case EM_CR16: ++ return reloc_type == 3; /* R_CR16_NUM32. */ ++ case EM_CRX: ++ return reloc_type == 15; /* R_CRX_NUM32. */ ++ case EM_CSKY: ++ return reloc_type == 1; /* R_CKCORE_ADDR32. */ ++ case EM_CYGNUS_FRV: ++ return reloc_type == 1; ++ case EM_CYGNUS_D10V: ++ case EM_D10V: ++ return reloc_type == 6; /* R_D10V_32. */ ++ case EM_CYGNUS_D30V: ++ case EM_D30V: ++ return reloc_type == 12; /* R_D30V_32_NORMAL. */ ++ case EM_DLX: ++ return reloc_type == 3; /* R_DLX_RELOC_32. */ ++ case EM_CYGNUS_FR30: ++ case EM_FR30: ++ return reloc_type == 3; /* R_FR30_32. */ ++ case EM_FT32: ++ return reloc_type == 1; /* R_FT32_32. */ ++ case EM_H8S: ++ case EM_H8_300: ++ case EM_H8_300H: ++ return reloc_type == 1; /* R_H8_DIR32. */ ++ case EM_IA_64: ++ return (reloc_type == 0x64 /* R_IA64_SECREL32MSB. */ ++ || reloc_type == 0x65 /* R_IA64_SECREL32LSB. */ ++ || reloc_type == 0x24 /* R_IA64_DIR32MSB. */ ++ || reloc_type == 0x25 /* R_IA64_DIR32LSB. */); ++ case EM_IP2K_OLD: ++ case EM_IP2K: ++ return reloc_type == 2; /* R_IP2K_32. */ ++ case EM_IQ2000: ++ return reloc_type == 2; /* R_IQ2000_32. */ ++ case EM_LATTICEMICO32: ++ return reloc_type == 3; /* R_LM32_32. */ ++ case EM_M32C_OLD: ++ case EM_M32C: ++ return reloc_type == 3; /* R_M32C_32. */ ++ case EM_M32R: ++ return reloc_type == 34; /* R_M32R_32_RELA. */ ++ case EM_68HC11: ++ case EM_68HC12: ++ return reloc_type == 6; /* R_M68HC11_32. */ ++ case EM_S12Z: ++ return reloc_type == 7 || /* R_S12Z_EXT32 */ ++ reloc_type == 6; /* R_S12Z_CW32. */ ++ case EM_MCORE: ++ return reloc_type == 1; /* R_MCORE_ADDR32. */ ++ case EM_CYGNUS_MEP: ++ return reloc_type == 4; /* R_MEP_32. */ ++ case EM_METAG: ++ return reloc_type == 2; /* R_METAG_ADDR32. */ ++ case EM_MICROBLAZE: ++ return reloc_type == 1; /* R_MICROBLAZE_32. */ ++ case EM_MIPS: ++ return reloc_type == 2; /* R_MIPS_32. */ ++ case EM_MMIX: ++ return reloc_type == 4; /* R_MMIX_32. */ ++ case EM_CYGNUS_MN10200: ++ case EM_MN10200: ++ return reloc_type == 1; /* R_MN10200_32. */ ++ case EM_CYGNUS_MN10300: ++ case EM_MN10300: ++ return reloc_type == 1; /* R_MN10300_32. */ ++ case EM_MOXIE: ++ return reloc_type == 1; /* R_MOXIE_32. */ ++ case EM_MSP430_OLD: ++ case EM_MSP430: ++ return reloc_type == 1; /* R_MSP430_32 or R_MSP320_ABS32. */ ++ case EM_MT: ++ return reloc_type == 2; /* R_MT_32. */ ++ case EM_NDS32: ++ return reloc_type == 20; /* R_NDS32_RELA. */ ++ case EM_ALTERA_NIOS2: ++ return reloc_type == 12; /* R_NIOS2_BFD_RELOC_32. */ ++ case EM_NIOS32: ++ return reloc_type == 1; /* R_NIOS_32. */ ++ case EM_OR1K: ++ return reloc_type == 1; /* R_OR1K_32. */ ++ case EM_PARISC: ++ return (reloc_type == 1 /* R_PARISC_DIR32. */ ++ || reloc_type == 2 /* R_PARISC_DIR21L. */ ++ || reloc_type == 41); /* R_PARISC_SECREL32. */ ++ case EM_PJ: ++ case EM_PJ_OLD: ++ return reloc_type == 1; /* R_PJ_DATA_DIR32. */ ++ case EM_PPC64: ++ return reloc_type == 1; /* R_PPC64_ADDR32. */ ++ case EM_PPC: ++ return reloc_type == 1; /* R_PPC_ADDR32. */ ++ case EM_TI_PRU: ++ return reloc_type == 11; /* R_PRU_BFD_RELOC_32. */ ++ case EM_RISCV: ++ return reloc_type == 1; /* R_RISCV_32. */ ++ case EM_RL78: ++ return reloc_type == 1; /* R_RL78_DIR32. */ ++ case EM_RX: ++ return reloc_type == 1; /* R_RX_DIR32. */ ++ case EM_S370: ++ return reloc_type == 1; /* R_I370_ADDR31. */ ++ case EM_S390_OLD: ++ case EM_S390: ++ return reloc_type == 4; /* R_S390_32. */ ++ case EM_SCORE: ++ return reloc_type == 8; /* R_SCORE_ABS32. */ ++ case EM_SH: ++ return reloc_type == 1; /* R_SH_DIR32. */ ++ case EM_SPARC32PLUS: ++ case EM_SPARCV9: ++ case EM_SPARC: ++ return reloc_type == 3 /* R_SPARC_32. */ ++ || reloc_type == 23; /* R_SPARC_UA32. */ ++ case EM_SPU: ++ return reloc_type == 6; /* R_SPU_ADDR32 */ ++ case EM_TI_C6000: ++ return reloc_type == 1; /* R_C6000_ABS32. */ ++ case EM_TILEGX: ++ return reloc_type == 2; /* R_TILEGX_32. */ ++ case EM_TILEPRO: ++ return reloc_type == 1; /* R_TILEPRO_32. */ ++ case EM_CYGNUS_V850: ++ case EM_V850: ++ return reloc_type == 6; /* R_V850_ABS32. */ ++ case EM_V800: ++ return reloc_type == 0x33; /* R_V810_WORD. */ ++ case EM_VAX: ++ return reloc_type == 1; /* R_VAX_32. */ ++ case EM_VISIUM: ++ return reloc_type == 3; /* R_VISIUM_32. */ ++ case EM_WEBASSEMBLY: ++ return reloc_type == 1; /* R_WASM32_32. */ ++ case EM_X86_64: ++ case EM_L1OM: ++ case EM_K1OM: ++ return reloc_type == 10; /* R_X86_64_32. */ ++ case EM_XC16X: ++ case EM_C166: ++ return reloc_type == 3; /* R_XC16C_ABS_32. */ ++ case EM_XGATE: ++ return reloc_type == 4; /* R_XGATE_32. */ ++ case EM_XSTORMY16: ++ return reloc_type == 1; /* R_XSTROMY16_32. */ ++ case EM_XTENSA_OLD: ++ case EM_XTENSA: ++ return reloc_type == 1; /* R_XTENSA_32. */ ++ case EM_Z80: ++ return reloc_type == 6; /* R_Z80_32. */ ++ default: ++ { ++ static unsigned int prev_warn = 0; ++ ++ /* Avoid repeating the same warning multiple times. */ ++ if (prev_warn != filedata->file_header.e_machine) ++ error (_("Missing knowledge of 32-bit reloc types used in DWARF sections of machine number %d\n"), ++ filedata->file_header.e_machine); ++ prev_warn = filedata->file_header.e_machine; ++ return FALSE; ++ } ++ } ++} ++ ++/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is ++ a 32-bit pc-relative RELA relocation used in DWARF debug sections. */ ++ ++static bfd_boolean ++is_32bit_pcrel_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ switch (filedata->file_header.e_machine) ++ /* Please keep this table alpha-sorted for ease of visual lookup. */ ++ { ++ case EM_386: ++ case EM_IAMCU: ++ return reloc_type == 2; /* R_386_PC32. */ ++ case EM_68K: ++ return reloc_type == 4; /* R_68K_PC32. */ ++ case EM_AARCH64: ++ return reloc_type == 261; /* R_AARCH64_PREL32 */ ++ case EM_ADAPTEVA_EPIPHANY: ++ return reloc_type == 6; ++ case EM_ALPHA: ++ return reloc_type == 10; /* R_ALPHA_SREL32. */ ++ case EM_ARC_COMPACT: ++ case EM_ARC_COMPACT2: ++ return reloc_type == 49; /* R_ARC_32_PCREL. */ ++ case EM_ARM: ++ return reloc_type == 3; /* R_ARM_REL32 */ ++ case EM_AVR_OLD: ++ case EM_AVR: ++ return reloc_type == 36; /* R_AVR_32_PCREL. */ ++ case EM_MICROBLAZE: ++ return reloc_type == 2; /* R_MICROBLAZE_32_PCREL. */ ++ case EM_OR1K: ++ return reloc_type == 9; /* R_OR1K_32_PCREL. */ ++ case EM_PARISC: ++ return reloc_type == 9; /* R_PARISC_PCREL32. */ ++ case EM_PPC: ++ return reloc_type == 26; /* R_PPC_REL32. */ ++ case EM_PPC64: ++ return reloc_type == 26; /* R_PPC64_REL32. */ ++ case EM_RISCV: ++ return reloc_type == 57; /* R_RISCV_32_PCREL. */ ++ case EM_S390_OLD: ++ case EM_S390: ++ return reloc_type == 5; /* R_390_PC32. */ ++ case EM_SH: ++ return reloc_type == 2; /* R_SH_REL32. */ ++ case EM_SPARC32PLUS: ++ case EM_SPARCV9: ++ case EM_SPARC: ++ return reloc_type == 6; /* R_SPARC_DISP32. */ ++ case EM_SPU: ++ return reloc_type == 13; /* R_SPU_REL32. */ ++ case EM_TILEGX: ++ return reloc_type == 6; /* R_TILEGX_32_PCREL. */ ++ case EM_TILEPRO: ++ return reloc_type == 4; /* R_TILEPRO_32_PCREL. */ ++ case EM_VISIUM: ++ return reloc_type == 6; /* R_VISIUM_32_PCREL */ ++ case EM_X86_64: ++ case EM_L1OM: ++ case EM_K1OM: ++ return reloc_type == 2; /* R_X86_64_PC32. */ ++ case EM_VAX: ++ return reloc_type == 4; /* R_VAX_PCREL32. */ ++ case EM_XTENSA_OLD: ++ case EM_XTENSA: ++ return reloc_type == 14; /* R_XTENSA_32_PCREL. */ ++ default: ++ /* Do not abort or issue an error message here. Not all targets use ++ pc-relative 32-bit relocs in their DWARF debug information and we ++ have already tested for target coverage in is_32bit_abs_reloc. A ++ more helpful warning message will be generated by apply_relocations ++ anyway, so just return. */ ++ return FALSE; ++ } ++} ++ ++/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is ++ a 64-bit absolute RELA relocation used in DWARF debug sections. */ ++ ++static bfd_boolean ++is_64bit_abs_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_AARCH64: ++ return reloc_type == 257; /* R_AARCH64_ABS64. */ ++ case EM_ALPHA: ++ return reloc_type == 2; /* R_ALPHA_REFQUAD. */ ++ case EM_IA_64: ++ return (reloc_type == 0x26 /* R_IA64_DIR64MSB. */ ++ || reloc_type == 0x27 /* R_IA64_DIR64LSB. */); ++ case EM_PARISC: ++ return reloc_type == 80; /* R_PARISC_DIR64. */ ++ case EM_PPC64: ++ return reloc_type == 38; /* R_PPC64_ADDR64. */ ++ case EM_RISCV: ++ return reloc_type == 2; /* R_RISCV_64. */ ++ case EM_SPARC32PLUS: ++ case EM_SPARCV9: ++ case EM_SPARC: ++ return reloc_type == 32 /* R_SPARC_64. */ ++ || reloc_type == 54; /* R_SPARC_UA64. */ ++ case EM_X86_64: ++ case EM_L1OM: ++ case EM_K1OM: ++ return reloc_type == 1; /* R_X86_64_64. */ ++ case EM_S390_OLD: ++ case EM_S390: ++ return reloc_type == 22; /* R_S390_64. */ ++ case EM_TILEGX: ++ return reloc_type == 1; /* R_TILEGX_64. */ ++ case EM_MIPS: ++ return reloc_type == 18; /* R_MIPS_64. */ ++ default: ++ return FALSE; ++ } ++} ++ ++/* Like is_32bit_pcrel_reloc except that it returns TRUE iff RELOC_TYPE is ++ a 64-bit pc-relative RELA relocation used in DWARF debug sections. */ ++ ++static bfd_boolean ++is_64bit_pcrel_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_AARCH64: ++ return reloc_type == 260; /* R_AARCH64_PREL64. */ ++ case EM_ALPHA: ++ return reloc_type == 11; /* R_ALPHA_SREL64. */ ++ case EM_IA_64: ++ return (reloc_type == 0x4e /* R_IA64_PCREL64MSB. */ ++ || reloc_type == 0x4f /* R_IA64_PCREL64LSB. */); ++ case EM_PARISC: ++ return reloc_type == 72; /* R_PARISC_PCREL64. */ ++ case EM_PPC64: ++ return reloc_type == 44; /* R_PPC64_REL64. */ ++ case EM_SPARC32PLUS: ++ case EM_SPARCV9: ++ case EM_SPARC: ++ return reloc_type == 46; /* R_SPARC_DISP64. */ ++ case EM_X86_64: ++ case EM_L1OM: ++ case EM_K1OM: ++ return reloc_type == 24; /* R_X86_64_PC64. */ ++ case EM_S390_OLD: ++ case EM_S390: ++ return reloc_type == 23; /* R_S390_PC64. */ ++ case EM_TILEGX: ++ return reloc_type == 5; /* R_TILEGX_64_PCREL. */ ++ default: ++ return FALSE; ++ } ++} ++ ++/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is ++ a 24-bit absolute RELA relocation used in DWARF debug sections. */ ++ ++static bfd_boolean ++is_24bit_abs_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_CYGNUS_MN10200: ++ case EM_MN10200: ++ return reloc_type == 4; /* R_MN10200_24. */ ++ case EM_FT32: ++ return reloc_type == 5; /* R_FT32_20. */ ++ case EM_Z80: ++ return reloc_type == 5; /* R_Z80_24. */ ++ default: ++ return FALSE; ++ } ++} ++ ++/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is ++ a 16-bit absolute RELA relocation used in DWARF debug sections. */ ++ ++static bfd_boolean ++is_16bit_abs_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ /* Please keep this table alpha-sorted for ease of visual lookup. */ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_ARC: ++ case EM_ARC_COMPACT: ++ case EM_ARC_COMPACT2: ++ return reloc_type == 2; /* R_ARC_16. */ ++ case EM_ADAPTEVA_EPIPHANY: ++ return reloc_type == 5; ++ case EM_AVR_OLD: ++ case EM_AVR: ++ return reloc_type == 4; /* R_AVR_16. */ ++ case EM_CYGNUS_D10V: ++ case EM_D10V: ++ return reloc_type == 3; /* R_D10V_16. */ ++ case EM_FT32: ++ return reloc_type == 2; /* R_FT32_16. */ ++ case EM_H8S: ++ case EM_H8_300: ++ case EM_H8_300H: ++ return reloc_type == R_H8_DIR16; ++ case EM_IP2K_OLD: ++ case EM_IP2K: ++ return reloc_type == 1; /* R_IP2K_16. */ ++ case EM_M32C_OLD: ++ case EM_M32C: ++ return reloc_type == 1; /* R_M32C_16 */ ++ case EM_CYGNUS_MN10200: ++ case EM_MN10200: ++ return reloc_type == 2; /* R_MN10200_16. */ ++ case EM_CYGNUS_MN10300: ++ case EM_MN10300: ++ return reloc_type == 2; /* R_MN10300_16. */ ++ case EM_MSP430: ++ if (uses_msp430x_relocs (filedata)) ++ return reloc_type == 2; /* R_MSP430_ABS16. */ ++ /* Fall through. */ ++ case EM_MSP430_OLD: ++ return reloc_type == 5; /* R_MSP430_16_BYTE. */ ++ case EM_NDS32: ++ return reloc_type == 19; /* R_NDS32_RELA. */ ++ case EM_ALTERA_NIOS2: ++ return reloc_type == 13; /* R_NIOS2_BFD_RELOC_16. */ ++ case EM_NIOS32: ++ return reloc_type == 9; /* R_NIOS_16. */ ++ case EM_OR1K: ++ return reloc_type == 2; /* R_OR1K_16. */ ++ case EM_RISCV: ++ return reloc_type == 55; /* R_RISCV_SET16. */ ++ case EM_TI_PRU: ++ return reloc_type == 8; /* R_PRU_BFD_RELOC_16. */ ++ case EM_TI_C6000: ++ return reloc_type == 2; /* R_C6000_ABS16. */ ++ case EM_VISIUM: ++ return reloc_type == 2; /* R_VISIUM_16. */ ++ case EM_XC16X: ++ case EM_C166: ++ return reloc_type == 2; /* R_XC16C_ABS_16. */ ++ case EM_XGATE: ++ return reloc_type == 3; /* R_XGATE_16. */ ++ case EM_Z80: ++ return reloc_type == 4; /* R_Z80_16. */ ++ default: ++ return FALSE; ++ } ++} ++ ++/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is ++ a 8-bit absolute RELA relocation used in DWARF debug sections. */ ++ ++static bfd_boolean ++is_8bit_abs_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_RISCV: ++ return reloc_type == 54; /* R_RISCV_SET8. */ ++ case EM_Z80: ++ return reloc_type == 1; /* R_Z80_8. */ ++ default: ++ return FALSE; ++ } ++} ++ ++/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is ++ a 6-bit absolute RELA relocation used in DWARF debug sections. */ ++ ++static bfd_boolean ++is_6bit_abs_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_RISCV: ++ return reloc_type == 53; /* R_RISCV_SET6. */ ++ default: ++ return FALSE; ++ } ++} ++ ++/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is ++ a 32-bit inplace add RELA relocation used in DWARF debug sections. */ ++ ++static bfd_boolean ++is_32bit_inplace_add_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ /* Please keep this table alpha-sorted for ease of visual lookup. */ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_RISCV: ++ return reloc_type == 35; /* R_RISCV_ADD32. */ ++ default: ++ return FALSE; ++ } ++} ++ ++/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is ++ a 32-bit inplace sub RELA relocation used in DWARF debug sections. */ ++ ++static bfd_boolean ++is_32bit_inplace_sub_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ /* Please keep this table alpha-sorted for ease of visual lookup. */ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_RISCV: ++ return reloc_type == 39; /* R_RISCV_SUB32. */ ++ default: ++ return FALSE; ++ } ++} ++ ++/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is ++ a 64-bit inplace add RELA relocation used in DWARF debug sections. */ ++ ++static bfd_boolean ++is_64bit_inplace_add_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ /* Please keep this table alpha-sorted for ease of visual lookup. */ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_RISCV: ++ return reloc_type == 36; /* R_RISCV_ADD64. */ ++ default: ++ return FALSE; ++ } ++} ++ ++/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is ++ a 64-bit inplace sub RELA relocation used in DWARF debug sections. */ ++ ++static bfd_boolean ++is_64bit_inplace_sub_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ /* Please keep this table alpha-sorted for ease of visual lookup. */ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_RISCV: ++ return reloc_type == 40; /* R_RISCV_SUB64. */ ++ default: ++ return FALSE; ++ } ++} ++ ++/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is ++ a 16-bit inplace add RELA relocation used in DWARF debug sections. */ ++ ++static bfd_boolean ++is_16bit_inplace_add_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ /* Please keep this table alpha-sorted for ease of visual lookup. */ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_RISCV: ++ return reloc_type == 34; /* R_RISCV_ADD16. */ ++ default: ++ return FALSE; ++ } ++} ++ ++/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is ++ a 16-bit inplace sub RELA relocation used in DWARF debug sections. */ ++ ++static bfd_boolean ++is_16bit_inplace_sub_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ /* Please keep this table alpha-sorted for ease of visual lookup. */ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_RISCV: ++ return reloc_type == 38; /* R_RISCV_SUB16. */ ++ default: ++ return FALSE; ++ } ++} ++ ++/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is ++ a 8-bit inplace add RELA relocation used in DWARF debug sections. */ ++ ++static bfd_boolean ++is_8bit_inplace_add_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ /* Please keep this table alpha-sorted for ease of visual lookup. */ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_RISCV: ++ return reloc_type == 33; /* R_RISCV_ADD8. */ ++ default: ++ return FALSE; ++ } ++} ++ ++/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is ++ a 8-bit inplace sub RELA relocation used in DWARF debug sections. */ ++ ++static bfd_boolean ++is_8bit_inplace_sub_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ /* Please keep this table alpha-sorted for ease of visual lookup. */ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_RISCV: ++ return reloc_type == 37; /* R_RISCV_SUB8. */ ++ default: ++ return FALSE; ++ } ++} ++ ++/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is ++ a 6-bit inplace sub RELA relocation used in DWARF debug sections. */ ++ ++static bfd_boolean ++is_6bit_inplace_sub_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_RISCV: ++ return reloc_type == 52; /* R_RISCV_SUB6. */ ++ default: ++ return FALSE; ++ } ++} ++ ++/* Returns TRUE iff RELOC_TYPE is a NONE relocation used for discarded ++ relocation entries (possibly formerly used for SHT_GROUP sections). */ ++ ++static bfd_boolean ++is_none_reloc (Filedata * filedata, unsigned int reloc_type) ++{ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_386: /* R_386_NONE. */ ++ case EM_68K: /* R_68K_NONE. */ ++ case EM_ADAPTEVA_EPIPHANY: ++ case EM_ALPHA: /* R_ALPHA_NONE. */ ++ case EM_ALTERA_NIOS2: /* R_NIOS2_NONE. */ ++ case EM_ARC: /* R_ARC_NONE. */ ++ case EM_ARC_COMPACT2: /* R_ARC_NONE. */ ++ case EM_ARC_COMPACT: /* R_ARC_NONE. */ ++ case EM_ARM: /* R_ARM_NONE. */ ++ case EM_C166: /* R_XC16X_NONE. */ ++ case EM_CRIS: /* R_CRIS_NONE. */ ++ case EM_FT32: /* R_FT32_NONE. */ ++ case EM_IA_64: /* R_IA64_NONE. */ ++ case EM_K1OM: /* R_X86_64_NONE. */ ++ case EM_L1OM: /* R_X86_64_NONE. */ ++ case EM_M32R: /* R_M32R_NONE. */ ++ case EM_MIPS: /* R_MIPS_NONE. */ ++ case EM_MN10300: /* R_MN10300_NONE. */ ++ case EM_MOXIE: /* R_MOXIE_NONE. */ ++ case EM_NIOS32: /* R_NIOS_NONE. */ ++ case EM_OR1K: /* R_OR1K_NONE. */ ++ case EM_PARISC: /* R_PARISC_NONE. */ ++ case EM_PPC64: /* R_PPC64_NONE. */ ++ case EM_PPC: /* R_PPC_NONE. */ ++ case EM_RISCV: /* R_RISCV_NONE. */ ++ case EM_S390: /* R_390_NONE. */ ++ case EM_S390_OLD: ++ case EM_SH: /* R_SH_NONE. */ ++ case EM_SPARC32PLUS: ++ case EM_SPARC: /* R_SPARC_NONE. */ ++ case EM_SPARCV9: ++ case EM_TILEGX: /* R_TILEGX_NONE. */ ++ case EM_TILEPRO: /* R_TILEPRO_NONE. */ ++ case EM_TI_C6000:/* R_C6000_NONE. */ ++ case EM_X86_64: /* R_X86_64_NONE. */ ++ case EM_XC16X: ++ case EM_Z80: /* R_Z80_NONE. */ ++ case EM_WEBASSEMBLY: /* R_WASM32_NONE. */ ++ return reloc_type == 0; ++ ++ case EM_AARCH64: ++ return reloc_type == 0 || reloc_type == 256; ++ case EM_AVR_OLD: ++ case EM_AVR: ++ return (reloc_type == 0 /* R_AVR_NONE. */ ++ || reloc_type == 30 /* R_AVR_DIFF8. */ ++ || reloc_type == 31 /* R_AVR_DIFF16. */ ++ || reloc_type == 32 /* R_AVR_DIFF32. */); ++ case EM_METAG: ++ return reloc_type == 3; /* R_METAG_NONE. */ ++ case EM_NDS32: ++ return (reloc_type == 0 /* R_XTENSA_NONE. */ ++ || reloc_type == 204 /* R_NDS32_DIFF8. */ ++ || reloc_type == 205 /* R_NDS32_DIFF16. */ ++ || reloc_type == 206 /* R_NDS32_DIFF32. */ ++ || reloc_type == 207 /* R_NDS32_ULEB128. */); ++ case EM_TI_PRU: ++ return (reloc_type == 0 /* R_PRU_NONE. */ ++ || reloc_type == 65 /* R_PRU_DIFF8. */ ++ || reloc_type == 66 /* R_PRU_DIFF16. */ ++ || reloc_type == 67 /* R_PRU_DIFF32. */); ++ case EM_XTENSA_OLD: ++ case EM_XTENSA: ++ return (reloc_type == 0 /* R_XTENSA_NONE. */ ++ || reloc_type == 17 /* R_XTENSA_DIFF8. */ ++ || reloc_type == 18 /* R_XTENSA_DIFF16. */ ++ || reloc_type == 19 /* R_XTENSA_DIFF32. */ ++ || reloc_type == 57 /* R_XTENSA_PDIFF8. */ ++ || reloc_type == 58 /* R_XTENSA_PDIFF16. */ ++ || reloc_type == 59 /* R_XTENSA_PDIFF32. */ ++ || reloc_type == 60 /* R_XTENSA_NDIFF8. */ ++ || reloc_type == 61 /* R_XTENSA_NDIFF16. */ ++ || reloc_type == 62 /* R_XTENSA_NDIFF32. */); ++ } ++ return FALSE; ++} ++ ++/* Returns TRUE if there is a relocation against ++ section NAME at OFFSET bytes. */ ++ ++bfd_boolean ++reloc_at (struct dwarf_section * dsec, dwarf_vma offset) ++{ ++ Elf_Internal_Rela * relocs; ++ Elf_Internal_Rela * rp; ++ ++ if (dsec == NULL || dsec->reloc_info == NULL) ++ return FALSE; ++ ++ relocs = (Elf_Internal_Rela *) dsec->reloc_info; ++ ++ for (rp = relocs; rp < relocs + dsec->num_relocs; ++rp) ++ if (rp->r_offset == offset) ++ return TRUE; ++ ++ return FALSE; ++} ++ ++/* Apply relocations to a section. ++ Returns TRUE upon success, FALSE otherwise. ++ If RELOCS_RETURN is non-NULL then it is set to point to the loaded relocs. ++ It is then the caller's responsibility to free them. NUM_RELOCS_RETURN ++ will be set to the number of relocs loaded. ++ ++ Note: So far support has been added only for those relocations ++ which can be found in debug sections. FIXME: Add support for ++ more relocations ? */ ++ ++static bfd_boolean ++apply_relocations (Filedata * filedata, ++ const Elf_Internal_Shdr * section, ++ unsigned char * start, ++ bfd_size_type size, ++ void ** relocs_return, ++ unsigned long * num_relocs_return) ++{ ++ Elf_Internal_Shdr * relsec; ++ unsigned char * end = start + size; ++ ++ if (relocs_return != NULL) ++ { ++ * (Elf_Internal_Rela **) relocs_return = NULL; ++ * num_relocs_return = 0; ++ } ++ ++ if (filedata->file_header.e_type != ET_REL) ++ /* No relocs to apply. */ ++ return TRUE; ++ ++ /* Find the reloc section associated with the section. */ ++ for (relsec = filedata->section_headers; ++ relsec < filedata->section_headers + filedata->file_header.e_shnum; ++ ++relsec) ++ { ++ bfd_boolean is_rela; ++ unsigned long num_relocs; ++ Elf_Internal_Rela * relocs; ++ Elf_Internal_Rela * rp; ++ Elf_Internal_Shdr * symsec; ++ Elf_Internal_Sym * symtab; ++ unsigned long num_syms; ++ Elf_Internal_Sym * sym; ++ ++ if ((relsec->sh_type != SHT_RELA && relsec->sh_type != SHT_REL) ++ || relsec->sh_info >= filedata->file_header.e_shnum ++ || filedata->section_headers + relsec->sh_info != section ++ || relsec->sh_size == 0 ++ || relsec->sh_link >= filedata->file_header.e_shnum) ++ continue; ++ ++ symsec = filedata->section_headers + relsec->sh_link; ++ if (symsec->sh_type != SHT_SYMTAB ++ && symsec->sh_type != SHT_DYNSYM) ++ return FALSE; ++ ++ is_rela = relsec->sh_type == SHT_RELA; ++ ++ if (is_rela) ++ { ++ if (!slurp_rela_relocs (filedata, relsec->sh_offset, ++ relsec->sh_size, & relocs, & num_relocs)) ++ return FALSE; ++ } ++ else ++ { ++ if (!slurp_rel_relocs (filedata, relsec->sh_offset, ++ relsec->sh_size, & relocs, & num_relocs)) ++ return FALSE; ++ } ++ ++ /* SH uses RELA but uses in place value instead of the addend field. */ ++ if (filedata->file_header.e_machine == EM_SH) ++ is_rela = FALSE; ++ ++ symtab = GET_ELF_SYMBOLS (filedata, symsec, & num_syms); ++ ++ for (rp = relocs; rp < relocs + num_relocs; ++rp) ++ { ++ bfd_vma addend; ++ unsigned int reloc_type; ++ unsigned int reloc_size; ++ bfd_boolean reloc_inplace = FALSE; ++ bfd_boolean reloc_subtract = FALSE; ++ unsigned char * rloc; ++ unsigned long sym_index; ++ ++ reloc_type = get_reloc_type (filedata, rp->r_info); ++ ++ if (target_specific_reloc_handling (filedata, rp, start, end, symtab, num_syms)) ++ continue; ++ else if (is_none_reloc (filedata, reloc_type)) ++ continue; ++ else if (is_32bit_abs_reloc (filedata, reloc_type) ++ || is_32bit_pcrel_reloc (filedata, reloc_type)) ++ reloc_size = 4; ++ else if (is_64bit_abs_reloc (filedata, reloc_type) ++ || is_64bit_pcrel_reloc (filedata, reloc_type)) ++ reloc_size = 8; ++ else if (is_24bit_abs_reloc (filedata, reloc_type)) ++ reloc_size = 3; ++ else if (is_16bit_abs_reloc (filedata, reloc_type)) ++ reloc_size = 2; ++ else if (is_8bit_abs_reloc (filedata, reloc_type) ++ || is_6bit_abs_reloc (filedata, reloc_type)) ++ reloc_size = 1; ++ else if ((reloc_subtract = is_32bit_inplace_sub_reloc (filedata, ++ reloc_type)) ++ || is_32bit_inplace_add_reloc (filedata, reloc_type)) ++ { ++ reloc_size = 4; ++ reloc_inplace = TRUE; ++ } ++ else if ((reloc_subtract = is_64bit_inplace_sub_reloc (filedata, ++ reloc_type)) ++ || is_64bit_inplace_add_reloc (filedata, reloc_type)) ++ { ++ reloc_size = 8; ++ reloc_inplace = TRUE; ++ } ++ else if ((reloc_subtract = is_16bit_inplace_sub_reloc (filedata, ++ reloc_type)) ++ || is_16bit_inplace_add_reloc (filedata, reloc_type)) ++ { ++ reloc_size = 2; ++ reloc_inplace = TRUE; ++ } ++ else if ((reloc_subtract = is_8bit_inplace_sub_reloc (filedata, ++ reloc_type)) ++ || is_8bit_inplace_add_reloc (filedata, reloc_type)) ++ { ++ reloc_size = 1; ++ reloc_inplace = TRUE; ++ } ++ else if ((reloc_subtract = is_6bit_inplace_sub_reloc (filedata, ++ reloc_type))) ++ { ++ reloc_size = 1; ++ reloc_inplace = TRUE; ++ } ++ else ++ { ++ static unsigned int prev_reloc = 0; ++ ++ if (reloc_type != prev_reloc) ++ warn (_("unable to apply unsupported reloc type %d to section %s\n"), ++ reloc_type, printable_section_name (filedata, section)); ++ prev_reloc = reloc_type; ++ continue; ++ } ++ ++ rloc = start + rp->r_offset; ++ if (!IN_RANGE (start, end, rloc, reloc_size)) ++ { ++ warn (_("skipping invalid relocation offset 0x%lx in section %s\n"), ++ (unsigned long) rp->r_offset, ++ printable_section_name (filedata, section)); ++ continue; ++ } ++ ++ sym_index = (unsigned long) get_reloc_symindex (rp->r_info); ++ if (sym_index >= num_syms) ++ { ++ warn (_("skipping invalid relocation symbol index 0x%lx in section %s\n"), ++ sym_index, printable_section_name (filedata, section)); ++ continue; ++ } ++ sym = symtab + sym_index; ++ ++ /* If the reloc has a symbol associated with it, ++ make sure that it is of an appropriate type. ++ ++ Relocations against symbols without type can happen. ++ Gcc -feliminate-dwarf2-dups may generate symbols ++ without type for debug info. ++ ++ Icc generates relocations against function symbols ++ instead of local labels. ++ ++ Relocations against object symbols can happen, eg when ++ referencing a global array. For an example of this see ++ the _clz.o binary in libgcc.a. */ ++ if (sym != symtab ++ && ELF_ST_TYPE (sym->st_info) != STT_COMMON ++ && ELF_ST_TYPE (sym->st_info) > STT_SECTION) ++ { ++ warn (_("skipping unexpected symbol type %s in section %s relocation %ld\n"), ++ get_symbol_type (filedata, ELF_ST_TYPE (sym->st_info)), ++ printable_section_name (filedata, relsec), ++ (long int)(rp - relocs)); ++ continue; ++ } ++ ++ addend = 0; ++ if (is_rela) ++ addend += rp->r_addend; ++ /* R_XTENSA_32, R_PJ_DATA_DIR32 and R_D30V_32_NORMAL are ++ partial_inplace. */ ++ if (!is_rela ++ || (filedata->file_header.e_machine == EM_XTENSA ++ && reloc_type == 1) ++ || ((filedata->file_header.e_machine == EM_PJ ++ || filedata->file_header.e_machine == EM_PJ_OLD) ++ && reloc_type == 1) ++ || ((filedata->file_header.e_machine == EM_D30V ++ || filedata->file_header.e_machine == EM_CYGNUS_D30V) ++ && reloc_type == 12) ++ || reloc_inplace) ++ { ++ if (is_6bit_inplace_sub_reloc (filedata, reloc_type)) ++ addend += byte_get (rloc, reloc_size) & 0x3f; ++ else ++ addend += byte_get (rloc, reloc_size); ++ } ++ ++ if (is_32bit_pcrel_reloc (filedata, reloc_type) ++ || is_64bit_pcrel_reloc (filedata, reloc_type)) ++ { ++ /* On HPPA, all pc-relative relocations are biased by 8. */ ++ if (filedata->file_header.e_machine == EM_PARISC) ++ addend -= 8; ++ byte_put (rloc, (addend + sym->st_value) - rp->r_offset, ++ reloc_size); ++ } ++ else if (is_6bit_abs_reloc (filedata, reloc_type) ++ || is_6bit_inplace_sub_reloc (filedata, reloc_type)) ++ { ++ if (reloc_subtract) ++ addend -= sym->st_value; ++ else ++ addend += sym->st_value; ++ addend = (addend & 0x3f) | (byte_get (rloc, reloc_size) & 0xc0); ++ byte_put (rloc, addend, reloc_size); ++ } ++ else if (reloc_subtract) ++ byte_put (rloc, addend - sym->st_value, reloc_size); ++ else ++ byte_put (rloc, addend + sym->st_value, reloc_size); ++ } ++ ++ free (symtab); ++ /* Let the target specific reloc processing code know that ++ we have finished with these relocs. */ ++ target_specific_reloc_handling (filedata, NULL, NULL, NULL, NULL, 0); ++ ++ if (relocs_return) ++ { ++ * (Elf_Internal_Rela **) relocs_return = relocs; ++ * num_relocs_return = num_relocs; ++ } ++ else ++ free (relocs); ++ ++ break; ++ } ++ ++ return TRUE; ++} ++ ++#ifdef SUPPORT_DISASSEMBLY ++static bfd_boolean ++disassemble_section (Elf_Internal_Shdr * section, Filedata * filedata) ++{ ++ printf (_("\nAssembly dump of section %s\n"), printable_section_name (filedata, section)); ++ ++ /* FIXME: XXX -- to be done --- XXX */ ++ ++ return TRUE; ++} ++#endif ++ ++/* Reads in the contents of SECTION from FILE, returning a pointer ++ to a malloc'ed buffer or NULL if something went wrong. */ ++ ++static char * ++get_section_contents (Elf_Internal_Shdr * section, Filedata * filedata) ++{ ++ bfd_size_type num_bytes = section->sh_size; ++ ++ if (num_bytes == 0 || section->sh_type == SHT_NOBITS) ++ { ++ printf (_("Section '%s' has no data to dump.\n"), ++ printable_section_name (filedata, section)); ++ return NULL; ++ } ++ ++ return (char *) get_data (NULL, filedata, section->sh_offset, 1, num_bytes, ++ _("section contents")); ++} ++ ++/* Uncompresses a section that was compressed using zlib, in place. */ ++ ++static bfd_boolean ++uncompress_section_contents (unsigned char ** buffer, ++ dwarf_size_type uncompressed_size, ++ dwarf_size_type * size) ++{ ++ dwarf_size_type compressed_size = *size; ++ unsigned char * compressed_buffer = *buffer; ++ unsigned char * uncompressed_buffer; ++ z_stream strm; ++ int rc; ++ ++ /* It is possible the section consists of several compressed ++ buffers concatenated together, so we uncompress in a loop. */ ++ /* PR 18313: The state field in the z_stream structure is supposed ++ to be invisible to the user (ie us), but some compilers will ++ still complain about it being used without initialisation. So ++ we first zero the entire z_stream structure and then set the fields ++ that we need. */ ++ memset (& strm, 0, sizeof strm); ++ strm.avail_in = compressed_size; ++ strm.next_in = (Bytef *) compressed_buffer; ++ strm.avail_out = uncompressed_size; ++ uncompressed_buffer = (unsigned char *) xmalloc (uncompressed_size); ++ ++ rc = inflateInit (& strm); ++ while (strm.avail_in > 0) ++ { ++ if (rc != Z_OK) ++ goto fail; ++ strm.next_out = ((Bytef *) uncompressed_buffer ++ + (uncompressed_size - strm.avail_out)); ++ rc = inflate (&strm, Z_FINISH); ++ if (rc != Z_STREAM_END) ++ goto fail; ++ rc = inflateReset (& strm); ++ } ++ rc = inflateEnd (& strm); ++ if (rc != Z_OK ++ || strm.avail_out != 0) ++ goto fail; ++ ++ *buffer = uncompressed_buffer; ++ *size = uncompressed_size; ++ return TRUE; ++ ++ fail: ++ free (uncompressed_buffer); ++ /* Indicate decompression failure. */ ++ *buffer = NULL; ++ return FALSE; ++} ++ ++static bfd_boolean ++dump_section_as_strings (Elf_Internal_Shdr * section, Filedata * filedata) ++{ ++ Elf_Internal_Shdr * relsec; ++ bfd_size_type num_bytes; ++ unsigned char * data; ++ unsigned char * end; ++ unsigned char * real_start; ++ unsigned char * start; ++ bfd_boolean some_strings_shown; ++ ++ real_start = start = (unsigned char *) get_section_contents (section, filedata); ++ if (start == NULL) ++ /* PR 21820: Do not fail if the section was empty. */ ++ return (section->sh_size == 0 || section->sh_type == SHT_NOBITS) ? TRUE : FALSE; ++ ++ num_bytes = section->sh_size; ++ ++ printf (_("\nString dump of section '%s':\n"), printable_section_name (filedata, section)); ++ ++ if (decompress_dumps) ++ { ++ dwarf_size_type new_size = num_bytes; ++ dwarf_size_type uncompressed_size = 0; ++ ++ if ((section->sh_flags & SHF_COMPRESSED) != 0) ++ { ++ Elf_Internal_Chdr chdr; ++ unsigned int compression_header_size ++ = get_compression_header (& chdr, (unsigned char *) start, ++ num_bytes); ++ if (compression_header_size == 0) ++ /* An error message will have already been generated ++ by get_compression_header. */ ++ goto error_out; ++ ++ if (chdr.ch_type != ELFCOMPRESS_ZLIB) ++ { ++ warn (_("section '%s' has unsupported compress type: %d\n"), ++ printable_section_name (filedata, section), chdr.ch_type); ++ goto error_out; ++ } ++ uncompressed_size = chdr.ch_size; ++ start += compression_header_size; ++ new_size -= compression_header_size; ++ } ++ else if (new_size > 12 && streq ((char *) start, "ZLIB")) ++ { ++ /* Read the zlib header. In this case, it should be "ZLIB" ++ followed by the uncompressed section size, 8 bytes in ++ big-endian order. */ ++ uncompressed_size = start[4]; uncompressed_size <<= 8; ++ uncompressed_size += start[5]; uncompressed_size <<= 8; ++ uncompressed_size += start[6]; uncompressed_size <<= 8; ++ uncompressed_size += start[7]; uncompressed_size <<= 8; ++ uncompressed_size += start[8]; uncompressed_size <<= 8; ++ uncompressed_size += start[9]; uncompressed_size <<= 8; ++ uncompressed_size += start[10]; uncompressed_size <<= 8; ++ uncompressed_size += start[11]; ++ start += 12; ++ new_size -= 12; ++ } ++ ++ if (uncompressed_size) ++ { ++ if (uncompress_section_contents (& start, ++ uncompressed_size, & new_size)) ++ num_bytes = new_size; ++ else ++ { ++ error (_("Unable to decompress section %s\n"), ++ printable_section_name (filedata, section)); ++ goto error_out; ++ } ++ } ++ else ++ start = real_start; ++ } ++ ++ /* If the section being dumped has relocations against it the user might ++ be expecting these relocations to have been applied. Check for this ++ case and issue a warning message in order to avoid confusion. ++ FIXME: Maybe we ought to have an option that dumps a section with ++ relocs applied ? */ ++ for (relsec = filedata->section_headers; ++ relsec < filedata->section_headers + filedata->file_header.e_shnum; ++ ++relsec) ++ { ++ if ((relsec->sh_type != SHT_RELA && relsec->sh_type != SHT_REL) ++ || relsec->sh_info >= filedata->file_header.e_shnum ++ || filedata->section_headers + relsec->sh_info != section ++ || relsec->sh_size == 0 ++ || relsec->sh_link >= filedata->file_header.e_shnum) ++ continue; ++ ++ printf (_(" Note: This section has relocations against it, but these have NOT been applied to this dump.\n")); ++ break; ++ } ++ ++ data = start; ++ end = start + num_bytes; ++ some_strings_shown = FALSE; ++ ++#ifdef HAVE_MBSTATE_T ++ mbstate_t state; ++ /* Initialise the multibyte conversion state. */ ++ memset (& state, 0, sizeof (state)); ++#endif ++ ++ bfd_boolean continuing = FALSE; ++ ++ while (data < end) ++ { ++ while (!ISPRINT (* data)) ++ if (++ data >= end) ++ break; ++ ++ if (data < end) ++ { ++ size_t maxlen = end - data; ++ ++ if (continuing) ++ { ++ printf (" "); ++ continuing = FALSE; ++ } ++ else ++ { ++#ifndef __MSVCRT__ ++ /* PR 11128: Use two separate invocations in order to work ++ around bugs in the Solaris 8 implementation of printf. */ ++ printf (" [%6tx] ", data - start); ++#else ++ printf (" [%6Ix] ", (size_t) (data - start)); ++#endif ++ } ++ ++ if (maxlen > 0) ++ { ++ char c; ++ ++ while (maxlen) ++ { ++ c = *data++; ++ ++ if (c == 0) ++ break; ++ ++ /* PR 25543: Treat new-lines as string-ending characters. */ ++ if (c == '\n') ++ { ++ printf ("\\n\n"); ++ if (*data != 0) ++ continuing = TRUE; ++ break; ++ } ++ ++ /* Do not print control characters directly as they can affect terminal ++ settings. Such characters usually appear in the names generated ++ by the assembler for local labels. */ ++ if (ISCNTRL (c)) ++ { ++ printf ("^%c", c + 0x40); ++ } ++ else if (ISPRINT (c)) ++ { ++ putchar (c); ++ } ++ else ++ { ++ size_t n; ++#ifdef HAVE_MBSTATE_T ++ wchar_t w; ++#endif ++ /* Let printf do the hard work of displaying multibyte characters. */ ++ printf ("%.1s", data - 1); ++#ifdef HAVE_MBSTATE_T ++ /* Try to find out how many bytes made up the character that was ++ just printed. Advance the symbol pointer past the bytes that ++ were displayed. */ ++ n = mbrtowc (& w, (char *)(data - 1), MB_CUR_MAX, & state); ++#else ++ n = 1; ++#endif ++ if (n != (size_t) -1 && n != (size_t) -2 && n > 0) ++ data += (n - 1); ++ } ++ } ++ ++ if (c != '\n') ++ putchar ('\n'); ++ } ++ else ++ { ++ printf (_("\n")); ++ data = end; ++ } ++ some_strings_shown = TRUE; ++ } ++ } ++ ++ if (! some_strings_shown) ++ printf (_(" No strings found in this section.")); ++ ++ free (real_start); ++ ++ putchar ('\n'); ++ return TRUE; ++ ++error_out: ++ free (real_start); ++ return FALSE; ++} ++ ++static bfd_boolean ++dump_section_as_bytes (Elf_Internal_Shdr * section, ++ Filedata * filedata, ++ bfd_boolean relocate) ++{ ++ Elf_Internal_Shdr * relsec; ++ bfd_size_type bytes; ++ bfd_size_type section_size; ++ bfd_vma addr; ++ unsigned char * data; ++ unsigned char * real_start; ++ unsigned char * start; ++ ++ real_start = start = (unsigned char *) get_section_contents (section, filedata); ++ if (start == NULL) ++ /* PR 21820: Do not fail if the section was empty. */ ++ return (section->sh_size == 0 || section->sh_type == SHT_NOBITS) ? TRUE : FALSE; ++ ++ section_size = section->sh_size; ++ ++ printf (_("\nHex dump of section '%s':\n"), printable_section_name (filedata, section)); ++ ++ if (decompress_dumps) ++ { ++ dwarf_size_type new_size = section_size; ++ dwarf_size_type uncompressed_size = 0; ++ ++ if ((section->sh_flags & SHF_COMPRESSED) != 0) ++ { ++ Elf_Internal_Chdr chdr; ++ unsigned int compression_header_size ++ = get_compression_header (& chdr, start, section_size); ++ ++ if (compression_header_size == 0) ++ /* An error message will have already been generated ++ by get_compression_header. */ ++ goto error_out; ++ ++ if (chdr.ch_type != ELFCOMPRESS_ZLIB) ++ { ++ warn (_("section '%s' has unsupported compress type: %d\n"), ++ printable_section_name (filedata, section), chdr.ch_type); ++ goto error_out; ++ } ++ uncompressed_size = chdr.ch_size; ++ start += compression_header_size; ++ new_size -= compression_header_size; ++ } ++ else if (new_size > 12 && streq ((char *) start, "ZLIB")) ++ { ++ /* Read the zlib header. In this case, it should be "ZLIB" ++ followed by the uncompressed section size, 8 bytes in ++ big-endian order. */ ++ uncompressed_size = start[4]; uncompressed_size <<= 8; ++ uncompressed_size += start[5]; uncompressed_size <<= 8; ++ uncompressed_size += start[6]; uncompressed_size <<= 8; ++ uncompressed_size += start[7]; uncompressed_size <<= 8; ++ uncompressed_size += start[8]; uncompressed_size <<= 8; ++ uncompressed_size += start[9]; uncompressed_size <<= 8; ++ uncompressed_size += start[10]; uncompressed_size <<= 8; ++ uncompressed_size += start[11]; ++ start += 12; ++ new_size -= 12; ++ } ++ ++ if (uncompressed_size) ++ { ++ if (uncompress_section_contents (& start, uncompressed_size, ++ & new_size)) ++ { ++ section_size = new_size; ++ } ++ else ++ { ++ error (_("Unable to decompress section %s\n"), ++ printable_section_name (filedata, section)); ++ /* FIXME: Print the section anyway ? */ ++ goto error_out; ++ } ++ } ++ else ++ start = real_start; ++ } ++ ++ if (relocate) ++ { ++ if (! apply_relocations (filedata, section, start, section_size, NULL, NULL)) ++ goto error_out; ++ } ++ else ++ { ++ /* If the section being dumped has relocations against it the user might ++ be expecting these relocations to have been applied. Check for this ++ case and issue a warning message in order to avoid confusion. ++ FIXME: Maybe we ought to have an option that dumps a section with ++ relocs applied ? */ ++ for (relsec = filedata->section_headers; ++ relsec < filedata->section_headers + filedata->file_header.e_shnum; ++ ++relsec) ++ { ++ if ((relsec->sh_type != SHT_RELA && relsec->sh_type != SHT_REL) ++ || relsec->sh_info >= filedata->file_header.e_shnum ++ || filedata->section_headers + relsec->sh_info != section ++ || relsec->sh_size == 0 ++ || relsec->sh_link >= filedata->file_header.e_shnum) ++ continue; ++ ++ printf (_(" NOTE: This section has relocations against it, but these have NOT been applied to this dump.\n")); ++ break; ++ } ++ } ++ ++ addr = section->sh_addr; ++ bytes = section_size; ++ data = start; ++ ++ while (bytes) ++ { ++ int j; ++ int k; ++ int lbytes; ++ ++ lbytes = (bytes > 16 ? 16 : bytes); ++ ++ printf (" 0x%8.8lx ", (unsigned long) addr); ++ ++ for (j = 0; j < 16; j++) ++ { ++ if (j < lbytes) ++ printf ("%2.2x", data[j]); ++ else ++ printf (" "); ++ ++ if ((j & 3) == 3) ++ printf (" "); ++ } ++ ++ for (j = 0; j < lbytes; j++) ++ { ++ k = data[j]; ++ if (k >= ' ' && k < 0x7f) ++ printf ("%c", k); ++ else ++ printf ("."); ++ } ++ ++ putchar ('\n'); ++ ++ data += lbytes; ++ addr += lbytes; ++ bytes -= lbytes; ++ } ++ ++ free (real_start); ++ ++ putchar ('\n'); ++ return TRUE; ++ ++ error_out: ++ free (real_start); ++ return FALSE; ++} ++ ++#ifdef ENABLE_LIBCTF ++static ctf_sect_t * ++shdr_to_ctf_sect (ctf_sect_t *buf, Elf_Internal_Shdr *shdr, Filedata *filedata) ++{ ++ buf->cts_name = SECTION_NAME (shdr); ++ buf->cts_size = shdr->sh_size; ++ buf->cts_entsize = shdr->sh_entsize; ++ ++ return buf; ++} ++ ++/* Formatting callback function passed to ctf_dump. Returns either the pointer ++ it is passed, or a pointer to newly-allocated storage, in which case ++ dump_ctf() will free it when it no longer needs it. */ ++ ++static char * ++dump_ctf_indent_lines (ctf_sect_names_t sect ATTRIBUTE_UNUSED, ++ char *s, void *arg) ++{ ++ const char *blanks = arg; ++ char *new_s; ++ ++ if (asprintf (&new_s, "%s%s", blanks, s) < 0) ++ return s; ++ return new_s; ++} ++ ++/* Dump one CTF archive member. */ ++ ++static int ++dump_ctf_archive_member (ctf_file_t *ctf, const char *name, void *arg) ++{ ++ ctf_file_t *parent = (ctf_file_t *) arg; ++ const char *things[] = {"Header", "Labels", "Data objects", ++ "Function objects", "Variables", "Types", "Strings", ++ ""}; ++ const char **thing; ++ size_t i; ++ ++ /* Only print out the name of non-default-named archive members. ++ The name .ctf appears everywhere, even for things that aren't ++ really archives, so printing it out is liable to be confusing. ++ ++ The parent, if there is one, is the default-owned archive member: ++ avoid importing it into itself. (This does no harm, but looks ++ confusing.) */ ++ ++ if (strcmp (name, ".ctf") != 0) ++ { ++ printf (_("\nCTF archive member: %s:\n"), name); ++ ctf_import (ctf, parent); ++ } ++ ++ for (i = 0, thing = things; *thing[0]; thing++, i++) ++ { ++ ctf_dump_state_t *s = NULL; ++ char *item; ++ ++ printf ("\n %s:\n", *thing); ++ while ((item = ctf_dump (ctf, &s, i, dump_ctf_indent_lines, ++ (void *) " ")) != NULL) ++ { ++ printf ("%s\n", item); ++ free (item); ++ } ++ ++ if (ctf_errno (ctf)) ++ { ++ error (_("Iteration failed: %s, %s\n"), *thing, ++ ctf_errmsg (ctf_errno (ctf))); ++ return 1; ++ } ++ } ++ return 0; ++} ++ ++static bfd_boolean ++dump_section_as_ctf (Elf_Internal_Shdr * section, Filedata * filedata) ++{ ++ Elf_Internal_Shdr * parent_sec = NULL; ++ Elf_Internal_Shdr * symtab_sec = NULL; ++ Elf_Internal_Shdr * strtab_sec = NULL; ++ void * data = NULL; ++ void * symdata = NULL; ++ void * strdata = NULL; ++ void * parentdata = NULL; ++ ctf_sect_t ctfsect, symsect, strsect, parentsect; ++ ctf_sect_t * symsectp = NULL; ++ ctf_sect_t * strsectp = NULL; ++ ctf_archive_t * ctfa = NULL; ++ ctf_archive_t * parenta = NULL, *lookparent; ++ ctf_file_t * parent = NULL; ++ ++ int err; ++ bfd_boolean ret = FALSE; ++ ++ shdr_to_ctf_sect (&ctfsect, section, filedata); ++ data = get_section_contents (section, filedata); ++ ctfsect.cts_data = data; ++ ++ if (!dump_ctf_symtab_name) ++ dump_ctf_symtab_name = strdup (".symtab"); ++ ++ if (!dump_ctf_strtab_name) ++ dump_ctf_strtab_name = strdup (".strtab"); ++ ++ if (dump_ctf_symtab_name && dump_ctf_symtab_name[0] != 0) ++ { ++ if ((symtab_sec = find_section (filedata, dump_ctf_symtab_name)) == NULL) ++ { ++ error (_("No symbol section named %s\n"), dump_ctf_symtab_name); ++ goto fail; ++ } ++ if ((symdata = (void *) get_data (NULL, filedata, ++ symtab_sec->sh_offset, 1, ++ symtab_sec->sh_size, ++ _("symbols"))) == NULL) ++ goto fail; ++ symsectp = shdr_to_ctf_sect (&symsect, symtab_sec, filedata); ++ symsect.cts_data = symdata; ++ } ++ if (dump_ctf_strtab_name && dump_ctf_symtab_name[0] != 0) ++ { ++ if ((strtab_sec = find_section (filedata, dump_ctf_strtab_name)) == NULL) ++ { ++ error (_("No string table section named %s\n"), ++ dump_ctf_strtab_name); ++ goto fail; ++ } ++ if ((strdata = (void *) get_data (NULL, filedata, ++ strtab_sec->sh_offset, 1, ++ strtab_sec->sh_size, ++ _("strings"))) == NULL) ++ goto fail; ++ strsectp = shdr_to_ctf_sect (&strsect, strtab_sec, filedata); ++ strsect.cts_data = strdata; ++ } ++ if (dump_ctf_parent_name) ++ { ++ if ((parent_sec = find_section (filedata, dump_ctf_parent_name)) == NULL) ++ { ++ error (_("No CTF parent section named %s\n"), dump_ctf_parent_name); ++ goto fail; ++ } ++ if ((parentdata = (void *) get_data (NULL, filedata, ++ parent_sec->sh_offset, 1, ++ parent_sec->sh_size, ++ _("CTF parent"))) == NULL) ++ goto fail; ++ shdr_to_ctf_sect (&parentsect, parent_sec, filedata); ++ parentsect.cts_data = parentdata; ++ } ++ ++ /* Load the CTF file and dump it. It may be a raw CTF section, or an archive: ++ libctf papers over the difference, so we can pretend it is always an ++ archive. Possibly open the parent as well, if one was specified. */ ++ ++ if ((ctfa = ctf_arc_bufopen (&ctfsect, symsectp, strsectp, &err)) == NULL) ++ { ++ error (_("CTF open failure: %s\n"), ctf_errmsg (err)); ++ goto fail; ++ } ++ ++ if (parentdata) ++ { ++ if ((parenta = ctf_arc_bufopen (&parentsect, symsectp, strsectp, ++ &err)) == NULL) ++ { ++ error (_("CTF open failure: %s\n"), ctf_errmsg (err)); ++ goto fail; ++ } ++ lookparent = parenta; ++ } ++ else ++ lookparent = ctfa; ++ ++ /* Assume that the applicable parent archive member is the default one. ++ (This is what all known implementations are expected to do, if they ++ put CTFs and their parents in archives together.) */ ++ if ((parent = ctf_arc_open_by_name (lookparent, NULL, &err)) == NULL) ++ { ++ error (_("CTF open failure: %s\n"), ctf_errmsg (err)); ++ goto fail; ++ } ++ ++ ret = TRUE; ++ ++ printf (_("\nDump of CTF section '%s':\n"), ++ printable_section_name (filedata, section)); ++ ++ if (ctf_archive_iter (ctfa, dump_ctf_archive_member, parent) != 0) ++ ret = FALSE; ++ ++ fail: ++ ctf_file_close (parent); ++ ctf_close (ctfa); ++ ctf_close (parenta); ++ free (parentdata); ++ free (data); ++ free (symdata); ++ free (strdata); ++ return ret; ++} ++#endif ++ ++static bfd_boolean ++load_specific_debug_section (enum dwarf_section_display_enum debug, ++ const Elf_Internal_Shdr * sec, ++ void * data) ++{ ++ struct dwarf_section * section = &debug_displays [debug].section; ++ char buf [64]; ++ Filedata * filedata = (Filedata *) data; ++ ++ if (section->start != NULL) ++ { ++ /* If it is already loaded, do nothing. */ ++ if (streq (section->filename, filedata->file_name)) ++ return TRUE; ++ free (section->start); ++ } ++ ++ snprintf (buf, sizeof (buf), _("%s section data"), section->name); ++ section->address = sec->sh_addr; ++ section->user_data = NULL; ++ section->filename = filedata->file_name; ++ section->start = (unsigned char *) get_data (NULL, filedata, ++ sec->sh_offset, 1, ++ sec->sh_size, buf); ++ if (section->start == NULL) ++ section->size = 0; ++ else ++ { ++ unsigned char *start = section->start; ++ dwarf_size_type size = sec->sh_size; ++ dwarf_size_type uncompressed_size = 0; ++ ++ if ((sec->sh_flags & SHF_COMPRESSED) != 0) ++ { ++ Elf_Internal_Chdr chdr; ++ unsigned int compression_header_size; ++ ++ if (size < (is_32bit_elf ++ ? sizeof (Elf32_External_Chdr) ++ : sizeof (Elf64_External_Chdr))) ++ { ++ warn (_("compressed section %s is too small to contain a compression header\n"), ++ section->name); ++ return FALSE; ++ } ++ ++ compression_header_size = get_compression_header (&chdr, start, size); ++ if (compression_header_size == 0) ++ /* An error message will have already been generated ++ by get_compression_header. */ ++ return FALSE; ++ ++ if (chdr.ch_type != ELFCOMPRESS_ZLIB) ++ { ++ warn (_("section '%s' has unsupported compress type: %d\n"), ++ section->name, chdr.ch_type); ++ return FALSE; ++ } ++ uncompressed_size = chdr.ch_size; ++ start += compression_header_size; ++ size -= compression_header_size; ++ } ++ else if (size > 12 && streq ((char *) start, "ZLIB")) ++ { ++ /* Read the zlib header. In this case, it should be "ZLIB" ++ followed by the uncompressed section size, 8 bytes in ++ big-endian order. */ ++ uncompressed_size = start[4]; uncompressed_size <<= 8; ++ uncompressed_size += start[5]; uncompressed_size <<= 8; ++ uncompressed_size += start[6]; uncompressed_size <<= 8; ++ uncompressed_size += start[7]; uncompressed_size <<= 8; ++ uncompressed_size += start[8]; uncompressed_size <<= 8; ++ uncompressed_size += start[9]; uncompressed_size <<= 8; ++ uncompressed_size += start[10]; uncompressed_size <<= 8; ++ uncompressed_size += start[11]; ++ start += 12; ++ size -= 12; ++ } ++ ++ if (uncompressed_size) ++ { ++ if (uncompress_section_contents (&start, uncompressed_size, ++ &size)) ++ { ++ /* Free the compressed buffer, update the section buffer ++ and the section size if uncompress is successful. */ ++ free (section->start); ++ section->start = start; ++ } ++ else ++ { ++ error (_("Unable to decompress section %s\n"), ++ printable_section_name (filedata, sec)); ++ return FALSE; ++ } ++ } ++ ++ section->size = size; ++ } ++ ++ if (section->start == NULL) ++ return FALSE; ++ ++ if (debug_displays [debug].relocate) ++ { ++ if (! apply_relocations (filedata, sec, section->start, section->size, ++ & section->reloc_info, & section->num_relocs)) ++ return FALSE; ++ } ++ else ++ { ++ section->reloc_info = NULL; ++ section->num_relocs = 0; ++ } ++ ++ return TRUE; ++} ++ ++#if HAVE_LIBDEBUGINFOD ++/* Return a hex string representation of the build-id. */ ++unsigned char * ++get_build_id (void * data) ++{ ++ Filedata * filedata = (Filedata *)data; ++ Elf_Internal_Shdr * shdr; ++ unsigned long i; ++ ++ /* Iterate through notes to find note.gnu.build-id. ++ FIXME: Only the first note in any note section is examined. */ ++ for (i = 0, shdr = filedata->section_headers; ++ i < filedata->file_header.e_shnum && shdr != NULL; ++ i++, shdr++) ++ { ++ if (shdr->sh_type != SHT_NOTE) ++ continue; ++ ++ char * next; ++ char * end; ++ size_t data_remaining; ++ size_t min_notesz; ++ Elf_External_Note * enote; ++ Elf_Internal_Note inote; ++ ++ bfd_vma offset = shdr->sh_offset; ++ bfd_vma align = shdr->sh_addralign; ++ bfd_vma length = shdr->sh_size; ++ ++ enote = (Elf_External_Note *) get_section_contents (shdr, filedata); ++ if (enote == NULL) ++ continue; ++ ++ if (align < 4) ++ align = 4; ++ else if (align != 4 && align != 8) ++ { ++ free (enote); ++ continue; ++ } ++ ++ end = (char *) enote + length; ++ data_remaining = end - (char *) enote; ++ ++ if (!is_ia64_vms (filedata)) ++ { ++ min_notesz = offsetof (Elf_External_Note, name); ++ if (data_remaining < min_notesz) ++ { ++ warn (_("\ ++malformed note encountered in section %s whilst scanning for build-id note\n"), ++ printable_section_name (filedata, shdr)); ++ free (enote); ++ continue; ++ } ++ data_remaining -= min_notesz; ++ ++ inote.type = BYTE_GET (enote->type); ++ inote.namesz = BYTE_GET (enote->namesz); ++ inote.namedata = enote->name; ++ inote.descsz = BYTE_GET (enote->descsz); ++ inote.descdata = ((char *) enote ++ + ELF_NOTE_DESC_OFFSET (inote.namesz, align)); ++ inote.descpos = offset + (inote.descdata - (char *) enote); ++ next = ((char *) enote ++ + ELF_NOTE_NEXT_OFFSET (inote.namesz, inote.descsz, align)); ++ } ++ else ++ { ++ Elf64_External_VMS_Note *vms_enote; ++ ++ /* PR binutils/15191 ++ Make sure that there is enough data to read. */ ++ min_notesz = offsetof (Elf64_External_VMS_Note, name); ++ if (data_remaining < min_notesz) ++ { ++ warn (_("\ ++malformed note encountered in section %s whilst scanning for build-id note\n"), ++ printable_section_name (filedata, shdr)); ++ free (enote); ++ continue; ++ } ++ data_remaining -= min_notesz; ++ ++ vms_enote = (Elf64_External_VMS_Note *) enote; ++ inote.type = BYTE_GET (vms_enote->type); ++ inote.namesz = BYTE_GET (vms_enote->namesz); ++ inote.namedata = vms_enote->name; ++ inote.descsz = BYTE_GET (vms_enote->descsz); ++ inote.descdata = inote.namedata + align_power (inote.namesz, 3); ++ inote.descpos = offset + (inote.descdata - (char *) enote); ++ next = inote.descdata + align_power (inote.descsz, 3); ++ } ++ ++ /* Skip malformed notes. */ ++ if ((size_t) (inote.descdata - inote.namedata) < inote.namesz ++ || (size_t) (inote.descdata - inote.namedata) > data_remaining ++ || (size_t) (next - inote.descdata) < inote.descsz ++ || ((size_t) (next - inote.descdata) ++ > data_remaining - (size_t) (inote.descdata - inote.namedata))) ++ { ++ warn (_("\ ++malformed note encountered in section %s whilst scanning for build-id note\n"), ++ printable_section_name (filedata, shdr)); ++ free (enote); ++ continue; ++ } ++ ++ /* Check if this is the build-id note. If so then convert the build-id ++ bytes to a hex string. */ ++ if (inote.namesz > 0 ++ && const_strneq (inote.namedata, "GNU") ++ && inote.type == NT_GNU_BUILD_ID) ++ { ++ unsigned long j; ++ char * build_id; ++ ++ build_id = malloc (inote.descsz * 2 + 1); ++ if (build_id == NULL) ++ { ++ free (enote); ++ return NULL; ++ } ++ ++ for (j = 0; j < inote.descsz; ++j) ++ sprintf (build_id + (j * 2), "%02x", inote.descdata[j] & 0xff); ++ build_id[inote.descsz * 2] = '\0'; ++ free (enote); ++ ++ return (unsigned char *) build_id; ++ } ++ free (enote); ++ } ++ ++ return NULL; ++} ++#endif /* HAVE_LIBDEBUGINFOD */ ++ ++/* If this is not NULL, load_debug_section will only look for sections ++ within the list of sections given here. */ ++static unsigned int * section_subset = NULL; ++ ++bfd_boolean ++load_debug_section (enum dwarf_section_display_enum debug, void * data) ++{ ++ struct dwarf_section * section = &debug_displays [debug].section; ++ Elf_Internal_Shdr * sec; ++ Filedata * filedata = (Filedata *) data; ++ ++ /* Without section headers we cannot find any sections. */ ++ if (filedata->section_headers == NULL) ++ return FALSE; ++ ++ if (filedata->string_table == NULL ++ && filedata->file_header.e_shstrndx != SHN_UNDEF ++ && filedata->file_header.e_shstrndx < filedata->file_header.e_shnum) ++ { ++ Elf_Internal_Shdr * strs; ++ ++ /* Read in the string table, so that we have section names to scan. */ ++ strs = filedata->section_headers + filedata->file_header.e_shstrndx; ++ ++ if (strs != NULL && strs->sh_size != 0) ++ { ++ filedata->string_table ++ = (char *) get_data (NULL, filedata, strs->sh_offset, ++ 1, strs->sh_size, _("string table")); ++ ++ filedata->string_table_length ++ = filedata->string_table != NULL ? strs->sh_size : 0; ++ } ++ } ++ ++ /* Locate the debug section. */ ++ sec = find_section_in_set (filedata, section->uncompressed_name, section_subset); ++ if (sec != NULL) ++ section->name = section->uncompressed_name; ++ else ++ { ++ sec = find_section_in_set (filedata, section->compressed_name, section_subset); ++ if (sec != NULL) ++ section->name = section->compressed_name; ++ } ++ if (sec == NULL) ++ return FALSE; ++ ++ /* If we're loading from a subset of sections, and we've loaded ++ a section matching this name before, it's likely that it's a ++ different one. */ ++ if (section_subset != NULL) ++ free_debug_section (debug); ++ ++ return load_specific_debug_section (debug, sec, data); ++} ++ ++void ++free_debug_section (enum dwarf_section_display_enum debug) ++{ ++ struct dwarf_section * section = &debug_displays [debug].section; ++ ++ if (section->start == NULL) ++ return; ++ ++ free ((char *) section->start); ++ section->start = NULL; ++ section->address = 0; ++ section->size = 0; ++ ++ free (section->reloc_info); ++ section->reloc_info = NULL; ++ section->num_relocs = 0; ++} ++ ++static bfd_boolean ++display_debug_section (int shndx, Elf_Internal_Shdr * section, Filedata * filedata) ++{ ++ char * name = SECTION_NAME (section); ++ const char * print_name = printable_section_name (filedata, section); ++ bfd_size_type length; ++ bfd_boolean result = TRUE; ++ int i; ++ ++ length = section->sh_size; ++ if (length == 0) ++ { ++ printf (_("\nSection '%s' has no debugging data.\n"), print_name); ++ return TRUE; ++ } ++ if (section->sh_type == SHT_NOBITS) ++ { ++ /* There is no point in dumping the contents of a debugging section ++ which has the NOBITS type - the bits in the file will be random. ++ This can happen when a file containing a .eh_frame section is ++ stripped with the --only-keep-debug command line option. */ ++ printf (_("section '%s' has the NOBITS type - its contents are unreliable.\n"), ++ print_name); ++ return FALSE; ++ } ++ ++ if (const_strneq (name, ".gnu.linkonce.wi.")) ++ name = ".debug_info"; ++ ++ /* See if we know how to display the contents of this section. */ ++ for (i = 0; i < max; i++) ++ { ++ enum dwarf_section_display_enum id = (enum dwarf_section_display_enum) i; ++ struct dwarf_section_display * display = debug_displays + i; ++ struct dwarf_section * sec = & display->section; ++ ++ if (streq (sec->uncompressed_name, name) ++ || (id == line && const_strneq (name, ".debug_line.")) ++ || streq (sec->compressed_name, name)) ++ { ++ bfd_boolean secondary = (section != find_section (filedata, name)); ++ ++ if (secondary) ++ free_debug_section (id); ++ ++ if (i == line && const_strneq (name, ".debug_line.")) ++ sec->name = name; ++ else if (streq (sec->uncompressed_name, name)) ++ sec->name = sec->uncompressed_name; ++ else ++ sec->name = sec->compressed_name; ++ ++ if (load_specific_debug_section (id, section, filedata)) ++ { ++ /* If this debug section is part of a CU/TU set in a .dwp file, ++ restrict load_debug_section to the sections in that set. */ ++ section_subset = find_cu_tu_set (filedata, shndx); ++ ++ result &= display->display (sec, filedata); ++ ++ section_subset = NULL; ++ ++ if (secondary || (id != info && id != abbrev)) ++ free_debug_section (id); ++ } ++ break; ++ } ++ } ++ ++ if (i == max) ++ { ++ printf (_("Unrecognized debug section: %s\n"), print_name); ++ result = FALSE; ++ } ++ ++ return result; ++} ++ ++/* Set DUMP_SECTS for all sections where dumps were requested ++ based on section name. */ ++ ++static void ++initialise_dumps_byname (Filedata * filedata) ++{ ++ struct dump_list_entry * cur; ++ ++ for (cur = dump_sects_byname; cur; cur = cur->next) ++ { ++ unsigned int i; ++ bfd_boolean any = FALSE; ++ ++ for (i = 0; i < filedata->file_header.e_shnum; i++) ++ if (streq (SECTION_NAME (filedata->section_headers + i), cur->name)) ++ { ++ request_dump_bynumber (&filedata->dump, i, cur->type); ++ any = TRUE; ++ } ++ ++ if (!any) ++ warn (_("Section '%s' was not dumped because it does not exist!\n"), ++ cur->name); ++ } ++} ++ ++static bfd_boolean ++process_section_contents (Filedata * filedata) ++{ ++ Elf_Internal_Shdr * section; ++ unsigned int i; ++ bfd_boolean res = TRUE; ++ ++ if (! do_dump) ++ return TRUE; ++ ++ initialise_dumps_byname (filedata); ++ ++ for (i = 0, section = filedata->section_headers; ++ i < filedata->file_header.e_shnum && i < filedata->dump.num_dump_sects; ++ i++, section++) ++ { ++ dump_type dump = filedata->dump.dump_sects[i]; ++ ++#ifdef SUPPORT_DISASSEMBLY ++ if (dump & DISASS_DUMP) ++ { ++ if (! disassemble_section (section, filedata)) ++ res = FALSE; ++ } ++#endif ++ if (dump & HEX_DUMP) ++ { ++ if (! dump_section_as_bytes (section, filedata, FALSE)) ++ res = FALSE; ++ } ++ ++ if (dump & RELOC_DUMP) ++ { ++ if (! dump_section_as_bytes (section, filedata, TRUE)) ++ res = FALSE; ++ } ++ ++ if (dump & STRING_DUMP) ++ { ++ if (! dump_section_as_strings (section, filedata)) ++ res = FALSE; ++ } ++ ++ if (dump & DEBUG_DUMP) ++ { ++ if (! display_debug_section (i, section, filedata)) ++ res = FALSE; ++ } ++ ++#ifdef ENABLE_LIBCTF ++ if (dump & CTF_DUMP) ++ { ++ if (! dump_section_as_ctf (section, filedata)) ++ res = FALSE; ++ } ++#endif ++ } ++ ++ /* Check to see if the user requested a ++ dump of a section that does not exist. */ ++ while (i < filedata->dump.num_dump_sects) ++ { ++ if (filedata->dump.dump_sects[i]) ++ { ++ warn (_("Section %d was not dumped because it does not exist!\n"), i); ++ res = FALSE; ++ } ++ i++; ++ } ++ ++ return res; ++} ++ ++static void ++process_mips_fpe_exception (int mask) ++{ ++ if (mask) ++ { ++ bfd_boolean first = TRUE; ++ ++ if (mask & OEX_FPU_INEX) ++ fputs ("INEX", stdout), first = FALSE; ++ if (mask & OEX_FPU_UFLO) ++ printf ("%sUFLO", first ? "" : "|"), first = FALSE; ++ if (mask & OEX_FPU_OFLO) ++ printf ("%sOFLO", first ? "" : "|"), first = FALSE; ++ if (mask & OEX_FPU_DIV0) ++ printf ("%sDIV0", first ? "" : "|"), first = FALSE; ++ if (mask & OEX_FPU_INVAL) ++ printf ("%sINVAL", first ? "" : "|"); ++ } ++ else ++ fputs ("0", stdout); ++} ++ ++/* Display's the value of TAG at location P. If TAG is ++ greater than 0 it is assumed to be an unknown tag, and ++ a message is printed to this effect. Otherwise it is ++ assumed that a message has already been printed. ++ ++ If the bottom bit of TAG is set it assumed to have a ++ string value, otherwise it is assumed to have an integer ++ value. ++ ++ Returns an updated P pointing to the first unread byte ++ beyond the end of TAG's value. ++ ++ Reads at or beyond END will not be made. */ ++ ++static unsigned char * ++display_tag_value (signed int tag, ++ unsigned char * p, ++ const unsigned char * const end) ++{ ++ unsigned long val; ++ ++ if (tag > 0) ++ printf (" Tag_unknown_%d: ", tag); ++ ++ if (p >= end) ++ { ++ warn (_("\n")); ++ } ++ else if (tag & 1) ++ { ++ /* PR 17531 file: 027-19978-0.004. */ ++ size_t maxlen = (end - p) - 1; ++ ++ putchar ('"'); ++ if (maxlen > 0) ++ { ++ print_symbol ((int) maxlen, (const char *) p); ++ p += strnlen ((char *) p, maxlen) + 1; ++ } ++ else ++ { ++ printf (_("")); ++ p = (unsigned char *) end; ++ } ++ printf ("\"\n"); ++ } ++ else ++ { ++ READ_ULEB (val, p, end); ++ printf ("%ld (0x%lx)\n", val, val); ++ } ++ ++ assert (p <= end); ++ return p; ++} ++ ++/* ARC ABI attributes section. */ ++ ++static unsigned char * ++display_arc_attribute (unsigned char * p, ++ const unsigned char * const end) ++{ ++ unsigned int tag; ++ unsigned int val; ++ ++ READ_ULEB (tag, p, end); ++ ++ switch (tag) ++ { ++ case Tag_ARC_PCS_config: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ARC_PCS_config: "); ++ switch (val) ++ { ++ case 0: ++ printf (_("Absent/Non standard\n")); ++ break; ++ case 1: ++ printf (_("Bare metal/mwdt\n")); ++ break; ++ case 2: ++ printf (_("Bare metal/newlib\n")); ++ break; ++ case 3: ++ printf (_("Linux/uclibc\n")); ++ break; ++ case 4: ++ printf (_("Linux/glibc\n")); ++ break; ++ default: ++ printf (_("Unknown\n")); ++ break; ++ } ++ break; ++ ++ case Tag_ARC_CPU_base: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ARC_CPU_base: "); ++ switch (val) ++ { ++ default: ++ case TAG_CPU_NONE: ++ printf (_("Absent\n")); ++ break; ++ case TAG_CPU_ARC6xx: ++ printf ("ARC6xx\n"); ++ break; ++ case TAG_CPU_ARC7xx: ++ printf ("ARC7xx\n"); ++ break; ++ case TAG_CPU_ARCEM: ++ printf ("ARCEM\n"); ++ break; ++ case TAG_CPU_ARCHS: ++ printf ("ARCHS\n"); ++ break; ++ } ++ break; ++ ++ case Tag_ARC_CPU_variation: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ARC_CPU_variation: "); ++ switch (val) ++ { ++ default: ++ if (val > 0 && val < 16) ++ printf ("Core%d\n", val); ++ else ++ printf ("Unknown\n"); ++ break; ++ ++ case 0: ++ printf (_("Absent\n")); ++ break; ++ } ++ break; ++ ++ case Tag_ARC_CPU_name: ++ printf (" Tag_ARC_CPU_name: "); ++ p = display_tag_value (-1, p, end); ++ break; ++ ++ case Tag_ARC_ABI_rf16: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ARC_ABI_rf16: %s\n", val ? _("yes") : _("no")); ++ break; ++ ++ case Tag_ARC_ABI_osver: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ARC_ABI_osver: v%d\n", val); ++ break; ++ ++ case Tag_ARC_ABI_pic: ++ case Tag_ARC_ABI_sda: ++ READ_ULEB (val, p, end); ++ printf (tag == Tag_ARC_ABI_sda ? " Tag_ARC_ABI_sda: " ++ : " Tag_ARC_ABI_pic: "); ++ switch (val) ++ { ++ case 0: ++ printf (_("Absent\n")); ++ break; ++ case 1: ++ printf ("MWDT\n"); ++ break; ++ case 2: ++ printf ("GNU\n"); ++ break; ++ default: ++ printf (_("Unknown\n")); ++ break; ++ } ++ break; ++ ++ case Tag_ARC_ABI_tls: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ARC_ABI_tls: %s\n", val ? "r25": "none"); ++ break; ++ ++ case Tag_ARC_ABI_enumsize: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ARC_ABI_enumsize: %s\n", val ? _("default") : ++ _("smallest")); ++ break; ++ ++ case Tag_ARC_ABI_exceptions: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ARC_ABI_exceptions: %s\n", val ? _("OPTFP") ++ : _("default")); ++ break; ++ ++ case Tag_ARC_ABI_double_size: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ARC_ABI_double_size: %d\n", val); ++ break; ++ ++ case Tag_ARC_ISA_config: ++ printf (" Tag_ARC_ISA_config: "); ++ p = display_tag_value (-1, p, end); ++ break; ++ ++ case Tag_ARC_ISA_apex: ++ printf (" Tag_ARC_ISA_apex: "); ++ p = display_tag_value (-1, p, end); ++ break; ++ ++ case Tag_ARC_ISA_mpy_option: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ARC_ISA_mpy_option: %d\n", val); ++ break; ++ ++ case Tag_ARC_ATR_version: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ARC_ATR_version: %d\n", val); ++ break; ++ ++ default: ++ return display_tag_value (tag & 1, p, end); ++ } ++ ++ return p; ++} ++ ++/* ARM EABI attributes section. */ ++typedef struct ++{ ++ unsigned int tag; ++ const char * name; ++ /* 0 = special, 1 = string, 2 = uleb123, > 0x80 == table lookup. */ ++ unsigned int type; ++ const char ** table; ++} arm_attr_public_tag; ++ ++static const char * arm_attr_tag_CPU_arch[] = ++ {"Pre-v4", "v4", "v4T", "v5T", "v5TE", "v5TEJ", "v6", "v6KZ", "v6T2", ++ "v6K", "v7", "v6-M", "v6S-M", "v7E-M", "v8", "v8-R", "v8-M.baseline", ++ "v8-M.mainline", "", "", "", "v8.1-M.mainline"}; ++static const char * arm_attr_tag_ARM_ISA_use[] = {"No", "Yes"}; ++static const char * arm_attr_tag_THUMB_ISA_use[] = ++ {"No", "Thumb-1", "Thumb-2", "Yes"}; ++static const char * arm_attr_tag_FP_arch[] = ++ {"No", "VFPv1", "VFPv2", "VFPv3", "VFPv3-D16", "VFPv4", "VFPv4-D16", ++ "FP for ARMv8", "FPv5/FP-D16 for ARMv8"}; ++static const char * arm_attr_tag_WMMX_arch[] = {"No", "WMMXv1", "WMMXv2"}; ++static const char * arm_attr_tag_Advanced_SIMD_arch[] = ++ {"No", "NEONv1", "NEONv1 with Fused-MAC", "NEON for ARMv8", ++ "NEON for ARMv8.1"}; ++static const char * arm_attr_tag_PCS_config[] = ++ {"None", "Bare platform", "Linux application", "Linux DSO", "PalmOS 2004", ++ "PalmOS (reserved)", "SymbianOS 2004", "SymbianOS (reserved)"}; ++static const char * arm_attr_tag_ABI_PCS_R9_use[] = ++ {"V6", "SB", "TLS", "Unused"}; ++static const char * arm_attr_tag_ABI_PCS_RW_data[] = ++ {"Absolute", "PC-relative", "SB-relative", "None"}; ++static const char * arm_attr_tag_ABI_PCS_RO_data[] = ++ {"Absolute", "PC-relative", "None"}; ++static const char * arm_attr_tag_ABI_PCS_GOT_use[] = ++ {"None", "direct", "GOT-indirect"}; ++static const char * arm_attr_tag_ABI_PCS_wchar_t[] = ++ {"None", "??? 1", "2", "??? 3", "4"}; ++static const char * arm_attr_tag_ABI_FP_rounding[] = {"Unused", "Needed"}; ++static const char * arm_attr_tag_ABI_FP_denormal[] = ++ {"Unused", "Needed", "Sign only"}; ++static const char * arm_attr_tag_ABI_FP_exceptions[] = {"Unused", "Needed"}; ++static const char * arm_attr_tag_ABI_FP_user_exceptions[] = {"Unused", "Needed"}; ++static const char * arm_attr_tag_ABI_FP_number_model[] = ++ {"Unused", "Finite", "RTABI", "IEEE 754"}; ++static const char * arm_attr_tag_ABI_enum_size[] = ++ {"Unused", "small", "int", "forced to int"}; ++static const char * arm_attr_tag_ABI_HardFP_use[] = ++ {"As Tag_FP_arch", "SP only", "Reserved", "Deprecated"}; ++static const char * arm_attr_tag_ABI_VFP_args[] = ++ {"AAPCS", "VFP registers", "custom", "compatible"}; ++static const char * arm_attr_tag_ABI_WMMX_args[] = ++ {"AAPCS", "WMMX registers", "custom"}; ++static const char * arm_attr_tag_ABI_optimization_goals[] = ++ {"None", "Prefer Speed", "Aggressive Speed", "Prefer Size", ++ "Aggressive Size", "Prefer Debug", "Aggressive Debug"}; ++static const char * arm_attr_tag_ABI_FP_optimization_goals[] = ++ {"None", "Prefer Speed", "Aggressive Speed", "Prefer Size", ++ "Aggressive Size", "Prefer Accuracy", "Aggressive Accuracy"}; ++static const char * arm_attr_tag_CPU_unaligned_access[] = {"None", "v6"}; ++static const char * arm_attr_tag_FP_HP_extension[] = ++ {"Not Allowed", "Allowed"}; ++static const char * arm_attr_tag_ABI_FP_16bit_format[] = ++ {"None", "IEEE 754", "Alternative Format"}; ++static const char * arm_attr_tag_DSP_extension[] = ++ {"Follow architecture", "Allowed"}; ++static const char * arm_attr_tag_MPextension_use[] = ++ {"Not Allowed", "Allowed"}; ++static const char * arm_attr_tag_DIV_use[] = ++ {"Allowed in Thumb-ISA, v7-R or v7-M", "Not allowed", ++ "Allowed in v7-A with integer division extension"}; ++static const char * arm_attr_tag_T2EE_use[] = {"Not Allowed", "Allowed"}; ++static const char * arm_attr_tag_Virtualization_use[] = ++ {"Not Allowed", "TrustZone", "Virtualization Extensions", ++ "TrustZone and Virtualization Extensions"}; ++static const char * arm_attr_tag_MPextension_use_legacy[] = ++ {"Not Allowed", "Allowed"}; ++ ++static const char * arm_attr_tag_MVE_arch[] = ++ {"No MVE", "MVE Integer only", "MVE Integer and FP"}; ++ ++#define LOOKUP(id, name) \ ++ {id, #name, 0x80 | ARRAY_SIZE(arm_attr_tag_##name), arm_attr_tag_##name} ++static arm_attr_public_tag arm_attr_public_tags[] = ++{ ++ {4, "CPU_raw_name", 1, NULL}, ++ {5, "CPU_name", 1, NULL}, ++ LOOKUP(6, CPU_arch), ++ {7, "CPU_arch_profile", 0, NULL}, ++ LOOKUP(8, ARM_ISA_use), ++ LOOKUP(9, THUMB_ISA_use), ++ LOOKUP(10, FP_arch), ++ LOOKUP(11, WMMX_arch), ++ LOOKUP(12, Advanced_SIMD_arch), ++ LOOKUP(13, PCS_config), ++ LOOKUP(14, ABI_PCS_R9_use), ++ LOOKUP(15, ABI_PCS_RW_data), ++ LOOKUP(16, ABI_PCS_RO_data), ++ LOOKUP(17, ABI_PCS_GOT_use), ++ LOOKUP(18, ABI_PCS_wchar_t), ++ LOOKUP(19, ABI_FP_rounding), ++ LOOKUP(20, ABI_FP_denormal), ++ LOOKUP(21, ABI_FP_exceptions), ++ LOOKUP(22, ABI_FP_user_exceptions), ++ LOOKUP(23, ABI_FP_number_model), ++ {24, "ABI_align_needed", 0, NULL}, ++ {25, "ABI_align_preserved", 0, NULL}, ++ LOOKUP(26, ABI_enum_size), ++ LOOKUP(27, ABI_HardFP_use), ++ LOOKUP(28, ABI_VFP_args), ++ LOOKUP(29, ABI_WMMX_args), ++ LOOKUP(30, ABI_optimization_goals), ++ LOOKUP(31, ABI_FP_optimization_goals), ++ {32, "compatibility", 0, NULL}, ++ LOOKUP(34, CPU_unaligned_access), ++ LOOKUP(36, FP_HP_extension), ++ LOOKUP(38, ABI_FP_16bit_format), ++ LOOKUP(42, MPextension_use), ++ LOOKUP(44, DIV_use), ++ LOOKUP(46, DSP_extension), ++ LOOKUP(48, MVE_arch), ++ {64, "nodefaults", 0, NULL}, ++ {65, "also_compatible_with", 0, NULL}, ++ LOOKUP(66, T2EE_use), ++ {67, "conformance", 1, NULL}, ++ LOOKUP(68, Virtualization_use), ++ LOOKUP(70, MPextension_use_legacy) ++}; ++#undef LOOKUP ++ ++static unsigned char * ++display_arm_attribute (unsigned char * p, ++ const unsigned char * const end) ++{ ++ unsigned int tag; ++ unsigned int val; ++ arm_attr_public_tag * attr; ++ unsigned i; ++ unsigned int type; ++ ++ READ_ULEB (tag, p, end); ++ attr = NULL; ++ for (i = 0; i < ARRAY_SIZE (arm_attr_public_tags); i++) ++ { ++ if (arm_attr_public_tags[i].tag == tag) ++ { ++ attr = &arm_attr_public_tags[i]; ++ break; ++ } ++ } ++ ++ if (attr) ++ { ++ printf (" Tag_%s: ", attr->name); ++ switch (attr->type) ++ { ++ case 0: ++ switch (tag) ++ { ++ case 7: /* Tag_CPU_arch_profile. */ ++ READ_ULEB (val, p, end); ++ switch (val) ++ { ++ case 0: printf (_("None\n")); break; ++ case 'A': printf (_("Application\n")); break; ++ case 'R': printf (_("Realtime\n")); break; ++ case 'M': printf (_("Microcontroller\n")); break; ++ case 'S': printf (_("Application or Realtime\n")); break; ++ default: printf ("??? (%d)\n", val); break; ++ } ++ break; ++ ++ case 24: /* Tag_align_needed. */ ++ READ_ULEB (val, p, end); ++ switch (val) ++ { ++ case 0: printf (_("None\n")); break; ++ case 1: printf (_("8-byte\n")); break; ++ case 2: printf (_("4-byte\n")); break; ++ case 3: printf ("??? 3\n"); break; ++ default: ++ if (val <= 12) ++ printf (_("8-byte and up to %d-byte extended\n"), ++ 1 << val); ++ else ++ printf ("??? (%d)\n", val); ++ break; ++ } ++ break; ++ ++ case 25: /* Tag_align_preserved. */ ++ READ_ULEB (val, p, end); ++ switch (val) ++ { ++ case 0: printf (_("None\n")); break; ++ case 1: printf (_("8-byte, except leaf SP\n")); break; ++ case 2: printf (_("8-byte\n")); break; ++ case 3: printf ("??? 3\n"); break; ++ default: ++ if (val <= 12) ++ printf (_("8-byte and up to %d-byte extended\n"), ++ 1 << val); ++ else ++ printf ("??? (%d)\n", val); ++ break; ++ } ++ break; ++ ++ case 32: /* Tag_compatibility. */ ++ { ++ READ_ULEB (val, p, end); ++ printf (_("flag = %d, vendor = "), val); ++ if (p < end - 1) ++ { ++ size_t maxlen = (end - p) - 1; ++ ++ print_symbol ((int) maxlen, (const char *) p); ++ p += strnlen ((char *) p, maxlen) + 1; ++ } ++ else ++ { ++ printf (_("")); ++ p = (unsigned char *) end; ++ } ++ putchar ('\n'); ++ } ++ break; ++ ++ case 64: /* Tag_nodefaults. */ ++ /* PR 17531: file: 001-505008-0.01. */ ++ if (p < end) ++ p++; ++ printf (_("True\n")); ++ break; ++ ++ case 65: /* Tag_also_compatible_with. */ ++ READ_ULEB (val, p, end); ++ if (val == 6 /* Tag_CPU_arch. */) ++ { ++ READ_ULEB (val, p, end); ++ if ((unsigned int) val >= ARRAY_SIZE (arm_attr_tag_CPU_arch)) ++ printf ("??? (%d)\n", val); ++ else ++ printf ("%s\n", arm_attr_tag_CPU_arch[val]); ++ } ++ else ++ printf ("???\n"); ++ while (p < end && *(p++) != '\0' /* NUL terminator. */) ++ ; ++ break; ++ ++ default: ++ printf (_("\n"), tag); ++ break; ++ } ++ return p; ++ ++ case 1: ++ return display_tag_value (-1, p, end); ++ case 2: ++ return display_tag_value (0, p, end); ++ ++ default: ++ assert (attr->type & 0x80); ++ READ_ULEB (val, p, end); ++ type = attr->type & 0x7f; ++ if (val >= type) ++ printf ("??? (%d)\n", val); ++ else ++ printf ("%s\n", attr->table[val]); ++ return p; ++ } ++ } ++ ++ return display_tag_value (tag, p, end); ++} ++ ++static unsigned char * ++display_gnu_attribute (unsigned char * p, ++ unsigned char * (* display_proc_gnu_attribute) (unsigned char *, unsigned int, const unsigned char * const), ++ const unsigned char * const end) ++{ ++ unsigned int tag; ++ unsigned int val; ++ ++ READ_ULEB (tag, p, end); ++ ++ /* Tag_compatibility is the only generic GNU attribute defined at ++ present. */ ++ if (tag == 32) ++ { ++ READ_ULEB (val, p, end); ++ ++ printf (_("flag = %d, vendor = "), val); ++ if (p == end) ++ { ++ printf (_("\n")); ++ warn (_("corrupt vendor attribute\n")); ++ } ++ else ++ { ++ if (p < end - 1) ++ { ++ size_t maxlen = (end - p) - 1; ++ ++ print_symbol ((int) maxlen, (const char *) p); ++ p += strnlen ((char *) p, maxlen) + 1; ++ } ++ else ++ { ++ printf (_("")); ++ p = (unsigned char *) end; ++ } ++ putchar ('\n'); ++ } ++ return p; ++ } ++ ++ if ((tag & 2) == 0 && display_proc_gnu_attribute) ++ return display_proc_gnu_attribute (p, tag, end); ++ ++ return display_tag_value (tag, p, end); ++} ++ ++static unsigned char * ++display_m68k_gnu_attribute (unsigned char * p, ++ unsigned int tag, ++ const unsigned char * const end) ++{ ++ unsigned int val; ++ ++ if (tag == Tag_GNU_M68K_ABI_FP) ++ { ++ printf (" Tag_GNU_M68K_ABI_FP: "); ++ if (p == end) ++ { ++ printf (_("\n")); ++ return p; ++ } ++ READ_ULEB (val, p, end); ++ ++ if (val > 3) ++ printf ("(%#x), ", val); ++ ++ switch (val & 3) ++ { ++ case 0: ++ printf (_("unspecified hard/soft float\n")); ++ break; ++ case 1: ++ printf (_("hard float\n")); ++ break; ++ case 2: ++ printf (_("soft float\n")); ++ break; ++ } ++ return p; ++ } ++ ++ return display_tag_value (tag & 1, p, end); ++} ++ ++static unsigned char * ++display_power_gnu_attribute (unsigned char * p, ++ unsigned int tag, ++ const unsigned char * const end) ++{ ++ unsigned int val; ++ ++ if (tag == Tag_GNU_Power_ABI_FP) ++ { ++ printf (" Tag_GNU_Power_ABI_FP: "); ++ if (p == end) ++ { ++ printf (_("\n")); ++ return p; ++ } ++ READ_ULEB (val, p, end); ++ ++ if (val > 15) ++ printf ("(%#x), ", val); ++ ++ switch (val & 3) ++ { ++ case 0: ++ printf (_("unspecified hard/soft float, ")); ++ break; ++ case 1: ++ printf (_("hard float, ")); ++ break; ++ case 2: ++ printf (_("soft float, ")); ++ break; ++ case 3: ++ printf (_("single-precision hard float, ")); ++ break; ++ } ++ ++ switch (val & 0xC) ++ { ++ case 0: ++ printf (_("unspecified long double\n")); ++ break; ++ case 4: ++ printf (_("128-bit IBM long double\n")); ++ break; ++ case 8: ++ printf (_("64-bit long double\n")); ++ break; ++ case 12: ++ printf (_("128-bit IEEE long double\n")); ++ break; ++ } ++ return p; ++ } ++ ++ if (tag == Tag_GNU_Power_ABI_Vector) ++ { ++ printf (" Tag_GNU_Power_ABI_Vector: "); ++ if (p == end) ++ { ++ printf (_("\n")); ++ return p; ++ } ++ READ_ULEB (val, p, end); ++ ++ if (val > 3) ++ printf ("(%#x), ", val); ++ ++ switch (val & 3) ++ { ++ case 0: ++ printf (_("unspecified\n")); ++ break; ++ case 1: ++ printf (_("generic\n")); ++ break; ++ case 2: ++ printf ("AltiVec\n"); ++ break; ++ case 3: ++ printf ("SPE\n"); ++ break; ++ } ++ return p; ++ } ++ ++ if (tag == Tag_GNU_Power_ABI_Struct_Return) ++ { ++ printf (" Tag_GNU_Power_ABI_Struct_Return: "); ++ if (p == end) ++ { ++ printf (_("\n")); ++ return p; ++ } ++ READ_ULEB (val, p, end); ++ ++ if (val > 2) ++ printf ("(%#x), ", val); ++ ++ switch (val & 3) ++ { ++ case 0: ++ printf (_("unspecified\n")); ++ break; ++ case 1: ++ printf ("r3/r4\n"); ++ break; ++ case 2: ++ printf (_("memory\n")); ++ break; ++ case 3: ++ printf ("???\n"); ++ break; ++ } ++ return p; ++ } ++ ++ return display_tag_value (tag & 1, p, end); ++} ++ ++static unsigned char * ++display_s390_gnu_attribute (unsigned char * p, ++ unsigned int tag, ++ const unsigned char * const end) ++{ ++ unsigned int val; ++ ++ if (tag == Tag_GNU_S390_ABI_Vector) ++ { ++ printf (" Tag_GNU_S390_ABI_Vector: "); ++ READ_ULEB (val, p, end); ++ ++ switch (val) ++ { ++ case 0: ++ printf (_("any\n")); ++ break; ++ case 1: ++ printf (_("software\n")); ++ break; ++ case 2: ++ printf (_("hardware\n")); ++ break; ++ default: ++ printf ("??? (%d)\n", val); ++ break; ++ } ++ return p; ++ } ++ ++ return display_tag_value (tag & 1, p, end); ++} ++ ++static void ++display_sparc_hwcaps (unsigned int mask) ++{ ++ if (mask) ++ { ++ bfd_boolean first = TRUE; ++ ++ if (mask & ELF_SPARC_HWCAP_MUL32) ++ fputs ("mul32", stdout), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP_DIV32) ++ printf ("%sdiv32", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP_FSMULD) ++ printf ("%sfsmuld", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP_V8PLUS) ++ printf ("%sv8plus", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP_POPC) ++ printf ("%spopc", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP_VIS) ++ printf ("%svis", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP_VIS2) ++ printf ("%svis2", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP_ASI_BLK_INIT) ++ printf ("%sASIBlkInit", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP_FMAF) ++ printf ("%sfmaf", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP_VIS3) ++ printf ("%svis3", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP_HPC) ++ printf ("%shpc", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP_RANDOM) ++ printf ("%srandom", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP_TRANS) ++ printf ("%strans", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP_FJFMAU) ++ printf ("%sfjfmau", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP_IMA) ++ printf ("%sima", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP_ASI_CACHE_SPARING) ++ printf ("%scspare", first ? "" : "|"), first = FALSE; ++ } ++ else ++ fputc ('0', stdout); ++ fputc ('\n', stdout); ++} ++ ++static void ++display_sparc_hwcaps2 (unsigned int mask) ++{ ++ if (mask) ++ { ++ bfd_boolean first = TRUE; ++ ++ if (mask & ELF_SPARC_HWCAP2_FJATHPLUS) ++ fputs ("fjathplus", stdout), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP2_VIS3B) ++ printf ("%svis3b", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP2_ADP) ++ printf ("%sadp", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP2_SPARC5) ++ printf ("%ssparc5", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP2_MWAIT) ++ printf ("%smwait", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP2_XMPMUL) ++ printf ("%sxmpmul", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP2_XMONT) ++ printf ("%sxmont2", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP2_NSEC) ++ printf ("%snsec", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP2_FJATHHPC) ++ printf ("%sfjathhpc", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP2_FJDES) ++ printf ("%sfjdes", first ? "" : "|"), first = FALSE; ++ if (mask & ELF_SPARC_HWCAP2_FJAES) ++ printf ("%sfjaes", first ? "" : "|"), first = FALSE; ++ } ++ else ++ fputc ('0', stdout); ++ fputc ('\n', stdout); ++} ++ ++static unsigned char * ++display_sparc_gnu_attribute (unsigned char * p, ++ unsigned int tag, ++ const unsigned char * const end) ++{ ++ unsigned int val; ++ ++ if (tag == Tag_GNU_Sparc_HWCAPS) ++ { ++ READ_ULEB (val, p, end); ++ printf (" Tag_GNU_Sparc_HWCAPS: "); ++ display_sparc_hwcaps (val); ++ return p; ++ } ++ if (tag == Tag_GNU_Sparc_HWCAPS2) ++ { ++ READ_ULEB (val, p, end); ++ printf (" Tag_GNU_Sparc_HWCAPS2: "); ++ display_sparc_hwcaps2 (val); ++ return p; ++ } ++ ++ return display_tag_value (tag, p, end); ++} ++ ++static void ++print_mips_fp_abi_value (unsigned int val) ++{ ++ switch (val) ++ { ++ case Val_GNU_MIPS_ABI_FP_ANY: ++ printf (_("Hard or soft float\n")); ++ break; ++ case Val_GNU_MIPS_ABI_FP_DOUBLE: ++ printf (_("Hard float (double precision)\n")); ++ break; ++ case Val_GNU_MIPS_ABI_FP_SINGLE: ++ printf (_("Hard float (single precision)\n")); ++ break; ++ case Val_GNU_MIPS_ABI_FP_SOFT: ++ printf (_("Soft float\n")); ++ break; ++ case Val_GNU_MIPS_ABI_FP_OLD_64: ++ printf (_("Hard float (MIPS32r2 64-bit FPU 12 callee-saved)\n")); ++ break; ++ case Val_GNU_MIPS_ABI_FP_XX: ++ printf (_("Hard float (32-bit CPU, Any FPU)\n")); ++ break; ++ case Val_GNU_MIPS_ABI_FP_64: ++ printf (_("Hard float (32-bit CPU, 64-bit FPU)\n")); ++ break; ++ case Val_GNU_MIPS_ABI_FP_64A: ++ printf (_("Hard float compat (32-bit CPU, 64-bit FPU)\n")); ++ break; ++ case Val_GNU_MIPS_ABI_FP_NAN2008: ++ printf (_("NaN 2008 compatibility\n")); ++ break; ++ default: ++ printf ("??? (%d)\n", val); ++ break; ++ } ++} ++ ++static unsigned char * ++display_mips_gnu_attribute (unsigned char * p, ++ unsigned int tag, ++ const unsigned char * const end) ++{ ++ if (tag == Tag_GNU_MIPS_ABI_FP) ++ { ++ unsigned int val; ++ ++ printf (" Tag_GNU_MIPS_ABI_FP: "); ++ READ_ULEB (val, p, end); ++ print_mips_fp_abi_value (val); ++ return p; ++ } ++ ++ if (tag == Tag_GNU_MIPS_ABI_MSA) ++ { ++ unsigned int val; ++ ++ printf (" Tag_GNU_MIPS_ABI_MSA: "); ++ READ_ULEB (val, p, end); ++ ++ switch (val) ++ { ++ case Val_GNU_MIPS_ABI_MSA_ANY: ++ printf (_("Any MSA or not\n")); ++ break; ++ case Val_GNU_MIPS_ABI_MSA_128: ++ printf (_("128-bit MSA\n")); ++ break; ++ default: ++ printf ("??? (%d)\n", val); ++ break; ++ } ++ return p; ++ } ++ ++ return display_tag_value (tag & 1, p, end); ++} ++ ++static unsigned char * ++display_tic6x_attribute (unsigned char * p, ++ const unsigned char * const end) ++{ ++ unsigned int tag; ++ unsigned int val; ++ ++ READ_ULEB (tag, p, end); ++ ++ switch (tag) ++ { ++ case Tag_ISA: ++ printf (" Tag_ISA: "); ++ READ_ULEB (val, p, end); ++ ++ switch (val) ++ { ++ case C6XABI_Tag_ISA_none: ++ printf (_("None\n")); ++ break; ++ case C6XABI_Tag_ISA_C62X: ++ printf ("C62x\n"); ++ break; ++ case C6XABI_Tag_ISA_C67X: ++ printf ("C67x\n"); ++ break; ++ case C6XABI_Tag_ISA_C67XP: ++ printf ("C67x+\n"); ++ break; ++ case C6XABI_Tag_ISA_C64X: ++ printf ("C64x\n"); ++ break; ++ case C6XABI_Tag_ISA_C64XP: ++ printf ("C64x+\n"); ++ break; ++ case C6XABI_Tag_ISA_C674X: ++ printf ("C674x\n"); ++ break; ++ default: ++ printf ("??? (%d)\n", val); ++ break; ++ } ++ return p; ++ ++ case Tag_ABI_wchar_t: ++ printf (" Tag_ABI_wchar_t: "); ++ READ_ULEB (val, p, end); ++ switch (val) ++ { ++ case 0: ++ printf (_("Not used\n")); ++ break; ++ case 1: ++ printf (_("2 bytes\n")); ++ break; ++ case 2: ++ printf (_("4 bytes\n")); ++ break; ++ default: ++ printf ("??? (%d)\n", val); ++ break; ++ } ++ return p; ++ ++ case Tag_ABI_stack_align_needed: ++ printf (" Tag_ABI_stack_align_needed: "); ++ READ_ULEB (val, p, end); ++ switch (val) ++ { ++ case 0: ++ printf (_("8-byte\n")); ++ break; ++ case 1: ++ printf (_("16-byte\n")); ++ break; ++ default: ++ printf ("??? (%d)\n", val); ++ break; ++ } ++ return p; ++ ++ case Tag_ABI_stack_align_preserved: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ABI_stack_align_preserved: "); ++ switch (val) ++ { ++ case 0: ++ printf (_("8-byte\n")); ++ break; ++ case 1: ++ printf (_("16-byte\n")); ++ break; ++ default: ++ printf ("??? (%d)\n", val); ++ break; ++ } ++ return p; ++ ++ case Tag_ABI_DSBT: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ABI_DSBT: "); ++ switch (val) ++ { ++ case 0: ++ printf (_("DSBT addressing not used\n")); ++ break; ++ case 1: ++ printf (_("DSBT addressing used\n")); ++ break; ++ default: ++ printf ("??? (%d)\n", val); ++ break; ++ } ++ return p; ++ ++ case Tag_ABI_PID: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ABI_PID: "); ++ switch (val) ++ { ++ case 0: ++ printf (_("Data addressing position-dependent\n")); ++ break; ++ case 1: ++ printf (_("Data addressing position-independent, GOT near DP\n")); ++ break; ++ case 2: ++ printf (_("Data addressing position-independent, GOT far from DP\n")); ++ break; ++ default: ++ printf ("??? (%d)\n", val); ++ break; ++ } ++ return p; ++ ++ case Tag_ABI_PIC: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ABI_PIC: "); ++ switch (val) ++ { ++ case 0: ++ printf (_("Code addressing position-dependent\n")); ++ break; ++ case 1: ++ printf (_("Code addressing position-independent\n")); ++ break; ++ default: ++ printf ("??? (%d)\n", val); ++ break; ++ } ++ return p; ++ ++ case Tag_ABI_array_object_alignment: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ABI_array_object_alignment: "); ++ switch (val) ++ { ++ case 0: ++ printf (_("8-byte\n")); ++ break; ++ case 1: ++ printf (_("4-byte\n")); ++ break; ++ case 2: ++ printf (_("16-byte\n")); ++ break; ++ default: ++ printf ("??? (%d)\n", val); ++ break; ++ } ++ return p; ++ ++ case Tag_ABI_array_object_align_expected: ++ READ_ULEB (val, p, end); ++ printf (" Tag_ABI_array_object_align_expected: "); ++ switch (val) ++ { ++ case 0: ++ printf (_("8-byte\n")); ++ break; ++ case 1: ++ printf (_("4-byte\n")); ++ break; ++ case 2: ++ printf (_("16-byte\n")); ++ break; ++ default: ++ printf ("??? (%d)\n", val); ++ break; ++ } ++ return p; ++ ++ case Tag_ABI_compatibility: ++ { ++ READ_ULEB (val, p, end); ++ printf (" Tag_ABI_compatibility: "); ++ printf (_("flag = %d, vendor = "), val); ++ if (p < end - 1) ++ { ++ size_t maxlen = (end - p) - 1; ++ ++ print_symbol ((int) maxlen, (const char *) p); ++ p += strnlen ((char *) p, maxlen) + 1; ++ } ++ else ++ { ++ printf (_("")); ++ p = (unsigned char *) end; ++ } ++ putchar ('\n'); ++ return p; ++ } ++ ++ case Tag_ABI_conformance: ++ { ++ printf (" Tag_ABI_conformance: \""); ++ if (p < end - 1) ++ { ++ size_t maxlen = (end - p) - 1; ++ ++ print_symbol ((int) maxlen, (const char *) p); ++ p += strnlen ((char *) p, maxlen) + 1; ++ } ++ else ++ { ++ printf (_("")); ++ p = (unsigned char *) end; ++ } ++ printf ("\"\n"); ++ return p; ++ } ++ } ++ ++ return display_tag_value (tag, p, end); ++} ++ ++static void ++display_raw_attribute (unsigned char * p, unsigned char const * const end) ++{ ++ unsigned long addr = 0; ++ size_t bytes = end - p; ++ ++ assert (end >= p); ++ while (bytes) ++ { ++ int j; ++ int k; ++ int lbytes = (bytes > 16 ? 16 : bytes); ++ ++ printf (" 0x%8.8lx ", addr); ++ ++ for (j = 0; j < 16; j++) ++ { ++ if (j < lbytes) ++ printf ("%2.2x", p[j]); ++ else ++ printf (" "); ++ ++ if ((j & 3) == 3) ++ printf (" "); ++ } ++ ++ for (j = 0; j < lbytes; j++) ++ { ++ k = p[j]; ++ if (k >= ' ' && k < 0x7f) ++ printf ("%c", k); ++ else ++ printf ("."); ++ } ++ ++ putchar ('\n'); ++ ++ p += lbytes; ++ bytes -= lbytes; ++ addr += lbytes; ++ } ++ ++ putchar ('\n'); ++} ++ ++static unsigned char * ++display_msp430x_attribute (unsigned char * p, ++ const unsigned char * const end) ++{ ++ unsigned int val; ++ unsigned int tag; ++ ++ READ_ULEB (tag, p, end); ++ ++ switch (tag) ++ { ++ case OFBA_MSPABI_Tag_ISA: ++ printf (" Tag_ISA: "); ++ READ_ULEB (val, p, end); ++ switch (val) ++ { ++ case 0: printf (_("None\n")); break; ++ case 1: printf (_("MSP430\n")); break; ++ case 2: printf (_("MSP430X\n")); break; ++ default: printf ("??? (%d)\n", val); break; ++ } ++ break; ++ ++ case OFBA_MSPABI_Tag_Code_Model: ++ printf (" Tag_Code_Model: "); ++ READ_ULEB (val, p, end); ++ switch (val) ++ { ++ case 0: printf (_("None\n")); break; ++ case 1: printf (_("Small\n")); break; ++ case 2: printf (_("Large\n")); break; ++ default: printf ("??? (%d)\n", val); break; ++ } ++ break; ++ ++ case OFBA_MSPABI_Tag_Data_Model: ++ printf (" Tag_Data_Model: "); ++ READ_ULEB (val, p, end); ++ switch (val) ++ { ++ case 0: printf (_("None\n")); break; ++ case 1: printf (_("Small\n")); break; ++ case 2: printf (_("Large\n")); break; ++ case 3: printf (_("Restricted Large\n")); break; ++ default: printf ("??? (%d)\n", val); break; ++ } ++ break; ++ ++ default: ++ printf (_(" : "), tag); ++ ++ if (tag & 1) ++ { ++ putchar ('"'); ++ if (p < end - 1) ++ { ++ size_t maxlen = (end - p) - 1; ++ ++ print_symbol ((int) maxlen, (const char *) p); ++ p += strnlen ((char *) p, maxlen) + 1; ++ } ++ else ++ { ++ printf (_("")); ++ p = (unsigned char *) end; ++ } ++ printf ("\"\n"); ++ } ++ else ++ { ++ READ_ULEB (val, p, end); ++ printf ("%d (0x%x)\n", val, val); ++ } ++ break; ++ } ++ ++ assert (p <= end); ++ return p; ++} ++ ++static unsigned char * ++display_msp430_gnu_attribute (unsigned char * p, ++ unsigned int tag, ++ const unsigned char * const end) ++{ ++ if (tag == Tag_GNU_MSP430_Data_Region) ++ { ++ unsigned int val; ++ ++ printf (" Tag_GNU_MSP430_Data_Region: "); ++ READ_ULEB (val, p, end); ++ ++ switch (val) ++ { ++ case Val_GNU_MSP430_Data_Region_Any: ++ printf (_("Any Region\n")); ++ break; ++ case Val_GNU_MSP430_Data_Region_Lower: ++ printf (_("Lower Region Only\n")); ++ break; ++ default: ++ printf ("??? (%u)\n", val); ++ } ++ return p; ++ } ++ return display_tag_value (tag & 1, p, end); ++} ++ ++struct riscv_attr_tag_t { ++ const char *name; ++ unsigned int tag; ++}; ++ ++static struct riscv_attr_tag_t riscv_attr_tag[] = ++{ ++#define T(tag) {"Tag_RISCV_" #tag, Tag_RISCV_##tag} ++ T(arch), ++ T(priv_spec), ++ T(priv_spec_minor), ++ T(priv_spec_revision), ++ T(unaligned_access), ++ T(stack_align), ++#undef T ++}; ++ ++static unsigned char * ++display_riscv_attribute (unsigned char *p, ++ const unsigned char * const end) ++{ ++ unsigned int val; ++ unsigned int tag; ++ struct riscv_attr_tag_t *attr = NULL; ++ unsigned i; ++ ++ READ_ULEB (tag, p, end); ++ ++ /* Find the name of attribute. */ ++ for (i = 0; i < ARRAY_SIZE (riscv_attr_tag); i++) ++ { ++ if (riscv_attr_tag[i].tag == tag) ++ { ++ attr = &riscv_attr_tag[i]; ++ break; ++ } ++ } ++ ++ if (attr) ++ printf (" %s: ", attr->name); ++ else ++ return display_tag_value (tag, p, end); ++ ++ switch (tag) ++ { ++ case Tag_RISCV_priv_spec: ++ case Tag_RISCV_priv_spec_minor: ++ case Tag_RISCV_priv_spec_revision: ++ READ_ULEB (val, p, end); ++ printf (_("%u\n"), val); ++ break; ++ case Tag_RISCV_unaligned_access: ++ READ_ULEB (val, p, end); ++ switch (val) ++ { ++ case 0: ++ printf (_("No unaligned access\n")); ++ break; ++ case 1: ++ printf (_("Unaligned access\n")); ++ break; ++ } ++ break; ++ case Tag_RISCV_stack_align: ++ READ_ULEB (val, p, end); ++ printf (_("%u-bytes\n"), val); ++ break; ++ case Tag_RISCV_arch: ++ p = display_tag_value (-1, p, end); ++ break; ++ default: ++ return display_tag_value (tag, p, end); ++ } ++ ++ return p; ++} ++ ++static bfd_boolean ++process_attributes (Filedata * filedata, ++ const char * public_name, ++ unsigned int proc_type, ++ unsigned char * (* display_pub_attribute) (unsigned char *, const unsigned char * const), ++ unsigned char * (* display_proc_gnu_attribute) (unsigned char *, unsigned int, const unsigned char * const)) ++{ ++ Elf_Internal_Shdr * sect; ++ unsigned i; ++ bfd_boolean res = TRUE; ++ ++ /* Find the section header so that we get the size. */ ++ for (i = 0, sect = filedata->section_headers; ++ i < filedata->file_header.e_shnum; ++ i++, sect++) ++ { ++ unsigned char * contents; ++ unsigned char * p; ++ ++ if (sect->sh_type != proc_type && sect->sh_type != SHT_GNU_ATTRIBUTES) ++ continue; ++ ++ contents = (unsigned char *) get_data (NULL, filedata, sect->sh_offset, 1, ++ sect->sh_size, _("attributes")); ++ if (contents == NULL) ++ { ++ res = FALSE; ++ continue; ++ } ++ ++ p = contents; ++ /* The first character is the version of the attributes. ++ Currently only version 1, (aka 'A') is recognised here. */ ++ if (*p != 'A') ++ { ++ printf (_("Unknown attributes version '%c'(%d) - expecting 'A'\n"), *p, *p); ++ res = FALSE; ++ } ++ else ++ { ++ bfd_vma section_len; ++ ++ section_len = sect->sh_size - 1; ++ p++; ++ ++ while (section_len > 0) ++ { ++ bfd_vma attr_len; ++ unsigned int namelen; ++ bfd_boolean public_section; ++ bfd_boolean gnu_section; ++ ++ if (section_len <= 4) ++ { ++ error (_("Tag section ends prematurely\n")); ++ res = FALSE; ++ break; ++ } ++ attr_len = byte_get (p, 4); ++ p += 4; ++ ++ if (attr_len > section_len) ++ { ++ error (_("Bad attribute length (%u > %u)\n"), ++ (unsigned) attr_len, (unsigned) section_len); ++ attr_len = section_len; ++ res = FALSE; ++ } ++ /* PR 17531: file: 001-101425-0.004 */ ++ else if (attr_len < 5) ++ { ++ error (_("Attribute length of %u is too small\n"), (unsigned) attr_len); ++ res = FALSE; ++ break; ++ } ++ ++ section_len -= attr_len; ++ attr_len -= 4; ++ ++ namelen = strnlen ((char *) p, attr_len) + 1; ++ if (namelen == 0 || namelen >= attr_len) ++ { ++ error (_("Corrupt attribute section name\n")); ++ res = FALSE; ++ break; ++ } ++ ++ printf (_("Attribute Section: ")); ++ print_symbol (INT_MAX, (const char *) p); ++ putchar ('\n'); ++ ++ if (public_name && streq ((char *) p, public_name)) ++ public_section = TRUE; ++ else ++ public_section = FALSE; ++ ++ if (streq ((char *) p, "gnu")) ++ gnu_section = TRUE; ++ else ++ gnu_section = FALSE; ++ ++ p += namelen; ++ attr_len -= namelen; ++ ++ while (attr_len > 0 && p < contents + sect->sh_size) ++ { ++ int tag; ++ unsigned int val; ++ bfd_vma size; ++ unsigned char * end; ++ ++ /* PR binutils/17531: Safe handling of corrupt files. */ ++ if (attr_len < 6) ++ { ++ error (_("Unused bytes at end of section\n")); ++ res = FALSE; ++ section_len = 0; ++ break; ++ } ++ ++ tag = *(p++); ++ size = byte_get (p, 4); ++ if (size > attr_len) ++ { ++ error (_("Bad subsection length (%u > %u)\n"), ++ (unsigned) size, (unsigned) attr_len); ++ res = FALSE; ++ size = attr_len; ++ } ++ /* PR binutils/17531: Safe handling of corrupt files. */ ++ if (size < 6) ++ { ++ error (_("Bad subsection length (%u < 6)\n"), ++ (unsigned) size); ++ res = FALSE; ++ section_len = 0; ++ break; ++ } ++ ++ attr_len -= size; ++ end = p + size - 1; ++ assert (end <= contents + sect->sh_size); ++ p += 4; ++ ++ switch (tag) ++ { ++ case 1: ++ printf (_("File Attributes\n")); ++ break; ++ case 2: ++ printf (_("Section Attributes:")); ++ goto do_numlist; ++ case 3: ++ printf (_("Symbol Attributes:")); ++ /* Fall through. */ ++ do_numlist: ++ for (;;) ++ { ++ READ_ULEB (val, p, end); ++ if (val == 0) ++ break; ++ printf (" %d", val); ++ } ++ printf ("\n"); ++ break; ++ default: ++ printf (_("Unknown tag: %d\n"), tag); ++ public_section = FALSE; ++ break; ++ } ++ ++ if (public_section && display_pub_attribute != NULL) ++ { ++ while (p < end) ++ p = display_pub_attribute (p, end); ++ assert (p == end); ++ } ++ else if (gnu_section && display_proc_gnu_attribute != NULL) ++ { ++ while (p < end) ++ p = display_gnu_attribute (p, ++ display_proc_gnu_attribute, ++ end); ++ assert (p == end); ++ } ++ else if (p < end) ++ { ++ printf (_(" Unknown attribute:\n")); ++ display_raw_attribute (p, end); ++ p = end; ++ } ++ else ++ attr_len = 0; ++ } ++ } ++ } ++ ++ free (contents); ++ } ++ ++ return res; ++} ++ ++/* DATA points to the contents of a MIPS GOT that starts at VMA PLTGOT. ++ Print the Address, Access and Initial fields of an entry at VMA ADDR ++ and return the VMA of the next entry, or -1 if there was a problem. ++ Does not read from DATA_END or beyond. */ ++ ++static bfd_vma ++print_mips_got_entry (unsigned char * data, bfd_vma pltgot, bfd_vma addr, ++ unsigned char * data_end) ++{ ++ printf (" "); ++ print_vma (addr, LONG_HEX); ++ printf (" "); ++ if (addr < pltgot + 0xfff0) ++ printf ("%6d(gp)", (int) (addr - pltgot - 0x7ff0)); ++ else ++ printf ("%10s", ""); ++ printf (" "); ++ if (data == NULL) ++ printf ("%*s", is_32bit_elf ? 8 : 16, _("")); ++ else ++ { ++ bfd_vma entry; ++ unsigned char * from = data + addr - pltgot; ++ ++ if (from + (is_32bit_elf ? 4 : 8) > data_end) ++ { ++ warn (_("MIPS GOT entry extends beyond the end of available data\n")); ++ printf ("%*s", is_32bit_elf ? 8 : 16, _("")); ++ return (bfd_vma) -1; ++ } ++ else ++ { ++ entry = byte_get (data + addr - pltgot, is_32bit_elf ? 4 : 8); ++ print_vma (entry, LONG_HEX); ++ } ++ } ++ return addr + (is_32bit_elf ? 4 : 8); ++} ++ ++/* DATA points to the contents of a MIPS PLT GOT that starts at VMA ++ PLTGOT. Print the Address and Initial fields of an entry at VMA ++ ADDR and return the VMA of the next entry. */ ++ ++static bfd_vma ++print_mips_pltgot_entry (unsigned char * data, bfd_vma pltgot, bfd_vma addr) ++{ ++ printf (" "); ++ print_vma (addr, LONG_HEX); ++ printf (" "); ++ if (data == NULL) ++ printf ("%*s", is_32bit_elf ? 8 : 16, _("")); ++ else ++ { ++ bfd_vma entry; ++ ++ entry = byte_get (data + addr - pltgot, is_32bit_elf ? 4 : 8); ++ print_vma (entry, LONG_HEX); ++ } ++ return addr + (is_32bit_elf ? 4 : 8); ++} ++ ++static void ++print_mips_ases (unsigned int mask) ++{ ++ if (mask & AFL_ASE_DSP) ++ fputs ("\n\tDSP ASE", stdout); ++ if (mask & AFL_ASE_DSPR2) ++ fputs ("\n\tDSP R2 ASE", stdout); ++ if (mask & AFL_ASE_DSPR3) ++ fputs ("\n\tDSP R3 ASE", stdout); ++ if (mask & AFL_ASE_EVA) ++ fputs ("\n\tEnhanced VA Scheme", stdout); ++ if (mask & AFL_ASE_MCU) ++ fputs ("\n\tMCU (MicroController) ASE", stdout); ++ if (mask & AFL_ASE_MDMX) ++ fputs ("\n\tMDMX ASE", stdout); ++ if (mask & AFL_ASE_MIPS3D) ++ fputs ("\n\tMIPS-3D ASE", stdout); ++ if (mask & AFL_ASE_MT) ++ fputs ("\n\tMT ASE", stdout); ++ if (mask & AFL_ASE_SMARTMIPS) ++ fputs ("\n\tSmartMIPS ASE", stdout); ++ if (mask & AFL_ASE_VIRT) ++ fputs ("\n\tVZ ASE", stdout); ++ if (mask & AFL_ASE_MSA) ++ fputs ("\n\tMSA ASE", stdout); ++ if (mask & AFL_ASE_MIPS16) ++ fputs ("\n\tMIPS16 ASE", stdout); ++ if (mask & AFL_ASE_MICROMIPS) ++ fputs ("\n\tMICROMIPS ASE", stdout); ++ if (mask & AFL_ASE_XPA) ++ fputs ("\n\tXPA ASE", stdout); ++ if (mask & AFL_ASE_MIPS16E2) ++ fputs ("\n\tMIPS16e2 ASE", stdout); ++ if (mask & AFL_ASE_CRC) ++ fputs ("\n\tCRC ASE", stdout); ++ if (mask & AFL_ASE_GINV) ++ fputs ("\n\tGINV ASE", stdout); ++ if (mask & AFL_ASE_LOONGSON_MMI) ++ fputs ("\n\tLoongson MMI ASE", stdout); ++ if (mask & AFL_ASE_LOONGSON_CAM) ++ fputs ("\n\tLoongson CAM ASE", stdout); ++ if (mask & AFL_ASE_LOONGSON_EXT) ++ fputs ("\n\tLoongson EXT ASE", stdout); ++ if (mask & AFL_ASE_LOONGSON_EXT2) ++ fputs ("\n\tLoongson EXT2 ASE", stdout); ++ if (mask == 0) ++ fprintf (stdout, "\n\t%s", _("None")); ++ else if ((mask & ~AFL_ASE_MASK) != 0) ++ fprintf (stdout, "\n\t%s (%x)", _("Unknown"), mask & ~AFL_ASE_MASK); ++} ++ ++static void ++print_mips_isa_ext (unsigned int isa_ext) ++{ ++ switch (isa_ext) ++ { ++ case 0: ++ fputs (_("None"), stdout); ++ break; ++ case AFL_EXT_XLR: ++ fputs ("RMI XLR", stdout); ++ break; ++ case AFL_EXT_OCTEON3: ++ fputs ("Cavium Networks Octeon3", stdout); ++ break; ++ case AFL_EXT_OCTEON2: ++ fputs ("Cavium Networks Octeon2", stdout); ++ break; ++ case AFL_EXT_OCTEONP: ++ fputs ("Cavium Networks OcteonP", stdout); ++ break; ++ case AFL_EXT_OCTEON: ++ fputs ("Cavium Networks Octeon", stdout); ++ break; ++ case AFL_EXT_5900: ++ fputs ("Toshiba R5900", stdout); ++ break; ++ case AFL_EXT_4650: ++ fputs ("MIPS R4650", stdout); ++ break; ++ case AFL_EXT_4010: ++ fputs ("LSI R4010", stdout); ++ break; ++ case AFL_EXT_4100: ++ fputs ("NEC VR4100", stdout); ++ break; ++ case AFL_EXT_3900: ++ fputs ("Toshiba R3900", stdout); ++ break; ++ case AFL_EXT_10000: ++ fputs ("MIPS R10000", stdout); ++ break; ++ case AFL_EXT_SB1: ++ fputs ("Broadcom SB-1", stdout); ++ break; ++ case AFL_EXT_4111: ++ fputs ("NEC VR4111/VR4181", stdout); ++ break; ++ case AFL_EXT_4120: ++ fputs ("NEC VR4120", stdout); ++ break; ++ case AFL_EXT_5400: ++ fputs ("NEC VR5400", stdout); ++ break; ++ case AFL_EXT_5500: ++ fputs ("NEC VR5500", stdout); ++ break; ++ case AFL_EXT_LOONGSON_2E: ++ fputs ("ST Microelectronics Loongson 2E", stdout); ++ break; ++ case AFL_EXT_LOONGSON_2F: ++ fputs ("ST Microelectronics Loongson 2F", stdout); ++ break; ++ case AFL_EXT_INTERAPTIV_MR2: ++ fputs ("Imagination interAptiv MR2", stdout); ++ break; ++ default: ++ fprintf (stdout, "%s (%d)", _("Unknown"), isa_ext); ++ } ++} ++ ++static signed int ++get_mips_reg_size (int reg_size) ++{ ++ return (reg_size == AFL_REG_NONE) ? 0 ++ : (reg_size == AFL_REG_32) ? 32 ++ : (reg_size == AFL_REG_64) ? 64 ++ : (reg_size == AFL_REG_128) ? 128 ++ : -1; ++} ++ ++static bfd_boolean ++process_mips_specific (Filedata * filedata) ++{ ++ Elf_Internal_Dyn * entry; ++ Elf_Internal_Shdr *sect = NULL; ++ size_t liblist_offset = 0; ++ size_t liblistno = 0; ++ size_t conflictsno = 0; ++ size_t options_offset = 0; ++ size_t conflicts_offset = 0; ++ size_t pltrelsz = 0; ++ size_t pltrel = 0; ++ bfd_vma pltgot = 0; ++ bfd_vma mips_pltgot = 0; ++ bfd_vma jmprel = 0; ++ bfd_vma local_gotno = 0; ++ bfd_vma gotsym = 0; ++ bfd_vma symtabno = 0; ++ bfd_boolean res = TRUE; ++ ++ if (! process_attributes (filedata, NULL, SHT_GNU_ATTRIBUTES, NULL, ++ display_mips_gnu_attribute)) ++ res = FALSE; ++ ++ sect = find_section (filedata, ".MIPS.abiflags"); ++ ++ if (sect != NULL) ++ { ++ Elf_External_ABIFlags_v0 *abiflags_ext; ++ Elf_Internal_ABIFlags_v0 abiflags_in; ++ ++ if (sizeof (Elf_External_ABIFlags_v0) != sect->sh_size) ++ { ++ error (_("Corrupt MIPS ABI Flags section.\n")); ++ res = FALSE; ++ } ++ else ++ { ++ abiflags_ext = get_data (NULL, filedata, sect->sh_offset, 1, ++ sect->sh_size, _("MIPS ABI Flags section")); ++ if (abiflags_ext) ++ { ++ abiflags_in.version = BYTE_GET (abiflags_ext->version); ++ abiflags_in.isa_level = BYTE_GET (abiflags_ext->isa_level); ++ abiflags_in.isa_rev = BYTE_GET (abiflags_ext->isa_rev); ++ abiflags_in.gpr_size = BYTE_GET (abiflags_ext->gpr_size); ++ abiflags_in.cpr1_size = BYTE_GET (abiflags_ext->cpr1_size); ++ abiflags_in.cpr2_size = BYTE_GET (abiflags_ext->cpr2_size); ++ abiflags_in.fp_abi = BYTE_GET (abiflags_ext->fp_abi); ++ abiflags_in.isa_ext = BYTE_GET (abiflags_ext->isa_ext); ++ abiflags_in.ases = BYTE_GET (abiflags_ext->ases); ++ abiflags_in.flags1 = BYTE_GET (abiflags_ext->flags1); ++ abiflags_in.flags2 = BYTE_GET (abiflags_ext->flags2); ++ ++ printf ("\nMIPS ABI Flags Version: %d\n", abiflags_in.version); ++ printf ("\nISA: MIPS%d", abiflags_in.isa_level); ++ if (abiflags_in.isa_rev > 1) ++ printf ("r%d", abiflags_in.isa_rev); ++ printf ("\nGPR size: %d", ++ get_mips_reg_size (abiflags_in.gpr_size)); ++ printf ("\nCPR1 size: %d", ++ get_mips_reg_size (abiflags_in.cpr1_size)); ++ printf ("\nCPR2 size: %d", ++ get_mips_reg_size (abiflags_in.cpr2_size)); ++ fputs ("\nFP ABI: ", stdout); ++ print_mips_fp_abi_value (abiflags_in.fp_abi); ++ fputs ("ISA Extension: ", stdout); ++ print_mips_isa_ext (abiflags_in.isa_ext); ++ fputs ("\nASEs:", stdout); ++ print_mips_ases (abiflags_in.ases); ++ printf ("\nFLAGS 1: %8.8lx", abiflags_in.flags1); ++ printf ("\nFLAGS 2: %8.8lx", abiflags_in.flags2); ++ fputc ('\n', stdout); ++ free (abiflags_ext); ++ } ++ } ++ } ++ ++ /* We have a lot of special sections. Thanks SGI! */ ++ if (filedata->dynamic_section == NULL) ++ { ++ /* No dynamic information available. See if there is static GOT. */ ++ sect = find_section (filedata, ".got"); ++ if (sect != NULL) ++ { ++ unsigned char *data_end; ++ unsigned char *data; ++ bfd_vma ent, end; ++ int addr_size; ++ ++ pltgot = sect->sh_addr; ++ ++ ent = pltgot; ++ addr_size = (is_32bit_elf ? 4 : 8); ++ end = pltgot + sect->sh_size; ++ ++ data = (unsigned char *) get_data (NULL, filedata, sect->sh_offset, ++ end - pltgot, 1, ++ _("Global Offset Table data")); ++ /* PR 12855: Null data is handled gracefully throughout. */ ++ data_end = data + (end - pltgot); ++ ++ printf (_("\nStatic GOT:\n")); ++ printf (_(" Canonical gp value: ")); ++ print_vma (ent + 0x7ff0, LONG_HEX); ++ printf ("\n\n"); ++ ++ /* In a dynamic binary GOT[0] is reserved for the dynamic ++ loader to store the lazy resolver pointer, however in ++ a static binary it may well have been omitted and GOT ++ reduced to a table of addresses. ++ PR 21344: Check for the entry being fully available ++ before fetching it. */ ++ if (data ++ && data + ent - pltgot + addr_size <= data_end ++ && byte_get (data + ent - pltgot, addr_size) == 0) ++ { ++ printf (_(" Reserved entries:\n")); ++ printf (_(" %*s %10s %*s\n"), ++ addr_size * 2, _("Address"), _("Access"), ++ addr_size * 2, _("Value")); ++ ent = print_mips_got_entry (data, pltgot, ent, data_end); ++ printf ("\n"); ++ if (ent == (bfd_vma) -1) ++ goto sgot_print_fail; ++ ++ /* Check for the MSB of GOT[1] being set, identifying a ++ GNU object. This entry will be used by some runtime ++ loaders, to store the module pointer. Otherwise this ++ is an ordinary local entry. ++ PR 21344: Check for the entry being fully available ++ before fetching it. */ ++ if (data ++ && data + ent - pltgot + addr_size <= data_end ++ && (byte_get (data + ent - pltgot, addr_size) ++ >> (addr_size * 8 - 1)) != 0) ++ { ++ ent = print_mips_got_entry (data, pltgot, ent, data_end); ++ printf ("\n"); ++ if (ent == (bfd_vma) -1) ++ goto sgot_print_fail; ++ } ++ printf ("\n"); ++ } ++ ++ if (data != NULL && ent < end) ++ { ++ printf (_(" Local entries:\n")); ++ printf (" %*s %10s %*s\n", ++ addr_size * 2, _("Address"), _("Access"), ++ addr_size * 2, _("Value")); ++ while (ent < end) ++ { ++ ent = print_mips_got_entry (data, pltgot, ent, data_end); ++ printf ("\n"); ++ if (ent == (bfd_vma) -1) ++ goto sgot_print_fail; ++ } ++ printf ("\n"); ++ } ++ ++ sgot_print_fail: ++ free (data); ++ } ++ return res; ++ } ++ ++ for (entry = filedata->dynamic_section; ++ /* PR 17531 file: 012-50589-0.004. */ ++ (entry < filedata->dynamic_section + filedata->dynamic_nent ++ && entry->d_tag != DT_NULL); ++ ++entry) ++ switch (entry->d_tag) ++ { ++ case DT_MIPS_LIBLIST: ++ liblist_offset ++ = offset_from_vma (filedata, entry->d_un.d_val, ++ liblistno * sizeof (Elf32_External_Lib)); ++ break; ++ case DT_MIPS_LIBLISTNO: ++ liblistno = entry->d_un.d_val; ++ break; ++ case DT_MIPS_OPTIONS: ++ options_offset = offset_from_vma (filedata, entry->d_un.d_val, 0); ++ break; ++ case DT_MIPS_CONFLICT: ++ conflicts_offset ++ = offset_from_vma (filedata, entry->d_un.d_val, ++ conflictsno * sizeof (Elf32_External_Conflict)); ++ break; ++ case DT_MIPS_CONFLICTNO: ++ conflictsno = entry->d_un.d_val; ++ break; ++ case DT_PLTGOT: ++ pltgot = entry->d_un.d_ptr; ++ break; ++ case DT_MIPS_LOCAL_GOTNO: ++ local_gotno = entry->d_un.d_val; ++ break; ++ case DT_MIPS_GOTSYM: ++ gotsym = entry->d_un.d_val; ++ break; ++ case DT_MIPS_SYMTABNO: ++ symtabno = entry->d_un.d_val; ++ break; ++ case DT_MIPS_PLTGOT: ++ mips_pltgot = entry->d_un.d_ptr; ++ break; ++ case DT_PLTREL: ++ pltrel = entry->d_un.d_val; ++ break; ++ case DT_PLTRELSZ: ++ pltrelsz = entry->d_un.d_val; ++ break; ++ case DT_JMPREL: ++ jmprel = entry->d_un.d_ptr; ++ break; ++ default: ++ break; ++ } ++ ++ if (liblist_offset != 0 && liblistno != 0 && do_dynamic) ++ { ++ Elf32_External_Lib * elib; ++ size_t cnt; ++ ++ elib = (Elf32_External_Lib *) get_data (NULL, filedata, liblist_offset, ++ sizeof (Elf32_External_Lib), ++ liblistno, ++ _("liblist section data")); ++ if (elib) ++ { ++ printf (ngettext ("\nSection '.liblist' contains %lu entry:\n", ++ "\nSection '.liblist' contains %lu entries:\n", ++ (unsigned long) liblistno), ++ (unsigned long) liblistno); ++ fputs (_(" Library Time Stamp Checksum Version Flags\n"), ++ stdout); ++ ++ for (cnt = 0; cnt < liblistno; ++cnt) ++ { ++ Elf32_Lib liblist; ++ time_t atime; ++ char timebuf[128]; ++ struct tm * tmp; ++ ++ liblist.l_name = BYTE_GET (elib[cnt].l_name); ++ atime = BYTE_GET (elib[cnt].l_time_stamp); ++ liblist.l_checksum = BYTE_GET (elib[cnt].l_checksum); ++ liblist.l_version = BYTE_GET (elib[cnt].l_version); ++ liblist.l_flags = BYTE_GET (elib[cnt].l_flags); ++ ++ tmp = gmtime (&atime); ++ snprintf (timebuf, sizeof (timebuf), ++ "%04u-%02u-%02uT%02u:%02u:%02u", ++ tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday, ++ tmp->tm_hour, tmp->tm_min, tmp->tm_sec); ++ ++ printf ("%3lu: ", (unsigned long) cnt); ++ if (VALID_DYNAMIC_NAME (filedata, liblist.l_name)) ++ print_symbol (20, GET_DYNAMIC_NAME (filedata, liblist.l_name)); ++ else ++ printf (_(""), liblist.l_name); ++ printf (" %s %#10lx %-7ld", timebuf, liblist.l_checksum, ++ liblist.l_version); ++ ++ if (liblist.l_flags == 0) ++ puts (_(" NONE")); ++ else ++ { ++ static const struct ++ { ++ const char * name; ++ int bit; ++ } ++ l_flags_vals[] = ++ { ++ { " EXACT_MATCH", LL_EXACT_MATCH }, ++ { " IGNORE_INT_VER", LL_IGNORE_INT_VER }, ++ { " REQUIRE_MINOR", LL_REQUIRE_MINOR }, ++ { " EXPORTS", LL_EXPORTS }, ++ { " DELAY_LOAD", LL_DELAY_LOAD }, ++ { " DELTA", LL_DELTA } ++ }; ++ int flags = liblist.l_flags; ++ size_t fcnt; ++ ++ for (fcnt = 0; fcnt < ARRAY_SIZE (l_flags_vals); ++fcnt) ++ if ((flags & l_flags_vals[fcnt].bit) != 0) ++ { ++ fputs (l_flags_vals[fcnt].name, stdout); ++ flags ^= l_flags_vals[fcnt].bit; ++ } ++ if (flags != 0) ++ printf (" %#x", (unsigned int) flags); ++ ++ puts (""); ++ } ++ } ++ ++ free (elib); ++ } ++ else ++ res = FALSE; ++ } ++ ++ if (options_offset != 0) ++ { ++ Elf_External_Options * eopt; ++ size_t offset; ++ int cnt; ++ sect = filedata->section_headers; ++ ++ /* Find the section header so that we get the size. */ ++ sect = find_section_by_type (filedata, SHT_MIPS_OPTIONS); ++ /* PR 17533 file: 012-277276-0.004. */ ++ if (sect == NULL) ++ { ++ error (_("No MIPS_OPTIONS header found\n")); ++ return FALSE; ++ } ++ /* PR 24243 */ ++ if (sect->sh_size < sizeof (* eopt)) ++ { ++ error (_("The MIPS options section is too small.\n")); ++ return FALSE; ++ } ++ ++ eopt = (Elf_External_Options *) get_data (NULL, filedata, options_offset, 1, ++ sect->sh_size, _("options")); ++ if (eopt) ++ { ++ Elf_Internal_Options option; ++ ++ offset = cnt = 0; ++ while (offset <= sect->sh_size - sizeof (* eopt)) ++ { ++ Elf_External_Options * eoption; ++ unsigned int optsize; ++ ++ eoption = (Elf_External_Options *) ((char *) eopt + offset); ++ ++ optsize = BYTE_GET (eoption->size); ++ ++ /* PR 17531: file: ffa0fa3b. */ ++ if (optsize < sizeof (* eopt) ++ || optsize > sect->sh_size - offset) ++ { ++ error (_("Invalid size (%u) for MIPS option\n"), ++ optsize); ++ free (eopt); ++ return FALSE; ++ } ++ offset += optsize; ++ ++cnt; ++ } ++ ++ printf (ngettext ("\nSection '%s' contains %d entry:\n", ++ "\nSection '%s' contains %d entries:\n", ++ cnt), ++ printable_section_name (filedata, sect), cnt); ++ ++ offset = 0; ++ while (cnt-- > 0) ++ { ++ size_t len; ++ Elf_External_Options * eoption; ++ ++ eoption = (Elf_External_Options *) ((char *) eopt + offset); ++ ++ option.kind = BYTE_GET (eoption->kind); ++ option.size = BYTE_GET (eoption->size); ++ option.section = BYTE_GET (eoption->section); ++ option.info = BYTE_GET (eoption->info); ++ ++ switch (option.kind) ++ { ++ case ODK_NULL: ++ /* This shouldn't happen. */ ++ printf (" NULL %" PRId16 " %" PRIx32, ++ option.section, option.info); ++ break; ++ ++ case ODK_REGINFO: ++ printf (" REGINFO "); ++ if (filedata->file_header.e_machine == EM_MIPS) ++ { ++ Elf32_External_RegInfo * ereg; ++ Elf32_RegInfo reginfo; ++ ++ /* 32bit form. */ ++ if (option.size < (sizeof (Elf_External_Options) ++ + sizeof (Elf32_External_RegInfo))) ++ { ++ printf (_("\n")); ++ error (_("Truncated MIPS REGINFO option\n")); ++ cnt = 0; ++ break; ++ } ++ ++ ereg = (Elf32_External_RegInfo *) (eoption + 1); ++ ++ reginfo.ri_gprmask = BYTE_GET (ereg->ri_gprmask); ++ reginfo.ri_cprmask[0] = BYTE_GET (ereg->ri_cprmask[0]); ++ reginfo.ri_cprmask[1] = BYTE_GET (ereg->ri_cprmask[1]); ++ reginfo.ri_cprmask[2] = BYTE_GET (ereg->ri_cprmask[2]); ++ reginfo.ri_cprmask[3] = BYTE_GET (ereg->ri_cprmask[3]); ++ reginfo.ri_gp_value = BYTE_GET (ereg->ri_gp_value); ++ ++ printf ("GPR %08" PRIx32 " GP 0x%" PRIx32 "\n", ++ reginfo.ri_gprmask, reginfo.ri_gp_value); ++ printf (" " ++ " CPR0 %08" PRIx32 " CPR1 %08" PRIx32 ++ " CPR2 %08" PRIx32 " CPR3 %08" PRIx32 "\n", ++ reginfo.ri_cprmask[0], reginfo.ri_cprmask[1], ++ reginfo.ri_cprmask[2], reginfo.ri_cprmask[3]); ++ } ++ else ++ { ++ /* 64 bit form. */ ++ Elf64_External_RegInfo * ereg; ++ Elf64_Internal_RegInfo reginfo; ++ ++ if (option.size < (sizeof (Elf_External_Options) ++ + sizeof (Elf64_External_RegInfo))) ++ { ++ printf (_("\n")); ++ error (_("Truncated MIPS REGINFO option\n")); ++ cnt = 0; ++ break; ++ } ++ ++ ereg = (Elf64_External_RegInfo *) (eoption + 1); ++ reginfo.ri_gprmask = BYTE_GET (ereg->ri_gprmask); ++ reginfo.ri_cprmask[0] = BYTE_GET (ereg->ri_cprmask[0]); ++ reginfo.ri_cprmask[1] = BYTE_GET (ereg->ri_cprmask[1]); ++ reginfo.ri_cprmask[2] = BYTE_GET (ereg->ri_cprmask[2]); ++ reginfo.ri_cprmask[3] = BYTE_GET (ereg->ri_cprmask[3]); ++ reginfo.ri_gp_value = BYTE_GET (ereg->ri_gp_value); ++ ++ printf ("GPR %08" PRIx32 " GP 0x%" PRIx64 "\n", ++ reginfo.ri_gprmask, reginfo.ri_gp_value); ++ printf (" " ++ " CPR0 %08" PRIx32 " CPR1 %08" PRIx32 ++ " CPR2 %08" PRIx32 " CPR3 %08" PRIx32 "\n", ++ reginfo.ri_cprmask[0], reginfo.ri_cprmask[1], ++ reginfo.ri_cprmask[2], reginfo.ri_cprmask[3]); ++ } ++ offset += option.size; ++ continue; ++ ++ case ODK_EXCEPTIONS: ++ fputs (" EXCEPTIONS fpe_min(", stdout); ++ process_mips_fpe_exception (option.info & OEX_FPU_MIN); ++ fputs (") fpe_max(", stdout); ++ process_mips_fpe_exception ((option.info & OEX_FPU_MAX) >> 8); ++ fputs (")", stdout); ++ ++ if (option.info & OEX_PAGE0) ++ fputs (" PAGE0", stdout); ++ if (option.info & OEX_SMM) ++ fputs (" SMM", stdout); ++ if (option.info & OEX_FPDBUG) ++ fputs (" FPDBUG", stdout); ++ if (option.info & OEX_DISMISS) ++ fputs (" DISMISS", stdout); ++ break; ++ ++ case ODK_PAD: ++ fputs (" PAD ", stdout); ++ if (option.info & OPAD_PREFIX) ++ fputs (" PREFIX", stdout); ++ if (option.info & OPAD_POSTFIX) ++ fputs (" POSTFIX", stdout); ++ if (option.info & OPAD_SYMBOL) ++ fputs (" SYMBOL", stdout); ++ break; ++ ++ case ODK_HWPATCH: ++ fputs (" HWPATCH ", stdout); ++ if (option.info & OHW_R4KEOP) ++ fputs (" R4KEOP", stdout); ++ if (option.info & OHW_R8KPFETCH) ++ fputs (" R8KPFETCH", stdout); ++ if (option.info & OHW_R5KEOP) ++ fputs (" R5KEOP", stdout); ++ if (option.info & OHW_R5KCVTL) ++ fputs (" R5KCVTL", stdout); ++ break; ++ ++ case ODK_FILL: ++ fputs (" FILL ", stdout); ++ /* XXX Print content of info word? */ ++ break; ++ ++ case ODK_TAGS: ++ fputs (" TAGS ", stdout); ++ /* XXX Print content of info word? */ ++ break; ++ ++ case ODK_HWAND: ++ fputs (" HWAND ", stdout); ++ if (option.info & OHWA0_R4KEOP_CHECKED) ++ fputs (" R4KEOP_CHECKED", stdout); ++ if (option.info & OHWA0_R4KEOP_CLEAN) ++ fputs (" R4KEOP_CLEAN", stdout); ++ break; ++ ++ case ODK_HWOR: ++ fputs (" HWOR ", stdout); ++ if (option.info & OHWA0_R4KEOP_CHECKED) ++ fputs (" R4KEOP_CHECKED", stdout); ++ if (option.info & OHWA0_R4KEOP_CLEAN) ++ fputs (" R4KEOP_CLEAN", stdout); ++ break; ++ ++ case ODK_GP_GROUP: ++ printf (" GP_GROUP %#06x self-contained %#06x", ++ option.info & OGP_GROUP, ++ (option.info & OGP_SELF) >> 16); ++ break; ++ ++ case ODK_IDENT: ++ printf (" IDENT %#06x self-contained %#06x", ++ option.info & OGP_GROUP, ++ (option.info & OGP_SELF) >> 16); ++ break; ++ ++ default: ++ /* This shouldn't happen. */ ++ printf (" %3d ??? %" PRId16 " %" PRIx32, ++ option.kind, option.section, option.info); ++ break; ++ } ++ ++ len = sizeof (* eopt); ++ while (len < option.size) ++ { ++ unsigned char datum = *((unsigned char *) eoption + len); ++ ++ if (ISPRINT (datum)) ++ printf ("%c", datum); ++ else ++ printf ("\\%03o", datum); ++ len ++; ++ } ++ fputs ("\n", stdout); ++ ++ offset += option.size; ++ } ++ free (eopt); ++ } ++ else ++ res = FALSE; ++ } ++ ++ if (conflicts_offset != 0 && conflictsno != 0) ++ { ++ Elf32_Conflict * iconf; ++ size_t cnt; ++ ++ if (filedata->dynamic_symbols == NULL) ++ { ++ error (_("conflict list found without a dynamic symbol table\n")); ++ return FALSE; ++ } ++ ++ /* PR 21345 - print a slightly more helpful error message ++ if we are sure that the cmalloc will fail. */ ++ if (conflictsno > filedata->file_size / sizeof (* iconf)) ++ { ++ error (_("Overlarge number of conflicts detected: %lx\n"), ++ (long) conflictsno); ++ return FALSE; ++ } ++ ++ iconf = (Elf32_Conflict *) cmalloc (conflictsno, sizeof (* iconf)); ++ if (iconf == NULL) ++ { ++ error (_("Out of memory allocating space for dynamic conflicts\n")); ++ return FALSE; ++ } ++ ++ if (is_32bit_elf) ++ { ++ Elf32_External_Conflict * econf32; ++ ++ econf32 = (Elf32_External_Conflict *) ++ get_data (NULL, filedata, conflicts_offset, ++ sizeof (*econf32), conflictsno, _("conflict")); ++ if (!econf32) ++ { ++ free (iconf); ++ return FALSE; ++ } ++ ++ for (cnt = 0; cnt < conflictsno; ++cnt) ++ iconf[cnt] = BYTE_GET (econf32[cnt]); ++ ++ free (econf32); ++ } ++ else ++ { ++ Elf64_External_Conflict * econf64; ++ ++ econf64 = (Elf64_External_Conflict *) ++ get_data (NULL, filedata, conflicts_offset, ++ sizeof (*econf64), conflictsno, _("conflict")); ++ if (!econf64) ++ { ++ free (iconf); ++ return FALSE; ++ } ++ ++ for (cnt = 0; cnt < conflictsno; ++cnt) ++ iconf[cnt] = BYTE_GET (econf64[cnt]); ++ ++ free (econf64); ++ } ++ ++ printf (ngettext ("\nSection '.conflict' contains %lu entry:\n", ++ "\nSection '.conflict' contains %lu entries:\n", ++ (unsigned long) conflictsno), ++ (unsigned long) conflictsno); ++ puts (_(" Num: Index Value Name")); ++ ++ for (cnt = 0; cnt < conflictsno; ++cnt) ++ { ++ printf ("%5lu: %8lu ", (unsigned long) cnt, iconf[cnt]); ++ ++ if (iconf[cnt] >= filedata->num_dynamic_syms) ++ printf (_("")); ++ else ++ { ++ Elf_Internal_Sym * psym; ++ ++ psym = & filedata->dynamic_symbols[iconf[cnt]]; ++ print_vma (psym->st_value, FULL_HEX); ++ putchar (' '); ++ if (VALID_DYNAMIC_NAME (filedata, psym->st_name)) ++ print_symbol (25, GET_DYNAMIC_NAME (filedata, psym->st_name)); ++ else ++ printf (_(""), psym->st_name); ++ } ++ putchar ('\n'); ++ } ++ ++ free (iconf); ++ } ++ ++ if (pltgot != 0 && local_gotno != 0) ++ { ++ bfd_vma ent, local_end, global_end; ++ size_t i, offset; ++ unsigned char * data; ++ unsigned char * data_end; ++ int addr_size; ++ ++ ent = pltgot; ++ addr_size = (is_32bit_elf ? 4 : 8); ++ local_end = pltgot + local_gotno * addr_size; ++ ++ /* PR binutils/17533 file: 012-111227-0.004 */ ++ if (symtabno < gotsym) ++ { ++ error (_("The GOT symbol offset (%lu) is greater than the symbol table size (%lu)\n"), ++ (unsigned long) gotsym, (unsigned long) symtabno); ++ return FALSE; ++ } ++ ++ global_end = local_end + (symtabno - gotsym) * addr_size; ++ /* PR 17531: file: 54c91a34. */ ++ if (global_end < local_end) ++ { ++ error (_("Too many GOT symbols: %lu\n"), (unsigned long) symtabno); ++ return FALSE; ++ } ++ ++ offset = offset_from_vma (filedata, pltgot, global_end - pltgot); ++ data = (unsigned char *) get_data (NULL, filedata, offset, ++ global_end - pltgot, 1, ++ _("Global Offset Table data")); ++ /* PR 12855: Null data is handled gracefully throughout. */ ++ data_end = data + (global_end - pltgot); ++ ++ printf (_("\nPrimary GOT:\n")); ++ printf (_(" Canonical gp value: ")); ++ print_vma (pltgot + 0x7ff0, LONG_HEX); ++ printf ("\n\n"); ++ ++ printf (_(" Reserved entries:\n")); ++ printf (_(" %*s %10s %*s Purpose\n"), ++ addr_size * 2, _("Address"), _("Access"), ++ addr_size * 2, _("Initial")); ++ ent = print_mips_got_entry (data, pltgot, ent, data_end); ++ printf (_(" Lazy resolver\n")); ++ if (ent == (bfd_vma) -1) ++ goto got_print_fail; ++ ++ /* Check for the MSB of GOT[1] being set, denoting a GNU object. ++ This entry will be used by some runtime loaders, to store the ++ module pointer. Otherwise this is an ordinary local entry. ++ PR 21344: Check for the entry being fully available before ++ fetching it. */ ++ if (data ++ && data + ent - pltgot + addr_size <= data_end ++ && (byte_get (data + ent - pltgot, addr_size) ++ >> (addr_size * 8 - 1)) != 0) ++ { ++ ent = print_mips_got_entry (data, pltgot, ent, data_end); ++ printf (_(" Module pointer (GNU extension)\n")); ++ if (ent == (bfd_vma) -1) ++ goto got_print_fail; ++ } ++ printf ("\n"); ++ ++ if (data != NULL && ent < local_end) ++ { ++ printf (_(" Local entries:\n")); ++ printf (" %*s %10s %*s\n", ++ addr_size * 2, _("Address"), _("Access"), ++ addr_size * 2, _("Initial")); ++ while (ent < local_end) ++ { ++ ent = print_mips_got_entry (data, pltgot, ent, data_end); ++ printf ("\n"); ++ if (ent == (bfd_vma) -1) ++ goto got_print_fail; ++ } ++ printf ("\n"); ++ } ++ ++ if (data != NULL && gotsym < symtabno) ++ { ++ int sym_width; ++ ++ printf (_(" Global entries:\n")); ++ printf (" %*s %10s %*s %*s %-7s %3s %s\n", ++ addr_size * 2, _("Address"), ++ _("Access"), ++ addr_size * 2, _("Initial"), ++ addr_size * 2, _("Sym.Val."), ++ _("Type"), ++ /* Note for translators: "Ndx" = abbreviated form of "Index". */ ++ _("Ndx"), _("Name")); ++ ++ sym_width = (is_32bit_elf ? 80 : 160) - 28 - addr_size * 6 - 1; ++ ++ for (i = gotsym; i < symtabno; i++) ++ { ++ ent = print_mips_got_entry (data, pltgot, ent, data_end); ++ printf (" "); ++ ++ if (filedata->dynamic_symbols == NULL) ++ printf (_("")); ++ else if (i < filedata->num_dynamic_syms) ++ { ++ Elf_Internal_Sym * psym = filedata->dynamic_symbols + i; ++ ++ print_vma (psym->st_value, LONG_HEX); ++ printf (" %-7s %3s ", ++ get_symbol_type (filedata, ELF_ST_TYPE (psym->st_info)), ++ get_symbol_index_type (filedata, psym->st_shndx)); ++ ++ if (VALID_DYNAMIC_NAME (filedata, psym->st_name)) ++ print_symbol (sym_width, ++ GET_DYNAMIC_NAME (filedata, psym->st_name)); ++ else ++ printf (_(""), psym->st_name); ++ } ++ else ++ printf (_(""), ++ (unsigned long) i); ++ ++ printf ("\n"); ++ if (ent == (bfd_vma) -1) ++ break; ++ } ++ printf ("\n"); ++ } ++ ++ got_print_fail: ++ free (data); ++ } ++ ++ if (mips_pltgot != 0 && jmprel != 0 && pltrel != 0 && pltrelsz != 0) ++ { ++ bfd_vma ent, end; ++ size_t offset, rel_offset; ++ unsigned long count, i; ++ unsigned char * data; ++ int addr_size, sym_width; ++ Elf_Internal_Rela * rels; ++ ++ rel_offset = offset_from_vma (filedata, jmprel, pltrelsz); ++ if (pltrel == DT_RELA) ++ { ++ if (!slurp_rela_relocs (filedata, rel_offset, pltrelsz, &rels, &count)) ++ return FALSE; ++ } ++ else ++ { ++ if (!slurp_rel_relocs (filedata, rel_offset, pltrelsz, &rels, &count)) ++ return FALSE; ++ } ++ ++ ent = mips_pltgot; ++ addr_size = (is_32bit_elf ? 4 : 8); ++ end = mips_pltgot + (2 + count) * addr_size; ++ ++ offset = offset_from_vma (filedata, mips_pltgot, end - mips_pltgot); ++ data = (unsigned char *) get_data (NULL, filedata, offset, end - mips_pltgot, ++ 1, _("Procedure Linkage Table data")); ++ if (data == NULL) ++ return FALSE; ++ ++ printf ("\nPLT GOT:\n\n"); ++ printf (_(" Reserved entries:\n")); ++ printf (_(" %*s %*s Purpose\n"), ++ addr_size * 2, _("Address"), addr_size * 2, _("Initial")); ++ ent = print_mips_pltgot_entry (data, mips_pltgot, ent); ++ printf (_(" PLT lazy resolver\n")); ++ ent = print_mips_pltgot_entry (data, mips_pltgot, ent); ++ printf (_(" Module pointer\n")); ++ printf ("\n"); ++ ++ printf (_(" Entries:\n")); ++ printf (" %*s %*s %*s %-7s %3s %s\n", ++ addr_size * 2, _("Address"), ++ addr_size * 2, _("Initial"), ++ addr_size * 2, _("Sym.Val."), _("Type"), _("Ndx"), _("Name")); ++ sym_width = (is_32bit_elf ? 80 : 160) - 17 - addr_size * 6 - 1; ++ for (i = 0; i < count; i++) ++ { ++ unsigned long idx = get_reloc_symindex (rels[i].r_info); ++ ++ ent = print_mips_pltgot_entry (data, mips_pltgot, ent); ++ printf (" "); ++ ++ if (idx >= filedata->num_dynamic_syms) ++ printf (_(""), idx); ++ else ++ { ++ Elf_Internal_Sym * psym = filedata->dynamic_symbols + idx; ++ ++ print_vma (psym->st_value, LONG_HEX); ++ printf (" %-7s %3s ", ++ get_symbol_type (filedata, ELF_ST_TYPE (psym->st_info)), ++ get_symbol_index_type (filedata, psym->st_shndx)); ++ if (VALID_DYNAMIC_NAME (filedata, psym->st_name)) ++ print_symbol (sym_width, ++ GET_DYNAMIC_NAME (filedata, psym->st_name)); ++ else ++ printf (_(""), psym->st_name); ++ } ++ printf ("\n"); ++ } ++ printf ("\n"); ++ ++ free (data); ++ free (rels); ++ } ++ ++ return res; ++} ++ ++static bfd_boolean ++process_nds32_specific (Filedata * filedata) ++{ ++ Elf_Internal_Shdr *sect = NULL; ++ ++ sect = find_section (filedata, ".nds32_e_flags"); ++ if (sect != NULL && sect->sh_size >= 4) ++ { ++ unsigned char *buf; ++ unsigned int flag; ++ ++ printf ("\nNDS32 elf flags section:\n"); ++ buf = get_data (NULL, filedata, sect->sh_offset, 1, 4, ++ _("NDS32 elf flags section")); ++ ++ if (buf == NULL) ++ return FALSE; ++ ++ flag = byte_get (buf, 4); ++ free (buf); ++ switch (flag & 0x3) ++ { ++ case 0: ++ printf ("(VEC_SIZE):\tNo entry.\n"); ++ break; ++ case 1: ++ printf ("(VEC_SIZE):\t4 bytes\n"); ++ break; ++ case 2: ++ printf ("(VEC_SIZE):\t16 bytes\n"); ++ break; ++ case 3: ++ printf ("(VEC_SIZE):\treserved\n"); ++ break; ++ } ++ } ++ ++ return TRUE; ++} ++ ++static bfd_boolean ++process_gnu_liblist (Filedata * filedata) ++{ ++ Elf_Internal_Shdr * section; ++ Elf_Internal_Shdr * string_sec; ++ Elf32_External_Lib * elib; ++ char * strtab; ++ size_t strtab_size; ++ size_t cnt; ++ unsigned long num_liblist; ++ unsigned i; ++ bfd_boolean res = TRUE; ++ ++ if (! do_arch) ++ return TRUE; ++ ++ for (i = 0, section = filedata->section_headers; ++ i < filedata->file_header.e_shnum; ++ i++, section++) ++ { ++ switch (section->sh_type) ++ { ++ case SHT_GNU_LIBLIST: ++ if (section->sh_link >= filedata->file_header.e_shnum) ++ break; ++ ++ elib = (Elf32_External_Lib *) ++ get_data (NULL, filedata, section->sh_offset, 1, section->sh_size, ++ _("liblist section data")); ++ ++ if (elib == NULL) ++ { ++ res = FALSE; ++ break; ++ } ++ ++ string_sec = filedata->section_headers + section->sh_link; ++ strtab = (char *) get_data (NULL, filedata, string_sec->sh_offset, 1, ++ string_sec->sh_size, ++ _("liblist string table")); ++ if (strtab == NULL ++ || section->sh_entsize != sizeof (Elf32_External_Lib)) ++ { ++ free (elib); ++ free (strtab); ++ res = FALSE; ++ break; ++ } ++ strtab_size = string_sec->sh_size; ++ ++ num_liblist = section->sh_size / sizeof (Elf32_External_Lib); ++ printf (ngettext ("\nLibrary list section '%s' contains %lu entries:\n", ++ "\nLibrary list section '%s' contains %lu entries:\n", ++ num_liblist), ++ printable_section_name (filedata, section), ++ num_liblist); ++ ++ puts (_(" Library Time Stamp Checksum Version Flags")); ++ ++ for (cnt = 0; cnt < section->sh_size / sizeof (Elf32_External_Lib); ++ ++cnt) ++ { ++ Elf32_Lib liblist; ++ time_t atime; ++ char timebuf[128]; ++ struct tm * tmp; ++ ++ liblist.l_name = BYTE_GET (elib[cnt].l_name); ++ atime = BYTE_GET (elib[cnt].l_time_stamp); ++ liblist.l_checksum = BYTE_GET (elib[cnt].l_checksum); ++ liblist.l_version = BYTE_GET (elib[cnt].l_version); ++ liblist.l_flags = BYTE_GET (elib[cnt].l_flags); ++ ++ tmp = gmtime (&atime); ++ snprintf (timebuf, sizeof (timebuf), ++ "%04u-%02u-%02uT%02u:%02u:%02u", ++ tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday, ++ tmp->tm_hour, tmp->tm_min, tmp->tm_sec); ++ ++ printf ("%3lu: ", (unsigned long) cnt); ++ if (do_wide) ++ printf ("%-20s", liblist.l_name < strtab_size ++ ? strtab + liblist.l_name : _("")); ++ else ++ printf ("%-20.20s", liblist.l_name < strtab_size ++ ? strtab + liblist.l_name : _("")); ++ printf (" %s %#010lx %-7ld %-7ld\n", timebuf, liblist.l_checksum, ++ liblist.l_version, liblist.l_flags); ++ } ++ ++ free (elib); ++ free (strtab); ++ } ++ } ++ ++ return res; ++} ++ ++static const char * ++get_note_type (Filedata * filedata, unsigned e_type) ++{ ++ static char buff[64]; ++ ++ if (filedata->file_header.e_type == ET_CORE) ++ switch (e_type) ++ { ++ case NT_AUXV: ++ return _("NT_AUXV (auxiliary vector)"); ++ case NT_PRSTATUS: ++ return _("NT_PRSTATUS (prstatus structure)"); ++ case NT_FPREGSET: ++ return _("NT_FPREGSET (floating point registers)"); ++ case NT_PRPSINFO: ++ return _("NT_PRPSINFO (prpsinfo structure)"); ++ case NT_TASKSTRUCT: ++ return _("NT_TASKSTRUCT (task structure)"); ++ case NT_PRXFPREG: ++ return _("NT_PRXFPREG (user_xfpregs structure)"); ++ case NT_PPC_VMX: ++ return _("NT_PPC_VMX (ppc Altivec registers)"); ++ case NT_PPC_VSX: ++ return _("NT_PPC_VSX (ppc VSX registers)"); ++ case NT_PPC_TAR: ++ return _("NT_PPC_TAR (ppc TAR register)"); ++ case NT_PPC_PPR: ++ return _("NT_PPC_PPR (ppc PPR register)"); ++ case NT_PPC_DSCR: ++ return _("NT_PPC_DSCR (ppc DSCR register)"); ++ case NT_PPC_EBB: ++ return _("NT_PPC_EBB (ppc EBB registers)"); ++ case NT_PPC_PMU: ++ return _("NT_PPC_PMU (ppc PMU registers)"); ++ case NT_PPC_TM_CGPR: ++ return _("NT_PPC_TM_CGPR (ppc checkpointed GPR registers)"); ++ case NT_PPC_TM_CFPR: ++ return _("NT_PPC_TM_CFPR (ppc checkpointed floating point registers)"); ++ case NT_PPC_TM_CVMX: ++ return _("NT_PPC_TM_CVMX (ppc checkpointed Altivec registers)"); ++ case NT_PPC_TM_CVSX: ++ return _("NT_PPC_TM_CVSX (ppc checkpointed VSX registers)"); ++ case NT_PPC_TM_SPR: ++ return _("NT_PPC_TM_SPR (ppc TM special purpose registers)"); ++ case NT_PPC_TM_CTAR: ++ return _("NT_PPC_TM_CTAR (ppc checkpointed TAR register)"); ++ case NT_PPC_TM_CPPR: ++ return _("NT_PPC_TM_CPPR (ppc checkpointed PPR register)"); ++ case NT_PPC_TM_CDSCR: ++ return _("NT_PPC_TM_CDSCR (ppc checkpointed DSCR register)"); ++ case NT_386_TLS: ++ return _("NT_386_TLS (x86 TLS information)"); ++ case NT_386_IOPERM: ++ return _("NT_386_IOPERM (x86 I/O permissions)"); ++ case NT_X86_XSTATE: ++ return _("NT_X86_XSTATE (x86 XSAVE extended state)"); ++ case NT_S390_HIGH_GPRS: ++ return _("NT_S390_HIGH_GPRS (s390 upper register halves)"); ++ case NT_S390_TIMER: ++ return _("NT_S390_TIMER (s390 timer register)"); ++ case NT_S390_TODCMP: ++ return _("NT_S390_TODCMP (s390 TOD comparator register)"); ++ case NT_S390_TODPREG: ++ return _("NT_S390_TODPREG (s390 TOD programmable register)"); ++ case NT_S390_CTRS: ++ return _("NT_S390_CTRS (s390 control registers)"); ++ case NT_S390_PREFIX: ++ return _("NT_S390_PREFIX (s390 prefix register)"); ++ case NT_S390_LAST_BREAK: ++ return _("NT_S390_LAST_BREAK (s390 last breaking event address)"); ++ case NT_S390_SYSTEM_CALL: ++ return _("NT_S390_SYSTEM_CALL (s390 system call restart data)"); ++ case NT_S390_TDB: ++ return _("NT_S390_TDB (s390 transaction diagnostic block)"); ++ case NT_S390_VXRS_LOW: ++ return _("NT_S390_VXRS_LOW (s390 vector registers 0-15 upper half)"); ++ case NT_S390_VXRS_HIGH: ++ return _("NT_S390_VXRS_HIGH (s390 vector registers 16-31)"); ++ case NT_S390_GS_CB: ++ return _("NT_S390_GS_CB (s390 guarded-storage registers)"); ++ case NT_S390_GS_BC: ++ return _("NT_S390_GS_BC (s390 guarded-storage broadcast control)"); ++ case NT_ARM_VFP: ++ return _("NT_ARM_VFP (arm VFP registers)"); ++ case NT_ARM_TLS: ++ return _("NT_ARM_TLS (AArch TLS registers)"); ++ case NT_ARM_HW_BREAK: ++ return _("NT_ARM_HW_BREAK (AArch hardware breakpoint registers)"); ++ case NT_ARM_HW_WATCH: ++ return _("NT_ARM_HW_WATCH (AArch hardware watchpoint registers)"); ++ case NT_ARC_V2: ++ return _("NT_ARC_V2 (ARC HS accumulator/extra registers)"); ++ case NT_PSTATUS: ++ return _("NT_PSTATUS (pstatus structure)"); ++ case NT_FPREGS: ++ return _("NT_FPREGS (floating point registers)"); ++ case NT_PSINFO: ++ return _("NT_PSINFO (psinfo structure)"); ++ case NT_LWPSTATUS: ++ return _("NT_LWPSTATUS (lwpstatus_t structure)"); ++ case NT_LWPSINFO: ++ return _("NT_LWPSINFO (lwpsinfo_t structure)"); ++ case NT_WIN32PSTATUS: ++ return _("NT_WIN32PSTATUS (win32_pstatus structure)"); ++ case NT_SIGINFO: ++ return _("NT_SIGINFO (siginfo_t data)"); ++ case NT_FILE: ++ return _("NT_FILE (mapped files)"); ++ default: ++ break; ++ } ++ else ++ switch (e_type) ++ { ++ case NT_VERSION: ++ return _("NT_VERSION (version)"); ++ case NT_ARCH: ++ return _("NT_ARCH (architecture)"); ++ case NT_GNU_BUILD_ATTRIBUTE_OPEN: ++ return _("OPEN"); ++ case NT_GNU_BUILD_ATTRIBUTE_FUNC: ++ return _("func"); ++ default: ++ break; ++ } ++ ++ snprintf (buff, sizeof (buff), _("Unknown note type: (0x%08x)"), e_type); ++ return buff; ++} ++ ++static bfd_boolean ++print_core_note (Elf_Internal_Note *pnote) ++{ ++ unsigned int addr_size = is_32bit_elf ? 4 : 8; ++ bfd_vma count, page_size; ++ unsigned char *descdata, *filenames, *descend; ++ ++ if (pnote->type != NT_FILE) ++ { ++ if (do_wide) ++ printf ("\n"); ++ return TRUE; ++ } ++ ++#ifndef BFD64 ++ if (!is_32bit_elf) ++ { ++ printf (_(" Cannot decode 64-bit note in 32-bit build\n")); ++ /* Still "successful". */ ++ return TRUE; ++ } ++#endif ++ ++ if (pnote->descsz < 2 * addr_size) ++ { ++ error (_(" Malformed note - too short for header\n")); ++ return FALSE; ++ } ++ ++ descdata = (unsigned char *) pnote->descdata; ++ descend = descdata + pnote->descsz; ++ ++ if (descdata[pnote->descsz - 1] != '\0') ++ { ++ error (_(" Malformed note - does not end with \\0\n")); ++ return FALSE; ++ } ++ ++ count = byte_get (descdata, addr_size); ++ descdata += addr_size; ++ ++ page_size = byte_get (descdata, addr_size); ++ descdata += addr_size; ++ ++ if (count > ((bfd_vma) -1 - 2 * addr_size) / (3 * addr_size) ++ || pnote->descsz < 2 * addr_size + count * 3 * addr_size) ++ { ++ error (_(" Malformed note - too short for supplied file count\n")); ++ return FALSE; ++ } ++ ++ printf (_(" Page size: ")); ++ print_vma (page_size, DEC); ++ printf ("\n"); ++ ++ printf (_(" %*s%*s%*s\n"), ++ (int) (2 + 2 * addr_size), _("Start"), ++ (int) (4 + 2 * addr_size), _("End"), ++ (int) (4 + 2 * addr_size), _("Page Offset")); ++ filenames = descdata + count * 3 * addr_size; ++ while (count-- > 0) ++ { ++ bfd_vma start, end, file_ofs; ++ ++ if (filenames == descend) ++ { ++ error (_(" Malformed note - filenames end too early\n")); ++ return FALSE; ++ } ++ ++ start = byte_get (descdata, addr_size); ++ descdata += addr_size; ++ end = byte_get (descdata, addr_size); ++ descdata += addr_size; ++ file_ofs = byte_get (descdata, addr_size); ++ descdata += addr_size; ++ ++ printf (" "); ++ print_vma (start, FULL_HEX); ++ printf (" "); ++ print_vma (end, FULL_HEX); ++ printf (" "); ++ print_vma (file_ofs, FULL_HEX); ++ printf ("\n %s\n", filenames); ++ ++ filenames += 1 + strlen ((char *) filenames); ++ } ++ ++ return TRUE; ++} ++ ++static const char * ++get_gnu_elf_note_type (unsigned e_type) ++{ ++ /* NB/ Keep this switch statement in sync with print_gnu_note (). */ ++ switch (e_type) ++ { ++ case NT_GNU_ABI_TAG: ++ return _("NT_GNU_ABI_TAG (ABI version tag)"); ++ case NT_GNU_HWCAP: ++ return _("NT_GNU_HWCAP (DSO-supplied software HWCAP info)"); ++ case NT_GNU_BUILD_ID: ++ return _("NT_GNU_BUILD_ID (unique build ID bitstring)"); ++ case NT_GNU_GOLD_VERSION: ++ return _("NT_GNU_GOLD_VERSION (gold version)"); ++ case NT_GNU_PROPERTY_TYPE_0: ++ return _("NT_GNU_PROPERTY_TYPE_0"); ++ case NT_GNU_BUILD_ATTRIBUTE_OPEN: ++ return _("NT_GNU_BUILD_ATTRIBUTE_OPEN"); ++ case NT_GNU_BUILD_ATTRIBUTE_FUNC: ++ return _("NT_GNU_BUILD_ATTRIBUTE_FUNC"); ++ default: ++ { ++ static char buff[64]; ++ ++ snprintf (buff, sizeof (buff), _("Unknown note type: (0x%08x)"), e_type); ++ return buff; ++ } ++ } ++} ++ ++static void ++decode_x86_compat_isa (unsigned int bitmask) ++{ ++ while (bitmask) ++ { ++ unsigned int bit = bitmask & (- bitmask); ++ ++ bitmask &= ~ bit; ++ switch (bit) ++ { ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_486: ++ printf ("i486"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_586: ++ printf ("586"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_686: ++ printf ("686"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_SSE: ++ printf ("SSE"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_SSE2: ++ printf ("SSE2"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_SSE3: ++ printf ("SSE3"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_SSSE3: ++ printf ("SSSE3"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_SSE4_1: ++ printf ("SSE4_1"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_SSE4_2: ++ printf ("SSE4_2"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX: ++ printf ("AVX"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX2: ++ printf ("AVX2"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512F: ++ printf ("AVX512F"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512CD: ++ printf ("AVX512CD"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512ER: ++ printf ("AVX512ER"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512PF: ++ printf ("AVX512PF"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512VL: ++ printf ("AVX512VL"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512DQ: ++ printf ("AVX512DQ"); ++ break; ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512BW: ++ printf ("AVX512BW"); ++ break; ++ default: ++ printf (_(""), bit); ++ break; ++ } ++ if (bitmask) ++ printf (", "); ++ } ++} ++ ++static void ++decode_x86_isa (unsigned int bitmask) ++{ ++ if (!bitmask) ++ { ++ printf (_("")); ++ return; ++ } ++ ++ while (bitmask) ++ { ++ unsigned int bit = bitmask & (- bitmask); ++ ++ bitmask &= ~ bit; ++ switch (bit) ++ { ++ case GNU_PROPERTY_X86_ISA_1_CMOV: ++ printf ("CMOV"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_SSE: ++ printf ("SSE"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_SSE2: ++ printf ("SSE2"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_SSE3: ++ printf ("SSE3"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_SSSE3: ++ printf ("SSSE3"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_SSE4_1: ++ printf ("SSE4_1"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_SSE4_2: ++ printf ("SSE4_2"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX: ++ printf ("AVX"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX2: ++ printf ("AVX2"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_FMA: ++ printf ("FMA"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX512F: ++ printf ("AVX512F"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX512CD: ++ printf ("AVX512CD"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX512ER: ++ printf ("AVX512ER"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX512PF: ++ printf ("AVX512PF"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX512VL: ++ printf ("AVX512VL"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX512DQ: ++ printf ("AVX512DQ"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX512BW: ++ printf ("AVX512BW"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX512_4FMAPS: ++ printf ("AVX512_4FMAPS"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX512_4VNNIW: ++ printf ("AVX512_4VNNIW"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX512_BITALG: ++ printf ("AVX512_BITALG"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX512_IFMA: ++ printf ("AVX512_IFMA"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX512_VBMI: ++ printf ("AVX512_VBMI"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX512_VBMI2: ++ printf ("AVX512_VBMI2"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX512_VNNI: ++ printf ("AVX512_VNNI"); ++ break; ++ case GNU_PROPERTY_X86_ISA_1_AVX512_BF16: ++ printf ("AVX512_BF16"); ++ break; ++ default: ++ printf (_(""), bit); ++ break; ++ } ++ if (bitmask) ++ printf (", "); ++ } ++} ++ ++static void ++decode_x86_feature_1 (unsigned int bitmask) ++{ ++ if (!bitmask) ++ { ++ printf (_("")); ++ return; ++ } ++ ++ while (bitmask) ++ { ++ unsigned int bit = bitmask & (- bitmask); ++ ++ bitmask &= ~ bit; ++ switch (bit) ++ { ++ case GNU_PROPERTY_X86_FEATURE_1_IBT: ++ printf ("IBT"); ++ break; ++ case GNU_PROPERTY_X86_FEATURE_1_SHSTK: ++ printf ("SHSTK"); ++ break; ++ default: ++ printf (_(""), bit); ++ break; ++ } ++ if (bitmask) ++ printf (", "); ++ } ++} ++ ++static void ++decode_x86_feature_2 (unsigned int bitmask) ++{ ++ if (!bitmask) ++ { ++ printf (_("")); ++ return; ++ } ++ ++ while (bitmask) ++ { ++ unsigned int bit = bitmask & (- bitmask); ++ ++ bitmask &= ~ bit; ++ switch (bit) ++ { ++ case GNU_PROPERTY_X86_FEATURE_2_X86: ++ printf ("x86"); ++ break; ++ case GNU_PROPERTY_X86_FEATURE_2_X87: ++ printf ("x87"); ++ break; ++ case GNU_PROPERTY_X86_FEATURE_2_MMX: ++ printf ("MMX"); ++ break; ++ case GNU_PROPERTY_X86_FEATURE_2_XMM: ++ printf ("XMM"); ++ break; ++ case GNU_PROPERTY_X86_FEATURE_2_YMM: ++ printf ("YMM"); ++ break; ++ case GNU_PROPERTY_X86_FEATURE_2_ZMM: ++ printf ("ZMM"); ++ break; ++ case GNU_PROPERTY_X86_FEATURE_2_FXSR: ++ printf ("FXSR"); ++ break; ++ case GNU_PROPERTY_X86_FEATURE_2_XSAVE: ++ printf ("XSAVE"); ++ break; ++ case GNU_PROPERTY_X86_FEATURE_2_XSAVEOPT: ++ printf ("XSAVEOPT"); ++ break; ++ case GNU_PROPERTY_X86_FEATURE_2_XSAVEC: ++ printf ("XSAVEC"); ++ break; ++ default: ++ printf (_(""), bit); ++ break; ++ } ++ if (bitmask) ++ printf (", "); ++ } ++} ++ ++static void ++decode_aarch64_feature_1_and (unsigned int bitmask) ++{ ++ while (bitmask) ++ { ++ unsigned int bit = bitmask & (- bitmask); ++ ++ bitmask &= ~ bit; ++ switch (bit) ++ { ++ case GNU_PROPERTY_AARCH64_FEATURE_1_BTI: ++ printf ("BTI"); ++ break; ++ ++ case GNU_PROPERTY_AARCH64_FEATURE_1_PAC: ++ printf ("PAC"); ++ break; ++ ++ default: ++ printf (_(""), bit); ++ break; ++ } ++ if (bitmask) ++ printf (", "); ++ } ++} ++ ++static void ++print_gnu_property_note (Filedata * filedata, Elf_Internal_Note * pnote) ++{ ++ unsigned char * ptr = (unsigned char *) pnote->descdata; ++ unsigned char * ptr_end = ptr + pnote->descsz; ++ unsigned int size = is_32bit_elf ? 4 : 8; ++ ++ printf (_(" Properties: ")); ++ ++ if (pnote->descsz < 8 || (pnote->descsz % size) != 0) ++ { ++ printf (_("\n"), pnote->descsz); ++ return; ++ } ++ ++ while (ptr < ptr_end) ++ { ++ unsigned int j; ++ unsigned int type; ++ unsigned int datasz; ++ ++ if ((size_t) (ptr_end - ptr) < 8) ++ { ++ printf (_("\n"), pnote->descsz); ++ break; ++ } ++ ++ type = byte_get (ptr, 4); ++ datasz = byte_get (ptr + 4, 4); ++ ++ ptr += 8; ++ ++ if (datasz > (size_t) (ptr_end - ptr)) ++ { ++ printf (_("\n"), ++ type, datasz); ++ break; ++ } ++ ++ if (type >= GNU_PROPERTY_LOPROC && type <= GNU_PROPERTY_HIPROC) ++ { ++ if (filedata->file_header.e_machine == EM_X86_64 ++ || filedata->file_header.e_machine == EM_IAMCU ++ || filedata->file_header.e_machine == EM_386) ++ { ++ unsigned int bitmask; ++ ++ if (datasz == 4) ++ bitmask = byte_get (ptr, 4); ++ else ++ bitmask = 0; ++ ++ switch (type) ++ { ++ case GNU_PROPERTY_X86_ISA_1_USED: ++ if (datasz != 4) ++ printf (_("x86 ISA used: "), ++ datasz); ++ else ++ { ++ printf ("x86 ISA used: "); ++ decode_x86_isa (bitmask); ++ } ++ goto next; ++ ++ case GNU_PROPERTY_X86_ISA_1_NEEDED: ++ if (datasz != 4) ++ printf (_("x86 ISA needed: "), ++ datasz); ++ else ++ { ++ printf ("x86 ISA needed: "); ++ decode_x86_isa (bitmask); ++ } ++ goto next; ++ ++ case GNU_PROPERTY_X86_FEATURE_1_AND: ++ if (datasz != 4) ++ printf (_("x86 feature: "), ++ datasz); ++ else ++ { ++ printf ("x86 feature: "); ++ decode_x86_feature_1 (bitmask); ++ } ++ goto next; ++ ++ case GNU_PROPERTY_X86_FEATURE_2_USED: ++ if (datasz != 4) ++ printf (_("x86 feature used: "), ++ datasz); ++ else ++ { ++ printf ("x86 feature used: "); ++ decode_x86_feature_2 (bitmask); ++ } ++ goto next; ++ ++ case GNU_PROPERTY_X86_FEATURE_2_NEEDED: ++ if (datasz != 4) ++ printf (_("x86 feature needed: "), datasz); ++ else ++ { ++ printf ("x86 feature needed: "); ++ decode_x86_feature_2 (bitmask); ++ } ++ goto next; ++ ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_USED: ++ if (datasz != 4) ++ printf (_("x86 ISA used: "), ++ datasz); ++ else ++ { ++ printf ("x86 ISA used: "); ++ decode_x86_compat_isa (bitmask); ++ } ++ goto next; ++ ++ case GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED: ++ if (datasz != 4) ++ printf (_("x86 ISA needed: "), ++ datasz); ++ else ++ { ++ printf ("x86 ISA needed: "); ++ decode_x86_compat_isa (bitmask); ++ } ++ goto next; ++ ++ default: ++ break; ++ } ++ } ++ else if (filedata->file_header.e_machine == EM_AARCH64) ++ { ++ if (type == GNU_PROPERTY_AARCH64_FEATURE_1_AND) ++ { ++ printf ("AArch64 feature: "); ++ if (datasz != 4) ++ printf (_(" "), datasz); ++ else ++ decode_aarch64_feature_1_and (byte_get (ptr, 4)); ++ goto next; ++ } ++ } ++ } ++ else ++ { ++ switch (type) ++ { ++ case GNU_PROPERTY_STACK_SIZE: ++ printf (_("stack size: ")); ++ if (datasz != size) ++ printf (_(" "), datasz); ++ else ++ printf ("%#lx", (unsigned long) byte_get (ptr, size)); ++ goto next; ++ ++ case GNU_PROPERTY_NO_COPY_ON_PROTECTED: ++ printf ("no copy on protected "); ++ if (datasz) ++ printf (_(" "), datasz); ++ goto next; ++ ++ default: ++ break; ++ } ++ } ++ ++ if (type < GNU_PROPERTY_LOPROC) ++ printf (_(""); ++ ++ next: ++ ptr += ((datasz + (size - 1)) & ~ (size - 1)); ++ if (ptr == ptr_end) ++ break; ++ ++ if (do_wide) ++ printf (", "); ++ else ++ printf ("\n\t"); ++ } ++ ++ printf ("\n"); ++} ++ ++static bfd_boolean ++print_gnu_note (Filedata * filedata, Elf_Internal_Note *pnote) ++{ ++ /* NB/ Keep this switch statement in sync with get_gnu_elf_note_type (). */ ++ switch (pnote->type) ++ { ++ case NT_GNU_BUILD_ID: ++ { ++ unsigned long i; ++ ++ printf (_(" Build ID: ")); ++ for (i = 0; i < pnote->descsz; ++i) ++ printf ("%02x", pnote->descdata[i] & 0xff); ++ printf ("\n"); ++ } ++ break; ++ ++ case NT_GNU_ABI_TAG: ++ { ++ unsigned long os, major, minor, subminor; ++ const char *osname; ++ ++ /* PR 17531: file: 030-599401-0.004. */ ++ if (pnote->descsz < 16) ++ { ++ printf (_(" \n")); ++ break; ++ } ++ ++ os = byte_get ((unsigned char *) pnote->descdata, 4); ++ major = byte_get ((unsigned char *) pnote->descdata + 4, 4); ++ minor = byte_get ((unsigned char *) pnote->descdata + 8, 4); ++ subminor = byte_get ((unsigned char *) pnote->descdata + 12, 4); ++ ++ switch (os) ++ { ++ case GNU_ABI_TAG_LINUX: ++ osname = "Linux"; ++ break; ++ case GNU_ABI_TAG_HURD: ++ osname = "Hurd"; ++ break; ++ case GNU_ABI_TAG_SOLARIS: ++ osname = "Solaris"; ++ break; ++ case GNU_ABI_TAG_FREEBSD: ++ osname = "FreeBSD"; ++ break; ++ case GNU_ABI_TAG_NETBSD: ++ osname = "NetBSD"; ++ break; ++ case GNU_ABI_TAG_SYLLABLE: ++ osname = "Syllable"; ++ break; ++ case GNU_ABI_TAG_NACL: ++ osname = "NaCl"; ++ break; ++ default: ++ osname = "Unknown"; ++ break; ++ } ++ ++ printf (_(" OS: %s, ABI: %ld.%ld.%ld\n"), osname, ++ major, minor, subminor); ++ } ++ break; ++ ++ case NT_GNU_GOLD_VERSION: ++ { ++ unsigned long i; ++ ++ printf (_(" Version: ")); ++ for (i = 0; i < pnote->descsz && pnote->descdata[i] != '\0'; ++i) ++ printf ("%c", pnote->descdata[i]); ++ printf ("\n"); ++ } ++ break; ++ ++ case NT_GNU_HWCAP: ++ { ++ unsigned long num_entries, mask; ++ ++ /* Hardware capabilities information. Word 0 is the number of entries. ++ Word 1 is a bitmask of enabled entries. The rest of the descriptor ++ is a series of entries, where each entry is a single byte followed ++ by a nul terminated string. The byte gives the bit number to test ++ if enabled in the bitmask. */ ++ printf (_(" Hardware Capabilities: ")); ++ if (pnote->descsz < 8) ++ { ++ error (_("\n")); ++ return FALSE; ++ } ++ num_entries = byte_get ((unsigned char *) pnote->descdata, 4); ++ mask = byte_get ((unsigned char *) pnote->descdata + 4, 4); ++ printf (_("num entries: %ld, enabled mask: %lx\n"), num_entries, mask); ++ /* FIXME: Add code to display the entries... */ ++ } ++ break; ++ ++ case NT_GNU_PROPERTY_TYPE_0: ++ print_gnu_property_note (filedata, pnote); ++ break; ++ ++ default: ++ /* Handle unrecognised types. An error message should have already been ++ created by get_gnu_elf_note_type(), so all that we need to do is to ++ display the data. */ ++ { ++ unsigned long i; ++ ++ printf (_(" Description data: ")); ++ for (i = 0; i < pnote->descsz; ++i) ++ printf ("%02x ", pnote->descdata[i] & 0xff); ++ printf ("\n"); ++ } ++ break; ++ } ++ ++ return TRUE; ++} ++ ++static const char * ++get_v850_elf_note_type (enum v850_notes n_type) ++{ ++ static char buff[64]; ++ ++ switch (n_type) ++ { ++ case V850_NOTE_ALIGNMENT: return _("Alignment of 8-byte objects"); ++ case V850_NOTE_DATA_SIZE: return _("Sizeof double and long double"); ++ case V850_NOTE_FPU_INFO: return _("Type of FPU support needed"); ++ case V850_NOTE_SIMD_INFO: return _("Use of SIMD instructions"); ++ case V850_NOTE_CACHE_INFO: return _("Use of cache"); ++ case V850_NOTE_MMU_INFO: return _("Use of MMU"); ++ default: ++ snprintf (buff, sizeof (buff), _("Unknown note type: (0x%08x)"), n_type); ++ return buff; ++ } ++} ++ ++static bfd_boolean ++print_v850_note (Elf_Internal_Note * pnote) ++{ ++ unsigned int val; ++ ++ if (pnote->descsz != 4) ++ return FALSE; ++ ++ val = byte_get ((unsigned char *) pnote->descdata, pnote->descsz); ++ ++ if (val == 0) ++ { ++ printf (_("not set\n")); ++ return TRUE; ++ } ++ ++ switch (pnote->type) ++ { ++ case V850_NOTE_ALIGNMENT: ++ switch (val) ++ { ++ case EF_RH850_DATA_ALIGN4: printf (_("4-byte\n")); return TRUE; ++ case EF_RH850_DATA_ALIGN8: printf (_("8-byte\n")); return TRUE; ++ } ++ break; ++ ++ case V850_NOTE_DATA_SIZE: ++ switch (val) ++ { ++ case EF_RH850_DOUBLE32: printf (_("4-bytes\n")); return TRUE; ++ case EF_RH850_DOUBLE64: printf (_("8-bytes\n")); return TRUE; ++ } ++ break; ++ ++ case V850_NOTE_FPU_INFO: ++ switch (val) ++ { ++ case EF_RH850_FPU20: printf (_("FPU-2.0\n")); return TRUE; ++ case EF_RH850_FPU30: printf (_("FPU-3.0\n")); return TRUE; ++ } ++ break; ++ ++ case V850_NOTE_MMU_INFO: ++ case V850_NOTE_CACHE_INFO: ++ case V850_NOTE_SIMD_INFO: ++ if (val == EF_RH850_SIMD) ++ { ++ printf (_("yes\n")); ++ return TRUE; ++ } ++ break; ++ ++ default: ++ /* An 'unknown note type' message will already have been displayed. */ ++ break; ++ } ++ ++ printf (_("unknown value: %x\n"), val); ++ return FALSE; ++} ++ ++static bfd_boolean ++process_netbsd_elf_note (Elf_Internal_Note * pnote) ++{ ++ unsigned int version; ++ ++ switch (pnote->type) ++ { ++ case NT_NETBSD_IDENT: ++ if (pnote->descsz < 1) ++ break; ++ version = byte_get ((unsigned char *) pnote->descdata, sizeof (version)); ++ if ((version / 10000) % 100) ++ printf (" NetBSD\t\t0x%08lx\tIDENT %u (%u.%u%s%c)\n", pnote->descsz, ++ version, version / 100000000, (version / 1000000) % 100, ++ (version / 10000) % 100 > 26 ? "Z" : "", ++ 'A' + (version / 10000) % 26); ++ else ++ printf (" NetBSD\t\t0x%08lx\tIDENT %u (%u.%u.%u)\n", pnote->descsz, ++ version, version / 100000000, (version / 1000000) % 100, ++ (version / 100) % 100); ++ return TRUE; ++ ++ case NT_NETBSD_MARCH: ++ printf (" NetBSD\t\t0x%08lx\tMARCH <%s>\n", pnote->descsz, ++ pnote->descdata); ++ return TRUE; ++ ++#ifdef NT_NETBSD_PAX ++ case NT_NETBSD_PAX: ++ if (pnote->descsz < 1) ++ break; ++ version = byte_get ((unsigned char *) pnote->descdata, sizeof (version)); ++ printf (" NetBSD\t\t0x%08lx\tPaX <%s%s%s%s%s%s>\n", pnote->descsz, ++ ((version & NT_NETBSD_PAX_MPROTECT) ? "+mprotect" : ""), ++ ((version & NT_NETBSD_PAX_NOMPROTECT) ? "-mprotect" : ""), ++ ((version & NT_NETBSD_PAX_GUARD) ? "+guard" : ""), ++ ((version & NT_NETBSD_PAX_NOGUARD) ? "-guard" : ""), ++ ((version & NT_NETBSD_PAX_ASLR) ? "+ASLR" : ""), ++ ((version & NT_NETBSD_PAX_NOASLR) ? "-ASLR" : "")); ++ return TRUE; ++#endif ++ } ++ ++ printf (" NetBSD\t0x%08lx\tUnknown note type: (0x%08lx)\n", ++ pnote->descsz, pnote->type); ++ return FALSE; ++} ++ ++static const char * ++get_freebsd_elfcore_note_type (Filedata * filedata, unsigned e_type) ++{ ++ switch (e_type) ++ { ++ case NT_FREEBSD_THRMISC: ++ return _("NT_THRMISC (thrmisc structure)"); ++ case NT_FREEBSD_PROCSTAT_PROC: ++ return _("NT_PROCSTAT_PROC (proc data)"); ++ case NT_FREEBSD_PROCSTAT_FILES: ++ return _("NT_PROCSTAT_FILES (files data)"); ++ case NT_FREEBSD_PROCSTAT_VMMAP: ++ return _("NT_PROCSTAT_VMMAP (vmmap data)"); ++ case NT_FREEBSD_PROCSTAT_GROUPS: ++ return _("NT_PROCSTAT_GROUPS (groups data)"); ++ case NT_FREEBSD_PROCSTAT_UMASK: ++ return _("NT_PROCSTAT_UMASK (umask data)"); ++ case NT_FREEBSD_PROCSTAT_RLIMIT: ++ return _("NT_PROCSTAT_RLIMIT (rlimit data)"); ++ case NT_FREEBSD_PROCSTAT_OSREL: ++ return _("NT_PROCSTAT_OSREL (osreldate data)"); ++ case NT_FREEBSD_PROCSTAT_PSSTRINGS: ++ return _("NT_PROCSTAT_PSSTRINGS (ps_strings data)"); ++ case NT_FREEBSD_PROCSTAT_AUXV: ++ return _("NT_PROCSTAT_AUXV (auxv data)"); ++ case NT_FREEBSD_PTLWPINFO: ++ return _("NT_PTLWPINFO (ptrace_lwpinfo structure)"); ++ } ++ return get_note_type (filedata, e_type); ++} ++ ++static const char * ++get_netbsd_elfcore_note_type (Filedata * filedata, unsigned e_type) ++{ ++ static char buff[64]; ++ ++ switch (e_type) ++ { ++ case NT_NETBSDCORE_PROCINFO: ++ /* NetBSD core "procinfo" structure. */ ++ return _("NetBSD procinfo structure"); ++ ++#ifdef NT_NETBSDCORE_AUXV ++ case NT_NETBSDCORE_AUXV: ++ return _("NetBSD ELF auxiliary vector data"); ++#endif ++ ++#ifdef NT_NETBSDCORE_LWPSTATUS ++ case NT_NETBSDCORE_LWPSTATUS: ++ return _("PT_LWPSTATUS (ptrace_lwpstatus structure)"); ++#endif ++ ++ default: ++ /* As of Jan 2020 there are no other machine-independent notes ++ defined for NetBSD core files. If the note type is less ++ than the start of the machine-dependent note types, we don't ++ understand it. */ ++ ++ if (e_type < NT_NETBSDCORE_FIRSTMACH) ++ { ++ snprintf (buff, sizeof (buff), _("Unknown note type: (0x%08x)"), e_type); ++ return buff; ++ } ++ break; ++ } ++ ++ switch (filedata->file_header.e_machine) ++ { ++ /* On the Alpha, SPARC (32-bit and 64-bit), PT_GETREGS == mach+0 ++ and PT_GETFPREGS == mach+2. */ ++ ++ case EM_OLD_ALPHA: ++ case EM_ALPHA: ++ case EM_SPARC: ++ case EM_SPARC32PLUS: ++ case EM_SPARCV9: ++ switch (e_type) ++ { ++ case NT_NETBSDCORE_FIRSTMACH + 0: ++ return _("PT_GETREGS (reg structure)"); ++ case NT_NETBSDCORE_FIRSTMACH + 2: ++ return _("PT_GETFPREGS (fpreg structure)"); ++ default: ++ break; ++ } ++ break; ++ ++ /* On SuperH, PT_GETREGS == mach+3 and PT_GETFPREGS == mach+5. ++ There's also old PT___GETREGS40 == mach + 1 for old reg ++ structure which lacks GBR. */ ++ case EM_SH: ++ switch (e_type) ++ { ++ case NT_NETBSDCORE_FIRSTMACH + 1: ++ return _("PT___GETREGS40 (old reg structure)"); ++ case NT_NETBSDCORE_FIRSTMACH + 3: ++ return _("PT_GETREGS (reg structure)"); ++ case NT_NETBSDCORE_FIRSTMACH + 5: ++ return _("PT_GETFPREGS (fpreg structure)"); ++ default: ++ break; ++ } ++ break; ++ ++ /* On all other arch's, PT_GETREGS == mach+1 and ++ PT_GETFPREGS == mach+3. */ ++ default: ++ switch (e_type) ++ { ++ case NT_NETBSDCORE_FIRSTMACH + 1: ++ return _("PT_GETREGS (reg structure)"); ++ case NT_NETBSDCORE_FIRSTMACH + 3: ++ return _("PT_GETFPREGS (fpreg structure)"); ++ default: ++ break; ++ } ++ } ++ ++ snprintf (buff, sizeof (buff), "PT_FIRSTMACH+%d", ++ e_type - NT_NETBSDCORE_FIRSTMACH); ++ return buff; ++} ++ ++static const char * ++get_stapsdt_note_type (unsigned e_type) ++{ ++ static char buff[64]; ++ ++ switch (e_type) ++ { ++ case NT_STAPSDT: ++ return _("NT_STAPSDT (SystemTap probe descriptors)"); ++ ++ default: ++ break; ++ } ++ ++ snprintf (buff, sizeof (buff), _("Unknown note type: (0x%08x)"), e_type); ++ return buff; ++} ++ ++static bfd_boolean ++print_stapsdt_note (Elf_Internal_Note *pnote) ++{ ++ size_t len, maxlen; ++ unsigned long addr_size = is_32bit_elf ? 4 : 8; ++ char *data = pnote->descdata; ++ char *data_end = pnote->descdata + pnote->descsz; ++ bfd_vma pc, base_addr, semaphore; ++ char *provider, *probe, *arg_fmt; ++ ++ if (pnote->descsz < (addr_size * 3)) ++ goto stapdt_note_too_small; ++ ++ pc = byte_get ((unsigned char *) data, addr_size); ++ data += addr_size; ++ ++ base_addr = byte_get ((unsigned char *) data, addr_size); ++ data += addr_size; ++ ++ semaphore = byte_get ((unsigned char *) data, addr_size); ++ data += addr_size; ++ ++ if (data >= data_end) ++ goto stapdt_note_too_small; ++ maxlen = data_end - data; ++ len = strnlen (data, maxlen); ++ if (len < maxlen) ++ { ++ provider = data; ++ data += len + 1; ++ } ++ else ++ goto stapdt_note_too_small; ++ ++ if (data >= data_end) ++ goto stapdt_note_too_small; ++ maxlen = data_end - data; ++ len = strnlen (data, maxlen); ++ if (len < maxlen) ++ { ++ probe = data; ++ data += len + 1; ++ } ++ else ++ goto stapdt_note_too_small; ++ ++ if (data >= data_end) ++ goto stapdt_note_too_small; ++ maxlen = data_end - data; ++ len = strnlen (data, maxlen); ++ if (len < maxlen) ++ { ++ arg_fmt = data; ++ data += len + 1; ++ } ++ else ++ goto stapdt_note_too_small; ++ ++ printf (_(" Provider: %s\n"), provider); ++ printf (_(" Name: %s\n"), probe); ++ printf (_(" Location: ")); ++ print_vma (pc, FULL_HEX); ++ printf (_(", Base: ")); ++ print_vma (base_addr, FULL_HEX); ++ printf (_(", Semaphore: ")); ++ print_vma (semaphore, FULL_HEX); ++ printf ("\n"); ++ printf (_(" Arguments: %s\n"), arg_fmt); ++ ++ return data == data_end; ++ ++ stapdt_note_too_small: ++ printf (_(" \n")); ++ error (_("corrupt stapdt note - the data size is too small\n")); ++ return FALSE; ++} ++ ++static const char * ++get_ia64_vms_note_type (unsigned e_type) ++{ ++ static char buff[64]; ++ ++ switch (e_type) ++ { ++ case NT_VMS_MHD: ++ return _("NT_VMS_MHD (module header)"); ++ case NT_VMS_LNM: ++ return _("NT_VMS_LNM (language name)"); ++ case NT_VMS_SRC: ++ return _("NT_VMS_SRC (source files)"); ++ case NT_VMS_TITLE: ++ return "NT_VMS_TITLE"; ++ case NT_VMS_EIDC: ++ return _("NT_VMS_EIDC (consistency check)"); ++ case NT_VMS_FPMODE: ++ return _("NT_VMS_FPMODE (FP mode)"); ++ case NT_VMS_LINKTIME: ++ return "NT_VMS_LINKTIME"; ++ case NT_VMS_IMGNAM: ++ return _("NT_VMS_IMGNAM (image name)"); ++ case NT_VMS_IMGID: ++ return _("NT_VMS_IMGID (image id)"); ++ case NT_VMS_LINKID: ++ return _("NT_VMS_LINKID (link id)"); ++ case NT_VMS_IMGBID: ++ return _("NT_VMS_IMGBID (build id)"); ++ case NT_VMS_GSTNAM: ++ return _("NT_VMS_GSTNAM (sym table name)"); ++ case NT_VMS_ORIG_DYN: ++ return "NT_VMS_ORIG_DYN"; ++ case NT_VMS_PATCHTIME: ++ return "NT_VMS_PATCHTIME"; ++ default: ++ snprintf (buff, sizeof (buff), _("Unknown note type: (0x%08x)"), e_type); ++ return buff; ++ } ++} ++ ++static bfd_boolean ++print_ia64_vms_note (Elf_Internal_Note * pnote) ++{ ++ int maxlen = pnote->descsz; ++ ++ if (maxlen < 2 || (unsigned long) maxlen != pnote->descsz) ++ goto desc_size_fail; ++ ++ switch (pnote->type) ++ { ++ case NT_VMS_MHD: ++ if (maxlen <= 36) ++ goto desc_size_fail; ++ ++ int l = (int) strnlen (pnote->descdata + 34, maxlen - 34); ++ ++ printf (_(" Creation date : %.17s\n"), pnote->descdata); ++ printf (_(" Last patch date: %.17s\n"), pnote->descdata + 17); ++ if (l + 34 < maxlen) ++ { ++ printf (_(" Module name : %s\n"), pnote->descdata + 34); ++ if (l + 35 < maxlen) ++ printf (_(" Module version : %s\n"), pnote->descdata + 34 + l + 1); ++ else ++ printf (_(" Module version : \n")); ++ } ++ else ++ { ++ printf (_(" Module name : \n")); ++ printf (_(" Module version : \n")); ++ } ++ break; ++ ++ case NT_VMS_LNM: ++ printf (_(" Language: %.*s\n"), maxlen, pnote->descdata); ++ break; ++ ++#ifdef BFD64 ++ case NT_VMS_FPMODE: ++ printf (_(" Floating Point mode: ")); ++ if (maxlen < 8) ++ goto desc_size_fail; ++ /* FIXME: Generate an error if descsz > 8 ? */ ++ ++ printf ("0x%016" BFD_VMA_FMT "x\n", ++ (bfd_vma) byte_get ((unsigned char *)pnote->descdata, 8)); ++ break; ++ ++ case NT_VMS_LINKTIME: ++ printf (_(" Link time: ")); ++ if (maxlen < 8) ++ goto desc_size_fail; ++ /* FIXME: Generate an error if descsz > 8 ? */ ++ ++ print_vms_time ++ ((bfd_int64_t) byte_get ((unsigned char *)pnote->descdata, 8)); ++ printf ("\n"); ++ break; ++ ++ case NT_VMS_PATCHTIME: ++ printf (_(" Patch time: ")); ++ if (maxlen < 8) ++ goto desc_size_fail; ++ /* FIXME: Generate an error if descsz > 8 ? */ ++ ++ print_vms_time ++ ((bfd_int64_t) byte_get ((unsigned char *)pnote->descdata, 8)); ++ printf ("\n"); ++ break; ++ ++ case NT_VMS_ORIG_DYN: ++ if (maxlen < 34) ++ goto desc_size_fail; ++ ++ printf (_(" Major id: %u, minor id: %u\n"), ++ (unsigned) byte_get ((unsigned char *)pnote->descdata, 4), ++ (unsigned) byte_get ((unsigned char *)pnote->descdata + 4, 4)); ++ printf (_(" Last modified : ")); ++ print_vms_time ++ ((bfd_int64_t) byte_get ((unsigned char *)pnote->descdata + 8, 8)); ++ printf (_("\n Link flags : ")); ++ printf ("0x%016" BFD_VMA_FMT "x\n", ++ (bfd_vma) byte_get ((unsigned char *)pnote->descdata + 16, 8)); ++ printf (_(" Header flags: 0x%08x\n"), ++ (unsigned) byte_get ((unsigned char *)pnote->descdata + 24, 4)); ++ printf (_(" Image id : %.*s\n"), maxlen - 32, pnote->descdata + 32); ++ break; ++#endif ++ ++ case NT_VMS_IMGNAM: ++ printf (_(" Image name: %.*s\n"), maxlen, pnote->descdata); ++ break; ++ ++ case NT_VMS_GSTNAM: ++ printf (_(" Global symbol table name: %.*s\n"), maxlen, pnote->descdata); ++ break; ++ ++ case NT_VMS_IMGID: ++ printf (_(" Image id: %.*s\n"), maxlen, pnote->descdata); ++ break; ++ ++ case NT_VMS_LINKID: ++ printf (_(" Linker id: %.*s\n"), maxlen, pnote->descdata); ++ break; ++ ++ default: ++ return FALSE; ++ } ++ ++ return TRUE; ++ ++ desc_size_fail: ++ printf (_(" \n")); ++ error (_("corrupt IA64 note: data size is too small\n")); ++ return FALSE; ++} ++ ++struct build_attr_cache { ++ Filedata *filedata; ++ char *strtab; ++ unsigned long strtablen; ++ Elf_Internal_Sym *symtab; ++ unsigned long nsyms; ++} ba_cache; ++ ++/* Find the symbol associated with a build attribute that is attached ++ to address OFFSET. If PNAME is non-NULL then store the name of ++ the symbol (if found) in the provided pointer, Returns NULL if a ++ symbol could not be found. */ ++ ++static Elf_Internal_Sym * ++get_symbol_for_build_attribute (Filedata * filedata, ++ unsigned long offset, ++ bfd_boolean is_open_attr, ++ const char ** pname) ++{ ++ Elf_Internal_Sym *saved_sym = NULL; ++ Elf_Internal_Sym *sym; ++ ++ if (filedata->section_headers != NULL ++ && (ba_cache.filedata == NULL || filedata != ba_cache.filedata)) ++ { ++ Elf_Internal_Shdr * symsec; ++ ++ free (ba_cache.strtab); ++ ba_cache.strtab = NULL; ++ free (ba_cache.symtab); ++ ba_cache.symtab = NULL; ++ ++ /* Load the symbol and string sections. */ ++ for (symsec = filedata->section_headers; ++ symsec < filedata->section_headers + filedata->file_header.e_shnum; ++ symsec ++) ++ { ++ if (symsec->sh_type == SHT_SYMTAB ++ && get_symtab (filedata, symsec, ++ &ba_cache.symtab, &ba_cache.nsyms, ++ &ba_cache.strtab, &ba_cache.strtablen)) ++ break; ++ } ++ ba_cache.filedata = filedata; ++ } ++ ++ if (ba_cache.symtab == NULL) ++ return NULL; ++ ++ /* Find a symbol whose value matches offset. */ ++ for (sym = ba_cache.symtab; sym < ba_cache.symtab + ba_cache.nsyms; sym ++) ++ if (sym->st_value == offset) ++ { ++ if (sym->st_name >= ba_cache.strtablen) ++ /* Huh ? This should not happen. */ ++ continue; ++ ++ if (ba_cache.strtab[sym->st_name] == 0) ++ continue; ++ ++ /* The AArch64 and ARM architectures define mapping symbols ++ (eg $d, $x, $t) which we want to ignore. */ ++ if (ba_cache.strtab[sym->st_name] == '$' ++ && ba_cache.strtab[sym->st_name + 1] != 0 ++ && ba_cache.strtab[sym->st_name + 2] == 0) ++ continue; ++ ++ if (is_open_attr) ++ { ++ /* For OPEN attributes we prefer GLOBAL over LOCAL symbols ++ and FILE or OBJECT symbols over NOTYPE symbols. We skip ++ FUNC symbols entirely. */ ++ switch (ELF_ST_TYPE (sym->st_info)) ++ { ++ case STT_OBJECT: ++ case STT_FILE: ++ saved_sym = sym; ++ if (sym->st_size) ++ { ++ /* If the symbol has a size associated ++ with it then we can stop searching. */ ++ sym = ba_cache.symtab + ba_cache.nsyms; ++ } ++ continue; ++ ++ case STT_FUNC: ++ /* Ignore function symbols. */ ++ continue; ++ ++ default: ++ break; ++ } ++ ++ switch (ELF_ST_BIND (sym->st_info)) ++ { ++ case STB_GLOBAL: ++ if (saved_sym == NULL ++ || ELF_ST_TYPE (saved_sym->st_info) != STT_OBJECT) ++ saved_sym = sym; ++ break; ++ ++ case STB_LOCAL: ++ if (saved_sym == NULL) ++ saved_sym = sym; ++ break; ++ ++ default: ++ break; ++ } ++ } ++ else ++ { ++ if (ELF_ST_TYPE (sym->st_info) != STT_FUNC) ++ continue; ++ ++ saved_sym = sym; ++ break; ++ } ++ } ++ ++ if (saved_sym && pname) ++ * pname = ba_cache.strtab + saved_sym->st_name; ++ ++ return saved_sym; ++} ++ ++/* Returns true iff addr1 and addr2 are in the same section. */ ++ ++static bfd_boolean ++same_section (Filedata * filedata, unsigned long addr1, unsigned long addr2) ++{ ++ Elf_Internal_Shdr * a1; ++ Elf_Internal_Shdr * a2; ++ ++ a1 = find_section_by_address (filedata, addr1); ++ a2 = find_section_by_address (filedata, addr2); ++ ++ return a1 == a2 && a1 != NULL; ++} ++ ++static bfd_boolean ++print_gnu_build_attribute_description (Elf_Internal_Note * pnote, ++ Filedata * filedata) ++{ ++ static unsigned long global_offset = 0; ++ static unsigned long global_end = 0; ++ static unsigned long func_offset = 0; ++ static unsigned long func_end = 0; ++ ++ Elf_Internal_Sym * sym; ++ const char * name; ++ unsigned long start; ++ unsigned long end; ++ bfd_boolean is_open_attr = pnote->type == NT_GNU_BUILD_ATTRIBUTE_OPEN; ++ ++ switch (pnote->descsz) ++ { ++ case 0: ++ /* A zero-length description means that the range of ++ the previous note of the same type should be used. */ ++ if (is_open_attr) ++ { ++ if (global_end > global_offset) ++ printf (_(" Applies to region from %#lx to %#lx\n"), ++ global_offset, global_end); ++ else ++ printf (_(" Applies to region from %#lx\n"), global_offset); ++ } ++ else ++ { ++ if (func_end > func_offset) ++ printf (_(" Applies to region from %#lx to %#lx\n"), func_offset, func_end); ++ else ++ printf (_(" Applies to region from %#lx\n"), func_offset); ++ } ++ return TRUE; ++ ++ case 4: ++ start = byte_get ((unsigned char *) pnote->descdata, 4); ++ end = 0; ++ break; ++ ++ case 8: ++ if (is_32bit_elf) ++ { ++ /* FIXME: We should check that version 3+ notes are being used here... */ ++ start = byte_get ((unsigned char *) pnote->descdata, 4); ++ end = byte_get ((unsigned char *) pnote->descdata + 4, 4); ++ } ++ else ++ { ++ start = byte_get ((unsigned char *) pnote->descdata, 8); ++ end = 0; ++ } ++ break; ++ ++ case 16: ++ start = byte_get ((unsigned char *) pnote->descdata, 8); ++ end = byte_get ((unsigned char *) pnote->descdata + 8, 8); ++ break; ++ ++ default: ++ error (_(" \n"), pnote->descsz); ++ printf (_(" ")); ++ return FALSE; ++ } ++ ++ name = NULL; ++ sym = get_symbol_for_build_attribute (filedata, start, is_open_attr, & name); ++ /* As of version 5 of the annobin plugin, filename symbols are biased by 2 ++ in order to avoid them being confused with the start address of the ++ first function in the file... */ ++ if (sym == NULL && is_open_attr) ++ sym = get_symbol_for_build_attribute (filedata, start + 2, is_open_attr, ++ & name); ++ ++ if (end == 0 && sym != NULL && sym->st_size > 0) ++ end = start + sym->st_size; ++ ++ if (is_open_attr) ++ { ++#if 0 /* Suppressed because these gaps are no longer significant. */ ++ /* FIXME: Need to properly allow for section alignment. ++ 16 is just the alignment used on x86_64. */ ++ if (global_end > 0 ++ && start > BFD_ALIGN (global_end, 16) ++ /* Build notes are not guaranteed to be organised in order of ++ increasing address, but we should find the all of the notes ++ for one section in the same place. */ ++ && same_section (filedata, start, global_end)) ++ warn (_("Gap in build notes detected from %#lx to %#lx\n"), ++ global_end + 1, start - 1); ++#endif ++ printf (_(" Applies to region from %#lx"), start); ++ global_offset = start; ++ ++ if (end) ++ { ++ printf (_(" to %#lx"), end); ++ global_end = end; ++ } ++ } ++ else ++ { ++ printf (_(" Applies to region from %#lx"), start); ++ func_offset = start; ++ ++ if (end) ++ { ++ printf (_(" to %#lx"), end); ++ func_end = end; ++ } ++ } ++ ++ if (sym && name) ++ printf (_(" (%s)"), name); ++ ++ printf ("\n"); ++ return TRUE; ++} ++ ++static bfd_boolean ++print_gnu_build_attribute_name (Elf_Internal_Note * pnote) ++{ ++ static const char string_expected [2] = { GNU_BUILD_ATTRIBUTE_TYPE_STRING, 0 }; ++ static const char number_expected [2] = { GNU_BUILD_ATTRIBUTE_TYPE_NUMERIC, 0 }; ++ static const char bool_expected [3] = { GNU_BUILD_ATTRIBUTE_TYPE_BOOL_TRUE, GNU_BUILD_ATTRIBUTE_TYPE_BOOL_FALSE, 0 }; ++ char name_type; ++ char name_attribute; ++ const char * expected_types; ++ const char * name = pnote->namedata; ++ const char * text; ++ signed int left; ++ ++ if (name == NULL || pnote->namesz < 2) ++ { ++ error (_("corrupt name field in GNU build attribute note: size = %ld\n"), pnote->namesz); ++ print_symbol (-20, _(" ")); ++ return FALSE; ++ } ++ ++ if (do_wide) ++ left = 28; ++ else ++ left = 20; ++ ++ /* Version 2 of the spec adds a "GA" prefix to the name field. */ ++ if (name[0] == 'G' && name[1] == 'A') ++ { ++ if (pnote->namesz < 4) ++ { ++ error (_("corrupt name field in GNU build attribute note: size = %ld\n"), pnote->namesz); ++ print_symbol (-20, _(" ")); ++ return FALSE; ++ } ++ ++ printf ("GA"); ++ name += 2; ++ left -= 2; ++ } ++ ++ switch ((name_type = * name)) ++ { ++ case GNU_BUILD_ATTRIBUTE_TYPE_NUMERIC: ++ case GNU_BUILD_ATTRIBUTE_TYPE_STRING: ++ case GNU_BUILD_ATTRIBUTE_TYPE_BOOL_TRUE: ++ case GNU_BUILD_ATTRIBUTE_TYPE_BOOL_FALSE: ++ printf ("%c", * name); ++ left --; ++ break; ++ default: ++ error (_("unrecognised attribute type in name field: %d\n"), name_type); ++ print_symbol (-20, _("")); ++ return FALSE; ++ } ++ ++ ++ name; ++ text = NULL; ++ ++ switch ((name_attribute = * name)) ++ { ++ case GNU_BUILD_ATTRIBUTE_VERSION: ++ text = _(""); ++ expected_types = string_expected; ++ ++ name; ++ break; ++ case GNU_BUILD_ATTRIBUTE_STACK_PROT: ++ text = _(""); ++ expected_types = "!+*"; ++ ++ name; ++ break; ++ case GNU_BUILD_ATTRIBUTE_RELRO: ++ text = _(""); ++ expected_types = bool_expected; ++ ++ name; ++ break; ++ case GNU_BUILD_ATTRIBUTE_STACK_SIZE: ++ text = _(""); ++ expected_types = number_expected; ++ ++ name; ++ break; ++ case GNU_BUILD_ATTRIBUTE_TOOL: ++ text = _(""); ++ expected_types = string_expected; ++ ++ name; ++ break; ++ case GNU_BUILD_ATTRIBUTE_ABI: ++ text = _(""); ++ expected_types = "$*"; ++ ++ name; ++ break; ++ case GNU_BUILD_ATTRIBUTE_PIC: ++ text = _(""); ++ expected_types = number_expected; ++ ++ name; ++ break; ++ case GNU_BUILD_ATTRIBUTE_SHORT_ENUM: ++ text = _(""); ++ expected_types = bool_expected; ++ ++ name; ++ break; ++ default: ++ if (ISPRINT (* name)) ++ { ++ int len = strnlen (name, pnote->namesz - (name - pnote->namedata)) + 1; ++ ++ if (len > left && ! do_wide) ++ len = left; ++ printf ("%.*s:", len, name); ++ left -= len; ++ name += len; ++ } ++ else ++ { ++ static char tmpbuf [128]; ++ ++ error (_("unrecognised byte in name field: %d\n"), * name); ++ sprintf (tmpbuf, _(""), * name); ++ text = tmpbuf; ++ name ++; ++ } ++ expected_types = "*$!+"; ++ break; ++ } ++ ++ if (text) ++ left -= printf ("%s", text); ++ ++ if (strchr (expected_types, name_type) == NULL) ++ warn (_("attribute does not have an expected type (%c)\n"), name_type); ++ ++ if ((unsigned long)(name - pnote->namedata) > pnote->namesz) ++ { ++ error (_("corrupt name field: namesz: %lu but parsing gets to %ld\n"), ++ (unsigned long) pnote->namesz, ++ (long) (name - pnote->namedata)); ++ return FALSE; ++ } ++ ++ if (left < 1 && ! do_wide) ++ return TRUE; ++ ++ switch (name_type) ++ { ++ case GNU_BUILD_ATTRIBUTE_TYPE_NUMERIC: ++ { ++ unsigned int bytes; ++ unsigned long long val = 0; ++ unsigned int shift = 0; ++ char * decoded = NULL; ++ ++ bytes = pnote->namesz - (name - pnote->namedata); ++ if (bytes > 0) ++ /* The -1 is because the name field is always 0 terminated, and we ++ want to be able to ensure that the shift in the while loop below ++ will not overflow. */ ++ -- bytes; ++ ++ if (bytes > sizeof (val)) ++ { ++ error (_("corrupt numeric name field: too many bytes in the value: %x\n"), ++ bytes); ++ bytes = sizeof (val); ++ } ++ /* We do not bother to warn if bytes == 0 as this can ++ happen with some early versions of the gcc plugin. */ ++ ++ while (bytes --) ++ { ++ unsigned long byte = (* name ++) & 0xff; ++ ++ val |= byte << shift; ++ shift += 8; ++ } ++ ++ switch (name_attribute) ++ { ++ case GNU_BUILD_ATTRIBUTE_PIC: ++ switch (val) ++ { ++ case 0: decoded = "static"; break; ++ case 1: decoded = "pic"; break; ++ case 2: decoded = "PIC"; break; ++ case 3: decoded = "pie"; break; ++ case 4: decoded = "PIE"; break; ++ default: break; ++ } ++ break; ++ case GNU_BUILD_ATTRIBUTE_STACK_PROT: ++ switch (val) ++ { ++ /* Based upon the SPCT_FLAG_xxx enum values in gcc/cfgexpand.c. */ ++ case 0: decoded = "off"; break; ++ case 1: decoded = "on"; break; ++ case 2: decoded = "all"; break; ++ case 3: decoded = "strong"; break; ++ case 4: decoded = "explicit"; break; ++ default: break; ++ } ++ break; ++ default: ++ break; ++ } ++ ++ if (decoded != NULL) ++ { ++ print_symbol (-left, decoded); ++ left = 0; ++ } ++ else if (val == 0) ++ { ++ printf ("0x0"); ++ left -= 3; ++ } ++ else ++ { ++ if (do_wide) ++ left -= printf ("0x%llx", val); ++ else ++ left -= printf ("0x%-.*llx", left, val); ++ } ++ } ++ break; ++ case GNU_BUILD_ATTRIBUTE_TYPE_STRING: ++ left -= print_symbol (- left, name); ++ break; ++ case GNU_BUILD_ATTRIBUTE_TYPE_BOOL_TRUE: ++ left -= print_symbol (- left, "true"); ++ break; ++ case GNU_BUILD_ATTRIBUTE_TYPE_BOOL_FALSE: ++ left -= print_symbol (- left, "false"); ++ break; ++ } ++ ++ if (do_wide && left > 0) ++ printf ("%-*s", left, " "); ++ ++ return TRUE; ++} ++ ++/* Note that by the ELF standard, the name field is already null byte ++ terminated, and namesz includes the terminating null byte. ++ I.E. the value of namesz for the name "FSF" is 4. ++ ++ If the value of namesz is zero, there is no name present. */ ++ ++static bfd_boolean ++process_note (Elf_Internal_Note * pnote, ++ Filedata * filedata) ++{ ++ const char * name = pnote->namesz ? pnote->namedata : "(NONE)"; ++ const char * nt; ++ ++ if (pnote->namesz == 0) ++ /* If there is no note name, then use the default set of ++ note type strings. */ ++ nt = get_note_type (filedata, pnote->type); ++ ++ else if (const_strneq (pnote->namedata, "GNU")) ++ /* GNU-specific object file notes. */ ++ nt = get_gnu_elf_note_type (pnote->type); ++ ++ else if (const_strneq (pnote->namedata, "FreeBSD")) ++ /* FreeBSD-specific core file notes. */ ++ nt = get_freebsd_elfcore_note_type (filedata, pnote->type); ++ ++ else if (const_strneq (pnote->namedata, "NetBSD-CORE")) ++ /* NetBSD-specific core file notes. */ ++ nt = get_netbsd_elfcore_note_type (filedata, pnote->type); ++ ++ else if (const_strneq (pnote->namedata, "NetBSD")) ++ /* NetBSD-specific core file notes. */ ++ return process_netbsd_elf_note (pnote); ++ ++ else if (const_strneq (pnote->namedata, "PaX")) ++ /* NetBSD-specific core file notes. */ ++ return process_netbsd_elf_note (pnote); ++ ++ else if (strneq (pnote->namedata, "SPU/", 4)) ++ { ++ /* SPU-specific core file notes. */ ++ nt = pnote->namedata + 4; ++ name = "SPU"; ++ } ++ ++ else if (const_strneq (pnote->namedata, "IPF/VMS")) ++ /* VMS/ia64-specific file notes. */ ++ nt = get_ia64_vms_note_type (pnote->type); ++ ++ else if (const_strneq (pnote->namedata, "stapsdt")) ++ nt = get_stapsdt_note_type (pnote->type); ++ ++ else ++ /* Don't recognize this note name; just use the default set of ++ note type strings. */ ++ nt = get_note_type (filedata, pnote->type); ++ ++ printf (" "); ++ ++ if (((const_strneq (pnote->namedata, "GA") ++ && strchr ("*$!+", pnote->namedata[2]) != NULL) ++ || strchr ("*$!+", pnote->namedata[0]) != NULL) ++ && (pnote->type == NT_GNU_BUILD_ATTRIBUTE_OPEN ++ || pnote->type == NT_GNU_BUILD_ATTRIBUTE_FUNC)) ++ print_gnu_build_attribute_name (pnote); ++ else ++ print_symbol (-20, name); ++ ++ if (do_wide) ++ printf (" 0x%08lx\t%s\t", pnote->descsz, nt); ++ else ++ printf (" 0x%08lx\t%s\n", pnote->descsz, nt); ++ ++ if (const_strneq (pnote->namedata, "IPF/VMS")) ++ return print_ia64_vms_note (pnote); ++ else if (const_strneq (pnote->namedata, "GNU")) ++ return print_gnu_note (filedata, pnote); ++ else if (const_strneq (pnote->namedata, "stapsdt")) ++ return print_stapsdt_note (pnote); ++ else if (const_strneq (pnote->namedata, "CORE")) ++ return print_core_note (pnote); ++ else if (((const_strneq (pnote->namedata, "GA") ++ && strchr ("*$!+", pnote->namedata[2]) != NULL) ++ || strchr ("*$!+", pnote->namedata[0]) != NULL) ++ && (pnote->type == NT_GNU_BUILD_ATTRIBUTE_OPEN ++ || pnote->type == NT_GNU_BUILD_ATTRIBUTE_FUNC)) ++ return print_gnu_build_attribute_description (pnote, filedata); ++ ++ if (pnote->descsz) ++ { ++ unsigned long i; ++ ++ printf (_(" description data: ")); ++ for (i = 0; i < pnote->descsz; i++) ++ printf ("%02x ", pnote->descdata[i] & 0xff); ++ if (!do_wide) ++ printf ("\n"); ++ } ++ ++ if (do_wide) ++ printf ("\n"); ++ ++ return TRUE; ++} ++ ++static bfd_boolean ++process_notes_at (Filedata * filedata, ++ Elf_Internal_Shdr * section, ++ bfd_vma offset, ++ bfd_vma length, ++ bfd_vma align) ++{ ++ Elf_External_Note * pnotes; ++ Elf_External_Note * external; ++ char * end; ++ bfd_boolean res = TRUE; ++ ++ if (length <= 0) ++ return FALSE; ++ ++ if (section) ++ { ++ pnotes = (Elf_External_Note *) get_section_contents (section, filedata); ++ if (pnotes) ++ { ++ if (! apply_relocations (filedata, section, (unsigned char *) pnotes, length, NULL, NULL)) ++ { ++ free (pnotes); ++ return FALSE; ++ } ++ } ++ } ++ else ++ pnotes = (Elf_External_Note *) get_data (NULL, filedata, offset, 1, length, ++ _("notes")); ++ ++ if (pnotes == NULL) ++ return FALSE; ++ ++ external = pnotes; ++ ++ if (section) ++ printf (_("\nDisplaying notes found in: %s\n"), printable_section_name (filedata, section)); ++ else ++ printf (_("\nDisplaying notes found at file offset 0x%08lx with length 0x%08lx:\n"), ++ (unsigned long) offset, (unsigned long) length); ++ ++ /* NB: Some note sections may have alignment value of 0 or 1. gABI ++ specifies that notes should be aligned to 4 bytes in 32-bit ++ objects and to 8 bytes in 64-bit objects. As a Linux extension, ++ we also support 4 byte alignment in 64-bit objects. If section ++ alignment is less than 4, we treate alignment as 4 bytes. */ ++ if (align < 4) ++ align = 4; ++ else if (align != 4 && align != 8) ++ { ++ warn (_("Corrupt note: alignment %ld, expecting 4 or 8\n"), ++ (long) align); ++ free (pnotes); ++ return FALSE; ++ } ++ ++ printf (_(" %-20s %-10s\tDescription\n"), _("Owner"), _("Data size")); ++ ++ end = (char *) pnotes + length; ++ while ((char *) external < end) ++ { ++ Elf_Internal_Note inote; ++ size_t min_notesz; ++ char * next; ++ char * temp = NULL; ++ size_t data_remaining = end - (char *) external; ++ ++ if (!is_ia64_vms (filedata)) ++ { ++ /* PR binutils/15191 ++ Make sure that there is enough data to read. */ ++ min_notesz = offsetof (Elf_External_Note, name); ++ if (data_remaining < min_notesz) ++ { ++ warn (ngettext ("Corrupt note: only %ld byte remains, " ++ "not enough for a full note\n", ++ "Corrupt note: only %ld bytes remain, " ++ "not enough for a full note\n", ++ data_remaining), ++ (long) data_remaining); ++ break; ++ } ++ data_remaining -= min_notesz; ++ ++ inote.type = BYTE_GET (external->type); ++ inote.namesz = BYTE_GET (external->namesz); ++ inote.namedata = external->name; ++ inote.descsz = BYTE_GET (external->descsz); ++ inote.descdata = ((char *) external ++ + ELF_NOTE_DESC_OFFSET (inote.namesz, align)); ++ inote.descpos = offset + (inote.descdata - (char *) pnotes); ++ next = ((char *) external ++ + ELF_NOTE_NEXT_OFFSET (inote.namesz, inote.descsz, align)); ++ } ++ else ++ { ++ Elf64_External_VMS_Note *vms_external; ++ ++ /* PR binutils/15191 ++ Make sure that there is enough data to read. */ ++ min_notesz = offsetof (Elf64_External_VMS_Note, name); ++ if (data_remaining < min_notesz) ++ { ++ warn (ngettext ("Corrupt note: only %ld byte remains, " ++ "not enough for a full note\n", ++ "Corrupt note: only %ld bytes remain, " ++ "not enough for a full note\n", ++ data_remaining), ++ (long) data_remaining); ++ break; ++ } ++ data_remaining -= min_notesz; ++ ++ vms_external = (Elf64_External_VMS_Note *) external; ++ inote.type = BYTE_GET (vms_external->type); ++ inote.namesz = BYTE_GET (vms_external->namesz); ++ inote.namedata = vms_external->name; ++ inote.descsz = BYTE_GET (vms_external->descsz); ++ inote.descdata = inote.namedata + align_power (inote.namesz, 3); ++ inote.descpos = offset + (inote.descdata - (char *) pnotes); ++ next = inote.descdata + align_power (inote.descsz, 3); ++ } ++ ++ /* PR 17531: file: 3443835e. */ ++ /* PR 17531: file: id:000000,sig:11,src:006986,op:havoc,rep:4. */ ++ if ((size_t) (inote.descdata - inote.namedata) < inote.namesz ++ || (size_t) (inote.descdata - inote.namedata) > data_remaining ++ || (size_t) (next - inote.descdata) < inote.descsz ++ || ((size_t) (next - inote.descdata) ++ > data_remaining - (size_t) (inote.descdata - inote.namedata))) ++ { ++ warn (_("note with invalid namesz and/or descsz found at offset 0x%lx\n"), ++ (unsigned long) ((char *) external - (char *) pnotes)); ++ warn (_(" type: 0x%lx, namesize: 0x%08lx, descsize: 0x%08lx, alignment: %u\n"), ++ inote.type, inote.namesz, inote.descsz, (int) align); ++ break; ++ } ++ ++ external = (Elf_External_Note *) next; ++ ++ /* Verify that name is null terminated. It appears that at least ++ one version of Linux (RedHat 6.0) generates corefiles that don't ++ comply with the ELF spec by failing to include the null byte in ++ namesz. */ ++ if (inote.namesz > 0 && inote.namedata[inote.namesz - 1] != '\0') ++ { ++ if ((size_t) (inote.descdata - inote.namedata) == inote.namesz) ++ { ++ temp = (char *) malloc (inote.namesz + 1); ++ if (temp == NULL) ++ { ++ error (_("Out of memory allocating space for inote name\n")); ++ res = FALSE; ++ break; ++ } ++ ++ memcpy (temp, inote.namedata, inote.namesz); ++ inote.namedata = temp; ++ } ++ inote.namedata[inote.namesz] = 0; ++ } ++ ++ if (! process_note (& inote, filedata)) ++ res = FALSE; ++ ++ free (temp); ++ temp = NULL; ++ } ++ ++ free (pnotes); ++ ++ return res; ++} ++ ++static bfd_boolean ++process_corefile_note_segments (Filedata * filedata) ++{ ++ Elf_Internal_Phdr * segment; ++ unsigned int i; ++ bfd_boolean res = TRUE; ++ ++ if (! get_program_headers (filedata)) ++ return TRUE; ++ ++ for (i = 0, segment = filedata->program_headers; ++ i < filedata->file_header.e_phnum; ++ i++, segment++) ++ { ++ if (segment->p_type == PT_NOTE) ++ if (! process_notes_at (filedata, NULL, ++ (bfd_vma) segment->p_offset, ++ (bfd_vma) segment->p_filesz, ++ (bfd_vma) segment->p_align)) ++ res = FALSE; ++ } ++ ++ return res; ++} ++ ++static bfd_boolean ++process_v850_notes (Filedata * filedata, bfd_vma offset, bfd_vma length) ++{ ++ Elf_External_Note * pnotes; ++ Elf_External_Note * external; ++ char * end; ++ bfd_boolean res = TRUE; ++ ++ if (length <= 0) ++ return FALSE; ++ ++ pnotes = (Elf_External_Note *) get_data (NULL, filedata, offset, 1, length, ++ _("v850 notes")); ++ if (pnotes == NULL) ++ return FALSE; ++ ++ external = pnotes; ++ end = (char*) pnotes + length; ++ ++ printf (_("\nDisplaying contents of Renesas V850 notes section at offset 0x%lx with length 0x%lx:\n"), ++ (unsigned long) offset, (unsigned long) length); ++ ++ while ((char *) external + sizeof (Elf_External_Note) < end) ++ { ++ Elf_External_Note * next; ++ Elf_Internal_Note inote; ++ ++ inote.type = BYTE_GET (external->type); ++ inote.namesz = BYTE_GET (external->namesz); ++ inote.namedata = external->name; ++ inote.descsz = BYTE_GET (external->descsz); ++ inote.descdata = inote.namedata + align_power (inote.namesz, 2); ++ inote.descpos = offset + (inote.descdata - (char *) pnotes); ++ ++ if (inote.descdata < (char *) pnotes || inote.descdata >= end) ++ { ++ warn (_("Corrupt note: name size is too big: %lx\n"), inote.namesz); ++ inote.descdata = inote.namedata; ++ inote.namesz = 0; ++ } ++ ++ next = (Elf_External_Note *) (inote.descdata + align_power (inote.descsz, 2)); ++ ++ if ( ((char *) next > end) ++ || ((char *) next < (char *) pnotes)) ++ { ++ warn (_("corrupt descsz found in note at offset 0x%lx\n"), ++ (unsigned long) ((char *) external - (char *) pnotes)); ++ warn (_(" type: 0x%lx, namesize: 0x%lx, descsize: 0x%lx\n"), ++ inote.type, inote.namesz, inote.descsz); ++ break; ++ } ++ ++ external = next; ++ ++ /* Prevent out-of-bounds indexing. */ ++ if ( inote.namedata + inote.namesz > end ++ || inote.namedata + inote.namesz < inote.namedata) ++ { ++ warn (_("corrupt namesz found in note at offset 0x%lx\n"), ++ (unsigned long) ((char *) external - (char *) pnotes)); ++ warn (_(" type: 0x%lx, namesize: 0x%lx, descsize: 0x%lx\n"), ++ inote.type, inote.namesz, inote.descsz); ++ break; ++ } ++ ++ printf (" %s: ", get_v850_elf_note_type (inote.type)); ++ ++ if (! print_v850_note (& inote)) ++ { ++ res = FALSE; ++ printf ("\n", ++ inote.namesz, inote.descsz); ++ } ++ } ++ ++ free (pnotes); ++ ++ return res; ++} ++ ++static bfd_boolean ++process_note_sections (Filedata * filedata) ++{ ++ Elf_Internal_Shdr * section; ++ unsigned long i; ++ unsigned int n = 0; ++ bfd_boolean res = TRUE; ++ ++ for (i = 0, section = filedata->section_headers; ++ i < filedata->file_header.e_shnum && section != NULL; ++ i++, section++) ++ { ++ if (section->sh_type == SHT_NOTE) ++ { ++ if (! process_notes_at (filedata, section, ++ (bfd_vma) section->sh_offset, ++ (bfd_vma) section->sh_size, ++ (bfd_vma) section->sh_addralign)) ++ res = FALSE; ++ n++; ++ } ++ ++ if (( filedata->file_header.e_machine == EM_V800 ++ || filedata->file_header.e_machine == EM_V850 ++ || filedata->file_header.e_machine == EM_CYGNUS_V850) ++ && section->sh_type == SHT_RENESAS_INFO) ++ { ++ if (! process_v850_notes (filedata, ++ (bfd_vma) section->sh_offset, ++ (bfd_vma) section->sh_size)) ++ res = FALSE; ++ n++; ++ } ++ } ++ ++ if (n == 0) ++ /* Try processing NOTE segments instead. */ ++ return process_corefile_note_segments (filedata); ++ ++ return res; ++} ++ ++static bfd_boolean ++process_notes (Filedata * filedata) ++{ ++ /* If we have not been asked to display the notes then do nothing. */ ++ if (! do_notes) ++ return TRUE; ++ ++ if (filedata->file_header.e_type != ET_CORE) ++ return process_note_sections (filedata); ++ ++ /* No program headers means no NOTE segment. */ ++ if (filedata->file_header.e_phnum > 0) ++ return process_corefile_note_segments (filedata); ++ ++ printf (_("No note segments present in the core file.\n")); ++ return TRUE; ++} ++ ++static unsigned char * ++display_public_gnu_attributes (unsigned char * start, ++ const unsigned char * const end) ++{ ++ printf (_(" Unknown GNU attribute: %s\n"), start); ++ ++ start += strnlen ((char *) start, end - start); ++ display_raw_attribute (start, end); ++ ++ return (unsigned char *) end; ++} ++ ++static unsigned char * ++display_generic_attribute (unsigned char * start, ++ unsigned int tag, ++ const unsigned char * const end) ++{ ++ if (tag == 0) ++ return (unsigned char *) end; ++ ++ return display_tag_value (tag, start, end); ++} ++ ++static bfd_boolean ++process_arch_specific (Filedata * filedata) ++{ ++ if (! do_arch) ++ return TRUE; ++ ++ switch (filedata->file_header.e_machine) ++ { ++ case EM_ARC: ++ case EM_ARC_COMPACT: ++ case EM_ARC_COMPACT2: ++ return process_attributes (filedata, "ARC", SHT_ARC_ATTRIBUTES, ++ display_arc_attribute, ++ display_generic_attribute); ++ case EM_ARM: ++ return process_attributes (filedata, "aeabi", SHT_ARM_ATTRIBUTES, ++ display_arm_attribute, ++ display_generic_attribute); ++ ++ case EM_MIPS: ++ case EM_MIPS_RS3_LE: ++ return process_mips_specific (filedata); ++ ++ case EM_MSP430: ++ return process_attributes (filedata, "mspabi", SHT_MSP430_ATTRIBUTES, ++ display_msp430x_attribute, ++ display_msp430_gnu_attribute); ++ ++ case EM_RISCV: ++ return process_attributes (filedata, "riscv", SHT_RISCV_ATTRIBUTES, ++ display_riscv_attribute, ++ display_generic_attribute); ++ ++ case EM_NDS32: ++ return process_nds32_specific (filedata); ++ ++ case EM_68K: ++ return process_attributes (filedata, NULL, SHT_GNU_ATTRIBUTES, NULL, ++ display_m68k_gnu_attribute); ++ ++ case EM_PPC: ++ case EM_PPC64: ++ return process_attributes (filedata, NULL, SHT_GNU_ATTRIBUTES, NULL, ++ display_power_gnu_attribute); ++ ++ case EM_S390: ++ case EM_S390_OLD: ++ return process_attributes (filedata, NULL, SHT_GNU_ATTRIBUTES, NULL, ++ display_s390_gnu_attribute); ++ ++ case EM_SPARC: ++ case EM_SPARC32PLUS: ++ case EM_SPARCV9: ++ return process_attributes (filedata, NULL, SHT_GNU_ATTRIBUTES, NULL, ++ display_sparc_gnu_attribute); ++ ++ case EM_TI_C6000: ++ return process_attributes (filedata, "c6xabi", SHT_C6000_ATTRIBUTES, ++ display_tic6x_attribute, ++ display_generic_attribute); ++ ++ default: ++ return process_attributes (filedata, "gnu", SHT_GNU_ATTRIBUTES, ++ display_public_gnu_attributes, ++ display_generic_attribute); ++ } ++} ++ ++static bfd_boolean ++get_file_header (Filedata * filedata) ++{ ++ /* Read in the identity array. */ ++ if (fread (filedata->file_header.e_ident, EI_NIDENT, 1, filedata->handle) != 1) ++ return FALSE; ++ ++ /* Determine how to read the rest of the header. */ ++ switch (filedata->file_header.e_ident[EI_DATA]) ++ { ++ default: ++ case ELFDATANONE: ++ case ELFDATA2LSB: ++ byte_get = byte_get_little_endian; ++ byte_put = byte_put_little_endian; ++ break; ++ case ELFDATA2MSB: ++ byte_get = byte_get_big_endian; ++ byte_put = byte_put_big_endian; ++ break; ++ } ++ ++ /* For now we only support 32 bit and 64 bit ELF files. */ ++ is_32bit_elf = (filedata->file_header.e_ident[EI_CLASS] != ELFCLASS64); ++ ++ /* Read in the rest of the header. */ ++ if (is_32bit_elf) ++ { ++ Elf32_External_Ehdr ehdr32; ++ ++ if (fread (ehdr32.e_type, sizeof (ehdr32) - EI_NIDENT, 1, filedata->handle) != 1) ++ return FALSE; ++ ++ filedata->file_header.e_type = BYTE_GET (ehdr32.e_type); ++ filedata->file_header.e_machine = BYTE_GET (ehdr32.e_machine); ++ filedata->file_header.e_version = BYTE_GET (ehdr32.e_version); ++ filedata->file_header.e_entry = BYTE_GET (ehdr32.e_entry); ++ filedata->file_header.e_phoff = BYTE_GET (ehdr32.e_phoff); ++ filedata->file_header.e_shoff = BYTE_GET (ehdr32.e_shoff); ++ filedata->file_header.e_flags = BYTE_GET (ehdr32.e_flags); ++ filedata->file_header.e_ehsize = BYTE_GET (ehdr32.e_ehsize); ++ filedata->file_header.e_phentsize = BYTE_GET (ehdr32.e_phentsize); ++ filedata->file_header.e_phnum = BYTE_GET (ehdr32.e_phnum); ++ filedata->file_header.e_shentsize = BYTE_GET (ehdr32.e_shentsize); ++ filedata->file_header.e_shnum = BYTE_GET (ehdr32.e_shnum); ++ filedata->file_header.e_shstrndx = BYTE_GET (ehdr32.e_shstrndx); ++ } ++ else ++ { ++ Elf64_External_Ehdr ehdr64; ++ ++ /* If we have been compiled with sizeof (bfd_vma) == 4, then ++ we will not be able to cope with the 64bit data found in ++ 64 ELF files. Detect this now and abort before we start ++ overwriting things. */ ++ if (sizeof (bfd_vma) < 8) ++ { ++ error (_("This instance of readelf has been built without support for a\n\ ++64 bit data type and so it cannot read 64 bit ELF files.\n")); ++ return FALSE; ++ } ++ ++ if (fread (ehdr64.e_type, sizeof (ehdr64) - EI_NIDENT, 1, filedata->handle) != 1) ++ return FALSE; ++ ++ filedata->file_header.e_type = BYTE_GET (ehdr64.e_type); ++ filedata->file_header.e_machine = BYTE_GET (ehdr64.e_machine); ++ filedata->file_header.e_version = BYTE_GET (ehdr64.e_version); ++ filedata->file_header.e_entry = BYTE_GET (ehdr64.e_entry); ++ filedata->file_header.e_phoff = BYTE_GET (ehdr64.e_phoff); ++ filedata->file_header.e_shoff = BYTE_GET (ehdr64.e_shoff); ++ filedata->file_header.e_flags = BYTE_GET (ehdr64.e_flags); ++ filedata->file_header.e_ehsize = BYTE_GET (ehdr64.e_ehsize); ++ filedata->file_header.e_phentsize = BYTE_GET (ehdr64.e_phentsize); ++ filedata->file_header.e_phnum = BYTE_GET (ehdr64.e_phnum); ++ filedata->file_header.e_shentsize = BYTE_GET (ehdr64.e_shentsize); ++ filedata->file_header.e_shnum = BYTE_GET (ehdr64.e_shnum); ++ filedata->file_header.e_shstrndx = BYTE_GET (ehdr64.e_shstrndx); ++ } ++ ++ if (filedata->file_header.e_shoff) ++ { ++ /* There may be some extensions in the first section header. Don't ++ bomb if we can't read it. */ ++ if (is_32bit_elf) ++ get_32bit_section_headers (filedata, TRUE); ++ else ++ get_64bit_section_headers (filedata, TRUE); ++ } ++ ++ return TRUE; ++} ++ ++static void ++close_file (Filedata * filedata) ++{ ++ if (filedata) ++ { ++ if (filedata->handle) ++ fclose (filedata->handle); ++ free (filedata); ++ } ++} ++ ++void ++close_debug_file (void * data) ++{ ++ close_file ((Filedata *) data); ++} ++ ++static Filedata * ++open_file (const char * pathname) ++{ ++ struct stat statbuf; ++ Filedata * filedata = NULL; ++ ++ if (stat (pathname, & statbuf) < 0 ++ || ! S_ISREG (statbuf.st_mode)) ++ goto fail; ++ ++ filedata = calloc (1, sizeof * filedata); ++ if (filedata == NULL) ++ goto fail; ++ ++ filedata->handle = fopen (pathname, "rb"); ++ if (filedata->handle == NULL) ++ goto fail; ++ ++ filedata->file_size = (bfd_size_type) statbuf.st_size; ++ filedata->file_name = pathname; ++ ++ if (! get_file_header (filedata)) ++ goto fail; ++ ++ if (filedata->file_header.e_shoff) ++ { ++ bfd_boolean res; ++ ++ /* Read the section headers again, this time for real. */ ++ if (is_32bit_elf) ++ res = get_32bit_section_headers (filedata, FALSE); ++ else ++ res = get_64bit_section_headers (filedata, FALSE); ++ ++ if (!res) ++ goto fail; ++ } ++ ++ return filedata; ++ ++ fail: ++ if (filedata) ++ { ++ if (filedata->handle) ++ fclose (filedata->handle); ++ free (filedata); ++ } ++ return NULL; ++} ++ ++void * ++open_debug_file (const char * pathname) ++{ ++ return open_file (pathname); ++} ++ ++/* Process one ELF object file according to the command line options. ++ This file may actually be stored in an archive. The file is ++ positioned at the start of the ELF object. Returns TRUE if no ++ problems were encountered, FALSE otherwise. */ ++ ++static bfd_boolean ++process_object (Filedata * filedata) ++{ ++ bfd_boolean have_separate_files; ++ unsigned int i; ++ bfd_boolean res; ++ ++ if (! get_file_header (filedata)) ++ { ++ error (_("%s: Failed to read file header\n"), filedata->file_name); ++ return FALSE; ++ } ++ ++ /* Initialise per file variables. */ ++ for (i = ARRAY_SIZE (filedata->version_info); i--;) ++ filedata->version_info[i] = 0; ++ ++ for (i = ARRAY_SIZE (filedata->dynamic_info); i--;) ++ filedata->dynamic_info[i] = 0; ++ filedata->dynamic_info_DT_GNU_HASH = 0; ++ filedata->dynamic_info_DT_MIPS_XHASH = 0; ++ ++ /* Process the file. */ ++ if (show_name) ++ printf (_("\nFile: %s\n"), filedata->file_name); ++ ++ /* Initialise the dump_sects array from the cmdline_dump_sects array. ++ Note we do this even if cmdline_dump_sects is empty because we ++ must make sure that the dump_sets array is zeroed out before each ++ object file is processed. */ ++ if (filedata->dump.num_dump_sects > cmdline.num_dump_sects) ++ memset (filedata->dump.dump_sects, 0, ++ filedata->dump.num_dump_sects * sizeof (*filedata->dump.dump_sects)); ++ ++ if (cmdline.num_dump_sects > 0) ++ { ++ if (filedata->dump.num_dump_sects == 0) ++ /* A sneaky way of allocating the dump_sects array. */ ++ request_dump_bynumber (&filedata->dump, cmdline.num_dump_sects, 0); ++ ++ assert (filedata->dump.num_dump_sects >= cmdline.num_dump_sects); ++ memcpy (filedata->dump.dump_sects, cmdline.dump_sects, ++ cmdline.num_dump_sects * sizeof (*filedata->dump.dump_sects)); ++ } ++ ++ if (! process_file_header (filedata)) ++ return FALSE; ++ ++ if (! process_section_headers (filedata)) ++ { ++ /* Without loaded section headers we cannot process lots of things. */ ++ do_unwind = do_version = do_dump = do_arch = FALSE; ++ ++ if (! do_using_dynamic) ++ do_syms = do_dyn_syms = do_reloc = FALSE; ++ } ++ ++ if (! process_section_groups (filedata)) ++ /* Without loaded section groups we cannot process unwind. */ ++ do_unwind = FALSE; ++ ++ res = process_program_headers (filedata); ++ if (res) ++ res = process_dynamic_section (filedata); ++ ++ if (! process_relocs (filedata)) ++ res = FALSE; ++ ++ if (! process_unwind (filedata)) ++ res = FALSE; ++ ++ if (! process_symbol_table (filedata)) ++ res = FALSE; ++ ++ if (! process_syminfo (filedata)) ++ res = FALSE; ++ ++ if (! process_version_sections (filedata)) ++ res = FALSE; ++ ++ if (filedata->file_header.e_shstrndx != SHN_UNDEF) ++ have_separate_files = load_separate_debug_files (filedata, filedata->file_name); ++ else ++ have_separate_files = FALSE; ++ ++ if (! process_section_contents (filedata)) ++ res = FALSE; ++ ++ if (have_separate_files) ++ { ++ separate_info * d; ++ ++ for (d = first_separate_info; d != NULL; d = d->next) ++ { ++ if (! process_section_headers (d->handle)) ++ res = FALSE; ++ else if (! process_section_contents (d->handle)) ++ res = FALSE; ++ } ++ ++ /* The file handles are closed by the call to free_debug_memory() below. */ ++ } ++ ++ if (! process_notes (filedata)) ++ res = FALSE; ++ ++ if (! process_gnu_liblist (filedata)) ++ res = FALSE; ++ ++ if (! process_arch_specific (filedata)) ++ res = FALSE; ++ ++ free (filedata->program_headers); ++ filedata->program_headers = NULL; ++ ++ free (filedata->section_headers); ++ filedata->section_headers = NULL; ++ ++ free (filedata->string_table); ++ filedata->string_table = NULL; ++ filedata->string_table_length = 0; ++ ++ free (filedata->dump.dump_sects); ++ filedata->dump.dump_sects = NULL; ++ filedata->dump.num_dump_sects = 0; ++ ++ free (filedata->dynamic_strings); ++ filedata->dynamic_strings = NULL; ++ filedata->dynamic_strings_length = 0; ++ ++ free (filedata->dynamic_symbols); ++ filedata->dynamic_symbols = NULL; ++ filedata->num_dynamic_syms = 0; ++ ++ free (filedata->dynamic_syminfo); ++ filedata->dynamic_syminfo = NULL; ++ ++ free (filedata->dynamic_section); ++ filedata->dynamic_section = NULL; ++ ++ while (filedata->symtab_shndx_list != NULL) ++ { ++ elf_section_list *next = filedata->symtab_shndx_list->next; ++ free (filedata->symtab_shndx_list); ++ filedata->symtab_shndx_list = next; ++ } ++ ++ free (filedata->section_headers_groups); ++ filedata->section_headers_groups = NULL; ++ ++ if (filedata->section_groups) ++ { ++ struct group_list * g; ++ struct group_list * next; ++ ++ for (i = 0; i < filedata->group_count; i++) ++ { ++ for (g = filedata->section_groups [i].root; g != NULL; g = next) ++ { ++ next = g->next; ++ free (g); ++ } ++ } ++ ++ free (filedata->section_groups); ++ filedata->section_groups = NULL; ++ } ++ ++ free_debug_memory (); ++ ++ return res; ++} ++ ++/* Process an ELF archive. ++ On entry the file is positioned just after the ARMAG string. ++ Returns TRUE upon success, FALSE otherwise. */ ++ ++static bfd_boolean ++process_archive (Filedata * filedata, bfd_boolean is_thin_archive) ++{ ++ struct archive_info arch; ++ struct archive_info nested_arch; ++ size_t got; ++ bfd_boolean ret = TRUE; ++ ++ show_name = TRUE; ++ ++ /* The ARCH structure is used to hold information about this archive. */ ++ arch.file_name = NULL; ++ arch.file = NULL; ++ arch.index_array = NULL; ++ arch.sym_table = NULL; ++ arch.longnames = NULL; ++ ++ /* The NESTED_ARCH structure is used as a single-item cache of information ++ about a nested archive (when members of a thin archive reside within ++ another regular archive file). */ ++ nested_arch.file_name = NULL; ++ nested_arch.file = NULL; ++ nested_arch.index_array = NULL; ++ nested_arch.sym_table = NULL; ++ nested_arch.longnames = NULL; ++ ++ if (setup_archive (&arch, filedata->file_name, filedata->handle, ++ filedata->file_size, is_thin_archive, ++ do_archive_index) != 0) ++ { ++ ret = FALSE; ++ goto out; ++ } ++ ++ if (do_archive_index) ++ { ++ if (arch.sym_table == NULL) ++ error (_("%s: unable to dump the index as none was found\n"), ++ filedata->file_name); ++ else ++ { ++ unsigned long i, l; ++ unsigned long current_pos; ++ ++ printf (_("Index of archive %s: (%lu entries, 0x%lx bytes " ++ "in the symbol table)\n"), ++ filedata->file_name, (unsigned long) arch.index_num, ++ arch.sym_size); ++ ++ current_pos = ftell (filedata->handle); ++ ++ for (i = l = 0; i < arch.index_num; i++) ++ { ++ if (i == 0 ++ || (i > 0 && arch.index_array[i] != arch.index_array[i - 1])) ++ { ++ char * member_name ++ = get_archive_member_name_at (&arch, arch.index_array[i], ++ &nested_arch); ++ ++ if (member_name != NULL) ++ { ++ char * qualified_name ++ = make_qualified_name (&arch, &nested_arch, ++ member_name); ++ ++ if (qualified_name != NULL) ++ { ++ printf (_("Contents of binary %s at offset "), ++ qualified_name); ++ (void) print_vma (arch.index_array[i], PREFIX_HEX); ++ putchar ('\n'); ++ free (qualified_name); ++ } ++ free (member_name); ++ } ++ } ++ ++ if (l >= arch.sym_size) ++ { ++ error (_("%s: end of the symbol table reached " ++ "before the end of the index\n"), ++ filedata->file_name); ++ ret = FALSE; ++ break; ++ } ++ /* PR 17531: file: 0b6630b2. */ ++ printf ("\t%.*s\n", ++ (int) (arch.sym_size - l), arch.sym_table + l); ++ l += strnlen (arch.sym_table + l, arch.sym_size - l) + 1; ++ } ++ ++ if (arch.uses_64bit_indices) ++ l = (l + 7) & ~ 7; ++ else ++ l += l & 1; ++ ++ if (l < arch.sym_size) ++ { ++ error (ngettext ("%s: %ld byte remains in the symbol table, " ++ "but without corresponding entries in " ++ "the index table\n", ++ "%s: %ld bytes remain in the symbol table, " ++ "but without corresponding entries in " ++ "the index table\n", ++ arch.sym_size - l), ++ filedata->file_name, arch.sym_size - l); ++ ret = FALSE; ++ } ++ ++ if (fseek (filedata->handle, current_pos, SEEK_SET) != 0) ++ { ++ error (_("%s: failed to seek back to start of object files " ++ "in the archive\n"), ++ filedata->file_name); ++ ret = FALSE; ++ goto out; ++ } ++ } ++ ++ if (!do_dynamic && !do_syms && !do_reloc && !do_unwind && !do_sections ++ && !do_segments && !do_header && !do_dump && !do_version ++ && !do_histogram && !do_debugging && !do_arch && !do_notes ++ && !do_section_groups && !do_dyn_syms) ++ { ++ ret = TRUE; /* Archive index only. */ ++ goto out; ++ } ++ } ++ ++ while (1) ++ { ++ char * name; ++ size_t namelen; ++ char * qualified_name; ++ ++ /* Read the next archive header. */ ++ if (fseek (filedata->handle, arch.next_arhdr_offset, SEEK_SET) != 0) ++ { ++ error (_("%s: failed to seek to next archive header\n"), ++ arch.file_name); ++ ret = FALSE; ++ break; ++ } ++ got = fread (&arch.arhdr, 1, sizeof arch.arhdr, filedata->handle); ++ if (got != sizeof arch.arhdr) ++ { ++ if (got == 0) ++ break; ++ /* PR 24049 - we cannot use filedata->file_name as this will ++ have already been freed. */ ++ error (_("%s: failed to read archive header\n"), arch.file_name); ++ ++ ret = FALSE; ++ break; ++ } ++ if (memcmp (arch.arhdr.ar_fmag, ARFMAG, 2) != 0) ++ { ++ error (_("%s: did not find a valid archive header\n"), ++ arch.file_name); ++ ret = FALSE; ++ break; ++ } ++ ++ arch.next_arhdr_offset += sizeof arch.arhdr; ++ ++ filedata->archive_file_size = strtoul (arch.arhdr.ar_size, NULL, 10); ++ if (filedata->archive_file_size & 01) ++ ++filedata->archive_file_size; ++ ++ name = get_archive_member_name (&arch, &nested_arch); ++ if (name == NULL) ++ { ++ error (_("%s: bad archive file name\n"), arch.file_name); ++ ret = FALSE; ++ break; ++ } ++ namelen = strlen (name); ++ ++ qualified_name = make_qualified_name (&arch, &nested_arch, name); ++ if (qualified_name == NULL) ++ { ++ error (_("%s: bad archive file name\n"), arch.file_name); ++ free (name); ++ ret = FALSE; ++ break; ++ } ++ ++ if (is_thin_archive && arch.nested_member_origin == 0) ++ { ++ /* This is a proxy for an external member of a thin archive. */ ++ Filedata * member_filedata; ++ char * member_file_name = adjust_relative_path ++ (filedata->file_name, name, namelen); ++ ++ free (name); ++ if (member_file_name == NULL) ++ { ++ free (qualified_name); ++ ret = FALSE; ++ break; ++ } ++ ++ member_filedata = open_file (member_file_name); ++ if (member_filedata == NULL) ++ { ++ error (_("Input file '%s' is not readable.\n"), member_file_name); ++ free (member_file_name); ++ free (qualified_name); ++ ret = FALSE; ++ break; ++ } ++ ++ filedata->archive_file_offset = arch.nested_member_origin; ++ member_filedata->file_name = qualified_name; ++ ++ if (! process_object (member_filedata)) ++ ret = FALSE; ++ ++ close_file (member_filedata); ++ free (member_file_name); ++ } ++ else if (is_thin_archive) ++ { ++ Filedata thin_filedata; ++ ++ memset (&thin_filedata, 0, sizeof (thin_filedata)); ++ ++ /* PR 15140: Allow for corrupt thin archives. */ ++ if (nested_arch.file == NULL) ++ { ++ error (_("%s: contains corrupt thin archive: %s\n"), ++ qualified_name, name); ++ free (qualified_name); ++ free (name); ++ ret = FALSE; ++ break; ++ } ++ free (name); ++ ++ /* This is a proxy for a member of a nested archive. */ ++ filedata->archive_file_offset ++ = arch.nested_member_origin + sizeof arch.arhdr; ++ ++ /* The nested archive file will have been opened and setup by ++ get_archive_member_name. */ ++ if (fseek (nested_arch.file, filedata->archive_file_offset, ++ SEEK_SET) != 0) ++ { ++ error (_("%s: failed to seek to archive member.\n"), ++ nested_arch.file_name); ++ free (qualified_name); ++ ret = FALSE; ++ break; ++ } ++ ++ thin_filedata.handle = nested_arch.file; ++ thin_filedata.file_name = qualified_name; ++ ++ if (! process_object (& thin_filedata)) ++ ret = FALSE; ++ } ++ else ++ { ++ free (name); ++ filedata->archive_file_offset = arch.next_arhdr_offset; ++ filedata->file_name = qualified_name; ++ if (! process_object (filedata)) ++ ret = FALSE; ++ arch.next_arhdr_offset += filedata->archive_file_size; ++ /* Stop looping with "negative" archive_file_size. */ ++ if (arch.next_arhdr_offset < filedata->archive_file_size) ++ arch.next_arhdr_offset = -1ul; ++ } ++ ++ free (qualified_name); ++ } ++ ++ out: ++ if (nested_arch.file != NULL) ++ fclose (nested_arch.file); ++ release_archive (&nested_arch); ++ release_archive (&arch); ++ ++ return ret; ++} ++ ++static bfd_boolean ++process_file (char * file_name) ++{ ++ Filedata * filedata = NULL; ++ struct stat statbuf; ++ char armag[SARMAG]; ++ bfd_boolean ret = FALSE; ++ char * name; ++ char * saved_program_name; ++ ++ /* Overload program_name to include file_name. Doing this means ++ that warning/error messages will positively identify the file ++ concerned even when multiple instances of readelf are running. */ ++ name = xmalloc (strlen (program_name) + strlen (file_name) + 3); ++ sprintf (name, "%s: %s", program_name, file_name); ++ saved_program_name = program_name; ++ program_name = name; ++ ++ if (stat (file_name, &statbuf) < 0) ++ { ++ if (errno == ENOENT) ++ error (_("No such file\n")); ++ else ++ error (_("Could not locate file. System error message: %s\n"), ++ strerror (errno)); ++ goto done; ++ } ++ ++ if (! S_ISREG (statbuf.st_mode)) ++ { ++ error (_("Not an ordinary file\n")); ++ goto done; ++ } ++ ++ filedata = calloc (1, sizeof * filedata); ++ if (filedata == NULL) ++ { ++ error (_("Out of memory allocating file data structure\n")); ++ goto done; ++ } ++ ++ filedata->file_name = file_name; ++ filedata->handle = fopen (file_name, "rb"); ++ if (filedata->handle == NULL) ++ { ++ error (_("Not readable\n")); ++ goto done; ++ } ++ ++ if (fread (armag, SARMAG, 1, filedata->handle) != 1) ++ { ++ error (_("Failed to read file's magic number\n")); ++ goto done; ++ } ++ ++ filedata->file_size = (bfd_size_type) statbuf.st_size; ++ ++ if (memcmp (armag, ARMAG, SARMAG) == 0) ++ { ++ if (process_archive (filedata, FALSE)) ++ ret = TRUE; ++ } ++ else if (memcmp (armag, ARMAGT, SARMAG) == 0) ++ { ++ if (process_archive (filedata, TRUE)) ++ ret = TRUE; ++ } ++ else ++ { ++ if (do_archive_index && !check_all) ++ error (_("Not an archive so its index cannot be displayed.\n")); ++ ++ rewind (filedata->handle); ++ filedata->archive_file_size = filedata->archive_file_offset = 0; ++ ++ if (process_object (filedata)) ++ ret = TRUE; ++ } ++ ++ done: ++ if (filedata) ++ { ++ if (filedata->handle != NULL) ++ fclose (filedata->handle); ++ free (filedata->section_headers); ++ free (filedata->program_headers); ++ free (filedata->string_table); ++ free (filedata->dump.dump_sects); ++ free (filedata); ++ } ++ free (program_name); ++ program_name = saved_program_name; ++ ++ free (ba_cache.strtab); ++ ba_cache.strtab = NULL; ++ free (ba_cache.symtab); ++ ba_cache.symtab = NULL; ++ ba_cache.filedata = NULL; ++ ++ return ret; ++} ++ ++#ifdef SUPPORT_DISASSEMBLY ++/* Needed by the i386 disassembler. For extra credit, someone could ++ fix this so that we insert symbolic addresses here, esp for GOT/PLT ++ symbols. */ ++ ++void ++print_address (unsigned int addr, FILE * outfile) ++{ ++ fprintf (outfile,"0x%8.8x", addr); ++} ++ ++/* Needed by the i386 disassembler. */ ++ ++void ++db_task_printsym (unsigned int addr) ++{ ++ print_address (addr, stderr); ++} ++#endif ++ ++int ++main (int argc, char ** argv) ++{ ++ int err; ++ ++#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) ++ setlocale (LC_MESSAGES, ""); ++#endif ++#if defined (HAVE_SETLOCALE) ++ setlocale (LC_CTYPE, ""); ++#endif ++ bindtextdomain (PACKAGE, LOCALEDIR); ++ textdomain (PACKAGE); ++ ++ expandargv (&argc, &argv); ++ ++ parse_args (& cmdline, argc, argv); ++ ++ if (optind < (argc - 1)) ++ /* When displaying information for more than one file, ++ prefix the information with the file name. */ ++ show_name = TRUE; ++ else if (optind >= argc) ++ { ++ /* Ensure that the warning is always displayed. */ ++ do_checks = TRUE; ++ ++ warn (_("Nothing to do.\n")); ++ usage (stderr); ++ } ++ ++ err = FALSE; ++ while (optind < argc) ++ if (! process_file (argv[optind++])) ++ err = TRUE; ++ ++ free (cmdline.dump_sects); ++ ++ free (dump_ctf_symtab_name); ++ free (dump_ctf_strtab_name); ++ free (dump_ctf_parent_name); ++ ++ return err ? EXIT_FAILURE : EXIT_SUCCESS; ++} +diff -rupN binutils.orig/binutils/readelf.c.rej binutils-2.35.2/binutils/readelf.c.rej +--- binutils.orig/binutils/readelf.c.rej 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/readelf.c.rej 2021-11-09 16:53:52.334865883 +0000 +@@ -0,0 +1,58 @@ ++--- binutils/readelf.c 2021-11-09 12:34:21.680802825 +0000 +++++ binutils/readelf.c 2021-11-09 12:34:46.293643851 +0000 ++@@ -4814,6 +4960,7 @@ static struct option options[] = ++ {"syms", no_argument, 0, 's'}, ++ {"silent-truncation",no_argument, 0, 'T'}, ++ {"section-details", no_argument, 0, 't'}, +++ {"unicode", required_argument, NULL, 'U'}, ++ {"unwind", no_argument, 0, 'u'}, ++ {"version-info", no_argument, 0, 'V'}, ++ {"version", no_argument, 0, 'v'}, ++@@ -4890,6 +5037,12 @@ usage (FILE * stream) ++ fprintf (stream, _("\ ++ --no-recurse-limit Disable a demangling recursion limit\n")); ++ fprintf (stream, _("\ +++ -U[dlexhi] --unicode=[default|locale|escape|hex|highlight|invalid]\n\ +++ Display unicode characters as determined by the current locale\n\ +++ (default), escape sequences, \"\", highlighted\n\ +++ escape sequences, or treat them as invalid and display as\n\ +++ \"{hex sequences}\"\n")); +++ fprintf (stream, _("\ ++ -n --notes Display the core notes (if present)\n")); ++ fprintf (stream, _("\ ++ -r --relocs Display the relocations (if present)\n")); ++@@ -5074,7 +5227,7 @@ parse_args (struct dump_data *dumpdata, ++ usage (stderr); ++ ++ while ((c = getopt_long ++- (argc, argv, "ACDHILNPR:STVWacdeghi:lnp:rstuvw::x:z", options, NULL)) != EOF) +++ (argc, argv, "ACDHILNPR:STU:VWacdeghi:lnp:rstuvw::x:z", options, NULL)) != EOF) ++ { ++ switch (c) ++ { ++@@ -5276,6 +5429,25 @@ parse_args (struct dump_data *dumpdata, ++ /* Ignored for backward compatibility. */ ++ break; ++ +++ case 'U': +++ if (optarg == NULL) +++ error (_("Missing arg to -U/--unicode")); /* Can this happen ? */ +++ else if (streq (optarg, "default") || streq (optarg, "d")) +++ unicode_display = unicode_default; +++ else if (streq (optarg, "locale") || streq (optarg, "l")) +++ unicode_display = unicode_locale; +++ else if (streq (optarg, "escape") || streq (optarg, "e")) +++ unicode_display = unicode_escape; +++ else if (streq (optarg, "invalid") || streq (optarg, "i")) +++ unicode_display = unicode_invalid; +++ else if (streq (optarg, "hex") || streq (optarg, "x")) +++ unicode_display = unicode_hex; +++ else if (streq (optarg, "highlight") || streq (optarg, "h")) +++ unicode_display = unicode_highlight; +++ else +++ error (_("invalid argument to -U/--unicode: %s"), optarg); +++ break; +++ ++ case OPTION_SYM_BASE: ++ sym_base = 0; ++ if (optarg != NULL) +diff -rupN binutils.orig/binutils/strings.c binutils-2.35.2/binutils/strings.c +--- binutils.orig/binutils/strings.c 2021-11-09 16:53:12.816128287 +0000 ++++ binutils-2.35.2/binutils/strings.c 2021-11-09 17:21:19.268988882 +0000 +@@ -55,6 +55,19 @@ + -T {bfdname} + Specify a non-default object file format. + ++ --unicode={default|locale|invalid|hex|escape|highlight} ++ -u {d|l|i|x|e|h} ++ Determine how to handle UTF-8 unicode characters. The default ++ is no special treatment. All other versions of this option ++ only apply if the encoding is valid and enabling the option ++ implies --encoding=S. ++ The 'locale' option displays the characters according to the ++ current locale. The 'invalid' option treats them as ++ non-string characters. The 'hex' option displays them as hex ++ byte sequences. The 'escape' option displays them as escape ++ sequences and the 'highlight' option displays them as ++ coloured escape sequences. ++ + --output-separator=sep_string + -s sep_string String used to separate parsed strings in output. + Default is newline. +@@ -76,6 +89,22 @@ + #include "safe-ctype.h" + #include "bucomm.h" + ++#ifndef streq ++#define streq(a,b) (strcmp ((a),(b)) == 0) ++#endif ++ ++typedef enum unicode_display_type ++{ ++ unicode_default = 0, ++ unicode_locale, ++ unicode_escape, ++ unicode_hex, ++ unicode_highlight, ++ unicode_invalid ++} unicode_display_type; ++ ++static unicode_display_type unicode_display = unicode_default; ++ + #define STRING_ISGRAPHIC(c) \ + ( (c) >= 0 \ + && (c) <= 255 \ +@@ -94,7 +123,7 @@ extern int errno; + static int address_radix; + + /* Minimum length of sequence of graphic chars to trigger output. */ +-static int string_min; ++static uint string_min; + + /* Whether or not we include all whitespace as a graphic char. */ + static bfd_boolean include_all_whitespace; +@@ -135,7 +164,7 @@ static struct option long_options[] = + }; + + static bfd_boolean strings_file (char *); +-static void print_strings (const char *, FILE *, file_ptr, int, int, char *); ++static void print_strings (const char *, FILE *, file_ptr, int, char *); + static void usage (FILE *, int) ATTRIBUTE_NORETURN; + + int main (int, char **); +@@ -173,7 +202,7 @@ main (int argc, char **argv) + encoding = 's'; + output_separator = NULL; + +- while ((optc = getopt_long (argc, argv, "adfhHn:wot:e:T:s:Vv0123456789", ++ while ((optc = getopt_long (argc, argv, "adfhHn:wot:e:T:s:U:Vv0123456789", + long_options, (int *) 0)) != EOF) + { + switch (optc) +@@ -246,6 +275,23 @@ main (int argc, char **argv) + output_separator = optarg; + break; + ++ case 'U': ++ if (streq (optarg, "default") || streq (optarg, "d")) ++ unicode_display = unicode_default; ++ else if (streq (optarg, "locale") || streq (optarg, "l")) ++ unicode_display = unicode_locale; ++ else if (streq (optarg, "escape") || streq (optarg, "e")) ++ unicode_display = unicode_escape; ++ else if (streq (optarg, "invalid") || streq (optarg, "i")) ++ unicode_display = unicode_invalid; ++ else if (streq (optarg, "hex") || streq (optarg, "x")) ++ unicode_display = unicode_hex; ++ else if (streq (optarg, "highlight") || streq (optarg, "h")) ++ unicode_display = unicode_highlight; ++ else ++ fatal (_("invalid argument to -U/--unicode: %s"), optarg); ++ break; ++ + case 'V': + case 'v': + print_version ("strings"); +@@ -260,6 +306,9 @@ main (int argc, char **argv) + } + } + ++ if (unicode_display != unicode_default) ++ encoding = 'S'; ++ + if (numeric_opt != 0) + { + string_min = (int) strtoul (argv[numeric_opt - 1] + 1, &s, 0); +@@ -295,7 +344,7 @@ main (int argc, char **argv) + { + datasection_only = FALSE; + SET_BINARY (fileno (stdin)); +- print_strings ("{standard input}", stdin, 0, 0, 0, (char *) NULL); ++ print_strings ("{standard input}", stdin, 0, 0, (char *) NULL); + files_given = TRUE; + } + else +@@ -344,7 +393,7 @@ strings_a_section (bfd *abfd, asection * + } + + *got_a_section = TRUE; +- print_strings (filename, NULL, sect->filepos, 0, sectsize, (char *) mem); ++ print_strings (filename, NULL, sect->filepos, 0, (char *) mem); + free (mem); + } + +@@ -429,7 +478,7 @@ strings_file (char *file) + return FALSE; + } + +- print_strings (file, stream, (file_ptr) 0, 0, 0, (char *) 0); ++ print_strings (file, stream, (file_ptr) 0, 0, (char *) NULL); + + if (fclose (stream) == EOF) + { +@@ -553,11 +602,627 @@ unget_part_char (long c, file_ptr *addre + } + } + } ++ ++static void ++print_filename_and_address (const char * filename, file_ptr address) ++{ ++ if (print_filenames) ++ printf ("%s: ", filename); ++ ++ if (! print_addresses) ++ return; ++ ++ switch (address_radix) ++ { ++ case 8: ++ if (sizeof (address) > sizeof (long)) ++ { ++#ifndef __MSVCRT__ ++ printf ("%7llo ", (unsigned long long) address); ++#else ++ printf ("%7I64o ", (unsigned long long) address); ++#endif ++ } ++ else ++ printf ("%7lo ", (unsigned long) address); ++ break; ++ ++ case 10: ++ if (sizeof (address) > sizeof (long)) ++ { ++#ifndef __MSVCRT__ ++ printf ("%7llu ", (unsigned long long) address); ++#else ++ printf ("%7I64d ", (unsigned long long) address); ++#endif ++ } ++ else ++ printf ("%7ld ", (long) address); ++ break; ++ ++ case 16: ++ if (sizeof (address) > sizeof (long)) ++ { ++#ifndef __MSVCRT__ ++ printf ("%7llx ", (unsigned long long) address); ++#else ++ printf ("%7I64x ", (unsigned long long) address); ++#endif ++ } ++ else ++ printf ("%7lx ", (unsigned long) address); ++ break; ++ } ++} ++ ++/* Return non-zero if the bytes starting at BUFFER form a valid UTF-8 encoding. ++ If the encoding is valid then returns the number of bytes it uses. */ ++ ++static unsigned int ++is_valid_utf8 (const unsigned char * buffer, unsigned long buflen) ++{ ++ if (buffer[0] < 0xc0) ++ return 0; ++ ++ if (buflen < 2) ++ return 0; ++ ++ if ((buffer[1] & 0xc0) != 0x80) ++ return 0; ++ ++ if ((buffer[0] & 0x20) == 0) ++ return 2; ++ ++ if (buflen < 3) ++ return 0; ++ ++ if ((buffer[2] & 0xc0) != 0x80) ++ return 0; ++ ++ if ((buffer[0] & 0x10) == 0) ++ return 3; ++ ++ if (buflen < 4) ++ return 0; ++ ++ if ((buffer[3] & 0xc0) != 0x80) ++ return 0; ++ ++ return 4; ++} ++ ++/* Display a UTF-8 encoded character in BUFFER according to the setting ++ of unicode_display. The character is known to be valid. ++ Returns the number of bytes consumed. */ ++ ++static uint ++display_utf8_char (const unsigned char * buffer) ++{ ++ uint j; ++ uint utf8_len; ++ ++ switch (buffer[0] & 0x30) ++ { ++ case 0x00: ++ case 0x10: ++ utf8_len = 2; ++ break; ++ case 0x20: ++ utf8_len = 3; ++ break; ++ default: ++ utf8_len = 4; ++ } ++ ++ switch (unicode_display) ++ { ++ default: ++ fprintf (stderr, "ICE: unexpected unicode display type\n"); ++ break; ++ ++ case unicode_escape: ++ case unicode_highlight: ++ if (unicode_display == unicode_highlight && isatty (1)) ++ printf ("\x1B[31;47m"); /* Red. */ ++ ++ switch (utf8_len) ++ { ++ case 2: ++ printf ("\\u%02x%02x", ++ ((buffer[0] & 0x1c) >> 2), ++ ((buffer[0] & 0x03) << 6) | (buffer[1] & 0x3f)); ++ break; ++ ++ case 3: ++ printf ("\\u%02x%02x", ++ ((buffer[0] & 0x0f) << 4) | ((buffer[1] & 0x3c) >> 2), ++ ((buffer[1] & 0x03) << 6) | ((buffer[2] & 0x3f))); ++ break; ++ ++ case 4: ++ printf ("\\u%02x%02x%02x", ++ ((buffer[0] & 0x07) << 6) | ((buffer[1] & 0x3c) >> 2), ++ ((buffer[1] & 0x03) << 6) | ((buffer[2] & 0x3c) >> 2), ++ ((buffer[2] & 0x03) << 6) | ((buffer[3] & 0x3f))); ++ break; ++ default: ++ /* URG. */ ++ break; ++ } ++ ++ if (unicode_display == unicode_highlight && isatty (1)) ++ printf ("\033[0m"); /* Default colour. */ ++ break; ++ ++ case unicode_hex: ++ putchar ('<'); ++ printf ("0x"); ++ for (j = 0; j < utf8_len; j++) ++ printf ("%02x", buffer [j]); ++ putchar ('>'); ++ break; ++ ++ case unicode_locale: ++ printf ("%.1s", buffer); ++ break; ++ } ++ ++ return utf8_len; ++} ++ ++/* Display strings in BUFFER. Treat any UTF-8 encoded characters encountered ++ according to the setting of the unicode_display variable. The buffer ++ contains BUFLEN bytes. ++ ++ Display the characters as if they started at ADDRESS and are contained in ++ FILENAME. */ ++ ++static void ++print_unicode_buffer (const char * filename, ++ file_ptr address, ++ const unsigned char * buffer, ++ unsigned long buflen) ++{ ++ /* Paranoia checks... */ ++ if (filename == NULL ++ || buffer == NULL ++ || unicode_display == unicode_default ++ || encoding != 'S' ++ || encoding_bytes != 1) ++ { ++ fprintf (stderr, "ICE: bad arguments to print_unicode_buffer\n"); ++ return; ++ } ++ ++ if (buflen == 0) ++ return; ++ ++ /* We must only display strings that are at least string_min *characters* ++ long. So we scan the buffer in two stages. First we locate the start ++ of a potential string. Then we walk along it until we have found ++ string_min characters. Then we go back to the start point and start ++ displaying characters according to the unicode_display setting. */ ++ ++ unsigned long start_point = 0; ++ unsigned long i = 0; ++ unsigned int char_len = 1; ++ unsigned int num_found = 0; ++ ++ for (i = 0; i < buflen; i += char_len) ++ { ++ int c = buffer[i]; ++ ++ char_len = 1; ++ ++ /* Find the first potential character of a string. */ ++ if (! STRING_ISGRAPHIC (c)) ++ { ++ num_found = 0; ++ continue; ++ } ++ ++ if (c > 126) ++ { ++ if (c < 0xc0) ++ { ++ num_found = 0; ++ continue; ++ } ++ ++ if ((char_len = is_valid_utf8 (buffer + i, buflen - i)) == 0) ++ { ++ char_len = 1; ++ num_found = 0; ++ continue; ++ } ++ ++ if (unicode_display == unicode_invalid) ++ { ++ /* We have found a valid UTF-8 character, but we treat it as non-graphic. */ ++ num_found = 0; ++ continue; ++ } ++ } ++ ++ if (num_found == 0) ++ /* We have found a potential starting point for a string. */ ++ start_point = i; ++ ++ ++ num_found; ++ ++ if (num_found >= string_min) ++ break; ++ } ++ ++ if (num_found < string_min) ++ return; ++ ++ print_filename_and_address (filename, address + start_point); ++ ++ /* We have found string_min characters. Display them and any ++ more that follow. */ ++ for (i = start_point; i < buflen; i += char_len) ++ { ++ int c = buffer[i]; ++ ++ char_len = 1; ++ ++ if (! STRING_ISGRAPHIC (c)) ++ break; ++ else if (c < 127) ++ putchar (c); ++ else if (! is_valid_utf8 (buffer + i, buflen - i)) ++ break; ++ else if (unicode_display == unicode_invalid) ++ break; ++ else ++ char_len = display_utf8_char (buffer + i); ++ } ++ ++ if (output_separator) ++ fputs (output_separator, stdout); ++ else ++ putchar ('\n'); ++ ++ /* FIXME: Using tail recursion here is lazy programming... */ ++ print_unicode_buffer (filename, address + i, buffer + i, buflen - i); ++} ++ ++static int ++get_unicode_byte (FILE * stream, unsigned char * putback, uint * num_putback, uint * num_read) ++{ ++ if (* num_putback > 0) ++ { ++ * num_putback = * num_putback - 1; ++ return putback [* num_putback]; ++ } ++ ++ * num_read = * num_read + 1; ++ ++#if defined(HAVE_GETC_UNLOCKED) && HAVE_DECL_GETC_UNLOCKED ++ return getc_unlocked (stream); ++#else ++ return getc (stream); ++#endif ++} ++ ++/* Helper function for print_unicode_stream. */ ++ ++static void ++print_unicode_stream_body (const char * filename, ++ file_ptr address, ++ FILE * stream, ++ unsigned char * putback_buf, ++ uint num_putback, ++ unsigned char * print_buf) ++{ ++ /* It would be nice if we could just read the stream into a buffer ++ and then process if with print_unicode_buffer. But the input ++ might be huge or it might time-locked (eg stdin). So instead ++ we go one byte at a time... */ ++ ++ file_ptr start_point = 0; ++ uint num_read = 0; ++ uint num_chars = 0; ++ uint num_print = 0; ++ int c; ++ ++ /* Find a series of string_min characters. Put them into print_buf. */ ++ do ++ { ++ if (num_chars >= string_min) ++ break; ++ ++ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); ++ if (c == EOF) ++ break; ++ ++ if (! STRING_ISGRAPHIC (c)) ++ { ++ num_chars = num_print = 0; ++ continue; ++ } ++ ++ if (num_chars == 0) ++ start_point = num_read - 1; ++ ++ if (c < 127) ++ { ++ print_buf[num_print] = c; ++ num_chars ++; ++ num_print ++; ++ continue; ++ } ++ ++ if (c < 0xc0) ++ { ++ num_chars = num_print = 0; ++ continue; ++ } ++ ++ /* We *might* have a UTF-8 sequence. Time to start peeking. */ ++ char utf8[4]; ++ ++ utf8[0] = c; ++ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); ++ if (c == EOF) ++ break; ++ utf8[1] = c; ++ ++ if ((utf8[1] & 0xc0) != 0x80) ++ { ++ /* Invalid UTF-8. */ ++ putback_buf[num_putback++] = utf8[1]; ++ num_chars = num_print = 0; ++ continue; ++ } ++ else if ((utf8[0] & 0x20) == 0) ++ { ++ /* A valid 2-byte UTF-8 encoding. */ ++ if (unicode_display == unicode_invalid) ++ { ++ putback_buf[num_putback++] = utf8[1]; ++ num_chars = num_print = 0; ++ } ++ else ++ { ++ print_buf[num_print ++] = utf8[0]; ++ print_buf[num_print ++] = utf8[1]; ++ num_chars ++; ++ } ++ continue; ++ } ++ ++ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); ++ if (c == EOF) ++ break; ++ utf8[2] = c; ++ ++ if ((utf8[2] & 0xc0) != 0x80) ++ { ++ /* Invalid UTF-8. */ ++ putback_buf[num_putback++] = utf8[2]; ++ putback_buf[num_putback++] = utf8[1]; ++ num_chars = num_print = 0; ++ continue; ++ } ++ else if ((utf8[0] & 0x10) == 0) ++ { ++ /* A valid 3-byte UTF-8 encoding. */ ++ if (unicode_display == unicode_invalid) ++ { ++ putback_buf[num_putback++] = utf8[2]; ++ putback_buf[num_putback++] = utf8[1]; ++ num_chars = num_print = 0; ++ } ++ else ++ { ++ print_buf[num_print ++] = utf8[0]; ++ print_buf[num_print ++] = utf8[1]; ++ print_buf[num_print ++] = utf8[2]; ++ num_chars ++; ++ } ++ continue; ++ } ++ ++ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); ++ if (c == EOF) ++ break; ++ utf8[3] = c; ++ ++ if ((utf8[3] & 0xc0) != 0x80) ++ { ++ /* Invalid UTF-8. */ ++ putback_buf[num_putback++] = utf8[3]; ++ putback_buf[num_putback++] = utf8[2]; ++ putback_buf[num_putback++] = utf8[1]; ++ num_chars = num_print = 0; ++ } ++ /* We have a valid 4-byte UTF-8 encoding. */ ++ else if (unicode_display == unicode_invalid) ++ { ++ putback_buf[num_putback++] = utf8[3]; ++ putback_buf[num_putback++] = utf8[1]; ++ putback_buf[num_putback++] = utf8[2]; ++ num_chars = num_print = 0; ++ } ++ else ++ { ++ print_buf[num_print ++] = utf8[0]; ++ print_buf[num_print ++] = utf8[1]; ++ print_buf[num_print ++] = utf8[2]; ++ print_buf[num_print ++] = utf8[3]; ++ num_chars ++; ++ } ++ } ++ while (1); ++ ++ if (num_chars >= string_min) ++ { ++ /* We know that we have string_min valid characters in print_buf, ++ and there may be more to come in the stream. Start displaying ++ them. */ ++ ++ print_filename_and_address (filename, address + start_point); ++ ++ uint i; ++ for (i = 0; i < num_print;) ++ { ++ if (print_buf[i] < 127) ++ putchar (print_buf[i++]); ++ else ++ i += display_utf8_char (print_buf + i); ++ } ++ ++ /* OK so now we have to start read unchecked bytes. */ ++ ++ /* Find a series of string_min characters. Put them into print_buf. */ ++ do ++ { ++ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); ++ if (c == EOF) ++ break; ++ ++ if (! STRING_ISGRAPHIC (c)) ++ break; ++ ++ if (c < 127) ++ { ++ putchar (c); ++ continue; ++ } ++ ++ if (c < 0xc0) ++ break; ++ ++ /* We *might* have a UTF-8 sequence. Time to start peeking. */ ++ unsigned char utf8[4]; ++ ++ utf8[0] = c; ++ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); ++ if (c == EOF) ++ break; ++ utf8[1] = c; ++ ++ if ((utf8[1] & 0xc0) != 0x80) ++ { ++ /* Invalid UTF-8. */ ++ putback_buf[num_putback++] = utf8[1]; ++ break; ++ } ++ else if ((utf8[0] & 0x20) == 0) ++ { ++ /* Valid 2-byte UTF-8. */ ++ if (unicode_display == unicode_invalid) ++ { ++ putback_buf[num_putback++] = utf8[1]; ++ break; ++ } ++ else ++ { ++ (void) display_utf8_char (utf8); ++ continue; ++ } ++ } ++ ++ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); ++ if (c == EOF) ++ break; ++ utf8[2] = c; ++ ++ if ((utf8[2] & 0xc0) != 0x80) ++ { ++ /* Invalid UTF-8. */ ++ putback_buf[num_putback++] = utf8[2]; ++ putback_buf[num_putback++] = utf8[1]; ++ break; ++ } ++ else if ((utf8[0] & 0x10) == 0) ++ { ++ /* Valid 3-byte UTF-8. */ ++ if (unicode_display == unicode_invalid) ++ { ++ putback_buf[num_putback++] = utf8[2]; ++ putback_buf[num_putback++] = utf8[1]; ++ break; ++ } ++ else ++ { ++ (void) display_utf8_char (utf8); ++ continue; ++ } ++ } ++ ++ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); ++ if (c == EOF) ++ break; ++ utf8[3] = c; ++ ++ if ((utf8[3] & 0xc0) != 0x80) ++ { ++ /* Invalid UTF-8. */ ++ putback_buf[num_putback++] = utf8[3]; ++ putback_buf[num_putback++] = utf8[2]; ++ putback_buf[num_putback++] = utf8[1]; ++ break; ++ } ++ else if (unicode_display == unicode_invalid) ++ { ++ putback_buf[num_putback++] = utf8[3]; ++ putback_buf[num_putback++] = utf8[2]; ++ putback_buf[num_putback++] = utf8[1]; ++ break; ++ } ++ else ++ /* A valid 4-byte UTF-8 encoding. */ ++ (void) display_utf8_char (utf8); ++ } ++ while (1); ++ ++ if (output_separator) ++ fputs (output_separator, stdout); ++ else ++ putchar ('\n'); ++ } ++ ++ if (c != EOF) ++ /* FIXME: Using tail recursion here is lazy, but it works. */ ++ print_unicode_stream_body (filename, address + num_read, stream, putback_buf, num_putback, print_buf); ++} ++ ++/* Display strings read in from STREAM. Treat any UTF-8 encoded characters ++ encountered according to the setting of the unicode_display variable. ++ The stream is positioned at ADDRESS and is attached to FILENAME. */ ++ ++static void ++print_unicode_stream (const char * filename, ++ file_ptr address, ++ FILE * stream) ++{ ++ /* Paranoia checks... */ ++ if (filename == NULL ++ || stream == NULL ++ || unicode_display == unicode_default ++ || encoding != 'S' ++ || encoding_bytes != 1) ++ { ++ fprintf (stderr, "ICE: bad arguments to print_unicode_stream\n"); ++ return; ++ } ++ ++ /* Allocate space for string_min 4-byte utf-8 characters. */ ++ unsigned char * print_buf = xmalloc ((4 * string_min) + 1); ++ /* We should never have to put back more than 4 bytes. */ ++ unsigned char putback_buf[5]; ++ uint num_putback = 0; ++ ++ print_unicode_stream_body (filename, address, stream, putback_buf, num_putback, print_buf); ++ free (print_buf); ++} + + /* Find the strings in file FILENAME, read from STREAM. + Assume that STREAM is positioned so that the next byte read + is at address ADDRESS in the file. +- Stop reading at address STOP_POINT in the file, if nonzero. + + If STREAM is NULL, do not read from it. + The caller can supply a buffer of characters +@@ -568,20 +1233,29 @@ unget_part_char (long c, file_ptr *addre + + static void + print_strings (const char *filename, FILE *stream, file_ptr address, +- int stop_point, int magiccount, char *magic) ++ int magiccount, char *magic) + { ++ if (unicode_display != unicode_default) ++ { ++ if (magic != NULL) ++ print_unicode_buffer (filename, address, ++ (const unsigned char *) magic, magiccount); ++ ++ if (stream != NULL) ++ print_unicode_stream (filename, address, stream); ++ return; ++ } ++ + char *buf = (char *) xmalloc (sizeof (char) * (string_min + 1)); + + while (1) + { + file_ptr start; +- int i; ++ uint i; + long c; + + /* See if the next `string_min' chars are all graphic chars. */ + tryline: +- if (stop_point && address >= stop_point) +- break; + start = address; + for (i = 0; i < string_min; i++) + { +@@ -718,6 +1392,8 @@ usage (FILE *stream, int status) + -T --target= Specify the binary file format\n\ + -e --encoding={s,S,b,l,B,L} Select character size and endianness:\n\ + s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit\n\ ++ --unicode={default|show|invalid|hex|escape|highlight}\n\ ++ -u {d|s|i|x|e|h} Specify how to treat UTF-8 encoded unicode characters\n\ + -s --output-separator= String used to separate strings in output.\n\ + @ Read options from \n\ + -h --help Display this information\n\ +diff -rupN binutils.orig/binutils/strings.c.orig binutils-2.35.2/binutils/strings.c.orig +--- binutils.orig/binutils/strings.c.orig 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/strings.c.orig 2021-01-30 08:38:03.000000000 +0000 +@@ -0,0 +1,729 @@ ++/* strings -- print the strings of printable characters in files ++ Copyright (C) 1993-2020 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA ++ 02110-1301, USA. */ ++ ++/* Usage: strings [options] file... ++ ++ Options: ++ --all ++ -a ++ - Scan each file in its entirety. ++ ++ --data ++ -d Scan only the initialized data section(s) of object files. ++ ++ --print-file-name ++ -f Print the name of the file before each string. ++ ++ --bytes=min-len ++ -n min-len ++ -min-len Print graphic char sequences, MIN-LEN or more bytes long, ++ that are followed by a NUL or a newline. Default is 4. ++ ++ --radix={o,x,d} ++ -t {o,x,d} Print the offset within the file before each string, ++ in octal/hex/decimal. ++ ++ --include-all-whitespace ++ -w By default tab and space are the only whitepace included in graphic ++ char sequences. This option considers all of isspace() valid. ++ ++ -o Like -to. (Some other implementations have -o like -to, ++ others like -td. We chose one arbitrarily.) ++ ++ --encoding={s,S,b,l,B,L} ++ -e {s,S,b,l,B,L} ++ Select character encoding: 7-bit-character, 8-bit-character, ++ bigendian 16-bit, littleendian 16-bit, bigendian 32-bit, ++ littleendian 32-bit. ++ ++ --target=BFDNAME ++ -T {bfdname} ++ Specify a non-default object file format. ++ ++ --output-separator=sep_string ++ -s sep_string String used to separate parsed strings in output. ++ Default is newline. ++ ++ --help ++ -h Print the usage message on the standard output. ++ ++ --version ++ -V ++ -v Print the program version number. ++ ++ Written by Richard Stallman ++ and David MacKenzie . */ ++ ++#include "sysdep.h" ++#include "bfd.h" ++#include "getopt.h" ++#include "libiberty.h" ++#include "safe-ctype.h" ++#include "bucomm.h" ++ ++#define STRING_ISGRAPHIC(c) \ ++ ( (c) >= 0 \ ++ && (c) <= 255 \ ++ && ((c) == '\t' || ISPRINT (c) || (encoding == 'S' && (c) > 127) \ ++ || (include_all_whitespace && ISSPACE (c))) \ ++ ) ++ ++#ifndef errno ++extern int errno; ++#endif ++ ++/* The BFD section flags that identify an initialized data section. */ ++#define DATA_FLAGS (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS) ++ ++/* Radix for printing addresses (must be 8, 10 or 16). */ ++static int address_radix; ++ ++/* Minimum length of sequence of graphic chars to trigger output. */ ++static int string_min; ++ ++/* Whether or not we include all whitespace as a graphic char. */ ++static bfd_boolean include_all_whitespace; ++ ++/* TRUE means print address within file for each string. */ ++static bfd_boolean print_addresses; ++ ++/* TRUE means print filename for each string. */ ++static bfd_boolean print_filenames; ++ ++/* TRUE means for object files scan only the data section. */ ++static bfd_boolean datasection_only; ++ ++/* The BFD object file format. */ ++static char *target; ++ ++/* The character encoding format. */ ++static char encoding; ++static int encoding_bytes; ++ ++/* Output string used to separate parsed strings */ ++static char *output_separator; ++ ++static struct option long_options[] = ++{ ++ {"all", no_argument, NULL, 'a'}, ++ {"data", no_argument, NULL, 'd'}, ++ {"print-file-name", no_argument, NULL, 'f'}, ++ {"bytes", required_argument, NULL, 'n'}, ++ {"radix", required_argument, NULL, 't'}, ++ {"include-all-whitespace", no_argument, NULL, 'w'}, ++ {"encoding", required_argument, NULL, 'e'}, ++ {"target", required_argument, NULL, 'T'}, ++ {"output-separator", required_argument, NULL, 's'}, ++ {"help", no_argument, NULL, 'h'}, ++ {"version", no_argument, NULL, 'v'}, ++ {NULL, 0, NULL, 0} ++}; ++ ++static bfd_boolean strings_file (char *); ++static void print_strings (const char *, FILE *, file_ptr, int, int, char *); ++static void usage (FILE *, int) ATTRIBUTE_NORETURN; ++ ++int main (int, char **); ++ ++int ++main (int argc, char **argv) ++{ ++ int optc; ++ int exit_status = 0; ++ bfd_boolean files_given = FALSE; ++ char *s; ++ int numeric_opt = 0; ++ ++#if defined (HAVE_SETLOCALE) ++ setlocale (LC_ALL, ""); ++#endif ++ bindtextdomain (PACKAGE, LOCALEDIR); ++ textdomain (PACKAGE); ++ ++ program_name = argv[0]; ++ xmalloc_set_program_name (program_name); ++ bfd_set_error_program_name (program_name); ++ ++ expandargv (&argc, &argv); ++ ++ string_min = 4; ++ include_all_whitespace = FALSE; ++ print_addresses = FALSE; ++ print_filenames = FALSE; ++ if (DEFAULT_STRINGS_ALL) ++ datasection_only = FALSE; ++ else ++ datasection_only = TRUE; ++ target = NULL; ++ encoding = 's'; ++ output_separator = NULL; ++ ++ while ((optc = getopt_long (argc, argv, "adfhHn:wot:e:T:s:Vv0123456789", ++ long_options, (int *) 0)) != EOF) ++ { ++ switch (optc) ++ { ++ case 'a': ++ datasection_only = FALSE; ++ break; ++ ++ case 'd': ++ datasection_only = TRUE; ++ break; ++ ++ case 'f': ++ print_filenames = TRUE; ++ break; ++ ++ case 'H': ++ case 'h': ++ usage (stdout, 0); ++ ++ case 'n': ++ string_min = (int) strtoul (optarg, &s, 0); ++ if (s != NULL && *s != 0) ++ fatal (_("invalid integer argument %s"), optarg); ++ break; ++ ++ case 'w': ++ include_all_whitespace = TRUE; ++ break; ++ ++ case 'o': ++ print_addresses = TRUE; ++ address_radix = 8; ++ break; ++ ++ case 't': ++ print_addresses = TRUE; ++ if (optarg[1] != '\0') ++ usage (stderr, 1); ++ switch (optarg[0]) ++ { ++ case 'o': ++ address_radix = 8; ++ break; ++ ++ case 'd': ++ address_radix = 10; ++ break; ++ ++ case 'x': ++ address_radix = 16; ++ break; ++ ++ default: ++ usage (stderr, 1); ++ } ++ break; ++ ++ case 'T': ++ target = optarg; ++ break; ++ ++ case 'e': ++ if (optarg[1] != '\0') ++ usage (stderr, 1); ++ encoding = optarg[0]; ++ break; ++ ++ case 's': ++ output_separator = optarg; ++ break; ++ ++ case 'V': ++ case 'v': ++ print_version ("strings"); ++ break; ++ ++ case '?': ++ usage (stderr, 1); ++ ++ default: ++ numeric_opt = optind; ++ break; ++ } ++ } ++ ++ if (numeric_opt != 0) ++ { ++ string_min = (int) strtoul (argv[numeric_opt - 1] + 1, &s, 0); ++ if (s != NULL && *s != 0) ++ fatal (_("invalid integer argument %s"), argv[numeric_opt - 1] + 1); ++ } ++ if (string_min < 1) ++ fatal (_("invalid minimum string length %d"), string_min); ++ ++ switch (encoding) ++ { ++ case 'S': ++ case 's': ++ encoding_bytes = 1; ++ break; ++ case 'b': ++ case 'l': ++ encoding_bytes = 2; ++ break; ++ case 'B': ++ case 'L': ++ encoding_bytes = 4; ++ break; ++ default: ++ usage (stderr, 1); ++ } ++ ++ if (bfd_init () != BFD_INIT_MAGIC) ++ fatal (_("fatal error: libbfd ABI mismatch")); ++ set_default_bfd_target (); ++ ++ if (optind >= argc) ++ { ++ datasection_only = FALSE; ++ SET_BINARY (fileno (stdin)); ++ print_strings ("{standard input}", stdin, 0, 0, 0, (char *) NULL); ++ files_given = TRUE; ++ } ++ else ++ { ++ for (; optind < argc; ++optind) ++ { ++ if (strcmp (argv[optind], "-") == 0) ++ datasection_only = FALSE; ++ else ++ { ++ files_given = TRUE; ++ exit_status |= !strings_file (argv[optind]); ++ } ++ } ++ } ++ ++ if (!files_given) ++ usage (stderr, 1); ++ ++ return (exit_status); ++} ++ ++/* Scan section SECT of the file ABFD, whose printable name is ++ FILENAME. If it contains initialized data set GOT_A_SECTION and ++ print the strings in it. */ ++ ++static void ++strings_a_section (bfd *abfd, asection *sect, const char *filename, ++ bfd_boolean *got_a_section) ++{ ++ bfd_size_type sectsize; ++ bfd_byte *mem; ++ ++ if ((sect->flags & DATA_FLAGS) != DATA_FLAGS) ++ return; ++ ++ sectsize = bfd_section_size (sect); ++ if (sectsize == 0) ++ return; ++ ++ if (!bfd_malloc_and_get_section (abfd, sect, &mem)) ++ { ++ non_fatal (_("%s: Reading section %s failed: %s"), ++ filename, sect->name, bfd_errmsg (bfd_get_error ())); ++ return; ++ } ++ ++ *got_a_section = TRUE; ++ print_strings (filename, NULL, sect->filepos, 0, sectsize, (char *) mem); ++ free (mem); ++} ++ ++/* Scan all of the sections in FILE, and print the strings ++ in the initialized data section(s). ++ ++ Return TRUE if successful, ++ FALSE if not (such as if FILE is not an object file). */ ++ ++static bfd_boolean ++strings_object_file (const char *file) ++{ ++ bfd *abfd; ++ asection *s; ++ bfd_boolean got_a_section; ++ ++ abfd = bfd_openr (file, target); ++ ++ if (abfd == NULL) ++ /* Treat the file as a non-object file. */ ++ return FALSE; ++ ++ /* This call is mainly for its side effect of reading in the sections. ++ We follow the traditional behavior of `strings' in that we don't ++ complain if we don't recognize a file to be an object file. */ ++ if (!bfd_check_format (abfd, bfd_object)) ++ { ++ bfd_close (abfd); ++ return FALSE; ++ } ++ ++ got_a_section = FALSE; ++ for (s = abfd->sections; s != NULL; s = s->next) ++ strings_a_section (abfd, s, file, &got_a_section); ++ ++ if (!bfd_close (abfd)) ++ { ++ bfd_nonfatal (file); ++ return FALSE; ++ } ++ ++ return got_a_section; ++} ++ ++/* Print the strings in FILE. Return TRUE if ok, FALSE if an error occurs. */ ++ ++static bfd_boolean ++strings_file (char *file) ++{ ++ struct stat st; ++ ++ /* get_file_size does not support non-S_ISREG files. */ ++ ++ if (stat (file, &st) < 0) ++ { ++ if (errno == ENOENT) ++ non_fatal (_("'%s': No such file"), file); ++ else ++ non_fatal (_("Warning: could not locate '%s'. reason: %s"), ++ file, strerror (errno)); ++ return FALSE; ++ } ++ else if (S_ISDIR (st.st_mode)) ++ { ++ non_fatal (_("Warning: '%s' is a directory"), file); ++ return FALSE; ++ } ++ ++ /* If we weren't told to scan the whole file, ++ try to open it as an object file and only look at ++ initialized data sections. If that fails, fall back to the ++ whole file. */ ++ if (!datasection_only || !strings_object_file (file)) ++ { ++ FILE *stream; ++ ++ stream = fopen (file, FOPEN_RB); ++ if (stream == NULL) ++ { ++ fprintf (stderr, "%s: ", program_name); ++ perror (file); ++ return FALSE; ++ } ++ ++ print_strings (file, stream, (file_ptr) 0, 0, 0, (char *) 0); ++ ++ if (fclose (stream) == EOF) ++ { ++ fprintf (stderr, "%s: ", program_name); ++ perror (file); ++ return FALSE; ++ } ++ } ++ ++ return TRUE; ++} ++ ++/* Read the next character, return EOF if none available. ++ Assume that STREAM is positioned so that the next byte read ++ is at address ADDRESS in the file. ++ ++ If STREAM is NULL, do not read from it. ++ The caller can supply a buffer of characters ++ to be processed before the data in STREAM. ++ MAGIC is the address of the buffer and ++ MAGICCOUNT is how many characters are in it. */ ++ ++static long ++get_char (FILE *stream, file_ptr *address, int *magiccount, char **magic) ++{ ++ int c, i; ++ long r = 0; ++ ++ for (i = 0; i < encoding_bytes; i++) ++ { ++ if (*magiccount) ++ { ++ (*magiccount)--; ++ c = *(*magic)++; ++ } ++ else ++ { ++ if (stream == NULL) ++ return EOF; ++ ++ /* Only use getc_unlocked if we found a declaration for it. ++ Otherwise, libc is not thread safe by default, and we ++ should not use it. */ ++ ++#if defined(HAVE_GETC_UNLOCKED) && HAVE_DECL_GETC_UNLOCKED ++ c = getc_unlocked (stream); ++#else ++ c = getc (stream); ++#endif ++ if (c == EOF) ++ return EOF; ++ } ++ ++ (*address)++; ++ r = (r << 8) | (c & 0xff); ++ } ++ ++ switch (encoding) ++ { ++ default: ++ break; ++ case 'l': ++ r = ((r & 0xff) << 8) | ((r & 0xff00) >> 8); ++ break; ++ case 'L': ++ r = (((r & 0xff) << 24) | ((r & 0xff00) << 8) ++ | ((r & 0xff0000) >> 8) | ((r & 0xff000000) >> 24)); ++ break; ++ } ++ ++ return r; ++} ++ ++/* Throw away one byte of a (possibly) multi-byte char C, updating ++ address and buffer to suit. */ ++ ++static void ++unget_part_char (long c, file_ptr *address, int *magiccount, char **magic) ++{ ++ static char tmp[4]; ++ ++ if (encoding_bytes > 1) ++ { ++ *address -= encoding_bytes - 1; ++ ++ if (*magiccount == 0) ++ { ++ /* If no magic buffer exists, use temp buffer. */ ++ switch (encoding) ++ { ++ default: ++ break; ++ case 'b': ++ tmp[0] = c & 0xff; ++ *magiccount = 1; ++ break; ++ case 'l': ++ tmp[0] = (c >> 8) & 0xff; ++ *magiccount = 1; ++ break; ++ case 'B': ++ tmp[0] = (c >> 16) & 0xff; ++ tmp[1] = (c >> 8) & 0xff; ++ tmp[2] = c & 0xff; ++ *magiccount = 3; ++ break; ++ case 'L': ++ tmp[0] = (c >> 8) & 0xff; ++ tmp[1] = (c >> 16) & 0xff; ++ tmp[2] = (c >> 24) & 0xff; ++ *magiccount = 3; ++ break; ++ } ++ *magic = tmp; ++ } ++ else ++ { ++ /* If magic buffer exists, rewind. */ ++ *magic -= encoding_bytes - 1; ++ *magiccount += encoding_bytes - 1; ++ } ++ } ++} ++ ++/* Find the strings in file FILENAME, read from STREAM. ++ Assume that STREAM is positioned so that the next byte read ++ is at address ADDRESS in the file. ++ Stop reading at address STOP_POINT in the file, if nonzero. ++ ++ If STREAM is NULL, do not read from it. ++ The caller can supply a buffer of characters ++ to be processed before the data in STREAM. ++ MAGIC is the address of the buffer and ++ MAGICCOUNT is how many characters are in it. ++ Those characters come at address ADDRESS and the data in STREAM follow. */ ++ ++static void ++print_strings (const char *filename, FILE *stream, file_ptr address, ++ int stop_point, int magiccount, char *magic) ++{ ++ char *buf = (char *) xmalloc (sizeof (char) * (string_min + 1)); ++ ++ while (1) ++ { ++ file_ptr start; ++ int i; ++ long c; ++ ++ /* See if the next `string_min' chars are all graphic chars. */ ++ tryline: ++ if (stop_point && address >= stop_point) ++ break; ++ start = address; ++ for (i = 0; i < string_min; i++) ++ { ++ c = get_char (stream, &address, &magiccount, &magic); ++ if (c == EOF) ++ { ++ free (buf); ++ return; ++ } ++ ++ if (! STRING_ISGRAPHIC (c)) ++ { ++ /* Found a non-graphic. Try again starting with next byte. */ ++ unget_part_char (c, &address, &magiccount, &magic); ++ goto tryline; ++ } ++ buf[i] = c; ++ } ++ ++ /* We found a run of `string_min' graphic characters. Print up ++ to the next non-graphic character. */ ++ ++ if (print_filenames) ++ printf ("%s: ", filename); ++ if (print_addresses) ++ switch (address_radix) ++ { ++ case 8: ++#ifdef HAVE_LONG_LONG ++ if (sizeof (start) > sizeof (long)) ++ { ++# ifndef __MSVCRT__ ++ printf ("%7llo ", (unsigned long long) start); ++# else ++ printf ("%7I64o ", (unsigned long long) start); ++# endif ++ } ++ else ++#elif !BFD_HOST_64BIT_LONG ++ if (start != (unsigned long) start) ++ printf ("++%7lo ", (unsigned long) start); ++ else ++#endif ++ printf ("%7lo ", (unsigned long) start); ++ break; ++ ++ case 10: ++#ifdef HAVE_LONG_LONG ++ if (sizeof (start) > sizeof (long)) ++ { ++# ifndef __MSVCRT__ ++ printf ("%7llu ", (unsigned long long) start); ++# else ++ printf ("%7I64d ", (unsigned long long) start); ++# endif ++ } ++ else ++#elif !BFD_HOST_64BIT_LONG ++ if (start != (unsigned long) start) ++ printf ("++%7lu ", (unsigned long) start); ++ else ++#endif ++ printf ("%7ld ", (long) start); ++ break; ++ ++ case 16: ++#ifdef HAVE_LONG_LONG ++ if (sizeof (start) > sizeof (long)) ++ { ++# ifndef __MSVCRT__ ++ printf ("%7llx ", (unsigned long long) start); ++# else ++ printf ("%7I64x ", (unsigned long long) start); ++# endif ++ } ++ else ++#elif !BFD_HOST_64BIT_LONG ++ if (start != (unsigned long) start) ++ printf ("%lx%8.8lx ", (unsigned long) (start >> 32), ++ (unsigned long) (start & 0xffffffff)); ++ else ++#endif ++ printf ("%7lx ", (unsigned long) start); ++ break; ++ } ++ ++ buf[i] = '\0'; ++ fputs (buf, stdout); ++ ++ while (1) ++ { ++ c = get_char (stream, &address, &magiccount, &magic); ++ if (c == EOF) ++ break; ++ if (! STRING_ISGRAPHIC (c)) ++ { ++ unget_part_char (c, &address, &magiccount, &magic); ++ break; ++ } ++ putchar (c); ++ } ++ ++ if (output_separator) ++ fputs (output_separator, stdout); ++ else ++ putchar ('\n'); ++ } ++ free (buf); ++} ++ ++static void ++usage (FILE *stream, int status) ++{ ++ fprintf (stream, _("Usage: %s [option(s)] [file(s)]\n"), program_name); ++ fprintf (stream, _(" Display printable strings in [file(s)] (stdin by default)\n")); ++ fprintf (stream, _(" The options are:\n")); ++ ++ if (DEFAULT_STRINGS_ALL) ++ fprintf (stream, _("\ ++ -a - --all Scan the entire file, not just the data section [default]\n\ ++ -d --data Only scan the data sections in the file\n")); ++ else ++ fprintf (stream, _("\ ++ -a - --all Scan the entire file, not just the data section\n\ ++ -d --data Only scan the data sections in the file [default]\n")); ++ ++ fprintf (stream, _("\ ++ -f --print-file-name Print the name of the file before each string\n\ ++ -n --bytes=[number] Locate & print any NUL-terminated sequence of at\n\ ++ - least [number] characters (default 4).\n\ ++ -t --radix={o,d,x} Print the location of the string in base 8, 10 or 16\n\ ++ -w --include-all-whitespace Include all whitespace as valid string characters\n\ ++ -o An alias for --radix=o\n\ ++ -T --target= Specify the binary file format\n\ ++ -e --encoding={s,S,b,l,B,L} Select character size and endianness:\n\ ++ s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit\n\ ++ -s --output-separator= String used to separate strings in output.\n\ ++ @ Read options from \n\ ++ -h --help Display this information\n\ ++ -v -V --version Print the program's version number\n")); ++ list_supported_targets (program_name, stream); ++ if (REPORT_BUGS_TO[0] && status == 0) ++ fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); ++ exit (status); ++} +diff -rupN binutils.orig/binutils/strings.c.rej binutils-2.35.2/binutils/strings.c.rej +--- binutils.orig/binutils/strings.c.rej 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/strings.c.rej 2021-11-09 16:53:53.301859462 +0000 +@@ -0,0 +1,110 @@ ++--- binutils/strings.c 2021-11-09 12:34:21.663802935 +0000 +++++ binutils/strings.c 2021-11-09 12:34:46.293643851 +0000 ++@@ -150,21 +179,22 @@ static char *output_separator; ++ static struct option long_options[] = ++ { ++ {"all", no_argument, NULL, 'a'}, +++ {"bytes", required_argument, NULL, 'n'}, ++ {"data", no_argument, NULL, 'd'}, +++ {"encoding", required_argument, NULL, 'e'}, +++ {"help", no_argument, NULL, 'h'}, +++ {"include-all-whitespace", no_argument, NULL, 'w'}, +++ {"output-separator", required_argument, NULL, 's'}, ++ {"print-file-name", no_argument, NULL, 'f'}, ++- {"bytes", required_argument, NULL, 'n'}, ++ {"radix", required_argument, NULL, 't'}, ++- {"include-all-whitespace", no_argument, NULL, 'w'}, ++- {"encoding", required_argument, NULL, 'e'}, ++ {"target", required_argument, NULL, 'T'}, ++- {"output-separator", required_argument, NULL, 's'}, ++- {"help", no_argument, NULL, 'h'}, +++ {"unicode", required_argument, NULL, 'U'}, ++ {"version", no_argument, NULL, 'v'}, ++ {NULL, 0, NULL, 0} ++ }; ++ ++ static bool strings_file (char *); ++-static void print_strings (const char *, FILE *, file_ptr, int, int, char *); +++static void print_strings (const char *, FILE *, file_ptr, int, char *); ++ static void usage (FILE *, int) ATTRIBUTE_NORETURN; ++ ++ int main (int, char **); ++@@ -342,14 +392,14 @@ main (int argc, char **argv) ++ { ++ datasection_only = false; ++ SET_BINARY (fileno (stdin)); ++- print_strings ("{standard input}", stdin, 0, 0, 0, (char *) NULL); +++ print_strings ("{standard input}", stdin, 0, 0, (char *) NULL); ++ files_given = true; ++ } ++ else ++ { ++ for (; optind < argc; ++optind) ++ { ++- if (strcmp (argv[optind], "-") == 0) +++ if (streq (argv[optind], "-")) ++ datasection_only = false; ++ else ++ { ++@@ -391,7 +441,7 @@ strings_a_section (bfd *abfd, asection * ++ } ++ ++ *got_a_section = true; ++- print_strings (filename, NULL, sect->filepos, 0, sectsize, (char *) mem); +++ print_strings (filename, NULL, sect->filepos, sectsize, (char *) mem); ++ free (mem); ++ } ++ ++@@ -1275,51 +1950,7 @@ print_strings (const char *filename, FIL ++ ++ /* We found a run of `string_min' graphic characters. Print up ++ to the next non-graphic character. */ ++- ++- if (print_filenames) ++- printf ("%s: ", filename); ++- if (print_addresses) ++- switch (address_radix) ++- { ++- case 8: ++- if (sizeof (start) > sizeof (long)) ++- { ++-#ifndef __MSVCRT__ ++- printf ("%7llo ", (unsigned long long) start); ++-#else ++- printf ("%7I64o ", (unsigned long long) start); ++-#endif ++- } ++- else ++- printf ("%7lo ", (unsigned long) start); ++- break; ++- ++- case 10: ++- if (sizeof (start) > sizeof (long)) ++- { ++-#ifndef __MSVCRT__ ++- printf ("%7llu ", (unsigned long long) start); ++-#else ++- printf ("%7I64d ", (unsigned long long) start); ++-#endif ++- } ++- else ++- printf ("%7ld ", (long) start); ++- break; ++- ++- case 16: ++- if (sizeof (start) > sizeof (long)) ++- { ++-#ifndef __MSVCRT__ ++- printf ("%7llx ", (unsigned long long) start); ++-#else ++- printf ("%7I64x ", (unsigned long long) start); ++-#endif ++- } ++- else ++- printf ("%7lx ", (unsigned long) start); ++- break; ++- } +++ print_filename_and_address (filename, start); ++ ++ buf[i] = '\0'; ++ fputs (buf, stdout); +diff -rupN binutils.orig/binutils/testsuite/binutils-all/nm.hex.unicode binutils-2.35.2/binutils/testsuite/binutils-all/nm.hex.unicode +--- binutils.orig/binutils/testsuite/binutils-all/nm.hex.unicode 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/testsuite/binutils-all/nm.hex.unicode 2021-11-09 16:53:53.301859462 +0000 +@@ -0,0 +1,3 @@ ++#... ++.*he<0xe280ae>oll<0xe280ac> ++#pass +diff -rupN binutils.orig/binutils/testsuite/binutils-all/objdump.highlight.unicode binutils-2.35.2/binutils/testsuite/binutils-all/objdump.highlight.unicode +--- binutils.orig/binutils/testsuite/binutils-all/objdump.highlight.unicode 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/testsuite/binutils-all/objdump.highlight.unicode 2021-11-09 16:53:53.301859462 +0000 +@@ -0,0 +1,3 @@ ++#... ++.*he\\u202eoll\\u202c ++#pass +diff -rupN binutils.orig/binutils/testsuite/binutils-all/readelf.invalid.unicode binutils-2.35.2/binutils/testsuite/binutils-all/readelf.invalid.unicode +--- binutils.orig/binutils/testsuite/binutils-all/readelf.invalid.unicode 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/testsuite/binutils-all/readelf.invalid.unicode 2021-11-09 16:53:53.302859456 +0000 +@@ -0,0 +1,3 @@ ++#... ++.*he\{0xe280ae\}oll\{0xe280ac\} ++#pass +diff -rupN binutils.orig/binutils/testsuite/binutils-all/strings.escape.unicode binutils-2.35.2/binutils/testsuite/binutils-all/strings.escape.unicode +--- binutils.orig/binutils/testsuite/binutils-all/strings.escape.unicode 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/testsuite/binutils-all/strings.escape.unicode 2021-11-09 16:53:53.302859456 +0000 +@@ -0,0 +1,3 @@ ++#... ++he\\u202eoll\\u202c ++#pass +diff -rupN binutils.orig/binutils/testsuite/binutils-all/trick-hello.s binutils-2.35.2/binutils/testsuite/binutils-all/trick-hello.s +--- binutils.orig/binutils/testsuite/binutils-all/trick-hello.s 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/testsuite/binutils-all/trick-hello.s 2021-11-09 16:53:53.302859456 +0000 +@@ -0,0 +1,33 @@ ++ .file "trick-hello.c" ++ .text ++ .section .rodata ++.LC0: ++ .string "hah, gotcha!" ++ .text ++ .globl he‮oll‬ ++ .type he‮oll‬, %function ++he‮oll‬: ++.LFB0: ++ nop ++.LFE0: ++ .size he‮oll‬, .-he‮oll‬ ++ .section .rodata ++.LC1: ++ .string "Hello world" ++ .text ++ .globl hello ++ .type hello, %function ++hello: ++.LFB1: ++ nop ++.LFE1: ++ .size hello, .-hello ++ .globl main ++ .type main, %function ++main: ++.LFB2: ++ nop ++.LFE2: ++ .size main, .-main ++ .ident "GCC: (GNU) 11.2.1 20210728 (Red Hat 11.2.1-1)" ++ +diff -rupN binutils.orig/binutils/testsuite/binutils-all/unicode.exp binutils-2.35.2/binutils/testsuite/binutils-all/unicode.exp +--- binutils.orig/binutils/testsuite/binutils-all/unicode.exp 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.35.2/binutils/testsuite/binutils-all/unicode.exp 2021-11-09 16:53:53.303859449 +0000 +@@ -0,0 +1,71 @@ ++# Copyright (C) 2021 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. ++ ++# Written by Nick Clifton ++ ++proc unicode_test { program options binary_file regexp_file } { ++ ++ global srcdir ++ global subdir ++ ++ set testname "unicode $program $options [file rootname [file tail $binary_file]]" ++ ++ send_log "exec $program $options $binary_file > prog.out\n" ++ set got [remote_exec host "$program $options $binary_file" "" "/dev/null" "prog.out"] ++ ++ if { [lindex $got 0] != 0 } then { ++ fail "$testname (reason: execution failed)" ++ send_log $got ++ send_log "\n" ++ return ++ } ++ ++ if { ![string match "" [lindex $got 1]] } then { ++ fail "$testname (reason: error output)" ++ send_log $got ++ send_log "\n" ++ return ++ } ++ ++ if { [regexp_diff prog.out $srcdir/$subdir/$regexp_file] } then { ++ send_log [file_contents prog.out] ++ send_log "\n" ++ fail $testname ++ return ++ } ++ ++ pass $testname ++} ++ ++# Assemble the test file. ++if {![binutils_assemble $srcdir/$subdir/trick-hello.s tmpdir/trick-hello.o]} then { ++ unsupported "unicode tests (failed to assemble test file)" ++} else { ++ if ![is_remote host] { ++ set tempfile tmpdir/trick-hello.o ++ } else { ++ set tempfile [remote_download host tmpdir/trick-hello.o] ++ } ++ ++ global NM STRINGS OBJDUMP READELF ++ unicode_test $NM {--unicode=hex} $tempfile nm.hex.unicode ++ unicode_test $STRINGS {--unicode=escape} $tempfile strings.escape.unicode ++ unicode_test $OBJDUMP {-tUh} $tempfile objdump.highlight.unicode ++ ++ if [is_elf_format] { ++ unicode_test $READELF {-sUi} $tempfile readelf.invalid.unicode ++ } ++} diff --git a/patches/binutils/branch-updates.diff b/patches/binutils/branch-updates.diff dissimilarity index 98% index de257a8f..c1946a6d 100644 --- a/patches/binutils/branch-updates.diff +++ b/patches/binutils/branch-updates.diff @@ -1,2647 +1,62 @@ -diff --git a/ChangeLog b/ChangeLog -index 8420c77ff49..1a00154ef51 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,12 @@ -+2021-03-18 Nick Alcock -+ -+ PR libctf/27482 -+ * Makefile.def: Add install-bfd dependencies for install-libctf and -+ install-ld, and install-strip-bfd dependencies for -+ install-strip-libctf and install-strip-ld; move the install-ld -+ dependency on install-libctf to join it. -+ * Makefile.in: Regenerated. -+ - 2021-01-26 Nick Alcock - - * Makefile.def: Add install-libctf dependency to install-ld. -diff --git a/Makefile.def b/Makefile.def -index b45e580da5b..eb15489390e 100644 ---- a/Makefile.def -+++ b/Makefile.def -@@ -448,7 +448,6 @@ dependencies = { module=all-binutils; on=all-intl; }; - dependencies = { module=all-binutils; on=all-gas; }; - dependencies = { module=all-binutils; on=all-libctf; }; - dependencies = { module=all-ld; on=all-libctf; }; --dependencies = { module=install-ld; on=install-libctf; }; - - // We put install-opcodes before install-binutils because the installed - // binutils might be on PATH, and they might need the shared opcodes -@@ -456,6 +455,14 @@ dependencies = { module=install-ld; on=install-libctf; }; - dependencies = { module=install-binutils; on=install-opcodes; }; - dependencies = { module=install-strip-binutils; on=install-strip-opcodes; }; - -+// Likewise for ld, libctf, and bfd. -+dependencies = { module=install-libctf; on=install-bfd; }; -+dependencies = { module=install-ld; on=install-bfd; }; -+dependencies = { module=install-ld; on=install-libctf; }; -+dependencies = { module=install-strip-libctf; on=install-strip-bfd; }; -+dependencies = { module=install-strip-ld; on=install-strip-bfd; }; -+dependencies = { module=install-strip-ld; on=install-strip-libctf; }; -+ - // libopcodes depends on libbfd - dependencies = { module=install-opcodes; on=install-bfd; }; - dependencies = { module=install-strip-opcodes; on=install-strip-bfd; }; -diff --git a/Makefile.in b/Makefile.in -index c2c852c5660..a63050cd3e6 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -52111,9 +52111,14 @@ all-stage3-ld: maybe-all-stage3-libctf - all-stage4-ld: maybe-all-stage4-libctf - all-stageprofile-ld: maybe-all-stageprofile-libctf - all-stagefeedback-ld: maybe-all-stagefeedback-libctf --install-ld: maybe-install-libctf - install-binutils: maybe-install-opcodes - install-strip-binutils: maybe-install-strip-opcodes -+install-libctf: maybe-install-bfd -+install-ld: maybe-install-bfd -+install-ld: maybe-install-libctf -+install-strip-libctf: maybe-install-strip-bfd -+install-strip-ld: maybe-install-strip-bfd -+install-strip-ld: maybe-install-strip-libctf - install-opcodes: maybe-install-bfd - install-strip-opcodes: maybe-install-strip-bfd - configure-gas: maybe-configure-intl -diff --git a/bfd/ChangeLog b/bfd/ChangeLog -index 0c4631e15e6..0b035fbc3ae 100644 ---- a/bfd/ChangeLog -+++ b/bfd/ChangeLog -@@ -1,3 +1,61 @@ -+2021-07-09 Nick Clifton -+ -+ Backport from mainline: -+ -+ 2021-06-08 Michael Matz -+ -+ PR 28058 -+ * elf.c (bfd_section_from_shdr): Set has_secondary_relocs flag. -+ (_bfd_elf_slurp_secondary_reloc_section): Use it for early-out. -+ -+2021-07-09 Nick Clifton -+ -+ Backport this patch from the mainline: -+ 2021-03-02 Nick Clifton -+ -+ PR 27484 -+ * dwarf2.c (scan_unit_for_symbols): Scan twice, once to accumulate -+ function and variable tags and a second time to resolve their -+ attributes. -+ -+2021-05-03 Alan Modra -+ -+ PR 27755 -+ * elf32-ppc.c (ppc_elf_inline_plt): Do increment rel in loop. -+ -+2021-04-23 Eric Botcazou -+ -+ * elf.c (special_sections_p): Add .persistent.bss. -+ -+2021-04-01 Tamar Christina -+ -+ Backported from mainline. -+ 2021-04-01 Tamar Christina -+ -+ PR ld/26659 -+ * cofflink.c (_bfd_coff_generic_relocate_section): Ignore overflow. -+ -+2021-03-22 H.J. Lu -+ -+ PR ld/27587 -+ * dwarf2.c (read_attribute_value): Check version >= 3 for -+ DW_FORM_ref_addr. -+ -+2021-03-02 Alan Modra -+ -+ * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimise got -+ indirect to pc-relative or toc-relative for undefined symbols. -+ -+2021-03-01 Alan Modra -+ -+ Apply from mainline -+ 2021-02-25 Alan Modra -+ PR 27441 -+ * elf-bfd.h (struct elf_link_hash_entry): Add ref_ir_nonweak. -+ * elflink.c (elf_link_add_object_symbols): Set ref_ir_nonweak and -+ use when deciding an as-needed library should be loaded instead -+ of using the binding of the library definition. -+ - 2021-02-06 Nick Clifton - - (development): Set to true. -diff --git a/bfd/cofflink.c b/bfd/cofflink.c -index 4b0aab2a4ce..d0c027f2dce 100644 ---- a/bfd/cofflink.c -+++ b/bfd/cofflink.c -@@ -3118,6 +3118,21 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd, - return FALSE; - case bfd_reloc_overflow: - { -+ -+ /* Ignore any weak undef symbols that may have overflowed. Due to -+ PR ld/19011 the base address is now in the upper 64-bit address -+ range. This means that when _bfd_final_link_relocate calculates -+ the overlow it takes the distance between the symbol and the VMA -+ which will now always overflow as 0 - 64-bit addr > 32-bit range -+ of the relocation. This ends up creating PR ld/26659. */ -+ if (val == 0 -+ /* Reverse the hack where 4 is subtracted from the addend. */ -+ && (addend + 4) == 0 -+ && sym->n_sclass == C_NT_WEAK -+ && bfd_coff_classify_symbol (output_bfd, sym) -+ == COFF_SYMBOL_UNDEFINED) -+ break; -+ - const char *name; - char buf[SYMNMLEN + 1]; - -diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c -index 240138d5982..02618154a21 100644 ---- a/bfd/dwarf2.c -+++ b/bfd/dwarf2.c -@@ -1195,7 +1195,7 @@ read_attribute_value (struct attribute * attr, - case DW_FORM_ref_addr: - /* DW_FORM_ref_addr is an address in DWARF2, and an offset in - DWARF3. */ -- if (unit->version == 3 || unit->version == 4) -+ if (unit->version >= 3) - { - if (unit->offset_size == 4) - attr->u.val = read_4_bytes (unit->abfd, info_ptr, info_ptr_end); -@@ -1484,6 +1484,8 @@ struct funcinfo - struct arange arange; - /* Where the symbol is defined. */ - asection * sec; -+ /* The offset of the funcinfo from the start of the unit. */ -+ bfd_uint64_t unit_offset; - }; - - struct lookup_funcinfo -@@ -3304,6 +3306,15 @@ read_rangelist (struct comp_unit *unit, struct arange *arange, - return read_rnglists (unit, arange, offset); - } - -+static struct funcinfo * -+lookup_func_by_offset (bfd_uint64_t offset, struct funcinfo * table) -+{ -+ for (; table != NULL; table = table->prev_func) -+ if (table->unit_offset == offset) -+ return table; -+ return NULL; -+} -+ - static struct varinfo * - lookup_var_by_offset (bfd_uint64_t offset, struct varinfo * table) - { -@@ -3317,7 +3328,6 @@ lookup_var_by_offset (bfd_uint64_t offset, struct varinfo * table) - return NULL; - } - -- - /* DWARF2 Compilation unit functions. */ - - /* Scan over each die in a comp. unit looking for functions to add -@@ -3330,7 +3340,8 @@ scan_unit_for_symbols (struct comp_unit *unit) - bfd_byte *info_ptr = unit->first_child_die_ptr; - bfd_byte *info_ptr_end = unit->end_ptr; - int nesting_level = 0; -- struct nest_funcinfo { -+ struct nest_funcinfo -+ { - struct funcinfo *func; - } *nested_funcs; - int nested_funcs_size; -@@ -3344,16 +3355,16 @@ scan_unit_for_symbols (struct comp_unit *unit) - return FALSE; - nested_funcs[nesting_level].func = 0; - -+ /* PR 27484: We must scan the DIEs twice. The first time we look for -+ function and variable tags and accumulate them into their respective -+ tables. The second time through we process the attributes of the -+ functions/variables and augment the table entries. */ - while (nesting_level >= 0) - { - unsigned int abbrev_number, bytes_read, i; - struct abbrev_info *abbrev; -- struct attribute attr; - struct funcinfo *func; - struct varinfo *var; -- bfd_vma low_pc = 0; -- bfd_vma high_pc = 0; -- bfd_boolean high_pc_relative = FALSE; - bfd_uint64_t current_offset; - - /* PR 17512: file: 9f405d9d. */ -@@ -3365,7 +3376,7 @@ scan_unit_for_symbols (struct comp_unit *unit) - FALSE, info_ptr_end); - info_ptr += bytes_read; - -- if (! abbrev_number) -+ if (abbrev_number == 0) - { - nesting_level--; - continue; -@@ -3400,6 +3411,7 @@ scan_unit_for_symbols (struct comp_unit *unit) - goto fail; - func->tag = abbrev->tag; - func->prev_func = unit->function_table; -+ func->unit_offset = current_offset; - unit->function_table = func; - unit->number_of_functions++; - BFD_ASSERT (!unit->cached); -@@ -3420,6 +3432,7 @@ scan_unit_for_symbols (struct comp_unit *unit) - || abbrev->tag == DW_TAG_member) - { - size_t amt = sizeof (struct varinfo); -+ - var = (struct varinfo *) bfd_zalloc (abfd, amt); - if (var == NULL) - goto fail; -@@ -3438,6 +3451,89 @@ scan_unit_for_symbols (struct comp_unit *unit) - nested_funcs[nesting_level].func = 0; - } - -+ for (i = 0; i < abbrev->num_attrs; ++i) -+ { -+ struct attribute attr; -+ -+ info_ptr = read_attribute (&attr, &abbrev->attrs[i], -+ unit, info_ptr, info_ptr_end); -+ if (info_ptr == NULL) -+ goto fail; -+ } -+ -+ if (abbrev->has_children) -+ { -+ nesting_level++; -+ -+ if (nesting_level >= nested_funcs_size) -+ { -+ struct nest_funcinfo *tmp; -+ -+ nested_funcs_size *= 2; -+ tmp = (struct nest_funcinfo *) -+ bfd_realloc (nested_funcs, -+ nested_funcs_size * sizeof (*nested_funcs)); -+ if (tmp == NULL) -+ goto fail; -+ nested_funcs = tmp; -+ } -+ nested_funcs[nesting_level].func = 0; -+ } -+ } -+ -+ /* This is the second pass over the abbrevs. */ -+ info_ptr = unit->first_child_die_ptr; -+ nesting_level = 0; -+ -+ while (nesting_level >= 0) -+ { -+ unsigned int abbrev_number, bytes_read, i; -+ struct abbrev_info *abbrev; -+ struct attribute attr; -+ struct funcinfo *func; -+ struct varinfo *var; -+ bfd_vma low_pc = 0; -+ bfd_vma high_pc = 0; -+ bfd_boolean high_pc_relative = FALSE; -+ bfd_uint64_t current_offset; -+ -+ /* PR 17512: file: 9f405d9d. */ -+ if (info_ptr >= info_ptr_end) -+ goto fail; -+ -+ current_offset = info_ptr - unit->info_ptr_unit; -+ abbrev_number = _bfd_safe_read_leb128 (abfd, info_ptr, &bytes_read, -+ FALSE, info_ptr_end); -+ info_ptr += bytes_read; -+ -+ if (! abbrev_number) -+ { -+ nesting_level--; -+ continue; -+ } -+ -+ abbrev = lookup_abbrev (abbrev_number, unit->abbrevs); -+ /* This should have been handled above. */ -+ BFD_ASSERT (abbrev != NULL); -+ -+ func = NULL; -+ var = NULL; -+ if (abbrev->tag == DW_TAG_subprogram -+ || abbrev->tag == DW_TAG_entry_point -+ || abbrev->tag == DW_TAG_inlined_subroutine) -+ { -+ func = lookup_func_by_offset (current_offset, unit->function_table); -+ if (func == NULL) -+ goto fail; -+ } -+ else if (abbrev->tag == DW_TAG_variable -+ || abbrev->tag == DW_TAG_member) -+ { -+ var = lookup_var_by_offset (current_offset, unit->variable_table); -+ if (var == NULL) -+ goto fail; -+ } -+ - for (i = 0; i < abbrev->num_attrs; ++i) - { - info_ptr = read_attribute (&attr, &abbrev->attrs[i], -@@ -3532,7 +3628,7 @@ scan_unit_for_symbols (struct comp_unit *unit) - { - _bfd_error_handler (_("DWARF error: could not find " - "variable specification " -- "at offset %lx"), -+ "at offset 0x%lx"), - (unsigned long) attr.u.val); - break; - } -@@ -3604,6 +3700,9 @@ scan_unit_for_symbols (struct comp_unit *unit) - } - } - -+ if (abbrev->has_children) -+ nesting_level++; -+ - if (high_pc_relative) - high_pc += low_pc; - -@@ -3612,25 +3711,6 @@ scan_unit_for_symbols (struct comp_unit *unit) - if (!arange_add (unit, &func->arange, low_pc, high_pc)) - goto fail; - } -- -- if (abbrev->has_children) -- { -- nesting_level++; -- -- if (nesting_level >= nested_funcs_size) -- { -- struct nest_funcinfo *tmp; -- -- nested_funcs_size *= 2; -- tmp = (struct nest_funcinfo *) -- bfd_realloc (nested_funcs, -- nested_funcs_size * sizeof (*nested_funcs)); -- if (tmp == NULL) -- goto fail; -- nested_funcs = tmp; -- } -- nested_funcs[nesting_level].func = 0; -- } - } - - free (nested_funcs); -diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h -index 15206b4e876..2cff9f055c5 100644 ---- a/bfd/elf-bfd.h -+++ b/bfd/elf-bfd.h -@@ -184,6 +184,8 @@ struct elf_link_hash_entry - /* Symbol has a non-weak reference from a non-shared object (other than - the object in which it is defined). */ - unsigned int ref_regular_nonweak : 1; -+ /* Symbol has a non-weak reference from a LTO IR object file. */ -+ unsigned int ref_ir_nonweak : 1; - /* Dynamic symbol has been adjustd. */ - unsigned int dynamic_adjusted : 1; - /* Symbol needs a copy reloc. */ -diff --git a/bfd/elf.c b/bfd/elf.c -index 84a5d942817..af62aadc3d4 100644 ---- a/bfd/elf.c -+++ b/bfd/elf.c -@@ -2454,6 +2454,8 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) - "for section %pA found - ignoring"), - abfd, name, target_sect); - } -+ else -+ esdt->has_secondary_relocs = TRUE; - goto success; - } - -@@ -2712,6 +2714,7 @@ static const struct bfd_elf_special_section special_sections_n[] = - - static const struct bfd_elf_special_section special_sections_p[] = - { -+ { STRING_COMMA_LEN (".persistent.bss"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, - { STRING_COMMA_LEN (".persistent"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { STRING_COMMA_LEN (".preinit_array"), -2, SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE }, - { STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, -@@ -12586,6 +12589,9 @@ _bfd_elf_slurp_secondary_reloc_section (bfd * abfd, - #endif - r_sym = elf32_r_sym; - -+ if (!elf_section_data (sec)->has_secondary_relocs) -+ return TRUE; -+ - /* Discover if there are any secondary reloc sections - associated with SEC. */ - for (relsec = abfd->sections; relsec != NULL; relsec = relsec->next) -diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c -index fd88f3d718e..d278a1ab8fa 100644 ---- a/bfd/elf32-ppc.c -+++ b/bfd/elf32-ppc.c -@@ -4245,7 +4245,7 @@ ppc_elf_inline_plt (struct bfd_link_info *info) - return FALSE; - - relend = relstart + sec->reloc_count; -- for (rel = relstart; rel < relend; ) -+ for (rel = relstart; rel < relend; rel++) - { - enum elf_ppc_reloc_type r_type; - unsigned long r_symndx; -diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c -index 3119aaca84c..77f2c855864 100644 ---- a/bfd/elf64-ppc.c -+++ b/bfd/elf64-ppc.c -@@ -16071,6 +16071,9 @@ ppc64_elf_relocate_section (bfd *output_bfd, - break; - from = TOCstart + htab->sec_info[input_section->id].toc_off; - if (relocation + addend - from + 0x8000 < 0x10000 -+ && sec != NULL -+ && sec->output_section != NULL -+ && !discarded_section (sec) - && (h == NULL || SYMBOL_REFERENCES_LOCAL (info, &h->elf))) - { - insn = bfd_get_32 (input_bfd, contents + (rel->r_offset & ~3)); -@@ -16091,6 +16094,9 @@ ppc64_elf_relocate_section (bfd *output_bfd, - break; - from = TOCstart + htab->sec_info[input_section->id].toc_off; - if (relocation + addend - from + 0x80008000ULL < 0x100000000ULL -+ && sec != NULL -+ && sec->output_section != NULL -+ && !discarded_section (sec) - && (h == NULL || SYMBOL_REFERENCES_LOCAL (info, &h->elf))) - { - insn = bfd_get_32 (input_bfd, contents + (rel->r_offset & ~3)); -@@ -16119,6 +16125,9 @@ ppc64_elf_relocate_section (bfd *output_bfd, - + input_section->output_section->vma - + input_section->output_offset); - if (!(relocation - from + (1ULL << 33) < 1ULL << 34 -+ && sec != NULL -+ && sec->output_section != NULL -+ && !discarded_section (sec) - && (h == NULL || SYMBOL_REFERENCES_LOCAL (info, &h->elf)))) - break; - -diff --git a/bfd/elflink.c b/bfd/elflink.c -index 7afbc5b1072..08f241d79a5 100644 ---- a/bfd/elflink.c -+++ b/bfd/elflink.c -@@ -5029,7 +5029,12 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) - - /* Plugin symbols aren't normal. Don't set def/ref flags. */ - if ((abfd->flags & BFD_PLUGIN) != 0) -- ; -+ { -+ /* Except for this flag to track nonweak references. */ -+ if (!definition -+ && bind != STB_WEAK) -+ h->ref_ir_nonweak = 1; -+ } - else if (!dynamic) - { - if (! definition) -@@ -5279,8 +5284,8 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) - && h->ref_regular_nonweak) - || (old_bfd != NULL - && (old_bfd->flags & BFD_PLUGIN) != 0 -- && !info->lto_all_symbols_read -- && bind != STB_WEAK) -+ && h->ref_ir_nonweak -+ && !info->lto_all_symbols_read) - || (h->ref_dynamic_nonweak - && (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0 - && !on_needed_list (elf_dt_name (abfd), -diff --git a/bfd/format.c b/bfd/format.c -index 43bb34135e9..54b63c2ca51 100644 ---- a/bfd/format.c -+++ b/bfd/format.c -@@ -151,6 +151,7 @@ bfd_reinit (bfd *abfd, unsigned int section_id, bfd_cleanup cleanup) - abfd->tdata.any = NULL; - abfd->arch_info = &bfd_default_arch_struct; - abfd->flags &= BFD_FLAGS_SAVED; -+ abfd->build_id = NULL; - bfd_section_list_clear (abfd); - } - -diff --git a/bfd/version.h b/bfd/version.h -index 765ce6c8596..9620cd5a9fe 100644 ---- a/bfd/version.h -+++ b/bfd/version.h -@@ -16,7 +16,7 @@ - - In releases, the date is not included in either version strings or - sonames. */ --#define BFD_VERSION_DATE 20210206 -+#define BFD_VERSION_DATE 20210703 - #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/ChangeLog b/binutils/ChangeLog -index 8b08bd0db79..11ff778cc35 100644 ---- a/binutils/ChangeLog -+++ b/binutils/ChangeLog -@@ -1,3 +1,67 @@ -+2021-04-15 Alan Modra -+ -+ PR 27456 -+ * rename.c (smart_rename): When TO and FROM are equal, just set -+ file timestamp. -+ * objcopy.c (strip_main, copy_main): Always call smart_rename. -+ -+2021-02-26 Alan Modra -+ -+ Backport from mainline -+ 2021-02-25 Alan Modra -+ PR 27456 -+ * rename.c (simple_copy): Mark target_stat ATTRIBUTE_UNUSED. -+ -+ 2021-02-24 Alan Modra -+ Siddhesh Poyarekar -+ PR 27456 -+ * bucomm.h (smart_rename): Update prototype. -+ * rename.c (smart_rename): Add fromfd and preserve_dates params. -+ Pass fromfd and target_stat to simple_copy. Call set_times -+ when preserve_dates. -+ (simple_copy): Accept fromfd rather than from filename. Add -+ target_stat param. Rewind fromfd rather than opening. Open -+ "to" file without O_CREAT. Try to preserve S_ISUID and S_ISGID. -+ * ar.c (write_archive): Rename ofd to tmpfd. Dup tmpfd before -+ closing output temp file, and pass tmpfd to smart_rename. -+ * arsup.c (temp_fd): Rename from real_fd. -+ (ar_save): Dup temp_fd and pass to smart_rename. -+ * objcopy.c (strip_main, copy_main): Likewise, and pass -+ preserve_dates. -+ -+ 2021-02-24 Alan Modra -+ PR 27456 -+ * rename.c: Tidy throughout. -+ (smart_rename): Always copy. Remove windows specific code. -+ -+ 2021-02-03 Alan Modra -+ PR 26945 -+ * ar.c: Don't include libbfd.h. -+ (write_archive): Replace xmalloc+strcpy with xstrdup. -+ * arsup.c (temp_name, real_ofd): New static variables. -+ (ar_open): Use make_tempname and bfd_fdopenw. -+ (ar_save): Adjust to suit ar_open changes. -+ * objcopy.c: Don't include libbfd.h. -+ * rename.c: Rename and reorder variables. -+ -+2021-02-22 Siddhesh Poyarekar -+ -+ * ar.c (write_archive): Adjust call to SMART_RENAME. -+ * arsup.c (ar_save): Likewise. -+ * objcopy (strip_main): Don't set times on temporary file and -+ adjust call to SMART_RENAME. -+ (copy_main): Likewise. -+ * rename.c [!S_ISLNK]: Remove definitions. -+ (try_preserve_permissions): Remove function. -+ (smart_rename): Replace PRESERVE_DATES argument with -+ TARGET_STAT. Use rename system call only if TO does not exist. -+ * bucomm.h (smart_rename): Adjust declaration. -+ -+2021-02-09 Alan Modra -+ -+ PR 27382 -+ * objcopy.c (copy_file): Use bfd_stat. -+ - 2021-02-06 Nick Clifton - - This is the 2.36.1 release. -diff --git a/binutils/ar.c b/binutils/ar.c -index 45a34e3a6cf..fb19b14fec5 100644 ---- a/binutils/ar.c -+++ b/binutils/ar.c -@@ -25,7 +25,6 @@ - - #include "sysdep.h" - #include "bfd.h" --#include "libbfd.h" - #include "libiberty.h" - #include "progress.h" - #include "getopt.h" -@@ -1253,22 +1252,21 @@ write_archive (bfd *iarch) - bfd *obfd; - char *old_name, *new_name; - bfd *contents_head = iarch->archive_next; -- int ofd = -1; -+ int tmpfd = -1; - -- old_name = (char *) xmalloc (strlen (bfd_get_filename (iarch)) + 1); -- strcpy (old_name, bfd_get_filename (iarch)); -- new_name = make_tempname (old_name, &ofd); -+ old_name = xstrdup (bfd_get_filename (iarch)); -+ new_name = make_tempname (old_name, &tmpfd); - - if (new_name == NULL) - bfd_fatal (_("could not create temporary file whilst writing archive")); - - output_filename = new_name; - -- obfd = bfd_fdopenw (new_name, bfd_get_target (iarch), ofd); -+ obfd = bfd_fdopenw (new_name, bfd_get_target (iarch), tmpfd); - - if (obfd == NULL) - { -- close (ofd); -+ close (tmpfd); - bfd_fatal (old_name); - } - -@@ -1299,6 +1297,7 @@ write_archive (bfd *iarch) - if (!bfd_set_archive_head (obfd, contents_head)) - bfd_fatal (old_name); - -+ tmpfd = dup (tmpfd); - if (!bfd_close (obfd)) - bfd_fatal (old_name); - -@@ -1308,7 +1307,7 @@ write_archive (bfd *iarch) - /* We don't care if this fails; we might be creating the archive. */ - bfd_close (iarch); - -- if (smart_rename (new_name, old_name, 0) != 0) -+ if (smart_rename (new_name, old_name, tmpfd, NULL, FALSE) != 0) - xexit (1); - free (old_name); - free (new_name); -diff --git a/binutils/arsup.c b/binutils/arsup.c -index 5403a0c5d74..9982484dbe0 100644 ---- a/binutils/arsup.c -+++ b/binutils/arsup.c -@@ -42,6 +42,8 @@ extern int deterministic; - - static bfd *obfd; - static char *real_name; -+static char *temp_name; -+static int temp_fd; - static FILE *outfile; - - static void -@@ -149,27 +151,24 @@ maybequit (void) - void - ar_open (char *name, int t) - { -- char *tname; -- const char *bname = lbasename (name); -- real_name = name; -+ real_name = xstrdup (name); -+ temp_name = make_tempname (real_name, &temp_fd); - -- /* Prepend tmp- to the beginning, to avoid file-name clashes after -- truncation on filesystems with limited namespaces (DOS). */ -- if (asprintf (&tname, "%.*stmp-%s", (int) (bname - name), name, bname) == -1) -+ if (temp_name == NULL) - { -- fprintf (stderr, _("%s: Can't allocate memory for temp name (%s)\n"), -+ fprintf (stderr, _("%s: Can't open temporary file (%s)\n"), - program_name, strerror(errno)); - maybequit (); - return; - } - -- obfd = bfd_openw (tname, NULL); -+ obfd = bfd_fdopenw (temp_name, NULL, temp_fd); - - if (!obfd) - { - fprintf (stderr, - _("%s: Can't open output archive %s\n"), -- program_name, tname); -+ program_name, temp_name); - - maybequit (); - } -@@ -344,16 +343,31 @@ ar_save (void) - } - else - { -- char *ofilename = xstrdup (bfd_get_filename (obfd)); -+ struct stat target_stat; - - if (deterministic > 0) - obfd->flags |= BFD_DETERMINISTIC_OUTPUT; - -+ temp_fd = dup (temp_fd); - bfd_close (obfd); - -- smart_rename (ofilename, real_name, 0); -+ if (stat (real_name, &target_stat) != 0) -+ { -+ /* The temp file created in ar_open has mode 0600 as per mkstemp. -+ Create the real empty output file here so smart_rename will -+ update the mode according to the process umask. */ -+ obfd = bfd_openw (real_name, NULL); -+ if (obfd != NULL) -+ { -+ bfd_set_format (obfd, bfd_archive); -+ bfd_close (obfd); -+ } -+ } -+ -+ smart_rename (temp_name, real_name, temp_fd, NULL, FALSE); - obfd = 0; -- free (ofilename); -+ free (temp_name); -+ free (real_name); - } - } - -diff --git a/binutils/bucomm.h b/binutils/bucomm.h -index 91f6a5b228f..f1ae47fa1b5 100644 ---- a/binutils/bucomm.h -+++ b/binutils/bucomm.h -@@ -71,7 +71,9 @@ extern void print_version (const char *); - /* In rename.c. */ - extern void set_times (const char *, const struct stat *); - --extern int smart_rename (const char *, const char *, int); -+extern int smart_rename (const char *, const char *, int, -+ struct stat *, bfd_boolean); -+ - - /* In libiberty. */ - void *xmalloc (size_t); -diff --git a/binutils/objcopy.c b/binutils/objcopy.c -index 00d751522c4..00ef851dc5d 100644 ---- a/binutils/objcopy.c -+++ b/binutils/objcopy.c -@@ -20,7 +20,6 @@ - - #include "sysdep.h" - #include "bfd.h" --#include "libbfd.h" - #include "progress.h" - #include "getopt.h" - #include "libiberty.h" -@@ -3769,7 +3768,7 @@ copy_file (const char *input_filename, const char *output_filename, int ofd, - /* To allow us to do "strip *" without dying on the first - non-object file, failures are nonfatal. */ - ibfd = bfd_openr (input_filename, input_target); -- if (ibfd == NULL || fstat (fileno (ibfd->iostream), in_stat) != 0) -+ if (ibfd == NULL || bfd_stat (ibfd, in_stat) != 0) - { - bfd_nonfatal_message (input_filename, NULL, NULL, NULL); - status = 1; -@@ -4835,6 +4834,7 @@ strip_main (int argc, char *argv[]) - struct stat statbuf; - char *tmpname; - int tmpfd = -1; -+ int copyfd = -1; - - if (get_file_size (argv[i]) < 1) - { -@@ -4844,7 +4844,11 @@ strip_main (int argc, char *argv[]) - - if (output_file == NULL - || filename_cmp (argv[i], output_file) == 0) -- tmpname = make_tempname (argv[i], &tmpfd); -+ { -+ tmpname = make_tempname (argv[i], &tmpfd); -+ if (tmpfd >= 0) -+ copyfd = dup (tmpfd); -+ } - else - tmpname = output_file; - -@@ -4861,17 +4865,18 @@ strip_main (int argc, char *argv[]) - output_target, NULL); - if (status == 0) - { -- if (preserve_dates) -- set_times (tmpname, &statbuf); -- if (output_file != tmpname) -- status = (smart_rename (tmpname, -- output_file ? output_file : argv[i], -- preserve_dates) != 0); -+ const char *oname = output_file ? output_file : argv[i]; -+ status = smart_rename (tmpname, oname, copyfd, -+ &statbuf, preserve_dates) != 0; - if (status == 0) - status = hold_status; - } - else -- unlink_if_ordinary (tmpname); -+ { -+ if (copyfd >= 0) -+ close (copyfd); -+ unlink_if_ordinary (tmpname); -+ } - if (output_file != tmpname) - free (tmpname); - } -@@ -5078,7 +5083,9 @@ copy_main (int argc, char *argv[]) - bfd_boolean formats_info = FALSE; - bfd_boolean use_globalize = FALSE; - bfd_boolean use_keep_global = FALSE; -- int c, tmpfd = -1; -+ int c; -+ int tmpfd = -1; -+ int copyfd; - struct stat statbuf; - const bfd_arch_info_type *input_arch = NULL; - -@@ -5916,10 +5923,15 @@ copy_main (int argc, char *argv[]) - } - - /* If there is no destination file, or the source and destination files -- are the same, then create a temp and rename the result into the input. */ -+ are the same, then create a temp and copy the result into the input. */ -+ copyfd = -1; - if (output_filename == NULL - || filename_cmp (input_filename, output_filename) == 0) -- tmpname = make_tempname (input_filename, &tmpfd); -+ { -+ tmpname = make_tempname (input_filename, &tmpfd); -+ if (tmpfd >= 0) -+ copyfd = dup (tmpfd); -+ } - else - tmpname = output_filename; - -@@ -5931,14 +5943,16 @@ copy_main (int argc, char *argv[]) - output_target, input_arch); - if (status == 0) - { -- if (preserve_dates) -- set_times (tmpname, &statbuf); -- if (tmpname != output_filename) -- status = (smart_rename (tmpname, input_filename, -- preserve_dates) != 0); -+ const char *oname = output_filename ? output_filename : input_filename; -+ status = smart_rename (tmpname, oname, copyfd, -+ &statbuf, preserve_dates) != 0; - } - else -- unlink_if_ordinary (tmpname); -+ { -+ if (copyfd >= 0) -+ close (copyfd); -+ unlink_if_ordinary (tmpname); -+ } - - if (tmpname != output_filename) - free (tmpname); -diff --git a/binutils/rename.c b/binutils/rename.c -index 65ad5bf52c4..0427348df5b 100644 ---- a/binutils/rename.c -+++ b/binutils/rename.c -@@ -24,36 +24,29 @@ - - #ifdef HAVE_GOOD_UTIME_H - #include --#else /* ! HAVE_GOOD_UTIME_H */ --#ifdef HAVE_UTIMES -+#elif defined HAVE_UTIMES - #include --#endif /* HAVE_UTIMES */ --#endif /* ! HAVE_GOOD_UTIME_H */ -- --#if ! defined (_WIN32) || defined (__CYGWIN32__) --static int simple_copy (const char *, const char *); -+#endif - - /* The number of bytes to copy at once. */ - #define COPY_BUF 8192 - --/* Copy file FROM to file TO, performing no translations. -+/* Copy file FROMFD to file TO, performing no translations. - Return 0 if ok, -1 if error. */ - - static int --simple_copy (const char *from, const char *to) -+simple_copy (int fromfd, const char *to, -+ struct stat *target_stat ATTRIBUTE_UNUSED) - { -- int fromfd, tofd, nread; -+ int tofd, nread; - int saved; - char buf[COPY_BUF]; - -- fromfd = open (from, O_RDONLY | O_BINARY); -- if (fromfd < 0) -+ if (fromfd < 0 -+ || lseek (fromfd, 0, SEEK_SET) != 0) - return -1; --#ifdef O_CREAT -- tofd = open (to, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0777); --#else -- tofd = creat (to, 0777); --#endif -+ -+ tofd = open (to, O_WRONLY | O_TRUNC | O_BINARY); - if (tofd < 0) - { - saved = errno; -@@ -61,6 +54,7 @@ simple_copy (const char *from, const char *to) - errno = saved; - return -1; - } -+ - while ((nread = read (fromfd, buf, sizeof buf)) > 0) - { - if (write (tofd, buf, nread) != nread) -@@ -72,7 +66,16 @@ simple_copy (const char *from, const char *to) - return -1; - } - } -+ - saved = errno; -+ -+#if !defined (_WIN32) || defined (__CYGWIN32__) -+ /* Writing to a setuid/setgid file may clear S_ISUID and S_ISGID. -+ Try to restore them, ignoring failure. */ -+ if (target_stat != NULL) -+ fchmod (tofd, target_stat->st_mode); -+#endif -+ - close (fromfd); - close (tofd); - if (nread < 0) -@@ -82,7 +85,6 @@ simple_copy (const char *from, const char *to) - } - return 0; - } --#endif /* __CYGWIN32__ or not _WIN32 */ - - /* Set the times of the file DESTINATION to be the same as those in - STATBUF. */ -@@ -91,122 +93,55 @@ void - set_times (const char *destination, const struct stat *statbuf) - { - int result; -- -- { - #ifdef HAVE_GOOD_UTIME_H -- struct utimbuf tb; -- -- tb.actime = statbuf->st_atime; -- tb.modtime = statbuf->st_mtime; -- result = utime (destination, &tb); --#else /* ! HAVE_GOOD_UTIME_H */ --#ifndef HAVE_UTIMES -- long tb[2]; -- -- tb[0] = statbuf->st_atime; -- tb[1] = statbuf->st_mtime; -- result = utime (destination, tb); --#else /* HAVE_UTIMES */ -- struct timeval tv[2]; -- -- tv[0].tv_sec = statbuf->st_atime; -- tv[0].tv_usec = 0; -- tv[1].tv_sec = statbuf->st_mtime; -- tv[1].tv_usec = 0; -- result = utimes (destination, tv); --#endif /* HAVE_UTIMES */ --#endif /* ! HAVE_GOOD_UTIME_H */ -- } -+ struct utimbuf tb; -+ -+ tb.actime = statbuf->st_atime; -+ tb.modtime = statbuf->st_mtime; -+ result = utime (destination, &tb); -+#elif defined HAVE_UTIMES -+ struct timeval tv[2]; -+ -+ tv[0].tv_sec = statbuf->st_atime; -+ tv[0].tv_usec = 0; -+ tv[1].tv_sec = statbuf->st_mtime; -+ tv[1].tv_usec = 0; -+ result = utimes (destination, tv); -+#else -+ long tb[2]; -+ -+ tb[0] = statbuf->st_atime; -+ tb[1] = statbuf->st_mtime; -+ result = utime (destination, tb); -+#endif - - if (result != 0) - non_fatal (_("%s: cannot set time: %s"), destination, strerror (errno)); - } - --#ifndef S_ISLNK --#ifdef S_IFLNK --#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) --#else --#define S_ISLNK(m) 0 --#define lstat stat --#endif --#endif -- --/* Rename FROM to TO, copying if TO is a link. -- Return 0 if ok, -1 if error. */ -+/* Copy FROM to TO. TARGET_STAT has the file status that, if non-NULL, -+ is used to fix up timestamps. Return 0 if ok, -1 if error. -+ At one time this function renamed files, but file permissions are -+ tricky to update given the number of different schemes used by -+ various systems. So now we just copy. */ - - int --smart_rename (const char *from, const char *to, int preserve_dates ATTRIBUTE_UNUSED) -+smart_rename (const char *from, const char *to, int fromfd, -+ struct stat *target_stat, bfd_boolean preserve_dates) - { -- bfd_boolean exists; -- struct stat s; - int ret = 0; - -- exists = lstat (to, &s) == 0; -- --#if defined (_WIN32) && !defined (__CYGWIN32__) -- /* Win32, unlike unix, will not erase `to' in `rename(from, to)' but -- fail instead. Also, chown is not present. */ -- -- if (exists) -- remove (to); -- -- ret = rename (from, to); -- if (ret != 0) -- { -- /* We have to clean up here. */ -- non_fatal (_("unable to rename '%s'; reason: %s"), to, strerror (errno)); -- unlink (from); -- } --#else -- /* Use rename only if TO is not a symbolic link and has -- only one hard link, and we have permission to write to it. */ -- if (! exists -- || (!S_ISLNK (s.st_mode) -- && S_ISREG (s.st_mode) -- && (s.st_mode & S_IWUSR) -- && s.st_nlink == 1) -- ) -+ if (to != from) - { -- ret = rename (from, to); -- if (ret == 0) -- { -- if (exists) -- { -- /* Try to preserve the permission bits and ownership of -- TO. First get the mode right except for the setuid -- bit. Then change the ownership. Then fix the setuid -- bit. We do the chmod before the chown because if the -- chown succeeds, and we are a normal user, we won't be -- able to do the chmod afterward. We don't bother to -- fix the setuid bit first because that might introduce -- a fleeting security problem, and because the chown -- will clear the setuid bit anyhow. We only fix the -- setuid bit if the chown succeeds, because we don't -- want to introduce an unexpected setuid file owned by -- the user running objcopy. */ -- chmod (to, s.st_mode & 0777); -- if (chown (to, s.st_uid, s.st_gid) >= 0) -- chmod (to, s.st_mode & 07777); -- } -- } -- else -- { -- /* We have to clean up here. */ -- non_fatal (_("unable to rename '%s'; reason: %s"), to, strerror (errno)); -- unlink (from); -- } -- } -- else -- { -- ret = simple_copy (from, to); -+ ret = simple_copy (fromfd, to, target_stat); - if (ret != 0) -- non_fatal (_("unable to copy file '%s'; reason: %s"), to, strerror (errno)); -- -- if (preserve_dates) -- set_times (to, &s); -+ non_fatal (_("unable to copy file '%s'; reason: %s"), -+ to, strerror (errno)); - unlink (from); - } --#endif /* _WIN32 && !__CYGWIN32__ */ -+ -+ if (preserve_dates) -+ set_times (to, target_stat); - - return ret; - } -diff --git a/gas/ChangeLog b/gas/ChangeLog -index 7f37f521404..0503d1beb0b 100644 ---- a/gas/ChangeLog -+++ b/gas/ChangeLog -@@ -1,3 +1,46 @@ -+2021-05-25 Tamar Christina -+ -+ Backported from mainline. -+ 2021-05-25 Tamar Christina -+ -+ PR gas/25235 -+ * config/tc-arm.c (md_convert_frag): Set LSB when Thumb symbol. -+ (relax_adr): Thumb symbols 4 bytes. -+ * testsuite/gas/arm/pr25235.d: New test. -+ * testsuite/gas/arm/pr25235.s: New test. -+ -+2021-05-19 Alex Coplan -+ -+ * config/tc-arm.c (do_mve_mov): Only reject vmov if we're moving -+ into the same GPR twice. -+ * testsuite/gas/arm/mve-vmov-bad-2.l: Tweak error message. -+ * testsuite/gas/arm/mve-vmov-3.d: New test. -+ * testsuite/gas/arm/mve-vmov-3.s: New test. -+ -+2021-04-23 Eric Botcazou -+ -+ * testsuite/gas/elf/section25.d: Run it everywhere. -+ * testsuite/gas/elf/section26.d: Likewise. -+ * testsuite/gas/elf/section26.s: Add test for .persistent.bss. -+ -+2021-04-09 Tejas Belagod -+ -+ Backported from mainline. -+ 2021-04-09 Tejas Belagod -+ -+ * config/tc-aarch64.c (warn_unpredictable_ldst): Clean-up diagnostic messages -+ for LD/ST Exclusive instructions. -+ * testsuite/gas/aarch64/diagnostic.s: Add a diagnostic test for STLXP. -+ * testsuite/gas/aarch64/diagnostic.l: Fix-up test after message clean-up. -+ -+2021-02-19 Andreas Krebbel -+ -+ * config/tc-s390.c (s390_parse_cpu): New entry for arch14. -+ * doc/c-s390.texi: Document arch14 march option. -+ * testsuite/gas/s390/s390.exp: Run the arch14 related tests. -+ * testsuite/gas/s390/zarch-arch14.d: New test. -+ * testsuite/gas/s390/zarch-arch14.s: New test. -+ - 2021-02-06 Nick Clifton - - This is the 2.36.1 release. -diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c -index 6f782d057f8..e852e38dfb4 100644 ---- a/gas/config/tc-aarch64.c -+++ b/gas/config/tc-aarch64.c -@@ -7020,18 +7020,49 @@ warn_unpredictable_ldst (aarch64_instruction *instr, char *str) - break; - - case ldstexcl: -- /* It is unpredictable if the destination and status registers are the -- same. */ - if ((aarch64_get_operand_class (opnds[0].type) - == AARCH64_OPND_CLASS_INT_REG) - && (aarch64_get_operand_class (opnds[1].type) -- == AARCH64_OPND_CLASS_INT_REG) -- && (opnds[0].reg.regno == opnds[1].reg.regno -- || opnds[0].reg.regno == opnds[2].reg.regno)) -- as_warn (_("unpredictable: identical transfer and status registers" -- " --`%s'"), -- str); -+ == AARCH64_OPND_CLASS_INT_REG)) -+ { -+ if ((opcode->opcode & (1 << 22))) -+ { -+ /* It is unpredictable if load-exclusive pair with Rt == Rt2. */ -+ if ((opcode->opcode & (1 << 21)) -+ && opnds[0].reg.regno == opnds[1].reg.regno) -+ as_warn (_("unpredictable load of register pair -- `%s'"), str); -+ } -+ else -+ { -+ /* Store-Exclusive is unpredictable if Rt == Rs. */ -+ if (opnds[0].reg.regno == opnds[1].reg.regno) -+ as_warn -+ (_("unpredictable: identical transfer and status registers" -+ " --`%s'"),str); - -+ if (opnds[0].reg.regno == opnds[2].reg.regno) -+ { -+ if (!(opcode->opcode & (1 << 21))) -+ /* Store-Exclusive is unpredictable if Rn == Rs. */ -+ as_warn -+ (_("unpredictable: identical base and status registers" -+ " --`%s'"),str); -+ else -+ /* Store-Exclusive pair is unpredictable if Rt2 == Rs. */ -+ as_warn -+ (_("unpredictable: " -+ "identical transfer and status registers" -+ " --`%s'"),str); -+ } -+ -+ /* Store-Exclusive pair is unpredictable if Rn == Rs. */ -+ if ((opcode->opcode & (1 << 21)) -+ && opnds[0].reg.regno == opnds[3].reg.regno -+ && opnds[3].reg.regno != REG_SP) -+ as_warn (_("unpredictable: identical base and status registers" -+ " --`%s'"),str); -+ } -+ } - break; - - default: -diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c -index ff962daf749..1280921d890 100644 ---- a/gas/config/tc-arm.c -+++ b/gas/config/tc-arm.c -@@ -20013,8 +20013,8 @@ do_mve_mov (int toQ) - constraint (inst.operands[Q0].reg != inst.operands[Q1].reg + 2, - _("Index one must be [2,3] and index two must be two less than" - " index one.")); -- constraint (inst.operands[Rt].reg == inst.operands[Rt2].reg, -- _("General purpose registers may not be the same")); -+ constraint (!toQ && inst.operands[Rt].reg == inst.operands[Rt2].reg, -+ _("Destination registers may not be the same")); - constraint (inst.operands[Rt].reg == REG_SP - || inst.operands[Rt2].reg == REG_SP, - BAD_SP); -@@ -26827,6 +26827,14 @@ md_convert_frag (bfd *abfd, segT asec ATTRIBUTE_UNUSED, fragS *fragp) - pc_rel = (opcode == T_MNEM_ldr_pc2); - break; - case T_MNEM_adr: -+ /* Thumb bits should be set in the frag handling so we process them -+ after all symbols have been seen. PR gas/25235. */ -+ if (exp.X_op == O_symbol -+ && exp.X_add_symbol != NULL -+ && S_IS_DEFINED (exp.X_add_symbol) -+ && THUMB_IS_FUNC (exp.X_add_symbol)) -+ exp.X_add_number |= 1; -+ - if (fragp->fr_var == 4) - { - insn = THUMB_OP32 (opcode); -@@ -27024,7 +27032,8 @@ relax_adr (fragS *fragp, asection *sec, long stretch) - if (fragp->fr_symbol == NULL - || !S_IS_DEFINED (fragp->fr_symbol) - || sec != S_GET_SEGMENT (fragp->fr_symbol) -- || S_IS_WEAK (fragp->fr_symbol)) -+ || S_IS_WEAK (fragp->fr_symbol) -+ || THUMB_IS_FUNC (fragp->fr_symbol)) - return 4; - - val = relaxed_symbol_addr (fragp, stretch); -diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c -index c6daef99fde..f23d9863d3d 100644 ---- a/gas/config/tc-s390.c -+++ b/gas/config/tc-s390.c -@@ -292,6 +292,8 @@ s390_parse_cpu (const char * arg, - { STRING_COMMA_LEN ("z14"), STRING_COMMA_LEN ("arch12"), - S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX }, - { STRING_COMMA_LEN ("z15"), STRING_COMMA_LEN ("arch13"), -+ S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX }, -+ { STRING_COMMA_LEN (""), STRING_COMMA_LEN ("arch14"), - S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX } - }; - static struct -diff --git a/gas/doc/c-s390.texi b/gas/doc/c-s390.texi -index c1b46a10c1e..53046a288bd 100644 ---- a/gas/doc/c-s390.texi -+++ b/gas/doc/c-s390.texi -@@ -18,7 +18,7 @@ and eleven chip levels. The architecture modes are the Enterprise System - Architecture (ESA) and the newer z/Architecture mode. The chip levels - are g5 (or arch3), g6, z900 (or arch5), z990 (or arch6), z9-109, z9-ec - (or arch7), z10 (or arch8), z196 (or arch9), zEC12 (or arch10), z13 --(or arch11), z14 (or arch12), and z15 (or arch13). -+(or arch11), z14 (or arch12), z15 (or arch13), or arch14. - - @menu - * s390 Options:: Command-line Options. -@@ -70,8 +70,9 @@ are recognized: - @code{z196} (or @code{arch9}), - @code{zEC12} (or @code{arch10}), - @code{z13} (or @code{arch11}), --@code{z14} (or @code{arch12}), and --@code{z15} (or @code{arch13}). -+@code{z14} (or @code{arch12}), -+@code{z15} (or @code{arch13}), and -+@code{arch14}. - - Assembling an instruction that is not supported on the target - processor results in an error message. -diff --git a/gas/testsuite/gas/aarch64/diagnostic.l b/gas/testsuite/gas/aarch64/diagnostic.l -index b5f304af70b..5158d41cd43 100644 ---- a/gas/testsuite/gas/aarch64/diagnostic.l -+++ b/gas/testsuite/gas/aarch64/diagnostic.l -@@ -175,11 +175,11 @@ - [^:]*:304: Warning: unpredictable: identical transfer and status registers --`stlxrb w26,w26,\[x0\]' - [^:]*:305: Warning: unpredictable: identical transfer and status registers --`stlxrh w26,w26,\[x1\]' - [^:]*:306: Warning: unpredictable: identical transfer and status registers --`stlxr w26,w26,\[x2\]' --[^:]*:307: Warning: unpredictable: identical transfer and status registers --`stlxrb w26,w27,\[x26\]' --[^:]*:308: Warning: unpredictable: identical transfer and status registers --`stlxrh w26,w27,\[x26\]' --[^:]*:309: Warning: unpredictable: identical transfer and status registers --`stlxr w26,w27,\[x26\]' --[^:]*:310: Warning: unpredictable: identical transfer and status registers --`stlxr w26,x27,\[x26\]' -+[^:]*:307: Warning: unpredictable: identical base and status registers --`stlxrb w26,w27,\[x26\]' -+[^:]*:308: Warning: unpredictable: identical base and status registers --`stlxrh w26,w27,\[x26\]' -+[^:]*:309: Warning: unpredictable: identical base and status registers --`stlxr w26,w27,\[x26\]' -+[^:]*:310: Warning: unpredictable: identical base and status registers --`stlxr w26,x27,\[x26\]' - [^:]*:311: Warning: unpredictable: identical transfer and status registers --`stlxr w26,x26,\[x3\]' --[^:]*:312: Warning: unpredictable: identical transfer and status registers --`ldxp x26,x26,\[x5\]' --[^:]*:313: Warning: unpredictable: identical transfer and status registers --`ldxp x26,x1,\[x26\]' -+[^:]*:312: Warning: unpredictable load of register pair -- `ldxp x26,x26,\[x5\]' - [^:]*:314: Error: expected element type rather than vector type at operand 1 -- `st4 {v0\.16b-v3\.16b}\[4\],\[x0\]' -+[^:]*:315: Warning: unpredictable: identical base and status registers --`stlxp w3,w26,w26,\[x3\]' -diff --git a/gas/testsuite/gas/aarch64/diagnostic.s b/gas/testsuite/gas/aarch64/diagnostic.s -index 21cbc53d897..0ebe85ac59d 100644 ---- a/gas/testsuite/gas/aarch64/diagnostic.s -+++ b/gas/testsuite/gas/aarch64/diagnostic.s -@@ -312,3 +312,4 @@ - ldxp x26, x26, [x5] - ldxp x26, x1, [x26] - st4 {v0.16b-v3.16b}[4], [x0] -+ stlxp w3, w26, w26, [x3] -diff --git a/gas/testsuite/gas/arm/mve-vmov-3.d b/gas/testsuite/gas/arm/mve-vmov-3.d -new file mode 100644 -index 00000000000..5355b4ac4cb ---- /dev/null -+++ b/gas/testsuite/gas/arm/mve-vmov-3.d -@@ -0,0 +1,169 @@ -+# name: MVE vmov (between two 32-bit vector lanes and two GPRs) -+# as: -march=armv8.1-m.main+mve -+# objdump: -dr -marmv8.1-m.main -+ -+.*: +file format .*arm.* -+ -+Disassembly of section .text: -+ -+0+ <.*>: -+.*: ec01 2f00 vmov r0, r1, q1\[2\], q1\[0\] -+.*: ec01 4f00 vmov r0, r1, q2\[2\], q2\[0\] -+.*: ec01 6f00 vmov r0, r1, q3\[2\], q3\[0\] -+.*: ec01 8f00 vmov r0, r1, q4\[2\], q4\[0\] -+.*: ec01 af00 vmov r0, r1, q5\[2\], q5\[0\] -+.*: ec01 cf00 vmov r0, r1, q6\[2\], q6\[0\] -+.*: ec01 ef00 vmov r0, r1, q7\[2\], q7\[0\] -+.*: ec00 0f01 vmov r1, r0, q0\[2\], q0\[0\] -+.*: ec00 0f02 vmov r2, r0, q0\[2\], q0\[0\] -+.*: ec00 0f03 vmov r3, r0, q0\[2\], q0\[0\] -+.*: ec00 0f04 vmov r4, r0, q0\[2\], q0\[0\] -+.*: ec00 0f05 vmov r5, r0, q0\[2\], q0\[0\] -+.*: ec00 0f06 vmov r6, r0, q0\[2\], q0\[0\] -+.*: ec00 0f07 vmov r7, r0, q0\[2\], q0\[0\] -+.*: ec00 0f08 vmov r8, r0, q0\[2\], q0\[0\] -+.*: ec00 0f09 vmov r9, r0, q0\[2\], q0\[0\] -+.*: ec00 0f0a vmov sl, r0, q0\[2\], q0\[0\] -+.*: ec00 0f0b vmov fp, r0, q0\[2\], q0\[0\] -+.*: ec00 0f0c vmov ip, r0, q0\[2\], q0\[0\] -+.*: ec00 0f0e vmov lr, r0, q0\[2\], q0\[0\] -+.*: ec01 0f00 vmov r0, r1, q0\[2\], q0\[0\] -+.*: ec02 0f00 vmov r0, r2, q0\[2\], q0\[0\] -+.*: ec03 0f00 vmov r0, r3, q0\[2\], q0\[0\] -+.*: ec04 0f00 vmov r0, r4, q0\[2\], q0\[0\] -+.*: ec05 0f00 vmov r0, r5, q0\[2\], q0\[0\] -+.*: ec06 0f00 vmov r0, r6, q0\[2\], q0\[0\] -+.*: ec07 0f00 vmov r0, r7, q0\[2\], q0\[0\] -+.*: ec08 0f00 vmov r0, r8, q0\[2\], q0\[0\] -+.*: ec09 0f00 vmov r0, r9, q0\[2\], q0\[0\] -+.*: ec0a 0f00 vmov r0, sl, q0\[2\], q0\[0\] -+.*: ec0b 0f00 vmov r0, fp, q0\[2\], q0\[0\] -+.*: ec0c 0f00 vmov r0, ip, q0\[2\], q0\[0\] -+.*: ec0e 0f00 vmov r0, lr, q0\[2\], q0\[0\] -+.*: ec01 2f10 vmov r0, r1, q1\[3\], q1\[1\] -+.*: ec01 4f10 vmov r0, r1, q2\[3\], q2\[1\] -+.*: ec01 6f10 vmov r0, r1, q3\[3\], q3\[1\] -+.*: ec01 8f10 vmov r0, r1, q4\[3\], q4\[1\] -+.*: ec01 af10 vmov r0, r1, q5\[3\], q5\[1\] -+.*: ec01 cf10 vmov r0, r1, q6\[3\], q6\[1\] -+.*: ec01 ef10 vmov r0, r1, q7\[3\], q7\[1\] -+.*: ec00 0f11 vmov r1, r0, q0\[3\], q0\[1\] -+.*: ec00 0f12 vmov r2, r0, q0\[3\], q0\[1\] -+.*: ec00 0f13 vmov r3, r0, q0\[3\], q0\[1\] -+.*: ec00 0f14 vmov r4, r0, q0\[3\], q0\[1\] -+.*: ec00 0f15 vmov r5, r0, q0\[3\], q0\[1\] -+.*: ec00 0f16 vmov r6, r0, q0\[3\], q0\[1\] -+.*: ec00 0f17 vmov r7, r0, q0\[3\], q0\[1\] -+.*: ec00 0f18 vmov r8, r0, q0\[3\], q0\[1\] -+.*: ec00 0f19 vmov r9, r0, q0\[3\], q0\[1\] -+.*: ec00 0f1a vmov sl, r0, q0\[3\], q0\[1\] -+.*: ec00 0f1b vmov fp, r0, q0\[3\], q0\[1\] -+.*: ec00 0f1c vmov ip, r0, q0\[3\], q0\[1\] -+.*: ec00 0f1e vmov lr, r0, q0\[3\], q0\[1\] -+.*: ec01 0f10 vmov r0, r1, q0\[3\], q0\[1\] -+.*: ec02 0f10 vmov r0, r2, q0\[3\], q0\[1\] -+.*: ec03 0f10 vmov r0, r3, q0\[3\], q0\[1\] -+.*: ec04 0f10 vmov r0, r4, q0\[3\], q0\[1\] -+.*: ec05 0f10 vmov r0, r5, q0\[3\], q0\[1\] -+.*: ec06 0f10 vmov r0, r6, q0\[3\], q0\[1\] -+.*: ec07 0f10 vmov r0, r7, q0\[3\], q0\[1\] -+.*: ec08 0f10 vmov r0, r8, q0\[3\], q0\[1\] -+.*: ec09 0f10 vmov r0, r9, q0\[3\], q0\[1\] -+.*: ec0a 0f10 vmov r0, sl, q0\[3\], q0\[1\] -+.*: ec0b 0f10 vmov r0, fp, q0\[3\], q0\[1\] -+.*: ec0c 0f10 vmov r0, ip, q0\[3\], q0\[1\] -+.*: ec0e 0f10 vmov r0, lr, q0\[3\], q0\[1\] -+.*: ec11 2f00 vmov q1\[2\], q1\[0\], r0, r1 -+.*: ec11 4f00 vmov q2\[2\], q2\[0\], r0, r1 -+.*: ec11 6f00 vmov q3\[2\], q3\[0\], r0, r1 -+.*: ec11 8f00 vmov q4\[2\], q4\[0\], r0, r1 -+.*: ec11 af00 vmov q5\[2\], q5\[0\], r0, r1 -+.*: ec11 cf00 vmov q6\[2\], q6\[0\], r0, r1 -+.*: ec11 ef00 vmov q7\[2\], q7\[0\], r0, r1 -+.*: ec10 0f00 vmov q0\[2\], q0\[0\], r0, r0 -+.*: ec10 0f01 vmov q0\[2\], q0\[0\], r1, r0 -+.*: ec10 0f02 vmov q0\[2\], q0\[0\], r2, r0 -+.*: ec10 0f03 vmov q0\[2\], q0\[0\], r3, r0 -+.*: ec10 0f04 vmov q0\[2\], q0\[0\], r4, r0 -+.*: ec10 0f05 vmov q0\[2\], q0\[0\], r5, r0 -+.*: ec10 0f06 vmov q0\[2\], q0\[0\], r6, r0 -+.*: ec10 0f07 vmov q0\[2\], q0\[0\], r7, r0 -+.*: ec10 0f08 vmov q0\[2\], q0\[0\], r8, r0 -+.*: ec10 0f09 vmov q0\[2\], q0\[0\], r9, r0 -+.*: ec10 0f0a vmov q0\[2\], q0\[0\], sl, r0 -+.*: ec10 0f0b vmov q0\[2\], q0\[0\], fp, r0 -+.*: ec10 0f0c vmov q0\[2\], q0\[0\], ip, r0 -+.*: ec10 0f0e vmov q0\[2\], q0\[0\], lr, r0 -+.*: ec11 0f00 vmov q0\[2\], q0\[0\], r0, r1 -+.*: ec12 0f00 vmov q0\[2\], q0\[0\], r0, r2 -+.*: ec13 0f00 vmov q0\[2\], q0\[0\], r0, r3 -+.*: ec14 0f00 vmov q0\[2\], q0\[0\], r0, r4 -+.*: ec15 0f00 vmov q0\[2\], q0\[0\], r0, r5 -+.*: ec16 0f00 vmov q0\[2\], q0\[0\], r0, r6 -+.*: ec17 0f00 vmov q0\[2\], q0\[0\], r0, r7 -+.*: ec18 0f00 vmov q0\[2\], q0\[0\], r0, r8 -+.*: ec19 0f00 vmov q0\[2\], q0\[0\], r0, r9 -+.*: ec1a 0f00 vmov q0\[2\], q0\[0\], r0, sl -+.*: ec1b 0f00 vmov q0\[2\], q0\[0\], r0, fp -+.*: ec1c 0f00 vmov q0\[2\], q0\[0\], r0, ip -+.*: ec1e 0f00 vmov q0\[2\], q0\[0\], r0, lr -+.*: ec11 0f01 vmov q0\[2\], q0\[0\], r1, r1 -+.*: ec12 0f02 vmov q0\[2\], q0\[0\], r2, r2 -+.*: ec13 0f03 vmov q0\[2\], q0\[0\], r3, r3 -+.*: ec14 0f04 vmov q0\[2\], q0\[0\], r4, r4 -+.*: ec15 0f05 vmov q0\[2\], q0\[0\], r5, r5 -+.*: ec16 0f06 vmov q0\[2\], q0\[0\], r6, r6 -+.*: ec17 0f07 vmov q0\[2\], q0\[0\], r7, r7 -+.*: ec18 0f08 vmov q0\[2\], q0\[0\], r8, r8 -+.*: ec19 0f09 vmov q0\[2\], q0\[0\], r9, r9 -+.*: ec1a 0f0a vmov q0\[2\], q0\[0\], sl, sl -+.*: ec1b 0f0b vmov q0\[2\], q0\[0\], fp, fp -+.*: ec1c 0f0c vmov q0\[2\], q0\[0\], ip, ip -+.*: ec1e 0f0e vmov q0\[2\], q0\[0\], lr, lr -+.*: ec11 2f10 vmov q1\[3\], q1\[1\], r0, r1 -+.*: ec11 4f10 vmov q2\[3\], q2\[1\], r0, r1 -+.*: ec11 6f10 vmov q3\[3\], q3\[1\], r0, r1 -+.*: ec11 8f10 vmov q4\[3\], q4\[1\], r0, r1 -+.*: ec11 af10 vmov q5\[3\], q5\[1\], r0, r1 -+.*: ec11 cf10 vmov q6\[3\], q6\[1\], r0, r1 -+.*: ec11 ef10 vmov q7\[3\], q7\[1\], r0, r1 -+.*: ec10 0f10 vmov q0\[3\], q0\[1\], r0, r0 -+.*: ec10 0f11 vmov q0\[3\], q0\[1\], r1, r0 -+.*: ec10 0f12 vmov q0\[3\], q0\[1\], r2, r0 -+.*: ec10 0f13 vmov q0\[3\], q0\[1\], r3, r0 -+.*: ec10 0f14 vmov q0\[3\], q0\[1\], r4, r0 -+.*: ec10 0f15 vmov q0\[3\], q0\[1\], r5, r0 -+.*: ec10 0f16 vmov q0\[3\], q0\[1\], r6, r0 -+.*: ec10 0f17 vmov q0\[3\], q0\[1\], r7, r0 -+.*: ec10 0f18 vmov q0\[3\], q0\[1\], r8, r0 -+.*: ec10 0f19 vmov q0\[3\], q0\[1\], r9, r0 -+.*: ec10 0f1a vmov q0\[3\], q0\[1\], sl, r0 -+.*: ec10 0f1b vmov q0\[3\], q0\[1\], fp, r0 -+.*: ec10 0f1c vmov q0\[3\], q0\[1\], ip, r0 -+.*: ec10 0f1e vmov q0\[3\], q0\[1\], lr, r0 -+.*: ec11 0f10 vmov q0\[3\], q0\[1\], r0, r1 -+.*: ec12 0f10 vmov q0\[3\], q0\[1\], r0, r2 -+.*: ec13 0f10 vmov q0\[3\], q0\[1\], r0, r3 -+.*: ec14 0f10 vmov q0\[3\], q0\[1\], r0, r4 -+.*: ec15 0f10 vmov q0\[3\], q0\[1\], r0, r5 -+.*: ec16 0f10 vmov q0\[3\], q0\[1\], r0, r6 -+.*: ec17 0f10 vmov q0\[3\], q0\[1\], r0, r7 -+.*: ec18 0f10 vmov q0\[3\], q0\[1\], r0, r8 -+.*: ec19 0f10 vmov q0\[3\], q0\[1\], r0, r9 -+.*: ec1a 0f10 vmov q0\[3\], q0\[1\], r0, sl -+.*: ec1b 0f10 vmov q0\[3\], q0\[1\], r0, fp -+.*: ec1c 0f10 vmov q0\[3\], q0\[1\], r0, ip -+.*: ec1e 0f10 vmov q0\[3\], q0\[1\], r0, lr -+.*: ec11 0f11 vmov q0\[3\], q0\[1\], r1, r1 -+.*: ec12 0f12 vmov q0\[3\], q0\[1\], r2, r2 -+.*: ec13 0f13 vmov q0\[3\], q0\[1\], r3, r3 -+.*: ec14 0f14 vmov q0\[3\], q0\[1\], r4, r4 -+.*: ec15 0f15 vmov q0\[3\], q0\[1\], r5, r5 -+.*: ec16 0f16 vmov q0\[3\], q0\[1\], r6, r6 -+.*: ec17 0f17 vmov q0\[3\], q0\[1\], r7, r7 -+.*: ec18 0f18 vmov q0\[3\], q0\[1\], r8, r8 -+.*: ec19 0f19 vmov q0\[3\], q0\[1\], r9, r9 -+.*: ec1a 0f1a vmov q0\[3\], q0\[1\], sl, sl -+.*: ec1b 0f1b vmov q0\[3\], q0\[1\], fp, fp -+.*: ec1c 0f1c vmov q0\[3\], q0\[1\], ip, ip -+.*: ec1e 0f1e vmov q0\[3\], q0\[1\], lr, lr -diff --git a/gas/testsuite/gas/arm/mve-vmov-3.s b/gas/testsuite/gas/arm/mve-vmov-3.s -new file mode 100644 -index 00000000000..caf09576acd ---- /dev/null -+++ b/gas/testsuite/gas/arm/mve-vmov-3.s -@@ -0,0 +1,160 @@ -+vmov r0, r1, q1[2], q1[0] -+vmov r0, r1, q2[2], q2[0] -+vmov r0, r1, q3[2], q3[0] -+vmov r0, r1, q4[2], q4[0] -+vmov r0, r1, q5[2], q5[0] -+vmov r0, r1, q6[2], q6[0] -+vmov r0, r1, q7[2], q7[0] -+vmov r1, r0, q0[2], q0[0] -+vmov r2, r0, q0[2], q0[0] -+vmov r3, r0, q0[2], q0[0] -+vmov r4, r0, q0[2], q0[0] -+vmov r5, r0, q0[2], q0[0] -+vmov r6, r0, q0[2], q0[0] -+vmov r7, r0, q0[2], q0[0] -+vmov r8, r0, q0[2], q0[0] -+vmov r9, r0, q0[2], q0[0] -+vmov sl, r0, q0[2], q0[0] -+vmov fp, r0, q0[2], q0[0] -+vmov ip, r0, q0[2], q0[0] -+vmov lr, r0, q0[2], q0[0] -+vmov r0, r1, q0[2], q0[0] -+vmov r0, r2, q0[2], q0[0] -+vmov r0, r3, q0[2], q0[0] -+vmov r0, r4, q0[2], q0[0] -+vmov r0, r5, q0[2], q0[0] -+vmov r0, r6, q0[2], q0[0] -+vmov r0, r7, q0[2], q0[0] -+vmov r0, r8, q0[2], q0[0] -+vmov r0, r9, q0[2], q0[0] -+vmov r0, sl, q0[2], q0[0] -+vmov r0, fp, q0[2], q0[0] -+vmov r0, ip, q0[2], q0[0] -+vmov r0, lr, q0[2], q0[0] -+vmov r0, r1, q1[3], q1[1] -+vmov r0, r1, q2[3], q2[1] -+vmov r0, r1, q3[3], q3[1] -+vmov r0, r1, q4[3], q4[1] -+vmov r0, r1, q5[3], q5[1] -+vmov r0, r1, q6[3], q6[1] -+vmov r0, r1, q7[3], q7[1] -+vmov r1, r0, q0[3], q0[1] -+vmov r2, r0, q0[3], q0[1] -+vmov r3, r0, q0[3], q0[1] -+vmov r4, r0, q0[3], q0[1] -+vmov r5, r0, q0[3], q0[1] -+vmov r6, r0, q0[3], q0[1] -+vmov r7, r0, q0[3], q0[1] -+vmov r8, r0, q0[3], q0[1] -+vmov r9, r0, q0[3], q0[1] -+vmov sl, r0, q0[3], q0[1] -+vmov fp, r0, q0[3], q0[1] -+vmov ip, r0, q0[3], q0[1] -+vmov lr, r0, q0[3], q0[1] -+vmov r0, r1, q0[3], q0[1] -+vmov r0, r2, q0[3], q0[1] -+vmov r0, r3, q0[3], q0[1] -+vmov r0, r4, q0[3], q0[1] -+vmov r0, r5, q0[3], q0[1] -+vmov r0, r6, q0[3], q0[1] -+vmov r0, r7, q0[3], q0[1] -+vmov r0, r8, q0[3], q0[1] -+vmov r0, r9, q0[3], q0[1] -+vmov r0, sl, q0[3], q0[1] -+vmov r0, fp, q0[3], q0[1] -+vmov r0, ip, q0[3], q0[1] -+vmov r0, lr, q0[3], q0[1] -+vmov q1[2], q1[0], r0, r1 -+vmov q2[2], q2[0], r0, r1 -+vmov q3[2], q3[0], r0, r1 -+vmov q4[2], q4[0], r0, r1 -+vmov q5[2], q5[0], r0, r1 -+vmov q6[2], q6[0], r0, r1 -+vmov q7[2], q7[0], r0, r1 -+vmov q0[2], q0[0], r0, r0 -+vmov q0[2], q0[0], r1, r0 -+vmov q0[2], q0[0], r2, r0 -+vmov q0[2], q0[0], r3, r0 -+vmov q0[2], q0[0], r4, r0 -+vmov q0[2], q0[0], r5, r0 -+vmov q0[2], q0[0], r6, r0 -+vmov q0[2], q0[0], r7, r0 -+vmov q0[2], q0[0], r8, r0 -+vmov q0[2], q0[0], r9, r0 -+vmov q0[2], q0[0], sl, r0 -+vmov q0[2], q0[0], fp, r0 -+vmov q0[2], q0[0], ip, r0 -+vmov q0[2], q0[0], lr, r0 -+vmov q0[2], q0[0], r0, r1 -+vmov q0[2], q0[0], r0, r2 -+vmov q0[2], q0[0], r0, r3 -+vmov q0[2], q0[0], r0, r4 -+vmov q0[2], q0[0], r0, r5 -+vmov q0[2], q0[0], r0, r6 -+vmov q0[2], q0[0], r0, r7 -+vmov q0[2], q0[0], r0, r8 -+vmov q0[2], q0[0], r0, r9 -+vmov q0[2], q0[0], r0, sl -+vmov q0[2], q0[0], r0, fp -+vmov q0[2], q0[0], r0, ip -+vmov q0[2], q0[0], r0, lr -+vmov q0[2], q0[0], r1, r1 -+vmov q0[2], q0[0], r2, r2 -+vmov q0[2], q0[0], r3, r3 -+vmov q0[2], q0[0], r4, r4 -+vmov q0[2], q0[0], r5, r5 -+vmov q0[2], q0[0], r6, r6 -+vmov q0[2], q0[0], r7, r7 -+vmov q0[2], q0[0], r8, r8 -+vmov q0[2], q0[0], r9, r9 -+vmov q0[2], q0[0], sl, sl -+vmov q0[2], q0[0], fp, fp -+vmov q0[2], q0[0], ip, ip -+vmov q0[2], q0[0], lr, lr -+vmov q1[3], q1[1], r0, r1 -+vmov q2[3], q2[1], r0, r1 -+vmov q3[3], q3[1], r0, r1 -+vmov q4[3], q4[1], r0, r1 -+vmov q5[3], q5[1], r0, r1 -+vmov q6[3], q6[1], r0, r1 -+vmov q7[3], q7[1], r0, r1 -+vmov q0[3], q0[1], r0, r0 -+vmov q0[3], q0[1], r1, r0 -+vmov q0[3], q0[1], r2, r0 -+vmov q0[3], q0[1], r3, r0 -+vmov q0[3], q0[1], r4, r0 -+vmov q0[3], q0[1], r5, r0 -+vmov q0[3], q0[1], r6, r0 -+vmov q0[3], q0[1], r7, r0 -+vmov q0[3], q0[1], r8, r0 -+vmov q0[3], q0[1], r9, r0 -+vmov q0[3], q0[1], sl, r0 -+vmov q0[3], q0[1], fp, r0 -+vmov q0[3], q0[1], ip, r0 -+vmov q0[3], q0[1], lr, r0 -+vmov q0[3], q0[1], r0, r1 -+vmov q0[3], q0[1], r0, r2 -+vmov q0[3], q0[1], r0, r3 -+vmov q0[3], q0[1], r0, r4 -+vmov q0[3], q0[1], r0, r5 -+vmov q0[3], q0[1], r0, r6 -+vmov q0[3], q0[1], r0, r7 -+vmov q0[3], q0[1], r0, r8 -+vmov q0[3], q0[1], r0, r9 -+vmov q0[3], q0[1], r0, sl -+vmov q0[3], q0[1], r0, fp -+vmov q0[3], q0[1], r0, ip -+vmov q0[3], q0[1], r0, lr -+vmov q0[3], q0[1], r1, r1 -+vmov q0[3], q0[1], r2, r2 -+vmov q0[3], q0[1], r3, r3 -+vmov q0[3], q0[1], r4, r4 -+vmov q0[3], q0[1], r5, r5 -+vmov q0[3], q0[1], r6, r6 -+vmov q0[3], q0[1], r7, r7 -+vmov q0[3], q0[1], r8, r8 -+vmov q0[3], q0[1], r9, r9 -+vmov q0[3], q0[1], sl, sl -+vmov q0[3], q0[1], fp, fp -+vmov q0[3], q0[1], ip, ip -+vmov q0[3], q0[1], lr, lr -diff --git a/gas/testsuite/gas/arm/mve-vmov-bad-2.l b/gas/testsuite/gas/arm/mve-vmov-bad-2.l -index 2f4bdc8293a..7c9226cf8ea 100644 ---- a/gas/testsuite/gas/arm/mve-vmov-bad-2.l -+++ b/gas/testsuite/gas/arm/mve-vmov-bad-2.l -@@ -1,5 +1,5 @@ - [^:]*: Assembler messages: --[^:]*:3: Error: General purpose registers may not be the same -- `vmov r0,r0,q0\[2\],q0\[0\]' -+[^:]*:3: Error: Destination registers may not be the same -- `vmov r0,r0,q0\[2\],q0\[0\]' - [^:]*:4: Error: r13 not allowed here -- `vmov sp,r0,q0\[2\],q0\[0\]' - [^:]*:5: Error: r13 not allowed here -- `vmov r0,sp,q0\[2\],q0\[0\]' - [^:]*:6: Error: r15 not allowed here -- `vmov pc,r0,q0\[2\],q0\[0\]' -diff --git a/gas/testsuite/gas/arm/pr25235.d b/gas/testsuite/gas/arm/pr25235.d -new file mode 100644 -index 00000000000..12695038701 ---- /dev/null -+++ b/gas/testsuite/gas/arm/pr25235.d -@@ -0,0 +1,24 @@ -+#skip: *-*-pe *-*-wince *-*-vxworks -+#objdump: -dr -+#name: PR25235: Thumb forward references error -+ -+.*: +file format .*arm.* -+ -+Disassembly of section .text: -+ -+00000000 : -+ 0: 46c0 nop ; \(mov r8, r8\) -+ 2: 46c0 nop ; \(mov r8, r8\) -+ -+00000004 : -+ 4: f2af 0107 subw r1, pc, #7 -+ 8: f20f 0305 addw r3, pc, #5 -+ c: a401 add r4, pc, #4 ; \(adr r4, 14 \) -+ e: 46c0 nop ; \(mov r8, r8\) -+ -+00000010 : -+ 10: 46c0 nop ; \(mov r8, r8\) -+ 12: 46c0 nop ; \(mov r8, r8\) -+ -+00000014 : -+ 14: e1a00000 nop ; \(mov r0, r0\) -diff --git a/gas/testsuite/gas/arm/pr25235.s b/gas/testsuite/gas/arm/pr25235.s -new file mode 100644 -index 00000000000..77637392f1c ---- /dev/null -+++ b/gas/testsuite/gas/arm/pr25235.s -@@ -0,0 +1,30 @@ -+ .syntax unified -+ .thumb -+ -+ .align 2 -+ .type f1, %function -+ .thumb_func -+ f1: -+ nop -+ -+ .align 2 -+ .type f2, %function -+ .thumb_func -+ f2: -+ adr r1, f1 -+ adr r3, f3 -+ adr r4, f4 -+ -+ -+ .align 2 -+ .type f3, %function -+ .thumb_func -+ f3: -+ nop -+ -+ .align 2 -+ .type f3, %function -+ .arm -+ f4: -+ nop -+ -diff --git a/gas/testsuite/gas/elf/section25.d b/gas/testsuite/gas/elf/section25.d -index 09353849e5b..fa09b85074f 100644 ---- a/gas/testsuite/gas/elf/section25.d -+++ b/gas/testsuite/gas/elf/section25.d -@@ -1,7 +1,9 @@ - #name: sections 25 (.noinit) --#target: [supports_noinit_section] - #source: section25.s - #readelf: -S --wide -+# The h8300 port issues a warning message for -+# new sections created without atrributes. -+#xfail: h8300-* - - #... - \[..\] .noinit[ ]+NOBITS[ ]+[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 WA .* -diff --git a/gas/testsuite/gas/elf/section25.s b/gas/testsuite/gas/elf/section25.s -index 538e5c7ce4b..25f81847fbd 100644 ---- a/gas/testsuite/gas/elf/section25.s -+++ b/gas/testsuite/gas/elf/section25.s -@@ -1,8 +1,8 @@ --.section .noinit --.word 0 -+ .section .noinit -+ .word 0 - --.section .noinit.foo --.word 0 -+ .section .noinit.foo -+ .word 0 - --.section .gnu.linkonce.n.bar --.word 0 -+ .section .gnu.linkonce.n.bar -+ .word 0 -diff --git a/gas/testsuite/gas/elf/section26.d b/gas/testsuite/gas/elf/section26.d -index 15d85bdca9d..f08f444e9c9 100644 ---- a/gas/testsuite/gas/elf/section26.d -+++ b/gas/testsuite/gas/elf/section26.d -@@ -1,12 +1,16 @@ - #name: sections 26 (.persistent) --#target: [supports_persistent_section] - #source: section26.s - #readelf: -S --wide -+# The h8300 port issues a warning message for -+# new sections created without atrributes. -+#xfail: h8300-* - - #... - \[..\] .persistent[ ]+PROGBITS[ ]+[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 WA .* - #... - \[..\] .persistent.foo[ ]+PROGBITS[ ]+[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 WA .* -+#... -+ \[..\] .persistent.bss[ ]+NOBITS[ ]+[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 WA .* - #... - \[..\] .gnu.linkonce.p.bar[ ]+PROGBITS[ ]+[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 WA .* - #pass -diff --git a/gas/testsuite/gas/elf/section26.s b/gas/testsuite/gas/elf/section26.s -index 7f986454229..240f90f8d2f 100644 ---- a/gas/testsuite/gas/elf/section26.s -+++ b/gas/testsuite/gas/elf/section26.s -@@ -1,8 +1,11 @@ --.section .persistent --.word 0 -+ .section .persistent -+ .word 0 - --.section .persistent.foo --.word 0 -+ .section .persistent.foo -+ .word 0 - --.section .gnu.linkonce.p.bar --.word 0 -+ .section .persistent.bss -+ .word 0 -+ -+ .section .gnu.linkonce.p.bar -+ .word 0 -diff --git a/gas/testsuite/gas/s390/s390.exp b/gas/testsuite/gas/s390/s390.exp -index f87a09a8633..d03555a7aef 100644 ---- a/gas/testsuite/gas/s390/s390.exp -+++ b/gas/testsuite/gas/s390/s390.exp -@@ -31,6 +31,7 @@ if [expr [istarget "s390-*-*"] || [istarget "s390x-*-*"]] then { - run_dump_test "zarch-z13" "{as -m64} {as -march=z13}" - run_dump_test "zarch-arch12" "{as -m64} {as -march=arch12}" - run_dump_test "zarch-arch13" "{as -m64} {as -march=arch13}" -+ run_dump_test "zarch-arch14" "{as -m64} {as -march=arch14}" - run_dump_test "zarch-reloc" "{as -m64}" - run_dump_test "zarch-operands" "{as -m64} {as -march=z9-109}" - run_dump_test "zarch-machine" "{as -m64} {as -march=z900}" -diff --git a/gas/testsuite/gas/s390/zarch-arch14.d b/gas/testsuite/gas/s390/zarch-arch14.d -new file mode 100644 -index 00000000000..97c4fd54719 ---- /dev/null -+++ b/gas/testsuite/gas/s390/zarch-arch14.d -@@ -0,0 +1,31 @@ -+#name: s390x opcode -+#objdump: -dr -+ -+.*: +file format .* -+ -+Disassembly of section .text: -+ -+.* : -+.*: e6 f1 40 c0 d6 74 [ ]*vschp %v15,%v17,%v20,13,12 -+.*: e6 f1 40 d0 26 74 [ ]*vschsp %v15,%v17,%v20,13 -+.*: e6 f1 40 d0 36 74 [ ]*vschdp %v15,%v17,%v20,13 -+.*: e6 f1 40 d0 46 74 [ ]*vschxp %v15,%v17,%v20,13 -+.*: e6 f1 40 00 06 7c [ ]*vscshp %v15,%v17,%v20 -+.*: e6 f1 40 d0 06 7d [ ]*vcsph %v15,%v17,%v20,13 -+.*: e6 f1 00 d0 04 51 [ ]*vclzdp %v15,%v17,13 -+.*: e6 f1 40 cf d6 70 [ ]*vpkzr %v15,%v17,%v20,253,12 -+.*: e6 f1 40 cf d6 72 [ ]*vsrpr %v15,%v17,%v20,253,12 -+.*: e6 f1 00 d0 04 54 [ ]*vupkzh %v15,%v17,13 -+.*: e6 f1 00 d0 04 5c [ ]*vupkzl %v15,%v17,13 -+.*: b9 3b 00 00 [ ]*nnpa -+.*: e6 f1 00 0c d4 56 [ ]*vclfnh %v15,%v17,13,12 -+.*: e6 f1 00 0c d4 5e [ ]*vclfnl %v15,%v17,13,12 -+.*: e6 f1 40 0c d6 75 [ ]*vcrnf %v15,%v17,%v20,13,12 -+.*: e6 f1 00 0c d4 5d [ ]*vcfn %v15,%v17,13,12 -+.*: e6 f1 00 0c d4 55 [ ]*vcnf %v15,%v17,13,12 -+.*: b9 8b 90 6b [ ]*rdp %r6,%r9,%r11 -+.*: b9 8b 9d 6b [ ]*rdp %r6,%r9,%r11,13 -+.*: eb fd 68 f0 fd 71 [ ]*lpswey -10000\(%r6\),253 -+.*: b2 00 6f a0 [ ]*lbear 4000\(%r6\) -+.*: b2 01 6f a0 [ ]*stbear 4000\(%r6\) -+.*: 07 07 [ ]*nopr %r7 -diff --git a/gas/testsuite/gas/s390/zarch-arch14.s b/gas/testsuite/gas/s390/zarch-arch14.s -new file mode 100644 -index 00000000000..830382f0ac5 ---- /dev/null -+++ b/gas/testsuite/gas/s390/zarch-arch14.s -@@ -0,0 +1,24 @@ -+.text -+foo: -+ vschp %v15,%v17,%v20,13,12 -+ vschsp %v15,%v17,%v20,13 -+ vschdp %v15,%v17,%v20,13 -+ vschxp %v15,%v17,%v20,13 -+ vscshp %v15,%v17,%v20 -+ vcsph %v15,%v17,%v20,13 -+ vclzdp %v15,%v17,13 -+ vpkzr %v15,%v17,%v20,253,12 -+ vsrpr %v15,%v17,%v20,253,12 -+ vupkzh %v15,%v17,13 -+ vupkzl %v15,%v17,13 -+ nnpa -+ vclfnh %v15,%v17,13,12 -+ vclfnl %v15,%v17,13,12 -+ vcrnf %v15,%v17,%v20,13,12 -+ vcfn %v15,%v17,13,12 -+ vcnf %v15,%v17,13,12 -+ rdp %r6,%r9,%r11 -+ rdp %r6,%r9,%r11,13 -+ lpswey -10000(%r6),253 -+ lbear 4000(%r6) -+ stbear 4000(%r6) -diff --git a/gold/config.in b/gold/config.in -index aaad1bee706..ca0b9d2e2f9 100644 ---- a/gold/config.in -+++ b/gold/config.in -@@ -124,6 +124,9 @@ - /* Define to 1 if you have the `mallinfo' function. */ - #undef HAVE_MALLINFO - -+/* Define to 1 if you have the `mallinfo2' function. */ -+#undef HAVE_MALLINFO2 -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_MEMORY_H - -diff --git a/gold/configure b/gold/configure -index e264a65ac3c..b9f062b68eb 100755 ---- a/gold/configure -+++ b/gold/configure -@@ -9967,7 +9967,7 @@ case "$ac_cv_search_dlopen" in - esac - - --for ac_func in mallinfo posix_fallocate fallocate readv sysconf times mkdtemp -+for ac_func in mallinfo mallinfo2 posix_fallocate fallocate readv sysconf times mkdtemp - do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` - ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" -diff --git a/gold/configure.ac b/gold/configure.ac -index eed45664093..1716a779416 100644 ---- a/gold/configure.ac -+++ b/gold/configure.ac -@@ -636,7 +636,7 @@ case "$ac_cv_search_dlopen" in - esac - AC_SUBST(DLOPEN_LIBS) - --AC_CHECK_FUNCS(mallinfo posix_fallocate fallocate readv sysconf times mkdtemp) -+AC_CHECK_FUNCS(mallinfo mallinfo2 posix_fallocate fallocate readv sysconf times mkdtemp) - AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, snprintf, vsnprintf, strverscmp, strndup, memmem]) - - # Use of ::std::tr1::unordered_map::rehash causes undefined symbols -diff --git a/gold/gc.h b/gold/gc.h -index 2c20b44b6ed..4a1368f5abe 100644 ---- a/gold/gc.h -+++ b/gold/gc.h -@@ -247,7 +247,7 @@ gc_process_relocs( - if (is_ordinary) - (*secvec).push_back(Section_id(src_obj, dst_indx)); - else -- (*secvec).push_back(Section_id(NULL, 0)); -+ (*secvec).push_back(Section_id(static_cast(NULL), 0)); - // If the target of the relocation is an STT_SECTION symbol, - // make a note of that by storing -1 in the symbol vector. - if (lsym.get_st_type() == elfcpp::STT_SECTION) -@@ -329,7 +329,7 @@ gc_process_relocs( - if (is_ordinary && dst_obj != NULL) - (*secvec).push_back(Section_id(dst_obj, dst_indx)); - else -- (*secvec).push_back(Section_id(NULL, 0)); -+ (*secvec).push_back(Section_id(static_cast(NULL), 0)); - (*symvec).push_back(gsym); - (*addendvec).push_back(std::make_pair( - static_cast(symvalue), -diff --git a/gold/main.cc b/gold/main.cc -index ea77ca3ebbe..ff44cbb7add 100644 ---- a/gold/main.cc -+++ b/gold/main.cc -@@ -25,7 +25,7 @@ - #include - #include - --#ifdef HAVE_MALLINFO -+#if defined(HAVE_MALLINFO) || defined(HAVE_MALLINFO2) - #include - #endif - -@@ -290,11 +290,16 @@ main(int argc, char** argv) - elapsed.sys / 1000, (elapsed.sys % 1000) * 1000, - elapsed.wall / 1000, (elapsed.wall % 1000) * 1000); - --#ifdef HAVE_MALLINFO -+#if defined(HAVE_MALLINFO2) -+ struct mallinfo2 m = mallinfo2(); -+ fprintf(stderr, _("%s: total space allocated by malloc: %lld bytes\n"), -+ program_name, static_cast(m.arena)); -+#elif defined(HAVE_MALLINFO) - struct mallinfo m = mallinfo(); - fprintf(stderr, _("%s: total space allocated by malloc: %lld bytes\n"), - program_name, static_cast(m.arena)); - #endif -+ - File_read::print_stats(); - Archive::print_stats(); - Lib_group::print_stats(); -diff --git a/gold/powerpc.cc b/gold/powerpc.cc -index ec6f950eb21..fbda058898a 100644 ---- a/gold/powerpc.cc -+++ b/gold/powerpc.cc -@@ -11086,6 +11086,8 @@ Target_powerpc::Relocate::relocate( - { - if (ent->save_res_) - value = (value - target->savres_section()->address() -+ + stub_table->stub_address() -+ + stub_table->plt_size() - + stub_table->branch_size()); - else - { -diff --git a/include/ChangeLog b/include/ChangeLog -index 733174b56b0..b4276ec5af0 100644 ---- a/include/ChangeLog -+++ b/include/ChangeLog -@@ -1,3 +1,13 @@ -+2021-07-01 Richard Earnshaw -+ -+ PR gas/28031 -+ * opcode/arm.h (FPU_ANY): Exclude XScale-related features. -+ -+2021-02-19 Andreas Krebbel -+ -+ * opcode/s390.h (enum s390_opcode_cpu_val): Add -+ S390_OPCODE_ARCH14. -+ - 2021-02-06 Nick Clifton - - This is the 2.36.1 release. -diff --git a/include/opcode/arm.h b/include/opcode/arm.h -index 03a80712c0a..90c09a70658 100644 ---- a/include/opcode/arm.h -+++ b/include/opcode/arm.h -@@ -383,7 +383,7 @@ - #define ARM_ARCH_NONE ARM_FEATURE_LOW (0, 0) - #define FPU_NONE ARM_FEATURE_LOW (0, 0) - #define ARM_ANY ARM_FEATURE (-1, -1 & ~ (ARM_EXT2_MVE | ARM_EXT2_MVE_FP), 0) /* Any basic core. */ --#define FPU_ANY ARM_FEATURE_COPROC (-1) /* Any FPU. */ -+#define FPU_ANY ARM_FEATURE_COPROC (-1 & ~(ARM_CEXT_XSCALE | ARM_CEXT_IWMMXT | ARM_CEXT_IWMMXT2)) /* Any FPU. */ - #define FPU_ANY_HARD ARM_FEATURE_COPROC (FPU_FPA | FPU_VFP_HARD | FPU_MAVERICK) - /* Extensions containing some Thumb-2 instructions. If any is present, Thumb - ISA is Thumb-2. */ -diff --git a/include/opcode/s390.h b/include/opcode/s390.h -index cc112b01588..868ae2f02dc 100644 ---- a/include/opcode/s390.h -+++ b/include/opcode/s390.h -@@ -44,6 +44,7 @@ enum s390_opcode_cpu_val - S390_OPCODE_Z13, - S390_OPCODE_ARCH12, - S390_OPCODE_ARCH13, -+ S390_OPCODE_ARCH14, - S390_OPCODE_MAXCPU - }; - -diff --git a/ld/ChangeLog b/ld/ChangeLog -index 97fef18c28e..8156b6d9260 100644 ---- a/ld/ChangeLog -+++ b/ld/ChangeLog -@@ -1,3 +1,37 @@ -+2021-04-01 Tamar Christina -+ -+ Backported from mainline -+ 2021-04-01 Tamar Christina -+ -+ PR ld/26659 -+ * testsuite/ld-pe/pe.exp: -+ * testsuite/ld-pe/pr26659-weak-undef-sym.d: New test. -+ * testsuite/ld-pe/pr26659-weak-undef-sym.s: New test. -+ -+2021-03-22 H.J. Lu -+ -+ PR ld/27587 -+ * testsuite/ld-x86-64/pr27587.err: New file. -+ * testsuite/ld-x86-64/pr27587a.obj.bz2: Likewise. -+ * testsuite/ld-x86-64/pr27587b.obj.bz2: Likewise. -+ * testsuite/ld-x86-64/x86-64.exp: Run PR ld/27587 test. -+ -+2021-03-02 Alan Modra -+ -+ * testsuite/ld-powerpc/weak1.d, -+ * testsuite/ld-powerpc/weak1.r, -+ * testsuite/ld-powerpc/weak1.s, -+ * testsuite/ld-powerpc/weak1so.d, -+ * testsuite/ld-powerpc/weak1so.r: New tests. -+ * testsuite/ld-powerpc/powerpc.exp: Run them. -+ -+2021-02-07 H.J. Lu -+ -+ PR ld/27358 -+ * testsuite/ld-i386/i386.exp: Remove property 3/4/5 run-time -+ tests. -+ * testsuite/ld-x86-64/x86-64.exp: Likewise. -+ - 2021-02-06 Nick Clifton - - This is the 2.36.1 release. -diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp -index 9bfc70c9fb9..24700f81352 100644 ---- a/ld/testsuite/ld-i386/i386.exp -+++ b/ld/testsuite/ld-i386/i386.exp -@@ -1105,69 +1105,6 @@ if { [isnative] - {pass.c property-stack.S} \ - "property-3-static" "pass.out" \ - ] \ -- [list \ -- "Run property 3" \ -- "" \ -- "-Wa,-mx86-used-note=yes" \ -- {pass.c property-stack.S property-x86-1.S} \ -- "property-3" "pass.out" \ -- ] \ -- [list \ -- "Run property 3 (PIE)" \ -- "-pie" \ -- "-Wa,-mx86-used-note=yes" \ -- {pass.c property-x86-1.S property-stack.S} \ -- "property-3-pie" "pass.out" "-fPIE" \ -- ] \ -- [list \ -- "Run property 3 (static)" \ -- "-static" \ -- "-Wa,-mx86-used-note=yes" \ -- {property-x86-1.S pass.c property-stack.S} \ -- "property-3-static" "pass.out" \ -- ] \ -- [list \ -- "Run property 4" \ -- "" \ -- "-Wa,-mx86-used-note=yes" \ -- {pass.c property-stack.S property-x86-1.S property-x86-2.S} \ -- "property-4" "pass.out" \ -- ] \ -- [list \ -- "Run property 4 (PIE)" \ -- "-pie" \ -- "-Wa,-mx86-used-note=yes" \ -- {pass.c property-x86-2.S property-x86-1.S property-stack.S} \ -- "property-4-pie" "pass.out" "-fPIE" \ -- ] \ -- [list \ -- "Run property 4 (static)" \ -- "-static" \ -- "-Wa,-mx86-used-note=yes" \ -- {property-x86-2.S property-x86-1.S pass.c property-stack.S} \ -- "property-4-static" "pass.out" \ -- ] \ -- [list \ -- "Run property 5" \ -- "-Wl,-z,stack-size=0x900000" \ -- "-Wa,-mx86-used-note=yes" \ -- {pass.c property-stack.S property-x86-1.S property-x86-2.S} \ -- "property-5" "pass.out" \ -- ] \ -- [list \ -- "Run property 5 (PIE)" \ -- "-pie -Wl,-z,stack-size=0x900000" \ -- "-Wa,-mx86-used-note=yes" \ -- {pass.c property-x86-2.S property-x86-1.S property-stack.S} \ -- "property-5-pie" "pass.out" "-fPIE" \ -- ] \ -- [list \ -- "Run property 5 (static)" \ -- "-static -Wl,-z,stack-size=0x900000" \ -- "-Wa,-mx86-used-note=yes" \ -- {property-x86-2.S property-x86-1.S pass.c property-stack.S} \ -- "property-5-static" "pass.out" \ -- ] \ - ] - - undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" -diff --git a/ld/testsuite/ld-pe/pe.exp b/ld/testsuite/ld-pe/pe.exp -index de9e104f0f6..5b04b6b8075 100644 ---- a/ld/testsuite/ld-pe/pe.exp -+++ b/ld/testsuite/ld-pe/pe.exp -@@ -79,6 +79,7 @@ run_dump_test "orphan_nu" - run_dump_test "weakdef-1" - - run_dump_test "pr19803" -+run_dump_test "pr26659-weak-undef-sym" - set pr19803_dll { - { "PR 19803: not exporting swept symbols" - "-shared --out-implib dx.dll --gc-sections" -diff --git a/ld/testsuite/ld-pe/pr26659-weak-undef-sym.d b/ld/testsuite/ld-pe/pr26659-weak-undef-sym.d -new file mode 100644 -index 00000000000..0b48994877d ---- /dev/null -+++ b/ld/testsuite/ld-pe/pr26659-weak-undef-sym.d -@@ -0,0 +1,32 @@ -+#source: pr26659-weak-undef-sym.s -+#target: x86_64-*-cygwin* x86_64-*-pe x86_64-*-mingw* -+#ld: -e0 -+#objdump: -d -+ -+#... -+0000000140001000 : -+ 140001000: 55 push %rbp -+ 140001001: 48 89 e5 mov %rsp,%rbp -+ 140001004: 48 83 ec 20 sub \$0x20,%rsp -+ 140001008: 89 4d 10 mov %ecx,0x10\(%rbp\) -+ 14000100b: 48 8b 05 ee 0f 00 00 mov 0xfee\(%rip\),%rax # 140002000 <__data_end__> -+ 140001012: 48 85 c0 test %rax,%rax -+ 140001015: 74 05 je 14000101c -+ 140001017: e8 e4 ef ff bf call 100000000 <__size_of_stack_reserve__\+0xffe00000> -+ 14000101c: 48 8b 05 ed 0f 00 00 mov 0xfed\(%rip\),%rax # 140002010 <.refptr.bar2> -+ 140001023: 48 85 c0 test %rax,%rax -+ 140001026: 74 05 je 14000102d -+ 140001028: e8 d3 ef ff bf call 100000000 <__size_of_stack_reserve__\+0xffe00000> -+ 14000102d: 8b 45 10 mov 0x10\(%rbp\),%eax -+ 140001030: 0f af c0 imul %eax,%eax -+ 140001033: 48 83 c4 20 add \$0x20,%rsp -+ 140001037: 5d pop %rbp -+ 140001038: c3 ret -+ 140001039: 90 nop -+ 14000103a: 90 nop -+ 14000103b: 90 nop -+ 14000103c: 90 nop -+ 14000103d: 90 nop -+ 14000103e: 90 nop -+ 14000103f: 90 nop -+#pass -diff --git a/ld/testsuite/ld-pe/pr26659-weak-undef-sym.s b/ld/testsuite/ld-pe/pr26659-weak-undef-sym.s -new file mode 100644 -index 00000000000..7a42759e752 ---- /dev/null -+++ b/ld/testsuite/ld-pe/pr26659-weak-undef-sym.s -@@ -0,0 +1,38 @@ -+ .text -+ .globl foo -+ .def foo; .scl 2; .type 32; .endef -+foo: -+ pushq %rbp -+ movq %rsp, %rbp -+ subq $32, %rsp -+ movl %ecx, 16(%rbp) -+ movq .refptr.bar1(%rip), %rax -+ testq %rax, %rax -+ je .L2 -+ call bar1 -+.L2: -+ movq .refptr.bar2(%rip), %rax -+ testq %rax, %rax -+ je .L3 -+ call bar2 -+.L3: -+ movl 16(%rbp), %eax -+ imull %eax, %eax -+ addq $32, %rsp -+ popq %rbp -+ ret -+ .weak bar2 -+ .weak bar1 -+ .def bar1; .scl 2; .type 32; .endef -+ .def bar2; .scl 2; .type 32; .endef -+ .section .rdata$.refptr.bar2, "dr" -+ .globl .refptr.bar2 -+ .linkonce discard -+.refptr.bar2: -+ .quad bar2 -+ .section .rdata$.refptr.bar1, "dr" -+ .globl .refptr.bar1 -+ .linkonce discard -+.refptr.bar1: -+ .quad bar1 -+ -diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp -index 45485e6c5d1..8aa0eccfa0e 100644 ---- a/ld/testsuite/ld-powerpc/powerpc.exp -+++ b/ld/testsuite/ld-powerpc/powerpc.exp -@@ -344,6 +344,12 @@ set ppc64elftests { - {"group3" "-melf64ppc -e foo" "" "-a64" {group3.s group2.s group1.s} - {{objdump {-d} group2.d} - {readelf {-s} group3.sym}} "group3"} -+ {"weak1" "-melf64ppc --hash-style=both" "" -+ "-a64 -mpower10" {weak1.s} -+ {{objdump -d weak1.d} {readelf {-srW} weak1.r}} "weak1"} -+ {"weak1.so" "-shared -melf64ppc --hash-style=both" "" -+ "-a64 -mpower10" {weak1.s} -+ {{objdump -d weak1so.d} {readelf {-srW} weak1so.r}} "weak1.so"} - } - - set ppceabitests { -diff --git a/ld/testsuite/ld-powerpc/weak1.d b/ld/testsuite/ld-powerpc/weak1.d -new file mode 100644 -index 00000000000..c0127539ddd ---- /dev/null -+++ b/ld/testsuite/ld-powerpc/weak1.d -@@ -0,0 +1,26 @@ -+ -+.*: file format .* -+ -+Disassembly of section \.text: -+ -+.*0c0 <_start>: -+.*0c0: (04 10 00 01|01 00 10 04) pld r3,65888 -+.*0c4: (e4 60 01 60|60 01 60 e4) -+.*0c8: (04 10 00 01|01 00 10 04) pld r3,65856 -+.*0cc: (e4 60 01 40|40 01 60 e4) -+.*0d0: (04 10 00 01|01 00 10 04) pld r3,65864 -+.*0d4: (e4 60 01 48|48 01 60 e4) -+.*0d8: (04 10 00 01|01 00 10 04) pld r3,65848 -+.*0dc: (e4 60 01 38|38 01 60 e4) -+.*0e0: (e8 62 80 20|20 80 62 e8) ld r3,-32736\(r2\) -+.*0e4: (e8 62 80 08|08 80 62 e8) ld r3,-32760\(r2\) -+.*0e8: (e8 62 80 18|18 80 62 e8) ld r3,-32744\(r2\) -+.*0ec: (e8 62 80 10|10 80 62 e8) ld r3,-32752\(r2\) -+.*0f0: (60 00 00 00|00 00 00 60) nop -+.*0f4: (e8 62 80 20|20 80 62 e8) ld r3,-32736\(r2\) -+.*0f8: (60 00 00 00|00 00 00 60) nop -+.*0fc: (e8 62 80 08|08 80 62 e8) ld r3,-32760\(r2\) -+.*100: (60 00 00 00|00 00 00 60) nop -+.*104: (e8 62 80 18|18 80 62 e8) ld r3,-32744\(r2\) -+.*108: (60 00 00 00|00 00 00 60) nop -+.*10c: (e8 62 80 10|10 80 62 e8) ld r3,-32752\(r2\) -diff --git a/ld/testsuite/ld-powerpc/weak1.r b/ld/testsuite/ld-powerpc/weak1.r -new file mode 100644 -index 00000000000..7d73f38cbb3 ---- /dev/null -+++ b/ld/testsuite/ld-powerpc/weak1.r -@@ -0,0 +1,5 @@ -+ -+There are no relocations in this file. -+ -+Symbol table '\.symtab' .* -+#pass -diff --git a/ld/testsuite/ld-powerpc/weak1.s b/ld/testsuite/ld-powerpc/weak1.s -new file mode 100644 -index 00000000000..0f370d974ba ---- /dev/null -+++ b/ld/testsuite/ld-powerpc/weak1.s -@@ -0,0 +1,22 @@ -+ .weak x1, x2, x3, x4 -+ .protected x2 -+ .hidden x3 -+ .internal x4 -+ .global _start -+_start: -+ pld 3,x1@got@pcrel -+ pld 3,x2@got@pcrel -+ pld 3,x3@got@pcrel -+ pld 3,x4@got@pcrel -+ ld 3,x1@got(2) -+ ld 3,x2@got(2) -+ ld 3,x3@got(2) -+ ld 3,x4@got(2) -+ addis 9,2,x1@got@ha -+ ld 3,x1@got@l(9) -+ addis 9,2,x2@got@ha -+ ld 3,x2@got@l(9) -+ addis 9,2,x3@got@ha -+ ld 3,x3@got@l(9) -+ addis 9,2,x4@got@ha -+ ld 3,x4@got@l(9) -diff --git a/ld/testsuite/ld-powerpc/weak1so.d b/ld/testsuite/ld-powerpc/weak1so.d -new file mode 100644 -index 00000000000..0d34b3b4840 ---- /dev/null -+++ b/ld/testsuite/ld-powerpc/weak1so.d -@@ -0,0 +1,26 @@ -+ -+.*: file format .* -+ -+Disassembly of section \.text: -+ -+0+1c0 <_start>: -+ 1c0: (04 10 00 01|01 00 10 04) pld r3,66144 -+ 1c4: (e4 60 02 60|60 02 60 e4) -+ 1c8: (04 10 00 01|01 00 10 04) pld r3,66112 -+ 1cc: (e4 60 02 40|40 02 60 e4) -+ 1d0: (04 10 00 01|01 00 10 04) pld r3,66120 -+ 1d4: (e4 60 02 48|48 02 60 e4) -+ 1d8: (04 10 00 01|01 00 10 04) pld r3,66104 -+ 1dc: (e4 60 02 38|38 02 60 e4) -+ 1e0: (e8 62 80 20|20 80 62 e8) ld r3,-32736\(r2\) -+ 1e4: (e8 62 80 08|08 80 62 e8) ld r3,-32760\(r2\) -+ 1e8: (e8 62 80 18|18 80 62 e8) ld r3,-32744\(r2\) -+ 1ec: (e8 62 80 10|10 80 62 e8) ld r3,-32752\(r2\) -+ 1f0: (60 00 00 00|00 00 00 60) nop -+ 1f4: (e8 62 80 20|20 80 62 e8) ld r3,-32736\(r2\) -+ 1f8: (60 00 00 00|00 00 00 60) nop -+ 1fc: (e8 62 80 08|08 80 62 e8) ld r3,-32760\(r2\) -+ 200: (60 00 00 00|00 00 00 60) nop -+ 204: (e8 62 80 18|18 80 62 e8) ld r3,-32744\(r2\) -+ 208: (60 00 00 00|00 00 00 60) nop -+ 20c: (e8 62 80 10|10 80 62 e8) ld r3,-32752\(r2\) -diff --git a/ld/testsuite/ld-powerpc/weak1so.r b/ld/testsuite/ld-powerpc/weak1so.r -new file mode 100644 -index 00000000000..dcc91f1879a ---- /dev/null -+++ b/ld/testsuite/ld-powerpc/weak1so.r -@@ -0,0 +1,7 @@ -+#... -+.* R_PPC64_GLOB_DAT +0+ x1 \+ 0 -+#... -+.* 0+ +0 NOTYPE +WEAK +DEFAULT +UND x1 -+#... -+.* 0+ +0 NOTYPE +WEAK +DEFAULT +UND x1 -+#pass -diff --git a/ld/testsuite/ld-x86-64/pr27587.err b/ld/testsuite/ld-x86-64/pr27587.err -new file mode 100644 -index 00000000000..fa870790813 ---- /dev/null -+++ b/ld/testsuite/ld-x86-64/pr27587.err -@@ -0,0 +1,3 @@ -+#... -+.*pr27587.i:4: undefined reference to `stack_size' -+#... -diff --git a/ld/testsuite/ld-x86-64/pr27587a.obj.bz2 b/ld/testsuite/ld-x86-64/pr27587a.obj.bz2 -new file mode 100644 -index 00000000000..eebcf54d44d -Binary files /dev/null and b/ld/testsuite/ld-x86-64/pr27587a.obj.bz2 differ -diff --git a/ld/testsuite/ld-x86-64/pr27587b.obj.bz2 b/ld/testsuite/ld-x86-64/pr27587b.obj.bz2 -new file mode 100644 -index 00000000000..8506e4eccdb -Binary files /dev/null and b/ld/testsuite/ld-x86-64/pr27587b.obj.bz2 differ -diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp -index 83fdaa7db65..d2ec1ddc328 100644 ---- a/ld/testsuite/ld-x86-64/x86-64.exp -+++ b/ld/testsuite/ld-x86-64/x86-64.exp -@@ -221,6 +221,11 @@ set x86_64tests { - "-melf_x86_64 -pie -z notext tmpdir/pr20550a.o tmpdir/pr20550b.so" - "" - "--64" { dummy.s } {} "pr20550"} -+ {"Build pr27587" -+ "-melf_x86_64 -e main" -+ "" "" -+ { pr27587a.obj.bz2 pr27587b.obj.bz2 } -+ {{ld "pr27587.err"}} "pr27587"} - } - - run_ld_link_tests $x86_64tests -@@ -1582,69 +1587,6 @@ if { [isnative] && [check_compiler_available] } { - {pass.c property-stack.S} \ - "property-3-static" "pass.out" \ - ] \ -- [list \ -- "Run property 3" \ -- "" \ -- "-Wa,-mx86-used-note=yes" \ -- {pass.c property-stack.S property-x86-1.S} \ -- "property-3" "pass.out" \ -- ] \ -- [list \ -- "Run property 3 (PIE)" \ -- "-pie" \ -- "-Wa,-mx86-used-note=yes" \ -- {pass.c property-x86-1.S property-stack.S} \ -- "property-3-pie" "pass.out" "-fPIE" \ -- ] \ -- [list \ -- "Run property 3 (static)" \ -- "-static" \ -- "-Wa,-mx86-used-note=yes" \ -- {property-x86-1.S pass.c property-stack.S} \ -- "property-3-static" "pass.out" \ -- ] \ -- [list \ -- "Run property 4" \ -- "" \ -- "-Wa,-mx86-used-note=yes" \ -- {pass.c property-stack.S property-x86-1.S property-x86-2.S} \ -- "property-4" "pass.out" \ -- ] \ -- [list \ -- "Run property 4 (PIE)" \ -- "-pie" \ -- "-Wa,-mx86-used-note=yes" \ -- {pass.c property-x86-2.S property-x86-1.S property-stack.S} \ -- "property-4-pie" "pass.out" "-fPIE" \ -- ] \ -- [list \ -- "Run property 4 (static)" \ -- "-static" \ -- "-Wa,-mx86-used-note=yes" \ -- {property-x86-2.S property-x86-1.S pass.c property-stack.S} \ -- "property-4-static" "pass.out" \ -- ] \ -- [list \ -- "Run property 5" \ -- "-Wl,-z,stack-size=0x900000" \ -- "-Wa,-mx86-used-note=yes" \ -- {pass.c property-stack.S property-x86-1.S property-x86-2.S} \ -- "property-5" "pass.out" \ -- ] \ -- [list \ -- "Run property 5 (PIE)" \ -- "-pie -Wl,-z,stack-size=0x900000" \ -- "-Wa,-mx86-used-note=yes" \ -- {pass.c property-x86-2.S property-x86-1.S property-stack.S} \ -- "property-5-pie" "pass.out" "-fPIE" \ -- ] \ -- [list \ -- "Run property 5 (static)" \ -- "-static -Wl,-z,stack-size=0x900000" \ -- "-Wa,-mx86-used-note=yes" \ -- {property-x86-2.S property-x86-1.S pass.c property-stack.S} \ -- "property-5-static" "pass.out" \ -- ] \ - [list \ - "Run pr22001-1a (PIC 1)" \ - "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \ -diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog -index 6046ffe395b..43cd9bef661 100644 ---- a/opcodes/ChangeLog -+++ b/opcodes/ChangeLog -@@ -1,3 +1,25 @@ -+2021-05-19 Alex Coplan -+ -+ * arm-dis.c (mve_opcodes): Fix disassembly of -+ MVE_VMOV2_GP_TO_VEC_LANE when idx == 1. -+ (is_mve_encoding_conflict): MVE vector loads should not match -+ when P = W = 0. -+ (is_mve_unpredictable): It's not unpredictable to use the same -+ source register twice (for MVE_VMOV2_GP_TO_VEC_LANE). -+ -+2021-04-09 Tejas Belagod -+ -+ Backported from mainline. -+ 021-04-09 Tejas Belagod -+ -+ * aarch64-tbl.h (struct aarch64_opcode aarch64_opcode_table): Reclassify -+ LD64/ST64 instructions to lse_atomic instead of ldstexcl. -+ -+2021-02-19 Andreas Krebbel -+ -+ * s390-mkopc.c (main): Accept arch14 as cpu string. -+ * s390-opc.txt: Add new arch14 instructions. -+ - 2021-02-06 Nick Clifton - - This is the 2.36.1 release. -diff --git a/opcodes/aarch64-tbl.h b/opcodes/aarch64-tbl.h -index f5c313138ea..4192e54d188 100644 ---- a/opcodes/aarch64-tbl.h -+++ b/opcodes/aarch64-tbl.h -@@ -3646,10 +3646,10 @@ struct aarch64_opcode aarch64_opcode_table[] = - CORE_INSN ("ldrsw", 0x98000000, 0xff000000, loadlit, OP_LDRSW_LIT, OP2 (Rt, ADDR_PCREL19), QL_X_PCREL, 0), - CORE_INSN ("prfm", 0xd8000000, 0xff000000, loadlit, OP_PRFM_LIT, OP2 (PRFOP, ADDR_PCREL19), QL_PRFM_PCREL, 0), - /* Atomic 64-byte load/store in Armv8.7. */ -- _LS64_INSN ("ld64b", 0xf83fd000, 0xfffffc00, ldstexcl, OP2 (Rt_LS64, ADDR_SIMPLE), QL_X1NIL, 0), -- _LS64_INSN ("st64b", 0xf83f9000, 0xfffffc00, ldstexcl, OP2 (Rt_LS64, ADDR_SIMPLE), QL_X1NIL, 0), -- _LS64_INSN ("st64bv", 0xf820b000, 0xffe0fc00, ldstexcl, OP3 (Rs, Rt_LS64, ADDR_SIMPLE), QL_X2NIL, 0), -- _LS64_INSN ("st64bv0", 0xf820a000, 0xffe0fc00, ldstexcl, OP3 (Rs, Rt_LS64, ADDR_SIMPLE), QL_X2NIL, 0), -+ _LS64_INSN ("ld64b", 0xf83fd000, 0xfffffc00, lse_atomic, OP2 (Rt_LS64, ADDR_SIMPLE), QL_X1NIL, 0), -+ _LS64_INSN ("st64b", 0xf83f9000, 0xfffffc00, lse_atomic, OP2 (Rt_LS64, ADDR_SIMPLE), QL_X1NIL, 0), -+ _LS64_INSN ("st64bv", 0xf820b000, 0xffe0fc00, lse_atomic, OP3 (Rs, Rt_LS64, ADDR_SIMPLE), QL_X2NIL, 0), -+ _LS64_INSN ("st64bv0", 0xf820a000, 0xffe0fc00, lse_atomic, OP3 (Rs, Rt_LS64, ADDR_SIMPLE), QL_X2NIL, 0), - /* Logical (immediate). */ - CORE_INSN ("and", 0x12000000, 0x7f800000, log_imm, 0, OP3 (Rd_SP, Rn, LIMM), QL_R2NIL, F_HAS_ALIAS | F_SF), - CORE_INSN ("bic", 0x12000000, 0x7f800000, log_imm, OP_BIC, OP3 (Rd_SP, Rn, LIMM), QL_R2NIL, F_ALIAS | F_PSEUDO | F_SF), -diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c -index f16a5902479..97632693803 100644 ---- a/opcodes/arm-dis.c -+++ b/opcodes/arm-dis.c -@@ -2959,7 +2959,7 @@ static const struct mopcode32 mve_opcodes[] = - {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE), - MVE_VMOV2_GP_TO_VEC_LANE, - 0xec100f10, 0xffb01ff0, -- "vmov%c\t%13-15,22Q[2], %13-15,22Q[0], %0-3r, %16-19r"}, -+ "vmov%c\t%13-15,22Q[3], %13-15,22Q[1], %0-3r, %16-19r"}, - - /* Vector VMOV Vector lane to gpr. */ - {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP), -@@ -5727,6 +5727,9 @@ is_mve_encoding_conflict (unsigned long given, - else - return FALSE; - -+ case MVE_VLDRB_T1: -+ case MVE_VLDRH_T2: -+ case MVE_VLDRW_T7: - case MVE_VSTRB_T5: - case MVE_VSTRH_T6: - case MVE_VSTRW_T7: -@@ -6661,7 +6664,7 @@ is_mve_unpredictable (unsigned long given, enum mve_instructions matched_insn, - *unpredictable_code = UNPRED_R15; - return TRUE; - } -- else if (rt == rt2) -+ else if (rt == rt2 && matched_insn != MVE_VMOV2_GP_TO_VEC_LANE) - { - *unpredictable_code = UNPRED_GP_REGS_EQUAL; - return TRUE; -diff --git a/opcodes/s390-mkopc.c b/opcodes/s390-mkopc.c -index bf2ef41d13a..bcd453314a1 100644 ---- a/opcodes/s390-mkopc.c -+++ b/opcodes/s390-mkopc.c -@@ -381,6 +381,8 @@ main (void) - else if (strcmp (cpu_string, "z15") == 0 - || strcmp (cpu_string, "arch13") == 0) - min_cpu = S390_OPCODE_ARCH13; -+ else if (strcmp (cpu_string, "arch14") == 0) -+ min_cpu = S390_OPCODE_ARCH14; - else { - fprintf (stderr, "Couldn't parse cpu string %s\n", cpu_string); - exit (1); -diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt -index 1f921563aa4..aa00b4f3b69 100644 ---- a/opcodes/s390-opc.txt -+++ b/opcodes/s390-opc.txt -@@ -2016,3 +2016,31 @@ e60000000052 vcvbg VRR_RV0UU "vector convert to binary 64 bit" arch13 zarch optp - # Message Security Assist Extension 9 - - b93a kdsa RRE_RR "compute digital signature authentication" arch13 zarch -+ -+ -+# arch14 instructions -+ -+e60000000074 vschp VRR_VVV0U0U " " arch14 zarch -+e60000002074 vschsp VRR_VVV0U0 " " arch14 zarch -+e60000003074 vschdp VRR_VVV0U0 " " arch14 zarch -+e60000004074 vschxp VRR_VVV0U0 " " arch14 zarch -+e6000000007c vscshp VRR_VVV " " arch14 zarch -+e6000000007d vcsph VRR_VVV0U0 " " arch14 zarch -+e60000000051 vclzdp VRR_VV0U2 " " arch14 zarch -+e60000000070 vpkzr VRI_VVV0UU2 " " arch14 zarch -+e60000000072 vsrpr VRI_VVV0UU2 " " arch14 zarch -+e60000000054 vupkzh VRR_VV0U2 " " arch14 zarch -+e6000000005c vupkzl VRR_VV0U2 " " arch14 zarch -+ -+b93b nnpa RRE_00 " " arch14 zarch -+e60000000056 vclfnh VRR_VV0UU2 " " arch14 zarch -+e6000000005e vclfnl VRR_VV0UU2 " " arch14 zarch -+e60000000075 vcrnf VRR_VVV0UU " " arch14 zarch -+e6000000005d vcfn VRR_VV0UU2 " " arch14 zarch -+e60000000055 vcnf VRR_VV0UU2 " " arch14 zarch -+ -+b98B rdp RRF_RURR2 " " arch14 zarch optparm -+ -+eb0000000071 lpswey SIY_URD " " arch14 zarch -+b200 lbear S_RD " " arch14 zarch -+b201 stbear S_RD " " arch14 zarch +diff --git a/bfd/ChangeLog b/bfd/ChangeLog +index 4de75dd9bf0..0c9c1a8a4fc 100644 +--- a/bfd/ChangeLog ++++ b/bfd/ChangeLog +@@ -1,3 +1,18 @@ ++2021-05-03 Alan Modra ++ ++ PR 27755 ++ * elf32-ppc.c (ppc_elf_inline_plt): Do increment rel in loop. ++ ++2021-03-22 H.J. Lu ++ ++ PR ld/27587 ++ * dwarf2.c (read_attribute_value): Check version >= 3 for ++ DW_FORM_ref_addr. ++ ++2021-01-30 Nick Clifton ++ ++ * development.sh (development): Set to true. ++ + 2021-01-30 Nick Clifton + + This is the 2.35.2 release. +diff --git a/bfd/development.sh b/bfd/development.sh +index 32be4b9460f..6bbed41d6d4 100644 +--- a/bfd/development.sh ++++ b/bfd/development.sh +@@ -16,7 +16,7 @@ + # along with this program. If not, see . + + # Controls whether to enable development-mode features by default. +-development=false ++development=true + + # Indicate whether this is a release branch. + experimental=false +diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c +index 767e9731199..c7561cdeeec 100644 +--- a/bfd/dwarf2.c ++++ b/bfd/dwarf2.c +@@ -1182,7 +1182,7 @@ read_attribute_value (struct attribute * attr, + case DW_FORM_ref_addr: + /* DW_FORM_ref_addr is an address in DWARF2, and an offset in + DWARF3. */ +- if (unit->version == 3 || unit->version == 4) ++ if (unit->version >= 3) + { + if (unit->offset_size == 4) + attr->u.val = read_4_bytes (unit->abfd, info_ptr, info_ptr_end); +diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c +index 11ae6e82f4b..eb35d4bd83b 100644 +--- a/bfd/elf32-ppc.c ++++ b/bfd/elf32-ppc.c +@@ -4246,7 +4246,7 @@ ppc_elf_inline_plt (struct bfd_link_info *info) + return FALSE; + + relend = relstart + sec->reloc_count; +- for (rel = relstart; rel < relend; ) ++ for (rel = relstart; rel < relend; rel++) + { + enum elf_ppc_reloc_type r_type; + unsigned long r_symndx; diff --git a/patches/gcc/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch b/patches/gcc/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch index 5dce434b..b207acce 100644 --- a/patches/gcc/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +++ b/patches/gcc/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch @@ -1,4 +1,4 @@ -From 49c826ad1ccaf63569b25318990a531ebe6fbc9c Mon Sep 17 00:00:00 2001 +From 5b8de466aa959a6c929cee2c78e4159a0209b4f8 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:46:56 +0000 Subject: [PATCH] On linux targets pass --as-needed by default to the linker, @@ -22,7 +22,7 @@ Subject: [PATCH] On linux targets pass --as-needed by default to the linker, 14 files changed, 36 insertions(+), 19 deletions(-) diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h -index 7f2529a2a1d..b097e1688aa 100644 +index e587e2e9ad6..1d1017aa523 100644 --- a/gcc/config/aarch64/aarch64-linux.h +++ b/gcc/config/aarch64/aarch64-linux.h @@ -35,6 +35,7 @@ @@ -34,7 +34,7 @@ index 7f2529a2a1d..b097e1688aa 100644 %{shared:-shared} \ %{symbolic:-Bsymbolic} \ diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h -index c1dae8ca2cf..a87dc740171 100644 +index e25fcac3c59..22b2f7b0d14 100644 --- a/gcc/config/alpha/linux-elf.h +++ b/gcc/config/alpha/linux-elf.h @@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see @@ -47,7 +47,7 @@ index c1dae8ca2cf..a87dc740171 100644 %{shared:-shared} \ %{!shared: \ diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h -index 0c1c4e70b6b..8b581afacdd 100644 +index 0ec3aa53189..f8bda84de2a 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -70,6 +70,7 @@ @@ -59,19 +59,16 @@ index 0c1c4e70b6b..8b581afacdd 100644 SUBTARGET_EXTRA_LINK_SPEC diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h -index 5ebbf42a13d..902378e1bad 100644 +index ff2e880b1fa..7f30c363e4a 100644 --- a/gcc/config/gnu-user.h +++ b/gcc/config/gnu-user.h -@@ -136,7 +136,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +@@ -136,17 +136,17 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \ "%{static-libasan:%{!shared:" \ LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \ - LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}" + LD_DYNAMIC_OPTION "}}%{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lasan %{fuse-ld=gold:--as-needed;:--pop-state}}" - #undef LIBHWASAN_EARLY_SPEC - #define LIBHWASAN_EARLY_SPEC "%{static-libhwasan:%{!shared:" \ - LD_STATIC_OPTION " --whole-archive -lhwasan --no-whole-archive " \ -@@ -145,12 +145,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + #undef LIBTSAN_EARLY_SPEC #define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \ "%{static-libtsan:%{!shared:" \ LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \ @@ -87,10 +84,10 @@ index 5ebbf42a13d..902378e1bad 100644 #undef TARGET_F951_OPTIONS diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h -index a23e7ab3eb7..12ac8cb93a9 100644 +index ae4aa844f02..54b91c0492a 100644 --- a/gcc/config/i386/gnu-user.h +++ b/gcc/config/i386/gnu-user.h -@@ -68,7 +68,7 @@ along with GCC; see the file COPYING3. If not see +@@ -74,7 +74,7 @@ along with GCC; see the file COPYING3. If not see { "link_emulation", GNU_USER_LINK_EMULATION },\ { "dynamic_linker", GNU_USER_DYNAMIC_LINKER } @@ -100,7 +97,7 @@ index a23e7ab3eb7..12ac8cb93a9 100644 %{!static: \ %{!static-pie: \ diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h -index f3e25b1412a..712b0f1c30e 100644 +index 785c68220b8..21dd66b412a 100644 --- a/gcc/config/i386/gnu-user64.h +++ b/gcc/config/i386/gnu-user64.h @@ -56,6 +56,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see @@ -112,7 +109,7 @@ index f3e25b1412a..712b0f1c30e 100644 %{!shared: \ %{!static: \ diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h -index ac40c3dfd3f..6e19e25c35a 100644 +index ee38e218aec..0325971d818 100644 --- a/gcc/config/ia64/linux.h +++ b/gcc/config/ia64/linux.h @@ -58,7 +58,7 @@ do { \ @@ -125,7 +122,7 @@ index ac40c3dfd3f..6e19e25c35a 100644 %{!shared: \ %{!static: \ diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h -index a390bcece83..be0ee289367 100644 +index 5d0782100bb..4be5fbb2191 100644 --- a/gcc/config/mips/gnu-user.h +++ b/gcc/config/mips/gnu-user.h @@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see @@ -137,7 +134,7 @@ index a390bcece83..be0ee289367 100644 %{!static: \ %{rdynamic:-export-dynamic} \ diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h -index fce5b896e6e..ee29979dd34 100644 +index 4afef7c228c..ba1a6e60e05 100644 --- a/gcc/config/riscv/linux.h +++ b/gcc/config/riscv/linux.h @@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see @@ -145,14 +142,14 @@ index fce5b896e6e..ee29979dd34 100644 #define LINK_SPEC "\ +-as-needed \ - -melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " \ + -melf" XLEN_SPEC "lriscv" LD_EMUL_SUFFIX " \ %{mno-relax:--no-relax} \ - %{mbig-endian:-EB} \ + %{shared} \ diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h -index e3f2cd254f6..43499ed29cf 100644 +index 2ded3301282..a1e44ddcc0d 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h -@@ -374,13 +374,13 @@ extern int dot_symbols; +@@ -457,13 +457,13 @@ extern int dot_symbols; " -m elf64ppc") #endif @@ -169,7 +166,7 @@ index e3f2cd254f6..43499ed29cf 100644 %{rdynamic:-export-dynamic} \ -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \ diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h -index 510abe169c5..3c1f3a8ec5d 100644 +index 9ade72114e9..9490b84a153 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -789,7 +789,7 @@ GNU_USER_TARGET_CC1_SPEC @@ -182,7 +179,7 @@ index 510abe169c5..3c1f3a8ec5d 100644 -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}" diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h -index daa48fdfc2b..2fcfc5d770f 100644 +index 6919b468f06..56d52d41b31 100644 --- a/gcc/config/s390/linux.h +++ b/gcc/config/s390/linux.h @@ -82,7 +82,7 @@ along with GCC; see the file COPYING3. If not see @@ -195,7 +192,7 @@ index daa48fdfc2b..2fcfc5d770f 100644 %{!shared: \ %{static:-static} \ diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h -index 2550d7ee8f0..7596d0b2757 100644 +index 63853e60c03..de6d8675456 100644 --- a/gcc/config/sparc/linux.h +++ b/gcc/config/sparc/linux.h @@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); @@ -208,10 +205,10 @@ index 2550d7ee8f0..7596d0b2757 100644 %{!shared: \ %{!static: \ diff --git a/gcc/gcc.c b/gcc/gcc.c -index faf9ce76b3d..1ad5da6d769 100644 +index 625c9ab7902..7aec9d3a016 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c -@@ -737,8 +737,11 @@ proper position among the other output files. */ +@@ -695,8 +695,11 @@ proper position among the other output files. */ #ifdef LIBASAN_EARLY_SPEC #define LIBASAN_SPEC STATIC_LIBASAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -225,7 +222,7 @@ index faf9ce76b3d..1ad5da6d769 100644 STATIC_LIBASAN_LIBS #else #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS -@@ -773,8 +776,11 @@ proper position among the other output files. */ +@@ -713,8 +716,11 @@ proper position among the other output files. */ #ifdef LIBTSAN_EARLY_SPEC #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -239,7 +236,7 @@ index faf9ce76b3d..1ad5da6d769 100644 STATIC_LIBTSAN_LIBS #else #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS -@@ -791,8 +797,11 @@ proper position among the other output files. */ +@@ -731,8 +737,11 @@ proper position among the other output files. */ #ifdef LIBLSAN_EARLY_SPEC #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -253,7 +250,7 @@ index faf9ce76b3d..1ad5da6d769 100644 STATIC_LIBLSAN_LIBS #else #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS -@@ -807,8 +816,11 @@ proper position among the other output files. */ +@@ -747,8 +756,11 @@ proper position among the other output files. */ #define STATIC_LIBUBSAN_LIBS \ " %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}" #ifdef HAVE_LD_STATIC_DYNAMIC @@ -268,5 +265,5 @@ index faf9ce76b3d..1ad5da6d769 100644 #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS -- -2.34.1 +2.29.2 diff --git a/patches/gcc/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch b/patches/gcc/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch index 4660066d..b0952ddf 100644 --- a/patches/gcc/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch +++ b/patches/gcc/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch @@ -1,4 +1,4 @@ -From 7e7c1f8a11a36e286a00f2eca90f55b3a32917b5 Mon Sep 17 00:00:00 2001 +From cfa0c7a3154415fe0e0ab6bd373a8f2164024ff5 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:49:40 +0000 Subject: [PATCH] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding @@ -10,10 +10,10 @@ Subject: [PATCH] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/gcc.c b/gcc/gcc.c -index 1ad5da6d769..99314032ec2 100644 +index 7aec9d3a016..daeb4d0c8ea 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c -@@ -989,6 +989,12 @@ proper position among the other output files. */ +@@ -886,6 +886,12 @@ proper position among the other output files. */ #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" #endif @@ -26,20 +26,20 @@ index 1ad5da6d769..99314032ec2 100644 #ifndef LINK_SSP_SPEC #ifdef TARGET_LIBC_PROVIDES_SSP #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ -@@ -1288,7 +1294,7 @@ static const char *cc1_options = +@@ -1170,7 +1176,7 @@ static const char *cc1_options = %{-version:--version}\ %{-help=*:--help=%*}\ - %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\ + %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\ - %{fsyntax-only:-o %j} %{-param*}\ + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ %{coverage:-fprofile-arcs -ftest-coverage}\ %{fprofile-arcs|fprofile-generate*|coverage:\ %{!fprofile-update=single:\ diff --git a/gcc/params.opt b/gcc/params.opt -index 8ba281b4cfa..bab39cdf8a2 100644 +index 4aec480798b..eaecfab37ad 100644 --- a/gcc/params.opt +++ b/gcc/params.opt -@@ -946,7 +946,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim +@@ -853,7 +853,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim The maximum number of SSA_NAME assignments to follow in determining a value. -param=ssp-buffer-size= @@ -49,5 +49,5 @@ index 8ba281b4cfa..bab39cdf8a2 100644 -param=stack-clash-protection-guard-size= -- -2.34.1 +2.29.2 diff --git a/patches/gcc/11/0002-posix_memalign.patch b/patches/gcc/10/0002-posix_memalign.patch similarity index 90% rename from patches/gcc/11/0002-posix_memalign.patch rename to patches/gcc/10/0002-posix_memalign.patch index ff1fbc2a..ecfd73d1 100644 --- a/patches/gcc/11/0002-posix_memalign.patch +++ b/patches/gcc/10/0002-posix_memalign.patch @@ -1,14 +1,14 @@ -From ba7401783edf0dd9e5503c934b58e1b4fb4595f1 Mon Sep 17 00:00:00 2001 +From d14c344854d4dc9077c02bc0894958af97fdf24d Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 26 Jan 2018 20:32:50 +0000 -Subject: [PATCH 2/5] posix_memalign +Subject: [PATCH 2/6] posix_memalign --- gcc/config/i386/pmm_malloc.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h -index 1b0bfe37852..d7b2b19bb3c 100644 +index 87344d9383f..ece428df487 100644 --- a/gcc/config/i386/pmm_malloc.h +++ b/gcc/config/i386/pmm_malloc.h @@ -27,12 +27,13 @@ diff --git a/patches/gcc/11/0003-j2.patch b/patches/gcc/10/0003-j2.patch similarity index 94% rename from patches/gcc/11/0003-j2.patch rename to patches/gcc/10/0003-j2.patch index 23f088d1..fb5e92c3 100644 --- a/patches/gcc/11/0003-j2.patch +++ b/patches/gcc/10/0003-j2.patch @@ -1,7 +1,7 @@ -From 8155bf9547c6a40a053799f4e4158bc5621ce7a0 Mon Sep 17 00:00:00 2001 +From 9eefe24c3af27614b9c37c363db9ba64cd89d1a4 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 26 Jan 2018 20:29:56 +0000 -Subject: [PATCH 3/5] j2 +Subject: [PATCH 3/6] j2 --- gcc/config.gcc | 26 ++++++++++++--------- @@ -13,10 +13,10 @@ Subject: [PATCH 3/5] j2 6 files changed, 98 insertions(+), 18 deletions(-) diff --git a/gcc/config.gcc b/gcc/config.gcc -index 357b0bed067..528add999f2 100644 +index 6fcdd771d4c..839a60d866e 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc -@@ -556,7 +556,7 @@ s390*-*-*) +@@ -547,7 +547,7 @@ s390*-*-*) extra_headers="s390intrin.h htmintrin.h htmxlintrin.h vecintrin.h" ;; # Note the 'l'; we need to be able to match e.g. "shle" or "shl". @@ -25,7 +25,7 @@ index 357b0bed067..528add999f2 100644 cpu_type=sh extra_options="${extra_options} fused-madd.opt" extra_objs="${extra_objs} sh_treg_combine.o sh-mem.o sh_optimize_sett_clrt.o" -@@ -3202,18 +3202,18 @@ s390x-ibm-tpf*) +@@ -3149,18 +3149,18 @@ s390x-ibm-tpf*) extra_options="${extra_options} s390/tpf.opt" tmake_file="${tmake_file} s390/t-s390" ;; @@ -48,7 +48,7 @@ index 357b0bed067..528add999f2 100644 *) with_endian=big,little ;; esac fi -@@ -3280,6 +3280,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \ +@@ -3227,6 +3227,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \ sh2a_nofpu*) sh_cpu_target=sh2a-nofpu ;; sh2a*) sh_cpu_target=sh2a ;; sh2e*) sh_cpu_target=sh2e ;; @@ -56,7 +56,7 @@ index 357b0bed067..528add999f2 100644 sh2*) sh_cpu_target=sh2 ;; *) sh_cpu_target=sh1 ;; esac -@@ -3301,7 +3302,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \ +@@ -3248,7 +3249,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \ sh2a-single-only | sh2a-single | sh2a-nofpu | sh2a | \ sh4a-single-only | sh4a-single | sh4a-nofpu | sh4a | sh4al | \ sh4-single-only | sh4-single | sh4-nofpu | sh4 | sh4-300 | \ @@ -65,7 +65,7 @@ index 357b0bed067..528add999f2 100644 "") sh_cpu_default=${sh_cpu_target} ;; *) echo "with_cpu=$with_cpu not supported"; exit 1 ;; esac -@@ -3310,9 +3311,9 @@ sh-*-elf* | sh[12346l]*-*-elf* | \ +@@ -3257,9 +3258,9 @@ sh-*-elf* | sh[12346l]*-*-elf* | \ case ${target} in sh[1234]*) sh_multilibs=${sh_cpu_target} ;; sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;; @@ -77,7 +77,7 @@ index 357b0bed067..528add999f2 100644 esac if test x$with_fp = xno; then sh_multilibs="`echo $sh_multilibs|sed -e s/m4/sh4-nofpu/ -e s/,m4-[^,]*//g -e s/,m[23]e// -e s/m2a,m2a-single/m2a-nofpu/ -e s/m5-..m....,//g`" -@@ -3327,7 +3328,8 @@ sh-*-elf* | sh[12346l]*-*-elf* | \ +@@ -3274,7 +3275,8 @@ sh-*-elf* | sh[12346l]*-*-elf* | \ m1 | m2 | m2e | m3 | m3e | \ m4 | m4-single | m4-single-only | m4-nofpu | m4-300 |\ m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al | \ @@ -87,7 +87,7 @@ index 357b0bed067..528add999f2 100644 # TM_MULTILIB_CONFIG is used by t-sh for the non-endian multilib definition # It is passed to MULTIILIB_OPTIONS verbatim. TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG}/${sh_multilib}" -@@ -3344,7 +3346,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \ +@@ -3291,7 +3293,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \ done TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's:^/::'` if test x${enable_incomplete_targets} = xyes ; then @@ -96,7 +96,7 @@ index 357b0bed067..528add999f2 100644 fi tm_file="$tm_file ./sysroot-suffix.h" tmake_file="$tmake_file t-sysroot-suffix" -@@ -5175,6 +5177,8 @@ case "${target}" in +@@ -5105,6 +5107,8 @@ case "${target}" in ;; m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al) ;; @@ -105,7 +105,7 @@ index 357b0bed067..528add999f2 100644 *) echo "Unknown CPU used in --with-cpu=$with_cpu, known values:" 1>&2 echo "m1 m2 m2e m3 m3e m4 m4-single m4-single-only m4-nofpu" 1>&2 -@@ -5385,7 +5389,7 @@ case ${target} in +@@ -5315,7 +5319,7 @@ case ${target} in tmake_file="${cpu_type}/t-${cpu_type} ${tmake_file}" ;; @@ -115,7 +115,7 @@ index 357b0bed067..528add999f2 100644 cxx_target_objs="${cxx_target_objs} sh-c.o" ;; diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c -index 1564109c942..798c1c1c1a3 100644 +index 84c0ea025b4..f15552af011 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -686,6 +686,7 @@ parse_validate_atomic_model_option (const char* str) @@ -154,7 +154,7 @@ index 1564109c942..798c1c1c1a3 100644 sh_cpu = PROCESSOR_SH3; if (TARGET_SH3E) diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h -index d2280e2ffe6..3a54a896721 100644 +index 8ab5455505c..6ffed6da403 100644 --- a/gcc/config/sh/sh.h +++ b/gcc/config/sh/sh.h @@ -85,6 +85,7 @@ extern int code_for_indirect_jump_scratch; @@ -236,7 +236,7 @@ index d2280e2ffe6..3a54a896721 100644 PROCESSOR_SH3E, PROCESSOR_SH4, diff --git a/gcc/config/sh/sh.opt b/gcc/config/sh/sh.opt -index b4755a812f3..0989a1c18da 100644 +index 908603b92e1..e6108dabbc6 100644 --- a/gcc/config/sh/sh.opt +++ b/gcc/config/sh/sh.opt @@ -65,6 +65,10 @@ m2e @@ -251,7 +251,7 @@ index b4755a812f3..0989a1c18da 100644 Target RejectNegative Mask(SH3) Condition(SUPPORT_SH3) Generate SH3 code. diff --git a/gcc/config/sh/sync.md b/gcc/config/sh/sync.md -index 2b43f8edb86..118fc5d06db 100644 +index 25f3b695d2f..55119386a18 100644 --- a/gcc/config/sh/sync.md +++ b/gcc/config/sh/sync.md @@ -240,6 +240,9 @@ @@ -323,7 +323,7 @@ index 2b43f8edb86..118fc5d06db 100644 ;; operand. In order to express that, we have to open code the memory ;; operand. Initially the insn is expanded like every other atomic insn diff --git a/gcc/config/sh/t-sh b/gcc/config/sh/t-sh -index 888f8ff7f25..29fd6ae45fd 100644 +index a402359be72..dbd0bf992bf 100644 --- a/gcc/config/sh/t-sh +++ b/gcc/config/sh/t-sh @@ -50,7 +50,8 @@ MULTILIB_MATCHES = $(shell \ diff --git a/patches/gcc/11/0004-static-pie.patch b/patches/gcc/10/0004-static-pie.patch similarity index 90% rename from patches/gcc/11/0004-static-pie.patch rename to patches/gcc/10/0004-static-pie.patch index 48f6476c..32f48a9d 100644 --- a/patches/gcc/11/0004-static-pie.patch +++ b/patches/gcc/10/0004-static-pie.patch @@ -1,7 +1,7 @@ -From f2dc7594a780d945fc5b1532ab9609cf1d735457 Mon Sep 17 00:00:00 2001 +From f98d6d0809c020b547d45755f68b0d997607292a Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 18 Aug 2018 23:58:45 +0000 -Subject: [PATCH 4/5] static-pie +Subject: [PATCH 4/6] static-pie in gcc-8 -static means static non-pie, even if -pie or -static-pie are specified, -static-pie can be used to build static pie. @@ -16,10 +16,10 @@ an alias to -static -pie. 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/gcc/common.opt b/gcc/common.opt -index a75b44ee47e..7c564818b49 100644 +index ec5235c3a41..dcee05500ba 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -3473,11 +3473,11 @@ Driver +@@ -3401,11 +3401,11 @@ Driver no-pie Driver RejectNegative Negative(shared) @@ -34,7 +34,7 @@ index a75b44ee47e..7c564818b49 100644 static-pie Driver RejectNegative Negative(pie) diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h -index 5ebbf42a13d..bb907d8e89a 100644 +index ff2e880b1fa..bafde149202 100644 --- a/gcc/config/gnu-user.h +++ b/gcc/config/gnu-user.h @@ -51,13 +51,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see @@ -80,10 +80,10 @@ index 5ebbf42a13d..bb907d8e89a 100644 #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \ diff --git a/gcc/gcc.c b/gcc/gcc.c -index 3c81c5798d8..cd96eac5d12 100644 +index e6887590ae2..df6e3965f13 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c -@@ -1010,7 +1010,7 @@ proper position among the other output files. */ +@@ -907,7 +907,7 @@ proper position among the other output files. */ #define NO_FPIE_AND_FPIC_SPEC NO_FPIE_SPEC "|" NO_FPIC_SPEC #define FPIE_OR_FPIC_SPEC NO_FPIE_AND_FPIC_SPEC ":;" #else @@ -92,7 +92,7 @@ index 3c81c5798d8..cd96eac5d12 100644 #define FPIE1_SPEC "fpie" #define NO_FPIE1_SPEC FPIE1_SPEC ":;" #define FPIE2_SPEC "fPIE" -@@ -1034,12 +1034,12 @@ proper position among the other output files. */ +@@ -931,12 +931,12 @@ proper position among the other output files. */ #ifndef LINK_PIE_SPEC #ifdef HAVE_LD_PIE #ifndef LD_PIE_SPEC diff --git a/patches/gcc/10/0005-libstdc-futex-time64.patch b/patches/gcc/10/0005-libstdc-futex-time64.patch new file mode 100644 index 00000000..b43a60cb --- /dev/null +++ b/patches/gcc/10/0005-libstdc-futex-time64.patch @@ -0,0 +1,42 @@ +From 2e0e9b467821f2e4d3b5eb72018e1da65167787c Mon Sep 17 00:00:00 2001 +From: Szabolcs Nagy +Date: Mon, 24 May 2021 20:39:17 +0000 +Subject: [PATCH 5/6] libstdc++-futex-time64 + +--- + libstdc++-v3/src/c++11/futex.cc | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/libstdc++-v3/src/c++11/futex.cc b/libstdc++-v3/src/c++11/futex.cc +index 698737d9b21..230d32574c6 100644 +--- a/libstdc++-v3/src/c++11/futex.cc ++++ b/libstdc++-v3/src/c++11/futex.cc +@@ -46,13 +46,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + + namespace + { ++#if defined(SYS_futex_time64) && SYS_futex_time64 != SYS_futex ++ typedef struct ++ { ++ long tv_sec; ++ long tv_nsec; ++ } sys_timespec; ++#else ++ typedef struct timespec sys_timespec; ++#endif ++ + // Return the relative duration from (now_s + now_ns) to (abs_s + abs_ns) + // as a timespec. +- struct timespec ++ sys_timespec + relative_timespec(chrono::seconds abs_s, chrono::nanoseconds abs_ns, + time_t now_s, long now_ns) + { +- struct timespec rt; ++ sys_timespec rt; + + // Did we already time out? + if (now_s > abs_s.count()) +-- +2.31.1 + diff --git a/patches/gcc/11/0005-m68k-sqrt.patch b/patches/gcc/10/0006-m68k-sqrt.patch similarity index 86% rename from patches/gcc/11/0005-m68k-sqrt.patch rename to patches/gcc/10/0006-m68k-sqrt.patch index 9eab234d..61f32c16 100644 --- a/patches/gcc/11/0005-m68k-sqrt.patch +++ b/patches/gcc/10/0006-m68k-sqrt.patch @@ -1,14 +1,14 @@ -From a0d8a166ceb234bbee2d5f97dff2c54c378c4b56 Mon Sep 17 00:00:00 2001 +From c993f40c536cf140b3c0a48bb323a01d21623d64 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 24 May 2021 19:54:11 +0000 -Subject: [PATCH 5/5] m68k sqrt +Subject: [PATCH 6/6] m68k sqrt --- gcc/config/m68k/m68k.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md -index 59a456cd496..dbfddea41bd 100644 +index 8e35357ea23..65c8b10b3eb 100644 --- a/gcc/config/m68k/m68k.md +++ b/gcc/config/m68k/m68k.md @@ -4174,13 +4174,13 @@ diff --git a/patches/gcc/11/extra-musl_libssp.patch b/patches/gcc/10/extra-musl_libssp.patch similarity index 100% rename from patches/gcc/11/extra-musl_libssp.patch rename to patches/gcc/10/extra-musl_libssp.patch diff --git a/patches/gcc/11/extra-relro-in-dragora.patch b/patches/gcc/10/extra-relro-in-dragora.patch similarity index 100% rename from patches/gcc/11/extra-relro-in-dragora.patch rename to patches/gcc/10/extra-relro-in-dragora.patch diff --git a/patches/gcc/gcc-11-bug80196.patch b/patches/gcc/gcc-11-bug80196.patch deleted file mode 100644 index f1ec338e..00000000 --- a/patches/gcc/gcc-11-bug80196.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/configure b/configure -index 6157a8c87fb..2a4a05b4edf 100755 ---- a/configure -+++ b/configure -@@ -16653,7 +16653,7 @@ else - fi - - --RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET" -+RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET -nostdinc++" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target ar" >&5 - $as_echo_n "checking where to find the target ar... " >&6; } -diff --git a/configure.ac b/configure.ac -index 2ff48941754..01ecc8c42d9 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3515,7 +3515,7 @@ ACX_CHECK_INSTALLED_TARGET_TOOL(STRIP_FOR_TARGET, strip) - ACX_CHECK_INSTALLED_TARGET_TOOL(WINDRES_FOR_TARGET, windres) - ACX_CHECK_INSTALLED_TARGET_TOOL(WINDMC_FOR_TARGET, windmc) - --RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET" -+RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET -nostdinc++" - - GCC_TARGET_TOOL(ar, AR_FOR_TARGET, AR, [binutils/ar]) - GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [gas/as-new]) diff --git a/patches/gdbm/gcc-10-ftbfs.patch b/patches/gdbm/gcc-10-ftbfs.patch deleted file mode 100644 index 1d54b2ba..00000000 --- a/patches/gdbm/gcc-10-ftbfs.patch +++ /dev/null @@ -1,20 +0,0 @@ -Description: fix ftbfs with gcc-10 due to duplicate definitions -Author: Steve Langasek -Last-Update: 2020-08-11 -Bug-Debian: https://bugs.debian.org/957259 - -Index: gdbm-1.18.1/src/parseopt.c -=================================================================== ---- gdbm-1.18.1.orig/src/parseopt.c -+++ gdbm-1.18.1/src/parseopt.c -@@ -255,8 +255,8 @@ - } - - char *parseopt_program_name; --char *parseopt_program_doc; --char *parseopt_program_args; -+extern char *parseopt_program_doc; -+extern char *parseopt_program_args; - const char *program_bug_address = "<" PACKAGE_BUGREPORT ">"; - void (*parseopt_help_hook) (FILE *stream); - diff --git a/patches/gdbm/patch-fix-spelling-error-in-gdbm.3.patch b/patches/gdbm/patch-fix-spelling-error-in-gdbm.3.patch deleted file mode 100644 index 76df57a8..00000000 --- a/patches/gdbm/patch-fix-spelling-error-in-gdbm.3.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Dmitry Bogatov -Date: Wed, 21 Feb 2018 15:28:56 +0300 -X-Dgit-Generated: 1.14.1-5~UNRELEASED e5153db259fdcddf8d808aaf7e9de59b1e8c8001 -Subject: [PATCH] Fix spelling error in gdbm.3 - - ---- - - -diff --git a/doc/gdbm.3 b/doc/gdbm.3 -index d803748..d36a852 100644 ---- a/doc/gdbm.3 -+++ b/doc/gdbm.3 -@@ -310,7 +310,7 @@ physically written to the disk file. - - .BI "int gdbm_sync (GDBM_FILE " dbf ");" - --It will not return until the disk file state is syncronized with the -+It will not return until the disk file state is synchronized with the - in-memory state of the database. - - To convert a \fBgdbm\fR error code into English text, use this routine: diff --git a/patches/glib2/glib-2.70.0-skip_warnings-1.patch b/patches/glib2/glib-2.70.2-skip_warnings-1.patch similarity index 100% rename from patches/glib2/glib-2.70.0-skip_warnings-1.patch rename to patches/glib2/glib-2.70.2-skip_warnings-1.patch diff --git a/patches/musl/branch-updates.diff b/patches/musl/branch-updates.diff index d34611c0..07724d34 100644 --- a/patches/musl/branch-updates.diff +++ b/patches/musl/branch-updates.diff @@ -255,9 +255,18 @@ index a6117951..e943883d 100644 +#define __NR_process_madvise 440 diff --git a/configure b/configure -index a5231a0e..e1aefed7 100755 +index a5231a0e..ca5cbc0b 100755 --- a/configure +++ b/configure +@@ -409,7 +409,7 @@ test "$debug" = yes && CFLAGS_AUTO=-g + # + printf "checking whether we should preprocess assembly to add debugging information... " + if fnmatch '-g*|*\ -g*' "$CFLAGS_AUTO $CFLAGS" && +- test -f "tools/add-cfi.$ARCH.awk" && ++ test -f "$srcdir/tools/add-cfi.$ARCH.awk" && + printf ".file 1 \"srcfile.s\"\n.line 1\n.cfi_startproc\n.cfi_endproc" | $CC -g -x assembler -c -o /dev/null 2>/dev/null - + then + ADD_CFI=yes @@ -671,9 +671,7 @@ trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf fi @@ -592,6 +601,150 @@ index 6b868c84..5b9c8be4 100644 ret = (callback)(&info, sizeof (info), data); +diff --git a/src/ctype/nonspacing.h b/src/ctype/nonspacing.h +index 5d05a3d1..7746f3b6 100644 +--- a/src/ctype/nonspacing.h ++++ b/src/ctype/nonspacing.h +@@ -1,23 +1,23 @@ +-16,16,16,18,19,20,21,22,23,24,25,26,27,28,29,30,31,16,16,32,16,16,16,33,34,35, +-36,37,38,39,16,16,40,16,16,16,16,16,16,16,16,16,16,16,41,42,16,16,43,16,16,16, ++16,16,16,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,16,33,16,16,16,34,35,36, ++37,38,39,40,16,16,41,16,16,16,16,16,16,16,16,16,16,16,42,43,16,16,44,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +-16,16,16,16,16,16,16,16,16,16,44,16,45,46,47,48,16,16,16,16,16,16,16,16,16,16, ++16,16,16,16,16,16,16,16,16,16,45,16,46,47,48,49,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, ++16,16,16,16,16,16,16,50,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, ++16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,51,16,16,52, ++53,16,54,55,56,16,16,16,16,16,16,57,16,16,58,16,59,60,61,62,63,64,65,66,67,68, ++69,70,16,71,72,73,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, ++16,74,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +-16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,49,16,16,50, +-51,16,52,53,54,16,16,16,16,16,16,55,16,16,56,16,57,58,59,60,61,62,63,64,65,66, +-67,68,16,69,70,71,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +-16,72,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, ++16,16,16,75,76,16,16,16,77,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +-16,16,16,73,74,16,16,16,75,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +-16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +-16,16,16,16,16,16,16,76,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +-16,16,77,78,16,16,16,16,16,16,16,79,16,16,16,16,16,80,81,82,16,16,16,16,16,83, +-84,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, ++16,16,16,16,16,16,16,78,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, ++16,16,79,80,16,16,16,16,16,16,16,81,16,16,16,16,16,82,83,84,16,16,16,16,16,85, ++86,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +@@ -35,55 +35,57 @@ + 242,7,128,127,0,0,0,0,0,0,0,0,0,0,0,0,242,31,0,63,0,0,0,0,0,0,0,0,0,3,0,0,160, + 2,0,0,0,0,0,0,254,127,223,224,255,254,255,255,255,31,64,0,0,0,0,0,0,0,0,0,0,0, + 0,224,253,102,0,0,0,195,1,0,30,0,100,32,0,32,0,0,0,0,0,0,0,0,0,0,0, +-0,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0, +-0,0,28,0,0,0,12,0,0,0,12,0,0,0,0,0,0,0,176,63,64,254,15,32,0,0,0,0,0,120,0,0, +-0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,1,4,14,0, +-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,9,0,0,0,0,0,0,64,127, +-229,31,248,159,0,0,0,0,0,0,255,127,0,0,0,0,0,0,0,0,15,0,0,0,0,0,208,23,4,0,0, +-0,0,248,15,0,3,0,0,0,60,59,0,0,0,0,0,0,64,163,3,0,0,0,0,0,0,240,207,0,0,0,0,0, +-0,0,0,0,0,0,0,0,0,0,0,0,0,0,247,255,253,33,16,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +-0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255, ++0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255, ++255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,0,0,0,28,0,0,0,28,0,0,0,12,0,0,0,12,0,0,0,0,0,0,0,176,63,64,254, ++15,32,0,0,0,0,0,120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,2,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,135,1,4,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ++128,9,0,0,0,0,0,0,64,127,229,31,248,159,0,0,0,0,0,0,255,127,0,0,0,0,0,0,0,0, ++15,0,0,0,0,0,208,23,4,0,0,0,0,248,15,0,3,0,0,0,60,59,0,0,0,0,0,0,64,163,3,0,0, ++0,0,0,0,240,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,247,255,253,33,16, ++3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255, + 251,0,248,0,0,0,124,0,0,0,0,0,0,223,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255, + 255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0, + 0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,128,247,63,0,0,0,192,0,0,0,0,0,0,0,0,0,0,3,0,68,8,0,0,96,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,255,255,3,128,0,0,0,0,192,63,0,0,128,255,3,0, +-0,0,0,0,7,0,0,0,0,0,200,51,0,0,0,0,32,0,0,0,0,0,0,0,0,126,102,0,8,16,0,0,0,0, +-0,16,0,0,0,0,0,0,157,193,2,0,0,0,0,48,64, +-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,33,0,0,0,0,0,64, +-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,255,255,0, +-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0, +-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +-0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +-0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +-0,110,240,0,0,0,0,0,135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0, +-0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +-0,0,0,192,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,255, +-127,0,0,0,0,0,0,128,3,0,0,0,0,0,120,38,0,32,0,0,0,0,0,0,7,0,0,0,128,239,31,0, +-0,0,0,0,0,0,8,0,3,0,0,0,0,0,192,127,0,30,0,0,0,0,0,0,0,0,0,0,0,128,211,64,0,0, +-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,248,7,0,0,3,0,0,0,0,0,0,24,1,0,0,0,192, +-31,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,92,0,0,64,0,0,0,0,0, +-0,0,0,0,0,248,133,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +-0,60,176,1,0,0,48,0,0,0, +-0,0,0,0,0,0,0,248,167,1,0,0,0,0,0,0,0,0,0,0,0,0,40,191,0,0,0,0,0,0,0,0,0,0,0, +-0,224,188,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +-128,255,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,12,1,0,0,0,254,7,0,0,0,0,248,121,128,0, +-126,14,0,0,0,0,0,252,127,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,191,0,0,0, +-0,0,0,0,0,0,0,252,255,255,252,109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,126,180,191,0, +-0,0,0,0,0,0,0,0,163,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +-0,0,0,0,0,0,0,0,0,0,0,0,0,0,24, +-0,0,0,0,0,0,0,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,127,0,0,0, +-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0, +-0,128,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,15, +-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,248,255,231,15,0,0,0,60,0, +-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +-0,0,0,255,255,255,255,255,255,127,248,255,255,255,255,255,31,32,0,16,0,0,248, +-254,255,0,0,0,0,0,0,0,0,0, +-0,127,255,255,249,219,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +-0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +-0,0,0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,240,7,0,0,0,0,0,0,0,0, +-0,0,0,0,0,0,0,0,0,0,0,0,0,0, ++0,0,0,0,7,0,0,0,0,0,200,51,0,0,0,0,32,0,0, ++0,0,0,0,0,0,126,102,0,8,16,0,0,0,0,0,16,0,0,0,0,0,0,157,193,2,0,0,0,0,48,64,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,33,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,0,0,0, ++64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,255, ++255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,1,0,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,110,240,0, ++0,0,0,0,135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0,240,0,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,255,1,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,255,127,0,0,0,0,0,0,128, ++3,0,0,0,0,0,120,38,0,32,0,0,0,0,0,0,7,0,0,0,128,239,31,0,0,0,0,0,0,0,8,0,3,0, ++0,0,0,0,192,127,0,30,0,0,0,0,0,0,0,0,0,0,0,128,211,64,0,0,0,0,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,128,248,7,0,0,3,0,0,0,0,0,0,24,1,0,0,0,192,31,31,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,0,255,92,0,0,64,0,0,0,0,0,0,0,0,0,0,248,133,13,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,176,1,0,0,48,0,0,0,0,0,0,0,0,0,0, ++248,167,1,0,0,0,0,0,0,0,0,0,0,0,0,40,191,0,0,0,0,0,0,0,0,0,0,0,0,224,188,15,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,255,6,0,0,0,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,240,12,1,0,0,0,254,7,0,0,0,0,248,121,128,0,126,14,0,0,0,0,0,252, ++127,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,191,0,0,0,0,0,0,0,0,0,0,252,255, ++255,252,109,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,126,180,191,0,0,0,0,0,0,0,0,0,163,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,255, ++1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,128,7,0,0,0,0,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,15,0,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,248,255,231,15,0,0,0,60,0,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255, ++255,255,255,255,127,248,255,255,255,255,255,31,32,0,16,0,0,248,254,255,0,0,0, ++0,0,0,0,0,0,0,127,255,255,249,219,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,240,7,0,0, ++0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, diff --git a/src/env/__libc_start_main.c b/src/env/__libc_start_main.c index 8fbe5262..c5b277bd 100644 --- a/src/env/__libc_start_main.c @@ -702,6 +855,34 @@ index deff5b10..93baa814 100644 #endif return __syscall_ret(r); } +diff --git a/src/locale/strtod_l.c b/src/locale/strtod_l.c +new file mode 100644 +index 00000000..574ba148 +--- /dev/null ++++ b/src/locale/strtod_l.c +@@ -0,0 +1,22 @@ ++#define _GNU_SOURCE ++#include ++#include ++ ++float strtof_l(const char *restrict s, char **restrict p, locale_t l) ++{ ++ return strtof(s, p); ++} ++ ++double strtod_l(const char *restrict s, char **restrict p, locale_t l) ++{ ++ return strtod(s, p); ++} ++ ++long double strtold_l(const char *restrict s, char **restrict p, locale_t l) ++{ ++ return strtold(s, p); ++} ++ ++weak_alias(strtof_l, __strtof_l); ++weak_alias(strtod_l, __strtod_l); ++weak_alias(strtold_l, __strtold_l); diff --git a/src/malloc/free.c b/src/malloc/free.c index f17a952c..3944f7b2 100644 --- a/src/malloc/free.c @@ -1356,6 +1537,21 @@ index 00000000..efe7ccec +{ + __qsort_r(base, nel, width, wrapper_cmp, cmp); +} +diff --git a/src/stdlib/strtod.c b/src/stdlib/strtod.c +index a5d0118a..39b9daad 100644 +--- a/src/stdlib/strtod.c ++++ b/src/stdlib/strtod.c +@@ -28,10 +28,3 @@ long double strtold(const char *restrict s, char **restrict p) + { + return strtox(s, p, 2); + } +- +-weak_alias(strtof, strtof_l); +-weak_alias(strtod, strtod_l); +-weak_alias(strtold, strtold_l); +-weak_alias(strtof, __strtof_l); +-weak_alias(strtod, __strtod_l); +-weak_alias(strtold, __strtold_l); diff --git a/src/thread/pthread_getname_np.c b/src/thread/pthread_getname_np.c new file mode 100644 index 00000000..85504e45 diff --git a/patches/readline/readline81-002 b/patches/readline/readline81-002 new file mode 100644 index 00000000..3fbfb794 --- /dev/null +++ b/patches/readline/readline81-002 @@ -0,0 +1,45 @@ + READLINE PATCH REPORT + ===================== + +Readline-Release: 8.1 +Patch-ID: readline81-002 + +Bug-Reported-by: Volodymyr Prodan +Bug-Reference-ID: +Bug-Reference-URL: https://savannah.gnu.org/patch/?10076 + +Bug-Description: + +There are some characters (e.g., cyrillic) that can't be displayed using +certain single-byte encodings (e.g., cp1251) because the negative signed +int is interpreted as EOF and not displayed. + +Patch (apply with `patch -p0'): + +*** ../readline-8.1-patched/display.c 2021-03-16 18:12:20.000000000 -0400 +--- display.c 2021-06-07 16:53:08.000000000 -0400 +*************** +*** 1599,1603 **** + + for (cur_face = FACE_NORMAL, i = 0; i < n; i++) +! putc_face (str[i], face[i], &cur_face); + putc_face (EOF, FACE_NORMAL, &cur_face); + } +--- 1599,1603 ---- + + for (cur_face = FACE_NORMAL, i = 0; i < n; i++) +! putc_face ((unsigned char) str[i], face[i], &cur_face); + putc_face (EOF, FACE_NORMAL, &cur_face); + } + +*** ../readline-8.1/patchlevel 2013-11-15 08:11:11.000000000 -0500 +--- patchlevel 2014-03-21 08:28:40.000000000 -0400 +*************** +*** 1,3 **** + # Do not edit -- exists only for use by patch + +! 1 +--- 1,3 ---- + # Do not edit -- exists only for use by patch + +! 2 diff --git a/recipes/00-core.order b/recipes/00-core.order index c0cbdb35..a879b85a 100644 --- a/recipes/00-core.order +++ b/recipes/00-core.order @@ -30,7 +30,7 @@ devel/fortify-headers: libs/musl: # Native Language Support (NLS) -tools/gettext-tiny: +libs/gettext: # Libraries, linker and compiler related devel/m4: @@ -216,7 +216,7 @@ boot/eudev: kernel/kmod devel/gperf db/tzdb: # Various ISO standards, database -data/iso-codes: tools/gettext-tiny +data/iso-codes: # PCI/USB user-space support tools/pciutils: kernel/kmod libs/hwids @@ -240,7 +240,7 @@ tools/lvm2: tools/mdadm # vim (if someone does not need it). tools/dosfstools: boot/eudev tools/vim-tiny -tools/xfsprogs: libs/inih libs/icu libs/readline tools/util-linux tools/gettext-tiny +tools/xfsprogs: libs/inih libs/icu libs/readline tools/util-linux tools/reiser4progs: libs/libaal tools/btrfs-progs: libs/lzo tools/squashfs-tools: tools/attr compressors/plzip @@ -282,7 +282,7 @@ gnupg/libassuan: gnupg/libksba: libs/npth: -gnupg/pinentry-nox11: gnupg/libgpg-error gnupg/libassuan +gnupg/pinentry: gnupg/libgpg-error gnupg/libassuan gnupg/gnupg2: gnupg/gpgme: diff --git a/recipes/boot/sysvinit/recipe b/recipes/boot/sysvinit/recipe index eca0abda..d4fc9429 100644 --- a/recipes/boot/sysvinit/recipe +++ b/recipes/boot/sysvinit/recipe @@ -1,6 +1,6 @@ # Build recipe for sysvinit. # -# Copyright (c) 2018-2021 Matias Fonzo, . +# Copyright (c) 2018-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=sysvinit -version=2.99 +version=3.01 release=1 # Define a category for the output of the package name @@ -87,6 +87,6 @@ build() # Copy documentation mkdir -p "${destdir}${docsdir}" - cp -p $docs "${destdir}${docsdir}"/ + cp -p $docs "${destdir}${docsdir}" } diff --git a/recipes/daemons/acpid/recipe b/recipes/daemons/acpid/recipe index 5ce00cc3..fe1590d7 100644 --- a/recipes/daemons/acpid/recipe +++ b/recipes/daemons/acpid/recipe @@ -1,6 +1,6 @@ # Build recipe for acpid. # -# Copyright (c) 2018-2019 Matias Fonzo, . +# Copyright (c) 2018-2019, 2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=acpid -version=2.0.32 +version=2.0.33 release=1 # Define a category for the output of the package name diff --git a/recipes/daemons/at/recipe b/recipes/daemons/at/recipe index 43c2d55a..bbc121b7 100644 --- a/recipes/daemons/at/recipe +++ b/recipes/daemons/at/recipe @@ -1,6 +1,6 @@ # Build recipe for at. # -# Copyright (c) 2018, 2020-2021 Matias Fonzo, . +# Copyright (c) 2018, 2020-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,8 +18,8 @@ set -e program=at -version=3.2.1 -release=2 +version=3.2.2 +release=1 # Define a category for the output of the package name pkgcategory=daemons @@ -71,7 +71,8 @@ build() # Apply a patch (from "Void Linux") to solve build issues patch -p0 < "${worktree}/patches/at/flex_isleap.patch" - ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \ + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \ SENDMAIL=/usr/sbin/sendmail \ $configure_args \ --mandir=$mandir \ diff --git a/recipes/daemons/sysklogd/recipe b/recipes/daemons/sysklogd/recipe index 40748cc5..863da679 100644 --- a/recipes/daemons/sysklogd/recipe +++ b/recipes/daemons/sysklogd/recipe @@ -1,6 +1,6 @@ # Build recipe for sysklogd. # -# Copyright (c) 2021 Matias Fonzo, . +# Copyright (c) 2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=sysklogd -version=2.2.1 +version=2.3.0 release=1 # Define a category for the output of the package name diff --git a/recipes/data/alsa-ucm-conf/recipe b/recipes/data/alsa-ucm-conf/recipe index 594190e6..f416aea4 100644 --- a/recipes/data/alsa-ucm-conf/recipe +++ b/recipes/data/alsa-ucm-conf/recipe @@ -1,6 +1,6 @@ # Build recipe for alsa-ucm-conf. # -# Copyright (c) 2021 Matias Fonzo, . +# Copyright (c) 2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=alsa-ucm-conf -version=1.2.5.1 +version=1.2.6.3 arch=noarch release=1 diff --git a/recipes/data/iana-etc/recipe b/recipes/data/iana-etc/recipe index 8dd69428..67814a49 100644 --- a/recipes/data/iana-etc/recipe +++ b/recipes/data/iana-etc/recipe @@ -1,6 +1,6 @@ # Build recipe for iana-etc. # -# Copyright (c) 2017, 2021 Matias Fonzo, . +# Copyright (c) 2017, 2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,16 +19,23 @@ set -e program=iana-etc version=2.30 +update_version=20211229 arch=noarch -release=2 +release=1 # Define a category for the output of the package name pkgcategory=data +# Define custom package version +pkgversion=${version}_${update_version} + tarname=${program}-${version}.tar.bz2 # Remote source(s) -fetch=http://sethwklein.net/$tarname +fetch=" + http://sethwklein.net/$tarname + https://github.com/Mic92/iana-etc/releases/download/${version}/$tarname +" description=" Provides /etc/services and /etc/protocols files. @@ -43,11 +50,12 @@ license=OSLv3.0 # Source documentation docs="COPYING CREDITS NEWS README VERSION" -docsdir="${docdir}/${program}-${version}" +docsdir="${docdir}/${program}-${pkgversion}" build() { unpack "${tardir}/$tarname" + unpack "${tardir}/${program}-${update_version}.tar.gz" cd "$srcdir" @@ -56,15 +64,24 @@ build() make all && make DESTDIR="$destdir" install + # Update files from 'update_version' iana's variant + cp -f -p "${TMPDIR}/${program}-${update_version}"/protocols \ + "${destdir}/etc" + cp -f -p "${TMPDIR}/${program}-${update_version}"/services \ + "${destdir}/etc" + # To handle config file(s) touch "${destdir}/etc/.graft-config" # Copy documentation mkdir -p "${destdir}${docsdir}" - - for file in $docs - do - cp -p $file "${destdir}${docsdir}" - done + cp -p $docs "${destdir}${docsdir}" + + # Do not keep the update version source, unless --keep is passed in Qi + if test -z "$keep_srcdir" + then + rm -rf -- "${TMPDIR}/${program}-${update_version}" + fi + unset -v update_version } diff --git a/recipes/data/iso-codes/recipe b/recipes/data/iso-codes/recipe index a158d44b..f9bc55f5 100644 --- a/recipes/data/iso-codes/recipe +++ b/recipes/data/iso-codes/recipe @@ -1,6 +1,6 @@ # Build recipe for iso-codes. # -# Copyright (C) 2018-2019, 2021 Matias Fonzo, . +# Copyright (C) 2018-2019, 2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,9 +18,9 @@ set -e program=iso-codes -version=4.5.0 +version=4.6.0 arch=noarch -release=2 +release=1 # Define a category for the output of the package name pkgcategory=data diff --git a/recipes/db/gdbm/recipe b/recipes/db/gdbm/recipe index 0864331e..7af9ad42 100644 --- a/recipes/db/gdbm/recipe +++ b/recipes/db/gdbm/recipe @@ -1,6 +1,6 @@ # Build recipe for gdbm. # -# Copyright (c) 2016-2018, 2020 Matias Fonzo, . +# Copyright (c) 2016-2018, 2020, 2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,8 +18,8 @@ set -e program=gdbm -version=1.18.1 -release=2 +version=1.22 +release=1 # Define a category for the output of the package name pkgcategory=db @@ -49,15 +49,11 @@ build() cd "$srcdir" - # Apply a few patches from Debian - - patch -Np1 -i "${worktree}/patches/gdbm/patch-fix-spelling-error-in-gdbm.3.patch" - patch -Np1 -i "${worktree}/patches/gdbm/gcc-10-ftbfs.patch" - # Set sane permissions chmod -R u+w,go-w,a+rX-s . - ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ $configure_args \ --libdir=/usr/lib${libSuffix} \ --infodir=$infodir \ diff --git a/recipes/db/sqlite/recipe b/recipes/db/sqlite/recipe index 0fe18b99..59cb090f 100644 --- a/recipes/db/sqlite/recipe +++ b/recipes/db/sqlite/recipe @@ -1,6 +1,6 @@ # Build recipe for sqlite. # -# Copyright (c) 2019-2021 Matias Fonzo, . +# Copyright (c) 2019-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=sqlite -version=3340000 +version=3370200 release=1 # Define a category for the output of the package name diff --git a/recipes/devel/bc/recipe b/recipes/devel/bc/recipe index cf56ce1c..1d56bcba 100644 --- a/recipes/devel/bc/recipe +++ b/recipes/devel/bc/recipe @@ -1,6 +1,6 @@ # Build recipe for bc. # -# Copyright (c) 2016-2017, 2021 Matias Fonzo, . +# Copyright (c) 2016-2017, 2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=bc -version=5.0.2 +version=5.2.1 release=1 # Define a category for the output of the package name diff --git a/recipes/devel/binutils/recipe b/recipes/devel/binutils/recipe index f5b1c7e8..4fc0e862 100644 --- a/recipes/devel/binutils/recipe +++ b/recipes/devel/binutils/recipe @@ -18,8 +18,8 @@ set -e program=binutils -version=2.36.1 -release=1 +version=2.35.2 +release=2 # Define a category for the output of the package name pkgcategory=devel @@ -56,33 +56,76 @@ build() chmod -R u+w,go-w,a+rX-s . # Apply patches from Fedora (Nick Clifton) - patch -Np1 -i "${worktree}/patches/binutils/binutils-export-demangle.h.patch" - patch -Np1 -i "${worktree}/patches/binutils/binutils-no-config-h-check.patch" - patch -Np1 -i "${worktree}/patches/binutils/binutils-gold-warn-unsupported.patch" - patch -Np1 -i "${worktree}/patches/binutils/binutils-use-long-long.patch" + + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-2.25-version.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-export-demangle.h.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-2.22.52.0.4-no-config-h-check.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-2.29-filename-in-error-messages.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-2.29-revert-PLT-elision.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-readelf-other-sym-info.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-2.27-aarch64-ifunc.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-do-not-link-with-static-libstdc++.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-attach-to-group.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-special-sections-in-groups.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-fix-testsuite-failures.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gold-mismatched-section-flags.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-CVE-2019-1010204.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gold-warn-unsupported.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-s390-build.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-config.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-warnings.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gcc-10-fixes.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-add-sym-cache-to-elf-link-hash.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-elf-add-objects.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-aarch64-condbranch-relocs.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-ppc-annobin-disassembly.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-strip-merge.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-plugin-as-needed.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-recursive-debuglink-following.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-SHF_LINK_ORDER.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-duplicate-sections.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-use-long-long.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gold-gnu-properties.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-testsuite-failures.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-CVE-2021-20197.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-ld-DWARF-5-sections.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-s390-arch14-insns.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-ppc64le-note-merge.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-readelf-no-warn-gaps.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-unexpected-form-20.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-CVE-2021-20284.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-extend-s390-arch14-support.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-CVE-2021-3487.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-CVE-2020-35448.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-dwarf-5-dir0.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gas-Use-the-directory-name-in-.file-0.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils.unicode.patch" + patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gas-multibyte-warnings.patch" patch -Np1 -i "${worktree}/patches/binutils/branch-updates.diff" # Create a separate build directory + rm -rf BUILD mkdir BUILD cd BUILD - # Set sane permissions - chmod -R u+w,go-w,a+rX-s . - # To pass extra options to binutils according to the architecture + binutils_hash_style=gnu; case $arch in i?86 | amd64 | x32 ) binutils_targets="--enable-targets=i386-efi-pe,x86_64-pep" ;; + mips*) + binutils_hash_style=sysv; + ;; esac # System-dependent MACHINE="$(gcc -dumpmachine)" ../configure CPPFLAGS="$QICPPFLAGS" \ - CFLAGS="$QICFLAGS -fPIC" CXXFLAGS="$QICXXFLAGS -fPIC" \ - LDFLAGS="$(echo $QILDFLAGS | sed 's/-s//') -fPIC" \ + CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" \ + LDFLAGS="$(echo $QILDFLAGS | sed 's/-s//')" \ $configure_args \ $multilib_options \ --libdir=/usr/lib${libSuffix} \ @@ -94,7 +137,7 @@ build() --enable-gold=yes \ --enable-ld=default \ --enable-threads=auto \ - --enable-default-hash-style=gnu \ + --enable-default-hash-style=$binutils_hash_style \ --enable-relro \ --enable-lto \ --enable-nls \ @@ -104,10 +147,11 @@ build() --disable-werror \ --disable-compressed-debug-sections \ --with-system-zlib \ + --with-pic \ --build=$MACHINE \ $binutils_targets - unset -v binutils_targets + unset -v binutils_targets binutils_hash_style make -j${jobs} tooldir=/usr/${MACHINE} #make -j${jobs} check make -j${jobs} tooldir=/usr/${MACHINE} DESTDIR="$destdir" install diff --git a/recipes/devel/bison/recipe b/recipes/devel/bison/recipe index 1fadc186..fa27decf 100644 --- a/recipes/devel/bison/recipe +++ b/recipes/devel/bison/recipe @@ -1,6 +1,6 @@ # Build recipe for bison. # -# Copyright (c) 2015-2021 Matias Fonzo, . +# Copyright (c) 2015-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=bison -version=3.8.1 +version=3.8.2 release=1 # Define a category for the output of the package name diff --git a/recipes/devel/cmake/recipe b/recipes/devel/cmake/recipe index 1716d246..4c1dbce3 100644 --- a/recipes/devel/cmake/recipe +++ b/recipes/devel/cmake/recipe @@ -1,6 +1,6 @@ # Build recipe for cmake. # -# Copyright (c) 2018-2021 Matias Fonzo, . +# Copyright (c) 2018-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=cmake -version=3.21.4 +version=3.22.1 release=1 # Define a category for the output of the package name diff --git a/recipes/devel/elfutils/recipe b/recipes/devel/elfutils/recipe index 30a6dfca..4b2afa9c 100644 --- a/recipes/devel/elfutils/recipe +++ b/recipes/devel/elfutils/recipe @@ -1,6 +1,6 @@ # Build recipe for elfutils. # -# Copyright (c) 2020-2021 Matias Fonzo, . +# Copyright (c) 2020-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,8 +18,8 @@ set -e program=elfutils -version=0.185 -release=2 +version=0.186 +release=1 # Define a category for the output of the package name pkgcategory=devel diff --git a/recipes/devel/gc/recipe b/recipes/devel/gc/recipe index dcdbf531..45c106a6 100644 --- a/recipes/devel/gc/recipe +++ b/recipes/devel/gc/recipe @@ -1,6 +1,6 @@ # Build recipe for gc. # -# Copyright (c) 2018-2019 Matias Fonzo, . +# Copyright (c) 2018-2019, 2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=gc -version=8.0.4 +version=8.0.6 release=1 # Define a category for the output of the package name @@ -64,8 +64,8 @@ build() # Set sane permissions chmod -R u+w,go-w,a+rX-s . - ./configure \ - CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \ + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \ $configure_args \ --libdir=/usr/lib${libSuffix} \ --mandir=$mandir \ @@ -96,6 +96,6 @@ build() # Copy documentation mkdir -p "${destdir}${docsdir}" - cp -p $docs "${destdir}${docsdir}"/ + cp -p $docs "${destdir}${docsdir}" } diff --git a/recipes/devel/gcc/recipe b/recipes/devel/gcc/recipe index a16e2666..7d5bf7d4 100644 --- a/recipes/devel/gcc/recipe +++ b/recipes/devel/gcc/recipe @@ -18,7 +18,7 @@ set -e program=gcc -version=11-20220101 +version=10-20220114 release=1 # Define a category for the output of the package name @@ -28,6 +28,7 @@ tarname=${program}-${version}.tar.xz # Remote source(s) fetch=" + https://gcc.gnu.org/pub/gcc/snapshots/${version}/$tarname https://mirrors.concertpass.com/gcc/snapshots/${version}/$tarname https://mirror.marwan.ma/gcc/snapshots/${version}/$tarname " @@ -60,15 +61,15 @@ build() chmod -R u+w,go-w,a+rX-s . # Apply specific patches for the support in musl. - # https://port70.net/~nsz/musl/gcc-11.1.0/ - - patch -Np1 -i "${worktree}/patches/gcc/11/0002-posix_memalign.patch" - patch -Np1 -i "${worktree}/patches/gcc/11/0003-j2.patch" - patch -Np1 -i "${worktree}/patches/gcc/11/0004-static-pie.patch" - patch -Np1 -i "${worktree}/patches/gcc/11/0005-m68k-sqrt.patch" - - patch -Np1 -i "${worktree}/patches/gcc/11/extra-relro-in-dragora.patch" - patch -Np1 -i "${worktree}/patches/gcc/11/extra-musl_libssp.patch" + # https://port70.net/~nsz/musl/gcc-10.3.0/ + + patch -Np1 -i "${worktree}/patches/gcc/10/0002-posix_memalign.patch" + patch -Np1 -i "${worktree}/patches/gcc/10/0003-j2.patch" + patch -Np1 -i "${worktree}/patches/gcc/10/0004-static-pie.patch" + patch -Np1 -i "${worktree}/patches/gcc/10/0005-libstdc-futex-time64.patch" + patch -Np1 -i "${worktree}/patches/gcc/10/0006-m68k-sqrt.patch" + patch -Np1 -i "${worktree}/patches/gcc/10/extra-musl_libssp.patch" + patch -Np1 -i "${worktree}/patches/gcc/10/extra-relro-in-dragora.patch" # Apply patches from "Alpine Linux" in order to improve the security (Thanks!) patch -Np1 -i "${worktree}/patches/gcc/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch" diff --git a/recipes/devel/git/recipe b/recipes/devel/git/recipe index 0bf49b92..a039d0c2 100644 --- a/recipes/devel/git/recipe +++ b/recipes/devel/git/recipe @@ -1,6 +1,6 @@ # Build recipe for git. # -# Copyright (c) 2017-2019, 2021 Matias Fonzo, . +# Copyright (c) 2017-2019, 2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,8 +18,8 @@ set -e program=git -version=2.33.0 -release=2 +version=2.34.1 +release=1 # Define a category for the output of the package name pkgcategory=devel @@ -116,6 +116,6 @@ EOF # Copy documentation mkdir -p "${destdir}${docsdir}" - cp -p $docs "${destdir}${docsdir}/" + cp -p $docs "${destdir}${docsdir}" } diff --git a/recipes/devel/meson/recipe b/recipes/devel/meson/recipe index 86261221..80539859 100644 --- a/recipes/devel/meson/recipe +++ b/recipes/devel/meson/recipe @@ -1,6 +1,6 @@ # Build recipe for meson. # -# Copyright (c) 2018-2021 Matias Fonzo, . +# Copyright (c) 2018-2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=meson -version=0.59.1 +version=0.61.0 release=1 # Define a category for the output of the package name diff --git a/recipes/devel/rpcsvc-proto/recipe b/recipes/devel/rpcsvc-proto/recipe index 8469ea3d..cea70acf 100644 --- a/recipes/devel/rpcsvc-proto/recipe +++ b/recipes/devel/rpcsvc-proto/recipe @@ -1,6 +1,6 @@ # Build recipe for rpcsvc-proto. # -# Copyright (C) 2020-2021 Matias Fonzo, . +# Copyright (C) 2020-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=rpcsvc-proto -version=1.4.2 +version=1.4.3 release=1 # Define a category for the output of the package name @@ -52,7 +52,8 @@ build() # Set sane permissions chmod -R u+w,go-w,a+rX-s . - ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ $configure_args \ --libdir=/usr/lib${libSuffix} \ --mandir=$mandir \ diff --git a/recipes/devel/strace/recipe b/recipes/devel/strace/recipe index a834a8d4..ee7a4a8d 100644 --- a/recipes/devel/strace/recipe +++ b/recipes/devel/strace/recipe @@ -1,6 +1,6 @@ # Build recipe for strace. # -# Copyright (c) 2018-2021 Matias Fonzo, . +# Copyright (c) 2018-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=strace -version=5.14 +version=5.16 release=1 # Define a category for the output of the package name diff --git a/recipes/devel/tcl/recipe b/recipes/devel/tcl/recipe index 40da221b..8d259eea 100644 --- a/recipes/devel/tcl/recipe +++ b/recipes/devel/tcl/recipe @@ -1,6 +1,6 @@ # Build recipe for tcl. # -# Copyright (c) 2018, 2020-2021 Matias Fonzo, . +# Copyright (c) 2018, 2020-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,9 +18,9 @@ set -e program=tcl -version=8.6.11 +version=8.6.12 series_version="${version%.*}" -release=2 +release=1 # Define a category for the output of the package name pkgcategory=devel @@ -92,8 +92,8 @@ build() make -j${jobs} V=1 # Current versions provided on this release - tdbc_version=1.1.2 - itcl_version=4.2.1 + itcl_version=4.2.2 + tdbc_version=1.1.3 # Fix header and library paths sed -e "s@^\(TCL_SRC_DIR='\).*@\1/usr/include'@" \ diff --git a/recipes/devel/tk/recipe b/recipes/devel/tk/recipe index 5bdbe8c1..c77fe13d 100644 --- a/recipes/devel/tk/recipe +++ b/recipes/devel/tk/recipe @@ -1,6 +1,6 @@ # Build recipe for tk (Tcl/Tk). # -# Copyright (c) 2018-2021 Matias Fonzo, . +# Copyright (c) 2018-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,9 +18,9 @@ set -e program=tk -version=8.6.11.1 +version=8.6.12 series_version=8.6 -release=2 +release=1 # Define a category for the output of the package name pkgcategory=devel @@ -48,7 +48,8 @@ docs="ChangeLog README.md changes license.terms" docsdir="${docdir}/${program}-${version}" # Custom source directory -srcdir="${program}${version%.*}" +#srcdir="${program}${version%.*}" +srcdir="${program}${version}" build() { diff --git a/recipes/devel/vala/recipe b/recipes/devel/vala/recipe index e8c465e8..73cdd7e2 100644 --- a/recipes/devel/vala/recipe +++ b/recipes/devel/vala/recipe @@ -1,6 +1,6 @@ # Build recipe for vala. # -# Copyright (C) 2018-2019, 2021 Matias Fonzo, . +# Copyright (C) 2018-2019, 2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=vala -version=0.54.1 +version=0.54.6 release=1 # Define a category for the output of the package name diff --git a/recipes/devel/valgrind/recipe b/recipes/devel/valgrind/recipe index ba226ff2..552562d5 100644 --- a/recipes/devel/valgrind/recipe +++ b/recipes/devel/valgrind/recipe @@ -1,7 +1,7 @@ # Build recipe for valgrind. # # Copyright (c) 2017 Mateus P. Rodrigues . -# Copyright (c) 2017-2021 Matias Fonzo, . +# Copyright (c) 2017-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ set -e program=valgrind -version=3.17.0 +version=3.18.1 release=1 # Define a category for the output of the package name diff --git a/recipes/docbook/itstool/recipe b/recipes/docbook/itstool/recipe index 4621ea49..0d58eb98 100644 --- a/recipes/docbook/itstool/recipe +++ b/recipes/docbook/itstool/recipe @@ -1,6 +1,6 @@ # Build recipe for itstool. # -# Copyright (c) 2019, 2021 Matias Fonzo, . +# Copyright (c) 2019, 2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,9 +18,9 @@ set -e program=itstool -version=2.0.6 +version=2.0.7 arch=noarch -release=2 +release=1 # Define a category for the output of the package name pkgcategory=docbook diff --git a/recipes/gnupg/gnupg2/recipe b/recipes/gnupg/gnupg2/recipe index e595fcb3..e23e84c6 100644 --- a/recipes/gnupg/gnupg2/recipe +++ b/recipes/gnupg/gnupg2/recipe @@ -1,6 +1,6 @@ # Build recipe for gnupg (version 2). # -# Copyright (c) 2018-2021 Matias Fonzo, . +# Copyright (c) 2018-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ set -e program=gnupg pkgname=gnupg2 -version=2.2.27 +version=2.2.33 release=1 # Define a category for the output of the package name @@ -57,7 +57,8 @@ build() sed -e '/noinst_SCRIPTS = gpg-zip/c sbin_SCRIPTS += gpg-zip' \ -i tools/Makefile.in - ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ $configure_args \ --libdir=/usr/lib${libSuffix} \ --infodir=$infodir \ diff --git a/recipes/gnupg/gpgme/recipe b/recipes/gnupg/gpgme/recipe index 489feb66..1a45e4e6 100644 --- a/recipes/gnupg/gpgme/recipe +++ b/recipes/gnupg/gpgme/recipe @@ -1,6 +1,6 @@ # Build recipe for gpgme. # -# Copyright (c) 2018-2021 Matias Fonzo, . +# Copyright (c) 2018-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=gpgme -version=1.15.1 +version=1.16.0 release=1 # Define a category for the output of the package name @@ -52,8 +52,8 @@ build() # Set sane permissions chmod -R u+w,go-w,a+rX-s . - ./configure \ - CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \ + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \ $configure_args \ --libdir=/usr/lib${libSuffix} \ --infodir=$infodir \ diff --git a/recipes/gnupg/libassuan/recipe b/recipes/gnupg/libassuan/recipe index 74517806..5f3445c1 100644 --- a/recipes/gnupg/libassuan/recipe +++ b/recipes/gnupg/libassuan/recipe @@ -1,6 +1,6 @@ # Build recipe for libassuan. # -# Copyright (c) 2018-2019, 2021 Matias Fonzo, . +# Copyright (c) 2018-2019, 2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=libassuan -version=2.5.4 +version=2.5.5 release=1 # Define a category for the output of the package name @@ -51,7 +51,8 @@ build() # Set sane permissions chmod -R u+w,go-w,a+rX-s . - ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ $configure_args \ --libdir=/usr/lib${libSuffix} \ --infodir=$infodir \ diff --git a/recipes/gnupg/libgcrypt/recipe b/recipes/gnupg/libgcrypt/recipe index dbdb080f..d9c73265 100644 --- a/recipes/gnupg/libgcrypt/recipe +++ b/recipes/gnupg/libgcrypt/recipe @@ -1,6 +1,6 @@ # Build recipe for libgcrypt. # -# Copyright (c) 2018-2021 Matias Fonzo, . +# Copyright (c) 2018-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=libgcrypt -version=1.9.1 +version=1.9.4 release=1 # Define a category for the output of the package name @@ -52,7 +52,8 @@ build() # Set sane permissions chmod -R u+w,go-w,a+rX-s . - ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ $configure_args \ --libdir=/usr/lib${libSuffix} \ --infodir=$infodir \ diff --git a/recipes/gnupg/libgpg-error/recipe b/recipes/gnupg/libgpg-error/recipe index 63de3ca6..35195916 100644 --- a/recipes/gnupg/libgpg-error/recipe +++ b/recipes/gnupg/libgpg-error/recipe @@ -1,6 +1,6 @@ # Build recipe for libgpg-error. # -# Copyright (c) 2018-2021 Matias Fonzo, . +# Copyright (c) 2018-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=libgpg-error -version=1.41 +version=1.43 release=1 # Define a category for the output of the package name @@ -52,7 +52,8 @@ build() # Set sane permissions chmod -R u+w,go-w,a+rX-s . - ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ $configure_args \ --libdir=/usr/lib${libSuffix} \ --infodir=$infodir \ diff --git a/recipes/gnupg/libksba/recipe b/recipes/gnupg/libksba/recipe index 2eed3239..a22ac696 100644 --- a/recipes/gnupg/libksba/recipe +++ b/recipes/gnupg/libksba/recipe @@ -1,6 +1,6 @@ # Build recipe for libksba. # -# Copyright (c) 2018, 2020-2021 Matias Fonzo, . +# Copyright (c) 2018, 2020-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,8 +18,8 @@ set -e program=libksba -version=1.5.0 -release=2 +version=1.6.0 +release=1 # Define a category for the output of the package name pkgcategory=gnupg @@ -27,7 +27,7 @@ pkgcategory=gnupg tarname=${program}-${version}.tar.bz2 # Remote source(s) -fetch=http://www.gnupg.org/ftp/gcrypt/libksba/$tarname +fetch=https://www.gnupg.org/ftp/gcrypt/libksba/$tarname description=" CMS and X.509 access library. @@ -53,7 +53,8 @@ build() # Set sane permissions chmod -R u+w,go-w,a+rX-s . - ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ $configure_args \ --libdir=/usr/lib${libSuffix} \ --infodir=$infodir \ diff --git a/recipes/gnupg/pinentry-nox11/recipe b/recipes/gnupg/pinentry/recipe similarity index 88% rename from recipes/gnupg/pinentry-nox11/recipe rename to recipes/gnupg/pinentry/recipe index ff6445ab..a55a5340 100644 --- a/recipes/gnupg/pinentry-nox11/recipe +++ b/recipes/gnupg/pinentry/recipe @@ -1,6 +1,6 @@ # Build recipe for pinentry. # -# Copyright (c) 2020 Matias Fonzo, . +# Copyright (c) 2020, 2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,8 +18,7 @@ set -e program=pinentry -pkgname=pinentry-nox11 -version=1.1.0 +version=1.2.0 release=1 # Define a category for the output of the package name @@ -42,7 +41,7 @@ license=GPLv2+ # Source documentation docs="AUTHORS COPYING* ChangeLog NEWS README* THANKS TODO VERSION" -docsdir="${docdir}/${pkgname}-${version}" +docsdir="${docdir}/${program}-${version}" build() { @@ -53,15 +52,13 @@ build() # Set sane permissions chmod -R u+w,go-w,a+rX-s . - ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ $configure_args \ --libdir=/usr/lib${libSuffix} \ --infodir=$infodir \ --mandir=$mandir \ --docdir=$docsdir \ - --disable-pinentry-gtk2 \ - --disable-pinentry-gnome3 \ - --disable-pinentry-qt \ --enable-pinentry-tty \ --enable-fallback-curses \ --build="$(gcc -dumpmachine)" diff --git a/recipes/libs/alsa-lib/recipe b/recipes/libs/alsa-lib/recipe index 848825fe..027bcad9 100644 --- a/recipes/libs/alsa-lib/recipe +++ b/recipes/libs/alsa-lib/recipe @@ -1,6 +1,6 @@ # Build recipe for alsa-lib. # -# Copyright (c) 2017-2021 Matias Fonzo, . +# Copyright (c) 2017-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=alsa-lib -version=1.2.5.1 +version=1.2.6.1 release=1 # Define a category for the output of the package name diff --git a/recipes/libs/alsa-plugins/recipe b/recipes/libs/alsa-plugins/recipe index 9ebc1a2f..dbe04f32 100644 --- a/recipes/libs/alsa-plugins/recipe +++ b/recipes/libs/alsa-plugins/recipe @@ -1,6 +1,6 @@ # Build recipe for alsa-plugins. # -# Copyright (c) 2017-2021 Matias Fonzo, . +# Copyright (c) 2017-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=alsa-plugins -version=1.2.5 +version=1.2.6 release=1 # Define a category for the output of the package name diff --git a/recipes/libs/expat/recipe b/recipes/libs/expat/recipe index f71bade8..33e4db5e 100644 --- a/recipes/libs/expat/recipe +++ b/recipes/libs/expat/recipe @@ -1,7 +1,7 @@ # Recipe file for expat. # # Copyright (c) 2017 Mateus P. Rodrigues, . -# Copyright (c) 2017-2019, 2021 Matias Fonzo, . +# Copyright (c) 2017-2019, 2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ set -e program=expat -version=2.2.10 +version=2.4.2 release=1 # Define a category for the output of the package name @@ -52,14 +52,15 @@ build() { # Set sane permissions chmod -R u+w,go-w,a+rX-s . - ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ - $configure_args \ - --libdir=/usr/lib${libSuffix} \ - --mandir=$mandir \ - --docdir=$docsdir \ - --enable-static=no \ - --enable-shared=yes \ - --build="$(gcc -dumpmachine)" + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ + $configure_args \ + --libdir=/usr/lib${libSuffix} \ + --mandir=$mandir \ + --docdir=$docsdir \ + --enable-static=no \ + --enable-shared=yes \ + --build="$(gcc -dumpmachine)" make -j${jobs} V=1 make -j${jobs} DESTDIR="$destdir" install-strip @@ -79,6 +80,6 @@ build() { # Copy documentation mkdir -p "${destdir}${docsdir}" - cp -p $docs "${destdir}${docsdir}/" + cp -p $docs "${destdir}${docsdir}" } diff --git a/recipes/libs/libidn2/recipe b/recipes/libs/gettext/recipe similarity index 69% copy from recipes/libs/libidn2/recipe copy to recipes/libs/gettext/recipe index 6ef601f0..25195239 100644 --- a/recipes/libs/libidn2/recipe +++ b/recipes/libs/gettext/recipe @@ -1,6 +1,6 @@ -# Build recipe for libidn2. +# Build recipe for gettext. # -# Copyright (c) 2021 Matias Fonzo, . +# Copyright (c) 2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,30 +17,32 @@ # Exit immediately on any error set -e -program=libidn2 -version=2.3.1 +program=gettext +version=0.21 release=1 # Define a category for the output of the package name pkgcategory=libs -tarname=${program}-${version}.tar.gz +tarname=${program}-${version}.tar.lz # Remote source(s) -fetch=https://ftp.gnu.org/gnu/libidn/$tarname +fetch=https://ftp.gnu.org/gnu/gettext/$tarname description=" -An implementation of IDNA2008. +Utilities for internationalization and localization. -Libidn2 is a free software implementation of IDNA2008, Punycode and TR46. -Its purpose is to encode and decode internationalized domain names. +The GNU gettext package contains utilities for internationalization +and localization. These allow programs to be compiled with NLS +(Native Language Support), enabling them to output messages in the +user's native language. " -homepage=https://www.gnu.org/software/libidn/ -license="GPLv2+, LGPLv3+" +homepage=https://www.gnu.org/software/gettext +license=GPLv3+ # Source documentation -docs="AUTHORS CONTRIBUTING.md COPYING* ChangeLog NEWS README.md" +docs="AUTHORS COPYING ChangeLog HACKING NEWS README THANKS" docsdir="${docdir}/${program}-${version}" build() @@ -53,23 +55,26 @@ build() chmod -R u+w,go-w,a+rX-s . ./configure CPPFLAGS="$QICPPFLAGS" \ - CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ + CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \ $configure_args \ --libdir=/usr/lib${libSuffix} \ --infodir=$infodir \ --mandir=$mandir \ --docdir=$docsdir \ - --enable-static=no \ + --htmldir=${docsdir}/html \ --enable-shared=yes \ - --disable-doc \ + --enable-static=no \ --build="$(gcc -dumpmachine)" make -j${jobs} V=1 make -j${jobs} DESTDIR="$destdir" install-strip - # Delete generated charset.alias - rm -f "${destdir}/usr/lib${libSuffix}/charset.alias" - rmdir "${destdir}/usr/lib${libSuffix}/" 2> /dev/null || true + # Compress examples + ( + cd "${destdir}$docsdir" && \ + tarlz --solid -9 -cpf examples.tar.lz examples/ && \ + rm -rf examples/ + ) # Compress info documents deleting index file for the package if test -d "${destdir}/$infodir" diff --git a/recipes/libs/glib2-pass1/recipe b/recipes/libs/glib2-pass1/recipe index 69d650b3..ed94e9be 100644 --- a/recipes/libs/glib2-pass1/recipe +++ b/recipes/libs/glib2-pass1/recipe @@ -1,6 +1,6 @@ # Build recipe for glib (release 2, pass 1). # -# Copyright (c) 2020-2021 Matias Fonzo, . +# Copyright (c) 2020-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=glib -version=2.70.1 +version=2.70.2 release=1 # Define a category for the output of the package name @@ -56,7 +56,7 @@ build() # Apply patch from "Beyond Linux From Scratch" to support 'GLIB_LOG_LEVEL' # which enables several warnings levels (Thank you!) - patch -Np1 -i "${worktree}/patches/glib2/glib-2.70.0-skip_warnings-1.patch" + patch -Np1 -i "${worktree}/patches/glib2/glib-2.70.2-skip_warnings-1.patch" # Set sane permissions chmod -R u+w,go-w,a+rX-s . diff --git a/recipes/libs/glib2/recipe b/recipes/libs/glib2/recipe index 1c8d3a7f..47c5bd13 100644 --- a/recipes/libs/glib2/recipe +++ b/recipes/libs/glib2/recipe @@ -1,6 +1,6 @@ # Build recipe for glib (release 2). # -# Copyright (c) 2017-2021 Matias Fonzo, . +# Copyright (c) 2017-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=glib -version=2.70.1 +version=2.70.2 release=1 # Define a category for the output of the package name @@ -59,7 +59,7 @@ build() # Apply patch from "Beyond Linux From Scratch" to support 'GLIB_LOG_LEVEL' # which enables several warnings levels (Thank you!) - patch -Np1 -i "${worktree}/patches/glib2/glib-2.70.0-skip_warnings-1.patch" + patch -Np1 -i "${worktree}/patches/glib2/glib-2.70.2-skip_warnings-1.patch" # Set sane permissions chmod -R u+w,go-w,a+rX-s . diff --git a/recipes/libs/icu/recipe b/recipes/libs/icu/recipe index 9dc126df..cc71decf 100644 --- a/recipes/libs/icu/recipe +++ b/recipes/libs/icu/recipe @@ -1,6 +1,6 @@ # Build recipe for icu. # -# Copyright (c) 2019-2021 Matias Fonzo, . +# Copyright (c) 2019-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=icu4c -version=69_1 +version=70_1 release=1 # Set custom name and custom version for the package diff --git a/recipes/libs/libcap-ng/recipe b/recipes/libs/libcap-ng/recipe index f7419ec0..9e96d12d 100644 --- a/recipes/libs/libcap-ng/recipe +++ b/recipes/libs/libcap-ng/recipe @@ -1,6 +1,6 @@ # Build recipe for libcap-ng. # -# Copyright (c) 2018-2021 Matias Fonzo, . +# Copyright (c) 2018-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ set -e program=libcap-ng version=0.8.2 -release=1 +release=2 # Define a category for the output of the package name pkgcategory=libs @@ -58,7 +58,8 @@ build() # Set sane permissions chmod -R u+w,go-w,a+rX-s . - ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ $configure_args \ --libdir=/usr/lib${libSuffix} \ --infodir=$infodir \ @@ -66,7 +67,7 @@ build() --docdir=$docsdir \ --enable-static=yes \ --enable-shared=yes \ - --with-python \ + --with-python=no \ --with-python3 \ --build="$(gcc -dumpmachine)" diff --git a/recipes/libs/libcap/recipe b/recipes/libs/libcap/recipe index 57f0f120..d41e201b 100644 --- a/recipes/libs/libcap/recipe +++ b/recipes/libs/libcap/recipe @@ -1,6 +1,6 @@ # Build recipe for libcap. # -# Copyright (c) 2016-2019, 2021 Matias Fonzo, . +# Copyright (c) 2016-2019, 2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=libcap -version=2.60 +version=2.62 release=1 # Define a category for the output of the package name diff --git a/recipes/libs/libdatrie/recipe b/recipes/libs/libdatrie/recipe index ed972886..eb7de8fe 100644 --- a/recipes/libs/libdatrie/recipe +++ b/recipes/libs/libdatrie/recipe @@ -1,6 +1,6 @@ # Build recipe for libdatrie. # -# Copyright (C) 2019, 2021 Matias Fonzo, . +# Copyright (C) 2019, 2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ set -e program=libdatrie version=0.2.13 -release=1 +release=2 # Define a category for the output of the package name pkgcategory=libs @@ -77,6 +77,9 @@ build() make -j${jobs} V=1 make -j${jobs} DESTDIR="$destdir" install-strip + # Build and install the trietool utility + ( cd tools/ && make install DESTDIR="$destdir" install-strip ) + # Copy the rest of the documentation mkdir -p "${destdir}${docsdir}" cp -p -f $docs "${destdir}${docsdir}" diff --git a/recipes/libs/libidn2/recipe b/recipes/libs/libidn2/recipe index 6ef601f0..9dbb9887 100644 --- a/recipes/libs/libidn2/recipe +++ b/recipes/libs/libidn2/recipe @@ -1,6 +1,6 @@ # Build recipe for libidn2. # -# Copyright (c) 2021 Matias Fonzo, . +# Copyright (c) 2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=libidn2 -version=2.3.1 +version=2.3.2 release=1 # Define a category for the output of the package name diff --git a/recipes/libs/libjpeg-turbo/recipe b/recipes/libs/libjpeg-turbo/recipe index 7d1faf6d..6ed64639 100644 --- a/recipes/libs/libjpeg-turbo/recipe +++ b/recipes/libs/libjpeg-turbo/recipe @@ -1,7 +1,7 @@ # Build recipe for libjpeg-turbo. # # Copyright (C) 2018, MMPG -# Copyright (C) 2018-2021 Matias Fonzo, . +# Copyright (C) 2018-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ set -e program=libjpeg-turbo -version=2.1.1 +version=2.1.2 release=1 # Define a category for the output of the package name diff --git a/recipes/libs/libpipeline/recipe b/recipes/libs/libpipeline/recipe index 54c65b3e..41ac5e16 100644 --- a/recipes/libs/libpipeline/recipe +++ b/recipes/libs/libpipeline/recipe @@ -1,6 +1,6 @@ # Build recipe for libpipeline. # -# Copyright (c) 2016-2019, 2021 Matias Fonzo, . +# Copyright (c) 2016-2019, 2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=libpipeline -version=1.5.3 +version=1.5.4 release=2 # Define a category for the output of the package name @@ -41,7 +41,7 @@ homepage=https://libpipeline.nongnu.org license=GPLv3+ # Source documentation -docs="COPYING ChangeLog NEWS README TODO" +docs="COPYING ChangeLog NEWS* README* TODO" docsdir="${docdir}/${program}-${version}" build() @@ -53,13 +53,16 @@ build() # Set sane permissions chmod -R u+w,go-w,a+rX-s . - ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ $configure_args \ --libdir=/usr/lib${libSuffix} \ --infodir=$infodir \ --mandir=$mandir \ --enable-static=yes \ --enable-shared=no \ + --enable-threads=posix \ + --enable-socketpair-pipe \ --build="$(gcc -dumpmachine)" make -j${jobs} V=1 diff --git a/recipes/libs/libsigsegv/recipe b/recipes/libs/libsigsegv/recipe index ddf54079..e3bba39e 100644 --- a/recipes/libs/libsigsegv/recipe +++ b/recipes/libs/libsigsegv/recipe @@ -1,7 +1,7 @@ # Build recipe for libsigsegv. # # Copyright (c) 2017 MMPG, . -# Copyright (c) 2017-2018, 2021 Matias Fonzo, . +# Copyright (c) 2017-2018, 2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ set -e program=libsigsegv -version=2.13 +version=2.14 release=1 # Define a category for the output of the package name diff --git a/recipes/libs/libtasn1/recipe b/recipes/libs/libtasn1/recipe index 4e1d6ee1..0df18516 100644 --- a/recipes/libs/libtasn1/recipe +++ b/recipes/libs/libtasn1/recipe @@ -1,6 +1,6 @@ # Build recipe for libtasn1. # -# Copyright (c) 2018-2019, 2021 Matias Fonzo, . +# Copyright (c) 2018-2019, 2021-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=libtasn1 -version=4.17.0 +version=4.18.0 release=1 # Define a category for the output of the package name diff --git a/recipes/libs/libthai/recipe b/recipes/libs/libthai/recipe index 68364d9e..e096676c 100644 --- a/recipes/libs/libthai/recipe +++ b/recipes/libs/libthai/recipe @@ -1,6 +1,6 @@ # Build recipe for libthai. # -# Copyright (C) 2019 Matias Fonzo, . +# Copyright (C) 2019, 2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=libthai -version=0.1.28 +version=0.1.29 release=1 # Define a category for the output of the package name @@ -53,7 +53,8 @@ build() # Set sane permissions chmod -R u+w,go-w,a+rX-s . - ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ $configure_args \ --libdir=/usr/lib${libSuffix} \ --mandir=$mandir \ diff --git a/recipes/libs/libunistring/recipe b/recipes/libs/libunistring/recipe index d3070cb5..a05f7a88 100644 --- a/recipes/libs/libunistring/recipe +++ b/recipes/libs/libunistring/recipe @@ -1,6 +1,6 @@ # Build recipe for libunistring. # -# Copyright (c) 2018 Matias Fonzo, . +# Copyright (c) 2018, 2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=libunistring -version=0.9.10 +version=1.0 release=1 # Define a category for the output of the package name @@ -61,7 +61,8 @@ build() # Set sane permissions chmod -R u+w,go-w,a+rX-s . - ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ $configure_args \ --libdir=/usr/lib${libSuffix} \ --infodir=$infodir \ @@ -102,6 +103,6 @@ build() # Copy documentation mkdir -p "${destdir}${docsdir}" - cp -p $docs "${destdir}${docsdir}"/ + cp -p $docs "${destdir}${docsdir}" } diff --git a/recipes/libs/libuv/recipe b/recipes/libs/libuv/recipe index 0b90e021..9acd9c54 100644 --- a/recipes/libs/libuv/recipe +++ b/recipes/libs/libuv/recipe @@ -1,6 +1,6 @@ # Build recipe for libuv. # -# Copyright (c) 2018-2021 Matias Fonzo, . +# Copyright (c) 2018-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=libuv -version=v1.42.0 +version=v1.43.0 pkgversion="${version#v*}" release=1 diff --git a/recipes/libs/musl/recipe b/recipes/libs/musl/recipe index 9679f611..d91b66fb 100644 --- a/recipes/libs/musl/recipe +++ b/recipes/libs/musl/recipe @@ -1,6 +1,6 @@ # Build recipe for musl. # -# Copyright (c) 2015-2021 Matias Fonzo, . +# Copyright (c) 2015-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ set -e program=musl version=1.2.2 -release=9 +release=10 # Define a category for the output of the package name pkgcategory=libs diff --git a/recipes/libs/readline/recipe b/recipes/libs/readline/recipe index ff0bdf6d..0a961bca 100644 --- a/recipes/libs/readline/recipe +++ b/recipes/libs/readline/recipe @@ -1,6 +1,6 @@ # Build recipe for readline. # -# Copyright (c) 2016-2019, 2021 Matias Fonzo, . +# Copyright (c) 2016-2019, 2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ set -e program=readline version=8.1 -release=2 +release=3 # Define a category for the output of the package name pkgcategory=libs diff --git a/recipes/perl/perl5/recipe b/recipes/perl/perl5/recipe index a9c96642..75c8ada7 100644 --- a/recipes/perl/perl5/recipe +++ b/recipes/perl/perl5/recipe @@ -1,6 +1,6 @@ # Build recipe for perl. # -# Copyright (c) 2016-2021 Matias Fonzo, . +# Copyright (c) 2016-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ set -e program=perl pkgname=perl5 version=5.32.1 -release=2 +release=1 # Define a category for the output of the package name pkgcategory=perl diff --git a/recipes/python/mako/recipe b/recipes/python/mako/recipe index df825919..3901cc5a 100644 --- a/recipes/python/mako/recipe +++ b/recipes/python/mako/recipe @@ -1,6 +1,6 @@ # Build recipe for mako. # -# Copyright (C) 2019-2021 Matias Fonzo, . +# Copyright (C) 2019-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=Mako -version=1.1.3 +version=1.1.6 release=1 pkgname=python-${program} @@ -29,7 +29,7 @@ pkgcategory=python tarname=${program}-${version}.tar.gz # Remote source(s) -fetch=https://files.pythonhosted.org/packages/72/89/402d2b4589e120ca76a6aed8fee906a0f5ae204b50e455edd36eda6e778d/$tarname +fetch=https://files.pythonhosted.org/packages/af/b6/42cd322ae555aa770d49e31b8c5c28a243ba1bbb57ad927e1a5f5b064811/$tarname description=" Mako is a template library written in Python. diff --git a/recipes/python/markupsafe/recipe b/recipes/python/markupsafe/recipe index cf1ea6e6..24f1841a 100644 --- a/recipes/python/markupsafe/recipe +++ b/recipes/python/markupsafe/recipe @@ -1,6 +1,6 @@ # Build recipe for markupsafe. # -# Copyright (C) 2019-2021 Matias Fonzo, . +# Copyright (C) 2019-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,8 +18,8 @@ set -e program=MarkupSafe -version=1.1.1 -release=4 +version=2.0.1 +release=1 pkgname=python-${program} @@ -29,7 +29,7 @@ pkgcategory=python tarname=${program}-${version}.tar.gz # Remote source(s) -fetch=https://files.pythonhosted.org/packages/b9/2e/64db92e53b86efccfaea71321f597fa2e1b2bd3853d8ce658568f7a13094/$tarname +fetch=https://files.pythonhosted.org/packages/bf/10/ff66fea6d1788c458663a84d88787bae15d45daa16f6b3ef33322a51fc7e/$tarname description=" A Python module that implements a XML/HTML/XHTML Markup safe string. diff --git a/recipes/python/python3/recipe b/recipes/python/python3/recipe index bcbab7e0..5fdeaeeb 100644 --- a/recipes/python/python3/recipe +++ b/recipes/python/python3/recipe @@ -1,7 +1,7 @@ # Build recipe for python3. # # Copyright (c) 2017 Mateus P. Rodrigues . -# Copyright (c) 2017-2021 Matias Fonzo, . +# Copyright (c) 2017-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,20 +19,22 @@ set -e program=Python -version=3.9.1 +version=3.10.2 short_version="${version%.*}" -release=2 +release=1 # Define a category for the output of the package name pkgcategory=python +# Define a custom package name +pkgname=python3 + +# The name of the tarball tarname=${program}-${version}.tgz # Remote source(s) fetch=https://www.python.org/ftp/python/${version}/$tarname -pkgname=python3 - description=" Multi-paradigm programming language (v3). @@ -71,7 +73,7 @@ build() --enable-shared \ --enable-loadable-sqlite-extensions \ --enable-ipv6 \ - --with-threads \ + --enable-optimizations \ --with-system-expat \ --with-system-ffi \ --with-ensurepip=yes \ diff --git a/recipes/python/setuptools/recipe b/recipes/python/setuptools/recipe index 3ee6e825..d6cd8605 100644 --- a/recipes/python/setuptools/recipe +++ b/recipes/python/setuptools/recipe @@ -1,6 +1,6 @@ # Build recipe for setuptools. # -# Copyright (C) 2020-2021 Matias Fonzo, . +# Copyright (C) 2020-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=setuptools -version=51.1.2 +version=60.5.0 release=1 pkgname=python-${program} @@ -29,7 +29,7 @@ pkgcategory=python tarname=${program}-${version}.tar.gz # Remote source(s) -fetch=https://files.pythonhosted.org/packages/82/2f/ef7afd98530d07c89deffec833b4b1a91a27a5db6d9f1a216599f5f0316e/$tarname +fetch=https://files.pythonhosted.org/packages/69/77/aee1ecacea4d0db740046ce1785e81d16c4b1755af50eceac4ca1a1f8bfd/$tarname description=" Easily build and distribute Python packages. diff --git a/recipes/python/six/recipe b/recipes/python/six/recipe index f4ea9cd0..d5847b80 100644 --- a/recipes/python/six/recipe +++ b/recipes/python/six/recipe @@ -1,7 +1,7 @@ # Build recipe for six. # # Copyright (C) 2018, MMPG -# Copyright (C) 2018-2021 Matias Fonzo, . +# Copyright (C) 2018-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ set -e program=six -version=1.15.0 +version=1.16.0 release=1 pkgname=python-${program} @@ -30,7 +30,7 @@ pkgcategory=python tarname=${program}-${version}.tar.gz # Remote source(s) -fetch=https://files.pythonhosted.org/packages/21/9f/b251f7f8a76dec1d6651be194dfba8fb8d7781d10ab3987190de8391d08e/$tarname +fetch=https://files.pythonhosted.org/packages/71/39/171f1c67cd00715f190ba0b100d606d440a28c93c7714febeca8b79af85e/$tarname description=" A Python 2 and 3 compatibility library. diff --git a/recipes/tools/alsa-utils/recipe b/recipes/tools/alsa-utils/recipe index 1f6dbaf3..90268b5f 100644 --- a/recipes/tools/alsa-utils/recipe +++ b/recipes/tools/alsa-utils/recipe @@ -1,6 +1,6 @@ # Build recipe for alsa-utils. # -# Copyright (c) 2017-2021 Matias Fonzo, . +# Copyright (c) 2017-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=alsa-utils -version=1.2.5.1 +version=1.2.6 release=1 # Define a category for the output of the package name diff --git a/recipes/tools/file/recipe b/recipes/tools/file/recipe index 12c62a29..3f3bc7b1 100644 --- a/recipes/tools/file/recipe +++ b/recipes/tools/file/recipe @@ -1,6 +1,6 @@ # Build recipe for file. # -# Copyright (c) 2016-2021 Matias Fonzo, . +# Copyright (c) 2016-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=file -version=5.40 +version=5.41 release=1 # Define a category for the output of the package name @@ -40,7 +40,7 @@ homepage=https://darwinsys.com/file license=Custom # Source documentation -docs="AUTHORS COPYING ChangeLog NEWS README TODO" +docs="AUTHORS COPYING ChangeLog NEWS README* RELEASE* TODO" docsdir="${docdir}/${program}-${version}" build() diff --git a/recipes/tools/gettext-tiny/recipe b/recipes/tools/gettext-tiny/recipe deleted file mode 100644 index bec70831..00000000 --- a/recipes/tools/gettext-tiny/recipe +++ /dev/null @@ -1,101 +0,0 @@ -# Build recipe for gettext-tiny. -# -# Copyright (c) 2018-2021 Matias Fonzo, . -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Exit immediately on any error -set -e - -program=gettext-tiny -version=0.3.2 -release=1 - -# Define a category for the output of the package name -pkgcategory=tools - -tarname=${program}-${version}.tar.xz - -# Remote source(s) -fetch=https://ftp.barfooze.de/pub/sabotage/tarballs/$tarname - -description=" -An internationalisation and localisation system. - -gettext-tiny provides lightweight replacements for tools typically used -from the GNU gettext suite, which is incredibly bloated and takes a lot -of time to build (in the order of an hour on slow devices). The most -notable component is msgfmt which is used to create binary translation -files in the .mo format out of textual input files in .po format. -This is the most important tool for building software from source, -because it is used from the build processes of many software packages. - -The gettext-tiny package is compatible with the Musl C Library. -" - -homepage=https://github.com/sabotage-linux/gettext-tiny/ -license=MIT - -# Source documentation -docs="LICENSE README.md" -docsdir="${docdir}/${program}-${version}" - -# Limit paralell jobs to '1' -jobs=1 - -build() -{ - unpack "${tardir}/$tarname" - - cd "$srcdir" - - # Set sane permissions - chmod -R u+w,go-w,a+rX-s . - - # Do not force to some tools to be static - sed -i 's/-static//g' Makefile - - make -j${jobs} LIBINTL=MUSL \ - CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ - prefix=/usr libdir=/usr/lib${libSuffix} \ - DESTDIR="$destdir" install - - strip --strip-unneeded "${destdir}/usr/bin"/* 2> /dev/null || true; - strip --strip-debug "${destdir}/usr/lib${libSuffix}/libintl.a" - - # Introduce our custom version of 'autopoint' which - # works well under busybox's ash, mksh shells. - - cp -p "${worktree}/archive/gettext-tiny/autopoint" \ - "${destdir}/usr/bin/" - chmod 755 "${destdir}/usr/bin/autopoint" - - # Compress and link man pages (if needed) - if test -d "${destdir}/$mandir" - then - ( - cd "${destdir}/$mandir" - find . -type f -exec lzip -9 {} + - find . -type l | while read -r file - do - ln -sf "$(readlink -- "$file").lz" "${file}.lz" - rm -- "$file" - done - ) - fi - - # Copy documentation - mkdir -p "${destdir}${docsdir}" - cp -p $docs "${destdir}${docsdir}"/ -} - diff --git a/recipes/tools/tarlz/recipe b/recipes/tools/tarlz/recipe index fb779ce0..023b6f6b 100644 --- a/recipes/tools/tarlz/recipe +++ b/recipes/tools/tarlz/recipe @@ -1,6 +1,6 @@ # Build recipe for tarlz. # -# Copyright (c) 2019-2021 Matias Fonzo, . +# Copyright (c) 2019-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ set -e program=tarlz -version=0.21 +version=0.22 release=1 # Define a category for the output of the package name diff --git a/sources/Mako-1.1.3.tar.gz.sha256 b/sources/Mako-1.1.3.tar.gz.sha256 deleted file mode 100644 index c93c58a7..00000000 --- a/sources/Mako-1.1.3.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -8195c8c1400ceb53496064314c6736719c6f25e7479cd24c77be3d9361cddc27 Mako-1.1.3.tar.gz diff --git a/sources/Mako-1.1.6.tar.gz.sha256 b/sources/Mako-1.1.6.tar.gz.sha256 new file mode 100644 index 00000000..ad2700aa --- /dev/null +++ b/sources/Mako-1.1.6.tar.gz.sha256 @@ -0,0 +1 @@ +4e9e345a41924a954251b95b4b28e14a301145b544901332e658907a7464b6b2 Mako-1.1.6.tar.gz diff --git a/sources/MarkupSafe-1.1.1.tar.gz.sha256 b/sources/MarkupSafe-1.1.1.tar.gz.sha256 deleted file mode 100644 index c0884c9e..00000000 --- a/sources/MarkupSafe-1.1.1.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b MarkupSafe-1.1.1.tar.gz diff --git a/sources/MarkupSafe-2.0.1.tar.gz.sha256 b/sources/MarkupSafe-2.0.1.tar.gz.sha256 new file mode 100644 index 00000000..a2e0b6aa --- /dev/null +++ b/sources/MarkupSafe-2.0.1.tar.gz.sha256 @@ -0,0 +1 @@ +594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a MarkupSafe-2.0.1.tar.gz diff --git a/sources/Python-3.10.2.tgz.sha256 b/sources/Python-3.10.2.tgz.sha256 new file mode 100644 index 00000000..934260b9 --- /dev/null +++ b/sources/Python-3.10.2.tgz.sha256 @@ -0,0 +1 @@ +3c0ede893011319f9b0a56b44953a3d52c7abf9657c23fb4bc9ced93b86e9c97 Python-3.10.2.tgz diff --git a/sources/Python-3.9.1.tgz.sha256 b/sources/Python-3.9.1.tgz.sha256 deleted file mode 100644 index 9a568dce..00000000 --- a/sources/Python-3.9.1.tgz.sha256 +++ /dev/null @@ -1 +0,0 @@ -29cb91ba038346da0bd9ab84a0a55a845d872c341a4da6879f462e94c741f117 Python-3.9.1.tgz diff --git a/sources/SOURCELIST.txt b/sources/SOURCELIST.txt index 2c085566..4f3dea2a 100644 --- a/sources/SOURCELIST.txt +++ b/sources/SOURCELIST.txt @@ -1,16 +1,16 @@ ftp://ftp.acc.umu.se/pub/gnome/sources/gtk+/3.24/gtk+-3.24.24.tar.xz -ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.2.5.1.tar.bz2 +ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.2.6.1.tar.bz2 ftp://ftp.alsa-project.org/pub/lib/alsa-topology-conf-1.2.5.1.tar.bz2 -ftp://ftp.alsa-project.org/pub/lib/alsa-ucm-conf-1.2.5.1.tar.bz2 -ftp://ftp.alsa-project.org/pub/plugins/alsa-plugins-1.2.5.tar.bz2 -ftp://ftp.alsa-project.org/pub/utils/alsa-utils-1.2.5.1.tar.bz2 -ftp://ftp.astron.com/pub/file/file-5.40.tar.gz +ftp://ftp.alsa-project.org/pub/lib/alsa-ucm-conf-1.2.6.3.tar.bz2 +ftp://ftp.alsa-project.org/pub/plugins/alsa-plugins-1.2.6.tar.bz2 +ftp://ftp.alsa-project.org/pub/utils/alsa-utils-1.2.6.tar.bz2 +ftp://ftp.astron.com/pub/file/file-5.41.tar.gz ftp://ftp.freedesktop.org/pub/mesa/glu/glu-9.0.1.tar.gz ftp://ftp.gnu.org/gnu/aspell/aspell-0.60.8.tar.gz ftp://ftp.gnu.org/gnu/aspell/dict/en/aspell6-en-2020.12.07-0.tar.bz2 ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz ftp://ftp.gnu.org/gnu/gawk/gawk-5.1.0.tar.lz -ftp://ftp.gnu.org/gnu/gdbm/gdbm-1.18.1.tar.gz +ftp://ftp.gnu.org/gnu/gdbm/gdbm-1.22.tar.gz ftp://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.gz ftp://ftp.gnu.org/gnu/m4/m4-1.4.19.tar.bz2 ftp://ftp.gnu.org/gnu/make/make-4.3.tar.lz @@ -18,10 +18,10 @@ ftp://ftp.gnu.org/gnu/patch/patch-2.7.6.tar.bz2 ftp://ftp.gnu.org/gnu/readline/readline-8.1.tar.gz ftp://ftp.mars.org/pub/mpeg/libid3tag-0.15.1b.tar.gz ftp://ftp.ncftp.com/ncftp/ncftp-3.2.6-src.tar.gz -ftp://sourceware.org/pub/valgrind/valgrind-3.17.0.tar.bz2 -http://anduin.linuxfromscratch.org/BLFS/iso-codes/iso-codes-4.5.0.tar.xz +ftp://sourceware.org/pub/valgrind/valgrind-3.18.1.tar.bz2 +https://anduin.linuxfromscratch.org/BLFS/iso-codes/iso-codes-4.6.0.tar.xz http://crux.ster.zone/downloads/jack-audio-connection-kit/jack-audio-connection-kit-0.125.0.tar.gz -http://files.itstool.org/itstool/itstool-2.0.6.tar.bz2 +http://files.itstool.org/itstool/itstool-2.0.7.tar.bz2 http://ftp.barfooze.de/pub/sabotage/tarballs/gettext-tiny-0.3.2.tar.xz http://ftp.midnight-commander.org/mc-4.8.27.tar.bz2 http://ftp.netfilter.org/pub/nftables/nftables-0.9.8.tar.bz2 @@ -34,10 +34,10 @@ https://archive.mesa3d.org/mesa-21.2.5.tar.xz https://archive.mozilla.org/pub/nspr/releases/v4.30/src/nspr-4.30.tar.gz https://audiofile.68k.org/audiofile-0.3.6.tar.gz https://bitmath.org/code/mtdev/mtdev-1.1.6.tar.bz2 -https://busybox.net/downloads/busybox-1.33.0.tar.bz2 +https://busybox.net/downloads/busybox-1.35.0.tar.bz2 https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.0.tar.gz https://cairographics.org/snapshots/cairo-1.17.4.tar.xz -https://cmake.org/files/v3.21/cmake-3.21.4.tar.gz +https://cmake.org/files/v3.22/cmake-3.22.1.tar.gz https://cpan.metacpan.org/authors/id/B/BJ/BJOERN/XML-SAX-Expat-0.51.tar.gz https://cpan.metacpan.org/authors/id/G/GR/GRANTM/XML-SAX-1.02.tar.gz https://cpan.metacpan.org/authors/id/G/GR/GRANTM/XML-SAX-Base-1.09.tar.gz @@ -56,7 +56,7 @@ https://deb.debian.org/debian/pool/main/p/pmount/pmount_0.9.23.orig.tar.bz2 https://dev.gentoo.org/~blueness/eudev/eudev-3.2.10.tar.gz https://dianne.skoll.ca/projects/rp-pppoe/download/rp-pppoe-3.14.tar.gz https://distfiles.dereferenced.org/pkgconf/pkgconf-1.8.0.tar.gz -https://dist.libuv.org/dist/v1.42.0/libuv-v1.42.0.tar.gz +https://dist.libuv.org/dist/v1.43.0/libuv-v1.43.0.tar.gz https://dl.2f30.org/releases/fortify-headers-1.1.tar.gz https://dl.2f30.org/releases/scron-0.4.tar.gz https://dl.bintray.com/htop/source/htop-3.0.5.tar.gz @@ -70,22 +70,22 @@ https://download.gnome.org/sources/atk/2.36/atk-2.36.0.tar.xz https://download.gnome.org/sources/at-spi2-atk/2.38/at-spi2-atk-2.38.0.tar.xz https://download.gnome.org/sources/at-spi2-core/2.38/at-spi2-core-2.38.0.tar.xz https://download.gnome.org/sources/gdk-pixbuf/2.42/gdk-pixbuf-2.42.2.tar.xz -https://download.gnome.org/sources/glib/2.70/glib-2.70.1.tar.xz +https://download.gnome.org/sources/glib/2.70/glib-2.70.2.tar.xz https://download.gnome.org/sources/gobject-introspection/1.66/gobject-introspection-1.66.1.tar.xz https://download.gnome.org/sources/gtk+/2.24/gtk+-2.24.33.tar.xz https://download.gnome.org/sources/libgudev/234/libgudev-234.tar.xz https://download.gnome.org/sources/librsvg/2.40/librsvg-2.40.21.tar.xz https://download.gnome.org/sources/libwnck/3.36/libwnck-3.36.0.tar.xz https://download.gnome.org/sources/pango/1.48/pango-1.48.1.tar.xz -https://download.gnome.org/sources/vala/0.54/vala-0.54.1.tar.xz -https://download-mirror.savannah.gnu.org/releases/lzip/tarlz/tarlz-0.21.tar.lz +https://download.gnome.org/sources/vala/0.54/vala-0.54.6.tar.xz +https://download-mirror.savannah.gnu.org/releases/lzip/tarlz/tarlz-0.22.tar.lz https://download-mirror.savannah.gnu.org/releases/lzip/xlunzip/xlunzip-0.7.tar.lz https://download.osgeo.org/libtiff/tiff-4.3.0.tar.gz https://download.samba.org/pub/rsync/src/rsync-3.2.3.tar.gz https://download.savannah.gnu.org/releases/acl/acl-2.3.1.tar.gz https://download.savannah.gnu.org/releases/attr/attr-2.5.1.tar.gz https://download.savannah.gnu.org/releases/freetype/freetype-2.9.1.tar.bz2 -https://download.savannah.gnu.org/releases/libpipeline/libpipeline-1.5.3.tar.gz +https://download.savannah.gnu.org/releases/libpipeline/libpipeline-1.5.4.tar.gz https://download.savannah.gnu.org/releases/lzip/clzip/clzip-1.11.tar.gz https://download.savannah.gnu.org/releases/lzip/lziprecover/lziprecover-1.22.tar.lz https://download.savannah.gnu.org/releases/lzip/lzlib/lzlib-1.13-pre1.tar.lz @@ -93,16 +93,16 @@ https://download.savannah.gnu.org/releases/lzip/plzip/plzip-1.9.tar.lz https://download.savannah.gnu.org/releases/moe/moe-1.11.tar.lz https://download.savannah.gnu.org/releases/zutils/zutils-1.10.tar.lz https://download.savannah.nongnu.org/releases/man-db/man-db-2.9.4.tar.xz -https://download.savannah.nongnu.org/releases/sysvinit/sysvinit-2.99.tar.xz +https://download.savannah.nongnu.org/releases/sysvinit/sysvinit-3.01.tar.xz https://downloads.sourceforge.net/e2fsprogs/e2fsprogs-1.46.4.tar.gz https://downloads.sourceforge.net/freeglut/freeglut-3.2.1.tar.gz https://downloads.sourceforge.net/infozip/unzip60.tar.gz -https://downloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-2.1.1.tar.gz +https://sourceforge.net/projects/libjpeg-turbo/files/2.1.2/libjpeg-turbo-2.1.2.tar.gz https://downloads.sourceforge.net/openjade/OpenSP-1.5.2.tar.gz -https://downloads.sourceforge.net/project/acpid2/acpid-2.0.32.tar.xz +https://downloads.sourceforge.net/project/acpid2/acpid-2.0.33.tar.xz https://downloads.sourceforge.net/project/enlightenment/imlib2-src/1.7.1/imlib2-1.7.1.tar.bz2 https://downloads.sourceforge.net/project/espeak/espeak/espeak-1.48/espeak-1.48.04-source.zip -https://downloads.sourceforge.net/project/expat/expat/2.2.10/expat-2.2.10.tar.lz +https://sourceforge.net/projects/expat/files/expat/2.4.2/expat-2.4.2.tar.lz https://downloads.sourceforge.net/project/giflib/giflib-5.2.1.tar.gz https://downloads.sourceforge.net/project/hdparm/hdparm/hdparm-9.62.tar.gz https://downloads.sourceforge.net/project/libmng/libmng-devel/2.0.3/libmng-2.0.3.tar.xz @@ -120,11 +120,12 @@ https://downloads.sourceforge.net/reiser4/libaal-1.0.7.tar.gz https://dri.freedesktop.org/libdrm/libdrm-2.4.109.tar.xz https://espejito.fder.edu.uy/gnu/help2man/help2man-1.48.5.tar.xz http://sethwklein.net/iana-etc-2.30.tar.bz2 +https://github.com/Mic92/iana-etc/releases/download/20211229/iana-etc-20211229.tar.gz https://feh.finalrewind.org/feh-3.6.3.tar.bz2 -https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz -https://files.pythonhosted.org/packages/72/89/402d2b4589e120ca76a6aed8fee906a0f5ae204b50e455edd36eda6e778d/Mako-1.1.3.tar.gz -https://files.pythonhosted.org/packages/82/2f/ef7afd98530d07c89deffec833b4b1a91a27a5db6d9f1a216599f5f0316e/setuptools-51.1.2.tar.gz -https://files.pythonhosted.org/packages/b9/2e/64db92e53b86efccfaea71321f597fa2e1b2bd3853d8ce658568f7a13094/MarkupSafe-1.1.1.tar.gz +https://files.pythonhosted.org/packages/71/39/171f1c67cd00715f190ba0b100d606d440a28c93c7714febeca8b79af85e/six-1.16.0.tar.gz +https://files.pythonhosted.org/packages/af/b6/42cd322ae555aa770d49e31b8c5c28a243ba1bbb57ad927e1a5f5b064811/Mako-1.1.6.tar.gz +https://files.pythonhosted.org/packages/69/77/aee1ecacea4d0db740046ce1785e81d16c4b1755af50eceac4ca1a1f8bfd/setuptools-60.5.0.tar.gz +https://files.pythonhosted.org/packages/bf/10/ff66fea6d1788c458663a84d88787bae15d45daa16f6b3ef33322a51fc7e/MarkupSafe-2.0.1.tar.gz https://ftp3.usa.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.4p1.tar.gz https://ftp.acc.umu.se/pub/gnome/sources/libcroco/0.6/libcroco-0.6.13.tar.xz https://ftp.debian.org/debian/pool/main/liba/libaio/libaio_0.3.112.orig.tar.xz @@ -134,8 +135,8 @@ https://ftp.gnome.org/pub/gnome/sources/gnome-themes-extra/3.28/gnome-themes-ext https://ftp.gnome.org/pub/gnome/sources/libnotify/0.7/libnotify-0.7.9.tar.xz https://ftp.gnu.org/gnu/automake/automake-1.16.5.tar.gz https://ftp.gnu.org/gnu/bash/bash-5.1.tar.gz -https://ftp.gnu.org/gnu/binutils/binutils-2.36.1.tar.lz -https://ftp.gnu.org/gnu/bison/bison-3.8.1.tar.lz +https://ftp.gnu.org/gnu/binutils/binutils-2.35.2.tar.lz +https://ftp.gnu.org/gnu/bison/bison-3.8.2.tar.lz https://ftp.gnu.org/gnu/diffutils/diffutils-3.8.tar.xz https://ftp.gnu.org/gnu/ed/ed-1.17.tar.lz https://ftp.gnu.org/gnu/emacs/emacs-27.1.tar.gz @@ -148,10 +149,10 @@ https://ftp.gnu.org/gnu/guile/guile-3.0.7.tar.lz https://ftp.gnu.org/gnu/gzip/gzip-1.10.tar.gz https://ftp.gnu.org/gnu/inetutils/inetutils-2.0.tar.gz https://ftp.gnu.org/gnu/libidn/libidn-1.38.tar.gz -https://ftp.gnu.org/gnu/libidn/libidn2-2.3.1.tar.gz -https://ftp.gnu.org/gnu/libsigsegv/libsigsegv-2.13.tar.gz -https://ftp.gnu.org/gnu/libtasn1/libtasn1-4.17.0.tar.gz -https://ftp.gnu.org/gnu/libunistring/libunistring-0.9.10.tar.gz +https://ftp.gnu.org/gnu/libidn/libidn2-2.3.2.tar.gz +https://ftp.gnu.org/gnu/libsigsegv/libsigsegv-2.14.tar.gz +https://ftp.gnu.org/gnu/libtasn1/libtasn1-4.18.0.tar.gz +https://ftp.gnu.org/gnu/libunistring/libunistring-1.0.tar.gz https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz https://ftp.gnu.org/gnu/nettle/nettle-3.7.3.tar.gz https://ftp.gnu.org/gnu/sed/sed-4.8.tar.gz @@ -180,13 +181,13 @@ https://github.com/docbook/xslt10-stylesheets/releases/download/release/1.79.2/d https://github.com/dosfstools/dosfstools/releases/download/v4.2/dosfstools-4.2.tar.gz https://github.com/dreamer/scrot/archive/scrot-0.8.tar.gz https://github.com/fribidi/fribidi/releases/download/v1.0.10/fribidi-1.0.10.tar.xz -https://github.com/gavinhoward/bc/releases/download/5.0.2/bc-5.0.2.tar.xz +https://github.com/gavinhoward/bc/releases/download/5.2.1/bc-5.2.1.tar.xz https://github.com/gentoo/hwids/archive/refs/tags/hwids-20210613.tar.gz https://github.com/harfbuzz/harfbuzz/releases/download/2.7.4/harfbuzz-2.7.4.tar.xz https://github.com/intel/intel-vaapi-driver/releases/download/2.4.1/intel-vaapi-driver-2.4.1.tar.bz2 https://github.com/intel/libva/releases/download/2.10.0/libva-2.10.0.tar.bz2 https://github.com/irssi/irssi/releases/download/1.2.2/irssi-1.2.2.tar.gz -https://github.com/ivmai/bdwgc/releases/download/v8.0.4/gc-8.0.4.tar.gz +https://github.com/ivmai/bdwgc/releases/download/v8.0.6/gc-8.0.6.tar.gz https://github.com/ivmai/libatomic_ops/releases/download/v7.6.12/libatomic_ops-7.6.12.tar.gz https://github.com/libcheck/check/releases/download/0.15.2/check-0.15.2.tar.gz https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz @@ -201,7 +202,7 @@ https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/compiler-r https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/llvm-13.0.0.src.tar.xz https://github.com/lm-sensors/lm-sensors/archive/V3-6-0/lm-sensors-3-6-0.tar.gz https://github.com/logrotate/logrotate/releases/download/3.18.1/logrotate-3.18.1.tar.gz -https://github.com/mesonbuild/meson/releases/download/0.59.1/meson-0.59.1.tar.gz +https://github.com/mesonbuild/meson/releases/download/0.61.0/meson-0.61.0.tar.gz https://github.com/metalink-dev/libmetalink/releases/download/release-0.1.3/libmetalink-0.1.3.tar.bz2 https://github.com/nghttp2/nghttp2/releases/download/v1.45.1/nghttp2-1.45.1.tar.bz2 https://github.com/ninja-build/ninja/archive/v1.10.2/ninja-1.10.2.tar.gz @@ -211,13 +212,13 @@ https://github.com/rockdaboot/libpsl/releases/download/0.21.1/libpsl-0.21.1.tar. https://github.com/shadow-maint/shadow/releases/download/4.8.1/shadow-4.8.1.tar.gz https://github.com/skvadrik/re2c/releases/download/2.2/re2c-2.2.tar.lz https://github.com/thkukuk/libnsl/releases/download/v2.0.0/libnsl-2.0.0.tar.xz -https://github.com/thkukuk/rpcsvc-proto/releases/download/v1.4.2/rpcsvc-proto-1.4.2.tar.xz +https://github.com/thkukuk/rpcsvc-proto/releases/download/v1.4.3/rpcsvc-proto-1.4.3.tar.xz https://github.com/thom311/libnl/releases/download/libnl3_5_0/libnl-3.5.0.tar.gz https://github.com/tlwg/libdatrie/releases/download/v0.2.13/libdatrie-0.2.13.tar.xz https://github.com/tmux/tmux/releases/download/3.2a/tmux-3.2a.tar.gz -https://github.com/troglobit/sysklogd/releases/download/v2.2.1/sysklogd-2.2.1.tar.gz +https://github.com/troglobit/sysklogd/releases/download/v2.3.0/sysklogd-2.3.0.tar.gz https://github.com/uclouvain/openjpeg/archive/v2.4.0/openjpeg-2.4.0.tar.gz -https://github.com/unicode-org/icu/releases/download/release-69-1/icu4c-69_1-src.tgz +https://github.com/unicode-org/icu/releases/download/release-70-1/icu4c-70_1-src.tgz https://github.com/vim/vim/archive/v8.2.3371/vim-8.2.3371.tar.gz https://github.com/void-linux/musl-fts/archive/v1.2.7/musl-fts-1.2.7.tar.gz https://github.com/void-linux/musl-obstack/archive/v1.2.2/musl-obstack-1.2.2.tar.gz @@ -239,13 +240,13 @@ https://jxself.org/firmware/linux-libre-firmware-1.4.tar.lz https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz https://libarchive.org/downloads/libarchive-3.5.2.tar.gz https://linux-libre.fsfla.org/pub/linux-libre/releases/5.10.56-gnu/linux-libre-5.10.56-gnu.tar.lz -https://linux.thai.net/pub/thailinux/software/libthai/libthai-0.1.28.tar.xz +https://linux.thai.net/pub/thailinux/software/libthai/libthai-0.1.29.tar.xz https://luarocks.github.io/luarocks/releases/luarocks-3.5.0.tar.gz https://mirror.fsf.org/dragora/v3/sources/bzip2-1.0.6.tar.gz -https://mirrors.concertpass.com/gcc/snapshots/11-20220101/gcc-11-20220101.tar.xz +https://gcc.gnu.org/pub/gcc/snapshots/10-20220114/gcc-10-20220114.tar.xz https://mirrors.edge.kernel.org/pub/linux/docs/man-pages/man-pages-posix/man-pages-posix-2017-a.tar.gz https://mirrors.edge.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v5.13.1.tar.gz -https://mirrors.edge.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.60.tar.gz +https://mirrors.edge.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.62.tar.gz https://mirrors.edge.kernel.org/pub/linux/network/connman/connman-1.38.tar.gz https://mirrors.edge.kernel.org/pub/linux/network/wireless/iwd-1.11.tar.gz https://mirrors.edge.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-5.13.0.tar.gz @@ -256,21 +257,21 @@ https://mirrors.edge.kernel.org/pub/linux/utils/usb/usbutils/usbutils-014.tar.gz https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.37/util-linux-2.37.2.tar.gz https://mirrors.edge.kernel.org/pub/software/network/ethtool/ethtool-5.10.tar.gz https://mirrors.edge.kernel.org/pub/software/network/iw/iw-5.9.tar.gz -https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.33.0.tar.gz -https://mirrors.edge.kernel.org/pub/software/scm/git/git-manpages-2.33.0.tar.gz +https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.34.1.tar.gz +https://mirrors.edge.kernel.org/pub/software/scm/git/git-manpages-2.34.1.tar.gz https://mirrors.edge.kernel.org/pub/software/utils/pciutils/pciutils-3.7.0.tar.gz https://musl.libc.org/releases/musl-1.2.2.tar.gz https://nano-editor.org/dist/latest/nano-5.8.tar.gz https://netfilter.org/projects/iptables/files/iptables-1.8.7.tar.bz2 https://netfilter.org/projects/libnftnl/files/libnftnl-1.1.9.tar.bz2 -http://software.calhariz.com/at/at_3.2.1.orig.tar.gz +http://software.calhariz.com/at/at_3.2.2.orig.tar.gz https://people.freedesktop.org/~svu/libxklavier-5.4.tar.bz2 https://people.redhat.com/sgrubb/libcap-ng/libcap-ng-0.8.2.tar.gz https://pm-utils.freedesktop.org/releases/pm-utils-1.4.1.tar.gz https://poppler.freedesktop.org/poppler-21.04.0.tar.xz https://poppler.freedesktop.org/poppler-data-0.4.10.tar.gz -https://prdownloads.sourceforge.net/tcl/tcl8.6.11-src.tar.gz -https://prdownloads.sourceforge.net/tcl/tk8.6.11.1-src.tar.gz +https://prdownloads.sourceforge.net/tcl/tcl8.6.12-src.tar.gz +https://prdownloads.sourceforge.net/tcl/tk8.6.12-src.tar.gz https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz https://releases.pagure.org/mlocate/mlocate-0.26.tar.xz https://releases.pagure.org/xmlto/xmlto-0.0.28.tar.bz2 @@ -297,11 +298,11 @@ https://rubygems.org/downloads/asciidoctor-2.0.12.gem https://sourceforge.net/projects/lcms/files/lcms/2.11/lcms2-2.11.tar.gz https://sourceforge.net/projects/libtirpc/files/libtirpc/1.3.2/libtirpc-1.3.2.tar.bz2 https://sourceforge.net/projects/slackbuildsdirectlinks/files/giblib/giblib-1.2.4.tar.gz -https://sourceware.org/elfutils/ftp/0.185/elfutils-0.185.tar.bz2 +https://sourceware.org/elfutils/ftp/0.186/elfutils-0.186.tar.bz2 https://sourceware.org/ftp/docbook-tools/new-trials/SOURCES/sgml-common-0.6.3.tgz https://sourceware.org/ftp/lvm2/releases/LVM2.2.02.168.tgz -https://sqlite.org/2020/sqlite-autoconf-3340000.tar.gz -https://strace.io/files/5.14/strace-5.14.tar.xz +https://sqlite.org/2022/sqlite-autoconf-3370200.tar.gz +https://strace.io/files/5.16/strace-5.16.tar.xz https://thrysoee.dk/editline/libedit-20210910-3.1.tar.gz https://tukaani.org/xz/xz-5.2.5.tar.bz2 https://user-dirs.freedesktop.org/releases/xdg-user-dirs-0.17.tar.gz @@ -317,14 +318,14 @@ https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.1.tar.bz https://www.freedesktop.org/software/libevdev/libevdev-1.11.0.tar.xz https://www.freedesktop.org/software/libinput/libinput-1.16.5.tar.xz https://www.freedesktop.org/software/startup-notification/releases/startup-notification-0.12.tar.gz -https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.2.27.tar.bz2 +https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.2.33.tar.bz2 https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7/gnutls-3.7.2.tar.xz -https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-1.15.1.tar.bz2 -https://www.gnupg.org/ftp/gcrypt/libassuan/libassuan-2.5.4.tar.bz2 -https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.9.1.tar.bz2 -https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.41.tar.bz2 +https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-1.16.0.tar.bz2 +https://www.gnupg.org/ftp/gcrypt/libassuan/libassuan-2.5.5.tar.bz2 +https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.9.4.tar.bz2 +https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.43.tar.bz2 https://www.gnupg.org/ftp/gcrypt/npth/npth-1.6.tar.bz2 -https://www.gnupg.org/ftp/gcrypt/pinentry/pinentry-1.1.0.tar.bz2 +https://www.gnupg.org/ftp/gcrypt/pinentry/pinentry-1.2.0.tar.bz2 https://www.greenwoodsoftware.com/less/less-590.tar.gz https://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-4.1.tar.gz https://www.libssh2.org/download/libssh2-1.10.0.tar.gz @@ -334,7 +335,7 @@ https://www.mpfr.org/mpfr-current/mpfr-4.1.0.tar.bz2 https://www.nasm.us/pub/nasm/releasebuilds/2.15/nasm-2.15.tar.bz2 https://www.netfilter.org/projects/libmnl/files/libmnl-1.0.4.tar.bz2 https://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz -https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz +https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tgz https://www.sudo.ws/dist/sudo-1.9.7p2.tar.gz https://www.tcpdump.org/release/libpcap-1.10.0.tar.gz https://www.tcpdump.org/release/tcpdump-4.9.3.tar.gz @@ -553,7 +554,7 @@ https://xkbcommon.org/download/libxkbcommon-1.0.3.tar.xz https://xorg.freedesktop.org/archive/individual/proto/xcb-proto-1.14.1.tar.xz https://zlib.net/zlib-1.2.11.tar.gz http://tango.freedesktop.org/releases/icon-naming-utils-0.8.90.tar.bz2 -http://www.gnupg.org/ftp/gcrypt/libksba/libksba-1.4.0.tar.bz2 +https://www.gnupg.org/ftp/gcrypt/libksba/libksba-1.6.0.tar.bz2 http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz http://www.roestockfox.co.uk/files/isapnptools/isapnptools-1.27.tgz http://xmlsoft.org/sources/libxml2-2.9.12.tar.gz diff --git a/sources/acpid-2.0.32.tar.xz.sha256 b/sources/acpid-2.0.32.tar.xz.sha256 deleted file mode 100644 index c7336824..00000000 --- a/sources/acpid-2.0.32.tar.xz.sha256 +++ /dev/null @@ -1 +0,0 @@ -f2d2d30b3edc3234bd82f6f7186699a6aa3c85c8d20bc4e30e9b3c68a1ed157e acpid-2.0.32.tar.xz diff --git a/sources/acpid-2.0.33.tar.xz.sha256 b/sources/acpid-2.0.33.tar.xz.sha256 new file mode 100644 index 00000000..49c3176a --- /dev/null +++ b/sources/acpid-2.0.33.tar.xz.sha256 @@ -0,0 +1 @@ +0856f71b3eb34a1b663d0a8e6363dfcbc519e63d847330498898658e2972dbe8 acpid-2.0.33.tar.xz diff --git a/sources/alsa-lib-1.2.5.1.tar.bz2.sha256 b/sources/alsa-lib-1.2.5.1.tar.bz2.sha256 deleted file mode 100644 index c285b26e..00000000 --- a/sources/alsa-lib-1.2.5.1.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -628421d950cecaf234de3f899d520c0a6923313c964ad751ffac081df331438e alsa-lib-1.2.5.1.tar.bz2 diff --git a/sources/alsa-lib-1.2.6.1.tar.bz2.sha256 b/sources/alsa-lib-1.2.6.1.tar.bz2.sha256 new file mode 100644 index 00000000..8a95fe75 --- /dev/null +++ b/sources/alsa-lib-1.2.6.1.tar.bz2.sha256 @@ -0,0 +1 @@ +ad582993d52cdb5fb159a0beab60a6ac57eab0cc1bdf85dc4db6d6197f02333f alsa-lib-1.2.6.1.tar.bz2 diff --git a/sources/alsa-lib-1.2.6.tar.bz2.sha256 b/sources/alsa-lib-1.2.6.tar.bz2.sha256 new file mode 100644 index 00000000..e69de29b diff --git a/sources/alsa-plugins-1.2.5.tar.bz2.sha256 b/sources/alsa-plugins-1.2.5.tar.bz2.sha256 deleted file mode 100644 index abd3b7e5..00000000 --- a/sources/alsa-plugins-1.2.5.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -42eef98433d2c8d11f1deeeb459643619215a75aa5a5bbdd06a794e4c413df20 alsa-plugins-1.2.5.tar.bz2 diff --git a/sources/alsa-plugins-1.2.6.tar.bz2.sha256 b/sources/alsa-plugins-1.2.6.tar.bz2.sha256 new file mode 100644 index 00000000..0956200c --- /dev/null +++ b/sources/alsa-plugins-1.2.6.tar.bz2.sha256 @@ -0,0 +1 @@ +068818a4b55d8c029daa00015d853d45113f56b224b7c64e1e117988c825b2a0 alsa-plugins-1.2.6.tar.bz2 diff --git a/sources/alsa-ucm-conf-1.2.5.1.tar.bz2.sha256 b/sources/alsa-ucm-conf-1.2.5.1.tar.bz2.sha256 deleted file mode 100644 index a9c31b58..00000000 --- a/sources/alsa-ucm-conf-1.2.5.1.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -5841a444166dcbf479db751303dbc3556f685085ac7e00f0c9e7755676195d97 alsa-ucm-conf-1.2.5.1.tar.bz2 diff --git a/sources/alsa-ucm-conf-1.2.6.3.tar.bz2.sha256 b/sources/alsa-ucm-conf-1.2.6.3.tar.bz2.sha256 new file mode 100644 index 00000000..699c089e --- /dev/null +++ b/sources/alsa-ucm-conf-1.2.6.3.tar.bz2.sha256 @@ -0,0 +1 @@ +b8a03aa387a624a2f65edc201bf777421190b60529a92087646823afbd96c5cd alsa-ucm-conf-1.2.6.3.tar.bz2 diff --git a/sources/alsa-utils-1.2.5.1.tar.bz2.sha256 b/sources/alsa-utils-1.2.5.1.tar.bz2.sha256 deleted file mode 100644 index 2a0e948a..00000000 --- a/sources/alsa-utils-1.2.5.1.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -9c169ae37a49295f9b97b92ace772803daf6b6510a19574e0b78f87e562118d0 alsa-utils-1.2.5.1.tar.bz2 diff --git a/sources/alsa-utils-1.2.6.tar.bz2.sha256 b/sources/alsa-utils-1.2.6.tar.bz2.sha256 new file mode 100644 index 00000000..01a402ad --- /dev/null +++ b/sources/alsa-utils-1.2.6.tar.bz2.sha256 @@ -0,0 +1 @@ +6a1efd8a1f1d9d38e489633eaec1fffa5c315663b316cab804be486887e6145d alsa-utils-1.2.6.tar.bz2 diff --git a/sources/at_3.2.1.orig.tar.gz.sha256 b/sources/at_3.2.1.orig.tar.gz.sha256 deleted file mode 100644 index da053f2c..00000000 --- a/sources/at_3.2.1.orig.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -aabe6e5cb6dd19fe9fb25c2747492f2db38762b95ea41b86f949609c39fb55c4 at_3.2.1.orig.tar.gz diff --git a/sources/at_3.2.2.orig.tar.gz.sha256 b/sources/at_3.2.2.orig.tar.gz.sha256 new file mode 100644 index 00000000..0ab845e6 --- /dev/null +++ b/sources/at_3.2.2.orig.tar.gz.sha256 @@ -0,0 +1 @@ +2211da14914fde1f9cc83592838fb6385a32fb11fcecb7816c77700df6559088 at_3.2.2.orig.tar.gz diff --git a/sources/bc-5.0.2.tar.xz.sha256 b/sources/bc-5.0.2.tar.xz.sha256 deleted file mode 100644 index b18a1e36..00000000 --- a/sources/bc-5.0.2.tar.xz.sha256 +++ /dev/null @@ -1 +0,0 @@ -3f23e5a8b11c2f9c668cfd7987c9c4e9f065f0aa193fe875e2a785e1f3283efe bc-5.0.2.tar.xz diff --git a/sources/bc-5.2.1.tar.xz.sha256 b/sources/bc-5.2.1.tar.xz.sha256 new file mode 100644 index 00000000..cc6a072c --- /dev/null +++ b/sources/bc-5.2.1.tar.xz.sha256 @@ -0,0 +1 @@ +bc031b68e5eafef37305697b76f6261abac4a94286e260fa339771f2484f1ecd bc-5.2.1.tar.xz diff --git a/sources/binutils-2.35.2.tar.lz.sha256 b/sources/binutils-2.35.2.tar.lz.sha256 new file mode 100644 index 00000000..ab5bbe38 --- /dev/null +++ b/sources/binutils-2.35.2.tar.lz.sha256 @@ -0,0 +1 @@ +63b93212abb9acbb34b345ea67554ac24af2a6160571d2b0770ff748fdc9ab2a binutils-2.35.2.tar.lz diff --git a/sources/binutils-2.36.1.tar.lz.sha256 b/sources/binutils-2.36.1.tar.lz.sha256 deleted file mode 100644 index dfa30122..00000000 --- a/sources/binutils-2.36.1.tar.lz.sha256 +++ /dev/null @@ -1 +0,0 @@ -3ae061cbadef8c08c008fb11ac037d579b5d411cb4e7c540cf3c6b3f852b85f4 binutils-2.36.1.tar.lz diff --git a/sources/bison-3.8.1.tar.lz.sha256 b/sources/bison-3.8.1.tar.lz.sha256 deleted file mode 100644 index 1e5a9550..00000000 --- a/sources/bison-3.8.1.tar.lz.sha256 +++ /dev/null @@ -1 +0,0 @@ -009da75a8063e1a3bd21546b37e524212056891fc2c92afa11a9f396986821b8 bison-3.8.1.tar.lz diff --git a/sources/bison-3.8.2.tar.lz.sha256 b/sources/bison-3.8.2.tar.lz.sha256 new file mode 100644 index 00000000..af403a35 --- /dev/null +++ b/sources/bison-3.8.2.tar.lz.sha256 @@ -0,0 +1 @@ +fdf98bfe82abb04a34d4356753f7748dbbd2ef1221b1f202852a2b5ce0f78534 bison-3.8.2.tar.lz diff --git a/sources/busybox-1.33.0.tar.bz2.sha256 b/sources/busybox-1.33.0.tar.bz2.sha256 deleted file mode 100644 index 98773fc2..00000000 --- a/sources/busybox-1.33.0.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -d568681c91a85edc6710770cebc1e80e042ad74d305b5c2e6d57a5f3de3b8fbd busybox-1.33.0.tar.bz2 diff --git a/sources/busybox-1.35.0.tar.bz2.sha256 b/sources/busybox-1.35.0.tar.bz2.sha256 new file mode 100644 index 00000000..b4e6b0df --- /dev/null +++ b/sources/busybox-1.35.0.tar.bz2.sha256 @@ -0,0 +1 @@ +faeeb244c35a348a334f4a59e44626ee870fb07b6884d68c10ae8bc19f83a694 busybox-1.35.0.tar.bz2 diff --git a/sources/clisp-20210628_de01f0f47.tar.lz.sha256 b/sources/clisp-20210628_de01f0f47.tar.lz.sha256 index 2bad00cb..1b070ab2 100644 --- a/sources/clisp-20210628_de01f0f47.tar.lz.sha256 +++ b/sources/clisp-20210628_de01f0f47.tar.lz.sha256 @@ -1 +1 @@ -3a4095948b69bdc82cde840e5ed08e90eb7108c60655438956071ecec1993afe clisp-20210628_de01f0f47.tar.lz +94974142bc750cf488af2c708c1bc28f616509eb5904c71cfae2fd79ba14e0b4 clisp-20210628_de01f0f47.tar.lz diff --git a/sources/cmake-20210720_6980b57.tar.lz.sha256 b/sources/cmake-20210720_6980b57.tar.lz.sha256 deleted file mode 100644 index 93e7a29d..00000000 --- a/sources/cmake-20210720_6980b57.tar.lz.sha256 +++ /dev/null @@ -1 +0,0 @@ -ce50e29aa18551b3b934b89b659a7701d2c8ca983be6760ac09d06708d0d8210 cmake-20210720_6980b57.tar.lz diff --git a/sources/cmake-3.21.4.tar.gz.sha256 b/sources/cmake-3.21.4.tar.gz.sha256 deleted file mode 100644 index 187d5730..00000000 --- a/sources/cmake-3.21.4.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -d9570a95c215f4c9886dd0f0564ca4ef8d18c30750f157238ea12669c2985978 cmake-3.21.4.tar.gz diff --git a/sources/cmake-3.22.1.tar.gz.sha256 b/sources/cmake-3.22.1.tar.gz.sha256 new file mode 100644 index 00000000..c4245754 --- /dev/null +++ b/sources/cmake-3.22.1.tar.gz.sha256 @@ -0,0 +1 @@ +0e998229549d7b3f368703d20e248e7ee1f853910d42704aa87918c213ea82c0 cmake-3.22.1.tar.gz diff --git a/sources/elfutils-0.185.tar.bz2.sha256 b/sources/elfutils-0.185.tar.bz2.sha256 deleted file mode 100644 index a2d5ac25..00000000 --- a/sources/elfutils-0.185.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -dc8d3e74ab209465e7f568e1b3bb9a5a142f8656e2b57d10049a73da2ae6b5a6 elfutils-0.185.tar.bz2 diff --git a/sources/elfutils-0.186.tar.bz2.sha256 b/sources/elfutils-0.186.tar.bz2.sha256 new file mode 100644 index 00000000..43e29f92 --- /dev/null +++ b/sources/elfutils-0.186.tar.bz2.sha256 @@ -0,0 +1 @@ +7f6fb9149b1673d38d9178a0d3e0fb8a1ec4f53a9f4c2ff89469609879641177 elfutils-0.186.tar.bz2 diff --git a/sources/expat-2.2.10.tar.lz.sha256 b/sources/expat-2.2.10.tar.lz.sha256 deleted file mode 100644 index 0954eaaf..00000000 --- a/sources/expat-2.2.10.tar.lz.sha256 +++ /dev/null @@ -1 +0,0 @@ -a17adece0afd5c42a1ba9549fad00e5066838c87c4d2ac395ff447558fe045de expat-2.2.10.tar.lz diff --git a/sources/expat-2.4.2.tar.lz.sha256 b/sources/expat-2.4.2.tar.lz.sha256 new file mode 100644 index 00000000..afc4ae94 --- /dev/null +++ b/sources/expat-2.4.2.tar.lz.sha256 @@ -0,0 +1 @@ +e114edc885cae53d9e534d18122c47001e093544f11cdaa68f25fa209a13acdf expat-2.4.2.tar.lz diff --git a/sources/file-5.40.tar.gz.sha256 b/sources/file-5.40.tar.gz.sha256 deleted file mode 100644 index 2fc253f1..00000000 --- a/sources/file-5.40.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -167321f43c148a553f68a0ea7f579821ef3b11c27b8cbe158e4df897e4a5dd57 file-5.40.tar.gz diff --git a/sources/file-5.41.tar.gz.sha256 b/sources/file-5.41.tar.gz.sha256 new file mode 100644 index 00000000..c40d86f8 --- /dev/null +++ b/sources/file-5.41.tar.gz.sha256 @@ -0,0 +1 @@ +13e532c7b364f7d57e23dfeea3147103150cb90593a57af86c10e4f6e411603f file-5.41.tar.gz diff --git a/sources/gc-8.0.4.tar.gz.sha256 b/sources/gc-8.0.4.tar.gz.sha256 deleted file mode 100644 index 81aae4df..00000000 --- a/sources/gc-8.0.4.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -436a0ddc67b1ac0b0405b61a9675bca9e075c8156f4debd1d06f3a56c7cd289d gc-8.0.4.tar.gz diff --git a/sources/gc-8.0.6.tar.gz.sha256 b/sources/gc-8.0.6.tar.gz.sha256 new file mode 100644 index 00000000..327e71d3 --- /dev/null +++ b/sources/gc-8.0.6.tar.gz.sha256 @@ -0,0 +1 @@ +3b4914abc9fa76593596773e4da671d7ed4d5390e3d46fbf2e5f155e121bea11 gc-8.0.6.tar.gz diff --git a/sources/gcc-10-20220114.tar.xz.sha256 b/sources/gcc-10-20220114.tar.xz.sha256 new file mode 100644 index 00000000..6df4f1bb --- /dev/null +++ b/sources/gcc-10-20220114.tar.xz.sha256 @@ -0,0 +1 @@ +dd2fe7538679fa31a68327786679f540aac3c9b0a1623ac120620e64f40c0f9c gcc-10-20220114.tar.xz diff --git a/sources/gcc-11-20220101.tar.xz.sha256 b/sources/gcc-11-20220101.tar.xz.sha256 deleted file mode 100644 index 691a93e5..00000000 --- a/sources/gcc-11-20220101.tar.xz.sha256 +++ /dev/null @@ -1 +0,0 @@ -b2c48911631b46efb76edae3d6c1ee27d46f98e1f9859e563bdeca52509d946e gcc-11-20220101.tar.xz diff --git a/sources/gdbm-1.18.1.tar.gz.sha256 b/sources/gdbm-1.18.1.tar.gz.sha256 deleted file mode 100644 index 39a800ce..00000000 --- a/sources/gdbm-1.18.1.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -86e613527e5dba544e73208f42b78b7c022d4fa5a6d5498bf18c8d6f745b91dc gdbm-1.18.1.tar.gz diff --git a/sources/gdbm-1.22.tar.gz.sha256 b/sources/gdbm-1.22.tar.gz.sha256 new file mode 100644 index 00000000..dd7a0116 --- /dev/null +++ b/sources/gdbm-1.22.tar.gz.sha256 @@ -0,0 +1 @@ +f366c823a6724af313b6bbe975b2809f9a157e5f6a43612a72949138d161d762 gdbm-1.22.tar.gz diff --git a/sources/gettext-0.21.tar.lz.sha256 b/sources/gettext-0.21.tar.lz.sha256 new file mode 100644 index 00000000..14fab620 --- /dev/null +++ b/sources/gettext-0.21.tar.lz.sha256 @@ -0,0 +1 @@ +435b546e3880ab767c967c0731b20629a0cb0ba620e6bac2f590f401c10ebb45 gettext-0.21.tar.lz diff --git a/sources/git-2.33.0.tar.gz.sha256 b/sources/git-2.33.0.tar.gz.sha256 deleted file mode 100644 index c5affab3..00000000 --- a/sources/git-2.33.0.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -02d909d0bba560d3a1008bd00dd577621ffb57401b09175fab2bf6da0e9704ae git-2.33.0.tar.gz diff --git a/sources/git-2.34.1.tar.gz.sha256 b/sources/git-2.34.1.tar.gz.sha256 new file mode 100644 index 00000000..8c13fe97 --- /dev/null +++ b/sources/git-2.34.1.tar.gz.sha256 @@ -0,0 +1 @@ +fc4eb5ecb9299db91cdd156c06cdeb41833f53adc5631ddf8c0cb13eaa2911c1 git-2.34.1.tar.gz diff --git a/sources/git-manpages-2.33.0.tar.gz.sha256 b/sources/git-manpages-2.33.0.tar.gz.sha256 deleted file mode 100644 index 888a1c51..00000000 --- a/sources/git-manpages-2.33.0.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -ba9cd0f29a3632a3b78f8ed2389f0780aa6e8fcbe258259d7c584920d19ed1f7 git-manpages-2.33.0.tar.gz diff --git a/sources/git-manpages-2.34.1.tar.gz.sha256 b/sources/git-manpages-2.34.1.tar.gz.sha256 new file mode 100644 index 00000000..a666e7c8 --- /dev/null +++ b/sources/git-manpages-2.34.1.tar.gz.sha256 @@ -0,0 +1 @@ +220f1ed68582caeddf79c4db15e4eaa4808ec01fd11889e19232f0a74d7f31b0 git-manpages-2.34.1.tar.gz diff --git a/sources/glib-2.70.1.tar.xz.sha256 b/sources/glib-2.70.1.tar.xz.sha256 deleted file mode 100644 index 37c53f25..00000000 --- a/sources/glib-2.70.1.tar.xz.sha256 +++ /dev/null @@ -1 +0,0 @@ -f9b7bce7f51753a1f43853bbcaca8bf09e15e994268e29cfd7a76f65636263c0 glib-2.70.1.tar.xz diff --git a/sources/glib-2.70.2.tar.xz.sha256 b/sources/glib-2.70.2.tar.xz.sha256 new file mode 100644 index 00000000..cceb39c8 --- /dev/null +++ b/sources/glib-2.70.2.tar.xz.sha256 @@ -0,0 +1 @@ +0551459c85cd3da3d58ddc9016fd28be5af503f5e1615a71ba5b512ac945806f glib-2.70.2.tar.xz diff --git a/sources/gnupg-2.2.27.tar.bz2.sha256 b/sources/gnupg-2.2.27.tar.bz2.sha256 deleted file mode 100644 index 18f5fc08..00000000 --- a/sources/gnupg-2.2.27.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -34e60009014ea16402069136e0a5f63d9b65f90096244975db5cea74b3d02399 gnupg-2.2.27.tar.bz2 diff --git a/sources/gnupg-2.2.33.tar.bz2.sha256 b/sources/gnupg-2.2.33.tar.bz2.sha256 new file mode 100644 index 00000000..0ce40a2c --- /dev/null +++ b/sources/gnupg-2.2.33.tar.bz2.sha256 @@ -0,0 +1 @@ +8688836e8c043d70410bb64d72de6ae15176e09ecede8d24528b4380c000e4e3 gnupg-2.2.33.tar.bz2 diff --git a/sources/gpgme-1.15.1.tar.bz2.sha256 b/sources/gpgme-1.15.1.tar.bz2.sha256 deleted file mode 100644 index 25fd83ba..00000000 --- a/sources/gpgme-1.15.1.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad gpgme-1.15.1.tar.bz2 diff --git a/sources/gpgme-1.16.0.tar.bz2.sha256 b/sources/gpgme-1.16.0.tar.bz2.sha256 new file mode 100644 index 00000000..7250ec07 --- /dev/null +++ b/sources/gpgme-1.16.0.tar.bz2.sha256 @@ -0,0 +1 @@ +6c8cc4aedb10d5d4c905894ba1d850544619ee765606ac43df7405865de29ed0 gpgme-1.16.0.tar.bz2 diff --git a/sources/iana-etc-20211229.tar.gz.sha256 b/sources/iana-etc-20211229.tar.gz.sha256 new file mode 100644 index 00000000..cfc29947 --- /dev/null +++ b/sources/iana-etc-20211229.tar.gz.sha256 @@ -0,0 +1 @@ +33b40437f9a9def218b780a8611e794c5dc0e0eeb1f42a184db45d6dd4e2d397 iana-etc-20211229.tar.gz diff --git a/sources/icu4c-69_1-src.tgz.sha256 b/sources/icu4c-69_1-src.tgz.sha256 deleted file mode 100644 index cb0ac760..00000000 --- a/sources/icu4c-69_1-src.tgz.sha256 +++ /dev/null @@ -1 +0,0 @@ -4cba7b7acd1d3c42c44bb0c14be6637098c7faf2b330ce876bc5f3b915d09745 icu4c-69_1-src.tgz diff --git a/sources/icu4c-70_1-src.tgz.sha256 b/sources/icu4c-70_1-src.tgz.sha256 new file mode 100644 index 00000000..999a0f8d --- /dev/null +++ b/sources/icu4c-70_1-src.tgz.sha256 @@ -0,0 +1 @@ +8d205428c17bf13bb535300669ed28b338a157b1c01ae66d31d0d3e2d47c3fd5 icu4c-70_1-src.tgz diff --git a/sources/iso-codes-4.5.0.tar.xz.sha256 b/sources/iso-codes-4.5.0.tar.xz.sha256 deleted file mode 100644 index 84d08f2e..00000000 --- a/sources/iso-codes-4.5.0.tar.xz.sha256 +++ /dev/null @@ -1 +0,0 @@ -295caf14632696a5c6aedf4119450a7943581cff34b628c46bbe16f0d21e3201 iso-codes-4.5.0.tar.xz diff --git a/sources/iso-codes-4.6.0.tar.xz.sha256 b/sources/iso-codes-4.6.0.tar.xz.sha256 new file mode 100644 index 00000000..cbdc81c7 --- /dev/null +++ b/sources/iso-codes-4.6.0.tar.xz.sha256 @@ -0,0 +1 @@ +1735f23a5e65458aacaefaaf66daa521c17b4a4266a63f60fba9653cdbaac783 iso-codes-4.6.0.tar.xz diff --git a/sources/itstool-2.0.6.tar.bz2.sha256 b/sources/itstool-2.0.6.tar.bz2.sha256 deleted file mode 100644 index 78ec5ee9..00000000 --- a/sources/itstool-2.0.6.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -6233cc22726a9a5a83664bf67d1af79549a298c23185d926c3677afa917b92a9 itstool-2.0.6.tar.bz2 diff --git a/sources/itstool-2.0.7.tar.bz2.sha256 b/sources/itstool-2.0.7.tar.bz2.sha256 new file mode 100644 index 00000000..890b6da2 --- /dev/null +++ b/sources/itstool-2.0.7.tar.bz2.sha256 @@ -0,0 +1 @@ +6b9a7cd29a12bb95598f5750e8763cee78836a1a207f85b74d8b3275b27e87ca itstool-2.0.7.tar.bz2 diff --git a/sources/libassuan-2.5.4.tar.bz2.sha256 b/sources/libassuan-2.5.4.tar.bz2.sha256 deleted file mode 100644 index a3b44e0a..00000000 --- a/sources/libassuan-2.5.4.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -c080ee96b3bd519edd696cfcebdecf19a3952189178db9887be713ccbcb5fbf0 libassuan-2.5.4.tar.bz2 diff --git a/sources/libassuan-2.5.5.tar.bz2.sha256 b/sources/libassuan-2.5.5.tar.bz2.sha256 new file mode 100644 index 00000000..d34a2c0d --- /dev/null +++ b/sources/libassuan-2.5.5.tar.bz2.sha256 @@ -0,0 +1 @@ +8e8c2fcc982f9ca67dcbb1d95e2dc746b1739a4668bc20b3a3c5be632edb34e4 libassuan-2.5.5.tar.bz2 diff --git a/sources/libcap-2.60.tar.gz.sha256 b/sources/libcap-2.60.tar.gz.sha256 deleted file mode 100644 index cc2c12db..00000000 --- a/sources/libcap-2.60.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -b112f716dc0407e06b8d775b3805eb22c5977950631b6477d212b8e3c1a75b05 libcap-2.60.tar.gz diff --git a/sources/libcap-2.62.tar.gz.sha256 b/sources/libcap-2.62.tar.gz.sha256 new file mode 100644 index 00000000..0c816283 --- /dev/null +++ b/sources/libcap-2.62.tar.gz.sha256 @@ -0,0 +1 @@ +dbafebc2a19413dddf45c1e2c28dee5464e1390a2d87c9e2c573b6c5821cbfb7 libcap-2.62.tar.gz diff --git a/sources/libgcrypt-1.9.1.tar.bz2.sha256 b/sources/libgcrypt-1.9.1.tar.bz2.sha256 deleted file mode 100644 index 8f74fa95..00000000 --- a/sources/libgcrypt-1.9.1.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -c5a67a8b9b2bd370fb415ed1ee31c7172e5683076493cf4a3678a0fbdf0265d9 libgcrypt-1.9.1.tar.bz2 diff --git a/sources/libgcrypt-1.9.4.tar.bz2.sha256 b/sources/libgcrypt-1.9.4.tar.bz2.sha256 new file mode 100644 index 00000000..c0521e27 --- /dev/null +++ b/sources/libgcrypt-1.9.4.tar.bz2.sha256 @@ -0,0 +1 @@ +ea849c83a72454e3ed4267697e8ca03390aee972ab421e7df69dfe42b65caaf7 libgcrypt-1.9.4.tar.bz2 diff --git a/sources/libgpg-error-1.41.tar.bz2.sha256 b/sources/libgpg-error-1.41.tar.bz2.sha256 deleted file mode 100644 index d246c91a..00000000 --- a/sources/libgpg-error-1.41.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -64b078b45ac3c3003d7e352a5e05318880a5778c42331ce1ef33d1a0d9922742 libgpg-error-1.41.tar.bz2 diff --git a/sources/libgpg-error-1.43.tar.bz2.sha256 b/sources/libgpg-error-1.43.tar.bz2.sha256 new file mode 100644 index 00000000..0808bfa1 --- /dev/null +++ b/sources/libgpg-error-1.43.tar.bz2.sha256 @@ -0,0 +1 @@ +a9ab83ca7acc442a5bd846a75b920285ff79bdb4e3d34aa382be88ed2c3aebaf libgpg-error-1.43.tar.bz2 diff --git a/sources/libidn2-2.3.1.tar.gz.sha256 b/sources/libidn2-2.3.1.tar.gz.sha256 deleted file mode 100644 index ac3de0d6..00000000 --- a/sources/libidn2-2.3.1.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -8af684943836b8b53965d5f5b6714ef13c26c91eaa36ce7d242e3d21f5d40f2d libidn2-2.3.1.tar.gz diff --git a/sources/libidn2-2.3.2.tar.gz.sha256 b/sources/libidn2-2.3.2.tar.gz.sha256 new file mode 100644 index 00000000..f95b87c5 --- /dev/null +++ b/sources/libidn2-2.3.2.tar.gz.sha256 @@ -0,0 +1 @@ +76940cd4e778e8093579a9d195b25fff5e936e9dc6242068528b437a76764f91 libidn2-2.3.2.tar.gz diff --git a/sources/libjpeg-turbo-2.1.1.tar.gz.sha256 b/sources/libjpeg-turbo-2.1.1.tar.gz.sha256 deleted file mode 100644 index ebef1f2d..00000000 --- a/sources/libjpeg-turbo-2.1.1.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -b76aaedefb71ba882cbad4e9275b30c2ae493e3195be0a099425b5c6b99bd510 libjpeg-turbo-2.1.1.tar.gz diff --git a/sources/libjpeg-turbo-2.1.2.tar.gz.sha256 b/sources/libjpeg-turbo-2.1.2.tar.gz.sha256 new file mode 100644 index 00000000..ad75fe25 --- /dev/null +++ b/sources/libjpeg-turbo-2.1.2.tar.gz.sha256 @@ -0,0 +1 @@ +09b96cb8cbff9ea556a9c2d173485fd19488844d55276ed4f42240e1e2073ce5 libjpeg-turbo-2.1.2.tar.gz diff --git a/sources/libksba-1.5.0.tar.bz2.sha256 b/sources/libksba-1.5.0.tar.bz2.sha256 deleted file mode 100644 index d5853bea..00000000 --- a/sources/libksba-1.5.0.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -ae4af129216b2d7fdea0b5bf2a788cd458a79c983bb09a43f4d525cc87aba0ba libksba-1.5.0.tar.bz2 diff --git a/sources/libksba-1.6.0.tar.bz2.sha256 b/sources/libksba-1.6.0.tar.bz2.sha256 new file mode 100644 index 00000000..735a5b79 --- /dev/null +++ b/sources/libksba-1.6.0.tar.bz2.sha256 @@ -0,0 +1 @@ +dad683e6f2d915d880aa4bed5cea9a115690b8935b78a1bbe01669189307a48b libksba-1.6.0.tar.bz2 diff --git a/sources/libpipeline-1.5.3.tar.gz.sha256 b/sources/libpipeline-1.5.3.tar.gz.sha256 deleted file mode 100644 index 255ca205..00000000 --- a/sources/libpipeline-1.5.3.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -5dbf08faf50fad853754293e57fd4e6c69bb8e486f176596d682c67e02a0adb0 libpipeline-1.5.3.tar.gz diff --git a/sources/libpipeline-1.5.4.tar.gz.sha256 b/sources/libpipeline-1.5.4.tar.gz.sha256 new file mode 100644 index 00000000..757d0621 --- /dev/null +++ b/sources/libpipeline-1.5.4.tar.gz.sha256 @@ -0,0 +1 @@ +db785bddba0a37ef14b4ef82ae2d18b8824e6983dfb9910319385e28df3f1a9c libpipeline-1.5.4.tar.gz diff --git a/sources/libsigsegv-2.13.tar.gz.sha256 b/sources/libsigsegv-2.13.tar.gz.sha256 deleted file mode 100644 index bbf41005..00000000 --- a/sources/libsigsegv-2.13.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -be78ee4176b05f7c75ff03298d84874db90f4b6c9d5503f0da1226b3a3c48119 libsigsegv-2.13.tar.gz diff --git a/sources/libsigsegv-2.14.tar.gz.sha256 b/sources/libsigsegv-2.14.tar.gz.sha256 new file mode 100644 index 00000000..d9e976a8 --- /dev/null +++ b/sources/libsigsegv-2.14.tar.gz.sha256 @@ -0,0 +1 @@ +cdac3941803364cf81a908499beb79c200ead60b6b5b40cad124fd1e06caa295 libsigsegv-2.14.tar.gz diff --git a/sources/libtasn1-4.17.0.tar.gz.sha256 b/sources/libtasn1-4.17.0.tar.gz.sha256 deleted file mode 100644 index 636023e1..00000000 --- a/sources/libtasn1-4.17.0.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -ece7551cea7922b8e10d7ebc70bc2248d1fdd73351646a2d6a8d68a9421c45a5 libtasn1-4.17.0.tar.gz diff --git a/sources/libtasn1-4.18.0.tar.gz.sha256 b/sources/libtasn1-4.18.0.tar.gz.sha256 new file mode 100644 index 00000000..04043a9a --- /dev/null +++ b/sources/libtasn1-4.18.0.tar.gz.sha256 @@ -0,0 +1 @@ +4365c154953563d64c67a024b607d1ee75c6db76e0d0f65709ea80a334cd1898 libtasn1-4.18.0.tar.gz diff --git a/sources/libthai-0.1.28.tar.xz.sha256 b/sources/libthai-0.1.28.tar.xz.sha256 deleted file mode 100644 index 7d1f2a63..00000000 --- a/sources/libthai-0.1.28.tar.xz.sha256 +++ /dev/null @@ -1 +0,0 @@ -ffe0a17b4b5aa11b153c15986800eca19f6c93a4025ffa5cf2cab2dcdf1ae911 libthai-0.1.28.tar.xz diff --git a/sources/libthai-0.1.29.tar.xz.sha256 b/sources/libthai-0.1.29.tar.xz.sha256 new file mode 100644 index 00000000..aa535361 --- /dev/null +++ b/sources/libthai-0.1.29.tar.xz.sha256 @@ -0,0 +1 @@ +fc80cc7dcb50e11302b417cebd24f2d30a8b987292e77e003267b9100d0f4bcd libthai-0.1.29.tar.xz diff --git a/sources/libunistring-0.9.10.tar.gz.sha256 b/sources/libunistring-0.9.10.tar.gz.sha256 deleted file mode 100644 index 705767ad..00000000 --- a/sources/libunistring-0.9.10.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -a82e5b333339a88ea4608e4635479a1cfb2e01aafb925e1290b65710d43f610b libunistring-0.9.10.tar.gz diff --git a/sources/libunistring-1.0.tar.gz.sha256 b/sources/libunistring-1.0.tar.gz.sha256 new file mode 100644 index 00000000..49af1114 --- /dev/null +++ b/sources/libunistring-1.0.tar.gz.sha256 @@ -0,0 +1 @@ +3c0184c0e492d7c208ce31d25dd1d2c58f0c3ed6cbbe032c5b248cddad318544 libunistring-1.0.tar.gz diff --git a/sources/libuv-v1.42.0.tar.gz.sha256 b/sources/libuv-v1.42.0.tar.gz.sha256 deleted file mode 100644 index df79c9a6..00000000 --- a/sources/libuv-v1.42.0.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -43129625155a8aed796ebe90b8d4c990a73985ec717de2b2d5d3a23cfe4deb72 libuv-v1.42.0.tar.gz diff --git a/sources/libuv-v1.43.0.tar.gz.sha256 b/sources/libuv-v1.43.0.tar.gz.sha256 new file mode 100644 index 00000000..603c427e --- /dev/null +++ b/sources/libuv-v1.43.0.tar.gz.sha256 @@ -0,0 +1 @@ +90d72bb7ae18de2519d0cac70eb89c319351146b90cd3f91303a492707e693a4 libuv-v1.43.0.tar.gz diff --git a/sources/meson-0.59.1.tar.gz.sha256 b/sources/meson-0.59.1.tar.gz.sha256 deleted file mode 100644 index 9cee8b80..00000000 --- a/sources/meson-0.59.1.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -db586a451650d46bbe10984a87b79d9bcdc1caebf38d8e189f8848f8d502356d meson-0.59.1.tar.gz diff --git a/sources/meson-0.61.0.tar.gz.sha256 b/sources/meson-0.61.0.tar.gz.sha256 new file mode 100644 index 00000000..0de29fc9 --- /dev/null +++ b/sources/meson-0.61.0.tar.gz.sha256 @@ -0,0 +1 @@ +ea9f33246b1f23f02e90a50e75e0f41e526f6dabf0c24f3e00e27a3f5abdc35c meson-0.61.0.tar.gz diff --git a/sources/pinentry-1.1.0.tar.bz2.sha256 b/sources/pinentry-1.1.0.tar.bz2.sha256 deleted file mode 100644 index 6a0f2277..00000000 --- a/sources/pinentry-1.1.0.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -68076686fa724a290ea49cdf0d1c0c1500907d1b759a3bcbfbec0293e8f56570 pinentry-1.1.0.tar.bz2 diff --git a/sources/pinentry-1.2.0.tar.bz2.sha256 b/sources/pinentry-1.2.0.tar.bz2.sha256 new file mode 100644 index 00000000..aa76ffc5 --- /dev/null +++ b/sources/pinentry-1.2.0.tar.bz2.sha256 @@ -0,0 +1 @@ +10072045a3e043d0581f91cd5676fcac7ffee957a16636adedaa4f583a616470 pinentry-1.2.0.tar.bz2 diff --git a/sources/rpcsvc-proto-1.4.2.tar.xz.sha256 b/sources/rpcsvc-proto-1.4.2.tar.xz.sha256 deleted file mode 100644 index 4d67e115..00000000 --- a/sources/rpcsvc-proto-1.4.2.tar.xz.sha256 +++ /dev/null @@ -1 +0,0 @@ -678851b9f7ddf4410d2859c12016b65a6dd1a0728d478f18aeb54d165352f17c rpcsvc-proto-1.4.2.tar.xz diff --git a/sources/rpcsvc-proto-1.4.3.tar.xz.sha256 b/sources/rpcsvc-proto-1.4.3.tar.xz.sha256 new file mode 100644 index 00000000..e6238f08 --- /dev/null +++ b/sources/rpcsvc-proto-1.4.3.tar.xz.sha256 @@ -0,0 +1 @@ +69315e94430f4e79c74d43422f4a36e6259e97e67e2677b2c7d7060436bd99b1 rpcsvc-proto-1.4.3.tar.xz diff --git a/sources/setuptools-51.1.2.tar.gz.sha256 b/sources/setuptools-51.1.2.tar.gz.sha256 deleted file mode 100644 index 4ae2112b..00000000 --- a/sources/setuptools-51.1.2.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -4fa149145ba5dcd4aaa89912ec92393a31170eaf17fe0268b1429538bad1f85a setuptools-51.1.2.tar.gz diff --git a/sources/setuptools-60.5.0.tar.gz.sha256 b/sources/setuptools-60.5.0.tar.gz.sha256 new file mode 100644 index 00000000..75da0dcd --- /dev/null +++ b/sources/setuptools-60.5.0.tar.gz.sha256 @@ -0,0 +1 @@ +2404879cda71495fc4d5cbc445ed52fdaddf352b36e40be8dcc63147cb4edabe setuptools-60.5.0.tar.gz diff --git a/sources/six-1.15.0.tar.gz.sha256 b/sources/six-1.15.0.tar.gz.sha256 deleted file mode 100644 index c85fa0d7..00000000 --- a/sources/six-1.15.0.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259 six-1.15.0.tar.gz diff --git a/sources/six-1.16.0.tar.gz.sha256 b/sources/six-1.16.0.tar.gz.sha256 new file mode 100644 index 00000000..ea2a88ae --- /dev/null +++ b/sources/six-1.16.0.tar.gz.sha256 @@ -0,0 +1 @@ +1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 six-1.16.0.tar.gz diff --git a/sources/sqlite-autoconf-3340000.tar.gz.sha256 b/sources/sqlite-autoconf-3340000.tar.gz.sha256 deleted file mode 100644 index 0ad694b2..00000000 --- a/sources/sqlite-autoconf-3340000.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -bf6db7fae37d51754737747aaaf413b4d6b3b5fbacd52bdb2d0d6e5b2edd9aee sqlite-autoconf-3340000.tar.gz diff --git a/sources/sqlite-autoconf-3370200.tar.gz.sha256 b/sources/sqlite-autoconf-3370200.tar.gz.sha256 new file mode 100644 index 00000000..7d8e2e75 --- /dev/null +++ b/sources/sqlite-autoconf-3370200.tar.gz.sha256 @@ -0,0 +1 @@ +4089a8d9b467537b3f246f217b84cd76e00b1d1a971fe5aca1e30e230e46b2d8 sqlite-autoconf-3370200.tar.gz diff --git a/sources/strace-5.14.tar.xz.sha256 b/sources/strace-5.14.tar.xz.sha256 deleted file mode 100644 index 00f90e84..00000000 --- a/sources/strace-5.14.tar.xz.sha256 +++ /dev/null @@ -1 +0,0 @@ -901bee6db5e17debad4530dd9ffb4dc9a96c4a656edbe1c3141b7cb307b11e73 strace-5.14.tar.xz diff --git a/sources/strace-5.16.tar.xz.sha256 b/sources/strace-5.16.tar.xz.sha256 new file mode 100644 index 00000000..d382f8ef --- /dev/null +++ b/sources/strace-5.16.tar.xz.sha256 @@ -0,0 +1 @@ +dc7db230ff3e57c249830ba94acab2b862da1fcaac55417e9b85041a833ca285 strace-5.16.tar.xz diff --git a/sources/sysklogd-2.2.1.tar.gz.sha256 b/sources/sysklogd-2.2.1.tar.gz.sha256 deleted file mode 100644 index 9199a1f4..00000000 --- a/sources/sysklogd-2.2.1.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -a93b7ad6a615336f030d8a3257544cff1644908af6a12c65f65482f27bd39ca9 sysklogd-2.2.1.tar.gz diff --git a/sources/sysklogd-2.3.0.tar.gz.sha256 b/sources/sysklogd-2.3.0.tar.gz.sha256 new file mode 100644 index 00000000..8b34144e --- /dev/null +++ b/sources/sysklogd-2.3.0.tar.gz.sha256 @@ -0,0 +1 @@ +9a410b484713d9600c820d8113f2d80cb14708328c908b1a28e8b7b31fd54f57 sysklogd-2.3.0.tar.gz diff --git a/sources/sysvinit-2.99.tar.xz.sha256 b/sources/sysvinit-2.99.tar.xz.sha256 deleted file mode 100644 index 17f63d68..00000000 --- a/sources/sysvinit-2.99.tar.xz.sha256 +++ /dev/null @@ -1 +0,0 @@ -b05c3677bb698afe64c997968b00c49b2a9bd320ce963523230ee7ea41197757 sysvinit-2.99.tar.xz diff --git a/sources/sysvinit-3.01.tar.xz.sha256 b/sources/sysvinit-3.01.tar.xz.sha256 new file mode 100644 index 00000000..77e8c6a9 --- /dev/null +++ b/sources/sysvinit-3.01.tar.xz.sha256 @@ -0,0 +1 @@ +68b11a4772cdacce5fb65a4cbead324a2ce3999d138b4ff61dc2d59e57ef5793 sysvinit-3.01.tar.xz diff --git a/sources/tarlz-0.21.tar.lz.sha256 b/sources/tarlz-0.21.tar.lz.sha256 deleted file mode 100644 index 4c17bf44..00000000 --- a/sources/tarlz-0.21.tar.lz.sha256 +++ /dev/null @@ -1 +0,0 @@ -0f972112dd3f126a394d5a04107695ccbbb9e603e7b193367bd1714607e0adf4 tarlz-0.21.tar.lz diff --git a/sources/tarlz-0.22.tar.lz.sha256 b/sources/tarlz-0.22.tar.lz.sha256 new file mode 100644 index 00000000..802849eb --- /dev/null +++ b/sources/tarlz-0.22.tar.lz.sha256 @@ -0,0 +1 @@ +fccf7226fa24b55d326cab13f76ea349bec446c5a8df71a46d343099a05091dc tarlz-0.22.tar.lz diff --git a/sources/tcl8.6.11-src.tar.gz.sha256 b/sources/tcl8.6.11-src.tar.gz.sha256 deleted file mode 100644 index 49453c20..00000000 --- a/sources/tcl8.6.11-src.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -8c0486668586672c5693d7d95817cb05a18c5ecca2f40e2836b9578064088258 tcl8.6.11-src.tar.gz diff --git a/sources/tcl8.6.12-src.tar.gz.sha256 b/sources/tcl8.6.12-src.tar.gz.sha256 new file mode 100644 index 00000000..c6c57efc --- /dev/null +++ b/sources/tcl8.6.12-src.tar.gz.sha256 @@ -0,0 +1 @@ +26c995dd0f167e48b11961d891ee555f680c175f7173ff8cb829f4ebcde4c1a6 tcl8.6.12-src.tar.gz diff --git a/sources/tk8.6.11.1-src.tar.gz.sha256 b/sources/tk8.6.11.1-src.tar.gz.sha256 deleted file mode 100644 index 4a6d50fc..00000000 --- a/sources/tk8.6.11.1-src.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -006cab171beeca6a968b6d617588538176f27be232a2b334a0e96173e89909be tk8.6.11.1-src.tar.gz diff --git a/sources/tk8.6.12-src.tar.gz.sha256 b/sources/tk8.6.12-src.tar.gz.sha256 new file mode 100644 index 00000000..50049209 --- /dev/null +++ b/sources/tk8.6.12-src.tar.gz.sha256 @@ -0,0 +1 @@ +12395c1f3fcb6bed2938689f797ea3cdf41ed5cb6c4766eec8ac949560310630 tk8.6.12-src.tar.gz diff --git a/sources/vala-0.54.1.tar.xz.sha256 b/sources/vala-0.54.1.tar.xz.sha256 deleted file mode 100644 index 727a856d..00000000 --- a/sources/vala-0.54.1.tar.xz.sha256 +++ /dev/null @@ -1 +0,0 @@ -5dde77ac86f0633cb78a1eba7399edc77d5bbfe1e830c1203c51d594a169904a vala-0.54.1.tar.xz diff --git a/sources/vala-0.54.6.tar.xz.sha256 b/sources/vala-0.54.6.tar.xz.sha256 new file mode 100644 index 00000000..0f7a1d69 --- /dev/null +++ b/sources/vala-0.54.6.tar.xz.sha256 @@ -0,0 +1 @@ +49d60d96a3fdf6c4287397442bc6d6d95bf40aa7df678ee49128c4b11ba6e469 vala-0.54.6.tar.xz diff --git a/sources/valgrind-3.17.0.tar.bz2.sha256 b/sources/valgrind-3.17.0.tar.bz2.sha256 deleted file mode 100644 index 4560165a..00000000 --- a/sources/valgrind-3.17.0.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -ad3aec668e813e40f238995f60796d9590eee64a16dff88421430630e69285a2 valgrind-3.17.0.tar.bz2 diff --git a/sources/valgrind-3.18.1.tar.bz2.sha256 b/sources/valgrind-3.18.1.tar.bz2.sha256 new file mode 100644 index 00000000..6aaf46e0 --- /dev/null +++ b/sources/valgrind-3.18.1.tar.bz2.sha256 @@ -0,0 +1 @@ +00859aa13a772eddf7822225f4b46ee0d39afbe071d32778da4d99984081f7f5 valgrind-3.18.1.tar.bz2 diff --git a/stages/0/01-binutils b/stages/0/01-binutils index 8ec3436b..f8419bd7 100755 --- a/stages/0/01-binutils +++ b/stages/0/01-binutils @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -version=2.36.1 +version=2.35.2 cd -- "$TMPDIR" rm -rf binutils-${version} @@ -23,6 +23,53 @@ unpack "${worktree}/sources/binutils-${version}.tar.lz" # Build instructions cd binutils-${version} +# Apply patches from Fedora (Nick Clifton) + +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-2.25-version.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-export-demangle.h.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-2.22.52.0.4-no-config-h-check.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-2.29-filename-in-error-messages.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-2.29-revert-PLT-elision.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-readelf-other-sym-info.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-2.27-aarch64-ifunc.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-do-not-link-with-static-libstdc++.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-attach-to-group.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-special-sections-in-groups.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-fix-testsuite-failures.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gold-mismatched-section-flags.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-CVE-2019-1010204.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gold-warn-unsupported.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-s390-build.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-config.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-warnings.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gcc-10-fixes.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-add-sym-cache-to-elf-link-hash.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-elf-add-objects.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-aarch64-condbranch-relocs.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-ppc-annobin-disassembly.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-strip-merge.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-plugin-as-needed.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-recursive-debuglink-following.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-SHF_LINK_ORDER.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-duplicate-sections.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-use-long-long.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gold-gnu-properties.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-testsuite-failures.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-CVE-2021-20197.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-ld-DWARF-5-sections.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-s390-arch14-insns.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-ppc64le-note-merge.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-readelf-no-warn-gaps.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-unexpected-form-20.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-CVE-2021-20284.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-extend-s390-arch14-support.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-CVE-2021-3487.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-CVE-2020-35448.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-dwarf-5-dir0.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gas-Use-the-directory-name-in-.file-0.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils.unicode.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gas-multibyte-warnings.patch" + patch -Np1 -i "${worktree}/patches/binutils/branch-updates.diff" # Build in a separate directory diff --git a/stages/0/03-gcc-static b/stages/0/03-gcc-static index 3fc71f90..73a75538 100755 --- a/stages/0/03-gcc-static +++ b/stages/0/03-gcc-static @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -version=11-20220101 +version=10-20220114 # Prerequisites gmp_version=6.2.1 @@ -64,14 +64,15 @@ cp -f "${worktree}/archive/common/config.guess" isl/config.guess cp -f "${worktree}/archive/common/config.sub" isl/config.sub # Apply specific patches for the support in musl. -# https://port70.net/~nsz/musl/gcc-11.1.0/ +# https://port70.net/~nsz/musl/gcc-10.3.0/ -patch -Np1 -i "${worktree}/patches/gcc/11/0002-posix_memalign.patch" -patch -Np1 -i "${worktree}/patches/gcc/11/0003-j2.patch" -patch -Np1 -i "${worktree}/patches/gcc/11/0004-static-pie.patch" -patch -Np1 -i "${worktree}/patches/gcc/11/0005-m68k-sqrt.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/0002-posix_memalign.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/0003-j2.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/0004-static-pie.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/0005-libstdc-futex-time64.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/0006-m68k-sqrt.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/extra-musl_libssp.patch" -patch -Np1 -i "${worktree}/patches/gcc/11/extra-musl_libssp.patch" patch -Np1 -i "${worktree}/patches/gcc/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch" # Build in a separate directory diff --git a/stages/0/04-musl b/stages/0/04-musl index 2f7f3f63..6ca37fb4 100755 --- a/stages/0/04-musl +++ b/stages/0/04-musl @@ -1,6 +1,6 @@ # Build script for musl. # -# Copyright (c) 2014-2021 Matias Fonzo, . +# Copyright (c) 2014-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/stages/0/05-gcc-final b/stages/0/05-gcc-final index 0e973296..3eecc153 100755 --- a/stages/0/05-gcc-final +++ b/stages/0/05-gcc-final @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -version=11-20220101 +version=10-20220114 # Prerequisites gmp_version=6.2.1 @@ -64,14 +64,15 @@ cp -f "${worktree}/archive/common/config.guess" isl/config.guess cp -f "${worktree}/archive/common/config.sub" isl/config.sub # Apply specific patches for the support in musl. -# https://port70.net/~nsz/musl/gcc-11.1.0/ +# https://port70.net/~nsz/musl/gcc-10.3.0/ -patch -Np1 -i "${worktree}/patches/gcc/11/0002-posix_memalign.patch" -patch -Np1 -i "${worktree}/patches/gcc/11/0003-j2.patch" -patch -Np1 -i "${worktree}/patches/gcc/11/0004-static-pie.patch" -patch -Np1 -i "${worktree}/patches/gcc/11/0005-m68k-sqrt.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/0002-posix_memalign.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/0003-j2.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/0004-static-pie.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/0005-libstdc-futex-time64.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/0006-m68k-sqrt.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/extra-musl_libssp.patch" -patch -Np1 -i "${worktree}/patches/gcc/11/extra-musl_libssp.patch" patch -Np1 -i "${worktree}/patches/gcc/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch" # Build in a separate directory diff --git a/stages/1/02-musl b/stages/1/02-musl index debbe460..601a5ff9 100755 --- a/stages/1/02-musl +++ b/stages/1/02-musl @@ -1,6 +1,6 @@ # Build script for musl. # -# Copyright (c) 2014-2021 Matias Fonzo, . +# Copyright (c) 2014-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/stages/1/05-binutils b/stages/1/05-binutils index 8f42f2b1..3819fe51 100755 --- a/stages/1/05-binutils +++ b/stages/1/05-binutils @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -version=2.36.1 +version=2.35.2 cd -- "$TMPDIR" rm -rf binutils-${version} @@ -24,10 +24,51 @@ unpack "${worktree}/sources/binutils-${version}.tar.lz" cd binutils-${version} # Apply patches from Fedora (Nick Clifton) -patch -Np1 -i "${worktree}/patches/binutils/binutils-export-demangle.h.patch" -patch -Np1 -i "${worktree}/patches/binutils/binutils-no-config-h-check.patch" -patch -Np1 -i "${worktree}/patches/binutils/binutils-gold-warn-unsupported.patch" -patch -Np1 -i "${worktree}/patches/binutils/binutils-use-long-long.patch" + +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-2.25-version.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-export-demangle.h.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-2.22.52.0.4-no-config-h-check.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-2.29-filename-in-error-messages.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-2.29-revert-PLT-elision.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-readelf-other-sym-info.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-2.27-aarch64-ifunc.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-do-not-link-with-static-libstdc++.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-attach-to-group.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-special-sections-in-groups.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-fix-testsuite-failures.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gold-mismatched-section-flags.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-CVE-2019-1010204.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gold-warn-unsupported.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-s390-build.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-config.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-warnings.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gcc-10-fixes.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-add-sym-cache-to-elf-link-hash.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-elf-add-objects.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-aarch64-condbranch-relocs.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-ppc-annobin-disassembly.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-strip-merge.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-plugin-as-needed.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-recursive-debuglink-following.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-SHF_LINK_ORDER.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-duplicate-sections.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-use-long-long.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gold-gnu-properties.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-testsuite-failures.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-CVE-2021-20197.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-ld-DWARF-5-sections.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-s390-arch14-insns.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-ppc64le-note-merge.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-readelf-no-warn-gaps.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-unexpected-form-20.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-CVE-2021-20284.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-extend-s390-arch14-support.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-CVE-2021-3487.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-CVE-2020-35448.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-dwarf-5-dir0.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gas-Use-the-directory-name-in-.file-0.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils.unicode.patch" +patch -Np1 -i "${worktree}/patches/binutils/2.35/binutils-gas-multibyte-warnings.patch" patch -Np1 -i "${worktree}/patches/binutils/branch-updates.diff" @@ -60,6 +101,7 @@ CFLAGS="$BTCFLAGS" CXXFLAGS="$BTCXXFLAGS" LDFLAGS="$BTLDFLAGS" \ --disable-ppl-version-check \ --disable-cloog-version-check \ --with-lib-path=/tools/lib \ + --with-pic \ $multilib_options make -j${jobs} MAKEINFO="true" diff --git a/stages/1/06-gcc b/stages/1/06-gcc index 95d4f175..26d0f9fe 100755 --- a/stages/1/06-gcc +++ b/stages/1/06-gcc @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -version=11-20220101 +version=10-20220114 # Prerequisites gmp_version=6.2.1 @@ -35,26 +35,28 @@ unpack "${worktree}/sources/gcc-${version}.tar.xz" \ # Build instructions cd gcc-${version} -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80196 -patch -Np1 -i "${worktree}/patches/gcc/gcc-11-bug80196.patch" - # Apply specific patches for the support in musl. -# https://port70.net/~nsz/musl/gcc-11.1.0/ - -patch -Np1 -i "${worktree}/patches/gcc/11/0002-posix_memalign.patch" -patch -Np1 -i "${worktree}/patches/gcc/11/0003-j2.patch" -patch -Np1 -i "${worktree}/patches/gcc/11/0004-static-pie.patch" -patch -Np1 -i "${worktree}/patches/gcc/11/0005-m68k-sqrt.patch" +# https://port70.net/~nsz/musl/gcc-10.3.0/ -patch -Np1 -i "${worktree}/patches/gcc/11/extra-relro-in-dragora.patch" -patch -Np1 -i "${worktree}/patches/gcc/11/extra-musl_libssp.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/0002-posix_memalign.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/0003-j2.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/0004-static-pie.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/0005-libstdc-futex-time64.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/0006-m68k-sqrt.patch" +patch -Np1 -i "${worktree}/patches/gcc/10/extra-musl_libssp.patch" # Apply patches from "Alpine Linux" in order to improve the security (Thanks!) +echo "patch1:" patch -Np1 -i "${worktree}/patches/gcc/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch" +echo "patch2:" patch -Np1 -i "${worktree}/patches/gcc/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch" +echo "patch3:" patch -Np1 -i "${worktree}/patches/gcc/0006-Enable-Wformat-and-Wformat-security-by-default.patch" +echo "patch4:" patch -Np1 -i "${worktree}/patches/gcc/0007-Enable-Wtrampolines-by-default.patch" +echo "patch5:" patch -Np1 -i "${worktree}/patches/gcc/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch" +echo "patch6:" patch -Np1 -i "${worktree}/patches/gcc/0020-add-fortify-headers-paths.patch" # Hard code default ld path to look at /tools diff --git a/stages/1/07-file b/stages/1/07-file index 7b8b5b8e..dd46bec5 100755 --- a/stages/1/07-file +++ b/stages/1/07-file @@ -1,6 +1,6 @@ # Build script for file. # -# Copyright (c) 2014-2021 Matias Fonzo, . +# Copyright (c) 2014-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -version=5.40 +version=5.41 cd -- "$TMPDIR" rm -rf file-${version} diff --git a/stages/1/11-perl b/stages/1/11-perl index b0881771..c48e857f 100755 --- a/stages/1/11-perl +++ b/stages/1/11-perl @@ -1,7 +1,7 @@ # Build script for perl and perl-cross. # Perl-cross URL: http://arsv.github.io/perl-cross/ # -# Copyright (c) 2014-2021 Matias Fonzo, . +# Copyright (c) 2014-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/stages/1/15-tarlz b/stages/1/15-tarlz index 0c5839db..a556d705 100755 --- a/stages/1/15-tarlz +++ b/stages/1/15-tarlz @@ -1,6 +1,6 @@ # Build script for tarlz. # -# Copyright (c) 2019-2021 Matias Fonzo, . +# Copyright (c) 2019-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -version=0.21 +version=0.22 cd -- "$TMPDIR" rm -rf tarlz-${version} diff --git a/stages/1/18-busybox b/stages/1/18-busybox index 4a57a568..f7b31528 100755 --- a/stages/1/18-busybox +++ b/stages/1/18-busybox @@ -1,6 +1,6 @@ # Build script for busybox. # -# Copyright (c) 2014-2021 Matias Fonzo, . +# Copyright (c) 2014-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -version=1.33.0 +version=1.35.0 cd -- "$TMPDIR" rm -rf busybox-${version} diff --git a/stages/2/01-busybox b/stages/2/01-busybox index edf13d35..3709570f 100755 --- a/stages/2/01-busybox +++ b/stages/2/01-busybox @@ -1,6 +1,6 @@ # Build script for busybox (liveCD). # -# Copyright (c) 2017-2021 Matias Fonzo, . +# Copyright (c) 2017-2022 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -version=1.33.0 +version=1.35.0 cd -- "$TMPDIR" rm -rf busybox-${version} -- 2.11.4.GIT